From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Charles Mirabile <cmirabil@redhat.com>, linux-kernel@vger.kernel.org
Cc: Serge Schneider <serge@raspberrypi.org>,
Stefan Wahren <stefan.wahren@i2se.com>,
Nicolas Saenz Julienne <nsaenzju@redhat.com>,
Mattias Brugger <mbrugger@suse.com>,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
fedora-rpi@googlegroups.com, Miguel Ojeda <ojeda@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Lee Jones <lee.jones@linaro.org>,
devicetree@vger.kernel.org, linux-input@vger.kernel.org,
Mwesigwa Guma <mguma@redhat.com>,
Joel Savitz <jsavitz@redhat.com>
Subject: Re: [PATCH v8 4/6] dt-bindings: mfd: sensehat: Add Raspberry Pi Sense HAT schema
Date: Wed, 13 Apr 2022 15:38:51 +0200 [thread overview]
Message-ID: <79281f23-1eb8-6659-d126-eaa608c7abe5@linaro.org> (raw)
In-Reply-To: <20220412201343.8074-5-cmirabil@redhat.com>
On 12/04/2022 22:13, Charles Mirabile wrote:
> This patch adds the device tree bindings for the Sense HAT
> and each of its children devices in yaml form.
>
Thank you for your patch. There is something to discuss/improve.
> +description:
> + This device is part of the sensehat multi function device.
> + For more information see ../mfd/raspberrypi,sensehat.yaml.
> +
> + This device features a programmable 8x8 RGB LED matrix.
> +
> +properties:
> + compatible:
> + const: raspberrypi,sensehat-display
This binding is practically empty, so I wonder what's is purpose? Do you
plan to grow it? If this was already explained, sorry for bringing it up
again... :)
> +
> +required:
> + - compatible
> +
> +additionalProperties: false
> diff --git a/Documentation/devicetree/bindings/input/raspberrypi,sensehat-joystick.yaml b/Documentation/devicetree/bindings/input/raspberrypi,sensehat-joystick.yaml
> new file mode 100644
> index 000000000000..c97cd1d8eac6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/raspberrypi,sensehat-joystick.yaml
> @@ -0,0 +1,33 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/raspberrypi,sensehat-joystick.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Raspberry Pi Sensehat Joystick
> +
> +maintainers:
> + - Charles Mirabile <cmirabil@redhat.com>
> + - Mwesigwa Guma <mguma@redhat.com>
> + - Joel Savitz <jsavitz@redhat.com>
> +
> +description:
> + This device is part of the sensehat multi function device.
> + For more information see ../mfd/raspberrypi,sensehat.yaml.
> +
> + This device features a five button joystick (up, down,left,
> + right, click)
> +
> +properties:
> + compatible:
> + const: raspberrypi,sensehat-joystick
> +
> + interrupts:
> + items:
> + - description: pin number for joystick interrupt
Description is obvious, so just "maxItems: 1"
> +
> +required:
> + - compatible
> + - interrupts
> +
> +additionalProperties: false
> diff --git a/Documentation/devicetree/bindings/mfd/raspberrypi,sensehat.yaml b/Documentation/devicetree/bindings/mfd/raspberrypi,sensehat.yaml
> new file mode 100644
> index 000000000000..2484ec91b430
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/raspberrypi,sensehat.yaml
> @@ -0,0 +1,69 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/raspberrypi,sensehat.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Raspberry Pi Sensehat
> +
> +maintainers:
> + - Charles Mirabile <cmirabil@redhat.com>
> + - Mwesigwa Guma <mguma@redhat.com>
> + - Joel Savitz <jsavitz@redhat.com>
> +
> +description:
> + The Raspberry Pi Sensehat is an addon board originally developed
> + for the Raspberry Pi that has a joystick and an 8x8 RGB LED display
> + as well as several environmental sensors. It connects via i2c and
> + a gpio for irq.
> +
> +properties:
> + compatible:
> + const: raspberrypi,sensehat
> +
> + reg:
> + items:
> + - description: i2c device address
Description is obvious, so just "maxItems: 1"
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 0
Why do you need these? You are not allowing any children with unit
addresses.
> +
> + "joystick":
> + $ref: ../input/raspberrypi,sensehat-joystick.yaml
Full path, so "/schemas/input/raspberrypi,sensehat-joystick.yaml#"
> +
> + "display":
> + $ref: ../auxdisplay/raspberrypi,sensehat-display.yaml
The same.
> +
> +required:
> + - compatible
> + - reg
> + - "#address-cells"
> + - "#size-cells"
> + - joystick
> + - display
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + sensehat@46 {
Generic node names please, so "hat".
> + #address-cells = <1>;
> + #size-cells = <0>;
> + compatible = "raspberrypi,sensehat";
> + reg = <0x46>;
Could you put compatible and then reg at beginning of properties (before
address/size)? It is more common convention and these are more important
properties.
> + display {
> + compatible = "raspberrypi,sensehat-display";
> + };
> + joystick {
> + compatible = "raspberrypi,sensehat-joystick";
> + interrupts = <23 GPIO_ACTIVE_HIGH>;
This does not look like proper interrupt flag. Wrong constant.
> + };
> + };
> + };
Best regards,
Krzysztof
next prev parent reply other threads:[~2022-04-13 13:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220412201343.8074-1-cmirabil@redhat.com>
2022-04-12 20:13 ` [PATCH v8 4/6] dt-bindings: mfd: sensehat: Add Raspberry Pi Sense HAT schema Charles Mirabile
2022-04-13 13:38 ` Krzysztof Kozlowski [this message]
2022-04-13 13:40 ` 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=79281f23-1eb8-6659-d126-eaa608c7abe5@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=cmirabil@redhat.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=fedora-rpi@googlegroups.com \
--cc=jsavitz@redhat.com \
--cc=krzk+dt@kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=mbrugger@suse.com \
--cc=mguma@redhat.com \
--cc=nsaenzju@redhat.com \
--cc=ojeda@kernel.org \
--cc=robh+dt@kernel.org \
--cc=serge@raspberrypi.org \
--cc=stefan.wahren@i2se.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).