alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: "Amelie Delaunay" <amelie.delaunay@st.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Matti Vaittinen" <matti.vaittinen@fi.rohmeurope.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	alsa-devel@alsa-project.org, "Stefan Agner" <stefan@agner.ch>,
	"Bjorn Andersson" <bjorn.andersson@linaro.org>,
	"Paul Cercueil" <paul@crapouillou.net>,
	"Masahiro Yamada" <yamada.masahiro@socionext.com>,
	"Chris Brandt" <chris.brandt@renesas.com>,
	"Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	linux-riscv@lists.infradead.org,
	"Fabio Estevam" <festevam@gmail.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	"Alexandre Torgue" <alexandre.torgue@st.com>,
	linux-renesas-soc@vger.kernel.org,
	"Laurent Pinchart" <laurent.pinchart+renesas@ideasonboard.com>,
	"Anson Huang" <Anson.Huang@nxp.com>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Chen-Yu Tsai" <wens@csie.org>, "Andy Gross" <agross@kernel.org>,
	bcm-kernel-feedback-list@broadcom.com,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Andy Teng" <andy.teng@mediatek.com>,
	"Jacopo Mondi" <jacopo+renesas@jmondi.org>,
	"Sungbo Eo" <mans0n@gorani.run>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	"Cristian Ciocaltea" <cristian.ciocaltea@gmail.com>,
	"Charles Keepax" <ckeepax@opensource.cirrus.com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Ray Jui" <rjui@broadcom.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	linux-gpio@vger.kernel.org,
	"Richard Fitzgerald" <rf@opensource.cirrus.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	linux-mediatek@lists.infradead.org,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Sricharan R" <sricharan@codeaurora.org>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Hoan Tran" <hoan@os.amperecomputing.com>,
	linux-arm-kernel@lists.infradead.org,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Scott Branden" <sbranden@broadcom.com>,
	linux-unisoc@lists.infradead.org,
	- <patches@opensource.cirrus.com>,
	"Chris Packham" <chris.packham@alliedtelesis.co.nz>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Serge Semin" <fancer.lancer@gmail.com>,
	linux-kernel@vger.kernel.org,
	"Paul Kocialkowski" <paul.kocialkowski@bootlin.com>,
	"Yash Shah" <yash.shah@sifive.com>,
	"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	linux-media@vger.kernel.org, "Shawn Guo" <shawnguo@kernel.org>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [PATCH v2 01/13] dt-bindings: gpio: add common schema for GPIO controllers
Date: Thu, 17 Sep 2020 23:09:36 +0300	[thread overview]
Message-ID: <20200917200936.GF3969@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200917165301.23100-2-krzk@kernel.org>

Hi Krzysztof,

Thank you for the patch.

On Thu, Sep 17, 2020 at 06:52:49PM +0200, Krzysztof Kozlowski wrote:
> Convert parts of gpio.txt bindings into common dtschema file for GPIO
> controllers.

How about deleting the part that has been converted from gpio.txt ?

> The schema enforces proper naming of GPIO controller nodes and GPIO
> hogs.
> 
> The schema should be included by specific GPIO controllers bindings.

Instead of including it manually, could we use a conditional select: to
apply the schema automatically when a gpio-controller property is
present ?

> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> ---
> 
> Changes since v1:
> 1. Do not require compatible (some child nodes are gpio-controllers
>    without the compatible).
> ---
>  .../devicetree/bindings/gpio/gpio-common.yaml | 125 ++++++++++++++++++
>  1 file changed, 125 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-common.yaml
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-common.yaml b/Documentation/devicetree/bindings/gpio/gpio-common.yaml
> new file mode 100644
> index 000000000000..af9f6c7feeec
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/gpio-common.yaml
> @@ -0,0 +1,125 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gpio/gpio-common.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Common GPIO controller properties
> +
> +maintainers:
> +  - Krzysztof Kozlowski <krzk@kernel.org>
> +  - Linus Walleij <linus.walleij@linaro.org>
> +
> +properties:
> +  nodename:
> +    pattern: "^(gpio-controller|gpio)(@[0-9a-f]+|-[0-9a-f]+)?$"
> +
> +  '#gpio-cells': true
> +  gpio-controller: true
> +  gpio-ranges: true
> +
> +  gpio-line-names:
> +    description: |
> +      Optionally, a GPIO controller may have a "gpio-line-names" property. This
> +      is an array of strings defining the names of the GPIO lines going out of
> +      the GPIO controller. This name should be the most meaningful producer
> +      name for the system, such as a rail name indicating the usage. Package
> +      names such as pin name are discouraged: such lines have opaque names
> +      (since they are by definition generic purpose) and such names are usually
> +      not very helpful.
> +
> +      For example "MMC-CD", "Red LED Vdd" and "ethernet reset" are reasonable
> +      line names as they describe what the line is used for. "GPIO0" is not a
> +      good name to give to a GPIO line.
> +
> +      Placeholders are discouraged: rather use the "" (blank string) if the use
> +      of the GPIO line is undefined in your design. The names are assigned
> +      starting from line offset 0 from left to right from the passed array. An
> +      incomplete array (where the number of passed named are less than ngpios)
> +      will still be used up until the last provided valid line index.
> +
> +  gpio-reserved-ranges:
> +    description:
> +      Indicates the start and size of the GPIOs that can't be used.
> +
> +  ngpios:
> +    description: |
> +      Optionally, a GPIO controller may have a "ngpios" property. This property
> +      indicates the number of in-use slots of available slots for GPIOs. The
> +      typical example is something like this: the hardware register is 32 bits
> +      wide, but only 18 of the bits have a physical counterpart. The driver is
> +      generally written so that all 32 bits can be used, but the IP block is
> +      reused in a lot of designs, some using all 32 bits, some using 18 and
> +      some using 12. In this case, setting "ngpios = <18>;" informs the driver
> +      that only the first 18 GPIOs, at local offset 0 .. 17, are in use.
> +
> +      If these GPIOs do not happen to be the first N GPIOs at offset 0...N-1,
> +      an additional set of tuples is needed to specify which GPIOs are
> +      unusable, with the gpio-reserved-ranges binding.
> +
> +patternProperties:
> +  "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
> +    type: object
> +    description:
> +      The GPIO chip may contain GPIO hog definitions. GPIO hogging is a mechanism
> +      providing automatic GPIO request and configuration as part of the
> +      gpio-controller's driver probe function.
> +      Each GPIO hog definition is represented as a child node of the GPIO controller.
> +
> +    properties:
> +      gpio-hog: true
> +      gpios: true
> +      input: true
> +      output-high: true
> +      output-low: true
> +      line-name:
> +        description:
> +          The GPIO label name. If not present the node name is used.
> +
> +    required:
> +      - gpio-hog
> +      - gpios
> +
> +    oneOf:
> +      - required:
> +          - input
> +      - required:
> +          - output-high
> +      - required:
> +          - output-low
> +
> +    additionalProperties: false
> +
> +required:
> +  - "#gpio-cells"
> +  - gpio-controller
> +
> +examples:
> +  - |
> +    gpio-controller@15000000 {
> +        compatible = "foo";
> +        reg = <0x15000000 0x1000>;
> +        gpio-controller;
> +        #gpio-cells = <2>;
> +        ngpios = <18>;
> +        gpio-reserved-ranges = <0 4>, <12 2>;
> +        gpio-line-names = "MMC-CD", "MMC-WP", "VDD eth", "RST eth", "LED R",
> +                          "LED G", "LED B", "Col A", "Col B", "Col C", "Col D",
> +                          "Row A", "Row B", "Row C", "Row D", "NMI button",
> +                          "poweroff", "reset";
> +    };
> +
> +  - |
> +    gpio-controller@1400 {
> +        compatible = "fsl,qe-pario-bank-a", "fsl,qe-pario-bank";
> +        reg = <0x1400 0x18>;
> +        gpio-controller;
> +        #gpio-cells = <2>;
> +
> +        line-b-hog {
> +            gpio-hog;
> +            gpios = <6 0>;
> +            input;
> +            line-name = "foo-bar-gpio";
> +        };
> +    };

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2020-09-21  8:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 16:52 [PATCH v2 00/13] gpio: add common dtschema Krzysztof Kozlowski
2020-09-17 16:52 ` [PATCH v2 01/13] dt-bindings: gpio: add common schema for GPIO controllers Krzysztof Kozlowski
2020-09-17 20:09   ` Laurent Pinchart [this message]
2020-09-18  7:52     ` Krzysztof Kozlowski
2020-09-18 14:18       ` Laurent Pinchart
2020-09-18 14:30   ` Rob Herring
2020-09-20 19:39     ` Krzysztof Kozlowski
2020-09-22 15:40       ` Rob Herring
2020-09-17 16:52 ` [PATCH v2 02/13] dt-bindings: gpio: include common schema in " Krzysztof Kozlowski
2020-09-17 20:13   ` Laurent Pinchart
2020-09-17 16:52 ` [PATCH v2 03/13] dt-bindings: gpio: pl061: add missing properties and include common schema Krzysztof Kozlowski
2020-09-17 16:52 ` [PATCH v2 04/13] dt-bindings: gpio: fsl-imx-gpio: add i.MX ARMv6 and ARMv7 compatibles Krzysztof Kozlowski
2020-09-17 16:52 ` [PATCH v2 05/13] dt-bindings: gpio: fsl-imx-gpio: add gpio-line-names Krzysztof Kozlowski
2020-09-17 16:52 ` [PATCH v2 06/13] dt-bindings: gpio: gpio-vf610: fix iMX 7ULP compatible matching Krzysztof Kozlowski
2020-09-17 16:52 ` [PATCH v2 07/13] dt-bindings: media: include common schema in GPIO controllers Krzysztof Kozlowski
2020-09-17 16:52 ` [PATCH v2 08/13] dt-bindings: mfd: " Krzysztof Kozlowski
2020-09-21  9:54   ` Charles Keepax
2020-09-17 16:52 ` [PATCH v2 09/13] dt-bindings: pinctrl: " Krzysztof Kozlowski
2020-09-17 19:03   ` Paul Cercueil
2020-09-17 20:12   ` Laurent Pinchart
2020-09-21  9:55   ` Charles Keepax
2020-09-17 16:52 ` [PATCH v2 10/13] ASoC: dt-bindings: zl38060: " Krzysztof Kozlowski
2020-09-17 16:59   ` Mark Brown
2020-09-17 16:52 ` [PATCH v2 11/13] arm64: dts: imx8mq-librem5: correct GPIO hog property Krzysztof Kozlowski
2020-09-17 16:53 ` [PATCH v2 12/13] arm64: dts: imx8mq-librem5: align GPIO hog names with dtschema Krzysztof Kozlowski
2020-09-17 16:53 ` [PATCH v2 13/13] ARM: dts: imx: " Krzysztof Kozlowski

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=20200917200936.GF3969@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=Anson.Huang@nxp.com \
    --cc=afaerber@suse.de \
    --cc=agross@kernel.org \
    --cc=alexandre.torgue@st.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amelie.delaunay@st.com \
    --cc=andy.teng@mediatek.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=chris.brandt@renesas.com \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=cristian.ciocaltea@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=festevam@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=hoan@os.amperecomputing.com \
    --cc=jacopo+renesas@jmondi.org \
    --cc=kernel@pengutronix.de \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=krzk@kernel.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-unisoc@lists.infradead.org \
    --cc=magnus.damm@gmail.com \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mans0n@gorani.run \
    --cc=matthias.bgg@gmail.com \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mchehab@kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mripard@kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=palmer@dabbelt.com \
    --cc=patches@opensource.cirrus.com \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=paul.walmsley@sifive.com \
    --cc=paul@crapouillou.net \
    --cc=rf@opensource.cirrus.com \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sbranden@broadcom.com \
    --cc=sean.wang@mediatek.com \
    --cc=shawnguo@kernel.org \
    --cc=sricharan@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=stefan@agner.ch \
    --cc=tiwai@suse.com \
    --cc=wens@csie.org \
    --cc=yamada.masahiro@socionext.com \
    --cc=yash.shah@sifive.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).