From: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Matt Ranostay <mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH] iio: health: max30100: add config for LED current
Date: Tue, 29 Dec 2015 12:34:47 -0600 [thread overview]
Message-ID: <20151229183447.GE12450@rob-hp-laptop> (raw)
In-Reply-To: <1451191104-1281-1-git-send-email-mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Sat, Dec 26, 2015 at 08:38:24PM -0800, Matt Ranostay wrote:
> Allow the current for both RED and IR LEDs to be set via an device tree
> property setting.
>
> This is an optional setting that is useful for applications that have a
> known glass attenuation factor.
>
> Signed-off-by: Matt Ranostay <mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> .../devicetree/bindings/iio/health/max30100.txt | 7 +++++++
> drivers/iio/health/max30100.c | 21 +++++++++++++++------
> 2 files changed, 22 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/health/max30100.txt b/Documentation/devicetree/bindings/iio/health/max30100.txt
> index f6fbac6..009314c 100644
> --- a/Documentation/devicetree/bindings/iio/health/max30100.txt
> +++ b/Documentation/devicetree/bindings/iio/health/max30100.txt
> @@ -11,11 +11,18 @@ Required properties:
> Refer to interrupt-controller/interrupts.txt for generic
> interrupt client node bindings.
>
> +Optional properties:
> + - max30100,led-current: configuration for LED current (in mA) while the engine
> + is running. Upper nibble is for the RED LED, and lower nibble the IR LED.
Can you use the common LED binding and led-max-microamp instead?
Otherwise, please add "-microamp" suffix and just split to 2 cells for
RED and IR LEDs. Also, "max30100" is not a vendor prefix. Use maxim.
> + ret = of_property_read_u32(np, "max30100,led-current", &val);
> + if (ret) {
> + /* Default to 24 mA RED LED, 50 mA IR LED */
> + val = (MAX30100_REG_LED_CONFIG_24MA <<
> + MAX30100_REG_LED_CONFIG_RED_LED_SHIFT) |
> + MAX30100_REG_LED_CONFIG_50MA;
> + dev_warn(dev, "no led-current set, defaulting to %d", val);
> + }
> +
> + ret = regmap_write(data->regmap, MAX30100_REG_LED_CONFIG, val & 0xFF);
Huh? You say the units are milliamps, but then you use the DT value
directly?
Rob
next prev parent reply other threads:[~2015-12-29 18:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-27 4:38 [PATCH] iio: health: max30100: add config for LED current Matt Ranostay
[not found] ` <1451191104-1281-1-git-send-email-mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-29 18:34 ` Rob Herring [this message]
2015-12-30 2:13 ` Matt Ranostay
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=20151229183447.GE12450@rob-hp-laptop \
--to=robh-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mranostay-Re5JQEeQqe8AvxtiuMwx3w@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