]> git.baikalelectronics.ru Git - kernel.git/commit
usb: typec: tcpm: Return ENOTSUPP for power supply prop writes
authorBadhri Jagan Sridharan <badhri@google.com>
Wed, 17 Aug 2022 21:54:10 +0000 (14:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Aug 2022 15:01:43 +0000 (17:01 +0200)
commit776098ee1b8a55511ef4b84633a11f1964fbfded
tree27536d969071f56e910f3cbc50b5f2b9b404550f
parent264cde13e1481b3b133815746f99d8a637ead7cb
usb: typec: tcpm: Return ENOTSUPP for power supply prop writes

When the port does not support USB PD, prevent transition to PD
only states when power supply property is written. In this case,
TCPM transitions to SNK_NEGOTIATE_CAPABILITIES
which should not be the case given that the port is not pd_capable.

[   84.308251] state change SNK_READY -> SNK_NEGOTIATE_CAPABILITIES [rev3 NONE_AMS]
[   84.308335] Setting usb_comm capable false
[   84.323367] set_auto_vbus_discharge_threshold mode:3 pps_active:n vbus:5000 ret:0
[   84.323376] state change SNK_NEGOTIATE_CAPABILITIES -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]

Fixes: de5554fca91e3 ("usb: typec: tcpm: Support non-PD mode")
Cc: stable@vger.kernel.org
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20220817215410.1807477-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c