[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL_Jsq+LOqe9h1t9nYeothfV96ntkWb6X+anSryLqbVTX+XSWw@mail.gmail.com>
Date: Fri, 10 Aug 2018 12:11:41 -0600
From: Rob Herring <robh@...nel.org>
To: Andreas Färber <afaerber@...e.de>
Cc: "open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
Linux-MIPS <linux-mips@...ux-mips.org>, jringle@...dpoint.com,
Michael Allwright <allsey87@...il.com>,
Jakub Kicinski <kubakici@...pl>, liuxuenetmail@...il.com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] serial: sc16is7xx: Use DT sub-nodes for UART ports
On Fri, Aug 10, 2018 at 11:45 AM Andreas Färber <afaerber@...e.de> wrote:
>
> Am 10.08.2018 um 19:34 schrieb Rob Herring:
> > On Sun, Aug 5, 2018 at 5:27 PM Andreas Färber <afaerber@...e.de> wrote:
> >>
> >> This is to allow using serdev.
> >>
> >> Signed-off-by: Andreas Färber <afaerber@...e.de>
> >> ---
> >> drivers/tty/serial/sc16is7xx.c | 25 +++++++++++++++++++++++++
> >> 1 file changed, 25 insertions(+)
> >>
> >> diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
> >> index 243c96025053..ad7267274f65 100644
> >> --- a/drivers/tty/serial/sc16is7xx.c
> >> +++ b/drivers/tty/serial/sc16is7xx.c
> >> @@ -1213,9 +1213,31 @@ static int sc16is7xx_probe(struct device *dev,
> >> SC16IS7XX_IOCONTROL_SRESET_BIT);
> >>
> >> for (i = 0; i < devtype->nr_uart; ++i) {
> >> +#ifdef CONFIG_OF
> >> + struct device_node *np;
> >> + struct platform_device *pdev;
> >> + char name[6] = "uartx";
> >> +#endif
> >> +
> >> s->p[i].line = i;
> >> /* Initialize port data */
> >> +#ifdef CONFIG_OF
> >> + name[4] = '0' + i;
> >> + np = of_get_child_by_name(dev->of_node, name);
> >> + if (IS_ERR(np)) {
> >> + ret = PTR_ERR(np);
> >> + goto out_ports;
> >> + }
> >> + pdev = of_platform_device_create(np, NULL, dev);
> >
> > Ideally, you would use of_platform_default_populate here. I think
> > you'd have to add a compatible to the child nodes, but that wouldn't
> > be a bad thing. I could envision that the child nodes ultimately
> > become their own driver utilizing the standard 8250 driver and a
> > compatible string would be needed in that case.
>
> Separate compatibles would mean separate drivers.
No. Having a compatible doesn't mean you have to have a driver.
> Unlike your DUART example this is not an MMIO device that we can easily
> split but a SPI slave (well, regmap due to some I2C models).
A SPI slave could provide a regmap, right?
> I don't see how separate drivers could work, given that the whole
> spi_device has a single interrupt for all functions of this device.
A shared interrupt or a parent driver that creates an irqchip like MFD
drivers often do.
>
> That left me with this ugly but working construct.
In any case, I'm was suggesting that you do any of this now. I just
want the binding to be designed to work either way.
> Is the uartX naming correct, or should it be serialX?
Ah, yes. Should be serial@... I'm fine if both the parent and child
are named serial@...
Rob
Powered by blists - more mailing lists