Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1332232

Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485 direction control

From Ильяс Гасанов <torso.nafi@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485 direction control
Date 2016-02-11 17:50 +0100
Message-ID <r12Bk-2Ym-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

2016-02-01 21:09 GMT+03:00 "Matwey V. Kornilov" <matwey@sai.msu.ru>:
> +static int omap_8250_rs485_config(struct uart_port *port,
> +                                 struct serial_rs485 *rs485)
> +{
> +       struct uart_8250_port *up = up_to_u8250p(port);
> +
> +       /* Clamp the delays to [0, 100ms] */
> +       rs485->delay_rts_before_send = min(rs485->delay_rts_before_send, 100U);
> +       rs485->delay_rts_after_send  = min(rs485->delay_rts_after_send, 100U);
> +
> +       port->rs485 = *rs485;
> +
> +       /*
> +        * Both serial8250_em485_init and serial8250_em485_destroy
> +        * are idempotent
> +        */
> +       if (rs485->flags & SER_RS485_ENABLED) {
> +               int ret = serial8250_em485_init(up);
> +
> +               if (ret) {
> +                       rs485->flags &= ~SER_RS485_ENABLED;
> +                       port->rs485.flags &= ~SER_RS485_ENABLED;
> +               }
> +               return ret;
> +       }
> +
> +       serial8250_em485_destroy(up);
> +
> +       return 0;
> +}

I think that an invocation of serial8250_em485_destroy() should be
performed inside omap8250_remove() as well. However there is a catch -
serial8250_get_port() is only reserved for suspend-resume power
management operations, and I am aware of no other means how to supply
an uart_8250_port to serial8250_em485_destroy() at that point.

Similarly, I got no idea on how to implement handling
"linux,rs485-enabled-at-boot-time" property without using
serial8250_get_port() directly (well, honestly I could try invoking
the corresponding ioctl somehow, but that's gonna be plain ugly at
least).

Regards,
Ilyas G.

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485  direction control Ильяс Гасанов   <torso.nafi@gmail.com> - 2016-02-11 17:50 +0100
  Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485  direction control "Matwey V. Kornilov" <matwey@sai.msu.ru> - 2016-02-11 20:10 +0100
    Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485  direction control Ильяс Гасанов   <torso.nafi@gmail.com> - 2016-02-11 21:30 +0100
      Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485  direction control "Matwey V. Kornilov" <matwey@sai.msu.ru> - 2016-02-12 09:00 +0100
        Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485  direction control Ильяс Гасанов   <torso.nafi@gmail.com> - 2016-02-12 10:40 +0100
          Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485  direction control Ильяс Гасанов   <torso.nafi@gmail.com> - 2016-02-17 18:00 +0100
            Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485  direction control Ильяс Гасанов   <torso.nafi@gmail.com> - 2016-02-18 08:20 +0100
              Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485  direction control Ильяс Гасанов   <torso.nafi@gmail.com> - 2016-02-18 10:50 +0100
                Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485  direction control Peter Hurley <peter@hurleysoftware.com> - 2016-02-18 18:00 +0100
                Re: [PATCH v8 3/3] tty: 8250_omap: Use software emulated RS485  direction control Ильяс Гасанов   <torso.nafi@gmail.com> - 2016-02-18 19:20 +0100

csiph-web