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: add update_connector callback

Add a callback to allow glue drivers to update the connector before
registering corresponding power supply and Type-C port. In particular
this is useful if glue drivers want to touch the connector's Type-C
capabilities structure.

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-4-d4b1cb22a33f@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Baryshkov and committed by
Greg Kroah-Hartman
62866465 2fb5ea6b

+5
+3
drivers/usb/typec/ucsi/ucsi.c
··· 1561 1561 cap->driver_data = con; 1562 1562 cap->ops = &ucsi_ops; 1563 1563 1564 + if (ucsi->ops->update_connector) 1565 + ucsi->ops->update_connector(con); 1566 + 1564 1567 ret = ucsi_register_port_psy(con); 1565 1568 if (ret) 1566 1569 goto out;
+2
drivers/usb/typec/ucsi/ucsi.h
··· 60 60 * @sync_write: Blocking write operation 61 61 * @async_write: Non-blocking write operation 62 62 * @update_altmodes: Squashes duplicate DP altmodes 63 + * @update_connector: Update connector capabilities before registering 63 64 * @connector_status: Updates connector status, called holding connector lock 64 65 * 65 66 * Read and write routines for UCSI interface. @sync_write must wait for the ··· 76 75 const void *val, size_t val_len); 77 76 bool (*update_altmodes)(struct ucsi *ucsi, struct ucsi_altmode *orig, 78 77 struct ucsi_altmode *updated); 78 + void (*update_connector)(struct ucsi_connector *con); 79 79 void (*connector_status)(struct ucsi_connector *con); 80 80 }; 81 81