diff options
-rw-r--r-- | drivers/usb/typec/tcpm/tcpm.c | 6 | ||||
-rw-r--r-- | include/linux/usb/tcpm.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index b6d7131228f9..3d505614bff1 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -1167,6 +1167,12 @@ static int tcpm_set_roles(struct tcpm_port *port, bool attached, if (ret < 0) return ret; + if (port->tcpc->set_orientation) { + ret = port->tcpc->set_orientation(port->tcpc, orientation); + if (ret < 0) + return ret; + } + port->pwr_role = role; port->data_role = data; typec_set_data_role(port->typec_port, data); diff --git a/include/linux/usb/tcpm.h b/include/linux/usb/tcpm.h index 6671427f7eeb..061da9546a81 100644 --- a/include/linux/usb/tcpm.h +++ b/include/linux/usb/tcpm.h @@ -144,6 +144,8 @@ struct tcpc_dev { enum typec_cc_status *cc2); int (*set_polarity)(struct tcpc_dev *dev, enum typec_cc_polarity polarity); + int (*set_orientation)(struct tcpc_dev *dev, + enum typec_orientation orientation); int (*set_vconn)(struct tcpc_dev *dev, bool on); int (*set_vbus)(struct tcpc_dev *dev, bool on, bool charge); int (*set_current_limit)(struct tcpc_dev *dev, u32 max_ma, u32 mv); |