aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/mc13783-regulator.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-10-20regulator: drop owner assignment from platform_driversWolfram Sang1-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>
2013-10-24Merge remote-tracking branch 'regulator/topic/mc13783' into regulator-nextMark Brown1-14/+14
2013-10-15regulator: mc13783: Fix checkpatch issueJingoo Han1-14/+14
Fix the following checkpatch warnings. WARNING: Avoid unnecessary line continuations Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-17regulator: mc13783: Use devm_regulator_registerSachin Kamat1-21/+4
devm_* simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-05-12regulator: Remove all platform_set_drvdata(pdev, NULL) in driversAxel Lin1-2/+0
Since 0998d06310 "device-core: Ensure drvdata = NULL when no driver is bound", this is done by driver core after device_release or on probe failure. Thus we can remove all platform_set_drvdata(pdev, NULL) in drivers. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-28regulator: mc13783: Add device tree probe supportAlexander Shiyan1-15/+29
Patch adds device tree probe support for mc13783-regulator driver. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
2012-11-20regulator: remove use of __devexitBill Pemberton1-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>
2012-11-20regulator: remove use of __devinitBill Pemberton1-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>
2012-11-20regulator: remove use of __devexit_pBill Pemberton1-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>
2012-08-28regulator: mc13783: add regulators sw1x and sw2xGaëtan Carlier1-0/+66
Signed-off-by: Gaëtan Carlier <gcembed@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: mc13xxx: Remove get_voltage implementation for single voltage regulatorsAxel Lin1-1/+0
This is not required after commit f7df20ec "regulator: core: Use list_voltage() to read single voltage regulators" Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: mc13783: Make mc13783_powermisc_rmw() lock protectedAxel Lin1-14/+8
Then we can remove lock/unlock around the caller. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17regulator: mc13xxx: Convert to regulator_list_voltage_tableAxel Lin1-19/+19
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-10regulator: Fix build error for mc13783 and mc13892Axel Lin1-3/+9
Convert mc13783 and mc13892 to use a struct to pass in regulator runtime configuration. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: mc13783: bail out without platform dataSascha Hauer1-0/+3
the platform data pointer is used without checking it. Bail out in the driver instead of crashing the kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-29regulator: mc13783: Convert to devm_kzalloc()Fabio Estevam1-4/+1
Convert mc13783-regulator driver to use devm_kzalloc(). Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-23regulator: pass additional of_node to regulator_register()Rajendra Nayak1-1/+1
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>
2011-11-06Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linuxLinus Torvalds1-0/+1
* 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
2011-10-31regulator: Add module.h to drivers/regulator users as requiredPaul Gortmaker1-0/+1
Another group of drivers that are taking advantage of the implicit presence of module.h -- and will break when we pull the carpet out from under them during a cleanup. Fix 'em now. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-24regulator: Finish mc13783 conversion to the mc13xxx APISamuel Ortiz1-3/+3
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26mfd: Use mfd cell platform_data for mc13xxx cells platform bitsSamuel Ortiz1-3/+4
With the addition of a platform device mfd_cell pointer, MFD drivers can go back to passing platform data back to their sub drivers. This allows for an mfd_cell->mfd_data removal and thus keep the sub drivers MFD agnostic. This is mostly needed for non MFD aware sub drivers. Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-10regulator: change debug statement be consistent with the style of the restWanlong Gao1-1/+1
change the "mc13783_regulator_probe" string in the function "mc13783_regulator_probe" to "__func__" for the debug statement be consistent with the style of the rest of the file. Signed-off-by: Wanlong Gao <wanlong.gao@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-23mfd: mfd_cell is now implicitly available to mc13xxx driversAndres Salomon1-4/+3
The cell's platform_data is now accessed with a helper function; change clients to use that, and remove the now-unused data_size. Note that mfd-core no longer makes a copy of platform_data, but the mc13xxx-core driver creates the pdata structures on the stack. In order to get around that, the various ARM mach types that set the pdata have been changed to hold the variable in static (global) memory. Also note that __initdata references in aforementioned pdata structs have been dropped. Signed-off-by: Andres Salomon <dilinger@queued.net> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-01-12make mc13783 regulator code genericYong Shen1-282/+43
move some common functions and micros of mc13783 regulaor driver to a seperate file, which makes it possible for mc13892 to share code. Signed-off-by: Yong Shen <yong.shen@linaro.org> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-12Change the register name definitions for mc13783Yong Shen1-15/+15
To make mc13783 and mc13892 share code, the register names should be changed to fit the new macro definitions in the comming patch. Signed-off-by: Yong Shen <yong.shen@linaro.org> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-12regulator: Remove duplicate consts from mc13873 driver voltage tablesMark Brown1-18/+18
They're not needed and sparse is verbosely upset about them. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-12regulator: Report actual configured voltage to set_voltage()Mark Brown1-2/+8
Change the interface used by set_voltage() to report the selected value to the regulator core in terms of a selector used by list_voltage(). This allows the regulator core to know the voltage that was chosen without having to do an explict get_voltage(), which would be much more expensive as it will generally access hardware. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-30regulator: Staticise mc13783_powermisc_rmw()Mark Brown1-2/+2
It is not used outside this driver so no need to make the symbol global. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Alberto Panizzo <maramaopercheseimorto@gmail.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-25mc13783-regulator: fix vaild voltage range checking for mc13783_fixed_regulator_set_voltageAxel Lin1-3/+3
In the case of "min_uV == max_uV == mc13783_regulators[id].voltages[0]", mc13783_fixed_regulator_set_voltage should return 0 instead of -EINVAL. This patch also adds a missing ">" character for MODULE_AUTHOR, a trivial fix. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-19mc13783-regulator: fix a memory leak in mc13783_regulator_removeAxel Lin1-0/+3
This patch fixes a memory leak by freeing priv in mc13783_regulator_remove Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.hTejun Heo1-0/+1
percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-03regulator: mc13783: consider Power Gates as digital regulators.Alberto Panizzo1-6/+126
GPO regulators are digital outputs that can be enabled or disabled by a dedicated bit in mc13783 POWERMISC register. In this family can be count in also Power Gates (PWGT1 and 2): enabled by a dedicated pin a Power Gate is an hardware driven supply where the output (PWGTnDRV) follow this law: Bit PWGTxSPIEN | Pin PWGTxEN | PWGTxDRV | Read Back 0 = default | | | PWGTxSPIEN ---------------+-------------+----------+------------ 1 | x | Low | 0 0 | 0 | High | 1 0 | 1 | Low | 0 As read back value of control bit reflects the PWGTxDRV state (not the control value previously written) and mc13783 POWERMISC register contain only regulator related bits, a dedicated function to manage these bits is created here with the aim of tracing the real value of PWGTxSPIEN bits and reproduce it on next writes. All POWERMISC users _must_ use the new function to not accidentally disable Power Gates supplies. v2 changes: -Better utilization of abstraction layers. -Voltage query support. GPO's and PWGTxDRV are fixed voltage regulator with voltage value of 3.1V and 5.5V respectively. Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-03regulator: add voltage selection capability to mc13783 regulators v2 .Alberto Panizzo1-30/+315
This patch, complete the mc13783 regulator subsystem driver with voltage selecting capability. Main Switches (SW1AB, SW2AB) are not supported yet. version 2 diffs: - delete the "Switchers PLL" enable and multiplication factor value selecting capability because it is not a voltage or current regulator. This will be a part of Main switcher supporting task. - Correct many coding style problems pointed me out. Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-12-17regulator: mc13783-regulator: correct the probing time.Alberto Panizzo1-2/+2
When the mc13783-regulator driver is built in kernel, probing it during the regulator subsystem initialisation result in a fault. That is because regulator subsystem is planned to be initialised very early in the boot process, before the mfd subsystem initialisation. The mc12783-regulator probing process need to access to the mc13783-core functionality to read/write mc13783 registers and so must be called after the mc13783-core driver initialisation. The way to do this is to let the kernel probe the mc13783-regulator driver when mc13783-core register his regulator subdevice. Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-12-17regulator/mc13783: various cleanupsUwe Kleine-König1-277/+112
- define needed registers and bits in the driver - properly namespace functions and structs - fix locking as required by patch "mfd/mc13783: near complete rewrite" - use platform_data as provided by "mfd/mc13783: near complete rewrite" instead of accessing struct mc13783 - struct mc13783_regulator_priv.desc is (and was) unused and so can go away - use cpp magic to initialize mc13783_regulators - bring MODULE_LICENSE in sync with actual copyright - minor style fixes This allows not including mc13783-private.h which I intend to remove soon. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Mark Brown <broonie@opensoruce.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-12-17regulator/mc13783: rename source file to match other driversUwe Kleine-König1-0/+410
One annoying thing about the old name was that the module was just called mc13783 which caused wrong expectations (at least for me). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Mark Brown <broonie@opensoruce.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>