All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: typec: mux: intel: Handle alt mode HPD_HIGH
@ 2020-04-29  5:44 Prashant Malani
  2020-04-29 12:32 ` Heikki Krogerus
  0 siblings, 1 reply; 2+ messages in thread
From: Prashant Malani @ 2020-04-29  5:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: heikki.krogerus, bleung, Prashant Malani, Greg Kroah-Hartman,
	open list:USB TYPEC CLASS

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_STATE (bit 7) field in the status update command VDO is set to
HPD_HIGH, 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")
---

Changes in v2:
- Clarified the commit message to mention the proper field names.

 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] usb: typec: mux: intel: Handle alt mode HPD_HIGH
  2020-04-29  5:44 [PATCH v2] usb: typec: mux: intel: Handle alt mode HPD_HIGH Prashant Malani
@ 2020-04-29 12:32 ` Heikki Krogerus
  0 siblings, 0 replies; 2+ messages in thread
From: Heikki Krogerus @ 2020-04-29 12:32 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, bleung, Greg Kroah-Hartman, open list:USB TYPEC CLASS

On Tue, Apr 28, 2020 at 10:44:28PM -0700, Prashant Malani 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_STATE (bit 7) field in the status update command VDO is set to
> HPD_HIGH, 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")

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
> 
> Changes in v2:
> - Clarified the commit message to mention the proper field names.
> 
>  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

thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-29 12:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29  5:44 [PATCH v2] usb: typec: mux: intel: Handle alt mode HPD_HIGH Prashant Malani
2020-04-29 12:32 ` Heikki Krogerus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.