Commit 49ccab4b authored by Franz Schnyder's avatar Franz Schnyder Committed by Vinod Koul
Browse files

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
45fe729b ("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: b58f0f86 ("phy: fsl-imx8mq-usb: add tca function driver for imx95")
Cc: stable@vger.kernel.org
Suggested-by: default avatarXu Yang <xu.yang_2@nxp.com>
Signed-off-by: default avatarFranz Schnyder <franz.schnyder@toradex.com>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Reviewed-by: default avatarXu Yang <xu.yang_2@nxp.com>
Link: https://patch.msgid.link/20251126140136.1202241-1-fra.schnyder@gmail.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 8f0b4cce
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -126,8 +126,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)
{
@@ -175,18 +173,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)
{