aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/88pm8607.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-03-19regulator: 88pm8607: Convert to regulator core's simplified DT parsing codeAxel Lin1-34/+9
Use regulator core's simplified DT parsing code to simply the driver implementation. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-26regulator: 88pm8607: Remove unused fields from struct pm8607_regulator_infoAxel Lin1-14/+5
The *i2c and *i2c_8606 are no longer used since this driver was converted to use regmap helpers. The *chip and *regulator are not really required. So remove these unused fields. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-26regulator: 88pm8607: Simplify pm8607_list_voltage implementationAxel Lin1-9/+10
Set volt_table filed then we can use regulator_list_voltage_table. Since we have volt_table setting, now we can remove vol_table from struct pm8607_regulator_info. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-06regulator: Use of_node_name_eq for node name comparisonsRob Herring1-1/+1
Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. For instances using of_node_cmp, this has the side effect of now using case sensitive comparisons. This should not matter for any FDT based system which all of these are. Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Support Opensource <support.opensource@diasemi.com> Cc: Sangbeom Kim <sbkim73@samsung.com> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: linux-samsung-soc@vger.kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31regulator: 88pm8607: constify regulator_ops structureBhumika Goyal1-2/+2
Declare regulator_ops structures as const as it is only stored in the ops field of a regulator_desc structure. This field is of type const, so regulator_ops structures having this property can be made const too. File size before: drivers/regulator/88pm8607.o text data bss dec hex filename 3466 5488 0 8954 22fa drivers/regulator/88pm8607.o File size after: drivers/regulator/88pm8607.o text data bss dec hex filename 3978 4976 0 8954 22fa drivers/regulator/88pm8607.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-01regulator: 88pm8607: Constify platform_device_idKrzysztof Kozlowski1-1/+1
The platform_device_id is not modified by the driver and core uses it as const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-14Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-coreLinus Torvalds1-1/+0
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 ...
2014-11-26regulator: of: Add regulator desc param to of_get_regulator_init_data()Javier Martinez Canillas1-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>
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>
2014-09-10regulator: remove unnecessary of_node_get() to parentGuodong Xu1-1/+1
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>
2014-02-27regulator: 88pm8607: fix indent code styleJingoo Han1-3/+3
Fix indent code style in order to fix the following checkpatch issues. ERROR: code indent should use tabs where possible WARNING: please, no space before tabs WARNING: please, no spaces at the start of a line Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-14regulator: 88pm8607: Use of_get_child_by_nameSachin Kamat1-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>
2013-09-17regulator: 88pm8607: Convert to devm_regulator_registerAxel Lin1-10/+2
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-30regulator: use dev_get_platdata()Jingoo Han1-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>
2013-05-12regulator: Remove all platform_set_drvdata(pdev, NULL) in driversAxel Lin1-1/+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-03-05regulator: 88pm8607: Use enable_is_inverted flag with regulator_enable_regmap and friends APIsAxel Lin1-32/+4
Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-02-19Merge remote-tracking branch 'regulator/topic/of' into regulator-nextMark Brown1-1/+2
2013-01-30regulator: Add missing of_node_put()Axel Lin1-1/+2
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>
2012-12-27regulator: 88pm8607: Use apply_[reg|bit] with regmap based voltage_sel operationsAxel Lin1-32/+6
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-27regulator: 88pm8607: Update update_bit for BUCK2 in pm8607_set_voltage_selAxel Lin1-0/+1
BUCK2 has the update_bit setting, but current code does not set update_bit in pm8607_set_voltage_sel. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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-10-02mfd: 88pm860x: Device tree supportHaojian Zhuang1-1/+34
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-19mfd: 88pm860x: Avoid to check resource for preg regulatorHaojian Zhuang1-13/+19
Since PREG regulator is the only one regulator in 88PM8606, and other regulators are in 88PM8607. Checking resource as identifying regulator is not a good way. We can use NULL resource to indentify PREG regulator. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-19regulator: 88pm860x: Add pre-regulator support for 88pm860x regulatorJett.Zhou1-0/+66
Pre-regulator of 88pm8606 is mainly for support charging based on vbus, it needs to be enabled for charging battery, and will be disabled in some exception condition like over-temp. Add the pre-regulator support for 88pm860x regulator driver. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-11mfd: 88pm860x: Use REG resource in regulatorHaojian Zhuang1-3/+2
Since IORESOURCE_IO is changed to IORESOURCE_REG in 88pm860x driver, update self-defined IORESOURCE_IO resource to register offset that is IORESOURCE_REG in regulator driver. And split regulator platform data array into scattered platform data. Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-11mfd: 88pm860x: Convert to IORESOURCE_REGMark Brown1-1/+1
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Tested-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-04regulator: 88pm8607: Use regulator_get_voltage_sel_regmap()Axel Lin1-27/+9
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-23regulator: 88pm8607: Use generic regmap enable/disable operationsAxel Lin1-38/+12
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 Brown1-2/+6
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-01regulator: Convert 88pm8607 to get_voltage_selAxel Lin1-3/+3
Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Jett Zhou <jtzhou@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-01regulator: Convert 88pm8607 to set_voltage_selAxel Lin1-39/+4
Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Jett Zhou <jtzhou@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-01regulator: Add missing n_voltages setting for 88pm8607Axel Lin1-26/+25
Then we can remove the vol_nbits field from struct pm8607_regulator_info. Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Jett Zhou <jtzhou@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-01regulator: Set list_voltage callback for 88pm8607Axel Lin1-0/+1
Current code implements pm8607_list_voltage but does not set the list_voltage callback function in pm8607_regulator_ops. Fix it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Jett Zhou <jtzhou@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-24regulator: fix the ldo configure according to 88pm860x specJett.Zhou1-3/+3
Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
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-08-08regulator: 88pm8607: Fix off-by-one value range checking in the case of no id is matchedAxel Lin1-1/+1
In the case of no id is matched, the variable i is equal to ARRAY_SIZE(pm8607_regulator_info). 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-26regulator: Fix 88pm8607.c printk format warningRandy Dunlap1-2/+2
Fix printk format warning (seen on x86_64) and change to unsigned output format: drivers/regulator/88pm8607.c:417: warning: format '%d' expects type 'int', but argument 3 has type 'resource_size_t' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26mfd: Avoid to use constraint name in 88pm860x regulator driverHaojian Zhuang1-12/+13
Avoid to use constraint name in regulator driver. So use regulator id is used instead in platform driver. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26mfd: Use mfd cell platform_data for 88pm860x cells platform bitsSamuel Ortiz1-6/+1
With the addition of a platform device mfd_cell pointer, MFD drivers can go back to passing platform 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> Cc: Richard Purdie <rpurdie@rpsys.net> Acked-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-23mfd: Adopt mfd_data in 88pm860x regulatorHaojian Zhuang1-22/+24
Copy 88pm860x platform data into different mfd_data structure for regulator driver. So move the identification of device node from regulator driver to mfd driver. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-01-12regulator: Report actual configured voltage to set_voltage()Mark Brown1-1/+2
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-09-05regulator: 88pm8607 - fix value range checking for accessing info->vol_tableAxel Lin1-2/+2
In choose_voltage(), we use i as array index of info->vol_table. The valid value range for i should be 0 .. ARRAY_SIZE(info->vol_table) - 1. Take LDO1 as example, ARRAY_SIZE(LDO1_table) is 4, vol_nbits of LDO1 is 2. for (i = 0; i < (2 << info->vol_nbits); i++) is equivalent to for (i = 0; i < 8; i++) which is wrong. The same value range checking also applies for index in pm8607_list_voltage(). Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@openource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-25regulator: use voltage number array in 88pm860xHaojian Zhuang1-262/+220
A lot of condition comparision statements are used in original driver. These statements are used to check the boundary of voltage numbers since voltage number isn't linear. Now use array of voltage numbers instead. Clean code with simpler way. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-25regulator: make 88pm860x sharing one driver structureHaojian Zhuang1-41/+10
Remove a lot of driver structures in 88pm860x driver. Make regulators share one driver structure. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-07regulator: Unsupport 88pm8607 A0 and A1Haojian Zhuang1-213/+77
Remove the support 88PM8607 A0/A1 stepping. There's some register definition changes in B0 stepping. It can make software more efficient. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-03-07mfd: Support 88pm8606 in 860x driverHaojian Zhuang1-17/+15
88PM8606 and 88PM8607 are two discrete chips used for power management. Hardware designer can use them together or only one of them according to requirement. There's some logic tightly linked between these two chips. For example, USB charger driver needs to access both chips by I2C interface. Now share one driver to these two devices. Only one I2C client is identified in platform init data. If another chip is also used, user should mark it in companion_addr field of platform init data. Then driver could create another I2C client for the companion chip. All I2C operations are accessed by 860x-i2c driver. In order to support both I2C client address, the read/write API is changed in below. reg_read(client, offset) reg_write(client, offset, data) The benefit is that client drivers only need one kind of read/write API. I2C and MFD driver can be shared in both 8606 and 8607. Since API is changed, update API in 8607 regulator driver. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>