[PATCH v3 1/6] Samsung SoC ADC: use regulator (VDD for ADC).

MyungJoo Ham myungjoo.ham at gmail.com
Thu Jun 30 05:03:06 EDT 2011


On Thu, Jun 30, 2011 at 5:22 PM, Vasily Khoruzhick <anarsoul at gmail.com> wrote:
> On Thursday 30 June 2011 10:49:30 MyungJoo Ham wrote:
>> This patch allows the Samsung ADC driver to enable VDD regulator at
>> probe and resume and to disable at exit and suspend.
>> In a platform where ADC's VDD regulator is not "always-on", this control
>> is required although this patch does not provide fine-grained power
>> control (turning on the regulator only when being accessed).
>>
>> However, if VDD regulator ("vdd" for the adc device) is not provided,
>> the regulator control will not be activated because there are platforms
>> that do not provide regulator for ADC device.
>>
>> arch_initcall has been modified to module_init in order to allow
>> regulators to be available at probe.
>>
>> Signed-off-by: MyungJoo Ham <myungjoo.ham at samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
[]
>> +     adc->vdd = regulator_get(dev, "vdd");
>> +     if (IS_ERR(adc->vdd)) {
>> +             dev_err(dev, "operating without regulator \"vdd\" .\n");
>> +             ret = PTR_ERR(adc->vdd);
>> +             goto err_alloc;
>> +     }
>> +
>
> NACK. Make it optional, otherwise it breaks s3c24xx.
>

Ok. Now, I've got the issue I've worried in the previous patch revision.

Anyway, Mark once stated:
--- quote starts ---
On Sun, Jun 19, 2011 at 12:06 AM, Mark Brown
<broonie at opensource.wolfsonmicro.com> wrote:
>> +     if (IS_ERR_OR_NULL(adc->vdd)) {
>> +             dev_dbg(dev, "operating without regulator %s.\n", S3C_ADC_REGULATOR_NAME);
>> +             adc->vdd = NULL; /* Do not control regulator */
>> +     }
>> +
>
> No, don't do this.  Just unconditionally assume the regulator is present
> if power is essential for use of the device.  The regulator API will
> stub out correctly if it's not in use to allow things to proceed and if
> vdd is genuinely not hooked up then the driver can't function.
--- quote ends ---

Then, how about unconditionally using ADC VDD for TYPE_ADCV3
(S5PC110/S5PV210/Exynos4210) and forget VDD for older ADC types?


Thanks.

- MyungJoo
-- 
MyungJoo Ham, Ph.D.
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: 82-10-6714-2858



More information about the linux-arm-kernel mailing list