From: Manivannan Sadhasivam <mani@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Johan Hovold <johan@kernel.org>,
Greg KH <gregkh@linuxfoundation.org>,
linux-usb <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
patong.mxl@gmail.com,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
angelo.dureghello@timesys.com,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH v5 2/3] usb: serial: xr_serial: Add gpiochip support
Date: Tue, 1 Dec 2020 23:30:18 +0530 [thread overview]
Message-ID: <20201201180018.GA78529@thinkpad> (raw)
In-Reply-To: <CACRpkdbY-aZB1BAD=JkZAHA+OQvpH12AD3tLAp6Nf1hwr74s9A@mail.gmail.com>
Hi Linus,
On Tue, Dec 01, 2020 at 03:37:38PM +0100, Linus Walleij wrote:
> On Sun, Nov 22, 2020 at 6:08 PM Manivannan Sadhasivam <mani@kernel.org> wrote:
>
> > Add gpiochip support for Maxlinear/Exar USB to serial converter
> > for controlling the available gpios.
> >
> > Inspired from cp210x usb to serial converter driver.
> >
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: linux-gpio@vger.kernel.org
> > Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
>
> This looks good to me overall, provided that it plays well with the
> serial port.
>
> One minor notice:
>
> > +enum gpio_pins {
> > + GPIO_RI = 0,
> > + GPIO_CD,
> > + GPIO_DSR,
> > + GPIO_DTR,
> > + GPIO_CTS,
> > + GPIO_RTS,
> > + GPIO_MAX,
> > +};
>
> You know the names of the pins...
>
> > + port_priv->gc.ngpio = 6;
> > + port_priv->gc.label = "xr_gpios";
> > + port_priv->gc.request = xr_gpio_request;
> > + port_priv->gc.free = xr_gpio_free;
> > + port_priv->gc.get_direction = xr_gpio_direction_get;
> > + port_priv->gc.direction_input = xr_gpio_direction_input;
> > + port_priv->gc.direction_output = xr_gpio_direction_output;
> > + port_priv->gc.get = xr_gpio_get;
> > + port_priv->gc.set = xr_gpio_set;
> > + port_priv->gc.owner = THIS_MODULE;
> > + port_priv->gc.parent = &port->dev;
> > + port_priv->gc.base = -1;
> > + port_priv->gc.can_sleep = true;
>
> So assign port_priv->gc.names here as well with an array
> of strings with the names ("RI", "CD", ... etc).
> This makes it look really nice in userspace if you do
> e.g. "lsgpio".
>
As Johan stated, this doesn't work with multiple devices attached to the system.
That's the reason for not adding the line names.
This gives me the motivation to get my hands dirty with gpiolib (but I fear of
breaking the ABI)...
> With that:
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
Thanks for the review!
Regards,
Mani
> Yours,
> Linus Walleij
next prev parent reply other threads:[~2020-12-01 18:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201122170822.21715-1-mani@kernel.org>
2020-11-22 17:08 ` [PATCH v5 2/3] usb: serial: xr_serial: Add gpiochip support Manivannan Sadhasivam
2020-12-01 14:37 ` Linus Walleij
2020-12-01 15:51 ` Johan Hovold
2020-12-05 22:21 ` Linus Walleij
2020-12-08 9:58 ` Johan Hovold
2020-12-08 12:41 ` Linus Walleij
2020-12-08 12:52 ` Manivannan Sadhasivam
2020-12-09 15:31 ` Johan Hovold
2020-12-09 15:25 ` Johan Hovold
2020-12-09 16:25 ` Linus Walleij
2020-12-10 8:53 ` Johan Hovold
2020-12-10 9:04 ` Johan Hovold
2020-12-12 0:03 ` Linus Walleij
2020-12-14 8:58 ` Johan Hovold
2020-12-14 9:19 ` Linus Walleij
2020-12-14 9:31 ` Johan Hovold
2020-12-01 18:00 ` Manivannan Sadhasivam [this message]
2021-01-21 11:06 ` Johan Hovold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201201180018.GA78529@thinkpad \
--to=mani@kernel.org \
--cc=angelo.dureghello@timesys.com \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=patong.mxl@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).