Skip to contentSkip to conversation

phy: fsl-imx8mq-usb: fix typec orientation switch when built as module

PATCH Applied Franz Schnyder 5 participants 5 messages Nov 26, 2025 – Dec 23, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 phy: fsl-imx8mq-usb: fix typec orientation switch when built as module

From: Franz Schnyder <[email protected]>

Currently, the PHY only registers the typec orientation switch when it is built in. If the typec driver is built as a module, the switch registration is skipped due to the preprocessor condition, causing orientation detection to fail.

With commit
45fe729be9a6 ("usb: typec: Stub out typec_switch APIs when CONFIG_TYPEC=n") the preprocessor condition is not needed anymore and the orientation switch is correctly registered for both built-in and module builds.

Fixes b58f0f86fd61 ("phy: fsl-imx8mq-usb: add tca function driver for imx95")

---
v2: Drop the preprocessor condition after a better suggestion.
Reviewed-by Neil tag not added as patch is different

---
 drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 14 --------------
 1 file changed, 14 deletions(-)
drivers/phy/freescale/phy-fsl-imx8mq-usb.c +0 -14
index b94f242420fc..72e8aff38b92 100644
@@ -124,8 +124,6 @@ struct imx8mq_usb_phy {
 static void tca_blk_orientation_set(struct tca_blk *tca,
 				enum typec_orientation orientation);
 
-#ifdef CONFIG_TYPEC
-
 static int tca_blk_typec_switch_set(struct typec_switch_dev *sw,
 				enum typec_orientation orientation)
 {
@@ -173,18 +171,6 @@ static void tca_blk_put_typec_switch(struct typec_switch_dev *sw)
 	typec_switch_unregister(sw);
 }
 
-#else
-
-static struct typec_switch_dev *tca_blk_get_typec_switch(struct platform_device *pdev,
-			struct imx8mq_usb_phy *imx_phy)
-{
-	return NULL;
-}
-
-static void tca_blk_put_typec_switch(struct typec_switch_dev *sw) {}
-
-#endif /* CONFIG_TYPEC */
-
 static void tca_blk_orientation_set(struct tca_blk *tca,
 				enum typec_orientation orientation)
 {
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 12 lines · Franz Schnyder

From: Franz Schnyder <[email protected]>

Currently, the PHY only registers the typec orientation switch when it is built in. If the typec driver is built as a module, the switch registration is skipped due to the preprocessor condition, causing orientation detection to fail.

With commit
45fe729be9a6 ("usb: typec: Stub out typec_switch APIs when CONFIG_TYPEC=n") the preprocessor condition is not needed anymore and the orientation switch is correctly registered for both built-in and module builds.

Quoted 8 lines
Fixes b58f0f86fd61 ("phy: fsl-imx8mq-usb: add tca function driver for imx95")

---
v2: Drop the preprocessor condition after a better suggestion.
Reviewed-by Neil tag not added as patch is different
---

Quoted 38 lines
 drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 14 --------------
 1 file changed, 14 deletions(-)
drivers/phy/freescale/phy-fsl-imx8mq-usb.c +0 -15
index b94f242420fc..72e8aff38b92 100644
@@ -124,8 +124,6 @@ struct imx8mq_usb_phy {
 static void tca_blk_orientation_set(struct tca_blk *tca,
 				enum typec_orientation orientation);
 
-#ifdef CONFIG_TYPEC
-
 static int tca_blk_typec_switch_set(struct typec_switch_dev *sw,
 				enum typec_orientation orientation)
 {
@@ -173,18 +171,6 @@ static void tca_blk_put_typec_switch(struct typec_switch_dev *sw)
 	typec_switch_unregister(sw);
 }
 
-#else
-
-static struct typec_switch_dev *tca_blk_get_typec_switch(struct platform_device *pdev,
-			struct imx8mq_usb_phy *imx_phy)
-{
-	return NULL;
-}
-
-static void tca_blk_put_typec_switch(struct typec_switch_dev *sw) {}
-
-#endif /* CONFIG_TYPEC */
-
 static void tca_blk_orientation_set(struct tca_blk *tca,
 				enum typec_orientation orientation)
 {
--

2.43.0

Reviewed-by on v2 1/1
#2 lore raw
In reply to Franz Schnyder
Quoted 12 lines · Franz Schnyder

From: Franz Schnyder <[email protected]>

Currently, the PHY only registers the typec orientation switch when it is built in. If the typec driver is built as a module, the switch registration is skipped due to the preprocessor condition, causing orientation detection to fail.

With commit
45fe729be9a6 ("usb: typec: Stub out typec_switch APIs when CONFIG_TYPEC=n") the preprocessor condition is not needed anymore and the orientation switch is correctly registered for both built-in and module builds.

Quoted 4 lines
Fixes b58f0f86fd61 ("phy: fsl-imx8mq-usb: add tca function driver for imx95")
#3 lore raw
In reply to Franz Schnyder

Hello Vinod,

Quoted 12 lines · Franz Schnyder

From: Franz Schnyder <[email protected]>

Currently, the PHY only registers the typec orientation switch when it is built in. If the typec driver is built as a module, the switch registration is skipped due to the preprocessor condition, causing orientation detection to fail.

With commit
45fe729be9a6 ("usb: typec: Stub out typec_switch APIs when CONFIG_TYPEC=n") the preprocessor condition is not needed anymore and the orientation switch is correctly registered for both built-in and module builds.

Quoted 4 lines
Fixes b58f0f86fd61 ("phy: fsl-imx8mq-usb: add tca function driver for imx95")

Just a gentle ping on this.

Thanks,
Francesco

maintainer Applied
#4 lore raw
In reply to Franz Schnyder
Quoted 11 lines · Franz Schnyder

Currently, the PHY only registers the typec orientation switch when it is built in. If the typec driver is built as a module, the switch registration is skipped due to the preprocessor condition, causing orientation detection to fail.

With commit
45fe729be9a6 ("usb: typec: Stub out typec_switch APIs when CONFIG_TYPEC=n") the preprocessor condition is not needed anymore and the orientation switch is correctly registered for both built-in and module builds.

[...]

Applied, thanks!

[1/1] phy: fsl-imx8mq-usb: fix typec orientation switch when built as module

      commit: 49ccab4bedd4779899246107dc19fb01c5b6fea3

Best regards,

Signature · 1 line
~Vinod