aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sc16is7xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/sc16is7xx.c')
-rw-r--r--drivers/tty/serial/sc16is7xx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 2675792a8f59..fb0672554123 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,
1130{ 1130{
1131 struct sc16is7xx_port *s = gpiochip_get_data(chip); 1131 struct sc16is7xx_port *s = gpiochip_get_data(chip);
1132 struct uart_port *port = &s->p[0].port; 1132 struct uart_port *port = &s->p[0].port;
1133 u8 state = sc16is7xx_port_read(port, SC16IS7XX_IOSTATE_REG);
1133 1134
1134 sc16is7xx_port_update(port, SC16IS7XX_IOSTATE_REG, BIT(offset), 1135 if (val)
1135 val ? BIT(offset) : 0); 1136 state |= BIT(offset);
1137 else
1138 state &= ~BIT(offset);
1139 sc16is7xx_port_write(port, SC16IS7XX_IOSTATE_REG, state);
1136 sc16is7xx_port_update(port, SC16IS7XX_IODIR_REG, BIT(offset), 1140 sc16is7xx_port_update(port, SC16IS7XX_IODIR_REG, BIT(offset),
1137 BIT(offset)); 1141 BIT(offset));
1138 1142