summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8973-regulator.c
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge remote-tracking branches 'regulator/topic/mt6311', ↵Mark Brown2015-08-301-1/+0
|\ \ | | | | | | | | | 'regulator/topic/ocp', 'regulator/topic/owner', 'regulator/topic/pfuze100' and 'regulator/topic/pwm' into regulator-next
| | * regulator: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski2015-07-141-1/+0
| |/ | | | | | | | | | | | | | | i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: max8973: Set VSEL regmap ops if DVS GPIO is not setMikko Perttunen2015-07-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Use regmap helpers for get_voltage_sel and set_voltage_sel ops if the DVS GPIO is not set. The DVS GPIO allows on the fly selection of the VSEL register from two choices. However, if it is not set, the VSEL register will stay fixed and we can use the regmap ops. This allows use of the *hardware_vsel* regulator APIs. Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: max8973: add support to configure ETR based on rail loadLaxman Dewangan2015-07-071-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support to configure Enhanced Transient Response Enable (ETR) and Sensitivity Selection based on maximum current i.e. expected load on that rail. Maxim recommended as: - Enable ETR with high sensitivity (75mV/us) for 0 to 9A expected loads, - Enable ETR with low sensitivity (150mV/us) for 9A to 12A expected loads. - Disable ETR for expected load > 12A. These recommendation will be configured for MAX77621 when maximum load is provided through regulator constraint for maximum current from platform. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: max8973: add support to configure ETR from DTLaxman Dewangan2015-07-071-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MAX8973/MAX77621 feature an Enhanced Transient Response(ETR) circuit that is enabled through software. The enhanced transient response reduces the voltage droop during large load steps by temporarily allowing all three phases to fire in unison, slewing total inductor current faster than would normally be possible if all three phases continued to operate 120deg out of phase. The enhanced transient response detector features two selectable sensitivity settings, which select the output voltage slew rate during load transients that triggers the ETR circuit. The sensitivity of the ETR detector is set by the CKADV[1:0] bits in the CONTROL2 register. Add support to configure the ETR through platform data from DT. Update the DT binding document accordingly. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: max8973: Fix up control flag option for bias controlLaxman Dewangan2015-07-071-1/+1
|/ | | | | | | | | | | The control flag for the bias control is MAX8973_CONTROL_BIAS_ENABLE rather than MAX8973_BIAS_ENABLE which is macro for the bits in register. Fix this typo. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: max8973: Fix up ramp_delay for MAX8973_RAMP_25mV_PER_US caseAxel Lin2015-06-101-1/+1
| | | | | | | | Fix trivial typo. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: max8973: add support for MAX77621Laxman Dewangan2015-06-091-20/+84
| | | | | | | | | | | | | | | | | | | | | | | | Maxim MAX77621 device is high-efficiency, three-phase, DC-DC step-down switching regulator delivers peak output currents up to 16A. This device is extension of MAX8973 and compatible with the register definition. The MAX77621 has the SHUTDOWN pin which is EN pin on the MAX8973. On MAX77621, the SHUTDOWN pin (active low) reset device register to its POR/OTP value. The voltage output is enabled when SHUTDONW pin is HIGH and EN bit on VOUT register is HIGH. For MAX8973, VOUT is enabled when EN bit or EN pin is high. Add support of the MAX77621 device on max8973 regulator driver with following changes: - Make sure SHUTDOWN pin is set HIGH through GPIO calls if GPIO from AP connected to SHUTDOWN pin provided. - Enable/disable the rail through register access only. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: max8973: configure ramp delay through callbackLaxman Dewangan2015-06-091-16/+57
| | | | | | | | | | | | Regulator core framework support the configuration of ramp delay reading from platform specific regulator data via the regulator callback ops. Instead of reading regulator init data on driver and setting ramp delay, use the callback to achieve this. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: max8973: add mechanism to enable/disable through GPIOLaxman Dewangan2015-05-221-6/+23
| | | | | | | | | | MAX8973 supports the voltage output enable/disable through its EN pin. This EN pin can be connected through GPIO from host processor. Add support to provide GPIO number from platform/DT and if it is valid GPIO then enable external control default. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: max8973: add DT parsing of platform specific parameterLaxman Dewangan2015-05-221-20/+65
| | | | | | | | | | | | There are some platform specific parameter required to configure the device like enable external control, DVS gpio etc. Add DT parsing of such properties to make platform specific data. Update DT binding doc accordingly. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: max8973: get rid of extra variable for gpio validityLaxman Dewangan2015-05-211-6/+2
| | | | | | | | | | To find that dvs-gpio is valid or not, gpio API gpio_is_valid() can be directly used instead of intermediate variable. Removing the extra variable and using the gpio_is_valid(). Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: max8973: make default/unset dvs gpio as invalid gpioLaxman Dewangan2015-05-211-1/+1
| | | | | | | | | If platform data has dvs-gpio value 0 as default/unset then make this as invalid gpio so that function gpio_is_valid() can return false on this case. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: max8973: set startup time for rail based on BIAS controlLaxman Dewangan2015-04-271-1/+5
| | | | | | | | | | | | In MAX8973, BIAS enable control bit is used for changing the startup time for voltage output. The startup delay is 240us (typ) when the BIASEN bit is set to 0. The startup delay is reduced to 20us (typ) when the BIASEN bit is set to 1. Pass the enable_time through regulator descriptor based on this flag. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: of: Add regulator desc param to of_get_regulator_init_data()Javier Martinez Canillas2014-11-261-1/+2
| | | | | | | | | | | | | | | | The of_get_regulator_init_data() function is used to extract the regulator init_data but information on how to extract certain data is defined in the static regulator descriptor (e.g: how to map the hardware operating modes). Add a const struct regulator_desc * parameter to the function signature so the parsing logic could use the information in the struct regulator_desc. of_get_regulator_init_data() relies on of_get_regulation_constraints() to actually extract the init_data so it has to pass the struct regulator_desc but that is modified on a later patch. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: max8973: Remove unused field from 'struct max8973_chip'Krzysztof Kozlowski2014-03-101-2/+0
| | | | | | | | The 'struct regulator_dev *rdev' of 'struct max8973_chip' isn't used anywhere in the driver so it can be removed safely. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: max8973: Remove redundant error messageSachin Kamat2014-02-191-3/+1
| | | | | | | kzalloc prints its own OOM message upon failure. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: max8973-regulator: Use devm_regulator_registerSachin Kamat2013-09-171-10/+1
| | | | | | | devm_* simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: use dev_get_platdata()Jingoo Han2013-07-301-1/+1
| | | | | | | | 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>
* regulator: max8973: initial DT supportGuennadi Liakhovetski2013-06-241-12/+25
| | | | | | | | | | | | | This patch adds primitive DT support to the max8973 regulator driver. None of the configuration parameters, supported in the platform data are yet available in DT, therefore no configuration is performed if booting with no platform data. This means, that DT instantiation can only be used on boards, where no run-time configuration of the chip is required. In such cases the driver can be used to scale its output voltage. In the future support for configuration parameters should be added. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulators: max8973: fix multiple instance supportGuennadi Liakhovetski2013-06-211-5/+7
| | | | | | | | | | | Currently the max8973 regulator driver uses a single static struct of regulator operations for all chip instances, but can overwrite some of its members depending on configuration. This will affect all other MAX8973 instances on the system. This patch fixes this bug by allocating a separate copy of the struct for each chip instance. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: max8973: Don't override control1 variable when set ramp delay bitsAxel Lin2013-04-241-5/+5
| | | | | | | | | Current code overrides control1 variable when setting ramp delay bits. Fix it by just setting ramp_delay bits. 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>
* Drivers: regulator: remove __dev* attributes.Greg Kroah-Hartman2013-01-031-6/+6
| | | | | | | | | | | | | | | | 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>
* regulator: max8973: provide enable/disable if external control disabledLaxman Dewangan2012-11-231-1/+1
| | | | | | | | If external control is enabled then do not provide regulator enable/disable apis. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8973: Fix callback setting for max8973_dcdc_ops.enableAxel Lin2012-11-221-1/+1
| | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8973: add regulator driver supportLaxman Dewangan2012-11-191-0/+505
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 <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>