From: Geert Uytterhoeven <geert@linux-m68k.org> To: Linus Walleij <linus.walleij@linaro.org> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>, Jonathan Corbet <corbet@lwn.net>, Harish Jenny K N <harish_kandiga@mentor.com>, Eugeniu Rosca <erosca@de.adit-jv.com>, Alexander Graf <graf@amazon.com>, Peter Maydell <peter.maydell@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Phil Reid <preid@electromag.com.au>, Marc Zyngier <marc.zyngier@arm.com>, Christoffer Dall <christoffer.dall@arm.com>, Magnus Damm <magnus.damm@gmail.com>, Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>, "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>, Linux Doc Mailing List <linux-doc@vger.kernel.org>, Linux-Renesas <linux-renesas-soc@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, QEMU Developers <qemu-devel@nongnu.org> Subject: Re: [PATCH v6 4/8] gpiolib: Add support for GPIO lookup by line name Date: Mon, 11 May 2020 12:18:22 +0200 Message-ID: <CAMuHMdXskE8_A4gbFVWfPVdcxBO-CfaMDEehSxGAK_aC0MQ7=A@mail.gmail.com> (raw) In-Reply-To: <CACRpkdbN82n3B+Q-QVjB1jLpJAYS19fKukkDXQm3gZsuFFFM_w@mail.gmail.com> Hi Linus, On Thu, Mar 26, 2020 at 10:18 PM Linus Walleij <linus.walleij@linaro.org> wrote: > On Tue, Mar 24, 2020 at 2:57 PM Geert Uytterhoeven > <geert+renesas@glider.be> wrote: > > Currently a GPIO lookup table can only refer to a specific GPIO by a > > tuple, consisting of a GPIO controller label and a GPIO offset inside > > the controller. > > > > However, a GPIO may also carry a line name, defined by DT or ACPI. > > If present, the line name is the most use-centric way to refer to a > > GPIO. Hence add support for looking up GPIOs by line name. > > > > Implement this by reusing the existing gpiod_lookup infrastructure. > > Rename gpiod_lookup.chip_label to gpiod_lookup.key, to make it clear > > that this field can have two meanings, and update the kerneldoc and > > GPIO_LOOKUP*() macros. > > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > > Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu> > > Reviewed-by: Eugeniu Rosca <erosca@de.adit-jv.com> > > Tested-by: Eugeniu Rosca <erosca@de.adit-jv.com> > > I kind of like this approach, however there are things here that > need to be considered: the line name is in no way globally unique, > and I think there are already quite a few GPIO chips that > have the same line names assigned for every instance of that > chip. > > gpiochip_set_desc_names() only warns if there is a line with > the same name on the same gpio_chip. on a _different_ gpio chip. > I suppose we need to document that the line name look-up > will be on a first-come-first-served basis: whatever line > we find first with this name is what you will get a reference > to, no matter what chip it is on, and it is possible albeit > not recommended that some other chip has a line with the > same name. Agreed. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
next prev parent reply index Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-03-24 13:53 [PATCH v6 0/8] gpio: Add GPIO Aggregator Geert Uytterhoeven 2020-03-24 13:56 ` [PATCH v6 1/8] ARM: integrator: impd1: Use GPIO_LOOKUP() helper macro Geert Uytterhoeven 2020-03-24 13:56 ` [PATCH v6 2/8] i2c: i801: " Geert Uytterhoeven 2020-03-25 9:14 ` Jean Delvare 2020-04-15 10:57 ` Wolfram Sang 2020-03-24 13:56 ` [PATCH v6 3/8] mfd: sm501: Use GPIO_LOOKUP_IDX() " Geert Uytterhoeven 2020-04-15 9:25 ` Lee Jones 2020-03-24 13:56 ` [PATCH v6 4/8] gpiolib: Add support for GPIO lookup by line name Geert Uytterhoeven 2020-03-26 21:18 ` Linus Walleij 2020-05-11 10:18 ` Geert Uytterhoeven [this message] 2020-03-24 13:56 ` [PATCH v6 5/8] gpiolib: Introduce gpiod_set_config() Geert Uytterhoeven 2020-03-26 21:26 ` Linus Walleij 2020-03-27 8:45 ` Geert Uytterhoeven 2020-03-27 21:33 ` Linus Walleij 2020-03-27 21:37 ` Linus Walleij 2020-03-24 13:56 ` [PATCH v6 6/8] gpio: Add GPIO Aggregator Geert Uytterhoeven 2020-03-24 13:56 ` [PATCH v6 7/8] docs: gpio: Add GPIO Aggregator documentation Geert Uytterhoeven 2020-03-24 13:56 ` [PATCH v6 8/8] MAINTAINERS: Add GPIO Aggregator section Geert Uytterhoeven 2020-03-26 21:07 ` [PATCH v6 1/8] ARM: integrator: impd1: Use GPIO_LOOKUP() helper macro Linus Walleij
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='CAMuHMdXskE8_A4gbFVWfPVdcxBO-CfaMDEehSxGAK_aC0MQ7=A@mail.gmail.com' \ --to=geert@linux-m68k.org \ --cc=bgolaszewski@baylibre.com \ --cc=christoffer.dall@arm.com \ --cc=corbet@lwn.net \ --cc=erosca@de.adit-jv.com \ --cc=graf@amazon.com \ --cc=harish_kandiga@mentor.com \ --cc=linus.walleij@linaro.org \ --cc=linux-doc@vger.kernel.org \ --cc=linux-gpio@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-renesas-soc@vger.kernel.org \ --cc=magnus.damm@gmail.com \ --cc=marc.zyngier@arm.com \ --cc=mark.rutland@arm.com \ --cc=pbonzini@redhat.com \ --cc=peter.maydell@linaro.org \ --cc=preid@electromag.com.au \ --cc=qemu-devel@nongnu.org \ --cc=robh+dt@kernel.org \ /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
Linux-Renesas-SoC Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/linux-renesas-soc/0 linux-renesas-soc/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 linux-renesas-soc linux-renesas-soc/ https://lore.kernel.org/linux-renesas-soc \ linux-renesas-soc@vger.kernel.org public-inbox-index linux-renesas-soc Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.linux-renesas-soc AGPL code for this site: git clone https://public-inbox.org/public-inbox.git