Skip to content

Commit c994cb5

Browse files
jhovoldgregkh
authored andcommitted
usb: typec: ucsi: fix gpio-based orientation detection
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: c6165ed ("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>
1 parent aef05e3 commit c994cb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/typec/ucsi/ucsi_glink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static void pmic_glink_ucsi_notify(struct work_struct *work)
228228

229229
con_num = UCSI_CCI_CONNECTOR(cci);
230230
if (con_num) {
231-
if (con_num < PMIC_GLINK_MAX_PORTS &&
231+
if (con_num <= PMIC_GLINK_MAX_PORTS &&
232232
ucsi->port_orientation[con_num - 1]) {
233233
int orientation = gpiod_get_value(ucsi->port_orientation[con_num - 1]);
234234

0 commit comments

Comments
 (0)