diff mbox

[2/4] sc16is7xx: don't wipe out port configuration on shutdown

Message ID 1426548529-21738-3-git-send-email-moorray3@wp.pl
State Not Applicable
Headers show

Commit Message

Jakub KiciƄski March 16, 2015, 11:28 p.m. UTC
From: Jakub Kicinski <kubakici@wp.pl>

EFCR register contains RS-485 configuration which should not
be changed by shutdown.  Instead of doing a write only update
the appropriate bits.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
---
 drivers/tty/serial/sc16is7xx.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Jon Ringle March 17, 2015, 2:43 p.m. UTC | #1
On Mon, 16 Mar 2015, Jakub Kicinski wrote:

> From: Jakub Kicinski <kubakici@wp.pl>
> 
> EFCR register contains RS-485 configuration which should not
> be changed by shutdown.  Instead of doing a write only update
> the appropriate bits.
> 
> Signed-off-by: Jakub Kicinski <kubakici@wp.pl>

Signed-off-by: Jon Ringle <jringle@gridpoint.com>

> ---
>  drivers/tty/serial/sc16is7xx.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
> index 11bb44039a57..e6b396e584f3 100644
> --- a/drivers/tty/serial/sc16is7xx.c
> +++ b/drivers/tty/serial/sc16is7xx.c
> @@ -903,9 +903,11 @@ static void sc16is7xx_shutdown(struct uart_port *port)
>  	/* Disable all interrupts */
>  	sc16is7xx_port_write(port, SC16IS7XX_IER_REG, 0);
>  	/* Disable TX/RX */
> -	sc16is7xx_port_write(port, SC16IS7XX_EFCR_REG,
> -			     SC16IS7XX_EFCR_RXDISABLE_BIT |
> -			     SC16IS7XX_EFCR_TXDISABLE_BIT);
> +	sc16is7xx_port_update(port, SC16IS7XX_EFCR_REG,
> +			      SC16IS7XX_EFCR_RXDISABLE_BIT |
> +			      SC16IS7XX_EFCR_TXDISABLE_BIT,
> +			      SC16IS7XX_EFCR_RXDISABLE_BIT |
> +			      SC16IS7XX_EFCR_TXDISABLE_BIT);
>  
>  	sc16is7xx_power(port, 0);
>  }
> -- 
> 2.1.0
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 11bb44039a57..e6b396e584f3 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -903,9 +903,11 @@  static void sc16is7xx_shutdown(struct uart_port *port)
 	/* Disable all interrupts */
 	sc16is7xx_port_write(port, SC16IS7XX_IER_REG, 0);
 	/* Disable TX/RX */
-	sc16is7xx_port_write(port, SC16IS7XX_EFCR_REG,
-			     SC16IS7XX_EFCR_RXDISABLE_BIT |
-			     SC16IS7XX_EFCR_TXDISABLE_BIT);
+	sc16is7xx_port_update(port, SC16IS7XX_EFCR_REG,
+			      SC16IS7XX_EFCR_RXDISABLE_BIT |
+			      SC16IS7XX_EFCR_TXDISABLE_BIT,
+			      SC16IS7XX_EFCR_RXDISABLE_BIT |
+			      SC16IS7XX_EFCR_TXDISABLE_BIT);
 
 	sc16is7xx_power(port, 0);
 }