Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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")
Cc: stable@vger.kernel.org
Suggested-by: Xu Yang <xu.yang_2@nxp.com>
Signed-off-by: Franz Schnyder <franz.schnyder@toradex.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://patch.msgid.link/20251126140136.1202241-1-fra.schnyder@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Franz Schnyder and committed by
Vinod Koul
49ccab4b 8f0b4cce

-14
-14
drivers/phy/freescale/phy-fsl-imx8mq-usb.c
··· 126 126 static void tca_blk_orientation_set(struct tca_blk *tca, 127 127 enum typec_orientation orientation); 128 128 129 - #ifdef CONFIG_TYPEC 130 - 131 129 static int tca_blk_typec_switch_set(struct typec_switch_dev *sw, 132 130 enum typec_orientation orientation) 133 131 { ··· 172 174 { 173 175 typec_switch_unregister(sw); 174 176 } 175 - 176 - #else 177 - 178 - static struct typec_switch_dev *tca_blk_get_typec_switch(struct platform_device *pdev, 179 - struct imx8mq_usb_phy *imx_phy) 180 - { 181 - return NULL; 182 - } 183 - 184 - static void tca_blk_put_typec_switch(struct typec_switch_dev *sw) {} 185 - 186 - #endif /* CONFIG_TYPEC */ 187 177 188 178 static void tca_blk_orientation_set(struct tca_blk *tca, 189 179 enum typec_orientation orientation)