From: Linus Walleij <linus.walleij@linaro.org> To: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Cc: Alexandre Courbot <gnurou@gmail.com>, "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>, Jason Cooper <jason@lakedaemon.net>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>, "open list:WOLFSON MICROELECTRONICS DRIVERS" <patches@opensource.wolfsonmicro.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Rob Herring <robh+dt@kernel.org>, "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>, Mark Brown <broonie@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Lee Jones <lee.jones@linaro.org> Subject: Re: [PATCH v2 12/18] gpio: madera: Support Cirrus Logic Madera class codecs Date: Fri, 28 Apr 2017 09:46:49 +0200 [thread overview] Message-ID: <CACRpkdbkvG+P2=4yPgQdo4cfZ708QbzdT=GSw_EcZP9K+BeHVA@mail.gmail.com> (raw) In-Reply-To: <1493131461.4826.66.camel@rf-debian.wolfsonmicro.main> On Tue, Apr 25, 2017 at 4:44 PM, Richard Fitzgerald <rf@opensource.wolfsonmicro.com> wrote: > On Tue, 2017-04-25 at 16:13 +0200, Linus Walleij wrote: >> On Mon, Apr 24, 2017 at 6:08 PM, Richard Fitzgerald >> <rf@opensource.wolfsonmicro.com> wrote: >> >> > This adds support for the GPIOs on Cirrus Logic Madera class codecs. >> > Any pins not used for special functions (see the pinctrl driver) can be >> > used as general single-bit input or output lines. The number of available >> > GPIOs varies between codecs. >> > >> > Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com> >> > Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> >> > Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> >> > --- >> > Changes from V1: >> > - dt bindings moved to a separate patch >> > - dependent on pinctrl driver instead of parent MFD >> > - added get_direction function >> > - added .request / .free / .set_config to work with pinctrl driver >> > - register range with pinctrl driver >> >> Nice, but... >> >> > + ret = gpiochip_add_pin_range(&madera_gpio->gpio_chip, "madera-pinctrl", >> > + 0, 0, madera_gpio->gpio_chip.ngpio); >> > + if (ret) { >> > + dev_warn(&pdev->dev, "Failed to add pin range (%d)\n", ret); >> > + return ret; >> > + } >> >> This is all fine, but we have generic code for adding ranges from >> the device tree, see >> Documentation/devicetree/bindings/gpio/gpio.txt >> > > The range of gpio pins is a fixed property of the chip, and so is the > combination of gpio+pinctrl drivers. Well so is the IRQ number, but we still put that in the device tree. > I think the general principle of the DT maintainers is that DT should be > used for things that the drivers don't already know and can't figure > out. It's a grayzone. People use ranges in the device tree for example when there are several instances of the same GPIO block with different ranges into a single pin controller and then it makes sense. But in this case you have your separate chip with one instance so it doesn't make sense, keep it like this. Also it is necessary to proble from boardfiles as you explained in the pinctrl patch. Good job, it's a nice driver. Also the pinctrl driver is very nice. Yours, Linus Walleij
WARNING: multiple messages have this Message-ID (diff)
From: Linus Walleij <linus.walleij@linaro.org> To: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Cc: Lee Jones <lee.jones@linaro.org>, Mark Brown <broonie@kernel.org>, Alexandre Courbot <gnurou@gmail.com>, Rob Herring <robh+dt@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Jason Cooper <jason@lakedaemon.net>, "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>, "open list:WOLFSON MICROELECTRONICS DRIVERS" <patches@opensource.wolfsonmicro.com>, "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> Subject: Re: [PATCH v2 12/18] gpio: madera: Support Cirrus Logic Madera class codecs Date: Fri, 28 Apr 2017 09:46:49 +0200 [thread overview] Message-ID: <CACRpkdbkvG+P2=4yPgQdo4cfZ708QbzdT=GSw_EcZP9K+BeHVA@mail.gmail.com> (raw) In-Reply-To: <1493131461.4826.66.camel@rf-debian.wolfsonmicro.main> On Tue, Apr 25, 2017 at 4:44 PM, Richard Fitzgerald <rf@opensource.wolfsonmicro.com> wrote: > On Tue, 2017-04-25 at 16:13 +0200, Linus Walleij wrote: >> On Mon, Apr 24, 2017 at 6:08 PM, Richard Fitzgerald >> <rf@opensource.wolfsonmicro.com> wrote: >> >> > This adds support for the GPIOs on Cirrus Logic Madera class codecs. >> > Any pins not used for special functions (see the pinctrl driver) can be >> > used as general single-bit input or output lines. The number of available >> > GPIOs varies between codecs. >> > >> > Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com> >> > Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> >> > Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> >> > --- >> > Changes from V1: >> > - dt bindings moved to a separate patch >> > - dependent on pinctrl driver instead of parent MFD >> > - added get_direction function >> > - added .request / .free / .set_config to work with pinctrl driver >> > - register range with pinctrl driver >> >> Nice, but... >> >> > + ret = gpiochip_add_pin_range(&madera_gpio->gpio_chip, "madera-pinctrl", >> > + 0, 0, madera_gpio->gpio_chip.ngpio); >> > + if (ret) { >> > + dev_warn(&pdev->dev, "Failed to add pin range (%d)\n", ret); >> > + return ret; >> > + } >> >> This is all fine, but we have generic code for adding ranges from >> the device tree, see >> Documentation/devicetree/bindings/gpio/gpio.txt >> > > The range of gpio pins is a fixed property of the chip, and so is the > combination of gpio+pinctrl drivers. Well so is the IRQ number, but we still put that in the device tree. > I think the general principle of the DT maintainers is that DT should be > used for things that the drivers don't already know and can't figure > out. It's a grayzone. People use ranges in the device tree for example when there are several instances of the same GPIO block with different ranges into a single pin controller and then it makes sense. But in this case you have your separate chip with one instance so it doesn't make sense, keep it like this. Also it is necessary to proble from boardfiles as you explained in the pinctrl patch. Good job, it's a nice driver. Also the pinctrl driver is very nice. Yours, Linus Walleij
next prev parent reply other threads:[~2017-04-28 7:46 UTC|newest] Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-04-24 16:08 [PATCH v2 00/18] Add support for Cirrus Logic CS47L35/L85/L90/L91 codecs Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald 2017-04-24 16:08 ` [PATCH v2 01/18] mfd: madera: Add register definitions for Cirrus Logic Madera codecs Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald [not found] ` <1493050124-5970-2-git-send-email-rf-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 2017-05-23 7:20 ` Lee Jones 2017-05-23 7:20 ` Lee Jones 2017-07-13 8:02 ` Lee Jones 2017-07-13 8:02 ` Lee Jones 2017-07-13 10:05 ` Mark Brown 2017-07-13 12:44 ` Richard Fitzgerald 2017-07-13 12:44 ` Richard Fitzgerald [not found] ` <1499949850.4826.88.camel-WeElTRBN8n0bEPBeyYQi64iQ8/zYDDdY1BehtkLrGTY@public.gmane.org> 2017-07-13 13:03 ` Mark Brown 2017-07-13 13:03 ` Mark Brown 2017-07-14 11:50 ` Richard Fitzgerald 2017-07-14 11:50 ` Richard Fitzgerald 2017-07-14 12:06 ` [alsa-devel] " Takashi Iwai 2017-04-24 16:08 ` [PATCH v2 02/18] mfd: madera: Add common support " Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald [not found] ` <1493050124-5970-3-git-send-email-rf-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 2017-05-22 17:39 ` Lee Jones 2017-05-22 17:39 ` Lee Jones 2017-04-24 16:08 ` [PATCH v2 03/18] dt-bindings: mfd: Add bindings " Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald 2017-04-28 18:07 ` Rob Herring 2017-05-22 17:40 ` Lee Jones 2017-04-24 16:08 ` [PATCH v2 04/18] mfd: madera: Register map tables for Cirrus Logic CS47L35 Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald [not found] ` <1493050124-5970-5-git-send-email-rf-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 2017-05-23 7:22 ` Lee Jones 2017-05-23 7:22 ` Lee Jones 2017-04-24 16:08 ` [PATCH v2 05/18] mfd: madera: Register map tables for Cirrus Logic CS47L85 Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald [not found] ` <1493050124-5970-6-git-send-email-rf-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 2017-05-23 7:23 ` Lee Jones 2017-05-23 7:23 ` Lee Jones [not found] ` <1493050124-5970-1-git-send-email-rf-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 2017-04-24 16:08 ` [PATCH v2 06/18] mfd: madera: Register map tables for Cirrus Logic CS47L90/91 Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald 2017-05-23 7:24 ` Lee Jones 2017-04-24 16:08 ` [PATCH v2 07/18] regulator: arizona-micsupp: Add support for Cirrus Logic Madera codecs Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald [not found] ` <1493050124-5970-8-git-send-email-rf-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 2017-04-28 18:07 ` Rob Herring 2017-04-28 18:07 ` Rob Herring 2017-04-24 16:08 ` [PATCH v2 10/18] pinctrl: madera: Add driver " Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald 2017-04-25 9:41 ` Linus Walleij 2017-04-25 9:41 ` Linus Walleij 2017-04-25 10:26 ` Richard Fitzgerald 2017-04-25 10:26 ` Richard Fitzgerald 2017-04-28 7:39 ` Linus Walleij 2017-04-28 7:39 ` Linus Walleij 2017-05-20 20:06 ` Paul Gortmaker 2017-05-20 20:06 ` Paul Gortmaker 2017-04-24 16:08 ` [PATCH v2 14/18] ASoC: madera: Add common support " Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald 2017-04-24 16:08 ` [PATCH v2 15/18] dt-bindings: sound: Add bindings " Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald 2017-04-25 15:52 ` Mark Brown 2017-04-25 15:52 ` Mark Brown 2017-04-25 16:27 ` Richard Fitzgerald 2017-04-25 16:27 ` Richard Fitzgerald 2017-05-14 10:04 ` Mark Brown 2017-04-28 18:06 ` Rob Herring 2017-04-24 16:08 ` [PATCH v2 08/18] regulator: arizona-ldo1: Add support " Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald 2017-04-24 16:08 ` [PATCH v2 09/18] irqchip: Add driver " Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald [not found] ` <1493050124-5970-10-git-send-email-rf-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 2017-05-10 15:03 ` Thomas Gleixner 2017-05-10 15:03 ` Thomas Gleixner 2017-04-24 16:08 ` [PATCH v2 11/18] dt-bindings: pinctrl: Add bindings " Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald 2017-04-25 9:35 ` Linus Walleij 2017-04-25 9:35 ` Linus Walleij [not found] ` <1493050124-5970-12-git-send-email-rf-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 2017-04-28 18:16 ` Rob Herring 2017-04-28 18:16 ` Rob Herring 2017-04-24 16:08 ` [PATCH v2 12/18] gpio: madera: Support Cirrus Logic Madera class codecs Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald [not found] ` <1493050124-5970-13-git-send-email-rf-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 2017-04-25 14:13 ` Linus Walleij 2017-04-25 14:13 ` Linus Walleij 2017-04-25 14:44 ` Richard Fitzgerald 2017-04-25 14:44 ` Richard Fitzgerald 2017-04-28 7:46 ` Linus Walleij [this message] 2017-04-28 7:46 ` Linus Walleij 2017-04-28 7:44 ` Linus Walleij 2017-04-28 7:44 ` Linus Walleij 2017-04-24 16:08 ` [PATCH v2 13/18] dt-bindings: gpio: Add bindings for GPIO on Cirrus Logic Madera codecs Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald 2017-04-25 9:42 ` Linus Walleij 2017-04-25 9:42 ` Linus Walleij 2017-04-28 18:17 ` Rob Herring 2017-04-24 16:08 ` [PATCH v2 16/18] ASoC: cs47l35: Add codec driver for Cirrus Logic CS47L35 Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald 2017-04-24 16:08 ` [PATCH v2 17/18] ASoC: cs47l85: Add codec driver for Cirrus Logic CS47L85 Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald 2017-04-24 16:08 ` [PATCH v2 18/18] ASoC: cs47l90: Add codec driver for Cirrus Logic CS47L90 Richard Fitzgerald 2017-04-24 16:08 ` Richard Fitzgerald
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='CACRpkdbkvG+P2=4yPgQdo4cfZ708QbzdT=GSw_EcZP9K+BeHVA@mail.gmail.com' \ --to=linus.walleij@linaro.org \ --cc=alsa-devel@alsa-project.org \ --cc=broonie@kernel.org \ --cc=devicetree@vger.kernel.org \ --cc=gnurou@gmail.com \ --cc=jason@lakedaemon.net \ --cc=lee.jones@linaro.org \ --cc=linux-gpio@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=patches@opensource.wolfsonmicro.com \ --cc=rf@opensource.wolfsonmicro.com \ --cc=robh+dt@kernel.org \ --cc=tglx@linutronix.de \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.