summaryrefslogtreecommitdiff
path: root/drivers/mfd
AgeCommit message (Collapse)Author
2012-01-06mfd: Turn on the twl4030-madc MADC clockKyle Manna
commit 3d6271f92e98094584fd1e609a9969cd33e61122 upstream. Without turning the MADC clock on, no MADC conversions occur. $ cat /sys/class/hwmon/hwmon0/device/in8_input [ 53.428436] twl4030_madc twl4030_madc: conversion timeout! cat: read error: Resource temporarily unavailable Signed-off-by: Kyle Manna <kyle@kylemanna.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-06mfd: Fix twl-core oops while calling twl_i2c_* for unbound driverIlya Yanok
commit 8653be1afd60d6e8c36139b487e375b70357d9ef upstream. Check inuse variable before trying to access twl_map to prevent dereferencing of uninitialized variable. Signed-off-by: Ilya Yanok <yanok@emcraft.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-21mfd: Fix twl4030 dependencies for audio codecThomas Weber
commit f09ee0451a44a4e913a7c3cec3805508f7de6c54 upstream. The codec for Devkit8000 (TWL4030) was not detected except when build with CONFIG_SND_SOC_ALL_CODECS. twl-core.c still uses the CONFIG_TWL4030_CODEC for twl_has_codec(). In commit 57fe7251f5bfc4332f24479376de48a1e8ca6211 the CONFIG_TWL4030_CODEC was renamed into CONFIG_MFD_TWL4030_AUDIO, thatswhy the codec was not detected. This patch renames the CONFIG_ TWL4030_CODEC into CONFIG_MFD_TWL4030_AUDIO in twl-core.c. Signed-off-by: Thomas Weber <weber@corscience.de> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Cc: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-21mfd: Fix generic irq chip ack function name for jz4740-adcLars-Peter Clausen
In commit 659fb32d1b6("genirq: replace irq_gc_ack() with {set,clr}_bit variants"), irq_gc_ack was renamed to irq_gc_ack_set_bit. The jz4740-adc driver still uses the old name which results in a compile error. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-09-06mfd: Fix omap-usb-host build failureMing Lei
The patch fixes the build failure: drivers/mfd/omap-usb-host.c:1034:1: warning: data definition has no type or storage class drivers/mfd/omap-usb-host.c:1034:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL' drivers/mfd/omap-usb-host.c:1034:1: warning: parameter names (without types) in function declaration drivers/mfd/omap-usb-host.c:1040:1: warning: data definition has no type or storage class drivers/mfd/omap-usb-host.c:1040:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL' drivers/mfd/omap-usb-host.c:1040:1: warning: parameter names (without types) in function declaration drivers/mfd/omap-usb-host.c:1045:13: error: 'THIS_MODULE' undeclared here (not in a function) drivers/mfd/omap-usb-host.c:1050:15: error: expected declaration specifiers or '...' before string constant drivers/mfd/omap-usb-host.c:1050:1: warning: data definition has no type or storage class drivers/mfd/omap-usb-host.c:1050:1: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR' drivers/mfd/omap-usb-host.c:1050:15: warning: function declaration isn't a prototype drivers/mfd/omap-usb-host.c:1051:14: error: expected declaration specifiers or '...' before string constant drivers/mfd/omap-usb-host.c:1051:1: warning: data definition has no type or storage class drivers/mfd/omap-usb-host.c:1051:1: warning: type defaults to 'int' in declaration of 'MODULE_ALIAS' drivers/mfd/omap-usb-host.c:1051:14: warning: function declaration isn't a prototype drivers/mfd/omap-usb-host.c:1052:16: error: expected declaration specifiers or '...' before string constant drivers/mfd/omap-usb-host.c:1052:1: warning: data definition has no type or storage class drivers/mfd/omap-usb-host.c:1052:1: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE' drivers/mfd/omap-usb-host.c:1052:16: warning: function declaration isn't a prototype drivers/mfd/omap-usb-host.c:1053:20: error: expected declaration specifiers or '...' before string constant drivers/mfd/omap-usb-host.c:1053:1: warning: data definition has no type or storage class drivers/mfd/omap-usb-host.c:1053:1: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION' drivers/mfd/omap-usb-host.c:1053:20: warning: function declaration isn't a prototype make[2]: *** [drivers/mfd/omap-usb-host.o] Error 1 CC fs/proc/namespaces.o make[1]: *** [drivers/mfd] Error 2 make: *** [drivers] Error 2 make: *** Waiting for unfinished jobs.... Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-09-06mfd: Make omap-usb-host TLL mode work againAnand Gadiyar
This code section seems to have been accidentally copy pasted. It causes incorrect bits to be set up in the TLL_CHANNEL_CONF register and prevents the TLL mode from working correctly. Cc: stable@kernel.org Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Cc: Keshava Munegowda <keshava_mgowda@ti.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-09-06mfd: Set MAX8997 irq pointerMyungJoo Ham
Required platform information is not handed to max8997-irq.c properly. This patch enables to hand over such information to max8997-irq.c so that max8997-irq functions properly. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-09-06mfd: Fix initialisation of tps65910 interruptsJohan Hovold
Fix regression introduced by commit a2974732ca7614aaf0baf9d6dd3ad893d50ce1c5 (TPS65911: Add new irq definitions) which caused irq_num to be incorrectly set for tps65910. Cc: stable@kernel.org Signed-off-by: Johan Hovold <jhovold@gmail.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-09-06mfd: Check for twl4030-madc NULL pointerKyle Manna
If the twl4030-madc device wasn't registered, and another device, such as twl4030-madc-hwmon, calls twl4030_madc_conversion() a NULL pointer is dereferenced. Signed-off-by: Kyle Manna <kyle@kylemanna.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-09-06mfd: Copy the device pointer to the twl4030-madc structureKyle Manna
Worst case this fixes the following error: [ 72.086212] (NULL device *): conversion timeout! Best case it prevents a crash Signed-off-by: Kyle Manna <kyle@kylemanna.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-09-06mfd: Rename wm8350 static gpio_set_debounce()Sascha Hauer
The kernel already has a function with this name declared in asm-generic/gpio.h. So if this header leaks into wm8350/gpio.c we get drivers/mfd/wm8350-gpio.c:40:12: error: conflicting types for 'gpio_set_debounce' include/asm-generic/gpio.h:156:12: note: previous declaration of 'gpio_set_debounce' was here Fix this by adding a wm8350_ prefix to the function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Fix mismatch in twl4030 mutex lock-unlockSanjeev Premi
A mutex is locked on entry into twl4030_madc_conversion(). Immediate return on some error conditions leaves the mutex locked. This patch ensures that mutex is always unlocked before leaving the function. Signed-off-by: Sanjeev Premi <premi@ti.com> Cc: Keerthy <j-keerthy@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: twl6030-pwm.c needs MODULE_LICENSERandy Dunlap
twl6030_pwm: module license 'unspecified' taints kernel. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Hemanth V <hemanthv@ti.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Fix the omap-usb-host clock API usage on usbhs_disable()Keshava Munegowda
usbhs_disable function was invoking clk_enable() instead of clk_disable(), thus only increasing the clock usage counter and preventing this particular clock from being ever turned off. Because of this, the power domain of omap4 the USB Host subsystem would never reach lower power states.This patch calls clk_disable() in usbhs_disable function Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Acknowledge WM8994 IRQs before reportingMark Brown
This ensures we never have a window where we've handled an interrupt but not told the hardware about it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Acknowlege all WM831x IRQs before we handle themMark Brown
Ensure that we never have a window where we've handled an interrupt (and therefore need to be notified of new events) but haven't yet told the interrupt controller that this is the case (so any new events will be discarded). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Avoid two assignments if failures happen in tps65910_i2c_probeJesper Juhl
In drivers/mfd/tps65910.c:tps65910_i2c_probe() there's potential for a tiny optimization. We assign to init_data->irq and init_data->irq_base long before we need them, and there are two potential exits from the function before they are needed. Moving the assignments below these two potential exits means we completely avoid doing them in these two (failure) cases. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Don't leak init_data in tps65910_i2c_probeJesper Juhl
There are a couple of situations where we leak init_data in drivers/mfd/tps65910.c:tps65910_i2c_probe() - this patch should take care of them. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Add AAT2870 mfd driverJin Park
Add mfd core driver for AnalogicTech AAT2870. The AAT2870 is communication through I2C and contains backlight and regulator components. Signed-off-by: Jin Park <jinyoungp@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Remove dead code from max8997-irqJesper Juhl
We either hit one of the case's or the default in the switch statement in get_i2c(), so the 'return ERR_PTR(-EINVAL);' at the end of the function is just dead code - remove it. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Move TPS55910 Kconfig optionLinus Walleij
Having another TPS chip at the end of the Kconfig when all it's relatives are grouped together in their own section seems totally counter-intuitive. Move it, also in the Makefile. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Fix missing stmpe kerneldocOm Prakash
Generating kerneldoc for STMPE result in warnings, so fix this by adding missing documentation. Signed-off-by: Om Prakash <omprakash.pal@stericsson.com> Reviewed-by: Rabin Vincent <rabin.vincent@stericsson.com> Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com> Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Fix off-by-one value range checking for tps65912_i2c_writeAxel Lin
If bytes == (TPS6591X_MAX_REGISTER + 1), we have a buffer overflow when doing memcpy(&msg[1], src, bytes). Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Add devices for WM831x clocking moduleMark Brown
With the new generic clk API that should appear at some point we should be able to support the clocking sensibly in Linux. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Remove comp{1,2}_threshold sysfs entries in tps65911_comparator_removeAxel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Don't ask about the TPS65912 core driver in KconfigMark Brown
The user has to select the I2C and SPI drivers individually and they select the core driver for the device so there's no point in presenting the user with an option for the core driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Fix off by one in WM831x IRQ codeDimitris Papastamos
The GPIO IRQs aren't the first IRQs defined, we need to subtract the base for the GPIOs as well to use them for array indexes. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Add tps65921 support from twl-coreOleg Drokin
Very similar to TPS65920 List of differences: http://www.ti.com/litv/pdf/swcu066b Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Ensure value written by wm831x_set_bits() is within the maskMark Brown
Purely for defensiveness. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Implement tps65910 IRQ cleanupMark Brown
The tps65910_irq_exit() cleanup function was generating a warning from sparse due to the lack of a prototype. This wasn't causing GCC warnings as the driver wasn't cleaning up its IRQs on exit at all so there was no use of an unprototyped function. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Add tunnelcreek watchdog to lpc_sch devicesAlexander Stein
Tunnel Creek has an additional watchdog core. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Update ab8500 subdevice listLinus Walleij
This synchronize the subdevice entries for the AB8500 MFD driver with the latest development of subdrivers for things like battery charging and temperature monitoring. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: ab8500-core MFD devices marked as initdataRobert Rosengren
Internal MFD device structs are marked as __devinitdata since the kernel will allocate memory for the same when calling mfd_add_devices. Signed-off-by: Robert Rosengren <robert.rosengren@stericsson.com> Reviewed-by: Mattias Wallin <mattias.wallin@stericsson.com> Reviewed-by: Johan Palsson <johan.palsson@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31tps65912: irq: add interrupt controllerMargarita Olaya
This module controls the interrupt handling for the tps65912. The interrupt sources can be the following: - GPIO - PWRON signal - PWRHOLD signal - Temperature detection Signed-off-by: Margarita Olaya Cabrera <magi@slimlogic.co.uk> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: tps65912: Add new mfd deviceMargarita Olaya
The tps65912 chip is a power management IC. It contains the following components: - Regulators - GPIO controller The core driver is registered as a platform driver, it provides communication through I2C and SPI interfaces. Signed-off-by: Margarita Olaya Cabrera <magi@slimlogic.co.uk> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Use kstrtoul_from_user in ab8500Peter Huewe
This patch replaces the code for getting an unsigned long from a userspace buffer by a simple call to kstroul_from_user. This makes it easier to read and less error prone. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Use kstrtoul_from_user in ab3550Peter Huewe
This patch replaces the code for getting an unsigned long from a userspace buffer by a simple call to kstroul_from_user. This makes it easier to read and less error prone. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Use generic irq chip for jz4740-adcLars-Peter Clausen
Use the generic irq chip framework for implementing the irq chip for the jz4740-adc driver. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Fix error handling if BUG() isn't enabled in WM8994Mark Brown
Even if we would've BUG()ed we should still tidy up after ourselves if that isn't enabled in the kernel config. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Fix WM8994 IRQ register cache restore on resumeMark Brown
When the byte swap was factored out into the per-register I/O functions the register restore for the IRQ mask cache (which we use and store in CPU native format for the interrupt handler) was not updated to do a byte swap when it uses the bulk I/O. Fix this by writing the cache out one register at a time. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Support multiple active WM831x AUXADC conversionsMark Brown
The WM831x AUXADC hardware can schedule multiple conversions at once, allowing higher performance when more than one source is in use as we can have the hardware start new conversions without having to wait for a register write. Take advantage of this in the interrupt driven case, maintaining a list of callers that are waiting for AUXADC conversions and completing them all simultaneously. The external interface of the AUXADC is not changed so there will be limited use of the feature immediately. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Restructure wm8994-core device revision handlingMark Brown
Switch on the device type before revision since anything we do here will be device as well as revision specific. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Allocate wm835x irq descs dynamicallySascha Hauer
This allows boards to leave the irq_base field unitialized and prevents them having to reserve irqs in the platform. pdata can be optional for irq support now. Without pdata the driver allocates some free irq range. With pdata and irq_base > 0 the driver allocates exactly the specified irq. Without pdata the irq defaults to IRQF_TRIGGER_LOW. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Refactor wm831x AUXADC handling into a separate fileMark Brown
In preparation for some additional work on the wm831x AUXADC code move the support into a separate file. This is a simple code motion patch, there should be no functional changes. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Read wm831x AUXADC conversion results before acknowledging interruptMark Brown
Ensure that there's no possibility of loosing an AUXADC interrupt by reading the conversion result in the IRQ handler when using interrupts. Otherwise it's possible that under very heavy load a new conversion could be initiated before the acknowledgement for a previous interrupt has happened. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Support dynamic allocation of IRQ range for wm831xMark Brown
Use irq_allocate_desc() to get the IRQ range, which turns into a noop on non-sparse systems. Since all existing users are non-sparse there should be no compatibility issues. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Only register wm831x RTC device if the 32.768kHz crystal is enabledMark Brown
The RTC uses the 32.768kHz crystal so if it's not enabled (and it can only be enabled via OTP or InstantConfig, not runtime software) the RTC can't function. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Allow touchscreen to be disabled on wm831x devicesMark Brown
Allow platform data to flag the touchscreen as disabled so that if the touch driver is built in we don't end up causing lots of work by spuriously detecting touchscreen activity on systems where it isn't in use. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Implement support for multiple WM831x devicesMark Brown
Systems using this functionality will be uncommon. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-31mfd: Fix bus lock interaction for WM831x IRQ set_type() operationMark Brown
The WM831x IRQ set_type() operation is doing a direct register write when called but since set_type() is called with the bus lock held this isn't legal and could cause deadlocks in the IRQ core. Fix this by posting the updates into an array and syncing in the bus_sync_unlock() callback. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>