All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Dan Murphy <dmurphy@ti.com>
Cc: robh+dt@kernel.org, mark.rutland@arm.com, rpurdie@rpsys.net,
	jacek.anaszewski@gmail.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org
Subject: Re: [PATCH 2/2] leds: lm3692x: Introduce LM3692x dual string driver
Date: Wed, 15 Nov 2017 11:45:26 +0100	[thread overview]
Message-ID: <20171115104526.GC456@amd> (raw)
In-Reply-To: <20171113205052.25884-2-dmurphy@ti.com>

[-- Attachment #1: Type: text/plain, Size: 2716 bytes --]

On Mon 2017-11-13 14:50:52, Dan Murphy wrote:
> Introducing the LM3692x Dual-String white LED driver.
> 
> Data sheet is located
> http://www.ti.com/lit/ds/snvsa29/snvsa29.pdf
> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>  drivers/leds/leds-lm3692x.c | 380 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 380 insertions(+)
>  create mode 100644 drivers/leds/leds-lm3692x.c
> 
> diff --git a/drivers/leds/leds-lm3692x.c b/drivers/leds/leds-lm3692x.c
> new file mode 100644
> index 000000000000..beb753abc7b0
> --- /dev/null
> +++ b/drivers/leds/leds-lm3692x.c
> @@ -0,0 +1,380 @@
> +/*
> + * TI lm3692x LED Driver
> + *
> + * Copyright (C) 2017 Texas Instruments
> + *
> + * Author: Dan Murphy <dmurphy@ti.com>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * version 2 as published by the Free Software Foundation.
> + *
> + */

I'd put data sheet link here.

> +/**
> + * struct lm3692x_led -
> + * @lock - Lock for reading/writing the device
> + * @client - Pointer to the I2C client
> + * @led_dev - led class device pointer
> + * @regmap - Devices register map
> + * @enable_gpio - VDDIO/EN gpio to enable communication interface
> + * @regulator - LED supply regulator pointer
> + * @label - LED label
> + **/

Are you sure this is linuxdoc? Would */ at the end be enough?

> +static int lm3692x_fault_check(struct lm3692x_led *led)
> +{
> +	int ret, fault;
> +	unsigned int read_buf;
> +
> +	ret = regmap_read(led->regmap, LM3692X_FAULT_FLAGS, &read_buf);
> +	if (ret)
> +		goto out;

Just return here.

> +	/*
> +	 * For glitch free operation, the following data should
> +	 * only be written while device enable bit is 0
> +	 * Per Section 7.5.14 of the data sheet
> +	 */

"per section 7.5.14 of the data sheet."

> +	ret = regmap_write(led->regmap, LM3692X_PWM_CTRL,
> +		LM3692X_PWM_FILTER_100 | LM3692X_PWM_SAMP_24MHZ);
> +	if (ret)
> +		dev_err(&led->client->dev, "Failed programming PWM CTRL\n");
> +
> +	ret = regmap_write(led->regmap, LM3692X_BOOST_CTRL,
> +			LM3692X_BRHT_MODE_RAMP_MULTI |
> +			LM3692X_BL_ADJ_POL |
> +			LM3692X_RAMP_RATE_250us);
> +	if (ret)
> +		dev_err(&led->client->dev, "Failed programming BOOST CTRL\n");
> +
> +	ret = regmap_write(led->regmap, LM3692X_AUTO_FREQ_HI, 0x00);
> +	if (ret)
> +		dev_err(&led->client->dev, "Failed programming AUTO HI FREQ\n");

If something fails, is it wise to continue?

Thanks,
									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 --]

  reply	other threads:[~2017-11-15 10:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 20:50 [PATCH 1/2] dt: bindings: lm3692x: Add bindings for lm3692x LED driver Dan Murphy
2017-11-13 20:50 ` Dan Murphy
2017-11-13 20:50 ` [PATCH 2/2] leds: lm3692x: Introduce LM3692x dual string driver Dan Murphy
2017-11-13 20:50   ` Dan Murphy
2017-11-15 10:45   ` Pavel Machek [this message]
2017-11-15 12:47     ` Dan Murphy
2017-11-15 12:47       ` Dan Murphy
2017-11-15 13:00       ` Pavel Machek
2017-11-15 13:06         ` Dan Murphy
2017-11-15 13:06           ` Dan Murphy
     [not found]   ` <20171113205052.25884-2-dmurphy-l0cyMroinI0@public.gmane.org>
2017-11-15 13:11     ` Dan Murphy
2017-11-15 13:11       ` Dan Murphy
2017-11-16  3:48   ` Andrew F. Davis
2017-11-16  3:48     ` Andrew F. Davis
     [not found]     ` <3e209041-561c-84a0-d0dd-253cf37f060a-l0cyMroinI0@public.gmane.org>
2017-11-16 12:46       ` Dan Murphy
2017-11-16 12:46         ` Dan Murphy
     [not found] ` <20171113205052.25884-1-dmurphy-l0cyMroinI0@public.gmane.org>
2017-11-15 10:35   ` [PATCH 1/2] dt: bindings: lm3692x: Add bindings for lm3692x LED driver Pavel Machek
2017-11-15 10:35     ` Pavel Machek

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=20171115104526.GC456@amd \
    --to=pavel@ucw.cz \
    --cc=devicetree@vger.kernel.org \
    --cc=dmurphy@ti.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rpurdie@rpsys.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.