From: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
To: "Cédric Le Goater" <clg-Bxea+6Xhats@public.gmane.org>
Cc: linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Richard Purdie <rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org>,
Jacek Anaszewski
<jacek.anaszewski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Joel Stanley <joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org>
Subject: Re: [PATCH v3 3/4] leds: pca955x: add GPIO support
Date: Fri, 11 Aug 2017 17:37:42 +0200 [thread overview]
Message-ID: <20170811153742.GA31267@amd> (raw)
In-Reply-To: <9330f31a-110c-8398-8cd1-764f8dd358e9-Bxea+6Xhats@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1423 bytes --]
Hi!
> > with minor comments below.
> >
> >> @@ -125,6 +130,7 @@ struct pca955x_led {
> >> struct led_classdev led_cdev;
> >> int led_num; /* 0 .. 15 potentially */
> >> char name[32];
> >> + u32 type;
> >
> > u32 is highly non-standard here. enum pca955x_led_type?
> >
> >
> >> +/*
> >> + * Read the INPUT register, which contains the state of LEDs.
> >> + */
> >> +static u8 pca955x_read_input(struct i2c_client *client, int n)
> >> +{
> >> + return (u8)i2c_smbus_read_byte_data(client, n);
> >> +}
> >
> > Is the cast needed? Should you attempt to handle errors?
>
> ah. this is a left over. I can fix in a resend.
No need to resend just for this.
Should you WARN_ON() if the read_byte_data returns < 0 or something?
https://linuxtv.org/downloads/v4l-dvb-internals/device-drivers/API-i2c-smbus-read-byte-data.html
> >> +#ifndef _DT_BINDINGS_LEDS_PCA955X_H
> >> +#define _DT_BINDINGS_LEDS_PCA955X_H
> >> +
> >> +#define PCA955X_TYPE_NONE 0
> >> +#define PCA955X_TYPE_LED 1
> >> +#define PCA955X_TYPE_GPIO 2
> >
> > And make these into the new enum pca955x_led_type?
>
> These are used in the device tree bindings, so we should keep the u32
> I think.
Aha, ok, makes sense.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2017-08-11 15:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 13:42 [PATCH v3 0/4] leds: pca955x: add GPIO support Cédric Le Goater
2017-08-08 13:42 ` [PATCH v3 2/4] leds: pca955x: use devm_led_classdev_register Cédric Le Goater
[not found] ` <1502199760-763-1-git-send-email-clg-Bxea+6Xhats@public.gmane.org>
2017-08-08 13:42 ` [PATCH v3 1/4] leds: pca955x: add device tree support Cédric Le Goater
2017-08-08 13:42 ` [PATCH v3 3/4] leds: pca955x: add GPIO support Cédric Le Goater
2017-08-11 13:47 ` Pavel Machek
2017-08-11 15:11 ` Cédric Le Goater
[not found] ` <9330f31a-110c-8398-8cd1-764f8dd358e9-Bxea+6Xhats@public.gmane.org>
2017-08-11 15:37 ` Pavel Machek [this message]
2017-08-11 16:26 ` Cédric Le Goater
2017-08-12 8:42 ` Pavel Machek
2017-08-24 11:30 ` Cédric Le Goater
2017-08-24 20:03 ` Jacek Anaszewski
[not found] ` <c403ddf1-a26c-1ccc-f722-eacac6115c34-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-08-24 21:32 ` Cédric Le Goater
2017-08-08 13:42 ` [PATCH v3 4/4] dt-bindings leds: add pca955x Cédric Le Goater
2017-08-14 20:28 ` [PATCH v3 0/4] leds: pca955x: add GPIO support Jacek Anaszewski
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=20170811153742.GA31267@amd \
--to=pavel-+zi9xunit7i@public.gmane.org \
--cc=clg-Bxea+6Xhats@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jacek.anaszewski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.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
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).