[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200627141222.GC1901451@kroah.com>
Date: Sat, 27 Jun 2020 16:12:22 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: sean.wang@...iatek.com
Cc: robh+dt@...nel.org, jslaby@...e.com,
andriy.shevchenko@...ux.intel.com, robert.jarzmik@...e.fr,
arnd@...db.de, p.zabel@...gutronix.de, joel@....id.au,
david@...hnology.com, jan.kiszka@...mens.com,
heikki.krogerus@...ux.intel.com, hpeter@...il.com, vigneshr@...com,
matthias.bgg@...il.com, tthayer@...nsource.altera.com,
devicetree@...r.kernel.org, linux-mediatek@...ts.infradead.org,
linux-serial@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, Steven Liu <steven.liu@...iatek.com>,
Ryder Lee <ryder.lee@...iatek.com>
Subject: Re: [PATCH v4] tty: serial: don't do termios for BTIF
On Sat, Jun 20, 2020 at 03:59:14AM +0800, sean.wang@...iatek.com wrote:
> From: Sean Wang <sean.wang@...iatek.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.
>
> Fixes: 1c16ae65e250 ("serial: 8250: of: Add new port type for MediaTek BTIF controller on MT7622/23 SoC")
> Cc: Steven Liu <steven.liu@...iatek.com>
> Signed-off-by: Sean Wang <sean.wang@...iatek.com>
> Signed-off-by: Ryder Lee <ryder.lee@...iatek.com>
>
> --
> v1->v2:
> no change on termios->c_cflag and refine commit message
>
> v2->v3:
> change the naming from NMOD to NTIO as TIO is a well established prefix
> for termios IOCTLs.
>
> v3->v4:
> 1. remove appropriate tag
> 2. add the explanation why the termios is required even when the connection
> isn't exported to userspace.
> ---
> drivers/tty/serial/8250/8250.h | 1 +
> drivers/tty/serial/8250/8250_port.c | 5 ++++-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
> index 52bb21205bb6..0d9d3bfe48af 100644
> --- a/drivers/tty/serial/8250/8250.h
> +++ b/drivers/tty/serial/8250/8250.h
> @@ -82,6 +82,7 @@ struct serial8250_config {
> #define UART_CAP_MINI (1 << 17) /* Mini UART on BCM283X family lacks:
> * STOP PARITY EPAR SPAR WLEN5 WLEN6
> */
> +#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...
thanks,
greg k-h
Powered by blists - more mailing lists