[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZXwmBxvQlxca8aNv@hovoldconsulting.com>
Date: Fri, 15 Dec 2023 11:10:15 +0100
From: Johan Hovold <johan@...nel.org>
To: Stan Bertrand <stanislasbertrand@...il.com>
Cc: linux-usb@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] USB: serial: ftdi_sio: add ftdi serial to gpiochip label
On Mon, Oct 02, 2023 at 05:11:35PM -0700, Stan Bertrand wrote:
> From: Stanislas Bertrand <stanislasbertrand@...il.com>
>
> Use ftdi serial number on gpiochip label.
> Allows to interface with gpiod utils using the serial number:
>
> $ gpiodetect
> gpiochip5 [ftdi-cbus-FTRelay2] (4 lines)
> gpiochip6 [ftdi-cbus] (4 lines)
> gpiochip7 [ftdi-cbus-A106TPEC] (4 lines)
>
> $ gpioget ftdi-cbus-FTRelay2 2
> 0
I don't think this is a good idea, for example, as not all devices have
a unique serial string.
Looks like the naming of gpiochips are all over the place, and ideally
this should not have been something that was left up to individual
driver to decide.
I see several drivers using the name of the corresponding platform
device as label, which works in most cases, but not always either. The
only unique and always available identifier is the gpiochip's place in
the device tree itself.
For USB, we already encode the bus topology in the USB device names
(e.g. 1-11.5.1) and we could possibly consider using that. But we
already have USB serial devices with multiple GPIO chips so also that
would require some further thought (e.g. using the interface name
instead).
Johan
Powered by blists - more mailing lists