aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd
AgeCommit message (Collapse)Author
2014-06-18mfd: twl-core: Fix accessibility of some twl4030 audio registersTomas Novotny
commit 56816b700c8c773270f3aaf4c92be53e359a03fd upstream. There are some unused registers in twl4030 at I2C address 0x49 and function twl4030_49_nop_reg() is used to check accessibility of that registers. These registers are written in decimal format but the values are correct in hexadecimal format. (It can be checked few lines above the patched code - these registers are marked as unused there.) As a consequence three registers of audio submodule are treated as inaccessible (preamplifier carkit right and both handsfree registers). Signed-off-by: Tomas Novotny <tomas@novotny.cz> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mfd: kempld-core: Fix potential hang-up during bootGuenter Roeck
commit 204747c970c0d568721c76ab8a57dde0e5dcf0d5 upstream. On PXT and COMe-cPC2 boards it is observed that the hardware mutex is acquired but not being released during initialization. This can result in a hang-up during boot if the driver is built into the kernel. Releasing the mutex twice if it was acquired fixes the problem. Subsequent request/release cycles work as expected, so the fix is only needed during initialization. Reviewed-by: Michael Brunner <michael.brunner@kontron.com> Tested-by: Michael Brunner <michael.brunner@kontron.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mfd: tps65910: Fix possible invalid pointer dereference on ↵Krzysztof Kozlowski
regmap_add_irq_chip fail commit 483e2dfdbc94751430e41db9973985f5b054d322 upstream. Fixes: 4aab3fadad32 ("mfd: tps65910: Move interrupt implementation code to mfd file") tps65910_irq_init() sets 'tps65910->chip_irq' before calling regmap_add_irq_chip(). If the regmap_add_irq_chip() call fails in memory allocation of regmap_irq_chip_data members then: 1. The 'tps65910->chip_irq' will still hold some value 2. 'tps65910->irq_data' will be pointing to already freed memory (because regmap_add_irq_chip() will free it on error) This results in invalid memory access during driver remove because the tps65910_irq_exit() tests whether 'tps65910->chip_irq' is not zero. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mfd: max8997: Fix possible NULL pointer dereference on i2c_new_dummy errorKrzysztof Kozlowski
commit 97dc4ed3fa377ec91bb60ba98b70d645c2099384 upstream. During probe the driver allocates dummy I2C devices for RTC, haptic and MUIC with i2c_new_dummy() but it does not check the return value of this calls. 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 i2c_unregister_device(). If i2c_new_dummy() fails for RTC, haptic or MUIC devices, fail also the probe for main MFD driver. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mfd: max8998: Fix possible NULL pointer dereference on i2c_new_dummy errorKrzysztof Kozlowski
commit ed26f87b9f71693a1d1ee85f5e6209601505080f upstream. During probe the driver allocates dummy I2C device for RTC 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 i2c_unregister_device(). If i2c_new_dummy() fails for RTC device, fail also the probe for main MFD driver. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mfd: max8925: Fix possible NULL pointer dereference on i2c_new_dummy errorKrzysztof Kozlowski
commit 96cf3dedc491d2f1f66cc26217f2b06b0c7b6797 upstream. During probe the driver allocates dummy I2C devices for RTC and ADC with i2c_new_dummy() but it does not check the return value of this calls. 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 i2c_unregister_device(). If i2c_new_dummy() fails for RTC or ADC devices, fail also the probe for main MFD driver. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mfd: max77693: Fix possible NULL pointer dereference on i2c_new_dummy errorKrzysztof Kozlowski
commit ad09dd6a1f5d6244bd89314015af506ba7f9810a upstream. During probe the driver allocates dummy I2C devices for MUIC and haptic with i2c_new_dummy() but it does not check the return value of this calls. 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 devm_regmap_init_i2c() and i2c_unregister_device(). If i2c_new_dummy() fails for MUIC or haptic devices, fail also the probe for main MFD driver. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mfd: max77686: Fix possible NULL pointer dereference on i2c_new_dummy errorKrzysztof Kozlowski
commit b9e183a1d495cd65412abe0f9df19b151716bfe7 upstream. During probe the driver allocates dummy I2C device for RTC 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 i2c_unregister_device(). If i2c_new_dummy() fails for RTC device, fail also the probe for main MFD driver. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mfd: 88pm800: Fix I2C device resource leak if probe failsKrzysztof Kozlowski
commit 141050cf3d84fc303df58796d68dc1376b0e8f67 upstream. During probe the driver allocates two dummy I2C devices for subchips in function pm800_pages_init(). Additionally this function allocates regmaps for these subchips. If any of these steps fail then these dummy I2C devices are not freed and resources leak. On pm800_pages_init() fail the driver must call pm800_pages_exit() to unregister dummy I2C devices. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mfd: 88pm860x: Fix I2C device resource leak on regmap init failKrzysztof Kozlowski
commit a7ab1c8b261305af583ce26bb4a14f555fdaa73e upstream. 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. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mfd: 88pm860x: Fix possible NULL pointer dereference on i2c_new_dummy errorKrzysztof Kozlowski
commit 159ce52a6b777fc82fa0b51c7440e25f9e4c6feb upstream. 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. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mfd: sec-core: Fix possible NULL pointer dereference when i2c_new_dummy errorKrzysztof Kozlowski
commit 65aba1e04916d72b30c028730a1e31860c225412 upstream. During probe the sec-core driver allocates dummy I2C device for RTC with i2c_new_dummy() but return value is not checked. 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 devm_regmap_init_i2c() or i2c_unregister_device(). If i2c_new_dummy() fails for RTC device, fail also the probe for main MFD driver. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16mfd: Support HiSilicon Hi6421 PMICGuodong Xu
Add support of HiSilicon Hi6421 in mfd. Hi6421 is a power management and codec IC from HiSilicon Inc., which includes regulators, codec, ADCs, Coulomb counter, etc. The way to communitcate with Hi6421 is through memory mapped I/O ports. Signed-off-by: Guodong Xu <guodong.xu@linaro.org> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2014-03-31mfd: Add bcm590xx pmu driverMatt Porter
Add a driver for the BCM590xx PMU multi-function devices. The driver initially supports regmap initialization and instantiation of the voltage regulator device function of the PMU. Signed-off-by: Matt Porter <mporter@linaro.org> Reviewed-by: Tim Kryger <tim.kryger@linaro.org> Reviewed-by: Markus Mayer <markus.mayer@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> (cherry picked from commit 4e5d0892c4e44de4c48669a302bf52eaa4246055)
2014-02-21Merge tag 'sound-3.14-rc4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "This time we got a slightly higher volume than previous times, but all device-specific good fixes. Noticeable changes are fixes in davinci, and the removal of open-codes in HD-audio ca0132 driver. The rest are all small fixes and/or quirks" * tag 'sound-3.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Enable front audio jacks on one HP desktop model ALSA: hda/ca0132 - Fix recording from mode id 0x8 ALSA: hda/ca0132 - setup/cleanup streams ALSA: hda - add headset mic detect quirks for two Dell laptops ALSA: usb-audio: work around KEF X300A firmware bug ASoC: max98090: make REVISION_ID readable ASoC: txx9aclc_ac97: Fix kernel crash on probe ASoC: max98090: sync regcache on entering STANDBY ASoC: blackfin: Fix machine driver Kconfig dependencies ASoC: da9055: Fix device registration of PMIC and CODEC devices ASoC: fsl-esai: fix ESAI TDM slot setting ASoC: fsl: fix pm support of machine drivers ASoC: rt5640: Add ACPI ID for Intel Baytrail ASoC: davinci-evm: Add pm callbacks to platform driver ASoC: davinci-mcasp: Consolidate pm_runtime_get/put() use in the driver ASoC: davinci-mcasp: Configure xxTDM, xxFMT and xxFMCT registers synchronously ASoC: davinci-mcasp: Harmonize the sub hw_params function names ASoC: samsung: Fix trivial typo ASoC: samsung: Remove invalid dependencies ASoC: wm8993: drop regulator_bulk_free of devm_ allocated data
2014-02-19mfd: sec-core: sec_pmic_{suspend,resume}() should depend on CONFIG_PM_SLEEPGeert Uytterhoeven
If CONFIG_PM_SLEEP=n: drivers/mfd/sec-core.c:349: warning: ‘sec_pmic_suspend’ defined but not used drivers/mfd/sec-core.c:371: warning: ‘sec_pmic_resume’ defined but not used Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-02-19mfd: max14577: max14577_{suspend,resume}() should depend on CONFIG_PM_SLEEPGeert Uytterhoeven
If CONFIG_PM_SLEEP=n: drivers/mfd/max14577.c:177: warning: ‘max14577_suspend’ defined but not used drivers/mfd/max14577.c:200: warning: ‘max14577_resume’ defined but not used Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-02-19mfd: tps65217: Naturalise cross-architecture discrepanciesLee Jones
If we compile the TPS65217 for a 64bit architecture we receive the following warnings: drivers/mfd/tps65217.c: In function ‘tps65217_probe’: drivers/mfd/tps65217.c:173:13: warning: cast from pointer to integer of different size chip_id = (unsigned int)match->data; ^ Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-02-19mfd: wm8994-core: Naturalise cross-architecture discrepanciesLee Jones
If we compile the WM8994 for a 64bit architecture we receive the following warnings: drivers/mfd/wm8994-core.c: In function ‘wm8994_i2c_probe’: drivers/mfd/wm8994-core.c:639:19: warning: cast from pointer to integer of different size wm8994->type = (int)of_id->data; ^ Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-02-19mfd: max8998: Naturalise cross-architecture discrepanciesLee Jones
If we compile the MAX8998 for a 64bit architecture we receive the following warnings: drivers/mfd/max8998.c: In function ‘max8998_i2c_get_driver_data’: drivers/mfd/max8998.c:178:10: warning: cast from pointer to integer of different size return (int)match->data; ^ Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-02-19mfd: max8997: Naturalise cross-architecture discrepanciesLee Jones
If we compile the MAX8997 for a 64bit architecture we receive the following warnings: drivers/mfd/max8997.c: In function ‘max8997_i2c_get_driver_data’: drivers/mfd/max8997.c:173:10: warning: cast from pointer to integer of different size return (int)match->data; ^ Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-02-10ASoC: da9055: Fix device registration of PMIC and CODEC devicesAdam Thomson
Currently the I2C device Ids conflict for the MFD and CODEC so cannot be both instantiated on one platform. This patch updates the Ids and names to make them unique from each other. It should be noted that the I2C addresses for both PMIC and CODEC are modifiable so instantiation of the two are kept as separate devices, rather than instantiating the CODEC from the MFD code. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Acked-by: Mark Brown <broonie@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2014-01-25Merge tag 'regulator-v3.14-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "A respin of the merges in the previous pull request with one extra fix. A quiet release for the regulator API, quite a large number of small improvements all over but other than the addition of new drivers for the AS3722 and MAX14577 there is nothing of substantial non-local impact" * tag 'regulator-v3.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (47 commits) regulator: pfuze100-regulator: Improve dev_info() message regulator: pfuze100-regulator: Fix some checkpatch complaints regulator: twl: Fix checkpatch issue regulator: core: Fix checkpatch issue regulator: anatop-regulator: Remove unneeded memset() regulator: s5m8767: Update LDO index in s5m8767-regulator.txt regulator: as3722: set enable time for SD0/1/6 regulator: as3722: detect SD0 low-voltage mode regulator: tps62360: Fix up a pointer-integer size mismatch warning regulator: anatop-regulator: Remove unneeded kstrdup() regulator: act8865: Fix build error when !OF regulator: act8865: register all regulators regardless of how many are used regulator: wm831x-dcdc: Remove unneeded 'err' label regulator: anatop-regulator: Add MODULE_ALIAS() regulator: act8865: fix incorrect devm_kzalloc for act8865 regulator: act8865: Remove set_suspend_[en|dis]able implementation regulator: act8865: Remove unneeded regulator_unregister() calls regulator: s2mps11: Clean up redundant code regulator: tps65910: Simplify setting enable_mask for regulators regulator: act8865: add device tree binding doc ...
2014-01-23drivers/mfd/tps65217.c: fix pointer-integer size mismatch warning in ↵David Howells
tps65217_probe() Fix up the following pointer-integer size mismatch warning in tps65217_probe(): drivers/mfd/tps65217.c: In function 'tps65217_probe': drivers/mfd/tps65217.c:173:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] chip_id = (unsigned int)match->data; ^ Signed-off-by: David Howells <dhowells@redhat.com> Cc: AnilKumar Ch <anilkumar@ti.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-01-23drivers/mfd/max8998.c: fix pointer-integer size mismatch warning in ↵David Howells
max8998_i2c_get_driver_data() Fix up the following pointer-integer size mismatch warning in max8998_i2c_get_driver_data(): drivers/mfd/max8998.c: In function 'max8998_i2c_get_driver_data': drivers/mfd/max8998.c:178:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] return (int)match->data; ^ Signed-off-by: David Howells <dhowells@redhat.com> Cc: Tomasz Figa <t.figa@samsung.com> Cc: Mark Brown <broonie@linaro.org> Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-01-23Merge remote-tracking branches 'regulator/topic/s2mps11', ↵Mark Brown
'regulator/topic/s5m8767', 'regulator/topic/stw481x-vmmc', 'regulator/topic/tps51632', 'regulator/topic/tps62360', 'regulator/topic/tps65910', 'regulator/topic/twl' and 'regulator/topic/wm831x' into regulator-linus
2014-01-23Merge remote-tracking branches 'regulator/topic/db8500', ↵Mark Brown
'regulator/topic/gpio', 'regulator/topic/lp3971', 'regulator/topic/lp3972', 'regulator/topic/max14577', 'regulator/topic/max77693', 'regulator/topic/mc13892', 'regulator/topic/pcf50633' and 'regulator/topic/pfuze100' into regulator-linus
2014-01-21Merge tag 'mfd-3.14-1' of git://git.linaro.org/people/ljones/mfdLinus Torvalds
Pull MFD changes from Lee Jones: "New drivers - Samsung Maxim 14577; Micro USB, Regulator, IRQ Controller and Battery Charger - TI/National Semiconductor LP3943 I2C GPIO Expander and PWM Generator Existing driver adaptions - Expansion of Wolfson Arizona DSP and High-Pass filter controls - TI TWL6040 default Regmap support and Regcache addition/bypass - Some nice Smatch catch fixes - Conversion of TI OMAP-USB and TI TWL6030 to endian neutralness - ChromeOS EC timing (delay) adaptions and added dependency on OF - Many constifications of 'struct {mfd_cell,regmap_irq,et.al}' - Watchdog support added for NVIDIA AS3722 - Convert functions to static in TI AM335x - Realigned previously defeated functionality in TI AM335x - IIO ADC-TSC concurrency dead-lock/timeout resolution - Addition of Power Management and Clock support for Samsung core - DEFINE_PCI_DEVICE_TABLE macro removal from MFD Subsystem - Greater use of irqdomain functionality in ST-E AB8500 - Removal of 'include/linux/mfd/abx500/ab8500-gpio.h' - Wolfson WM831x PMIC Power Management changes s/poweroff/shutdown/ - Device Tree documentation added for TI/Nat Semi LP3943 - Version detection and voltage tables for TI TPS6586x PMIC devices - Simplification of Freescale MC13XXX (de-)initialisation routines - Clean-up and simplification of the Realtek parent driver - Added support for RTL8402 Realtek PCI-Express card reader - Resource leak fix for Maxim 77686 - Possible suspend BUG() fix in OMAP USB TLL - Support for new Wolfson WM5110 Revision (D) - Testing of automatic assignment of of_node in mfd_add_device() - Reversion of the above when it started to cause issues - Remove legacy Platform Data from; TI TWL Core, Qualcomm SSBI and ST-E ABx500 Pinctrl - Clean-ups; tabbing issues, function name changes, 'drvdata = NULL' removal, unused uninitialised warning mitigation, error message clarity, removal of redundant/duplicate checks, licensing (GPL -> GPL2), coding consistency, duplicate function declaration, ret checks, commit corrections, redundant of_match_ptr() helper removal, spelling, #if-deffery removal and header guards name changes" * tag 'mfd-3.14-1' of git://git.linaro.org/people/ljones/mfd: (78 commits) mfd: wm5110: Add register patch for rev D chip mfd: omap-usb-tll: Don't hold lock during pm_runtime_get/put_sync() gpio: lp3943: Remove redundant of_match_ptr helper mfd: sta2x11-mfd: Use named constants for pci_power_t values Documentation: mfd: Fix LDO index in s2mps11.txt mfd: Cleanup mfd-mcp-sa11x0.h header mfd: max8997: Use "IS_ENABLED(CONFIG_OF)" for DT code. mfd: twl6030: Fix endianness problem in IRQ handler mfd: sec-core: Add cells for S5M8767-clocks mfd: max14577: Remove redundant of_match_ptr helper mfd: twl6040: Fix sparse non static symbol warning mfd: Revert "mfd: Always assign of_node in mfd_add_device()" mfd: rtsx: Fix sparse non static symbol warning mfd: max77693: Set proper maximum register for MUIC regmap mfd: max77686: Fix regmap resource leak on driver remove mfd: Represent correct filenames in file headers mfd: rtsx: Add support for card reader rtl8402 mfd: rtsx: Add set pull control macro and simplify rtl8411 mfd: max8997: Enforce mfd_add_devices() return value check mfd: mc13xxx: Simplify probe() & remove() ...
2014-01-21mfd: wm5110: Add register patch for rev D chipCharles Keepax
Evaluation of revision D of WM5110 suggests updates to the register patch for optimal performance. For the sake of clarity rev C of the chip does not require a register patch. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: omap-usb-tll: Don't hold lock during pm_runtime_get/put_sync()Roger Quadros
pm_runtime_get/put_sync() can sleep so don't hold spinlock while calling them. This patch prevents a BUG() during system suspend when CONFIG_DEBUG_ATOMIC_SLEEP is enabled. Bug is present in Kernel versions v3.9 onwards. Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Tested-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: sta2x11-mfd: Use named constants for pci_power_t valuesJulia Lawall
If nothing more than to improve code readability. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression pdev; @@ pci_set_power_state(pdev, - 0 + PCI_D0 ) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: max8997: Use "IS_ENABLED(CONFIG_OF)" for DT code.Manish Badarkhe
Instead of "#if define CONFIG_OF" use "IS_ENABLED(CONFIG_OF)" option for DT code to avoid if-deffery in code. Signed-off-by: Manish Badarkhe <badarkhe.manish@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: twl6030: Fix endianness problem in IRQ handlerDanke Xie
The current TWL 6030 IRQ handler assumes little endianness. This change makes it endian-neutral. Signed-off-by: Danke Xie <d.xie@sta.samsung.com> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: sec-core: Add cells for S5M8767-clocksTushar Behera
S5M8767 chip has 3 crystal oscillators running at 32KHz. These are supported by s2mps11-clk driver. Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: max14577: Remove redundant of_match_ptr helperSachin Kamat
'max14577_dt_match' is always compiled in. Hence the helper macro is not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: twl6040: Fix sparse non static symbol warningWei Yongjun
Fixes the following sparse warning: drivers/mfd/twl6040.c:89:20: warning: symbol 'twl6040_patch' was not declared. Should it be static? Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: Revert "mfd: Always assign of_node in mfd_add_device()"Lee Jones
This reverts commit 68044bee13770918e0b28dd44aa98c889ec7558f. We've had confirmed reports of this patch causing unforeseen issues with existing MFD users. It has been agreed by the original author and myself that reversion is the best solution. Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: rtsx: Fix sparse non static symbol warningWei Yongjun
Fixes the following sparse warning: drivers/mfd/rtl8411.c:473:6: warning: symbol 'rtl8411_init_common_params' was not declared. Should it be static? Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: max77693: Set proper maximum register for MUIC regmapKrzysztof Kozlowski
The MUIC block in max77693 has different I2C address than PMIC. The driver allocated two regmaps: for PMIC and MUIC. However it used the same regmap_config (with max_register field) for both regmaps. Actual maximum address of register for MUIC is different than for PMIC. Define another regmap_config for MUIC with proper max_register value. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: max77686: Fix regmap resource leak on driver removeKrzysztof Kozlowski
The regmap used by max77686 MFD driver was not freed with regmap_exit() on driver exit. This lead to leak of resources. Replace regmap_init_i2c() call in driver probe with initialization of managed register map so the regmap will be properly freed by the device management code. Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: rtsx: Add support for card reader rtl8402Micky Ching
rtl8402 is much like rtl8411, so just add it to rtl8411.c Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: rtsx: Add set pull control macro and simplify rtl8411Micky Ching
Add set pull control macro to reduce code for setting pull control, and use a common init function to reduce code for rtl8411.c. So this patch is used to just simplify code. Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: max8997: Enforce mfd_add_devices() return value checkLaszlo Papp
The original author provided a random return value check which is redundant and seemingly floating. This patch not only relocates the check so it is more clearly associated with the invokation of mfd_add_devices(), but provides a store for the error value. We also print a meaningful message on error before returning. Signed-off-by: Laszlo Papp <lpapp@kde.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: mc13xxx: Simplify probe() & remove()Alexander Shiyan
This patch simplifies probe() and remove() functions by moving some initialisation code out from the I2C/SPI init() and exit() functions and into the core driver. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: mc13xxx: Remove useless symbol MFD_MC13783Alexander Shiyan
Symbol MFD_MC13783 always selected by MFD_MC13XXX, so no need to keep additional symbol. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: ssbi: Mark match table constStephen Boyd
This is a read-only data structure. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: ssbi: Constify buffer in ssbi_writeStephen Boyd
In preparation for passing a const pointer directly to ssbi_write() from the regmap APIs. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: ssbi: Remove platform data structs and hide ssbi type enumStephen Boyd
The ssbi driver assumes that the device is DT based. Remove the platform data structs that will never be used and hide the enum in the only C file that uses it. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: Always assign of_node in mfd_add_device()Stephen Warren
mfd_add_device() assigns .of_node in the device objects it creates only if the mfd_cell for the device has the .of_compatible field set and the DT node for the top-level MFD device contains a child whose compatible property matches the cell's .of_compatible field. This leaves .of_node unset in many cases. When this happens, entries in the DT /aliases property which refer to the top-level MFD DT node will never match the MFD child devices, hence causing the requested alias not to be honored. Solve this by setting each MFD child device's .of_node equal to the top- level MFD device's .of_node field in the cases where it would otherwise remain unset. The first use-case for this will be aliases for the TPS6586x's RTC device. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: cros ec: spi: Add delay for raising CSRhyland Klein
The EC has specific timing it requires. Add support for an optional delay after raising CS to fix timing issues. This is configurable based on a DT property "google,cros-ec-spi-msg-delay". If this property isn't set, then no delay will be added. However, if set it will cause a delay equal to the value passed to it to be inserted at the end of a transaction. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Reviewed-by: Bernie Thompson <bhthompson@chromium.org> Reviewed-by: Andrew Bresticker <abrestic@chromium.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>