Skip to content

Commit

Permalink
staging: typec: tcpci: Only touch target bit when enable vconn
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Jun authored and Greg Kroah-Hartman committed Jun 28, 2018
1 parent 3af50c2 commit 0025148
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/staging/typec/tcpci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0025148

Please sign in to comment.