linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martyn Welch <martyn.welch@collabora.co.uk>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Johan Hovold <johan@kernel.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Karl Palsson <karlp@tweak.net.au>,
	Konstantin Shkolnyy <Konstantin.Shkolnyy@silabs.com>,
	Peter Senna Tschudin <peter.senna@collabora.com>
Subject: Re: [PATCH v10 1/1] USB: serial: cp210x: Adding GPIO support for CP2105
Date: Mon, 31 Oct 2016 10:17:44 +0000	[thread overview]
Message-ID: <20161031101744.GA11986@hermes.home> (raw)
In-Reply-To: <CACRpkdab5d71TgrTD-4U95R6MvWdFcaqRcGpPS0D8sExKi=b3g@mail.gmail.com>

On Tue, Oct 25, 2016 at 11:34:40AM +0200, Linus Walleij wrote:
> Good work on this patch, nice that it got merged.
> 
> I was just thinking that as an add-on, you may want to name
> the gpio lines so they have meaningful names in userspace
> when you use this with the chardev (I have reasons to believe
> these GPIOs will be used from userspace, tell me if that
> is wrong).
> 

Yeah, they are.

> We currently support naming lines for devicetree and
> ACPI (in -next).
> 

I'm not sure this would be a good fit for the current use case I've been
working on, as I understand there might be an arbitary number of devices
plugged in. The same chip may also get used in more than one way (in the
current use case, the Vendor/Product IDs actually get get to determine the
use case.

Originally I did name the GPIO as either SCI or ECI, in the case of the
CP2105, being able to distinguish between the two banks can be helpful
during debug (but isn't essential and didn't actually seem to help when
trying to programatically parse though the available banks of GPIO in user
space to find the ones that were interesting). However this doesn't
translate so well to the other chips in the CP210x family as the GPIO is
implemented differently for the majority of those (they don't mux pins from
the serial ports).

I have seen such chips actually used inside of units, so being able to name
the GPIO would be quite useful there, though that naming would need to only
be applied to specific devices and not to other devices plugged in
externally.

Martyn


      parent reply	other threads:[~2016-10-31 10:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20  8:13 [PATCH v10 1/1] USB: serial: cp210x: Adding GPIO support for CP2105 Martyn Welch
     [not found] ` <33cb529dad5c28a135e9e21460582c3cc4e6d4b5.1476950450.git.martyn.welch-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
2016-10-20  8:49   ` Johan Hovold
2016-10-20 13:31     ` Martyn Welch
2016-10-25  9:34 ` Linus Walleij
     [not found]   ` <CACRpkdab5d71TgrTD-4U95R6MvWdFcaqRcGpPS0D8sExKi=b3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-26  9:09     ` Johan Hovold
2016-10-26 11:50       ` Linus Walleij
2016-10-26 12:16         ` Johan Hovold
2016-10-31 10:17   ` Martyn Welch [this message]

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=20161031101744.GA11986@hermes.home \
    --to=martyn.welch@collabora.co.uk \
    --cc=Konstantin.Shkolnyy@silabs.com \
    --cc=gnurou@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=karlp@tweak.net.au \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.senna@collabora.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).