diff options
author | Li Jun <jun.li@nxp.com> | 2017-11-23 21:44:36 +0800 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 1c11b25784e4ed1e715f8865b021f93ef9ae131e (patch) | |
tree | e04a359821b176a34f56081f4b736303559ffb53 /drivers/staging | |
parent | 2722ce87cfc061b50774a6af1cfc011592bcb293 (diff) |
MLK-16820-2 staging: typec: tcpci: add sink_disable flag for source only power
As we need to use DRP config for data role, but the power role is source only,
so introduce a property sink-disable to avoid sink vbus command.
Signed-off-by: Li Jun <jun.li@nxp.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
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: |