[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <523847E0.2020400@nvidia.com>
Date: Tue, 17 Sep 2013 17:45:28 +0530
From: Laxman Dewangan <ldewangan@...dia.com>
To: Mark Brown <broonie@...nel.org>
CC: "lee.jones@...aro.org" <lee.jones@...aro.org>,
"sameo@...ux.intel.com" <sameo@...ux.intel.com>,
"linus.walleij@...aro.org" <linus.walleij@...aro.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"rtc-linux@...glegroups.com" <rtc-linux@...glegroups.com>,
"rob.herring@...xeda.com" <rob.herring@...xeda.com>,
"mark.rutland@....com" <mark.rutland@....com>,
"pawel.moll@....com" <pawel.moll@....com>,
"swarren@...dotorg.org" <swarren@...dotorg.org>,
"rob@...dley.net" <rob@...dley.net>,
"ijc+devicetree@...lion.org.uk" <ijc+devicetree@...lion.org.uk>,
"grant.likely@...aro.org" <grant.likely@...aro.org>,
"florian.lobmaier@....com" <florian.lobmaier@....com>
Subject: Re: [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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists