lkml.org 
[lkml]   [2013]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] regulator: as3722: add regulator driver for AMS AS3722

>> +static int as3722_ldo_get_voltage_sel(struct regulator_dev *rdev)
>> +{
>> + int ret;
>> +
>> + ret = regulator_get_voltage_sel_regmap(rdev);
>> + if (ret >= 0x40)
>> + ret -= 0x1B;
>> + return ret;
>> +}
> This looks very strange. What's going on here? A gap in the selectors?
> If that's the case you probably want to be using linear ranges.

Yes device does not want to be configure the vsel to 0x25 to 0x3F

01h-24h : V_LDO1=0.8V+ldo1_vsel*25mV
25h-3Fh : do not use
40h-7Fh : V_LDO1=1.725V+(ldo1_vsel-40h)*25mV

Let me use linear range.

>> + if (reg_config->ext_control) {
>> + ret = regulator_enable_regmap(rdev);
>> + if (ret < 0) {
>> + dev_err(&pdev->dev,
>> + "Regulator %d enable failed: %d\n",
>> + id, ret);
>> + goto scrub;
>> + }
> This looks wrong... why is the regualtor being enabled by something
> other than the core?

When the rail is configured externally controlled then we are not
providing the enable/disable callback to enable through register access.
So core will not be able to enable it.
Here, we are making sure that it is enabled through register write.
After that enable/disable can be done by device-input pin toggeling.



\
 
 \ /
  Last update: 2013-09-17 14:01    [W:0.048 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site