summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/da9052-regulator.c
Commit message (Collapse)AuthorAgeFilesLines
* regulator: da9053/52: Fix incorrectly stated minimum and maximum voltage limitsSteve Twiss2016-07-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix alters the minimum and maximum BUCK voltage limits for DA9052 and DA9053. It does so for the following cases: DA9052 - BUCK3 (MEM) min: 0.925V -> 0.950V max: 2.500V -> 2.525V DA9053 - BUCK3 (MEM) min: 0.925V -> 0.950V max: 2.500V -> 2.525V - BUCK4 (PERI) min: 0.925V -> 0.950V max: 2.500V -> 2.525V The voltage range remains the same, but the limits are shifted by +0.025V. This change is provided on DA9052:MEM, DA9053:MEM and DA9053:PERI and is a voltage difference of 0.025V, compared to those measured before this fix is applied. The patch has the effect of decreasing *all* measured voltages on those BUCKs when compared against the previously measured values for the same software voltage request. For example, with this fix applied for DA9052:MEM, DA9053:MEM and DA9053:PERI, the following is true. Because the previous software defined slot 0 as being 0.925V, if a request for 0.950V was previously sent, the slot 1 voltage would have been used. This would have corresponded to an actual measured voltage of 0.975V. But, with this patch fix, and with slot 0 properly aligned to 0.950V, if a voltage of 0.950V is requested by software, a measured value of 0.950V will be provided. Tested-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: da9*: constify regulator_ops structuresJulia Lawall2015-12-221-2/+2
| | | | | | | | | The regulator_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: da9053: Update regulator for DA9053 BC silicon supportSteve Twiss2015-10-161-0/+1
| | | | | | | | Provide an additional case entry for DA9053_BC in the find_regulator_info() function in order to support BC type silicon for the DA9053 device. Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* mfd: da9052: Fix broken regulator probeJohan Hovold2015-05-271-2/+3
| | | | | | | | | | | | | | | | | | Fix broken probe of da9052 regulators, which since commit b3f6c73db732 ("mfd: da9052-core: Fix platform-device id collision") use a non-deterministic platform-device id to retrieve static regulator information. Fortunately, adequate error handling was in place so probe would simply fail with an error message. Update the mfd-cell ids to be zero-based and use those to identify the cells when probing the regulator devices. Fixes: b3f6c73db732 ("mfd: da9052-core: Fix platform-device id collision") Cc: stable <stable@vger.kernel.org> # v3.19 Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds2014-12-141-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
| * regulator: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0
| | | | | | | | | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* | 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: remove unnecessary of_node_get() to parentGuodong Xu2014-09-101-2/+2
| | | | | | | | | | | | | | | These of_node_get() were added to balance refcount decrements inside of of_find_node_by_name(). See: commit c92f5dd2c42f ("regulator: Add missing of_node_put()") However of_find_node_by_name() was then replaced by of_get_child_by_name(), which doesn't call of_node_put() against its input parameter. So, need to remove these unnecessary of_node_get() calls. Signed-off-by: Guodong Xu <guodong.xu@linaro.org> Reviewed-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: da9052: Add ramp speed information for the DVC regulatorsPhilipp Zabel2014-02-191-0/+27
| | | | | | | | Some LDOs and DCDCs have a fixed ramp speed of 6.25 mV/µs. This patch adds the set_voltage_time_sel function to let consumers know about this. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: da9052: Use of_get_child_by_nameSachin Kamat2014-02-141-1/+1
| | | | | | | | of_find_node_by_name walks the allnodes list, and can thus walk outside of the parent node. Use of_get_child_by_name instead. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'regulator/topic/da9052' into regulator-nextMark Brown2013-10-241-6/+35
|\
| * regulator: da9052: Revert se apply_[reg|bit] with regmap based voltage_sel ↵Axel Lin2013-10-241-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | operations This reverts commit 68f7506017ba67f1334cf086ffab76606f2c5ac4. Michael reported that with this patch we loose the fix_io code path from da9052_reg_update. Thus revert it. Reported-by: Michael Grzeschik <mgr@pengutronix.de> Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | regulator: da9052: Convert to devm_regulator_registerAxel Lin2013-09-171-11/+3
|/ | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> 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>
* Merge remote-tracking branch 'regulator/topic/of' into regulator-nextMark Brown2013-02-191-2/+3
|\
| * regulator: Add missing of_node_put()Axel Lin2013-01-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | regulator: da9052: Use apply_[reg|bit] with regmap based voltage_sel operationsAxel Lin2012-12-241-35/+6
|/ | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge remote-tracking branch 'regulator/topic/hotplug' into regulator-nextMark Brown2012-12-101-3/+3
|\
| * regulator: remove use of __devexitBill Pemberton2012-11-201-1/+1
| | | | | | | | | | | | | | | | 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>
| * regulator: remove use of __devinitBill Pemberton2012-11-201-1/+1
| | | | | | | | | | | | | | | | 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>
| * regulator: remove use of __devexit_pBill Pemberton2012-11-201-1/+1
| | | | | | | | | | | | | | | | 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>
* | regulator: da9052: Ensure setting current limit within specific rangeAxel Lin2012-11-271-5/+5
|/ | | | | | | | Checking da9052_current_limits[row][i] <= max_uA is not enough, it is possible da9052_current_limits[row][i] may less than the requested min_uA. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: da9052: set_current_limit should select the maximum current in ↵Axel Lin2012-08-281-2/+2
| | | | | | | specific range Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: da9052: initialize of_node param for regulator registerAxel Lin2012-07-121-0/+1
| | | | | | | | Initialize config.of_node for regulator before registering. This is needed for DT based regulator support. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: da9052: Use for_each_child_of_node() macroAxel Lin2012-07-091-2/+1
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: da9052: Convert to set_voltage_sel and map_voltageAxel Lin2012-05-161-13/+24
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge remote-tracking branch 'regulator/topic/drivers' into regulator-nextMark Brown2012-05-121-1/+2
|\ | | | | | | | | Conflicts: drivers/regulator/88pm8607.c (simple overlap with a bugfix in v3.4)
| * regulator: da9052: fix bug in device tree iteration loopYing-Chun Liu (PaulLiu)2012-05-071-1/+1
| | | | | | | | | | | | | | | | The driver of da9052 is buggy due to the iteration loop of device tree. This patch fix the loop condition to make the driver work with device tree. Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * regulator: da9052: Directly include of.hMark Brown2012-04-161-0/+1
| | | | | | | | | | Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: da9052: Use regulator_get_voltage_sel_regmap()Axel Lin2012-05-041-24/+8
| | | | | | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: da9052: Use generic regmap enable/disable operationsAxel Lin2012-04-231-45/+11
|/ | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: da9052: add device tree supportYing-Chun Liu (PaulLiu)2012-04-131-1/+28
| | | | | | | | | | | | This patch adds device tree support for dialog regulators Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Liam Girdwood <lrg@ti.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Ashish Jangam <ashish.jangam@kpitcummins.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: core: Use a struct to pass in regulator runtime configurationMark Brown2012-04-091-3/+7
| | | | | | | | | | | | | | 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>
* regulator: da9052: Remove unneeded devm_kfree callsAxel Lin2012-04-051-10/+2
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Refactor to use one da9052_ldo_ops/da9052_dcdc_ops for all LDOs/DCDCsAxel Lin2012-04-011-186/+44
| | | | | | | | | | | | | | | | | | In current implementation, da9052_ldo_ops and da9052_ldo5_6_ops are very similar, only the set_voltage is slightly different. da9052_buckperi_ops and da9052_dcdc_ops are also similar. This patch adds da9052_regulator_set_voltage for the set_voltage callback used by all LDOs and DCDCs. Rework da9052_get_regulator_voltage_sel and da9052_set_dcdc_voltage to make it possible to be shared by all DCDCs. Rework da9052_list_voltage to make it to be shared by all DCDCs and LDOs. Then we can remove da9052_ldo5_6_ops and da9052_buckperi_ops. We can also remove DA9052_LDO5_6 and DA9052_BUCKPERI macros which is not used now. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Fix da9052 ldo regulator namesAxel Lin2012-04-011-40/+52
| | | | | | | | The regulator name for LDOs are LDO4 ... LDO13 in current implementation. The correct regulator name for LDOs should be LDO1 ... LDO10. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: da9052: Ensure the selected voltage falls within the specified rangeAxel Lin2012-03-111-4/+4
| | | | | | | | Integer division may truncate the result, use DIV_ROUND_UP to ensure the selected voltage falls within the specified range. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Set n_voltages for da9052 regulatorsAxel Lin2012-03-111-0/+4
| | | | | | | The n_voltages setting for all LDOs and DCDCs are missing in current code. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Fix mask parameter in da9052_reg_update callsAxel Lin2012-03-051-4/+4
| | | | | | | | If the mask parameter is 0, info->activate_bit bit won't be set by calling da9052_reg_update. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: da9052: Staticize non-exported symbolsAxel Lin2011-12-201-2/+2
| | | | | | | | da9052_regulator_info and da9053_regulator_info are not used outside this driver so no need to make the symbol global. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Replace kzalloc with devm_kzalloc and if-else with a switch-case ↵Ashish Jangam2011-12-171-5/+11
| | | | | | | | | for da9052-regulator Reported-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: David Dajun Chen <dchen@diasemi.com> Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Update da9052-regulator for DT changesMark Brown2011-12-151-1/+1
| | | | | Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: DA9052/53 Regulator supportAshish Jangam2011-12-151-0/+600
The Dialog PMIC has below featured regulators:- DA9052-BC - 4 DVS Buck converters 0.5V - 3.6V upto 1Amp. DA9053-AA/BX - 4 DVS Buck converters 0.5V - 2.5V upto 3Amp. DA9052/53 - 10 Programmable LDO's High PSSR, 1% accuracy. This patch support all the DA9052 and Da9053 regulators. The output voltages are fully programmable via I2C or SPI interface. The platform data with regulation constraints is passed down from the board to the regulator. Signed-off-by: David Dajun Chen <dchen@diasemi.com> Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com> Tested-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
OpenPOWER on IntegriCloud