Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1332613
| 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-12 10:40 +0100 |
| Message-ID | <r1imK-54w-3@gated-at.bofh.it> (permalink) |
| References | <r12Bk-2Ym-9@gated-at.bofh.it> <r14MN-4Cs-1@gated-at.bofh.it> <r162e-5mV-13@gated-at.bofh.it> <r1gNY-3W4-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
2016-02-12 10:57 GMT+03:00 Matwey V. Kornilov <matwey@sai.msu.ru>:
> up->em485 is always pointer, however you are right, that
> serial8250_em485_init stores pointer to up when the timers are inited.
> More complex issue here that serial8250_em485_init need to set RTS to
> proper state and probably can't do that before
> serial8250_register_8250_port. So omap8250_probe should directly or
> indirectly use serial8250_get_port(priv->line) after
> serial8250_register_8250_port. As for me, possible solution could be
> to add a wrapper:
>
> int serial8250_em485_init_by_line(int line) {
> struct uart_8250_port *uart = &serial8250_ports[line];
> int ret;
> unsigned long flags;
>
> spin_lock_irqsave(&uart->port.lock, flags);
> ret = serial8250_em485_init(uart).
> spin_unlock_irqrestore(&uart->port.lock, flags);
>
> return ret;
> }
Also, I noticed that in 8250_core.c the em485 tx handlers change the
MCR register itself. But in the case when RTS signal is itself
emulated, say by flipping a GPIO, a more generic approach would be
necessary, such as get_mctrl/set_mctrl, so that the use of helpers in
serial_mctrl_gpio.c is straightforward.
For example, in our design the RS232<->RS485 direction switch is
driven by a pin which cannot be pinmuxed as UART RTS but can be a
GPIO. Since it is already in production, making incompatible changes
to the design (and getting away with it) is not inherently feasible.
Regards,
Ilyas G.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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