aboutsummaryrefslogtreecommitdiff
path: root/include/linux/regulator
AgeCommit message (Collapse)AuthorFilesLines
2013-03-29regulator: ab8500: Init debug from regulator driverLee Jones1-0/+14
The purpose of this patch is to guarantee that ab8500-debug will record the regulator registers before they are modified by the ab8500 regulator driver. Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-29regulator: ab8500: Remove USB regulatorLee Jones1-1/+0
The USB regulator is controlled by hardware. The software support was only needed for early hardware (ED) which is no longer supported. Signed-off-by: Bengt Jonsson <[email protected]> Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-29regulator: ab8500-ext: Add HW request supportBengt Jonsson1-0/+4
Support for HW request is added in the external regulator driver. A flag in the board configuration can be set to let HW control the regulator when there is no SW request. This means that the regulator will be put in high power mode when there is a SW request and in HW-request mode otherwise. Signed-off-by: Bengt Jonsson <[email protected]> Signed-off-by: Lee Jones <[email protected]> Reviewed-by: Mattias NILSSON <[email protected]> Reviewed-by: Jonas ABERG <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-29regulator: ab8500-ext: New driver to control external regulatorsLee Jones1-0/+28
The ABx500 is capable of controlling three external regulator supplies. Most commonly on and off are supported, but if an external regulator chipset or power supply supports high-power and low-power mode settings, we can control those too. Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-28regulator: ab8500: Clean out SoC registersLee Jones1-12/+0
Clean out initialisation that is handled by SoC. Regulator settings for Vpll (partly), Vsmps1, Vsmps2, Vsmps3 (partly), Vrf1, Varm, Vape, Vbb, Vmod are cleaned out. They should not be touched by the kernel. We also update many of the initialisation values to be more in-line with the current development efforts of ST-Ericsson internal engineers. Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-22regulator: ab8500: Separate regulator and MFD platform dataBengt Jonsson1-0/+7
The ab8500 MFD should not have knowledge about regulator- specific platform data like number of regulators and regulator registers. As the regulator platform data is about to grow with external regulators, this information is moved to a new structure provided by the regulator driver. Signed-off-by: Bengt Jonsson <[email protected]> Signed-off-by: Lee Jones <[email protected]> Reviewed-by: Yvan FILLION <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-22regulator: ab8500: Another push to synchronise recent AB8500 developmentsLee Jones1-9/+12
This patch ensures that many of the recent developments pertaining to the AB8500 regulator device are propagated out into the public arena. It aims to update some of the existing initialisation values in accordance with internal ST-Ericsson code submissions. This single patch was originally a collection of updates which have been squashed together to aid with clarity. Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-22ARM: ux500: regulators: Add mask for configurationLee Jones1-4/+6
There is already before a register mask in the regulator driver to allow some bits of a register to be initialized. The register value is defined in the board configuration. This patch puts a mask in the board configuration to specify which bits should actually be altered. The purpose with this patch is to avoid future mistakes when updating the allowed bits in the regulator driver. Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-22regulator: ab8500: Further populate initialisation registersLee Jones1-0/+8
This patch supplies access to some extra settings provided by the AB8500 regulator device. We also update some of the existing initialisation values in accordance with internal ST-Ericsson code submissions. This single patch was originally a collection of updates which have been squashed together to aid with clarity. Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-05regulator: core: Add enable_is_inverted flag to indicate set enable_mask ↵Axel Lin1-0/+3
bits to disable Add enable_is_inverted flag to indicate set enable_mask bits to disable when using regulator_enable_regmap and friends APIs. Signed-off-by: Axel Lin <[email protected]> Reviewed-by: Haojian Zhuang <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-04regulator: core: use regulator_ena_pin memberKim, Milo1-2/+0
The regulator_dev has regulator_enable_gpio structure. 'ena_gpio' and 'ena_gpio_invert' were moved to in regulator_enable_gpio. regulator_dev ---> regulator_enable_gpio .ena_gpio .gpio .ena_gpio_invert .ena_gpio_invert Pointer, 'ena_pin' is used for checking valid enable GPIO pin. Signed-off-by: Milo(Woogyom) Kim <[email protected]> Reviewed-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-04regulator: core: support shared enable GPIO conceptKim, Milo1-0/+2
A Regulator can be enabled by external GPIO pin. This is configurable in the regulator_config. At this moment, the GPIO can be owned by only one regulator device. In some devices, multiple regulators are enabled by shared one GPIO pin. This patch extends this limitation, enabling shared enable GPIO of regulators. New list for enable GPIO: 'regulator_ena_gpio_list' This manages enable GPIO list. New structure for supporting shared enable GPIO: 'regulator_enable_gpio' The enable count is used for balancing GPIO control count. This count is incremented when GPIO is enabled. On the other hand, it's decremented when GPIO is disabled. Reference count: 'request_count' The reference count, 'request_count' is incremented/decremented on requesting/freeing the GPIO. This count makes sure only free the GPIO when it has no users. How it works If the GPIO is already used, skip requesting new GPIO usage. The GPIO is new one, request GPIO function and add it to the list of enable GPIO. This list is used for balancing enable GPIO count and pin control. Updating a GPIO and invert code moved 'ena_gpio' and 'ena_gpio_invert' of the regulator_config were moved to new function, regulator_ena_gpio_request(). Use regulator_enable_pin structure rather than regulator_dev. Signed-off-by: Milo(Woogyom) Kim <[email protected]> Reviewed-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-03-04regulator: core: Mark all get and enable calls as __must_checkMark Brown1-7/+7
It's generally important that devices have power when they expect it so drivers really ought to be checking for errors on the power up paths. Signed-off-by: Mark Brown <[email protected]>
2013-03-01regulator: core: update kernel documentation for regulator_descNishanth Menon1-0/+2
commit df367931 (regulator: core: Provide regmap get/set bypass operations) introduced regulator_[gs]et_bypass_regmap However structure documentation for regulator_desc needs an update. ./scripts/kernel-doc include/linux/regulator/driver.h >/dev/null generates: Warning(include/linux/regulator/driver.h:233): No description found for parameter 'bypass_reg' Warning(include/linux/regulator/driver.h:233): No description found for parameter 'bypass_mask' Cc: Liam Girdwood <[email protected]> Cc: Mark Brown <[email protected]> Cc: [email protected] Signed-off-by: Nishanth Menon <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-12-24regulator: core: Allow specify apply_[reg|bit] for regmap based voltage_sel ↵Axel Lin1-0/+6
operations Some DVM regulators needs to update apply_bit after setting vsel_reg to initiate voltage change on the output. This patch adds apply_reg and apply_bit to struct regulator_desc and update regulator_set_voltage_sel_regmap() to set apply_bit of apply_reg when apply_bit is set. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-12-10Merge remote-tracking branch 'regulator/topic/tol' into regulator-nextMark Brown1-0/+8
2012-12-10Merge remote-tracking branch 'regulator/topic/stub' into regulator-nextMark Brown1-0/+4
2012-12-10Merge remote-tracking branch 'regulator/topic/min' into regulator-nextMark Brown1-0/+2
2012-12-10Merge remote-tracking branch 'regulator/topic/max8973' into regulator-nextMark Brown1-0/+72
2012-12-10Merge remote-tracking branch 'regulator/topic/hotplug' into regulator-nextMark Brown3-50/+50
2012-12-06regulators: add regulator_can_change_voltage() functionMarek Szyprowski1-0/+1
Introduce a regulator_can_change_voltage() function for the subsytems or drivers which might check if applying voltage change is possible and use special workaround code when the driver is used with fixed regulators or regulators with disabled ability to change the voltage. Signed-off-by: Marek Szyprowski <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-11-27Merge branches 'topic/da9055' and 'topic/tps51632' of ↵Mark Brown1-0/+47
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-min
2012-11-27regulator: core: Allow specific minimal selector for starting linear mappingAxel Lin1-0/+2
Some drivers (at least 3 drivers) have such variant of linear mapping that the first few selectors are invalid and the reset are linear mapping. Let's support this case in core. This patch adds linear_min_sel in struct regulator_desc, so we can allow specific minimal selector for starting linear mapping. Then extends regulator_[map|list]_voltage_linear() to support this feature. Note that for selectors less than min_linear_index, we need count them to n_voltages so regulator_list_voltage() won't fail while checking the boundary for selector before calling list_voltage callback. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-11-21regulator: add missing prototype for regulator_is_supported_voltagePhilip Rakity1-0/+4
avoids needs for CONFIG_REGULATOR in sdhci.c Signed-off-by: Philip Rakity <[email protected]> Reviewed-by: Eric Miao <[email protected]> Signed-off-by: Eric Miao <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-11-20Merge branches 'topic/tps51632', 'topic/tps80031', 'topic/vexpress', ↵Mark Brown3-50/+50
'topic/max8925', 'topic/gpio' and 'topic/tps65090' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-hotplug
2012-11-19regulator: max8973: add regulator driver supportLaxman Dewangan1-0/+72
The MAXIM MAX8973 high-efficiency, three phase, DC-DC step-down switching regulator delievers up to 9A of output current. Each phase operates at a 2MHz fixed frequency with a 120 deg shift from the adjacent phase, allowing the use of small magnetic component. Add regulator driver for this device. Signed-off-by: Laxman Dewangan <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-11-14regulator: core: Add regulator_is_supported_voltage_tol()Mark Brown1-0/+8
If consumers wish to set voltages based on a tolerance it stands to reason that they will also want to query for support in the same manner. Signed-off-by: Mark Brown <[email protected]> Acked-by: Liam Girdwood <[email protected]>
2012-10-17regulator: tps65090: Register all regulators in single probe callLaxman Dewangan1-50/+0
MFD driver registers the regulator driver once per device and hence it is require to register all regulators in single probe call. Following are details of changes done to achieve this: - Move the regulator enums to mfd header and remove the tps65090-regulator.h as it does not contain more info. - Add max regulator and register all regulators even if there is no regulator init data from platform. - Convert regulator init data to pointer type in platform data. - Add input supply name in regulator desc to provide input supply. - Separate desc information from driver information. - Disable external control bit to have control through register write. Signed-off-by: Laxman Dewangan <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-10-15regulator: core: Support for continuous voltage rangePawel Moll1-0/+3
Some regulators can set any voltage within the constraints range, not being limited to specified operating points. This patch makes it possible to describe such regulator and makes the regulator_is_supported_voltage() function behave correctly. Signed-off-by: Pawel Moll <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-10-15regulator: tps51632: Add tps51632 regulator driverLaxman Dewangan1-0/+47
The TPS51632 is a driverless step down controller with serial control. Advanced features such as D-Cap+ architecture with overlapping pulse support and OSR overshoot reduction provide fast transient response, lowest output capacitance and high efficiency. The TPS51632 supports both I2C and DVFS interfaces (through PWM) for dynamic control of the output voltage and current monitor telemetry. Add regulator driver for TPS51632. Signed-off-by: Laxman Dewangan <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-09-28Merge remote-tracking branches 'regulator/topic/core', ↵Mark Brown4-1/+94
'regulator/topic/bypass', 'regulator/topic/tol', 'regulator/topic/drivers' and 'regulator/topic/tps6586x' into regulator-next
2012-09-10regulator: core: Provide regmap get/set bypass operationsMark Brown1-0/+4
Signed-off-by: Mark Brown <[email protected]>
2012-09-10regulator: core: Support bypass modeMark Brown3-0/+20
Many regulators support a bypass mode where they simply switch their input supply to the output. This is mainly used in low power retention states where power consumption is extremely low so higher voltage or less clean supplies can be used. Support this by providing ops for the drivers and a consumer API which allows the device to be put into bypass mode if all consumers enable it and the machine enables permission for this. This is not supported as a mode since the existing modes are rarely used due to fuzzy definition and mostly redundant with modern hardware which is able to respond promptly to load changes. Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Graeme Gregory <[email protected]>
2012-09-10regulator: Fairchild fan53555 supportYunfan Zhang1-0/+60
This driver supports Fairchild FAN53555 Digitally Programmable TinyBuck Regulator. The FAN53555 is a step-down switching voltage regulator that delivers a digitally programmable output from an input voltage supply of 2.5V to 5.5V. The output voltage is programmed through an I2C interface. Signed-off-by: Yunfan Zhang <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-08-31regulator: Clarify documentation for regmap in the configMark Brown1-1/+2
Signed-off-by: Mark Brown <[email protected]>
2012-08-28regulator: Update comment for set_current_limit callback of struct regulator_opsAxel Lin1-0/+1
The regulators should be tending to the maximum in the available range and consumers should specify the widest range possible. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-08-08regulator: add a new API regulator_set_voltage_tol()Shawn Guo1-0/+7
There are some use cases where a voltage range could be reasonably specified by a target voltage and tolerance. Add a new API regulator_set_voltage_tol() wrapping regulator_set_voltage() call to ease the users. Signed-off-by: Shawn Guo <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-07-22Merge branch 'regulator-drivers' into regulator-nextMark Brown4-0/+118
2012-07-22Merge branches 'regulator-core', 'regulator-dt' and 'regulator-dummy' into ↵Mark Brown1-4/+7
regulator-next
2012-07-12regulator: Add REGULATOR_STATUS_UNDEFINED.Krystian Garbaciak1-0/+2
REGULATOR_STATUS_UNDEFINED is to be returned by regulator, if any other state doesn't really apply. Signed-off-by: Krystian Garbaciak <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-07-05regulator: fixed: dt: support for input supplyLaxman Dewangan1-0/+2
Add support for input supply in DT parsing of node. The input supply will be provided by the property "vin-supply" in the regulator node. Signed-off-by: Laxman Dewangan <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-07-03regulator: core: Add core support for GPIO controlled enable linesMark Brown1-0/+11
It is very common for regulators to support having their enable signal controlled by a GPIO. Since there are a bunch of fiddly things to get right like handling the operations when the enable signal is tied to a rail and it's just replicated code add support for this to the core. Drivers should set ena_gpio in their config if they have a GPIO control, using ena_gpio_flags to specify any flags (including GPIOF_OUT_INIT_ for the initial state) and ena_gpio_invert if the GPIO is active low. The core will then override any enable and disable operations the driver has and instead control the specified GPIO. This will in the future also allow us to further extend the core by identifying when several enable signals have been tied together and handling this properly. Signed-off-by: Mark Brown <[email protected]>
2012-07-03regulator: core: Allow fixed enable_time to be set in the regulator_descMark Brown1-0/+4
Many regulators have a fixed specification for their enable time. Allow this to be set in the regulator_desc as a number to save them having to implement an explicit operation. Signed-off-by: Mark Brown <[email protected]>
2012-07-01regulator: add missing defintion regulator_is_supported_voltagePhilip Rakity1-0/+6
This definition is missing when CONFIG_REGULATOR is not defined. This causes compiler errors when compiling sdhci.c. This can be worked around by adding #ifdef CONFIG_REGULATOR .. #endif but since other definitions are there we have defined the missing definition Signed-off-by: Philip Rakity <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-06-19regulator: extend the fixed dummy voltage regulator to accept voltageGuennadi Liakhovetski1-3/+3
Trivially extend the regulator_register_always_on() helper function to be even more useful by adding a voltage parameter to it. Signed-off-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-06-19regulator: support multiple dummy fixed regulatorsGuennadi Liakhovetski1-2/+5
Currently regulator_register_fixed() uses a constant name to register a fixed dummy regulator. This is sufficient in principle, since there is no reason to register multiple such regulators. The user can simply supply all consumers in one array and use it to initialise such a regulator. However, in some cases it can be convenient to register multiple such regulators. This is also a prerequisite for the upcoming patch, that will add a voltage parameter to this function. The original function is provided as a wrapper macro. Signed-off-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-06-19regulator: add new regulator driver for lp872xKim, Milo1-0/+90
This driver supports TI/National LP8720, LP8725 PMIC. Signed-off-by: Milo(Woogyom) Kim <[email protected]> Reviewed-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-06-18regulator: stubs: Make stub regulator_get_voltage() return an errorMark Brown1-1/+1
Returning 0 isn't useful, it's not even meaningful if there is a real regulator there. Reported-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-06-18regulator: core: Change the unit of ramp_delay from mV/uS to uV/uSAxel Lin2-2/+2
This change makes it possible to set ramp_delay with 0.xxx mV/uS without truncation issue. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2012-06-17regulator: Add ramp_delay configuration to constraintsYadwinder Singh Brar2-0/+6
For some hardwares ramp_delay for BUCKs is a configurable parameter which can be configured through DT or board file.This patch adds ramp_delay to regulator constraints and allow user to configure it for regulators which supports this feature, through DT or board file. It will provide two ways of setting the ramp_delay for a regulator: First, by setting it as constraints in board file(for configurable regulators) and set_machine_constraints() will take care of setting it on hardware by calling(the provided) .set_ramp_delay() operation(callback). Second, by setting it as data in regulator_desc(as fixed/default ramp_delay rate) for a regulator in driver. regulator_set_voltage_time_sel() will give preference to constraints->ramp_delay while reading ramp_delay rate for regulator. Similarly users should also take care accordingly while refering ramp_delay rate(in case of implementing their private .set_voltage_time_sel() callbacks for different regulators). [Rewrote subject for 80 columns -- broonie] Signed-off-by: Yadwinder Singh Brar <[email protected]> Signed-off-by: Mark Brown <[email protected]>