summaryrefslogtreecommitdiff
path: root/drivers/mfd/88pm860x-core.c
AgeCommit message (Collapse)AuthorFilesLines
2016-11-17mfd: 88pm860x: Move over to new I2C device .probe() callLee Jones1-3/+2
As part of an effort to rid the mostly unused second parameter for I2C related .probe() functions and to conform to other existing frameworks we're moving over to a temporary replacement .probe() call-back. Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Kieran Bingham <kieran@bingham.xyz> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-14mfd: 88pm860x-core: Fix commenting and declaration spacingLee Jones1-3/+6
Checkpatch output: WARNING: Block comments use a trailing */ on a separate line + * - turn off */ WARNING: Missing a blank line after declarations + int ret; + ret = i2c_add_driver(&pm860x_driver); total: 0 errors, 2 warnings, 1283 lines checked Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14mfd: Use to_i2c_client() instead of open-coding itGeliang Tang1-2/+2
Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-11mfd: Kill off set_irq_flags usageRob Herring1-4/+0
set_irq_flags is ARM specific with custom flags which have genirq equivalents. Convert drivers to use the genirq interfaces directly, so we can kill off set_irq_flags. The translation of flags is as follows: IRQF_VALID -> !IRQ_NOREQUEST IRQF_PROBE -> !IRQ_NOPROBE IRQF_NOAUTOEN -> IRQ_NOAUTOEN For IRQs managed by an irqdomain, the irqdomain core code handles clearing and setting IRQ_NOREQUEST already, so there is no need to do this in .map() functions and we can simply remove the set_irq_flags calls. Some users also modify IRQ_NOPROBE and this has been maintained although it is not clear that is really needed. There appears to be a great deal of blind copy and paste of this code. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-11mfd: Drop owner assignment from i2c_driversKrzysztof Kozlowski1-1/+0
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-22mfd: Constify regmap and irq configuration dataKrzysztof Kozlowski1-1/+1
Constify in various drivers configuration data which is not modified: - regmap_irq_chip, - individual regmap_irq's in array, - regmap_config, - irq_domain_ops, Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-01-22mfd: 88pm860x-core: Constify struct regmap_configKrzysztof Kozlowski1-1/+1
The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-07-09mfd: 88pm860x-core: Repair formatting issuesLee Jones1-15/+22
Fixes the following checkpatch warnings: WARNING: please, no space before tabs #5: FILE: drivers/mfd/88pm860x-core.c:5: + * ^IHaojian Zhuang <haojian.zhuang@marvell.com>$ WARNING: line over 80 characters #143: FILE: drivers/mfd/88pm860x-core.c:143: + {PM8607_IRQ_AUDIO_SHORT, PM8607_IRQ_AUDIO_SHORT, "audio-short", IORESOURCE_IRQ,}, WARNING: line over 80 characters #153: FILE: drivers/mfd/88pm860x-core.c:153: + {PM8607_IRQ_CHG_DONE, PM8607_IRQ_CHG_DONE, "charging done", IORESOURCE_IRQ,}, WARNING: line over 80 characters #154: FILE: drivers/mfd/88pm860x-core.c:154: + {PM8607_IRQ_CHG_FAIL, PM8607_IRQ_CHG_FAIL, "charging timeout", IORESOURCE_IRQ,}, WARNING: line over 80 characters #155: FILE: drivers/mfd/88pm860x-core.c:155: + {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault", IORESOURCE_IRQ,}, WARNING: line over 80 characters #156: FILE: drivers/mfd/88pm860x-core.c:156: + {PM8607_IRQ_GPADC1, PM8607_IRQ_GPADC1, "battery temperature", IORESOURCE_IRQ,}, WARNING: Avoid unnecessary line continuations #571: FILE: drivers/mfd/88pm860x-core.c:571: + struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \ WARNING: line over 80 characters #634: FILE: drivers/mfd/88pm860x-core.c:634: + ret = request_threaded_irq(chip->core_irq, NULL, pm860x_irq, flags | IRQF_ONESHOT, WARNING: Unnecessary parentheses - maybe == should be = ? #874: FILE: drivers/mfd/88pm860x-core.c:874: + if ((pdata == NULL)) WARNING: quoted string split across lines #1001: FILE: drivers/mfd/88pm860x-core.c:1001: + dev_err(chip->dev, "Failed to detect Marvell 88PM8607. " + "Chip ID: %02x\n", ret); WARNING: quoted string split across lines #1124: FILE: drivers/mfd/88pm860x-core.c:1124: + dev_err(dev, "Not found \"marvell,88pm860x-slave-addr\" " + "property\n"); total: 0 errors, 11 warnings, 1281 lines checked Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: 88pm860x: Fix possible NULL pointer dereference on i2c_new_dummy errorKrzysztof Kozlowski1-0/+5
During probe the driver allocates dummy I2C device for companion chip with i2c_new_dummy() but it does not check the return value of this call. In case of error (i2c_new_device(): memory allocation failure or I2C address cannot be used) this function returns NULL which is later used by regmap_init_i2c(). If i2c_new_dummy() fails for companion device, fail also the probe for main MFD driver. Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: 88pm860x: Fix I2C device resource leak on regmap init failKrzysztof Kozlowski1-0/+1
During probe the driver allocates dummy I2C device for companion chip and then allocates a regmap for it. If regmap_init_i2c() fails then the I2C driver (allocated with i2c_new_dummy()) is not freed and this resource leaks. Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-10-23mfd: 88pm860x: Remove redundant of_match_ptrSachin Kamat1-1/+1
The data structure of_match_ptr() protects is always compiled in. Hence of_match_ptr() is not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-07-31mfd: 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: Lee Jones <lee.jones@linaro.org>
2013-06-13mfd: 88pm860x: Convert to managed resources for allocating memoryLee Jones1-3/+2
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-06-13mfd: 88pm860x: Use devm_regmap_init_i2c()Sachin Kamat1-2/+1
devm_regmap_init_i2c() is device managed and makes cleanup simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-04-08mfd: 88pm860x: Drop devm_kfree of devm_kzalloc'd dataJingoo Han1-9/+3
devm_kfree() allocates memory that is released when a driver detaches. Thus, there is no reason to explicitly call devm_kfree() in probe or remove functions. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-11-29mfd: remove use of __devexitBill Pemberton1-2/+2
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Peter Tyser <ptyser@xes-inc.com> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Acked-by: David Brown <davidb@codeaurora.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-29mfd: remove use of __devinitdataBill Pemberton1-34/+34
CONFIG_HOTPLUG is going away as an option so __devinitdata is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Peter Tyser <ptyser@xes-inc.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-29mfd: remove use of __devinitBill Pemberton1-15/+15
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Peter Tyser <ptyser@xes-inc.com> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Acked-by: David Brown <davidb@codeaurora.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-29mfd: 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> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Peter Tyser <ptyser@xes-inc.com> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Acked-by: David Brown <davidb@codeaurora.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-07Merge tag 'for-v3.7' of git://git.infradead.org/battery-2.6Linus Torvalds1-1/+21
Pull battery updates from Anton Vorontsov: "1. New drivers: - Marvell 88pm860x charger and battery drivers; - Texas Instruments LP8788 charger driver; 2. Two new power supply properties: whether a battery is authentic, and chargers' maximal currents and voltages; 3. A lot of TI LP8727 Charger cleanups; 4. New features for Charger Manager, mainly now we can disable specific regulators; 5. Random fixes and cleanups for other drivers." Fix up trivial conflicts in <linux/mfd/88pm860x.h> * tag 'for-v3.7' of git://git.infradead.org/battery-2.6: (52 commits) pda_power: Remove ac_draw_failed goto and label charger-manager: Add support sysfs entry for charger charger-manager: Support limit of maximum possible charger-manager: Check fully charged state of battery periodically lp8727_charger: More pure cosmetic improvements lp8727_charger: Fix checkpatch warning lp8727_charger: Add description in the private data lp8727_charger: Fix a typo - chg_parm to chg_param lp8727_charger: Make some cosmetic changes in lp8727_delayed_func() lp8727_charger: Clean up lp8727_charger_changed() lp8727_charger: Return if the battery is discharging lp8727_charger: Make lp8727_charger_get_propery() simpler lp8727_charger: Make lp8727_ctrl_switch() inline lp8727_charger: Make lp8727_init_device() shorter lp8727_charger: Clean up lp8727_is_charger_attached() lp8727_charger: Use specific definition lp8727_charger: Clean up lp8727 definitions lp8727_charger: Use the definition rather than enum lp8727_charger: Fix code for getting battery temp lp8727_charger: Clear interrrupts at inital time ...
2012-10-02mfd: 88pm860x: Move gpadc init into touchHaojian Zhuang1-51/+0
The initilization of GPADC is moved from core driver to touch driver with DT support. Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-10-02mfd: 88pm860x: Device tree supportHaojian Zhuang1-9/+53
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-10-02mfd: 88pm860x: Use irqdomainHaojian Zhuang1-27/+38
Use irqdomain and allocating interrupts. It's necessary for supporting DT mode. Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-25Merge with upstream to accommodate with MFD changesAnton Vorontsov1-11/+12
commit 0848c94fb4 ("mfd: core: Push irqdomain mapping out into devices") that appeared in v3.6-rc6 adds another argument to the mfd_add_devices() call, and that makes commit a830d28b48bf ("power_supply: Enable battery-charger for 88pm860x", which is battery tree) no longer compatible with the latest kernels. This commit is used to merge upstream back into battery tree and accommodate 88pm860x driver for the latest changes in MFD core. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Reported-by: Fengguang Wu <fengguang.wu@intel.com> Reported-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-09-2188pm860x_battery and charger: Fix a few post-merge issuesAnton Vorontsov1-2/+2
Sparse complains: CHECK drivers/power/88pm860x_battery.c drivers/power/88pm860x_battery.c:128:5: warning: symbol 'array_soc' was not declared. Should it be static? CHECK drivers/power/88pm860x_charger.c drivers/power/88pm860x_charger.c:640:3: warning: symbol 'pm860x_irq_descs' was not declared. Should it be static? CHECK drivers/mfd/88pm860x-core.c drivers/mfd/88pm860x-core.c:803:53: warning: incorrect type in assignment (different base types) drivers/mfd/88pm860x-core.c:803:53: expected struct charger_regulator *charger_regulators drivers/mfd/88pm860x-core.c:803:53: got struct regulator_bulk_data static [toplevel] * The issues are minor, except for the last one. We seemed to use 'regulator_bulk_data' struct (just as charger manager documentation wrongly tells us), but in real it should have been 'struct charger_regulator'. The only reason that it worked is because both 'supply' and 'regulator_name' struct members are the first in these structs. :-) Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-09-21power_supply: Enable battery-charger for 88pm860xJett.Zhou1-1/+21
There are charger and battery measurement feature for 88pm860x PMIC. For charger, it can support pre-charge with small current when battery is nearly exausted and then changed into fast-charge with CC&CV mode. For battery monitor, it can support battery measurement such as vbat,vsys,vchg and ibat etc,it can aslo accumulating the Coulomb value charged or discharged from battery based on Conlomb Counter, we use it to estimate battery capacity. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-09-19mfd: 88pm860x: Move initilization codeHaojian Zhuang1-3/+159
Move probe() and other functions from 88pm860x-i2c.c to 88pm860x-core.c. Since it could benefit to handle DT information. 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-7/+1
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-19mfd: Use IRQF_ONESHOT for 88pm860xFengguang Wu1-1/+1
Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci Make sure threaded IRQs without a primary handler are always request with IRQF_ONESHOT. Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-16mfd: core: Push irqdomain mapping out into devicesMark Brown1-10/+11
Currently the MFD core supports remapping MFD cell interrupts using an irqdomain but only if the MFD is being instantiated using device tree and only if the device tree bindings use the pattern of registering IPs in the device tree with compatible properties. This will be actively harmful for drivers which support non-DT platforms and use this pattern for their DT bindings as it will mean that the core will silently change remapping behaviour and it is also limiting for drivers which don't do DT with this particular pattern. There is also a potential fragility if there are interrupts not associated with MFD cells and all the cells are omitted from the device tree for some reason. Instead change the code to take an IRQ domain as an optional argument, allowing drivers to take the decision about the parent domain for their interrupts. The one current user of this feature is ab8500-core, it has the domain lookup pushed out into the driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-14mfd: 88pm860x: Fix section mismatch warningHaojian Zhuang1-3/+3
WARNING: drivers/built-in.o(.data+0x1e3c8): Section mismatch in reference from the variable bk_devs to the variable .devinit.data:bk0_resources The variable bk_devs references the variable __devinitdata bk0_resources If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console So add __devinitdata on bk_devs, led_devs & reg_devs. Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-14mfd: core: Push irqdomain mapping out into devicesMark Brown1-10/+11
Currently the MFD core supports remapping MFD cell interrupts using an irqdomain but only if the MFD is being instantiated using device tree and only if the device tree bindings use the pattern of registering IPs in the device tree with compatible properties. This will be actively harmful for drivers which support non-DT platforms and use this pattern for their DT bindings as it will mean that the core will silently change remapping behaviour and it is also limiting for drivers which don't do DT with this particular pattern. There is also a potential fragility if there are interrupts not associated with MFD cells and all the cells are omitted from the device tree for some reason. Instead change the code to take an IRQ domain as an optional argument, allowing drivers to take the decision about the parent domain for their interrupts. The one current user of this feature is ab8500-core, it has the domain lookup pushed out into the driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-11mfd: 88pm860x: Use REG resource in regulatorHaojian Zhuang1-66/+199
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: Use REG in leds resourceHaojian Zhuang1-40/+74
Since the resources of 88pm860x leds are changed from IORESOURCE_IO to IORESOURCE_REG that is register offset, change the original self-defined IORESOURCE_IO to register offset. Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-11mfd: 88pm860x: Use REG resource for backlightHaojian Zhuang1-35/+43
Now resource of 88pm860x backlight is changed from IORESOURCE_IO to IORESOURCE_REG. In original driver, the resource is using self-defined IORESOURCE_IO. So change the resource to register offset to match the definition of IORESOURCE_REG. 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-63/+29
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-09-11mfd: 88pm860x: Move _IO resources out of ioport_ioresourceMark Brown1-29/+63
The removal of mach/io.h from most ARM platforms also set the range of valid IO ports to be empty for most platforms when previously any 32 bit integer had been valid. This makes it impossible to add IO resources as the added range is smaller than that of the root resource for IO ports. Since we're not really using IO memory at all fix this by defining our own root resource outside the normal tree and make that the parent of all IO resources. This also ensures we won't conflict with read IO ports if we ever run on a platform which happens to use them. 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> Cc: stable@vger.kernel.org (v3.4+) Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-07-09mfd: Add pre-regulator device for 88pm860xJett.Zhou1-0/+23
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 device init data and resource for mfd subdev. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-03-06mfd: Fix pm8606 build failureSamuel Ortiz1-0/+2
Reported by Andrew Morton <akpm@linux-foundation.org>, with i386 allmodconfig: ERROR: "pm8606_osc_disable" [drivers/video/backlight/88pm860x_bl.ko] undefined! ERROR: "pm8606_osc_enable" [drivers/video/backlight/88pm860x_bl.ko] undefined! ERROR: "pm8606_osc_disable" [drivers/leds/leds-88pm860x.ko] undefined! ERROR: "pm8606_osc_enable" [drivers/leds/leds-88pm860x.ko] undefined! Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-03-06mfd: Code cleanup for pm8606 sub-dev initializationJett.Zhou1-6/+11
Collect all the sub-devices of pm8606 initialization into device_pm8606_init() for code clean up. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-03-06mfd: Add power control interface for pm8606 chipJett.Zhou1-0/+95
The reference group and internal oscillator are shared by sub-devs like led, backlight and vibrator in PM8606 chip. Now introduce a voting mechanism to enable/disable it. Add pm8606_osc_enable() and pm8606_osc_disable() interface and related defines to support this. This interface will be called by vibrator led and backlight driver.The refernce group and internal oscillator are enabled only when at least one of it's clients holds it on or disabled only all the clients don't use it any more based on the above mechanism. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26mfd: Avoid to use constraint name in 88pm860x regulator driverHaojian Zhuang1-27/+8
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: Remove unused parameter from 88pm860x APIHaojian Zhuang1-18/+10
i2c_client parameter isn't used in some functions. Just remove it. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26mfd: Avoid to allocate 88pm860x static platform dataHaojian Zhuang1-29/+16
Maybe multiple PMIC devices are installed into one board. Static variable can only make driver logic mess. So remove these variable, and use platform data from platform driver instead. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26mfd: Add rtc support to 88pm860xHaojian Zhuang1-0/+29
Enable rtc function in 88pm860x PMIC. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26mfd: Fix build warning on 88pm860xHaojian Zhuang1-14/+14
WARNING: vmlinux.o(.devinit.text+0x6c4): Section mismatch in reference from the function device_onkey_init() to the (unknown reference) .init.data:(unknown) The function __devinit device_onkey_init() references a (unknown reference) __initdata (unknown). If (unknown) is only used by device_onkey_init then annotate (unknown) with a matching annotation. It's caused by using __initdata on mfd cell resources. Replace __initdata with __devinitdata. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.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/+12
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-27mfd: Cleanup irq namespaceThomas Gleixner1-4/+4
Converted with coccinelle. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-27mfd: 88pm860x: Remove unused irq_desc leftoversThomas Gleixner1-3/+0
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-23mfd: Adopt mfd_data in 88pm860x input driverHaojian Zhuang1-125/+126
Copy 88pm860x platform data into different mfd_data structure for onkey/touch/codec/power driver. So move the identification of device node from those drivers to mfd driver. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>