usb: typec: ucsi: fix gpio-based orientation detection
authorJohan Hovold <johan+linaro@kernel.org>
Fri, 8 Dec 2023 12:36:02 +0000 (13:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jan 2024 12:42:41 +0000 (12:42 +0000)
commit847f8f529a13bd880aa271a76aa1c19408d03fa5
tree82256efeb0d224d844360bb4b97c4523ca1034c2
parent34c032a72f97e05cd1388aaeb1b3b255ac3c9581
usb: typec: ucsi: fix gpio-based orientation detection

commit c994cb596bf7ef5928f06331c76f46e071b16f09 upstream.

Fix the recently added connector sanity check which was off by one and
prevented orientation notifications from being handled correctly for the
second port when using GPIOs to determine orientation.

Fixes: c6165ed2f425 ("usb: ucsi: glink: use the connector orientation GPIO to provide switch events")
Cc: stable <stable@kernel.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20231208123603.29957-1-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi_glink.c