* Re: backlight/ld9040.c: regulator control in the lcd driver
[not found] <000c01ccb0c6$697c2aa0$3c747fe0$%lee@samsung.com>
@ 2011-12-02 8:49 ` Linus Walleij
2011-12-02 8:57 ` Kyungmin Park
0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2011-12-02 8:49 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 2, 2011 at 8:45 AM, leedonghwa <dh09.lee@samsung.com> wrote:
[From your mail headers]
> X-Mailer: Microsoft Office Outlook 12.0
No please. That mailer does not work, all your whitespace is screwed up.
Consult: Documentation/email-clients.txt
> This patch supports regulator power control in the driver.
Always CC the regulator maintainers on patches like this please.
> + lcd->reg_vdd3 = regulator_get(lcd->dev, "vdd");
> + if (IS_ERR(lcd->reg_vdd3)) {
> + dev_info(lcd->dev, "no %s regulator found\n", "vdd");
> + lcd->reg_vdd3 = NULL;
> + }
> +
> + lcd->reg_vci = regulator_get(lcd->dev, "vci");
> + if (IS_ERR(lcd->reg_vci)) {
> + dev_info(lcd->dev, "no %s regulator found\n", "vci");
> + lcd->reg_vci = NULL;
> + }
As explained in earlier discussion with Mark regarding the SMSC911x
driver regulator, treat these as errors and do not fail
"gracefully" like this.
Reference:
http://marc.info/?l=linux-netdev&m\x131914562120725&w=2
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: backlight/ld9040.c: regulator control in the lcd driver
2011-12-02 8:49 ` backlight/ld9040.c: regulator control in the lcd driver Linus Walleij
@ 2011-12-02 8:57 ` Kyungmin Park
2011-12-02 10:05 ` Linus Walleij
2011-12-02 10:31 ` Mark Brown
0 siblings, 2 replies; 7+ messages in thread
From: Kyungmin Park @ 2011-12-02 8:57 UTC (permalink / raw)
To: linux-arm-kernel
On 12/2/11, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Fri, Dec 2, 2011 at 8:45 AM, leedonghwa <dh09.lee@samsung.com> wrote:
>
> [From your mail headers]
>> X-Mailer: Microsoft Office Outlook 12.0
>
> No please. That mailer does not work, all your whitespace is screwed up.
> Consult: Documentation/email-clients.txt
>
>> This patch supports regulator power control in the driver.
>
> Always CC the regulator maintainers on patches like this please.
>
>> + lcd->reg_vdd3 = regulator_get(lcd->dev, "vdd");
>> + if (IS_ERR(lcd->reg_vdd3)) {
>> + dev_info(lcd->dev, "no %s regulator found\n", "vdd");
>> + lcd->reg_vdd3 = NULL;
>> + }
>> +
>> + lcd->reg_vci = regulator_get(lcd->dev, "vci");
>> + if (IS_ERR(lcd->reg_vci)) {
>> + dev_info(lcd->dev, "no %s regulator found\n", "vci");
>> + lcd->reg_vci = NULL;
>> + }
>
> As explained in earlier discussion with Mark regarding the SMSC911x
> driver regulator, treat these as errors and do not fail
> "gracefully" like this.
>
> Reference:
> http://marc.info/?l=linux-netdev&m\x131914562120725&w=2
As mentioned at commit message, the lcd regulator is optional part and
refer the mmc codes
host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
if (IS_ERR(host->vmmc)) {
pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc));
host->vmmc = NULL;
} else {
regulator_enable(host->vmmc);
}
Previous time, these codes are located at board file, but more boards
are used, it has same codes for all boards. so move it to drivers.
In our case, it has the regulator but some boards don't.
Umm then how to handle the regulator gracefully?
Thank you,
Kyungmin Park
>
> Yours,
> Linus Walleij
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: backlight/ld9040.c: regulator control in the lcd driver
2011-12-02 8:57 ` Kyungmin Park
@ 2011-12-02 10:05 ` Linus Walleij
2011-12-02 10:14 ` Kyungmin Park
2011-12-02 10:31 ` Mark Brown
1 sibling, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2011-12-02 10:05 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 2, 2011 at 9:57 AM, Kyungmin Park <kyungmin.park@samsung.com> wrote:
>>[leedonghwa]
> [Me]
>>> + lcd->reg_vdd3 = regulator_get(lcd->dev, "vdd");
>>> + if (IS_ERR(lcd->reg_vdd3)) {
>>> + dev_info(lcd->dev, "no %s regulator found\n", "vdd");
>>> + lcd->reg_vdd3 = NULL;
>>> + }
>>> +
>>> + lcd->reg_vci = regulator_get(lcd->dev, "vci");
>>> + if (IS_ERR(lcd->reg_vci)) {
>>> + dev_info(lcd->dev, "no %s regulator found\n", "vci");
>>> + lcd->reg_vci = NULL;
>>> + }
>>
>> As explained in earlier discussion with Mark regarding the SMSC911x
>> driver regulator, treat these as errors and do not fail
>> "gracefully" like this.
>>
>> Reference:
>> http://marc.info/?l=linux-netdev&m\x131914562120725&w=2
>
> As mentioned at commit message, the lcd regulator is optional part and
> refer the mmc codes
>
> host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
> if (IS_ERR(host->vmmc)) {
> pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc));
> host->vmmc = NULL;
> } else {
> regulator_enable(host->vmmc);
> }
>
> Previous time, these codes are located at board file, but more boards
> are used, it has same codes for all boards. so move it to drivers.
I know. This was brought up in the aforementioned discussion,
but the above is also wrong, simply. See:
http://marc.info/?l=linux-netdev&m\x131914562120667&w=2
http://marc.info/?l=linux-netdev&m\x131914562120690&w=2
http://marc.info/?l=linux-netdev&m\x131914562120725&w=2
http://marc.info/?l=linux-netdev&m\x131963332527416&w=2
> In our case, it has the regulator but some boards don't.
>
> Umm then how to handle the regulator gracefully?
Mark suggest using a fixed-voltage regulator for boards
where the power is always on. The voltage level itself
is optional. See:
http://marc.info/?l=linux-netdev&m\x131963332527416&w=2
Other approaches is to use dummy regulators, or not
call regulator_has_full_constraints(), which means the
regulator core will provide dummy regulators anyways.
See:
http://marc.info/?l=linux-netdev&m\x131973043527112&w=2
http://marc.info/?l=linux-netdev&m\x131975178703166&w=2
Whole thread of discussion:
http://marc.info/?l=linux-netdev&w=2&r=1&s=smsc911x&q=b
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: backlight/ld9040.c: regulator control in the lcd driver
2011-12-02 10:05 ` Linus Walleij
@ 2011-12-02 10:14 ` Kyungmin Park
0 siblings, 0 replies; 7+ messages in thread
From: Kyungmin Park @ 2011-12-02 10:14 UTC (permalink / raw)
To: linux-arm-kernel
On 12/2/11, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Fri, Dec 2, 2011 at 9:57 AM, Kyungmin Park <kyungmin.park@samsung.com>
> wrote:
>>>[leedonghwa]
>> [Me]
>>>> + lcd->reg_vdd3 = regulator_get(lcd->dev, "vdd");
>>>> + if (IS_ERR(lcd->reg_vdd3)) {
>>>> + dev_info(lcd->dev, "no %s regulator found\n",
>>>> "vdd");
>>>> + lcd->reg_vdd3 = NULL;
>>>> + }
>>>> +
>>>> + lcd->reg_vci = regulator_get(lcd->dev, "vci");
>>>> + if (IS_ERR(lcd->reg_vci)) {
>>>> + dev_info(lcd->dev, "no %s regulator found\n",
>>>> "vci");
>>>> + lcd->reg_vci = NULL;
>>>> + }
>>>
>>> As explained in earlier discussion with Mark regarding the SMSC911x
>>> driver regulator, treat these as errors and do not fail
>>> "gracefully" like this.
>>>
>>> Reference:
>>> http://marc.info/?l=linux-netdev&m\x131914562120725&w=2
>>
>> As mentioned at commit message, the lcd regulator is optional part and
>> refer the mmc codes
>>
>> host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
>> if (IS_ERR(host->vmmc)) {
>> pr_info("%s: no vmmc regulator found\n",
>> mmc_hostname(mmc));
>> host->vmmc = NULL;
>> } else {
>> regulator_enable(host->vmmc);
>> }
>>
>> Previous time, these codes are located at board file, but more boards
>> are used, it has same codes for all boards. so move it to drivers.
>
> I know. This was brought up in the aforementioned discussion,
> but the above is also wrong, simply. See:
> http://marc.info/?l=linux-netdev&m\x131914562120667&w=2
> http://marc.info/?l=linux-netdev&m\x131914562120690&w=2
> http://marc.info/?l=linux-netdev&m\x131914562120725&w=2
> http://marc.info/?l=linux-netdev&m\x131963332527416&w=2
>
>> In our case, it has the regulator but some boards don't.
>>
>> Umm then how to handle the regulator gracefully?
>
> Mark suggest using a fixed-voltage regulator for boards
> where the power is always on. The voltage level itself
> is optional. See:
> http://marc.info/?l=linux-netdev&m\x131963332527416&w=2
Make sense, okay send the updated patch
>
> Other approaches is to use dummy regulators, or not
> call regulator_has_full_constraints(), which means the
> regulator core will provide dummy regulators anyways.
> See:
> http://marc.info/?l=linux-netdev&m\x131973043527112&w=2
> http://marc.info/?l=linux-netdev&m\x131975178703166&w=2
>
> Whole thread of discussion:
> http://marc.info/?l=linux-netdev&w=2&r=1&s=smsc911x&q=b
>
> Yours,
> Linus Walleij
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: backlight/ld9040.c: regulator control in the lcd driver
2011-12-02 8:57 ` Kyungmin Park
2011-12-02 10:05 ` Linus Walleij
@ 2011-12-02 10:31 ` Mark Brown
2011-12-02 10:36 ` Linus Walleij
1 sibling, 1 reply; 7+ messages in thread
From: Mark Brown @ 2011-12-02 10:31 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 02, 2011 at 05:57:35PM +0900, Kyungmin Park wrote:
> As mentioned at commit message, the lcd regulator is optional part and
> refer the mmc codes
> host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
> if (IS_ERR(host->vmmc)) {
> pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc));
> host->vmmc = NULL;
> } else {
> regulator_enable(host->vmmc);
> }
> Previous time, these codes are located at board file, but more boards
> are used, it has same codes for all boards. so move it to drivers.
In the case of MMC the MMC guys told us that this supply was entirely
optional for MMC operation, it wasn't an essential supply for the MMC
device to run it just enabled more features. For supplies like that
it's OK for the regulator to fail, the driver should just not do
whatever things are enabled by having that supply.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: backlight/ld9040.c: regulator control in the lcd driver
2011-12-02 10:31 ` Mark Brown
@ 2011-12-02 10:36 ` Linus Walleij
2011-12-02 10:52 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2011-12-02 10:36 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 2, 2011 at 11:31 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Fri, Dec 02, 2011 at 05:57:35PM +0900, Kyungmin Park wrote:
>
>> As mentioned at commit message, the lcd regulator is optional part and
>> refer the mmc codes
>
>> host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
>> if (IS_ERR(host->vmmc)) {
>> pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc));
>> host->vmmc = NULL;
>> } else {
>> regulator_enable(host->vmmc);
>> }
>
>> Previous time, these codes are located at board file, but more boards
>> are used, it has same codes for all boards. so move it to drivers.
>
> In the case of MMC the MMC guys told us that this supply was entirely
> optional for MMC operation, it wasn't an essential supply for the MMC
> device to run it just enabled more features. For supplies like that
> it's OK for the regulator to fail, the driver should just not do
> whatever things are enabled by having that supply.
I don't think that's true. You *must* have some voltage on VMMC
to power the card, the optional part is regulating that voltage to
different levels as requested by the card internal machinery when
talking to it. All MMC/SD cards can run on a fixed voltage, something
like 3.8V I think.
In line with our previous discussions I think this should actually be
defined as a fixed voltage regulator in case it cannot be controlled,
because there sure as hell is a voltage there on all systems.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: backlight/ld9040.c: regulator control in the lcd driver
2011-12-02 10:36 ` Linus Walleij
@ 2011-12-02 10:52 ` Mark Brown
0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2011-12-02 10:52 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 02, 2011 at 11:36:13AM +0100, Linus Walleij wrote:
> I don't think that's true. You *must* have some voltage on VMMC
> to power the card, the optional part is regulating that voltage to
> different levels as requested by the card internal machinery when
> talking to it. All MMC/SD cards can run on a fixed voltage, something
> like 3.8V I think.
> In line with our previous discussions I think this should actually be
> defined as a fixed voltage regulator in case it cannot be controlled,
> because there sure as hell is a voltage there on all systems.
I have to say that I was very suspicious of this claim at the time but
there was so much pain associated with the MMC stuff that it just got
left to slide. Similarly with the use of regulator_get_exclusive() to
vary the voltage, I'd *really* expect that the code would be able to
cope with shared supplies.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-12-02 10:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <000c01ccb0c6$697c2aa0$3c747fe0$%lee@samsung.com>
2011-12-02 8:49 ` backlight/ld9040.c: regulator control in the lcd driver Linus Walleij
2011-12-02 8:57 ` Kyungmin Park
2011-12-02 10:05 ` Linus Walleij
2011-12-02 10:14 ` Kyungmin Park
2011-12-02 10:31 ` Mark Brown
2011-12-02 10:36 ` Linus Walleij
2011-12-02 10:52 ` Mark Brown
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).