diff options
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/typec/tcpci.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c index 6cca9618328f..589beeb991a6 100644 --- a/drivers/staging/typec/tcpci.c +++ b/drivers/staging/typec/tcpci.c @@ -41,6 +41,7 @@ struct tcpci { bool controls_vbus; bool drive_vbus; + bool sink_disable; struct gpio_desc *ss_sel_gpio; struct tcpc_dev tcpc; @@ -408,7 +409,7 @@ static int tcpci_set_vbus(struct tcpc_dev *tcpc, bool source, bool sink) tcpci->drive_vbus = true; } - if (sink) { + if (sink && !tcpci->sink_disable) { ret = regmap_write(tcpci->regmap, TCPC_COMMAND, TCPC_CMD_SINK_VBUS); if (ret < 0) @@ -704,6 +705,13 @@ static int tcpci_parse_config(struct tcpci *tcpci) &tcfg->operating_snk_mw)) goto snk_setting_wrong; + /* + * In case DRP only for data role, power role is source only + * we can use this property to disable power sink. + */ + if (device_property_read_bool(tcpci->dev, "sink-disable")) + tcpci->sink_disable = true; + return 0; snk_setting_wrong: |