diff options
author | 2019-02-13 10:45:50 +0300 | |
---|---|---|
committer | 2019-02-14 10:52:25 +0100 | |
commit | 540bfab7fbff6ab9092bb28aaf804af0b4d576ae (patch) | |
tree | 697565b197c4958f58884e6e0dafda15f4eab8c7 /drivers/usb/typec/class.c | |
parent | platform/x86: intel_cht_int33fe: Prepare for better mux naming scheme (diff) | |
download | linux-dev-540bfab7fbff6ab9092bb28aaf804af0b4d576ae.tar.xz linux-dev-540bfab7fbff6ab9092bb28aaf804af0b4d576ae.zip |
usb: typec: Rationalize the API for the muxes
Since with accessory modes there is no need for additional
identification when requesting a handle to the mux, we can
replace the second parameter that is passed to the
typec_mux_get() function with a pointer to alternate mode
description structure, and simply passing NULL with
accessory modes.
This change means the naming of the mux device connections
can be updated. Alternate and Accessory Modes will both be
handled with muxes named "mode-switch", and the orientation
switches will be named "orientation-switch".
Future identification of the alternate modes will be later
done using device property "svid" of the mux.
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec/class.c')
-rw-r--r-- | drivers/usb/typec/class.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index 41c0d790a50f..45abe2c7e9f3 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -1496,11 +1496,8 @@ typec_port_register_altmode(struct typec_port *port, { struct typec_altmode *adev; struct typec_mux *mux; - char id[10]; - sprintf(id, "id%04xm%02x", desc->svid, desc->mode); - - mux = typec_mux_get(&port->dev, id); + mux = typec_mux_get(&port->dev, desc); if (IS_ERR(mux)) return ERR_CAST(mux); @@ -1593,7 +1590,7 @@ struct typec_port *typec_register_port(struct device *parent, return ERR_CAST(port->sw); } - port->mux = typec_mux_get(&port->dev, "typec-mux"); + port->mux = typec_mux_get(&port->dev, NULL); if (IS_ERR(port->mux)) { put_device(&port->dev); return ERR_CAST(port->mux); |