linux/drivers/phy/rockchip
Neill Kapron fe5955b11f phy: rockchip-typec: fix tcphy_get_mode error case
[ Upstream commit 4ca651df07 ]

The existing logic in tcphy_get_mode() can cause the phy to be
incorrectly configured to USB UFP or DisplayPort mode when
extcon_get_state returns an error code.

extcon_get_state() can return 0, 1, or a negative error code.

It is possible to get into the failing state with an extcon driver
which does not support the extcon connector id specified as the
second argument to extcon_get_state().

tcphy_get_mode()
->extcon_get_state()
-->find_cable_index_by_id()
--->return -EINVAL;

Fixes: e96be45cb8 ("phy: Add USB Type-C PHY driver for rk3399")
Signed-off-by: Neill Kapron <nkapron@google.com>
Reviewed-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230126001013.3707873-1-nkapron@google.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-10 09:33:38 +01:00
..
Kconfig phy: rockchip: Support PCIe v3 2022-09-04 20:35:48 +05:30
Makefile phy: rockchip: Support PCIe v3 2022-09-04 20:35:48 +05:30
phy-rockchip-dp.c
phy-rockchip-dphy-rx0.c phy/rockchip: Use of_device_get_match_data() 2022-04-13 15:23:23 +05:30
phy-rockchip-emmc.c
phy-rockchip-inno-csidphy.c phy: rockchip: add support for the rk356x variant to rockchip-inno-csidphy 2022-09-02 23:00:47 +05:30
phy-rockchip-inno-dsidphy.c phy: rockchip: inno-dsidphy: Add support for rk3568 2022-09-20 11:39:47 +05:30
phy-rockchip-inno-hdmi.c
phy-rockchip-inno-usb2.c phy: rockchip-inno-usb2: Fix missing clk_disable_unprepare() in rockchip_usb2phy_power_on() 2023-02-01 08:34:17 +01:00
phy-rockchip-naneng-combphy.c phy: rockchip: add naneng combo phy for RK3568 2022-02-24 20:13:52 +05:30
phy-rockchip-pcie.c
phy-rockchip-snps-pcie3.c phy: rockchip-snps-pcie3: only look for rockchip,pipe-grf on rk3588 2022-09-29 11:43:04 +05:30
phy-rockchip-typec.c phy: rockchip-typec: fix tcphy_get_mode error case 2023-03-10 09:33:38 +01:00
phy-rockchip-usb.c