09 Dec, 2010
4 commits
-
Correct the register table for SM2, LDO8, RTC
Change-Id: I45348cec5ffbb7da9bd7523764fb611b537236b8
Signed-off-by: Danny Huang
Signed-off-by: Olof Johansson
Signed-off-by: Stephen Warren
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
Change-Id: I40400bb65eab496bb1becd26b37a9653b99d4f41
Signed-off-by: Danny Huang
Signed-off-by: Olof Johansson
Signed-off-by: Stephen Warren
Acked-by: Mark Brown
(Split into separate patches)
Signed-off-by: Liam Girdwood -
Change-Id: Idacf5e1e51dbbbcd5ea93f310a4e907977e7359e
Signed-off-by: Danny Huang
Signed-off-by: Olof Johansson
Signed-off-by: Stephen Warren
Acked-by: Mark Brown
(Split into separate patches)
(Minor formatting fixes)
Signed-off-by: Liam Girdwood -
Change-Id: I76eaceb31b56264f6978af15db1e6fc7e2e01b5a
Signed-off-by: Danny Huang
Signed-off-by: Olof Johansson
Signed-off-by: Stephen Warren
Acked-by: Mark Brown
(Split into separate patches)
Signed-off-by: Liam Girdwood
30 Nov, 2010
9 commits
-
Fix kernel-doc warning for set_consumer_device_supply():
Warning(drivers/regulator/core.c:912): missing initial short description on line:
* set_consumer_device_supply: Bind a regulator to a symbolic supplySigned-off-by: Randy Dunlap
Cc: Liam Girdwood
Cc: Mark Brown
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
Supply regulators are disabled only when the last
reference count is removed on the child regulator
(the use count goes from 1 to 0). This patch changes
the behaviour of enable so the supply regulator is
enabled only when the use count of the child
regulator goes from 0 to 1.Signed-off-by: Bengt Jonsson
Acked-by: Linus Walleij
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
The Singular Message is 16 bits:
DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0]Current implementation return immedially after sucessfuly write MSB part.
To properly set mode, we need to write the complete message ( MSB and LSB ).In twl.h, now we have defines for PM Master module register offsets,
use it instead of hard coded 0x15/0x16.Use "message & 0xff" to ensure we send correct value for LSB.
Signed-off-by: Axel Lin
Acked-by: Mark Brown
Tested-by: Lesly Arackal Manuel
Signed-off-by: Liam Girdwood -
This patch add locks around regulator supply enable.
Signed-off-by: Mattias Wallin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
Integer division will truncate the result, this patch ensures we have
enough delay time for enabling regulator.Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
We already have device_remove_file() in error path,
no need to call it before goto link_name_err.Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
It is not used outside this driver so no need to make the symbol global.
Signed-off-by: Mark Brown
Acked-by: Alberto Panizzo
Signed-off-by: Liam Girdwood -
This patch fixes a disable failure when regulator supply is used.
A while loop in regulator disable checks for supply pointer != NULL
but the pointer is not always updated, resulting in the while loop
running too many times causing a disable failure.Signed-off-by: Mattias Wallin
Acked-by: Linus Walleij
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood
29 Oct, 2010
13 commits
-
max8998_pmic_probe:
- modified to check if valid pins are defined at platform
data
- maximal voltage values (predefined at platform data) are uploaded to
max8998 devicemax8998_set_voltage_buck:
- BUCK1/2 voltages change between values already defined
- Checks if valid GPIO pins are passed from platform data
- If requested voltage cannot be satisfied from already defined values,
then one of free slots is used
- Predefined maximum voltages (as defined at platform data) are always
availableSigned-off-by: Lukasz Majewski
Signed-off-by: Kyungmin Park
Acked-by: Mark Brown
Acked-by: Liam Girdwood
Signed-off-by: Samuel Ortiz -
BUCK1/2 internal voltages and indexes defined in the struct max8998_data
max_get_voltage_register now uses index values to chose proper register
More generic BUCK1/2 registers names providedSigned-off-by: Lukasz Majewski
Signed-off-by: Kyungmin Park
Acked-by: Mark Brown
Acked-by: Liam Girdwood
Signed-off-by: Samuel Ortiz -
Signed-off-by: Lukasz Majewski
Signed-off-by: Kyungmin Park
Acked-by: Mark Brown
Acked-by: Liam Girdwood
Signed-off-by: Samuel Ortiz -
This patch makes the ab8500 mixed signal chip expose the same
interface for register access as the ab3100, ab3550 and ab5500 chip.
The ab8500_read() and ab8500_write() is removed and replaced with
abx500_get_register_interruptible() and
abx500_set_register_interruptible().Signed-off-by: Mattias Wallin
Acked-by: Linus Walleij
Acked-by: Mark Brown
Signed-off-by: Samuel Ortiz -
The MAX8998 chip have regulator and rtc features. The i2c slave address
of regulator and rtc is different, so needs each i2c client on i2c
operation functions.Also, this patch exports i2c operation functions instead of callback to
make easy to read.Signed-off-by: Joonyoung Shim
Signed-off-by: Kyungmin Park
Signed-off-by: Samuel Ortiz -
In current implementation, vid is declared as u8,
then "vid == -1" is always false, and "vid >= 0" is always true.
Thus change it to s8.Signed-off-by: Axel Lin
Acked-by: Mark Brown
Acked-by: Kyungmin Park
Signed-off-by: Liam Girdwood -
Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
Commit f03f91826 (regulator: Add option for machine drivers
to enable the dummy regulator) in the regulators tree
seems to have introduced the following build break when
CONFIG_REGULATOR_DUMMY is disabled. Fix this.CC drivers/regulator/dummy.o
drivers/regulator/dummy.c:41: error: redefinition of 'regulator_dummy_init'
drivers/regulator/dummy.h:28: note: previous definition of 'regulator_dummy_init' was here
make[2]: *** [drivers/regulator/dummy.o] Error 1
make[1]: *** [drivers/regulator] Error 2
make: *** [drivers] Error 2Signed-off-by: Anand Gadiyar
Cc: Liam Girdwood
Cc: Mark Brown
Acked-by: Randy Dunlap
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
I have a regulator A that sets regulator B as its supply. When I call
set_supply to add B as the supply for A, regulator A gets added to the
supply_list for regulator B.When I call regulator_disable(A), I end up with a call chain like this:
regulator_disable(A)
> mutex_lock(A)
> _regulator_disable(A)
>> _regulator_disable(B)
>>> _notifier_call_chain(B)
>>>> mutex_lock(A)Which results in dead lock since we are trying to acquire the mutex lock
for regulator A which we already hold.This patch addresses this issue by moving the call to disable regulator
B outside of the lock aquired inside the initial call to
regulator_disable.This change also addresses the issue of not acquiring the mutex for
regulator B before calling _regulator_disable(B).Signed-off-by: Jeffrey Carlyle
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
Allow machine drivers to explicitly enable the use of the dummy regulator,
enabling simpler support for systems with only a few specific supplies
visible to software.It is strongly recommended that this is not used on systems with
substantial software control over their PMICs, for maximum functionality
constrints should be as fully specified as possible.Signed-off-by: Mark Brown
Signed-off-by: Liam Girdwood -
This patch includes below fixes based on Mark's comment.
- Return actual error if i2c_smbus_read_byte_data() fail
- Add spaces around bitwise AND operator(&) to improve readability
- Add comment to explain why we need to update voltage change control register
for LDO1 and LDO5
- Logging the value for diagnostics if chip reported incorrect voltage value
- Add __devinit annotation for setup_regulators()
- Show system control register1 value if the value is mismatched
- Logging the value for diagnostics if failed to detect deviceSigned-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
This patch adds regulator drivers for National Semiconductors LP3972 PMIC.
This LP3972 PMIC controller has 3 DC/DC voltage converters and 5 low drop-out
(LDO) regulators. LP3972 PMIC controller uses I2C interface.Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
MAX8952 PMIC is used to provide voltage output between 770mV - 1400mV
with DVS support. In this initial release, users can set voltages for
four DVS modes, RAMP delay values, and SYNC frequency.
Controlling FPWM/SYNC_MODE/Pull-Down/Ramp Modes and reading CHIP_ID
is not supported in this release.If GPIO of EN is not valid in platform data, the driver assumes that it
is always-on. If GPIO of VID0 or VID1 is invalid, the driver pulls down
VID0 and VID1 to fix DVS mode as 0 and disables DVS support.We assume that V_OUT is capable to provide every voltage from 770mV to
1.40V in 10mV steps although the data sheet has some ambiguity on it.Signed-off-by: MyungJoo Ham
Signed-off-by: Kyungmin Park
Acked-by: Mark Brown
--
v2:
- Style correction
- Can accept platform_data with invalid GPIOs
- Removed unnecessary features
- Improved error handling
Signed-off-by: Liam Girdwood
08 Oct, 2010
1 commit
-
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
of/i2c: Fix module load order issue caused by of_i2c.c
i2c: Fix checks which cause legacy suspend to never get called
i2c-pca: Fix waitforcompletion() return value
i2c: Fix for suspend/resume issue
i2c: Remove obsolete cleanup for clientdata
02 Oct, 2010
3 commits
-
The SYNC bits are BIT6 and BIT7 of MAX8649_SYNC register.
pdata->extclk_freq could be [0|1|2].
(MAX8649_EXTCLK_26MHZ|MAX8649_EXTCLK_13MHZ|MAX8649_EXTCLK_19MHZ)
It requires to left shift 6 bits to properly set extclk_freq.Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
This patch fixes a typo that incorrectly reports mA numbers as uA.
Signed-off-by: Cyril Chemparathy
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
If device_register() fails then call put_device().
See comment to device_register.Signed-off-by: Vasiliy Kulikov
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood
30 Sep, 2010
1 commit
-
A few new i2c-drivers came into the kernel which clear the clientdata-pointer
on exit. This is obsolete meanwhile, so fix it and hope the word will spread.Signed-off-by: Wolfram Sang
Acked-by: Mark Brown
Signed-off-by: Jean Delvare
06 Sep, 2010
2 commits
-
In wm8350_dcdc_set_mode(), we set DCx_SLEEP bit of WM8350_DCDC_SLEEP_OPTIONS
register for REGULATOR_MODE_STANDBY mode.
( DCx_SLEEP bits: 0: Normal DC-DC operation 1: Select LDO mode )In wm8350_dcdc_get_mode(), current logic to determinate
REGULATOR_MODE_STANDBY mode is just reverse.
( sleep is set should mean REGULATOR_MODE_STANDBY mode. )Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
Problem description in current implementation:
When setting REGULATOR_MODE_IDLE mode, current implementation set
WM831X_LDO1_LP_MODE bit of ctrl_reg (which is wrong, it should clear the bit).
But due to a missing break statement for case REGULATOR_MODE_IDLE, the code
fall through to case REGULATOR_MODE_STANDBY and then clear
WM831X_LDO1_LP_MODE bit. So it still looks OK when checking the status
by wm831x_gp_ldo_get_mode().When setting REGULATOR_MODE_STANDBY mode, it just does not work.
wm831x_gp_ldo_get_mode() will still return REGULATOR_MODE_IDLE because
the accordingly WM831X_LDO1_LP_MODE bit is clear.Correct behavior should be:
Clear WM831X_LDO1_LP_MODE bit of ctrl_reg for REGULATOR_MODE_IDLE mode.
Set WM831X_LDO1_LP_MODE bit of ctrl_reg for REGULATOR_MODE_STANDBY mode.Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood
05 Sep, 2010
2 commits
-
selector is used as array index of info->supported_voltages
Thus the valid value range should be 0 .. info->voltages_len -1Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
In choose_voltage(), we use i as array index of info->vol_table.
The valid value range for i should be 0 .. ARRAY_SIZE(info->vol_table) - 1.Take LDO1 as example, ARRAY_SIZE(LDO1_table) is 4, vol_nbits of LDO1 is 2.
for (i = 0; i < (2 << info->vol_nbits); i++) is equivalent to
for (i = 0; i < 8; i++)
which is wrong.The same value range checking also applies for index in pm8607_list_voltage().
Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood
01 Sep, 2010
5 commits
-
Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
In current implementation, the address return from regulator_register()
is different from the address for regulator_unregister().Signed-off-by: Axel Lin
Acked-by: Sonic Zhang
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
max8998->dev is NULL in current implementation, set it to &pdev->dev.
regulator_register() still return success if max8998->dev is NULL,
but rdev->dev.parent will be set to NULL which is incorrect.Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
The third parameter of tps6586x_set_bits() is the bit_mask,
thus we should use (1 << ri->go_bit) instead of ri->go_bit.Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood -
val is used as array index of ri->voltages.
Thus the valid value range should be 0 .. ri->desc.n_voltages - 1.Signed-off-by: Axel Lin
Acked-by: Mark Brown
Signed-off-by: Liam Girdwood