The device tree binding of Palmas regulator driver says as:
palmas_pmis {
compatible = "ti,palmas-pmic";
...
regulators {
...
}
};
In this "regulators" subnode is expected to be part of parent node, not
the outside of parent node. Hence to get the regulator node, the correct
call is of_get_child_by_name() rather than of_find_node_by_name() which
actually searches the "regulators" node from the parent node to end of DTS
file.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Current equation on the comment is wrong.
For linear mapping starting from 0, the equation is (maxV-minV)/stepV + 1.
Since the linear mapping for PALMAS is not all starting from 0, the equation
on the comment is not useful and misleading. Thus remove it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As per datasheet (Referred TPS65913), the on-time for LDO is
500micro second. If LDO6 is in vibrator mode then the on-time
is 2000us.
Set the enable_time on regulator descriptor accordingly.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Palmas rails like LDOs, SMPSs, REGENs, SYSENs can be enable and disable
by register programming through I2C communication as well as it can be
enable/disable with the external control input ENABLE1, ENABLE2 and NSLEEP.
Add support for configuring these rails to be controlled by external control
inputs. This is require to configure the rail's control register as well as
configuration of resource register.
Provide the external input names through parameter "roof-floor". Updated the
DT binding document to details different value of the roof-floor.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Commmit af40a94aba "regulator: palmas: Use devm_regulator_register" missed
removing a regulator_unregister() call if palmas_extreg_init falis. Fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
As per datasheet (Referred TPS65913), the on-time for LDO is
500micro second. If LDO6 is in vibrator mode then the on-time
is 2000us.
Set the enable_time on regulator descriptor accordingly.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
With the following change
---------
commit ad02e84687
Author: Axel Lin <axel.lin@ingics.com>
regulator: palmas: Return raw register values as the selectors in [get|set]_voltage_sel
Don't adjust the selector in [get|set]_voltage_sel, fix it in list_voltage() instead.
For smps*(except smps10), the vsel reg-value and voltage mapping as below:
----------
The list_voltage() takes the true value of selector which is
programmed in the register. As per smsp voltage table
reg-value volt (uV) ( Assume RANGE is x1 )
0 0
1 500000
2 500000
3 500000
4 500000
5 500000
6 500000 (0.49V + 1 * 0.01V) * RANGE
7 510000 (0.49V + 2 * 0.01V) * RANGE
8 520000 (0.49V + 3 * 0.01V) * RANGE
9 530000 (0.49V + 4 * 0.01V) * RANGE
....
121 1650000 (0.49V + 116 * 0.1) * RANGE
Hence making n_voltages for smps to 122.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
SMPS10 has two outputs OUT1 and OUT2 and have one input IN1.
SMPS10-OUT2 is connected to SMPS10-IN1 and can be configured either
in BOOST mode or BYPASS mode. regulator_enable of SMPS10-OUT2 configures
it in BOOST mode. For BYPASS mode regulator_allow_bypass() API can be
used. SMPS10-OUT1 is connected to SMPS10-OUT2 and can be enabled using
regulator_enable().
[ axel.lin@ingics.com : Simplify regulator_desc setting for SMPS10_[OUT1|OUT2]
Signed-off-by: J Keerthy <j-keerthy@ti.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Add TPS659038 support.
Signed-off-by: J Keerthy <j-keerthy@ti.com>
Acked-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
The SMPS10 regulator is not presesnt in all the variants
of the PALMAS PMIC family. Hence adding a feature to distingush
between them.
Signed-off-by: J Keerthy <j-keerthy@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
regulator_enable_regmap() uses enable_reg to enable the regulator.
But enable_reg for smps10 points to SMPS10_STATUS which is a
read-only register. Fixed the same by having enable_reg
set to SMPS10_CTRL.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
Since 'id' cannot take two values at the same time, the condition
should probably be an OR (||) instead of AND (&&).
Introduced by commit 28d1e8cd67 ("regulator: palma: add ramp delay
support through regulator constraints").
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Datasheet says:
Time Step (TSTEP) selection, when changing the output voltage, the new value is
reached through successive voltage steps (if not bypassed). The equivalent
programmable slew rate of the output voltage is:
TSTEP[1:0]: 00 Jump (no slope control)
TSTEP[1:0]: 01 10mV/us
TSTEP[1:0]: 10 5mV/us (default)
TSTEP[1:0]: 11 2.5mV/us
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The ctrl_addr setting for SMPS10 is missed, thus palmas_smps_init() read/write
wrong register for SMPS10 in current code. Fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
SMPS3 and SMPS7 do not have tstep_addr setting, so current code actually
writes 0 to smps12_ctl (offset is 0) register when set_ramp_delay callback
is called for SMPS3 and SMPS7.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
When SMPS45 is set to off and LDO8 tracking is enabled, the output voltage can
be set from 0.45 to 1.65 V. Thus set min_uV to be 450000.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The Palma device like TPS65913 have the mode mask which is also
used for enable/disable the rails. The mode bits are defined as
00: OFF
01: AUTO
10: ECO
11: Forced PWM
and modes are set accordingly as
REGULATOR_MODE_NORMAL: AUTO
REGULATOR_MODE_IDLE: ECO
REGULATOR_MODE_FAST: PWM
Two issue observed:
1. If client calls following sequence:
regulator_enable(),
regulator_set_mode(FAST),
regulator_disable()
and again the regulator_enable() then the mode is reset
to NORMAL inplace of keeping the mode as FAST.
Fixing this by storing the current mode configured by client
and restoring modes when enable() is called after disable().
2. In following sequence, the regulator get enabled:
regulator_disable()
regulator_set_mode(FAST),
Fixing this by updating new mode in register only if it is
enabled.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Currently Palma regulator driver support the ramp delay
through rail specific platform data.
As regulator framework support the configuration of ramp
delay through regulator constraint, using the framework
method and removing the platform specific data approach.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
LDO8 of Palma device like tps65913 support the tracking mode
on which LDO8 track the SMPS45 voltage when SMPS45 is ON
and use the LDO8.VOLTAGE_SEL register when SMPS45 is OFF.
On track mode, the steps of voltage change for LDO8 is 25mV
where in non-tracking mode it is 50mV. Set the steps accordingly.
Number of voltage count is still same for both the cases.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Palmas device have control outputs like REGEN1, REGEN2, REGEN3,
SYSEN1 and SYSEN2. These control outputs can be used for controlling
external voltage switches to enabled/disable voltage outputs.
Add support of these control outputs through regulator framework.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Clear the sleep/warm reset bits when it is not selected through
regulator platform data. This will make sure that configuration
is inline with the platform data regardless of boot/POR
configuration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Palmas regulator support the different input supply pins for each of
the rails. Fill the regulator info data with their input supply pin
names.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
When palmas regulator probe creates stack dump during initialization
due to some crash, it prints the call trace as follows:
[3.166321] [<c028fa20>] (_regmap_read+0x5c/0xa8) from [<c028fab0>] (regmap_read+0x44/0x5c)
[3.174669] [<c028fab0>] (regmap_read+0x44/0x5c) from [<c023062c>] (palmas_probe+0x240/0x7d0)
[3.183193] [<c023062c>] (palmas_probe+0x240/0x7d0) from [<c0284064>] (platform_drv_probe+0x14/0x18)
[3.192322] [<c0284064>] (platform_drv_probe+0x14/0x18) from [<c0282ee4>] (driver_probe_device+0x104/0x214)
[3.202055] [<c0282ee4>] (driver_probe_device+0x104/0x214) from [<c028167c>] (bus_for_each_drv+0x5c/0x88)
The palmas_probe is current name but it helps on debugging if the
function name is more appropriate to the sub-module name.
Renaming the palmas_probe() to palmas_regulator_probe() and
palmas_remove() to palams_regulator_remove().
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
It does not make sense to assign return value of of_property_read_u32() to
pdata->reg_init[idx]->warm_reset. Use of_property_read_bool() to read
"ti,warm-reset" DT property instead which will return correct setting
for pdata->reg_init[idx]->warm_reset.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Fix the DT parsing to agree with the bindings document. Some small changes
to the value names and also fix the handling of boolean values. They were
previously using prop = 1/0, now just use of_property_read_bool calls.
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
DT node properties should not have "_". Replacing them by "-".
Signed-off-by: J Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Number of voltages for SMPS regulators was off by one.
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Ian Lartey <ian@slimlogic.co.uk>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Current code read "ti,warm_reset" of property twice, and set
pdata->reg_init[idx]->warm_reset twice. Read and set it once is enough.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
of_find_node_by_name() returns a node pointer with refcount incremented, use
of_node_put() on it when done.
of_find_node_by_name() will call of_node_put() against from parameter,
thus we also need to call of_node_get(from) before calling
of_find_node_by_name().
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.
This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.
Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.
Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Don't adjust the selector in [get|set]_voltage_sel, fix it in list_voltage() instead.
For smps*(except smps10), the vsel reg-value and voltage mapping as below:
reg-value volt (uV) ( Assume RANGE is x1 )
0 0
1 500000
2 500000
3 500000
4 500000
5 500000
6 500000 (0.49V + 1 * 0.01V) * RANGE
7 510000 (0.49V + 2 * 0.01V) * RANGE
8 520000 (0.49V + 3 * 0.01V) * RANGE
9 530000 (0.49V + 4 * 0.01V) * RANGE
....
The linear mapping is start from selector 6.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
As usual we have a few new drivers:
- TI LP8788
- TI OMAP USB TLL
- Maxim MAX8907
- SMSC ECE1099
- Dialog Semiconductor DA9055
- A simpler syscon driver that allow us to get rid of the anatop one.
Drivers are also gradually getting Device Tree and IRQ domain support.
The following drivers got DT support:
- palmas, 88pm860x, tc3589x and twl4030-audio
And those ones now use the IRQ domain APIs:
- 88pm860x, tc3589x, db8500_prcmu
Also some other interesting changes:
- Intel's ICH LPC now supports Lynx Point
- TI's twl4030-audio added a GPO child
- tps6527 enabled its backlight subdevice
- The twl6030 pwm driver moved to the new PWM subsystem
And finally a bunch of cleanup and casual fixes for mc13xxx, 88pm860x, palmas,
ab8500, wm8994, wm5110, max8907 and the tps65xxx family.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJQbVq4AAoJEIqAPN1PVmxKXOsP/ifwoqYkaGUsZ7M8b8iTTxlk
a0/SBU1O+FDG7LbIsOyJ6VZCpipj8R4WyVqNdS2CSPVoSdT8KnakrxFY9FAtcmpA
c6O7r+9dymcT7HeQ6mBQYYeEyXcZQkTXj9Y298zuRT88gccH5PQIOX8DTj6gKVxN
xhuDuAWtizvwAJWfof/57p7JLilCF96Hq0UdeISD10UWJPxPmXFJTzzYw6GbPPOl
zk1N6yig3VpK6sfK+QdqZykHFKj23RX57SmceHOISTpEr66ayuKIkJEqWm/IydMO
XWDTT2IN80ca+1PnbrQOyiMtXg3EKrZN5WDEp2AcUiKP0fnAoZBTeuZUkqyLc3rJ
W8LowQe6x5154CeLwcJc4+kmeGUhbj09GHKCsI7x/lQpMWgJCaGHGvLxAUE1uRZi
4Bn9IUP7OqE465fNolLOd1fRxgzWJxe5rBYKQB7UcOrS0NThPhu0r0qV905zBrBO
tyCZz+PexTiirpbv1K0dMTcpWeHVOmtYG5uJTmw9wTRv7jW7aUhkhkW5Q+E5BAdb
9Rj5/vYertqI3VzRQ1w2z1SavzBO3OykTURWGDkwjfFWYbJtEdPYGGjRSFiphVYG
8jvs5UzrDm2ICqkpkKzovVWi9lXyvNVVCgSwxHQeoPXfqb5dXLlbUZZBaCaQpRII
XlItAJvIiUNIA8bXLoC8
=n6lp
-----END PGP SIGNATURE-----
Merge tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD changes from Samuel Ortiz:
"MFD bits for the 3.7 merge window.
As usual we have a few new drivers:
- TI LP8788
- TI OMAP USB TLL
- Maxim MAX8907
- SMSC ECE1099
- Dialog Semiconductor DA9055
- A simpler syscon driver that allow us to get rid of the anatop one.
Drivers are also gradually getting Device Tree and IRQ domain support.
The following drivers got DT support:
- palmas, 88pm860x, tc3589x and twl4030-audio
And those ones now use the IRQ domain APIs:
- 88pm860x, tc3589x, db8500_prcmu
Also some other interesting changes:
- Intel's ICH LPC now supports Lynx Point
- TI's twl4030-audio added a GPO child
- tps6527 enabled its backlight subdevice
- The twl6030 pwm driver moved to the new PWM subsystem
And finally a bunch of cleanup and casual fixes for mc13xxx, 88pm860x,
palmas, ab8500, wm8994, wm5110, max8907 and the tps65xxx family."
Fix up various annoying conflicts: the DT and IRQ domain support came in
twice and was already in 3.6. And then it was apparently rebased.
Guys, DON'T REBASE!
* tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (89 commits)
ARM: dts: Enable 88pm860x pmic
mfd: 88pm860x: Move gpadc init into touch
mfd: 88pm860x: Device tree support
mfd: 88pm860x: Use irqdomain
mfd: smsc: Add support for smsc gpio io/keypad driver
backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe
mfd: DA9055 core driver
mfd: tps65910: Add alarm interrupt of TPS65910 RTC to mfd device list
mfd: wm5110: Add register patches for revision B
mfd: wm5110: Disable control interface error report for WM5110 rev B
mfd: max8907: Remove regulator-compatible from DT docs
backlight: Add TPS65217 WLED driver
mfd: Add backlight as subdevice to the tps65217
mfd: Provide the PRCMU with its own IRQ domain
mfd: Fix max8907 sparse warning
mfd: Add lp8788 mfd driver
mfd: dbx500: Provide a more accurate smp_twd clock
mfd: rc5t583: Fix warning messages
regulator: palmas: Add DT support
mfd: palmas: Change regulator defns to better suite DT
...
Add DT support to palmas regulator. This involved a little change to
the platform data structure. Regulator information can now come from
platform data or DT.
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>