Commit Graph

2247 Commits

Author SHA1 Message Date
Mark Brown ed4bf4f5e3 Merge remote-tracking branches 'regulator/topic/tps65217', 'regulator/topic/tps65218', 'regulator/topic/tps6586x' and 'regulator/topic/twl' into regulator-next 2014-08-05 18:29:30 +01:00
Mark Brown f71f26274d Merge remote-tracking branches 'regulator/topic/s2mps11', 'regulator/topic/s2mpu02', 'regulator/topic/s5m8767' and 'regulator/topic/tps65090' into regulator-next 2014-08-05 18:29:27 +01:00
Mark Brown d5b5d9d43b Merge remote-tracking branches 'regulator/topic/lp8755', 'regulator/topic/ltc3589', 'regulator/topic/max8952', 'regulator/topic/mc13xxx' and 'regulator/topic/palmas' into regulator-next 2014-08-05 18:29:24 +01:00
Mark Brown a627506a01 Merge remote-tracking branches 'regulator/topic/da9211', 'regulator/topic/getreg', 'regulator/topic/gpio' and 'regulator/topic/lp872x' into regulator-next 2014-08-05 18:29:21 +01:00
Mark Brown 862f9f840d Merge remote-tracking branches 'regulator/topic/88pm800', 'regulator/topic/ab8500', 'regulator/topic/act8865', 'regulator/topic/as3722' and 'regulator/topic/bcm590xx' into regulator-next 2014-08-05 18:29:18 +01:00
Mark Brown b7b045a550 Merge remote-tracking branch 'regulator/topic/core' into regulator-next 2014-08-05 18:29:17 +01:00
Mark Brown 9950756d77 Merge remote-tracking branches 'regulator/fix/act8865', 'regulator/fix/arizona' and 'regulator/fix/tps65218' into regulator-linus 2014-08-05 18:29:15 +01:00
Beniamino Galvani 34e0247ffc regulator: act8865: fix build when OF is not enabled
act8846_matches and act8865_matches are defined only when OF is
enabled. Move references to them to the act8865_pdata_from_dt()
function to avoid a build error when OF is disabled.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-05 18:02:54 +01:00
Beniamino Galvani ac0c0ea8b6 regulator: act8865: add support for act8846
Add device id and definition of registers and regulators to support
the act8846 PMU.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Tested-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-05 18:02:53 +01:00
Beniamino Galvani 50a03e35b0 regulator: act8865: prepare support for other act88xx devices
This patch prepares support for other devices in the act88xx family of
PMUs manufactured by Active-Semi.

http://www.active-semi.com/products/power-management-units/act88xx/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Tested-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-05 18:02:52 +01:00
Beniamino Galvani bbb83f38a8 regulator: act8865: set correct number of regulators in pdata
act8865_pdata_from_dt() populates the array pdata->regulators with all
the regulators and then assigns the field init_data only for the ones
actually found in the DT.

The patch changes the value assigned to pdata->num_regulators to match
the size of the array.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Tested-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-05 18:02:52 +01:00
Axel Lin 40d3bc1966 regulator: act8865: Remove error variable in act8865_pmic_probe
Simply use ret variable instead.
Also remove unneeded initialize for ret variable.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-05 18:02:52 +01:00
Beniamino Galvani 48a1e1b50d regulator: act8865: fix parsing of platform data
The driver loops through all available regulators (ACT8865_REG_NUM)
and accesses pdata->regulators[i].platform_data without checking the
actual value of num_regulators in platform data, potentially causing a
invalid memory access.

Fix this and look up the regulator init_data by id in platform data.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Tested-by Wenyou.Yang <wenyou.yang@atmel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-05 18:02:51 +01:00
Javier Martinez Canillas 4f2352cf52 regulator: tps65090: Set voltage for fixed regulators
According to the tps65090 data manual [0], the DCDC1 and DCDC2
step-down converters and the LDO's have a fixed output voltage.

Add this information to the driver since these fixed regulators
can be used as parent input supply for switches that don't have
an output voltage defined. So the regulator core needs to fetch
the FET parent output voltage if the child voltage is queried.

[0]: http://www.ti.com/lit/gpn/tps65090

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-31 20:24:29 +01:00
Javier Martinez Canillas 26988efe11 regulator: core: Allow to get voltage count and list from parent
Load switches are modeled as regulators but they just provide
the voltage of their parent input supply. So, the drivers for
these switches usually neither provide a .list_voltage handler
not set a .n_voltages count. But there is code in the kernel
that assumes that all regulators should be able to provide this
information (e.g: cpufreq and mmc subsystems).

If the voltage count and list are not available for a regulator
and it has a parent input supply, then use the parent values.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-29 19:24:43 +01:00
Javier Martinez Canillas e303996e94 regulator: core: Get voltage from parent if not available
Load switches are modeled as regulators but they just provide
the voltage of their parent input supply. So the drivers for
these switches usually don't provide a .get_voltage function
handler but there is code in the kernel that assumes that all
regulators should be able to provide its current voltage rail.

So, if the output voltage for a regulator is not available and
it has a parent supply, then pass the voltage of its parent.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-29 19:24:43 +01:00
Mark Brown 404d4df260 regulator: lp872x: Don't set constraints within the regulator driver
Regulator drivers should not be specifying constraints since the valid
configurations depend on how the device is used in a given system, there
is no way to know if a configuration is safe for a given board.

Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-28 13:19:23 +01:00
Axel Lin cad35c3f46 regulator: s2mps11: Update module description and Kconfig to add S2MPU02 support
This driver also supports S2MPU02 now, thus update module description and
Kconfig accordingly.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-25 18:53:23 +01:00
Tuomas Tynkkynen 04eca28cde regulator: Add helpers for low-level register access
Add helper functions that allow regulator consumers to obtain low-level
details about the regulator hardware, like the voltage selector register
address and such. These details can be useful when configuring hardware
or firmware that want to do low-level access to regulators, with no
involvement from the kernel.

The use-case for Tegra is a voltage-controlled oscillator clocksource
which has control logic to change the supply voltage via I2C to achieve
a desired output clock rate.

Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-25 18:43:48 +01:00
Axel Lin 516c1514b0 regulator: da9211: Remove unnecessary devm_regulator_unregister() calls
Current code uses devm_regulator_register(), so the resource management code
will ensure that the resource is freed.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-25 18:23:28 +01:00
James Ban 1028a37daa regulator: da9211: new regulator driver
This is the driver for the Dialog DA9211 Multi-phase 12A DC-DC Buck
Converter regulator. It communicates via an I2C bus to the device.

Signed-off-by: James Ban <james.ban.opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-14 19:15:56 +01:00
Keerthy 7753d2d41f regulator: tps65218: Add fixed_uV fields for dcdc5 and dcdc6
Add fixed_uV fields for dcdc5 and dcdc6.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-10 14:11:36 +02:00
Himangi Saraogi 5713525035 regulator: lp8755: Use devm_regulator_register
This patch moves data allocated using regulator_register to
devm_regulator_register and does away with the calls to
regulator_unregister. Also some labels are removed and a new labelerr is
introduced which is less specific to context.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-09 11:44:01 +02:00
Felipe Balbi 6a5e06d9f4 regulator: tps65218: drop order dependency
By just using GCC's array initialization extension, we
can easily drop order dependency between tps65218_regulattors
enumeration and tps65218_pmic_regs array.

Signed-of-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-09 10:29:19 +02:00
Felipe Balbi dd648ef247 regulator: tps65218: drop unneeded field from our regulator macro
volt table is always NULL for all regulators,
might as well drop the argument.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-09 10:29:11 +02:00
Mark Brown e60781b4eb Merge remote-tracking branch 'regulator/fix/tps65218' into regulator-tps65218 2014-07-09 10:28:49 +02:00
Felipe Balbi 42ab0f3915 regulator: tps65218: fix DCDC4 linear voltage range
The second range of this particular regulator,
starts at 1.60V, not as 1.55V as it was originally
implied by code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2014-07-09 10:26:21 +02:00
Beniamino Galvani 732714d0da regulator: act8865: set correct number of regulators in pdata
act8865_pdata_from_dt() populates the array pdata->regulators with all
the regulators and then assigns the field init_data only for the ones
actually found in the DT.

The patch changes the value assigned to pdata->num_regulators to match
the size of the array.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Tested-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-07 12:32:31 +02:00
Nikesh Oswal 5b919f3ebb regulator: arizona-ldo1: remove bypass functionality
WM5110/8280 devices do not support bypass mode for LDO1 so remove
the bypass callbacks registered with regulator core.

Signed-off-by: Nikesh Oswal <nikesh@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2014-07-04 18:51:45 +01:00
Nishanth Menon b632815e9a regulator: palmas: Fix SMPS enable/disable/is_enable for tps65917
We use regmap regulator ops to enable/disable and check if regulator
is enabled for various SMPS. However, these depend on valid
enable_reg, enable_mask and enable_value in regulator descriptor.

So, similar to fix we did in commit 318dbb02b5
("regulator: palmas: Fix SMPS enable/disable/is_enabled"), populate the
same for TPS65917 SMPS registration. LDO definitions are already in
place.

Fixes: d6f83370ed ("regulator: palmas: Add tps65917 PMIC support")
Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-03 15:25:56 +01:00
Nishanth Menon 429222d005 regulator: palmas: Simplify code by not indexing regulator_desc unnecessarily
Palmas regulator needs to full up the regulator_desc based on PMIC and
type of regulator. However, we dont need to do desc[id] every time. we
can simplify by using a pointer to desc[id] and filling up the
parameters.

Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-03 15:25:56 +01:00
Nishanth Menon 6839cd6f64 regulator: palmas: Rename palmas_regs_info to palmas_generic_regs_info
With commit d6f83370ed (regulator: palmas:
Add tps65917 PMIC support) palmas_regs_info naming is confusing as it is
a driver data parameter and a local variable. To prevent mistaken
updates, rename the local variable to palmas_generic_regs_info.

Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-03 15:25:56 +01:00
Nishanth Menon cf910b6b71 regulator: palmas: Simplify code by using pointer to palmas_reg_info
Palmas register information is part of the ddata pointer which is used
through out the code by indexing off the driver data array. Instead,
just do the indexing once and use the pointer to further reference
structure fields.

This simplifies code and prevents errors by accessing wrong variables.

Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-03 15:25:55 +01:00
Nishanth Menon e7cf34ef39 regulator: palmas: Rename reg_info to palmas_reg_info
reg_info is a generic term which might cause conflict at a later point
in time. To prevent such a thing from occuring in future, rename to
palmas_reg_info.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-03 15:25:52 +01:00
Nishanth Menon 4b09e17b6f regulator: palmas: Squelch sparse warnings
convert to static variables to squelch the following sparse warnings:
drivers/regulator/palmas-regulator.c:325:36: warning: symbol 'palma_sleep_req_info' was not declared. Should it be static?
drivers/regulator/palmas-regulator.c:1414:32: warning: symbol 'palmas_ddata' was not declared. Should it be static?
drivers/regulator/palmas-regulator.c:1427:32: warning: symbol 'tps65917_ddata' was not declared. Should it be static?

Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-03 15:24:42 +01:00
Russell King 778b28b434 regulator: core: convert to use gpio_desc internally
Convert the regulator GPIO handling to use a gpio descriptor rather than
numbers.  This allows us to revise the interfaces to permit all GPIOs
to be used with the regulator core.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-30 11:00:07 +01:00
Mark Brown 11767484b8 Merge remote-tracking branches 'regulator/fix/bcm590xx', 'regulator/fix/palmas' and 'regulator/fix/tps65218' into regulator-linus 2014-06-28 14:01:04 +01:00
Axel Lin d7da152c52 regulator: max8952: Convert to devm_gpio_request_one()
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-27 12:51:05 +01:00
Axel Lin cd01e32d91 regulator: twl: Convert to use devm_kmemdup()
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-27 12:50:35 +01:00
Keerthy 0eada6a1fc regulator: tps65218: Correct the the config register for LDO1
Correct the the config register for LDO1.

Fixes: 90e7d52627 (regulator: tps65218: Add Regulator driver for
TPS65218 PMIC)
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: <stable@vger.kernel.org> # v3.15
2014-06-24 16:28:58 +01:00
Keerthy d2fa87c3af regulator: tps65218: Add the missing of_node assignment in probe
Add the missing of_node assignment in probe.

Fixes: 90e7d52627 (regulator: tps65218: Add Regulator driver for TPS65218 PMIC)
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: <stable@vger.kernel.org> # v3.15
2014-06-24 16:28:49 +01:00
Sachin Kamat 5f986f7c2b regulator: tps65218: Fix build warnings
rdev_get_id() returns an int. Convert rid to type int to avoid the
following warnings:
drivers/regulator/tps65218-regulator.c:132:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
drivers/regulator/tps65218-regulator.c:146:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-24 16:25:13 +01:00
Sachin Kamat 6bdaaf0e5d regulator: tps65217: Fix build warnings
rdev_get_id() returns an int. Convert rid to type int to avoid the
following warnings:

drivers/regulator/tps65217-regulator.c:73:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
drivers/regulator/tps65217-regulator.c:87:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-24 16:23:00 +01:00
Sachin Kamat 0a3ade7ec2 regulator: s5m8767: Remove unused variable
'size' is not used in the function. Remove it.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-24 16:18:52 +01:00
Sachin Kamat a181c1c702 regulator: as3722: Fix incorrect parameter initialization
'name' field was re-initialized and getting overwritten in some
cases possibly due to a typo. Code inspection says the second time
it should be 'sname' instead of 'name'. Replace it.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-24 16:09:44 +01:00
Mark Brown 4c0c9cabcb Merge remote-tracking branch 'regulator/fix/palmas' into regulator-palmas
Conflicts:
	drivers/regulator/palmas-regulator.c
2014-06-24 12:20:11 +01:00
Stephen Warren 5b01bd11b7 regulator: palmas: fix typo in enable_reg calculation
When setting up .enable_reg for an SMPS regulator, presumably we should
call PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, ...) rather than using
LDO_BASE. This change makes the LCD panel and HDMI work again on the
NVIDIA Dalmore board anyway.

Fixes: 318dbb02b5 ("regulator: palmas: Fix SMPS enable/disable/is_enabled")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Nishanth Menon <nm@ti.com>
Tested-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-24 11:58:36 +01:00
Keerthy d6f83370ed regulator: palmas: Add tps65917 PMIC support
Add tps65917 PMIC support.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-23 12:30:56 +01:00
Keerthy cac9e91624 regulator: palmas: add driver data and modularize the probe
add driver data and modularize the probe.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-23 12:30:56 +01:00
Keerthy 9f057dc1d0 regulator: palmas: Shift the reg_info structure definition to the header file
Shift the reg_info structure definition to the header file.

Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-23 12:30:56 +01:00