diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-30 13:42:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-30 13:42:10 +0300 |
commit | 5131dcd7810806fe4ff81ca23dadb47921285e36 (patch) | |
tree | e3fb4dd65c6807fae3a5215cf1310eafecdeb86f /drivers/tty/serial/sc16is7xx.c | |
parent | 463e2a2b8996aabc0dca67cc716a00e30bffc110 (diff) | |
parent | a909d3e636995ba7c349e2ca5dbb528154d4ac30 (diff) | |
download | linux-5131dcd7810806fe4ff81ca23dadb47921285e36.tar.xz |
Merge 4.9-rc3 into tty-next
We want the serial/tty fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/sc16is7xx.c')
-rw-r--r-- | drivers/tty/serial/sc16is7xx.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 28cf48d41f66..793395451982 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1130,9 +1130,13 @@ static int sc16is7xx_gpio_direction_output(struct gpio_chip *chip, { struct sc16is7xx_port *s = gpiochip_get_data(chip); struct uart_port *port = &s->p[0].port; + u8 state = sc16is7xx_port_read(port, SC16IS7XX_IOSTATE_REG); - sc16is7xx_port_update(port, SC16IS7XX_IOSTATE_REG, BIT(offset), - val ? BIT(offset) : 0); + if (val) + state |= BIT(offset); + else + state &= ~BIT(offset); + sc16is7xx_port_write(port, SC16IS7XX_IOSTATE_REG, state); sc16is7xx_port_update(port, SC16IS7XX_IODIR_REG, BIT(offset), BIT(offset)); |