Skip to content

Commit 0025148

Browse files
Junlisuzhougregkh
authored andcommitted
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>
1 parent 3af50c2 commit 0025148

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/staging/typec/tcpci.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,9 @@ static int tcpci_set_vconn(struct tcpc_dev *tcpc, bool enable)
218218
return ret;
219219
}
220220

221-
ret = regmap_write(tcpci->regmap, TCPC_POWER_CTRL,
222-
enable ? TCPC_POWER_CTRL_VCONN_ENABLE : 0);
223-
if (ret < 0)
224-
return ret;
225-
226-
return 0;
221+
return regmap_update_bits(tcpci->regmap, TCPC_POWER_CTRL,
222+
TCPC_POWER_CTRL_VCONN_ENABLE,
223+
enable ? TCPC_POWER_CTRL_VCONN_ENABLE : 0);
227224
}
228225

229226
static int tcpci_set_roles(struct tcpc_dev *tcpc, bool attached,

0 commit comments

Comments
 (0)