summaryrefslogtreecommitdiff
path: root/drivers/regulator/tps65910-regulator.c
AgeCommit message (Collapse)Author
2012-06-04mfd: 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> (Cherry-pick from mainline 3f7e82759c692df473675ed06fb90b20f1f225c3) Change-Id: Ida79b196acf65ed14ff9fd2cc1f7c0048f99ba2b Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/105922 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rhyland Klein <rklein@nvidia.com> GVS: Gerrit_Virtual_Submit
2012-03-18regulator: 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> (cherry picked from commit 18039e0f16d50c8243fe0388a587c25a3b155ece) Change-Id: Ibd67d2661dd1d5b014754c221d44963baeb13726 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/90518 Reviewed-by: Automatic_Commit_Validation_User
2012-03-18regulator: 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> (cherry picked from commit 0651eed5e094a079a0a9fccd80a41cb3e7f2aa99) Change-Id: Ibdb05171cfb4c4e7a064c8f65193647997e8e9a8 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/90517 Reviewed-by: Automatic_Commit_Validation_User
2012-03-18regulator: 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> (cherry picked from commit 585993932ccc44ab6a8c6dc590a2f3d6b2facb41) Change-Id: I1cb46d05396a286ba34c84b1836b9070f0f78003 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/90516 Reviewed-by: Automatic_Commit_Validation_User
2012-03-18regulator: 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> Cherry-picked from mainline 94732b97c39859427cf99c34fc9de9750be7e5a5 Change-Id: Ie3eb5462a99cceab40ba0e26e4e3cdb93c5f3f0f Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/90515 Reviewed-by: Automatic_Commit_Validation_User
2012-03-12regulator: 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> cherry picked from mainline commit 87ae88a17396fe3f91c34ab44f460e5680eb6f61 Change-Id: I05645082ad5268a4553891db6b35af33650b7a95 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/89125
2012-03-09regulator: 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> cherry picked from mainline commit c4632aed3e5b134c55b54af19db49662959384c1 Change-Id: Ifc514a87803191cf796ffc0d75d979476e712dde Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/88830
2012-02-22regulator: 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> cherry picked from mainline commit 02c38f3e8e9b0cd76bdb835b0fd8d627ddf5e19b Change-Id: Iee8eaf208ae2d448f4c022b2c3908f8519191180 Reviewed-on: http://git-master/r/85124 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
2012-02-22regulator: 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> cherry picked from mainline commit 83e0323211e33b117ce585bab64636ca1fff807a Change-Id: Ica9d50dd62ccab15a02c8769e8b1279fb32d4a03 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/85122
2012-02-13regulator: 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> cherry picked from mainline 1e0c66f49762fa1866ab20b1feb6e86a9aa4838f Change-Id: Ie8256fae45c21f08b2d101efebca004cb32963a0 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/79181 Reviewed-by: Automatic_Commit_Validation_User
2012-01-30regulator: 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> Cherry picked from commit 7d38a3cb9b9f6a6d31b1d19e4f07a7c0b71407d5 Change-Id: I8ef3a7544bf432a3c6efb98d99cb660b6fefde38 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/77539 Reviewed-by: Automatic_Commit_Validation_User
2012-01-30regulator: 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> Cherry picked from mainline's commit 51ced5e288b4381705df173fb05f561dea35bfac Change-Id: I85ec3261125291f9862f9746ef7ec97e09fa375b Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/77538 Reviewed-by: Automatic_Commit_Validation_User
2012-01-30regulator: 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> Cherry picked from mainline's commit c2f8efd7641b1b10b73ffa6f216a45209a5705dd Change-Id: I7e544ea2f0b3df677ad75bbca38b744c9a6f71da Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/77537 Reviewed-by: Automatic_Commit_Validation_User
2012-01-30regulator: TPS65910: Fix VDD1/2 voltage selector countAfzal Mohammed
Count of selector voltage is required for regulator_set_voltage to work via set_voltage_sel. VDD1/2 currently have it as zero, so regulator_set_voltage won't work for VDD1/2. Update count (n_voltages) for VDD1/2. Output Voltage = (step value * 12.5 mV + 562.5 mV) * gain With above expr, number of voltages that can be selected is step value count * gain count constant for gain count will be called VDD1_2_NUM_VOLT_COARSE existing constant for step value count is VDD1_2_NUM_VOLTS, use VDD1_2_NUM_VOLT_FINE instead to make clear that step value is not the only component in deciding selectable voltage count Signed-off-by: Afzal Mohammed <afzal@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cherry picked from mainline's commit 780dc9ba4eb682a89be48d5b814feae6722a19e0 Change-Id: I1c246a02f1c647fe3c647b3dde2a0633c2783764 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/77536 Reviewed-by: Automatic_Commit_Validation_User
2012-01-30regulator: TPS65910: Create an array for init dataKyle Manna
Create an array of fixed size for the platform to pass regulator initalization data through. Passing an array of pointers to init data also allows more flexible definition of init data as well as prevents reading past the end of the array should the platform define an incorrectly sized array. Signed-off-by: Kyle Manna <kyle.manna@fuel7.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> cherry picked from mainline's commit c1fc1480249dfe059254779a4bb7ca27cf5f8038 Change-Id: Ia298bbd2828e644d24e10ab67ff76f1169cf7f51 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/77535 Reviewed-by: Automatic_Commit_Validation_User
2012-01-30regulator: TPS65910: Move regulator defs to headerKyle Manna
Move the regulator defintions to the header so that platform board file can use them to configure specific regulators. Signed-off-by: Kyle Manna <kyle.manna@fuel7.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cherry picked from mainline's commit: 72c108cc4947db2fcdd3f3e8a2b60bd65e74a1cc Change-Id: I7659c33cab6f20c91dc4bf36e1c157e1878993ab Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/77534 Reviewed-by: Automatic_Commit_Validation_User
2011-07-22regulator: tps65910: Fix array access out of bounds bugAxel Lin
For tps65910, the number of regulator is 13. ( ARRAY_SIZE(tps65910_regs) is 13) For tps65911, the number of regulator is 12. ( ARRAY_SIZE(tps65911_regs) is 12) If we are using this driver for tps65911, we hit array access out of bounds bug in tps65910_probe() because current implementation always assume the number of regulator is 13 and thus it will access tps65911_regs[12]. Fix it by setting correct num_regulators for both chips in tps65910_probe(), and allocated neccessay memory accordingly. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-07-22regulator: tps65910: Add missing breaks in switch/caseAxel Lin
Also add a default case in tps65910_list_voltage_dcdc to silence 'volt' may be used uninitialized in this function warning. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-07-22regulator: tps65910: Fix a memory leak in tps65910_probe error pathAxel Lin
Fix a memory leak if chip id is not matched. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: tps65911: Add new chip versionJorge Eduardo Candelaria
The tps65911 chip introduces new features, including changes in the regulator module. - VDD1 and VDD2 remain unchanged. - VDD3 is now named VDDCTRL and has a wider voltage range. - LDOs are now named LDO1...8 and voltage ranges are sequential, making LDOs easier to handle. Signed-off-by: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: Fix desc_id for tps65023/6507x/65910Axel Lin
The desc_id variable should not be a static variable. The rest of the code assumes the desc_id must less than TPSxxxxx_NUM_REGULATOR. If we set desc_id to be a static variable, checking the return value of rdev_get_id() may return error. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Anuj Aggarwal <anuj.aggarwal@ti.com> Cc: Graeme Gregory <gg@slimlogic.co.uk> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27TPS65910: Add tps65910 regulator driverGraeme Gregory
The regulator module consists of 3 DCDCs and 8 LDOs. The output voltages are configurable and are meant to supply power to the main processor and other components Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>