From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Tero Kristo <t-kristo@ti.com>,
Grazvydas Ignotas <notasas@gmail.com>,
<linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v3 3/3] pwm: New driver to support PWM driven LEDs on TWL4030/6030 series of PMICs
Date: Tue, 20 Nov 2012 12:54:11 +0100 [thread overview]
Message-ID: <50AB6F63.9040009@ti.com> (raw)
In-Reply-To: <1353405382-9226-4-git-send-email-peter.ujfalusi@ti.com>
On 11/20/2012 10:56 AM, Peter Ujfalusi wrote:
> The driver supports the following LED outputs as generic PWM driver:
> TWL4030 LEDA and LEDB (PWMA and PWMB)
> TWL6030 Charging indicator LED (PWM LED)
>
> On TWL6030 when the PWM requested LED is configured to be controlled by SW.
> In this case the user can enable/disable and set the duty period freely.
> When the PWM has been freed, the LED driver is put back to HW control.
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
> drivers/pwm/Kconfig | 10 ++
> drivers/pwm/Makefile | 1 +
> drivers/pwm/pwm-twl-led.c | 303 ++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 314 insertions(+)
> create mode 100644 drivers/pwm/pwm-twl-led.c
...
> +static int twl4030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm,
> + int duty_ns, int period_ns)
> +{
> + int duty_cycle = DIV_ROUND_UP(duty_ns * TWL4030_LED_MAX, period_ns);
> + u8 pwm_config[2] = {1, 0};
> + int base, ret;
> +
> + /*
> + * To configure the duty period:
> + * On-cycle is set to 1 (the minimum allowed value)
> + * The off time of 0 is not configurable, so the mapping is:
> + * 0 -> off cycle = 2,
> + * 1 -> off cycle = 2,
> + * 2 -> off cycle = 3,
> + * 125 - > off cycle 127,
> + * 126 - > off cycle 1
Oh, I missed to save the updated comment before I commited the change.
Can I just send and update patch instead of the whole series again?
> + * When on cycle == off cycle the PWM will be always on
> + */
--
Péter
next prev parent reply other threads:[~2012-11-20 11:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 9:56 [PATCH v3 0/3] pwm: Drivers for twl4030/6030 PWMs and LEDs Peter Ujfalusi
2012-11-20 9:56 ` [PATCH v3 1/3] pwm: Remove pwm-twl6030 driver Peter Ujfalusi
2012-11-23 15:05 ` Thierry Reding
2012-11-26 9:11 ` Peter Ujfalusi
2012-11-20 9:56 ` [PATCH v3 2/3] pwm: New driver to support PWMs on TWL4030/6030 series of PMICs Peter Ujfalusi
2012-11-23 14:58 ` Thierry Reding
2012-11-26 9:31 ` Peter Ujfalusi
2012-11-20 9:56 ` [PATCH v3 3/3] pwm: New driver to support PWM driven LEDs " Peter Ujfalusi
2012-11-20 11:54 ` Peter Ujfalusi [this message]
2012-11-20 11:58 ` Thierry Reding
2012-11-23 9:51 ` Peter Ujfalusi
2012-11-23 15:04 ` Thierry Reding
2012-11-26 8:30 ` Peter Ujfalusi
2012-11-26 9:17 ` Thierry Reding
2012-11-26 9:33 ` Peter Ujfalusi
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=50AB6F63.9040009@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=notasas@gmail.com \
--cc=t-kristo@ti.com \
--cc=thierry.reding@avionic-design.de \
/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