RE: [PATCH v2 03/11] OMAP4: Add the new voltage to vsel calculation formula

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

 




>>-----Original Message-----
>>From: Manuel, Lesly Arackal
>>Sent: Monday, September 27, 2010 9:44 AM
>>To: Gopinath, Thara; linux-omap@xxxxxxxxxxxxxxx
>>Cc: khilman@xxxxxxxxxxxxxxxxxxx; paul@xxxxxxxxx; Cousson, Benoit; Sripathy, Vishwanath; Sawant, Anand
>>Subject: RE: [PATCH v2 03/11] OMAP4: Add the new voltage to vsel calculation formula
>>
>>Hi Thara,
>>
>>
>>> -----Original Message-----
>>> From: linux-omap-owner@xxxxxxxxxxxxxxx [mailto:linux-omap-
>>> owner@xxxxxxxxxxxxxxx] On Behalf Of Thara Gopinath
>>> Sent: Saturday, September 25, 2010 6:21 PM
>>> To: linux-omap@xxxxxxxxxxxxxxx
>>> Cc: khilman@xxxxxxxxxxxxxxxxxxx; paul@xxxxxxxxx; b-cousson@xxxxxx;
>>> vishwanath.bs@xxxxxx; sawant@xxxxxx; Thara Gopinath
>>> Subject: [PATCH v2 03/11] OMAP4: Add the new voltage to vsel calculation
>>> formula
>>>
>>> TWL6030 the power IC used along with OMAP4 in OMAP4 SDPs,
>>> blaze boards and panda boards has a different formula
>>> from that of TWL4030 for voltage to vsel and
>>> vsel to voltage calculation. This patch implements the new
>>> formula depending on the PMIC type.
>>>
>>> Signed-off-by: Thara Gopinath <thara@xxxxxx>
>>> ---
>>>  arch/arm/plat-omap/opp_twl_tps.c |   71
>>> ++++++++++++++++++++++++++++++++++++++
>>>  1 files changed, 71 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/plat-omap/opp_twl_tps.c b/arch/arm/plat-
>>> omap/opp_twl_tps.c
>>> index 4448fc5..358b67b 100644
>>> --- a/arch/arm/plat-omap/opp_twl_tps.c
>>> +++ b/arch/arm/plat-omap/opp_twl_tps.c
>>> @@ -15,9 +15,16 @@
>>>
>>>  #include <linux/module.h>
>>>
>>> +#include <linux/i2c/twl.h>
>>> +
>>>  #include <plat/opp_twl_tps.h>
>>>  #include <plat/voltage.h>
>>>
>>> +static bool is_offset_valid;
>>> +static u8 smps_offset;
>>> +
>>> +#define REG_SMPS_OFFSET         0xE0
>>> +
>>>  /**
>>>   * omap_twl_vsel_to_vdc - convert TWL/TPS VSEL value to microvolts DC
>>>   * @vsel: TWL/TPS VSEL value to convert
>>> @@ -27,6 +34,38 @@
>>>   */
>>>  unsigned long omap_twl_vsel_to_uv(const u8 vsel)
>>>  {
>>> +	if (twl_class_is_6030()) {
>>> +		/*
>>> +		 * In TWL6030 depending on the value of SMPS_OFFSET
>>> +		 * efuse register the voltage range supported in
>>> +		 * standard mode can be either between 0.6V - 1.3V or
>>> +		 * 0.7V - 1.4V. In TWL6030 ES1.0 SMPS_OFFSET efuse
>>> +		 * is programmed to all 0's where as starting from
>>> +		 * TWL6030 ES1.1 the efuse is programmed to 1
>>> +		 */
>>> +		if (!is_offset_valid) {
>>> +			twl_i2c_read_u8(TWL6030_MODULE_ID0, &smps_offset,
>>0xE0);
>>> +			is_offset_valid = true;
>>> +		}
>>
>>Is it necessary to do the i2c read each time to check the smps_offset?
>>OR it can be done one time initially.
Hello Lesly,

It is not done every time. It is only done the first time omap_twl_vsel_to_uv
or omap_twl_uv_to_vsel is called. If is_offset_valid, we do not read the register
via i2c interface.

Regards
Thara

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


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux