Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: typec: ucsi: glink: use typec_set_orientation

Use typec_set_orientation() instead of calling typec_switch_set()
manually. This way the rest of the typec framework and the userspace are
notified about the orientation change.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240411-ucsi-orient-aware-v2-3-d4b1cb22a33f@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Baryshkov and committed by
Greg Kroah-Hartman
2fb5ea6b 76716fd5

+4 -9
+4 -9
drivers/usb/typec/ucsi/ucsi_glink.c
··· 58 58 struct device *dev; 59 59 60 60 struct gpio_desc *port_orientation[PMIC_GLINK_MAX_PORTS]; 61 - struct typec_switch *port_switch[PMIC_GLINK_MAX_PORTS]; 62 61 63 62 struct pmic_glink_client *client; 64 63 ··· 197 198 198 199 orientation = gpiod_get_value(ucsi->port_orientation[con->num - 1]); 199 200 if (orientation >= 0) { 200 - typec_switch_set(ucsi->port_switch[con->num - 1], 201 - orientation ? TYPEC_ORIENTATION_REVERSE 202 - : TYPEC_ORIENTATION_NORMAL); 201 + typec_set_orientation(con->port, 202 + orientation ? 203 + TYPEC_ORIENTATION_REVERSE : 204 + TYPEC_ORIENTATION_NORMAL); 203 205 } 204 206 } 205 207 ··· 378 378 return dev_err_probe(dev, PTR_ERR(desc), 379 379 "unable to acquire orientation gpio\n"); 380 380 ucsi->port_orientation[port] = desc; 381 - 382 - ucsi->port_switch[port] = fwnode_typec_switch_get(fwnode); 383 - if (IS_ERR(ucsi->port_switch[port])) 384 - return dev_err_probe(dev, PTR_ERR(ucsi->port_switch[port]), 385 - "failed to acquire orientation-switch\n"); 386 381 } 387 382 388 383 ucsi->client = devm_pmic_glink_register_client(dev,