Re: [PATCH/RFC 4/5] serial: sh-sci: Add support for GPIO-controlled modem lines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 17, 2016 at 2:47 PM, Geert Uytterhoeven
<geert+renesas@xxxxxxxxx> wrote:
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c

> @@ -1829,15 +1831,36 @@ static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl)
>                                         serial_port_in(port, SCFCR) |
>                                         SCFCR_LOOP);
>         }
> +
> +       mctrl_gpio_set(to_sci_port(port)->gpios, mctrl);
>  }
>
>  static unsigned int sci_get_mctrl(struct uart_port *port)
>  {
> +       unsigned int mctrl = 0;
> +
> +       mctrl_gpio_get(to_sci_port(port)->gpios, &mctrl);
> +
>         /*
>          * CTS/RTS is handled in hardware when supported, while nothing
>          * else is wired up. Keep it simple and simply assert CTS/DSR/CAR.
>          */
> -       return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
> +       if (IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(to_sci_port(port)->gpios,
> +                                              UART_GPIO_CTS)))
> +               mctrl |= TIOCM_CTS;
> +       if (IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(to_sci_port(port)->gpios,
> +                                              UART_GPIO_DSR)))
> +               mctrl |= TIOCM_DSR;
> +       if (IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(to_sci_port(port)->gpios,
> +                                              UART_GPIO_CAR)))

Oops, something went wrong during rebase before sending: that should
have been "UART_GPIO_DCD".

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux