Message ID | 20200429053319.113508-1-pmalani@chromium.org (mailing list archive) |
---|---|
State | Mainlined |
Commit | 7990be48ef4d87163940d6c04c349c93f0bd9ae7 |
Headers | show |
Series | usb: typec: mux: intel: Handle alt mode HPD_LVL | expand |
Sorry, didn't compose the Commit message quite right, have sent out v2. Thanks, On Tue, Apr 28, 2020 at 10:34 PM Prashant Malani <pmalani@chromium.org> wrote: > > According to the PMC Type C Subsystem (TCSS) Mux programming guide rev > 0.6, when a device is transitioning to DP Alternate Mode state, if the > HPD_LVL in the status update command VDO is set, the HPD_HIGH field in > the Alternate Mode request “mode_data” field (bit 14) should also be > set. Ensure the bit is correctly handled while issuing the Alternate > Mode request. > > Signed-off-by: Prashant Malani <pmalani@chromium.org> > Fixes: 6701adfa9693 ("usb: typec: driver for Intel PMC mux control") > --- > drivers/usb/typec/mux/intel_pmc_mux.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c > index f5c5e0aef66f..c599112559e7 100644 > --- a/drivers/usb/typec/mux/intel_pmc_mux.c > +++ b/drivers/usb/typec/mux/intel_pmc_mux.c > @@ -157,6 +157,10 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state) > req.mode_data |= (state->mode - TYPEC_STATE_MODAL) << > PMC_USB_ALTMODE_DP_MODE_SHIFT; > > + if (data->status & DP_STATUS_HPD_STATE) > + req.mode_data |= PMC_USB_DP_HPD_LVL << > + PMC_USB_ALTMODE_DP_MODE_SHIFT; > + > return pmc_usb_command(port, (void *)&req, sizeof(req)); > } > > -- > 2.26.2.303.gf8c07b1a785-goog >
diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c index f5c5e0aef66f..c599112559e7 100644 --- a/drivers/usb/typec/mux/intel_pmc_mux.c +++ b/drivers/usb/typec/mux/intel_pmc_mux.c @@ -157,6 +157,10 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state) req.mode_data |= (state->mode - TYPEC_STATE_MODAL) << PMC_USB_ALTMODE_DP_MODE_SHIFT; + if (data->status & DP_STATUS_HPD_STATE) + req.mode_data |= PMC_USB_DP_HPD_LVL << + PMC_USB_ALTMODE_DP_MODE_SHIFT; + return pmc_usb_command(port, (void *)&req, sizeof(req)); }
According to the PMC Type C Subsystem (TCSS) Mux programming guide rev 0.6, when a device is transitioning to DP Alternate Mode state, if the HPD_LVL in the status update command VDO is set, the HPD_HIGH field in the Alternate Mode request “mode_data” field (bit 14) should also be set. Ensure the bit is correctly handled while issuing the Alternate Mode request. Signed-off-by: Prashant Malani <pmalani@chromium.org> Fixes: 6701adfa9693 ("usb: typec: driver for Intel PMC mux control") --- drivers/usb/typec/mux/intel_pmc_mux.c | 4 ++++ 1 file changed, 4 insertions(+)