From: Andrew Morton <akpm@linux-foundation.org>
To: "Kim, Milo" <Milo.Kim@ti.com>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
"shreshthakumar.sahu@stericsson.com"
<shreshthakumar.sahu@stericsson.com>,
"rpurdie@rpsys.net" <rpurdie@rpsys.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 3/5] leds-lm3530: support pwm input mode
Date: Tue, 7 Feb 2012 14:54:58 -0800 [thread overview]
Message-ID: <20120207145458.6397d04c.akpm@linux-foundation.org> (raw)
In-Reply-To: <B567DBAB974C0544994013492B949F8E3812ED44A8@EXMAIL03.scwf.nsc.com>
On Mon, 6 Feb 2012 21:14:21 -0800
"Kim, Milo" <Milo.Kim@ti.com> wrote:
> * add 'struct lm3530_pwm_data' in the platform data
> The pwm data is the platform specific functions which generate the pwm.
> The pwm data is only valid when brightness is pwm input mode.
> Functions should be implemented by the pwm driver.
> pwm_set_intensity() : set duty of pwm.
> pwm_get_intensity() : get current the brightness.
>
> * brightness control by pwm
> If the control mode is pwm, then brightness is changed by the duty of pwm.
> So pwm platform function should be called in lm3530_brightness_set().
>
> * do not update brightness register when pwm input mode
> In pwm input mode, brightness register is not used.
> If any value is updated in this register, then the led will be off.
>
> * when input mode is changed, set duty of pwm to 0 if unnecessary.
>
> * patch base version : kernel 3.2.4
>
>
> ...
>
> @@ -327,14 +344,11 @@ static ssize_t lm3530_mode_set(struct device *dev, struct device_attribute
> return -EINVAL;
> }
>
> - if (mode == LM3530_BL_MODE_MANUAL)
> - drvdata->mode = LM3530_BL_MODE_MANUAL;
> - else if (mode == LM3530_BL_MODE_ALS)
> - drvdata->mode = LM3530_BL_MODE_ALS;
> - else if (mode == LM3530_BL_MODE_PWM) {
> - dev_err(dev, "PWM mode not supported\n");
> - return -EINVAL;
> - }
> + drvdata->mode = mode;
> +
> + /* set pwm to low if unnecessary */
> + if (mode != LM3530_BL_MODE_PWM && pwm->pwm_set_intensity)
> + pwm->pwm_set_intensity(0, max_brightness);
lm3530_mode_set() has no local variable "pwm" and has no local variable
"brightness".
I see now that you prepared the patches against 3.2.4, which might
contribute to this problem, but I don't see how the patches could work
in 3.2 either. Perhaps 3.2.4 is significantly different from 3.2.
Anyway, I think I will drop all the patches again until we can get this
fully sorted out. Please don't prepare patches against ancient old
kernels like 3.2.4! They should be prepared and tested against the
latest Linus tree, from
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git. Or
against the latest linux-next from
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
next prev parent reply other threads:[~2012-02-07 22:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-07 5:14 Kim, Milo
2012-02-07 22:54 ` Andrew Morton [this message]
2012-02-08 0:32 ` Kim, Milo
2012-02-08 2:34 ` Andrew Morton
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=20120207145458.6397d04c.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Milo.Kim@ti.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
--cc=shreshthakumar.sahu@stericsson.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
all inboxes | Powered by JetHome®