linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] usb: typec: mux: intel: Fix DP_HPD_LVL bit field
@ 2020-05-10 21:39 Prashant Malani
  2020-05-11  8:49 ` Lars Melin
  0 siblings, 1 reply; 3+ messages in thread
From: Prashant Malani @ 2020-05-10 21:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: bleung, Prashant Malani, Greg Kroah-Hartman, Heikki Krogerus,
	open list:USB TYPEC CLASS

According to the PMC Type C Subsystem (TCSS) Mux programming guide rev
0.6, the PMC HPD request LVL bit field is bit 4.
Fix the definition here to match the programming guide.

Since this bit field is changing, explicitly define a field for the
HPD_HIGH mode data bit.

Signed-off-by: Prashant Malani <pmalani@chromium.org>
Fixes: 6701adfa9693 ("usb: typec: driver for Intel PMC mux control")
Reviewed-by: Benson Leung <bleung@chromium.org>
---

Changes in v2:
- Fixed bit error in commit message.

 drivers/usb/typec/mux/intel_pmc_mux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
index 67c5139cfa0d..15074aec94eb 100644
--- a/drivers/usb/typec/mux/intel_pmc_mux.c
+++ b/drivers/usb/typec/mux/intel_pmc_mux.c
@@ -63,6 +63,7 @@ enum {
 #define PMC_USB_ALTMODE_DP_MODE_SHIFT	8
 
 /* TBT specific Mode Data bits */
+#define PMC_USB_ALTMODE_HPD_HIGH	BIT(14)
 #define PMC_USB_ALTMODE_TBT_TYPE	BIT(17)
 #define PMC_USB_ALTMODE_CABLE_TYPE	BIT(18)
 #define PMC_USB_ALTMODE_ACTIVE_LINK	BIT(20)
@@ -75,7 +76,7 @@ enum {
 
 /* Display HPD Request bits */
 #define PMC_USB_DP_HPD_IRQ		BIT(5)
-#define PMC_USB_DP_HPD_LVL		BIT(6)
+#define PMC_USB_DP_HPD_LVL		BIT(4)
 
 struct pmc_usb;
 
@@ -158,8 +159,7 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state)
 			 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;
+		req.mode_data |= PMC_USB_ALTMODE_HPD_HIGH;
 
 	return pmc_usb_command(port, (void *)&req, sizeof(req));
 }
-- 
2.26.2.645.ge9eca65c58-goog


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

* Re: [PATCH v2] usb: typec: mux: intel: Fix DP_HPD_LVL bit field
  2020-05-10 21:39 [PATCH v2] usb: typec: mux: intel: Fix DP_HPD_LVL bit field Prashant Malani
@ 2020-05-11  8:49 ` Lars Melin
  2020-05-11  9:18   ` Prashant Malani
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Melin @ 2020-05-11  8:49 UTC (permalink / raw)
  To: Prashant Malani, linux-kernel
  Cc: bleung, Greg Kroah-Hartman, Heikki Krogerus, open list:USB TYPEC CLASS

On 5/11/2020 04:39, Prashant Malani wrote:
> According to the PMC Type C Subsystem (TCSS) Mux programming guide rev
> 0.6, the PMC HPD request LVL bit field is bit 4.
> Fix the definition here to match the programming guide.
> 
> Since this bit field is changing, explicitly define a field for the
> HPD_HIGH mode data bit.
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>
> Fixes: 6701adfa9693 ("usb: typec: driver for Intel PMC mux control")
> Reviewed-by: Benson Leung <bleung@chromium.org>
> ---
> 
> Changes in v2:
> - Fixed bit error in commit message.
> 
>   drivers/usb/typec/mux/intel_pmc_mux.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
> index 67c5139cfa0d..15074aec94eb 100644
> --- a/drivers/usb/typec/mux/intel_pmc_mux.c
> +++ b/drivers/usb/typec/mux/intel_pmc_mux.c
> @@ -63,6 +63,7 @@ enum {
>   #define PMC_USB_ALTMODE_DP_MODE_SHIFT	8
>   
>   /* TBT specific Mode Data bits */
> +#define PMC_USB_ALTMODE_HPD_HIGH	BIT(14)
>   #define PMC_USB_ALTMODE_TBT_TYPE	BIT(17)
>   #define PMC_USB_ALTMODE_CABLE_TYPE	BIT(18)
>   #define PMC_USB_ALTMODE_ACTIVE_LINK	BIT(20)
> @@ -75,7 +76,7 @@ enum {
>   
>   /* Display HPD Request bits */
>   #define PMC_USB_DP_HPD_IRQ		BIT(5)
> -#define PMC_USB_DP_HPD_LVL		BIT(6)
> +#define PMC_USB_DP_HPD_LVL		BIT(4)
>   
Please keep the bits sorted

>   struct pmc_usb;
>   
> @@ -158,8 +159,7 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state)
>   			 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;
> +		req.mode_data |= PMC_USB_ALTMODE_HPD_HIGH;
>   
>   	return pmc_usb_command(port, (void *)&req, sizeof(req));
>   }
> 

Thanks
Lars

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

* Re: [PATCH v2] usb: typec: mux: intel: Fix DP_HPD_LVL bit field
  2020-05-11  8:49 ` Lars Melin
@ 2020-05-11  9:18   ` Prashant Malani
  0 siblings, 0 replies; 3+ messages in thread
From: Prashant Malani @ 2020-05-11  9:18 UTC (permalink / raw)
  To: Lars Melin
  Cc: Linux Kernel Mailing List, Benson Leung, Greg Kroah-Hartman,
	Heikki Krogerus, open list:USB TYPEC CLASS

Hi Lars,

Thanks for reviewing the patch.

On Mon, May 11, 2020 at 1:49 AM Lars Melin <larsm17@gmail.com> wrote:
>
> On 5/11/2020 04:39, Prashant Malani wrote:
> > According to the PMC Type C Subsystem (TCSS) Mux programming guide rev
> > 0.6, the PMC HPD request LVL bit field is bit 4.
> > Fix the definition here to match the programming guide.
> >
> > Since this bit field is changing, explicitly define a field for the
> > HPD_HIGH mode data bit.
> >
> > Signed-off-by: Prashant Malani <pmalani@chromium.org>
> > Fixes: 6701adfa9693 ("usb: typec: driver for Intel PMC mux control")
> > Reviewed-by: Benson Leung <bleung@chromium.org>
> > ---
> >
> > Changes in v2:
> > - Fixed bit error in commit message.
> >
> >   drivers/usb/typec/mux/intel_pmc_mux.c | 6 +++---
> >   1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
> > index 67c5139cfa0d..15074aec94eb 100644
> > --- a/drivers/usb/typec/mux/intel_pmc_mux.c
> > +++ b/drivers/usb/typec/mux/intel_pmc_mux.c
> > @@ -63,6 +63,7 @@ enum {
> >   #define PMC_USB_ALTMODE_DP_MODE_SHIFT       8
> >
> >   /* TBT specific Mode Data bits */
> > +#define PMC_USB_ALTMODE_HPD_HIGH     BIT(14)
> >   #define PMC_USB_ALTMODE_TBT_TYPE    BIT(17)
> >   #define PMC_USB_ALTMODE_CABLE_TYPE  BIT(18)
> >   #define PMC_USB_ALTMODE_ACTIVE_LINK BIT(20)
> > @@ -75,7 +76,7 @@ enum {
> >
> >   /* Display HPD Request bits */
> >   #define PMC_USB_DP_HPD_IRQ          BIT(5)
> > -#define PMC_USB_DP_HPD_LVL           BIT(6)
> > +#define PMC_USB_DP_HPD_LVL           BIT(4)
> >
> Please keep the bits sorted
Sure. Will send a new version of the patch with this change.

Best regards,
>
> >   struct pmc_usb;
> >
> > @@ -158,8 +159,7 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state)
> >                        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;
> > +             req.mode_data |= PMC_USB_ALTMODE_HPD_HIGH;
> >
> >       return pmc_usb_command(port, (void *)&req, sizeof(req));
> >   }
> >
>
> Thanks
> Lars

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

end of thread, other threads:[~2020-05-11  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-10 21:39 [PATCH v2] usb: typec: mux: intel: Fix DP_HPD_LVL bit field Prashant Malani
2020-05-11  8:49 ` Lars Melin
2020-05-11  9:18   ` Prashant Malani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).