aboutsummaryrefslogtreecommitdiff
path: root/drivers/regulator/tps65910-regulator.c
AgeCommit message (Collapse)Author
2013-04-23regulator: tps65910: Convert to use regulator_map_voltage_ascendAxel Lin
All regulators have ascendant voltage list in this driver. Some regulators have more than 200 supported voltages. e.g. For TPS65910_REG_VDD1 and TPS65910_REG_VDD2: n_voltages = VDD1_2_NUM_VOLT_FINE * VDD1_2_NUM_VOLT_COARSE = 73 * 3 = 219 Thus it worth converting to regulator_map_voltage_ascend rather than use default regulator_map_voltage_iterate. For consistent, convert all regulators to regulator_map_voltage_ascend. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-30regulator: Add missing of_node_put()Axel Lin
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>
2013-01-24regulator: tps65910: Fix using wrong dev argument for calling of_regulator_matchAxel Lin
The dev parameter is the device requesting the data. In this case it should be &pdev->dev rather than pdev->dev.parent. The dev parameter is used to call devm_kzalloc in of_get_regulator_init_data(), which means this fixes a memory leak because the memory is allocated every time probe() is called, thus it should be freed when this driver is unloaded. 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>
2012-12-10Merge remote-tracking branch 'regulator/topic/tps65910' into regulator-nextMark Brown
2012-11-20regulator: remove use of __devexitBill Pemberton
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>
2012-11-20regulator: remove use of __devinitBill Pemberton
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>
2012-11-20regulator: remove use of __devexit_pBill Pemberton
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>
2012-10-17regulator: tps65910: fix BUG_ON() shown with vrtc regulatorAnilKumar Ch
Fix BUG_ON() error if tps65910 VRTC regulator is used with out rdev->desc->volt_table data. Recent changes in regulator core driver which add support for "regulator_list_voltage_table" have BUG_ON() if regulator descriptor do not voltage table information. This patch adds the voltage table information to fix the issue. Signed-off-by: AnilKumar Ch <anilkumar@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-17regulator: tps65910: set input_supply on desc unconditionallyLaxman Dewangan
Set the supply_name in the regulator descriptor unconditionally and make this parameter as required parameter in the device node for successfully registration of the regulator. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-12regulator: tps65910: Remvoe ↵Axel Lin
tps65910_reg_[read|modify_bits|read_locked|write_locked] functions The tps65910 mfd driver has been converted to regmap APIs. This patch adds tps65910_reg_update_bits() in include/linux/mfd/tps65910.h. Thus we can use tps65910_reg_read/tps65910_reg_write/tps65910_reg_update_bits directly and remove tps65910_reg_[read|modify_bits|read_locked|write_locked] functions. With this change, we can also remove the mutex in struct tps65910_reg. Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-10regulator: tps65910: correct init value of n_voltagesLaxman Dewangan
Recent change in the core driver to get the maximum voltage is based on the (n_voltages -1) steps of voltage. For the tps65910, the (n_voltages -1)th step voltage is calculated based on the callback function list_voltage. This function direct maps the datasheet and adjust the first few steps for initial voltage as per datasheet, and hence initialize the n_voltages based on datasheet. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-06regulator: tps65910: add support for input supplyLaxman Dewangan
There is multiple voltage input pins on device which takes the voltage input for different voltage regulator. Support to configure the voltage input supplied by different regulator for each regulators. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-04regulator: tps65910: Set enable enable_time in regulator_descAxel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-22regulator: tps65910: Convert to regulator_list_voltage_tableAxel Lin
Convert tps65910_ops and tps65910_ops_vdd3 to regulator_list_voltage_table. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-22regulator: tps65910: Remove unused min_uV and max_uV from struct tps_infoAxel Lin
The min_uV and max_uV fields of struct tps_info are not used in the code. For the case voltage_table is provided, the min_uV and max_uV are the same values as volt_table[0] and volt_table[n_voltages -1]. For the case voltage_table is not available, having the min_uV and max_uV seems misleading. Current code uses equations to get the voltage value in this case, but these equations do not use the min_uV and max_uV fields of struct tps_info. Thus this patch removes the min_uV and max_uV fields from struct tps_info. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-21regulator: tps65910: Convert to regulator_set_voltage_time_sel()Axel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-18regulator: tps65910: Don't use 0 as NULLMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-29Merge tag 'mfd-3.5-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 Pull MFD changes from Samuel Ortiz: "Besides the usual cleanups, this one brings: * Support for 5 new chipsets: Intel's ICH LPC and SCH Centerton, ST-E's STAX211, Samsung's MAX77693 and TI's LM3533. * Device tree support for the twl6040, tps65910, da9502 and ab8500 drivers. * Fairly big tps56910, ab8500 and db8500 updates. * i2c support for mc13xxx. * Our regular update for the wm8xxx driver from Mark." Fix up various conflicts with other trees, largely due to ab5500 removal etc. * tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (106 commits) mfd: Fix build break of max77693 by adding REGMAP_I2C option mfd: Fix twl6040 build failure mfd: Fix max77693 build failure mfd: ab8500-core should depend on MFD_DB8500_PRCMU gpio: tps65910: dt: process gpio specific device node info mfd: Remove the parsing of dt info for tps65910 gpio mfd: Save device node parsed platform data for tps65910 sub devices mfd: Add r_select to lm3533 platform data gpio: Add Intel Centerton support to gpio-sch mfd: Emulate active low IRQs as well as active high IRQs for wm831x mfd: Mark two lm3533 zone registers as volatile mfd: Fix return type of lm533 attribute is_visible mfd: Enable Device Tree support in the ab8500-pwm driver mfd: Enable Device Tree support in the ab8500-sysctrl driver mfd: Add support for Device Tree to twl6040 mfd: Register the twl6040 child for the ASoC codec unconditionally mfd: Allocate twl6040 IRQ numbers dynamically mfd: twl6040 code cleanup in interrupt initialization part mfd: Enable ab8500-gpadc driver for Device Tree mfd: Prevent unassigned pointer from being used in ab8500-gpadc driver ...
2012-05-22Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial updates from Jiri Kosina: "As usual, it's mostly typo fixes, redundant code elimination and some documentation updates." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits) edac, mips: don't change code that has been removed in edac/mips tree xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer lib: Change mail address of Oskar Schirmer net: Change mail address of Oskar Schirmer arm/m68k: Change mail address of Sebastian Hess i2c: Change mail address of Oskar Schirmer net: Fix tcp_build_and_update_options comment in struct tcp_sock atomic64_32.h: fix parameter naming mismatch Kconfig: replace "--- help ---" with "---help---" c2port: fix bogus Kconfig "default no" edac: Fix spelling errors. qla1280: Remove redundant NULL check before release_firmware() call remoteproc: remove redundant NULL check before release_firmware() qla2xxx: Remove redundant NULL check before release_firmware() call. aic94xx: Get rid of redundant NULL check before release_firmware() call tehuti: delete redundant NULL check before release_firmware() qlogic: get rid of a redundant test for NULL before call to release_firmware() bna: remove redundant NULL test before release_firmware() tg3: remove redundant NULL test before release_firmware() call typhoon: get rid of redundant conditional before all to release_firmware() ...
2012-05-20regulator: tps65910: use of_node of matched regulator being registerLaxman Dewangan
After getting matched regulators by using of_regulator_match(), initialize the config.of_node of regulator being register with of_regulator_match.of_node of that regulator. This is require for supporting regulator consumers in dt. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-20regulator: tps65910: dt: support when "regulators" node foundLaxman Dewangan
The device tree binding for the tps65910 is described as: tps65911 { reg = <0x2d> ::::::::: regulators { compatible = "ti,tps65911"; ldo1_reg: ldo1 { /** regulator entry */ }; ldo2_reg: ldo2 { /** regulator entry */ }; :::::::::: }; }; Support the regulators functionality only when there is "regulators" child node available for tps65910. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-20regulator: tps65910: add error message in case of failureLaxman Dewangan
Prints error message whenever there is failure on resource allocation. Also used dev_* to print messages instead of pr_* Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-20mfd: Commonize tps65910 regmap access through headerRhyland Klein
This change removes the read/write callback functions in favor of common regmap accessors inside the header file. This change also makes use of regmap_read/write for single register access which maps better onto what this driver actually needs. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-19regulator: tps65910: use devm_* for memory allocationLaxman Dewangan
use the devm_* apis for memory allocation. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-19regulator: tps65910: use small letter for regulator namesLaxman Dewangan
Use the small-letter for names of different regulator to match the names with dt binding documents. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-12regulator: tps65910 regulator: add device tree supportRhyland Klein
Add devicetree based initialization support for TI tps65910 regulators. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-12Merge remote-tracking branch 'regulator/topic/drivers' into regulator-nextMark Brown
Conflicts: drivers/regulator/88pm8607.c (simple overlap with a bugfix in v3.4)
2012-05-09regulator: tps65910: Convert to get_voltage_selAxel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-23regulator: Remove unneeded include of linux/delay.h from regulator driversAxel Lin
All the drivers that need delay for the regulator voltage output voltage to stabilize after being enabled or after being set to a new value has been converted to implement enable_time and set_voltage_time_sel callbacks. Then regulator core will take care of the necessary delay. For the drivers that don't need the delay, don't need to include linux/delay.h. This patch removes the unneeded include of linux/delay.h in regulator drivers. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-23regulator: tps65910: Use generic regmap enable/disable operationsAxel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-11regulator: Convert tps65xxx regulator drivers to use devm_kzallocAxel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-09regulator: core: Use a struct to pass in regulator runtime configurationMark Brown
Rather than adding new arguments to regulator_register() every time we want to add a new bit of dynamic information at runtime change the function to take these via a struct. By doing this we avoid needing to do further changes like the recent addition of device tree support which required each regulator driver to be updated to take an additional parameter. The regulator_desc which should (mostly) be static data is still passed separately as most drivers are able to configure this statically at build time. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-08Merge branch 'master' into for-nextJiri Kosina
Merge with latest Linus' tree, as I have incoming patches that fix code that is newer than current HEAD of for-next. Conflicts: drivers/net/ethernet/realtek/r8169.c
2012-04-05Fix typo milivolt => millivoltThomas Weber
Signed-off-by: Thomas Weber <thomas@tweber.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-03-21Merge tag 'regulator-3.4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates for 3.4 from Mark Brown: "This has been a fairly quiet release from a regulator point of view, the only real framework features added were devm support and a convenience helper for setting up fixed voltage regulators. We also added a couple of drivers (but will drop the BQ240022 driver via the arm-soc tree as it's been replaced by the more generic gpio-regulator driver) and Axel Lin continued his relentless and generally awesome stream of fixes and cleanups." * tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (93 commits) regulator: Fix up a confusing dev_warn when DT lookup fails regulator: Convert tps6507x to set_voltage_sel regulator: Refactor tps6507x to use one tps6507x_pmic_ops for all LDOs and DCDCs regulator: Make s5m8767_get_voltage_register always return correct register regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlier regulator: tps65910: Provide settling time for DCDC voltage change regulator: Add Anatop regulator driver regulator: Simplify implementation of tps65912_get_voltage_dcdc regulator: Use tps65912_set_voltage_sel for both DCDCx and LDOx regulator: tps65910: Provide settling time for enabling rails regulator: max8925: Use DIV_ROUND_UP macro regulator: tps65912: Use simple equations to get register address regulator: Fix the logic of tps65910_get_mode regulator: Merge tps65217_pmic_ldo234_ops and tps65217_pmic_dcdc_ops to tps65217_pmic_ops regulator: Use DIV_ROUND_CLOSEST in wm8350_isink_get_current regulator: Use array to store dcdc_range settings for tps65912 regulator: Rename s5m8767_convert_voltage to s5m8767_convert_voltage_to_sel regulator: tps6524x: Remove unneeded comment for N_REGULATORS regulator: Rename set_voltage_sel callback function name to *_sel regulator: Fix s5m8767_set_voltage_time_sel calculation value ...
2012-03-14regulator: tps65910: Provide settling time for DCDC voltage changeLaxman Dewangan
Settling time is require when there is dcdc rail's voltage change. Returning proper delay time for dcdc voltage change to settle down the output voltage to new value. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-13regulator: tps65910: Provide settling time for enabling railsLaxman Dewangan
There is settling time for each rails when it is switched to ON. Implementing enable time for returning proper settling time of regulator rails when it is enabled. Filling the on-time for each rail as per tps65910/tps65911 datasheets. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-13regulator: Fix the logic of tps65910_get_modeAxel Lin
We actually clear LDO_ST_ON_BIT for standby mode in tps65910_set_mode. Fix the logic in tps65910_get_mode. Supply state (EEPROM bits): ST[1:0] = 00 : Off ST[1:0] = 01 : On high power (ACTIVE) ST[1:0] = 10 : Off ST[1:0] = 11 : On low power (SLEEP) Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Rename set_voltage_sel callback function name to *_selAxel Lin
This change improves readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: tps65910: Sleep off rails when ext sleep configuredLaxman Dewangan
Keep the rails OFF in sleep mode only when the rails are controlled by external sleep control. The devices tps65910 and tps65911, both has the sleep input. The tps65911's sleep input is not same as tps65910's EN3 and hence taking care of SLEEP input as separate external sleep control input. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Fix module desciption for tps65910 regulatorAxel Lin
Fix the module desciption and also update Kconfig to include supporting tps65911 chip. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: tps65910: Correct VIO voltage configurationLaxman Dewangan
The VIO regulator register specify the voltage configuration on bit3:2 of its register. And hence only these bits should be modified when setting voltage and used when reading voltage from register setting. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-07regulator: tps65910: Configure correct value for VDDCTRL vout regLaxman Dewangan
As per datasheet, the voltage output is defined as from SEL[6:0] = 3 to 64 (dec) Vout= (SEL[6:0] × 12.5 mV + 562.5 mV) The list_voltage returns the vout as 600mV + selector * 12.5mV and so equivalent VSEL is selector + 3. Adding 3 on selector when configuring VSEL register for VDDCTRL output. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-30regulator: tps65910: Sleep control through external inputsLaxman Dewangan
Add support for sleep controls of different regulator through external inputs EN1, EN2 or EN3. Each regulator's output will be active when its external input is high and turns to OFF/Low power mode when its external input is low. The configuration parameters for sleep control is provided through board specific platform data. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20regulator: tps65910: use appropriate variable names.Laxman Dewangan
Renaming the variables "table" to "voltage_table" and "table_len" to "n_voltages" of regulator information to have more meaningful. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20regulator: tps65910: Initialize n_voltages for rails.Laxman Dewangan
Initializing the number of voltages supported by different rails of pmic device tps65911. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20regulator: tps65910: Add regulator info for RTC railLaxman Dewangan
Adding missing regulator info for VRTC rail for device tps65911. The regulator voltage rail index start from VRTC which is defined as 0. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-23Merge remote-tracking branch 'regulator/topic/dt' into regulator-nextMark Brown
2011-11-23Merge branch 'for-linus' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-next
2011-11-23regulator: pass additional of_node to regulator_register()Rajendra Nayak
With device tree support for regulators, its needed that the regulator_dev->dev device has the right of_node attached. To be able to do this add an additional parameter to the regulator_register() api, wherein the dt-adapted driver can then pass this additional info onto the regulator core. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>