public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/4] usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros
@ 2024-02-28 23:20 Jameson Thies
  0 siblings, 0 replies; 5+ messages in thread
From: Jameson Thies @ 2024-02-28 23:20 UTC (permalink / raw)
  To: heikki.krogerus, linux-usb
  Cc: jthies, pmalani, bleung, abhishekpandit, andersson,
	dmitry.baryshkov, fabrice.gasnier, gregkh, hdegoede,
	neil.armstrong, rajaram.regupathy, saranya.gopal, linux-kernel,
	stable, Benson Leung

Clean up UCSI_CABLE_PROP macros by fixing a bitmask shifting error for
plug type and updating the modal support macro for consistent naming.

Fixes: 3cf657f07918 ("usb: typec: ucsi: Remove all bit-fields")
Cc: stable@vger.kernel.org
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Jameson Thies <jthies@google.com>
---
Changes in v3:
- Fixed CC stable.

Changes in v2:
- Tested on usb-testing branch merged with chromeOS 6.8-rc2 kernel.

 drivers/usb/typec/ucsi/ucsi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
index 7e35ffbe0a6f2..469a2baf472e4 100644
--- a/drivers/usb/typec/ucsi/ucsi.h
+++ b/drivers/usb/typec/ucsi/ucsi.h
@@ -259,12 +259,12 @@ struct ucsi_cable_property {
 #define UCSI_CABLE_PROP_FLAG_VBUS_IN_CABLE	BIT(0)
 #define UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE	BIT(1)
 #define UCSI_CABLE_PROP_FLAG_DIRECTIONALITY	BIT(2)
-#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE(_f_)	((_f_) & GENMASK(3, 0))
+#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE(_f_)	(((_f_) & GENMASK(4, 3)) >> 3)
 #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_A	0
 #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_B	1
 #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_C	2
 #define   UCSI_CABLE_PROPERTY_PLUG_OTHER	3
-#define UCSI_CABLE_PROP_MODE_SUPPORT		BIT(5)
+#define UCSI_CABLE_PROP_FLAG_MODE_SUPPORT	BIT(5)
 	u8 latency;
 } __packed;
 
-- 
2.44.0.rc1.240.g4c46232300-goog


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

* [PATCH v3 1/4] usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros
@ 2024-02-29  1:52 Jameson Thies
  2024-02-29  5:52 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Jameson Thies @ 2024-02-29  1:52 UTC (permalink / raw)
  To: heikki.krogerus, linux-usb
  Cc: jthies, pmalani, bleung, abhishekpandit, andersson,
	dmitry.baryshkov, fabrice.gasnier, gregkh, hdegoede,
	neil.armstrong, rajaram.regupathy, saranya.gopal, linux-kernel,
	stable, Benson Leung

Clean up UCSI_CABLE_PROP macros by fixing a bitmask shifting error for
plug type and updating the modal support macro for consistent naming.

Fixes: 3cf657f07918 ("usb: typec: ucsi: Remove all bit-fields")
Cc: stable@vger.kernel.org
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Jameson Thies <jthies@google.com>
---
Changes in v3:
- Fixed CC stable.

Changes in v2:
- Tested on usb-testing branch merged with chromeOS 6.8-rc2 kernel.

 drivers/usb/typec/ucsi/ucsi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
index 7e35ffbe0a6f2..469a2baf472e4 100644
--- a/drivers/usb/typec/ucsi/ucsi.h
+++ b/drivers/usb/typec/ucsi/ucsi.h
@@ -259,12 +259,12 @@ struct ucsi_cable_property {
 #define UCSI_CABLE_PROP_FLAG_VBUS_IN_CABLE	BIT(0)
 #define UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE	BIT(1)
 #define UCSI_CABLE_PROP_FLAG_DIRECTIONALITY	BIT(2)
-#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE(_f_)	((_f_) & GENMASK(3, 0))
+#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE(_f_)	(((_f_) & GENMASK(4, 3)) >> 3)
 #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_A	0
 #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_B	1
 #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_C	2
 #define   UCSI_CABLE_PROPERTY_PLUG_OTHER	3
-#define UCSI_CABLE_PROP_MODE_SUPPORT		BIT(5)
+#define UCSI_CABLE_PROP_FLAG_MODE_SUPPORT	BIT(5)
 	u8 latency;
 } __packed;
 
-- 
2.44.0.rc1.240.g4c46232300-goog


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

* Re: [PATCH v3 1/4] usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros
  2024-02-29  1:52 [PATCH v3 1/4] usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros Jameson Thies
@ 2024-02-29  5:52 ` Greg KH
  2024-02-29 17:29   ` Jameson Thies
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2024-02-29  5:52 UTC (permalink / raw)
  To: Jameson Thies
  Cc: heikki.krogerus, linux-usb, pmalani, bleung, abhishekpandit,
	andersson, dmitry.baryshkov, fabrice.gasnier, hdegoede,
	neil.armstrong, rajaram.regupathy, saranya.gopal, linux-kernel,
	stable, Benson Leung

On Thu, Feb 29, 2024 at 01:52:21AM +0000, Jameson Thies wrote:
> Clean up UCSI_CABLE_PROP macros by fixing a bitmask shifting error for
> plug type and updating the modal support macro for consistent naming.
> 
> Fixes: 3cf657f07918 ("usb: typec: ucsi: Remove all bit-fields")
> Cc: stable@vger.kernel.org
> Reviewed-by: Benson Leung <bleung@chromium.org>
> Reviewed-by: Prashant Malani <pmalani@chromium.org>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Jameson Thies <jthies@google.com>
> ---
> Changes in v3:
> - Fixed CC stable.

I see two different copies of this patch on the list, which one is
correct?

And none of them are properly "threaded", so that our tools can't pick
them up at once, can you use 'git send-email' to do this, or do replies
by hand if you aren't using it, so that things will work properly on our
end?  Right now all of these look like individual changes :(

thanks,

greg k-h

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

* Re: [PATCH v3 1/4] usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros
  2024-02-29  5:52 ` Greg KH
@ 2024-02-29 17:29   ` Jameson Thies
  0 siblings, 0 replies; 5+ messages in thread
From: Jameson Thies @ 2024-02-29 17:29 UTC (permalink / raw)
  To: Greg KH
  Cc: heikki.krogerus, linux-usb, pmalani, bleung, abhishekpandit,
	andersson, dmitry.baryshkov, fabrice.gasnier, hdegoede,
	neil.armstrong, rajaram.regupathy, saranya.gopal, linux-kernel,
	stable, Benson Leung

Hi Greg,
sorry about the confusing emails. The most recent "--no-thread" patch
was intended to be the correct one. I'll resend the v3 series with proper
threading.

Thanks,
Jameson

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

* [PATCH v3 1/4] usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros
  2024-02-29 23:26 [PATCH v3 0/4] usb: typec: ucsi: Expand SOP/SOP' Discovery Jameson Thies
@ 2024-02-29 23:26 ` Jameson Thies
  0 siblings, 0 replies; 5+ messages in thread
From: Jameson Thies @ 2024-02-29 23:26 UTC (permalink / raw)
  To: heikki.krogerus, linux-usb
  Cc: jthies, pmalani, bleung, abhishekpandit, andersson,
	dmitry.baryshkov, fabrice.gasnier, gregkh, hdegoede,
	neil.armstrong, rajaram.regupathy, saranya.gopal, linux-kernel,
	stable, Benson Leung

Clean up UCSI_CABLE_PROP macros by fixing a bitmask shifting error for
plug type and updating the modal support macro for consistent naming.

Fixes: 3cf657f07918 ("usb: typec: ucsi: Remove all bit-fields")
Cc: stable@vger.kernel.org
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Jameson Thies <jthies@google.com>
---
Changes in v3:
- Fixed CC stable.

Changes in v2:
- Tested on usb-testing branch merged with chromeOS 6.8-rc2 kernel.

 drivers/usb/typec/ucsi/ucsi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
index 7e35ffbe0a6f2..469a2baf472e4 100644
--- a/drivers/usb/typec/ucsi/ucsi.h
+++ b/drivers/usb/typec/ucsi/ucsi.h
@@ -259,12 +259,12 @@ struct ucsi_cable_property {
 #define UCSI_CABLE_PROP_FLAG_VBUS_IN_CABLE	BIT(0)
 #define UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE	BIT(1)
 #define UCSI_CABLE_PROP_FLAG_DIRECTIONALITY	BIT(2)
-#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE(_f_)	((_f_) & GENMASK(3, 0))
+#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE(_f_)	(((_f_) & GENMASK(4, 3)) >> 3)
 #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_A	0
 #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_B	1
 #define   UCSI_CABLE_PROPERTY_PLUG_TYPE_C	2
 #define   UCSI_CABLE_PROPERTY_PLUG_OTHER	3
-#define UCSI_CABLE_PROP_MODE_SUPPORT		BIT(5)
+#define UCSI_CABLE_PROP_FLAG_MODE_SUPPORT	BIT(5)
 	u8 latency;
 } __packed;
 
-- 
2.44.0.rc1.240.g4c46232300-goog


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

end of thread, other threads:[~2024-02-29 23:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-29  1:52 [PATCH v3 1/4] usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros Jameson Thies
2024-02-29  5:52 ` Greg KH
2024-02-29 17:29   ` Jameson Thies
  -- strict thread matches above, loose matches on Subject: below --
2024-02-29 23:26 [PATCH v3 0/4] usb: typec: ucsi: Expand SOP/SOP' Discovery Jameson Thies
2024-02-29 23:26 ` [PATCH v3 1/4] usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros Jameson Thies
2024-02-28 23:20 Jameson Thies

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox