Thread (4 messages) 4 messages, 3 authors, 2020-06-29

Re: [PATCH v4] tty: serial: don't do termios for BTIF

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2020-06-29 21:41:39
Also in: linux-devicetree, linux-mediatek, linux-serial, lkml

On Mon, Jun 29, 2020 at 11:29:27AM +0300, Andy Shevchenko wrote:
On Sat, Jun 27, 2020 at 04:12:22PM +0200, Greg KH wrote:
quoted
On Sat, Jun 20, 2020 at 03:59:14AM +0800, sean.wang@mediatek.com wrote:
quoted
From: Sean Wang <sean.wang@mediatek.com>

Bluetooth Interface (BTIF) is designed dedicatedly for MediaTek SOC with
BT in order to be instead of the UART interface between BT module and Host
CPU, and not exported to user space to access.

As the UART design, BTIF will be an APB slave and can transmit or receive
data by MCU access, but doesn't provide termios function like baudrate and
flow control setup.

Even LCR on offset 0xC that is just a FAKELCR
a. If FAKELCR[7] is equaled to 1, RBR(0x00), THR(0x00), IER(0x04)
   will not be readable/writable.

b. If FAKELCR is equaled to 0xBF, RBR(0x00), THR(0x00), IER(0x04),
   IIR(0x08), and LSR(0x14) will not be readable/writable.

So adding a new capability 'UART_CAP_NTIO' for the unusual unsupported
case.

The bluetooth driver would use BTIF device as a serdev. So the termios
still function would be called in kernelspace from ttyport_open in
drivers/tty/serdev/serdev-ttyprt.c.
quoted
quoted
+#define UART_CAP_NTIO	(1 << 18)	/* UART doesn't do termios */
Naming is hard.  I will never remember what "NTIO" is, how about we make
it explicit:
	define UART_CAP_IGNORE_TERMIOS

And the _CAP_ name is getting out of hand, this isn't a "capability",
it's a "quirk for this port" but that's a battle to worry about later...
For quirks we have a separate field in struct uart_port. Perhaps that can be used?
That would be much nicer, if possible.

thanks,

greg k-h

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help