lkml.org 
[lkml]   [2023]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v11 10/10] tty: serial: Add Nuvoton ma35d1 serial driver support
On Wed, May 24, 2023, at 10:34, Jacky Huang wrote:
> On 2023/5/24 下午 03:42, Jiri Slaby wrote:
>> On 16. 05. 23, 9:52, Jacky Huang wrote:
>>> +static void ma35d1serial_config_port(struct uart_port *port, int flags)
>>> +{
>>> +    /*
>>> +     * Driver core for serial ports forces a non-zero value for port
>>> type.
>>> +     * Write an arbitrary value here to accommodate the serial core
>>> driver,
>>> +     * as ID part of UAPI is redundant.
>>> +     */
>>> +    port->type = 1;
>>
>> So this 1 translates to PORT_8250. Why not to use it directly? Or
>> something more saner like PORT_16550A?
>>
> It's not actually 8250 or 16550A.
> Can we add the following definition to
> 'include/uapi/linux/serial_core.h' and use PORT_MA35 instead?
>
> #define PORT_MA35    124

This was already in a previous version, until Greg commented
that it was probably not needed:

https://lore.kernel.org/lkml/20fc81c9-5517-ce1e-639a-3b425cf27759@gmail.com/

Since leaving port->type at PORT_UNKNOWN doesn't work, and almost
all other drivers have something in serial_core.h, it's probably
best to do the same here. Checking the other drivers showed that
drivers/tty/serial/lantiq.c is currently the only exception, it
defines PORT_LTQ_ASC locally, which causes a conflict with
PORT_SPRD.

Arnd

\
 
 \ /
  Last update: 2023-05-24 11:01    [W:0.073 / U:0.992 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site