Re: [PATCH] pwm-backlight: add regulator and GPIO support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/05/2012 03:47 PM, Sascha Hauer wrote:
I thought about just checking if devm_get_regulator returned -ENODEV
and happily continue if that was the case, assuming no regulator was
declared.

And that's the problem. The get_regulator won't return -ENODEV. It will
return -EPROBE_DEFER which tells you nothing about whether a regulator
will ever be available or not.

Having a flag in platform data would be fine with me, but I know other
people think differently.

BTW in devicetree this flag implicitely exists with the power-supply
property.

One could actually question whether the whole regulator/gpio thing should be supported at all with platform data. The platform interface can use the function hooks in order to implement whatever behavior it wants when the light needs to be powered on and off. The reason for introducing optional regulator/gpio parameters is because the DT cannot use these. Since I have no plan to remove these function hooks, making the regulator/gpio option available in platform data might be redundant. Any thought about this?

Right now the regulator core will just return -EPROBE_DEFER in both
cases. This could easily be changed in the regulator core.

Could this be because the regulator core cannot make the difference between a not-yet-available regulator and a missing one?

Alex.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux