aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-05-15mfd: syscon: Add platform data with a regmap config namePawel Moll1-0/+4
Define syscon platform data structure that can be used to define a regmap config name. This is particularly useful in the regmap debugfs when there is more than one syscon device registered, to distinguish the register blocks. Signed-off-by: Pawel Moll <pawel.moll@arm.com> Acked-by: Lee Jones <lee.jones@linaro.org>
2014-05-15mfd: vexpress: Convert custom func API to regmapPawel Moll3-475/+209
Components of the Versatile Express platform (configuration microcontrollers on motherboard and daughterboards in particular) talk to each other over a custom configuration bus. They provide miscellaneous functions (from clock generator control to energy sensors) which are represented as platform devices (and Device Tree nodes). The transactions on the bus can be generated by different "bridges" in the system, some of which are universal for the whole platform (for the price of high transfer latencies), others restricted to a subsystem (but much faster). Until now drivers for such functions were using custom "func" API, which is being replaced in this patch by regmap calls. This required: * a rework (and move to drivers/bus directory, as suggested by Samuel and Arnd) of the config bus core, which is much simpler now and uses device model infrastructure (class) to keep track of the bridges; non-DT case (soon to be retired anyway) is simply covered by a special device registration function * the new config-bus driver also takes over device population, so there is no need for special matching table for of_platform_populate nor "simple-bus" hack in the arm64 model dtsi file (relevant bindings documentation has been updated); this allows all the vexpress devices fit into normal device model, making it possible to remove plenty of early inits and other hacks in the near future * adaptation of the syscfg bridge implementation in the sysreg driver, again making it much simpler; there is a special case of the "energy" function spanning two registers, where they should be both defined in the tree now, but backward compatibility is maintained in the code * modification of the relevant drivers: * hwmon - just a straight-forward API change * power/reset driver - API change * regulator - API change plus error handling simplification * osc clock driver - this one required larger rework in order to turn in into a standard platform driver Signed-off-by: Pawel Moll <pawel.moll@arm.com> Acked-by: Mark Brown <broonie@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Mike Turquette <mturquette@linaro.org>
2014-05-09mfd: stmpe: add optional regulatorsLinus Walleij1-0/+18
The STMPE has VCC and VIO supply lines, and sometimes (as on Ux500) this comes from a software-controlled regulator. Make it possible to supply the STMPE with power from these regulators. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-05-09mfd: stmpe: Probe properly from the Device TreeLinus Walleij2-1/+30
The current STMPE I2C probing code does not really match the compatible strings - it matches node names happening to give the right device name. Instead, let's introduce some real compatible matching, more complex, more accurate. Make the driver depend on OF since all platforms using it are DT-only. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-05-09mfd: stmpe: mask off unused blocks properlyLinus Walleij2-1/+10
The STMPE driver would just read/modify/write the system control register on the STMPE1601, meaning it would not properly mask off the PWM block, which remained active if it was on at boot time. This makes sure the blocks are always masked off if they were active on boot, saving some power. Also rename the inconsistenty named STMPE1601 define for the PWM block activation. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-05-08mmc: rtsx: Revert "mmc: rtsx: add support for pre_req and post_req"Micky Ching1-91/+41
This reverts commit c42deffd5b53c9e583d83c7964854ede2f12410d. commit <mmc: rtsx: add support for pre_req and post_req> did use mutex_unlock() in tasklet, but mutex_unlock() can't be used in tasklet(atomic context). The driver needs to use mutex to avoid concurrency, so we can't use tasklet here, the patch need to be removed. The spinlock host->lock and pcr->lock may deadlock, one way to solve the deadlock is remove host->lock in sd_isr_done_transfer(), but if using workqueue the we can avoid using the spinlock and also avoid the problem. Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-05-06Merge tag 'ib-mfd-omap-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into omap-for-v3.16/pmTony Lindgren1-0/+15
Immutable branch between MFD and ARM OMAP due for v3.16 merge-window.
2014-04-29ASoC: mc13783: Add devicetree supportAlexander Shiyan1-3/+7
This patch adds devicetree support for mc13783-codec. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-30mfd: db8500-prcmu: Use cpufreq_for_each_entry macro for iterationStratos Karafotis1-11/+8
The cpufreq core now supports the cpufreq_for_each_entry macro helper for iteration over the cpufreq_frequency_table, so use it. It should have no functional changes. Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-04-28mfd: rtsx_usb: Add comment in rtsx_usb_suspendRoger Tseng1-0/+6
Explain why there is no need to have a symmetric LED turn-on in resume handler while calling rtsx_usb_turn_off_led() in suspend handler. Signed-off-by: Roger Tseng <rogerable@realtek.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-04-28mfd: rtsx_usb: Fix possible race conditionRoger Tseng1-4/+4
Fix two possible race condition generated by misuse of del_timer in rtsx_usb_bulk_transfer_sglist() and uninitialized timers before mfd_add_devices in rtsx_usb_probe(). Signed-off-by: Roger Tseng <rogerable@realtek.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-04-23mfd: twl-core: Fix idle mode signaling for omaps when booted with device treeTony Lindgren1-0/+15
I noticed a regression where the omap sys_clkreq signal will never trigger for omap3 when booted with device tree while it triggers when booted in legacy mode. This means voltage scaling does not do anything when booted with device tree. Turns out the reason is we fail to initialize the SmartReflex enable bit in twl4030 with the following error: twl: not initialized And that happens because we are wrongly tinkering with the twl4030 registers in arch/arm/mach-omap2/omap_twl.c before the driver is initialized. Looking at the the SmartReflex bit enable code in omap_twl.c, we need to always set it. So let's fix the issue by always enabling the twl4030 SmartReflex bit in the drivers/mfd/twl-core.c probe, and drop the related code in omap_twl.c. Note that we still have some twl4030 tinkering left in omap_twl.c for the twl6030 case, but that's a different patch. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-04-23extcon: max14577: Add support for MAX77836Krzysztof Kozlowski1-0/+1
Add support for MAX77836 chipset to the max14577 extcon driver. The MAX77836 MUIC has additional interrupts (VIDRM, ADC1K) so IRQ handling is split up into two functions: max14577_parse_irq() and max77836_parse_irq(). Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-04-23mfd: max77836: Add MAX77836 support to max14577 driverKrzysztof Kozlowski2-11/+212
Add Maxim 77836 support to max14577 driver. The chipsets have same MUIC component so the extcon, charger and regulators are almost the same. The MAX77836 however has also PMIC and Fuel Gauge. The MAX77836 uses three I2C slave addresses and has additional interrupts (related to PMIC and Fuel Gauge). It has also Interrupt Source register, just like MAX77686 and MAX77693. The MAX77836 PMIC's TOPSYS and INTSRC interrupts are reported in the PMIC block. The PMIC block has different I2C slave address and uses own regmap so another regmap_irq_chip is needed. Since we have two regmap_irq_chip, use shared interrupts on MAX77836. This patch adds additional defines and functions to the max14577 MFD core driver so the driver will handle both chipsets. Also this patch replaces "0x1 << N" with BIT(N) in defines for register masks. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-04-23mfd: max14577: Add MAX14577 prefix to IRQ definesKrzysztof Kozlowski1-12/+12
This patch prepares for adding support for MAX77836 device to existing max14577 driver by adding MAX14577 prefix to defines of interrupts. This is only a rename-like patch, new code is not added. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-04-23mfd: max14577: Add detection of device typeKrzysztof Kozlowski1-19/+45
This patch continues the preparation for adding support for MAX77836 device to existing max14577 driver. Add enum for types of devices supported by this driver. The device type will be detected by matching of_device_id, or i2c_device_id as a fallback. The patch also moves to separate function the code related to displaying DeviceID register values. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-04-23mfd: max14577: Add muic prefix to regmap configKrzysztof Kozlowski1-4/+5
Add muic prefix to regmap config to differentiate between another regmap config for MAX77836 PMIC node. Additionally remove unused symbols: MAX14577_REG_INVALID and max14577_irq_source. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-04-23mfd: tps65090: Stop caching most registersDoug Anderson1-13/+14
Nearly all of the registers in tps65090 combine control bits and status bits. Turn off caching of all registers except the select few that can be cached. In order to avoid adding more duplicate #defines, we also move some register offset definitions to the mfd driver (and resolve inconsistent names). Signed-off-by: Doug Anderson <dianders@chromium.org> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-04-23mfd: tps65090: Don't tell child devices we have an IRQ if we don'tDoug Anderson1-3/+11
If we weren't given an interrupt we shouldn't tell child devices (like the tps65090 charger) that they have an interrupt. This is needed so that we can support polling mode in the tps65090 charger driver. See also (charger: tps65090: Allow charger module to be used when no irq). Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-04-18regulator: arizona-ldo1: Move setup processing from arizona-coreCharles Keepax1-9/+3
It is more idiomatic to process things relating to the regulator in its driver. This patch moves both processing of device tree relating to the regulator and checking if the regulator is external from arizona-core into the regulator driver. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-18mfd: arizona: Factor out read of device tree GPIOsCharles Keepax1-9/+22
This patch factors out the reading of GPIOs for the Arizona devices into a helper function. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-09Merge tag 'mmc-updates-for-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmcLinus Torvalds1-41/+91
Pull MMC updates from Chris Ball: "MMC highlights for 3.15: Core: - CONFIG_MMC_UNSAFE_RESUME=y is now default behavior - DT bindings for SDHCI UHS, eMMC HS200, high-speed DDR, at 1.8/1.2V - Add GPIO descriptor based slot-gpio card detect API Drivers: - dw_mmc: Refactor SOCFPGA support as a variant inside dw_mmc-pltfm.c - mmci: Support HW busy detection on ux500 - omap: Support MMC_ERASE - omap_hsmmc: Support MMC_PM_KEEP_POWER, MMC_PM_WAKE_SDIO_IRQ, (a)cmd23 - rtsx: Support pre-req/post-req async - sdhci: Add support for Realtek RTS5250 controllers - sdhci-acpi: Add support for 80860F16, fix 80860F14/SDIO card detect - sdhci-msm: Add new driver for Qualcomm SDHCI chipset support - sdhci-pxav3: Add support for Marvell Armada 380 and 385 SoCs" * tag 'mmc-updates-for-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (102 commits) mmc: sdhci-acpi: Intel SDIO has broken card detect mmc: sdhci-pxav3: add support for the Armada 38x SDHCI controller mmc: sdhci-msm: Add platform_execute_tuning implementation mmc: sdhci-msm: Initial support for Qualcomm chipsets mmc: sdhci-msm: Qualcomm SDHCI binding documentation sdhci: only reprogram retuning timer when flag is set mmc: rename ARCH_BCM to ARCH_BCM_MOBILE mmc: sdhci: Allow for irq being shared mmc: sdhci-acpi: Add device id 80860F16 mmc: sdhci-acpi: Fix broken card detect for ACPI HID 80860F14 mmc: slot-gpio: Add GPIO descriptor based CD GPIO API mmc: slot-gpio: Split out CD IRQ request into a separate function mmc: slot-gpio: Record GPIO descriptors instead of GPIO numbers Revert "dts: socfpga: Add support for SD/MMC on the SOCFPGA platform" mmc: sdhci-spear: use generic card detection gpio support mmc: sdhci-spear: remove support for power gpio mmc: sdhci-spear: simplify resource handling mmc: sdhci-spear: fix platform_data usage mmc: sdhci-spear: fix error handling paths for DT mmc: sdhci-bcm-kona: fix build errors when built-in ...
2014-04-07Merge tag 'mfd-for-linus-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfdLinus Torvalds60-2022/+2197
Pull MFD updates from Lee Jones: "Changes to existing drivers: - Use of managed resources - omap, twl4030, ti_am335x_tscadc - Advanced error handling - omap - Rework clk management - omap - Device Tree (re-)work - tc3589x, pm8921, da9055, sec - IRC management overhaul and !BROKEN - pm8921 - Convert to regmap - ssbi, pm8921 - Use simple power-management ops - ucb1x00 - Include file clean-up - adp5520, cs5535, janz, lpc_ich, - lpc_sch, max14577, mcp-sa11x0, pcf50633-adc, rc5t583, rdc321x-southbridge, retu, smsc-ece1099, ti-ssp, ti_am335x_tscadc, tps65912, vexpress-config, wm8350, ywm8350 - Various bug fixes across the subsystem - NULL/invalid pointer dereference prevention - Resource leak mitigation, - Variable used initialised - Staticise various containers - Enforce return value checks New drivers/supported devices: - Add support for s2mps14 and s2mpa01 to sec - Add support for da9063 (v5) to da9063 - Add support for atom-c2000 to gpio-ich - Add support for come-{mbt10,cbt6,chl6} to kempld - Add support for da9053 to da9052 - Add support for itco-wdt (v3) and baytrail to lpc_ich - Add new drivers for tps65218, rtsx_usb, bcm590xx (Re-)moved drivers: - twl4030 ==> drivers/iio - ti-ssp ==> /dev/null" * tag 'mfd-for-linus-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (103 commits) mfd: wm5110: Correct default for HEADPHONE_DETECT_1 mfd: arizona: Correct small errors in the DT binding documentation mfd: arizona: Mark DSP clocking register as volatile mfd: devicetree: bindings: Add pm8xxx RTC description mfd: kempld-core: Fix potential hang-up during boot mfd: sec-core: Fix uninitialized 'regmap_rtc' on S2MPA01 mfd: tps65910: Fix regmap_irq_chip_data leak on mfd_add_devices fail mfd: tps65910: Fix possible invalid pointer dereference on regmap_add_irq_chip fail mfd: sec-core: Fix I2C dummy device resource leak on probe failure mfd: sec-core: Add of_compatible strings for clock MFD cells mfd: Remove obsolete ti-ssp driver Documentation: mfd: s2mps11: Describe S5M8767 and S2MPS14 clocks mfd: bcm590xx: Fix type argument for module device table mfd: lpc_ich: Add support for Intel Bay Trail SoC mfd: lpc_ich: Add support for NM10 GPIO mfd: lpc_ich: Change Avoton to iTCO v3 watchdog: iTCO_wdt: Add support for v3 silicon mfd: lpc_ich: Add support for iTCO v3 mfd: lpc_ich: Remove lpc_ich_cfg struct use mfd: lpc_ich: Only configure watchdog or GPIO when present ...
2014-04-05Merge tag 'dt-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds2-25/+36
Pull ARM SoC device tree changes from Arnd Bergmann: "A large part of the arm-soc patches are nowadays DT changes, adding support for new SoCs, boards and devices without changing kernel source. The plan is still to move the devicetree files out of the kernel tree and reduce the amount of churn going on here, but we keep finding reasons to delay doing that. Changes are really all over the place, with little sticking out particularly. We have contributions from a total of 116 people in this branch. Unfortunately, the size of this branch also causes a significant number of conflicts at the moment, typically when subsystem maintainers merge patches that change the driver at the same time as the dts files. In most cases this could be avoided because the dts changes are supposed to be compatible in both ways, and we are asking everyone to send ARM dts changes through our tree only" * tag 'dt-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (541 commits) dts: stmmac: Document the clocks property in the stmmac base document dts: socfpga: Add DTS entry for adding the stmmac glue layer for stmmac. ARM: STi: stih41x: Add support for the FSM Serial Flash Controller ARM: STi: stih416: Add support for the FSM Serial Flash Controller ARM: tegra: fix Dalmore pinctrl configuration ARM: dts: keystone: use common "ti,keystone" compatible instead of -evm ARM: dts: k2hk-evm: set ubifs partition size for 512M NAND ARM: dts: Build all keystone dt blobs ARM: dts: keystone: Fix control register range for clktsip ARM: dts: keystone: Fix domain register range for clkfftc1 ARM: dts: bcm28155-ap: leave camldo1 on to fix reboot ARM: dts: add bcm590xx pmu support and enable for bcm28155-ap ARM: dts: bcm21664: Add device tree files. ARM: DT: bcm21664: Device tree bindings ARM: efm32: properly namespace i2c location property ARM: efm32: fix unit address part in USART2 device nodes' names ARM: mvebu: Enable NAND controller in Armada 385-DB ARM: mvebu: Add support for NAND controller in Armada 38x SoC ARM: mvebu: Add the Core Divider clock to Armada 38x SoCs ARM: mvebu: Add a 2 GHz fixed-clock on Armada 38x SoCs ...
2014-04-01Merge tag 'regulator-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulatorLinus Torvalds2-15/+194
Pull regulator updates from Mark Brown: "This release has lots and lots of small cleanups and fixes in the regulator subsystem, mainly cleaning up some bad patterns that got duplicated in DT code, but otherwise very little of note outside of the scope of the relevant drivers: - Support for configuration of the initial state for gpio regulators with multi-voltage support. - Support for calling regulator_set_voltage() on fixed regulators. - New drivers for Broadcom BCM590xx, Freescale pfuze200, Samsung S2MPA01 & S2MPS11/4, some PWM controlled regulators found on some ST boards and TI TPS65218" * tag 'regulator-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (154 commits) regulator: aat2870: Use regulator_map_voltage_ascend regulator: st-pwm: Convert to get_voltage_sel regulator: Add new driver for ST's PWM controlled voltage regulators regulator: bcm590xx: Remove **rdev from struct bcm590xx_reg regulator: bcm590xx: Make the modalias matches the driver name regulator: s5m8767: Convert to use regulator_[enable|disable|is_enabled]_regmap regulator: db8500-prcmu: Set 1.8V as a fixed voltage for vsmps2 regulator: s2mps11: Add missing of_node_put regulator: s2mps11: Use of_get_child_by_name Documentation: mfd: s2mps11: Document support for S2MPS14 regulator: s2mps11: Add set_suspend_disable for S2MPS14 regulator: s2mps11: Add support for S2MPS14 regulators regulator: max8660: Fix brace alignment regulator: dbx500: use seq_puts() instead of seq_printf() regulator: dbx500-prcmu: Silence checkpatch warnings regulator: anatop: Remove checking control_reg in [set|get]_voltage_sel regulator: max8952: Silence checkpatch warning regulator: max8925: Silence checkpatch warning regulator: max8660: Silence checkpatch warnings regulator: arizona-ldo1: Correct default regulator init_data ...
2014-03-31mfd: wm5110: Correct default for HEADPHONE_DETECT_1Charles Keepax1-1/+1
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-31mfd: arizona: Mark DSP clocking register as volatileCharles Keepax2-0/+5
The DSPs will often control there own clock speeds whilst running as such we should mark the registers controlling this as volatile. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-28Merge remote-tracking branches 'regmap/topic/cache', 'regmap/topic/irq', 'regmap/topic/lock', 'regmap/topic/mmio', 'regmap/topic/nodev', 'regmap/topic/parse-val' and 'regmap/topic/patch' into regmap-nextMark Brown2-21/+4
2014-03-20mfd: kempld-core: Fix potential hang-up during bootGuenter Roeck1-2/+5
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. Cc: <stable@vger.kernel.org> 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>
2014-03-20mfd: sec-core: Fix uninitialized 'regmap_rtc' on S2MPA01Krzysztof Kozlowski1-0/+7
Initialize the 'regmap_rtc' on S2MPA01 to some sane value. Sane at least for S5M87X chipsets, not S2MPS/S2MPA but it won't be used because rtc-s5m driver does not support S2MPA01. This fixes following error: drivers/mfd/sec-core.c:342:45: warning: ‘regmap_rtc’ may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: tps65910: Fix regmap_irq_chip_data leak on mfd_add_devices failKrzysztof Kozlowski1-0/+1
The tps65910_i2c_probe() allocates regmap_irq_chip in tps65910_irq_init() but it does not clean this up in case of mfd_add_devices() failure. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: tps65910: Fix possible invalid pointer dereference on regmap_add_irq_chip failKrzysztof Kozlowski1-1/+3
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. 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: sec-core: Fix I2C dummy device resource leak on probe failureKrzysztof Kozlowski1-3/+4
Dummy I2C device allocated in sec_pmic_probe() leaked if devm_regmap_init_i2c() failed. Unregister it before returning from probe. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: sec-core: Add of_compatible strings for clock MFD cellsKrzysztof Kozlowski1-0/+3
Add of_compatible strings for S5M8767 and S2MPS14 clock MFD cells. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: Remove obsolete ti-ssp driverArnd Bergmann3-476/+0
The tnetv107x platform is getting removed, so this driver is not needed any more. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Sekhar Nori <nsekhar@ti.com> Acked-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: bcm590xx: Fix type argument for module device tableAxel Lin1-1/+1
This fixes below build error. FATAL: drivers/mfd/bcm590xx: sizeof(struct i2c_device_id)=24 is not a modulo of the size of section __mod_i2c_device_table=392. Fix definition of struct i2c_device_id in mod_devicetable.h make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: lpc_ich: Add support for Intel Bay Trail SoCPeter Tyser1-0/+6
This patch adds the LPC Controller Device IDs for Watchdog and GPIO for the Intel Bay Trail Atom SoC. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: lpc_ich: Add support for NM10 GPIOPeter Tyser1-0/+1
The NM10's GPIO is compatible with ICH v7 GPIO. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Tested-by: Dan Weinlader <danw@vs-networks.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: lpc_ich: Change Avoton to iTCO v3Peter Tyser1-1/+1
The register layout of the Avoton is compatible with the iTCO v3 register layout. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Tested-by: Rajat Jain <rajatjain@juniper.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: lpc_ich: Add support for iTCO v3Peter Tyser1-14/+67
Some newer Atom CPUs, eg Avoton and Bay Trail, use slightly different register layouts for the iTCO than the current v1 and v2 iTCO. Differences from previous iTCO versions include: - The ACPI space is enabled in the "ACPI base address" register instead of the "ACPI control register" - The "no reboot" functionality is set in the "Power Management Configuration" register instead of the "General Control and Status" (GCS) register or PCI configuration space. - The "ACPI Control Register" is not present on v3. The "Power Management Configuration Base Address" register resides at the same address is Avoton/Bay Trail. To differentiate these newer chipsets create a new v3 iTCO version and update the MFD driver to support them. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Tested-by: Rajat Jain <rajatjain@juniper.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: lpc_ich: Remove lpc_ich_cfg struct usePeter Tyser1-31/+32
Future chipsets will use different register layouts that don't map cleanly to the lpc_ich_cfg fields. Remove the lpc_ich_cfg struct and add explicit fields to the higher level lpc_ich_priv structure. This change should have no functional impact. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Tested-by: Rajat Jain <rajatjain@juniper.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: lpc_ich: Only configure watchdog or GPIO when presentPeter Tyser1-6/+10
Some chipsets don't currently have GPIO support enabled. For these chipsets don't go through the process of initializing the GPIO region. Make the same change for the watchdog initialization for chipsets which may not enable the WDT in the future. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Tested-by: Rajat Jain <rajatjain@juniper.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: lpc_ich: Fix ACPI enable bitmaskPeter Tyser1-1/+1
The original bitmask of 0x10 was incorrect and would result in a write to a reserved read-only bit instead of enabling the ACPI I/O region. Update it to the proper value of 0x80. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Tested-by: Rajat Jain <rajatjain@juniper.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: Add bcm590xx pmu driverMatt Porter3-0/+102
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>
2014-03-19mfd: max14577: Select REGMAP_IRQKrzysztof Kozlowski1-0/+1
MAXIM 14577 MFD driver uses the regmap_irq_chip so it's Kconfig entry should select REGMAP_IRQ. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: twl-core: Fix accessibility of some twl4030 audio registersTomas Novotny1-5/+5
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). Cc: stable@vger.kernel.org Signed-off-by: Tomas Novotny <tomas@novotny.cz> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: tps65218: Fix reported randconfig errorLee Jones1-0/+1
Reported error was: ERROR: "regmap_del_irq_chip" [drivers/mfd/tps65218.ko] undefined! when CONFIG_REGMAP_IRQ is not enabled. Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: syscon: Simplify syscon_match_pdevname()Alexander Shiyan1-7/+0
Since we do not want to add new platform IDs for the syscon driver, there is no reason to iterate over IDs. This patch simplifies syscon_match_pdevname() function to remove such iteration. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: pm8921: Fixup probe() error path when irq invalidJosh Cartwright1-2/+1
platform_get_irq() returns a negative error code when an IRQ is invalid or unspecified. Make 'irq' signed to properly handle this. Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Josh Cartwright <joshc@codeaurora.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: da9055: Add DT support for PMICAdam Thomson1-0/+8
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>