All of lore.kernel.org
 help / color / mirror / Atom feed
* [v3,11/12] staging: typec: tcpci: Only touch target bit when enable vconn
@ 2018-03-15  4:43 Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2018-03-15  4:43 UTC (permalink / raw)
  To: Li Jun
  Cc: robh+dt, mark.rutland, gregkh, heikki.krogerus, a.hajda, yueyao,
	shufan_lee, o_leveque, linux-usb, linux-imx

On Tue, Mar 13, 2018 at 05:34:37PM +0800, Li Jun wrote:
> We need regmap_update_bits to avoid touch any other bits when
> enable or disable vconn.
> 
> Signed-off-by: Li Jun <jun.li@nxp.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/staging/typec/tcpci.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
> index 6fdb179..46c4cff 100644
> --- a/drivers/staging/typec/tcpci.c
> +++ b/drivers/staging/typec/tcpci.c
> @@ -219,12 +219,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,
> -- 
> 2.7.4
>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [v3,11/12] staging: typec: tcpci: Only touch target bit when enable vconn
@ 2018-03-13  9:34 Jun Li
  0 siblings, 0 replies; 2+ messages in thread
From: Jun Li @ 2018-03-13  9:34 UTC (permalink / raw)
  To: robh+dt, mark.rutland, gregkh, heikki.krogerus
  Cc: a.hajda, jun.li, linux, yueyao, shufan_lee, o_leveque, linux-usb,
	linux-imx

We need regmap_update_bits to avoid touch any other bits when
enable or disable vconn.

Signed-off-by: Li Jun <jun.li@nxp.com>
---
 drivers/staging/typec/tcpci.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
index 6fdb179..46c4cff 100644
--- a/drivers/staging/typec/tcpci.c
+++ b/drivers/staging/typec/tcpci.c
@@ -219,12 +219,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,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-15  4:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-15  4:43 [v3,11/12] staging: typec: tcpci: Only touch target bit when enable vconn Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2018-03-13  9:34 Jun Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.