summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorLi Jun <jun.li@nxp.com>2018-06-27 07:45:31 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-28 19:49:48 +0900
commit002514880ef36c26c19b144b11d7dae839ae4fe6 (patch)
treed159437e01689d014d751770efb45f46fb060612 /drivers/staging
parent3af50c293368f42390b8f3d9ec19e3b9b858c34d (diff)
downloadlinux-002514880ef36c26c19b144b11d7dae839ae4fe6.tar.bz2
staging: typec: tcpci: Only touch target bit when enable vconn
We need regmap_update_bits to avoid touch any other bits when enable or disable vconn. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/typec/tcpci.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
index 11c2d37622de..ac6b418b15f1 100644
--- a/drivers/staging/typec/tcpci.c
+++ b/drivers/staging/typec/tcpci.c
@@ -218,12 +218,9 @@ static int tcpci_set_vconn(struct tcpc_dev *tcpc, bool enable)
return ret;
}
- ret = regmap_write(tcpci->regmap, TCPC_POWER_CTRL,
- enable ? TCPC_POWER_CTRL_VCONN_ENABLE : 0);
- if (ret < 0)
- return ret;
-
- return 0;
+ return regmap_update_bits(tcpci->regmap, TCPC_POWER_CTRL,
+ TCPC_POWER_CTRL_VCONN_ENABLE,
+ enable ? TCPC_POWER_CTRL_VCONN_ENABLE : 0);
}
static int tcpci_set_roles(struct tcpc_dev *tcpc, bool attached,