From: David Mosberger-Tang <davidm@egauge.net>
To: Guenter Roeck <linux@roeck-us.net>,
Navin Sankar Velliangiri <navin@linumiz.com>
Cc: Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] hwmon: (sht4x) Add device tree match table and document it
Date: Sat, 20 Nov 2021 14:36:39 -0700 [thread overview]
Message-ID: <5f5798b3f021c419e94714ba557be0e3a40c671e.camel@egauge.net> (raw)
In-Reply-To: <4ebe1f6a-575f-2d34-7839-9055545e5e6b@roeck-us.net>
On Sat, 2021-11-20 at 13:12 -0800, Guenter Roeck wrote:
> On 11/20/21 12:40 PM, David Mosberger-Tang wrote:
> > This patch enables automatic loading of the sht4x module via a device
> > tree table entry.
> >
> > Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
> > ---
> > .../bindings/hwmon/sensirion,sht4x.yaml | 50 +++++++++++++++++++
> > drivers/hwmon/sht4x.c | 7 +++
>
> This needs to be two separate patches, one the devicetree change and the other
> the source code change. DT maintainers need to be copied on the devicetree
> patch.
Isn't that going to be confusing if one but not the other patch makes
it into a repository? Either you end up with an undocumented device
tree property or you end up with documentation for an unsupported
property.
> Also, please consider adding the device to trivial-devices.yaml instead since
> there are no special bindings.
I didn't know it existed. Sure, that's much easier.
--david
> Thanks,
> Guenter
>
> > 2 files changed, 57 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/hwmon/sensirion,sht4x.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/hwmon/sensirion,sht4x.yaml b/Documentation/devicetree/bindings/hwmon/sensirion,sht4x.yaml
> > new file mode 100644
> > index 000000000000..588c2e37b035
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/hwmon/sensirion,sht4x.yaml
> > @@ -0,0 +1,50 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/hwmon/sensirion,sht4x.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Sensirion SHT4x Humidity and Temperature Sensor IC
> > +
> > +maintainers:
> > + - Navin Sankar Velliangiri navin@linumiz.com
> > +
> > +description: |
> > + The SHT4x is a high-accuracy digital humidity and temperature sensor
> > + designed especially for battery-driven high-volume consumer
> > + electronics applications. For further information refere to
> > + Documentation/hwmon/sht4x.rst
> > +
> > + This binding document describes the binding for the hardware monitor
> > + portion of the driver.
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - sensirion,sht4x
> > +
> > + reg:
> > + const: 0x44
> > + description:
> > + The I2c base address of the SHT4x. 0x44 for all chip versions
> > + except for SHT41-BD1B, where it is 0x45.
> > +
> > +required:
> > + - compatible
> > + - reg
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + i2c {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + clock-frequency = <400000>;
> > +
> > + sht4x@44 {
> > + compatible = "sensirion,sht4x";
> > + reg = <0x44>;
> > + };
> > + };
> > +...
> > diff --git a/drivers/hwmon/sht4x.c b/drivers/hwmon/sht4x.c
> > index 3415d7a0e0fc..6e53d81e32d4 100644
> > --- a/drivers/hwmon/sht4x.c
> > +++ b/drivers/hwmon/sht4x.c
> > @@ -281,9 +281,16 @@ static const struct i2c_device_id sht4x_id[] = {
> > };
> > MODULE_DEVICE_TABLE(i2c, sht4x_id);
> >
> > +static const struct of_device_id sht4x_of_match[] = {
> > + { .compatible = "sensirion,sht4x" },
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(of, sht4x_of_match);
> > +
> > static struct i2c_driver sht4x_driver = {
> > .driver = {
> > .name = "sht4x",
> > + .of_match_table = sht4x_of_match
> > },
> > .probe = sht4x_probe,
> > .id_table = sht4x_id,
> >
next prev parent reply other threads:[~2021-11-20 21:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-20 20:40 [PATCH v2 1/2] hwmon: (sht4x) Fix EREMOTEIO errors David Mosberger-Tang
2021-11-20 20:40 ` [PATCH v2 2/2] hwmon: (sht4x) Add device tree match table and document it David Mosberger-Tang
2021-11-20 21:12 ` Guenter Roeck
2021-11-20 21:36 ` David Mosberger-Tang [this message]
2021-11-20 21:51 ` Guenter Roeck
2021-11-21 16:15 ` David Mosberger-Tang
2021-11-20 21:08 ` [PATCH v2 1/2] hwmon: (sht4x) Fix EREMOTEIO errors Guenter Roeck
2021-11-20 21:28 ` [PATCH v3] " David Mosberger-Tang
2021-11-20 21:28 ` David Mosberger-Tang
2021-11-20 22:45 ` Guenter Roeck
2021-11-20 21:55 ` Guenter Roeck
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=5f5798b3f021c419e94714ba557be0e3a40c671e.camel@egauge.net \
--to=davidm@egauge.net \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=navin@linumiz.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).