aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-08-12Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6Linus Torvalds4-1/+172
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: (22 commits) regulator: Remove default DEBUG define from TPS6586x regulator: tps6507x - add missing platform_set_drvdata in tps6507x_pmic_probe regulator: tps6586x - add regulator_unregister() in tps6586x_regulator_remove() mfd: max8998 - fix incorrect kfree(i2c) in i2c_driver probe callback handler regulator: lp3971 - remove unnecessary ret value checking in lp3971_i2c_write() regulator: max8660 - fix a memory leak in max8660_remove() regulator: max1586 - fix a memory leak in max1586_pmic_remove() regulator: Default GPIO controlled WM8994 regulators to disabled regulator: lp3971 - remove unnecessary ret value checking in lp3971_i2c_write() max8998: fix off-by-one value range checking regulator: tps6586x: fix millivolt return values and SM2 table regulator: tps6586x: add dependancy on MFD_TPS6585x regulator: add TPS6586X regulator driver regulator: MAX8998: set_voltage bugfix. ramp_up delay and min/max voltage regulator: add support for regulators on the ab8500 MFD ab8500-mfd: add regulator support to ab8500 mfd device tps65023: Allow registering similar TPS65021 drivers: regulators: depend on MFD_MAX8998 drivers: regulator: add Maxim 8998 driver ISL6271A voltage regulator support. ...
2010-08-12mfd: Fix incorrect kfree(i2c) in wm8994-core i2c_driver probeAxel Lin1-3/+1
The i2c_client received in probe() should not be kfree()'d. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix incorrect kfree(i2c) in wm831x-core i2c_driver probeAxel Lin1-3/+1
The i2c_client received in probe() should not be kfree()'d. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix incorrect kfree(i2c) in tps6507x i2c_driver probeAxel Lin1-3/+1
The i2c_client received in probe() should not be kfree()'d. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Add TPS6586x driverMike Rapoport3-0/+390
Add mfd core driver for TPS6586x PMICs family. The driver provides I/O access for the sub-device drivers and performs regstration of the sub-devices based on the platform requirements. In addition it implements GPIOlib interface for the chip GPIOs. TODO: - add interrupt support - add platform data for PWM, backlight leds and charger Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Use macros instead of some constant magic numbers for menelausJarkko Nikula1-21/+54
This patch is originally done by Carlos Eduardo Aguiar. Original fix is commit 3305829b2816072b9c8ed01374b205ae4de74027 in git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git Author modified the fix for mainline version of menelaus. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix menelaus mmc slot 2 misconfigurationJarkko Nikula1-2/+2
We are modifying register value instead of return value. This fix is originally done by Carlos Eduardo Aguiar. Original fix is commit bb4e91722e29efe31587d2cc664b6def645aecd9 in git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git Author modified the fix for mainline version of menelaus. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Missing slab.h includesDavid Miller1-0/+1
Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix wrong wm8350-core kfree in error pathAxel Lin1-2/+4
This patch includes below fixes: 1. fix wm8350_create_cache error path make sure wm8350->reg_cache is freed in error path. 2. fix wm8350_device_init error path no need to kfree(wm8350->reg_cache) in the case of goto out. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix wm8994_device_init() return valueAxel Lin1-1/+3
wm8994_device_init() will return 0 in the case of kzalloc fail in current implementation. This patch fixes the return value. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Avoid calling platform_device_put() twice in ucb1400 probe error pathAxel Lin1-1/+1
In the case of goto err2, what we want is to call platform_device_del() instead of platform_device_unregister(). Otherwise, we call platform_device_put() twice. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Annotate tc6387xb probe/remove routines with __devinit/__devexitAxel Lin1-3/+3
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix tc6387xb resource reclaimAxel Lin1-3/+7
This patch includes below fixes: 1. add a missing iounmap in tc6387xb_probe() error path 2. fix resource reclaim in tc6387xb_remove() Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix wrong goto labels for tc6393xb error handlingAxel Lin1-2/+2
This patch corrects the error handling path. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Get rid of now unused mc13783 private headerUwe Kleine-König1-1/+23
This adds all remaining definitions that are used by the core driver to the .c file. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: New mc13783 function exposing flagsUwe Kleine-König1-0/+6
This is needed for the mc13783-adc driver to decide if a touch screen is connected. If so some channels are not available as generic hwmon inputs. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Check jz4740-adc kmalloc() resultAxel Lin1-0/+4
If kmalloc() fails exit with -ENOMEM. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix jz4740-adc resource reclaim in probe error pathAxel Lin1-1/+7
If mfd_add_devices() fail, we need to relese allocated resources. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Add WM8321 supportMark Brown1-0/+14
The WM8321 is a PMIC for low power, high performance applications. From a software point of view the device is identical to the WM8320, all the differences between the two devices are visible only in hardware. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Add stmpe auto sleep featureSundar R Iyer2-0/+77
Some STMPE devices support entering sleep mode automatically on a specified timeout of inactivity on the I2C bus with the host system. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Add support for TWL6030 PWMHemanth V3-0/+173
TWL6030 supports PWM (Pulse Width Modulator) which is used to control charging LED. PWM allows for controlling brightness. This patch implements the APIs required by leds-pwm driver. Signed-off-by: Hemanth V <hemanthv@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Add JZ4740 ADC driverLars-Peter Clausen3-0/+393
This patch adds a MFD driver for the JZ4740 ADC unit. The driver is used to demultiplex IRQs and synchronize access to shared registers between the battery, hwmon and (future) touchscreen driver. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Add STMPE I/O Expander supportRabin Vincent4-0/+1115
Add support for the STMPE family of I/O Expanders from STMicroelectronics. These devices include upto 24 gpios and a varying selection of blocks, including PWM, keypad, and touchscreen controllers. This patch adds the MFD core. [l.fu@pengutronix.de: fix stmpe811 enable hook] [l.fu@pengutronix.de: add touchscreen platform data] Acked-by: Luotao Fu <l.fu@pengutronix.de> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Properly free t7l66xb clk32k clock sourceAxel Lin1-1/+2
This patch includes below fixes to properly free clk32k clock source: 1. remove a redundant clk_put in t7l66xb_probe error path 2. add missing clk_disable(t7l66xb->clk32k) and clk_put(t7l66xb->clk32k) to properly free the clock source. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: More verbose MFD Kconfig entrySamuel Ortiz1-1/+10
For people to be able to intellingibly decide if they want to enable MFD drivers or not, we have to give them a much better description of what they are.
2010-08-12mfd: Staticise ab3550 register access functionsMark Brown1-11/+12
These are now exported via an ops table rather than referenced directly and so should be staticised. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix davinci memory leakJulia Lawall1-2/+4
Error handling code following a kmalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S <... when != x when != if (...) { <+...x...+> } ( x->f1 = E | (x->f1 == NULL || ...) | f(...,x->f1,...) ) ...> ( return \(0\|<+...x...+>\|ptr\); | return@p2 ...; ) @script:python@ p1 << r.p1; p2 << r.p2; @@ print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: properly handle platform_device_add_resources fail in mfd_add_deviceAxel Lin1-1/+3
platform_device_add_resources may fail, thus add error checking for it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: kzalloc doesn't return ERR_PTRJulia Lawall1-1/+1
Use !x rather than IS_ERR(x) to test the result of kzalloc. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,E; @@ x = \(kmalloc\|kzalloc\|kcalloc\)(...) ... when != x = E - IS_ERR(x) + !x // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: AB8500 mask off irrelevant bits from the SPI messageLinus Walleij1-1/+6
The registers on the AB8500 are only 8 bits wide, so the content of the remaining bits is undefined. Let's mask off the undefined stuff when returning a register in an SPI read. Acked-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix 88pm860x uninitialized variable and clean upDan Carpenter1-40/+32
The original code had a compile warning: drivers/mfd/88pm860x-core.c:431: warning: ‘ret’ may be used uninitialized in this function It seems like the warning is valid if either pdata or pdata->touch is NULL. This patch checks pdata and pdata->touch at the beginning of the function. That means everything can be pulled in one indent level. Now all the statements fit within the 80 character limit. Also at that point the "use_gpadc" variable isn't needed and removing it simplifies the logic. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Haojian Zhuang <hzhuang1@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix memory leak in ab3100_otp_probeAxel Lin1-8/+8
In current implementation, there is a memory leak if ab3100_otp_read fail. And in the case of ab3100_otp_init_debugfs fail, it does not properly remove sysfs entries. This patch properly handle above failure cases. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Fix led resource in 88pm860xHaojian Zhuang1-6/+6
Fix typo error in LED resource of 88pm860x. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12mfd: Enable onkey on max8925Haojian Zhuang1-0/+27
Enable onkey feature in max8925 driver. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-11mfd: max8998 - fix incorrect kfree(i2c) in i2c_driver probe callback handlerAxel Lin1-3/+1
The i2c_client received in probe() should not be kfree()'d. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-11ab8500-mfd: add regulator support to ab8500 mfd deviceSundar R Iyer1-1/+3
Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-By: Mattias Wallin <mattias.wallin@stericsson.com> Acked-By: Bengt JONSSON <bengt.g.jonsson@stericsson.com> Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-11drivers: regulator: add Maxim 8998 driverKyungmin Park3-0/+171
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> This patch adds voltage regulator driver for Maxim 8998 chip. This chip is used on Samsung Aquila and GONI boards and provides following functionalities: - 4 BUCK voltage converters, 17 LDO power regulators and 5 other power controllers - battery charger This patch adds basic driver for voltage regulators and MAX 8998 MFD core. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> 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>
2010-06-03i2c: Remove all i2c_set_clientdata(client, NULL) in driversWolfram Sang12-21/+0
I2C drivers can use the clientdata-pointer to point to private data. As I2C devices are not really unregistered, but merely detached from their driver, it used to be the drivers obligation to clear this pointer during remove() or a failed probe(). As a couple of drivers forgot to do this, it was agreed that it was cleaner if the i2c-core does this clearance when appropriate, as there is no guarantee for the lifetime of the clientdata-pointer after remove() anyhow. This feature was added to the core with commit e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers. As there is no need anymore to clear the clientdata-pointer, remove all current occurrences in the drivers to simplify the code and prevent confusion. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Richard Purdie <rpurdie@linux.intel.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-05-28mfd: Rename twl5031 sih modulesIlkka Koskinen1-5/+6
Fix the names of twl5031 specific sih modules to match the documentation. Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-05-28mfd: Storage class for timberdale should be before const qualifierTobias Klauser1-10/+10
The C99 specification states in section 6.11.5: The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-05-28mfd: Remove unneeded and dangerous clearing of clientdataWolfram Sang2-3/+0
Unlike real i2c-devices which get detached from the driver, dummy-devices get truly unregistered. So, there has never been a need to clear the clientdata because the device will go away anyhow. For the occasions fixed here, clearing clientdata was even dangerous as the structure was freed already. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-05-28mfd: New AB8500 driverRabin Vincent5-214/+583
Add a new driver to support the AB8500 Power Management chip, replacing the current AB4500. The new driver replaces the old one, instead of an incremental modification, because this is a substantial overhaul including: - Split of the driver into -core and -spi portions, to allow another interface layer to be added - Addition of interrupt support - Switch to MFD core API for handling subdevices - Simplification of the APIs to remove a redundant block parameter - Rename of the APIs and macros from ab4500_* to ab8500_* - Rename of the files from ab4500* to ab8500* - Change of the driver name from ab4500 to ab8500 Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-05-28mfd: Change rdc321x resources flags to IORESOURCE_IOFlorian Fainelli1-3/+3
The rdc321x southbridge PCI device has no MEM PCI resources that we could pass to mfd_add_devices. Since 33254dd5, mfd_add_device checks for the mem_base argument that we set to NULL. Changing the resources passed to our MFD cells from IORESOURCE_MEM to IORESOURCE_IO fixes that. Since we use those resources as offsets to the PCI configuration space base address of the southbridge device this is also more adequate. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-05-28mfd: Move pcf50633 irq related functions to its own file.Lars-Peter Clausen3-294/+330
This reduces code clutter a bit and will ease an migration to genirq. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-05-28mfd: Use threaded irq for pcf50633Lars-Peter Clausen2-49/+10
Use threaded oneshot irq handler instead of normal irq handler and a workqueue. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-05-28mfd: pcf50633-adc: Fix potential race in pcf50633_adc_sync_readLars-Peter Clausen1-24/+15
Currently it's not guaranteed that request struct is not already freed when reading from it. Fix this by moving synced request related fields from the pcf50633_adc_request struct to its own struct and store it on the functions stack. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-05-28mfd: Fix pcf50633 bitfield logic in interrupt handlerLars-Peter Clausen1-4/+4
Those constants are alreay bitfields. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-05-28mfd: Use menuconfig for quicker config editingRandy Dunlap1-2/+8
Change MFD 'menu' to 'menuconfig' to facilitate easy (one-click) disabling of all MFD drivers. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-05-28mfd: AB3550 core driverMattias Wallin3-0/+1416
This adds a core driver for the AB3550 mixed-signal circuit found in the ST-Ericsson U300 platforms. This driver is a singleton proxy for all access to the AB3550 sub functionality drivers which can be added on top of this one: RTC, regulators, battery and system power control, vibrator, LEDs and an ALSA codec. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-05-28mfd: AB3100 register access change to abx500 APIMattias Wallin5-37/+239
The interface for the AB3100 is changed to make way for the ABX500 family of chips: AB3550, AB5500 and future ST-Ericsson Analog Baseband chips. The register access functions are moved out to a separate struct abx500_ops. In this way the interface is moved from the implementation and the sub functionality drivers can keep their interface intact when chip infrastructure and communication mechanisms changes. We also define the AB3550 device IDs and the AB3550 platform data struct and convert the catenated 32bit event to an array of 3 x 8bits. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>