summaryrefslogtreecommitdiff
path: root/drivers/mfd
AgeCommit message (Collapse)Author
2016-05-17Merge tag 'gpio-v4.7-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO updates from Linus Walleij: "This is the bulk of GPIO changes for kernel cycle v4.7: Core infrastructural changes: - Support for natively single-ended GPIO driver stages. This means that if the hardware has registers to configure open drain or open source configuration, we use that rather than (as we did before) try to emulate it by switching the line to an input to get high impedance. This is also documented throughly in Documentation/gpio/driver.txt for those of you who did not understand one word of what I just wrote. - Start to do away with the unnecessarily complex and unitelligible ARCH_REQUIRE_GPIOLIB and ARCH_WANT_OPTIONAL_GPIOLIB, another evolutional artifact from the time when the GPIO subsystem was unmaintained. Archs can now just select GPIOLIB and be done with it, cleanups to arches will trickle in for the next kernel. Some minor archs ACKed the changes immediately so these are included in this pull request. - Advancing the use of the data pointer inside the GPIO device for storing driver data by switching the PowerPC, Super-H Unicore and a few other subarches or subsystem drivers in ALSA SoC, Input, serial, SSB, staging etc to use it. - The initialization now reads the input/output state of the GPIO lines, so that each GPIO descriptor knows - if this callback is implemented - whether the line is input or output. This also reflects nicely in userspace "lsgpio". - It is now possible to name GPIO producer names, line names, from the device tree. (Platform data has been supported for a while). I bet we will get a similar mechanism for ACPI one of those days. This makes is possible to get sensible producer names for e.g. GPIO rails in "lsgpio" in userspace. New drivers: - New driver for the Loongson1. - The XLP driver now supports Broadcom Vulcan ARM64. - The IT87 driver now supports IT8620 and IT8628. - The PCA953X driver now supports Galileo Gen2. Driver improvements: - MCP23S08 was switched to use the gpiolib irqchip helpers and now also suppors level-triggered interrupts. - 74x164 and RCAR now supports the .set_multiple() callback - AMDPT was converted to use generic GPIO. - TC3589x, TPS65218, SX150X, F7188X, MENZ127, VX855, WM831X, WM8994 support the new single ended callback for open drain and in some cases open source. - Implement the .get_direction() callback for a few more drivers like PL061, Xgene. Cleanups: - Paul Gortmaker combed through the drivers and de-modularized those who are not really modules. - Move the GPIO poweroff DT bindings to the power subdir where they belong. - Rename gpio-generic.c to gpio-mmio.c, which is much more to the point. That's what it is handling, nothing more, nothing less" * tag 'gpio-v4.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (126 commits) MIPS: do away with ARCH_[WANT_OPTIONAL|REQUIRE]_GPIOLIB gpio: zevio: make it explicitly non-modular gpio: timberdale: make it explicitly non-modular gpio: stmpe: make it explicitly non-modular gpio: sodaville: make it explicitly non-modular pinctrl: sh-pfc: Let gpio_chip.to_irq() return zero on error gpio: dwapb: Add ACPI device ID for DWAPB GPIO controller on X-Gene platforms gpio: dt-bindings: add wd,mbl-gpio bindings gpio: of: make it possible to name GPIO lines gpio: make gpiod_to_irq() return negative for NO_IRQ gpio: xgene: implement .get_direction() gpio: xgene: Enable ACPI support for X-Gene GFC GPIO driver gpio: tegra: Implement gpio_get_direction callback gpio: set up initial state from .get_direction() gpio: rename gpio-generic.c into gpio-mmio.c gpio: generic: fix GPIO_GENERIC_PLATFORM is set to module case gpio: dwapb: add gpio-signaled acpi event support gpio: dwapb: convert device node to fwnode gpio: dwapb: remove name from dwapb_port_property gpio/qoriq: select IRQ_DOMAIN ...
2016-05-17Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (21 commits) gitignore: fix wording mfd: ab8500-debugfs: fix "between" in printk memstick: trivial fix of spelling mistake on management cpupowerutils: bench: fix "average" treewide: Fix typos in printk IB/mlx4: printk fix pinctrl: sirf/atlas7: fix printk spelling serial: mctrl_gpio: Grammar s/lines GPIOs/line GPIOs/, /sets/set/ w1: comment spelling s/minmum/minimum/ Blackfin: comment spelling s/divsor/divisor/ metag: Fix misspellings in comments. ia64: Fix misspellings in comments. hexagon: Fix misspellings in comments. tools/perf: Fix misspellings in comments. cris: Fix misspellings in comments. c6x: Fix misspellings in comments. blackfin: Fix misspelling of 'register' in comment. avr32: Fix misspelling of 'definitions' in comment. treewide: Fix typos in printk Doc: treewide : Fix typos in DocBook/filesystem.xml ...
2016-04-29gpio: dwapb: convert device node to fwnodeJiang Qiu
This patch converts device node to fwnode for dwapb driver, so as to provide a unified fwnode for DT and ACPI bindings. Tested-by: Alan Tull <delicious.quinoa@gmail.com> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Jiang Qiu <qiujiang@huawei.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-04-29gpio: dwapb: remove name from dwapb_port_propertyJiang Qiu
This patch removed the name property from dwapb_port_property. The name property is redundant, since we can get this info from dwapb_gpio dev node. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Jiang Qiu <qiujiang@huawei.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-04-28mfd: ab8500-debugfs: fix "between" in printkColin Ian King
fix spelling mistake, beetween -> between Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-04-09device property: don't bother the drivers with struct property_setHeikki Krogerus
Since device_add_property_set() now always takes a copy of the property_set, and also since the fwnode type is always hard coded to be FWNODE_PDATA, there is no need for the drivers to deliver the entire struct property_set. The function can just create the instance of it on its own and bind the properties from the drivers to it on the spot. This renames device_add_property_set() to device_add_properties(). The function now takes struct property_entry as its parameter instead of struct property_set. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Thierry Reding <treding@nvidia.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-03-18Merge tag 'mfd-for-linus-4.6' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Drivers: - Freescale Touch Screen ADC - X-Powers AXP PMIC with RSB - TI TPS65086 Power Management IC (PMIC) New Device Support: - Supply device PCI IDs for Intel Broxton Fix-ups: - Move to clkdev_create() API; intel_quark_i2c_gpio - Complete re-write of TI's TPS65912 Power Management IC (PMIC) - Remove unnecessary function argument; axp20x - Separate out bus related code; axp20x - Coding Style changes; axp20x - Allow more drivers to be compiled as modules - Work around false positive 'used uninitialised' warning; db8500-prcmu Bug Fixes: - Remove do_div(); fsl-imx25-gcq - Fix driver init when built-in; tps65010 - Fix clock-unregister leak; intel-lpss" * tag 'mfd-for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (53 commits) mfd: intel-lpss: Pass I2C configuration via properties on BXT mfd: imx6sx: Add PCIe register definitions for iomuxc gpr mfd: ipaq-micro: Use __maybe_unused to hide pm functions mfd: max77686: Add max77802 to I2C device ID table mfd: max77686: Export OF module alias information mfd: max77686: Allow driver to be built as a module mfd: stmpe: Add the proper PWM resources mfd: tps65090: Set regmap config reg counts properly mfd: syscon: Return ENOTSUPP instead of ENOSYS when disabled mfd: as3711: Set regmap config reg counts properly mfd: rc5t583: Set regmap config reg counts properly gpio: tps65086: Add GPO driver for the TPS65086 PMIC mfd: mt6397: Add platform device ID table mfd: da9063: Fix missing volatile registers in the core regmap_range volatile lists mfd: mt6397: Add MT6323 support to MT6397 driver mfd: mt6397: Add support for different Slave types mfd: mt6397: int_con and int_status may vary in location dt-bindings: mfd: Add bindings for the MediaTek MT6323 PMIC mfd: da9062: Fix missing volatile registers in the core regmap_range volatile lists mfd: Add documentation for ACT8945A DT bindings ...
2016-03-17Merge tag 'gpio-v4.6-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO updates from Linus Walleij: "This is the bulk of GPIO changes for kernel v4.6. There is quite a lot of interesting stuff going on. The patches to other subsystems and arch-wide are ACKed as far as possible, though I consider things like per-arch <asm/gpio.h> as essentially a part of the GPIO subsystem so it should not be needed. Core changes: - The gpio_chip is now a *real device*. Until now the gpio chips were just piggybacking the parent device or (gasp) floating in space outside of the device model. We now finally make GPIO chips devices. The gpio_chip will create a gpio_device which contains a struct device, and this gpio_device struct is kept private. Anything that needs to be kept private from the rest of the kernel will gradually be moved over to the gpio_device. - As a result of making the gpio_device a real device, we have added resource management, so devm_gpiochip_add_data() will cut down on overhead and reduce code lines. A huge slew of patches convert almost all drivers in the subsystem to use this. - Building on making the GPIO a real device, we add the first step of a new userspace ABI: the GPIO character device. We take small steps here, so we first add a pure *information* ABI and the tool "lsgpio" that will list all GPIO devices on the system and all lines on these devices. We can now discover GPIOs properly from userspace. We still have not come up with a way to actually *use* GPIOs from userspace. - To encourage people to use the character device for the future, we have it always-enabled when using GPIO. The old sysfs ABI is still opt-in (and can be used in parallel), but is marked as deprecated. We will keep it around for the foreseeable future, but it will not be extended to cover ever more use cases. Cleanup: - Bjorn Helgaas removed a whole slew of per-architecture <asm/gpio.h> includes. This dates back to when GPIO was an opt-in feature and no shared library even existed: just a header file with proper prototypes was provided and all semantics were up to the arch to implement. These patches make the GPIO chip even more a proper device and cleans out leftovers of the old in-kernel API here and there. Still some cruft is left but it's very little now. - There is still some clamping of return values for .get() going on, but we now return sane values in the vast majority of drivers and the errorpath is sanitized. Some patches for powerpc, blackfin and unicore still drop in. - We continue to switch the ARM, MIPS, blackfin, m68k local GPIO implementations to use gpiochip_add_data() and cut down on code lines. - MPC8xxx is converted to use the generic GPIO helpers. - ATH79 is converted to use the generic GPIO helpers. New drivers: - WinSystems WS16C48 - Acces 104-DIO-48E - F81866 (a F7188x variant) - Qoric (a MPC8xxx variant) - TS-4800 - SPI serializers (pisosr): simple 74xx shift registers connected to SPI to obtain a dirt-cheap output-only GPIO expander. - Texas Instruments TPIC2810 - Texas Instruments TPS65218 - Texas Instruments TPS65912 - X-Gene (ARM64) standby GPIO controller" * tag 'gpio-v4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (194 commits) Revert "Share upstreaming patches" gpio: mcp23s08: Fix clearing of interrupt. gpiolib: Fix comment referring to gpio_*() in gpiod_*() gpio: pca953x: Fix pca953x_gpio_set_multiple() on 64-bit gpio: xgene: Fix kconfig for standby GIPO contoller gpio: Add generic serializer DT binding gpio: uapi: use 0xB4 as ioctl() major gpio: tps65912: fix bad merge Revert "gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free" gpio: omap: drop dev field from gpio_bank structure gpio: mpc8xxx: Slightly update the code for better readability gpio: mpc8xxx: Remove *read_reg and *write_reg from struct mpc8xxx_gpio_chip gpio: mpc8xxx: Fixup setting gpio direction output gpio: mcp23s08: Add support for mcp23s18 dt-bindings: gpio: altera: Fix altr,interrupt-type property gpio: add driver for MEN 16Z127 GPIO controller gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free gpio: timberdale: Switch to devm_ioremap_resource() gpio: ts4800: Add IMX51 dependency gpiolib: rewrite gpiodev_add_to_list ...
2016-03-16mfd: intel-lpss: Pass I2C configuration via properties on BXTMika Westerberg
I2C host controller need to be configured properly in order to meet I2C timings specified in the I2C protocol specification. Some Intel Broxton based machines do not have this information in the ACPI namespace (or the boot firmware does not support ACPI at all) so we use build-in device properties instead. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: ipaq-micro: Use __maybe_unused to hide pm functionsArnd Bergmann
The ipaq-micro driver uses SET_SYSTEM_SLEEP_PM_OPS() to remove the reference to its resume function, but does not use an #ifdef around the definition, so we get a build warning: drivers/mfd/ipaq-micro.c:379:12: error: 'micro_resume' defined but not used [-Werror=unused-function] This adds a __maybe_unused annotation so the compiler knows it can silently drop it instead of warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: max77686: Add max77802 to I2C device ID tableJavier Martinez Canillas
The max77686 MFD driver supports both the Maxim 77686 and Maxim 77802 PMICs but only the OF device table contains entries for both devices. The max77802 entry is missing in the I2C device ID table which isn't a problem currently since the driver only supports DT but it will be needed if the driver is changed to be built as a module since the I2C core always reports a I2C modalias uevent so auto-load will not work. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: max77686: Export OF module alias informationJavier Martinez Canillas
When the device is registered via OF, the OF table is used to match the driver instead of the I2C device ID table but the entries in the latter are used as aliasses to load the module if the driver was not built-in. This is because the I2C core always reports an I2C module alias instead of an OF one but that could change so it is better to always export it. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: max77686: Allow driver to be built as a moduleJavier Martinez Canillas
The driver's Kconfig symbol is a boolean but nothing prevents the driver to be built as a module instead of built-in. It is true that most system integrators will choose the latter but the config should not restrict it. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: stmpe: Add the proper PWM resourcesLinus Walleij
This adds the PWM resources to the STMPE MFD driver, so that it can properly grab and use them. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: tps65090: Set regmap config reg counts properlyMaciej S. Szmigiero
Regmap config max_register field should contain number of device last register, however num_reg_defaults_raw field should be set to register count instead (usually one register more than max_register). tps65090 driver had both of these fields set to the same value, fix this by introducing separate defines for max register number and total count of registers. Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: as3711: Set regmap config reg counts properlyMaciej S. Szmigiero
Regmap config max_register field should contain number of device last register, however num_reg_defaults_raw field should be set to register count instead (usually one register more than max_register). as3711 driver had both of these fields set to the same value, fix this by introducing separate defines for max register number and total count of registers. Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: rc5t583: Set regmap config reg counts properlyMaciej S. Szmigiero
Regmap config max_register field should contain number of device last register, however num_reg_defaults_raw field should be set to register count instead (usually one register more than max_register). rc5t583 driver had both of these fields set to the same value, fix this by introducing separate defines for max register number and total count of registers. Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: mt6397: Add platform device ID tableJavier Martinez Canillas
The platform bus_type .match callback attempts to match the platform device name with an entry on the .id_table if provided and fallbacks to match with the driver's name if a table is not provided. Using a platform device ID to match is more explicit, allows the driver to support more than one device and also the MODULE_DEVICE_TABLE macro can be used to export the module aliases information instead of the MODULE_ALIAS. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: da9063: Fix missing volatile registers in the core regmap_range ↵Steve Twiss
volatile lists Add an updated set of registers listed in the core regmap_range volatile ranges defined for the DA9063. These new registers contain bits that cannot be considered under the full control of software. Under various conditions the hardware will set and/or automatically clear bit(s) contained in these registers. When using a cached version of regmap, the volatility of these registers must be identified otherwise the regmap operations may not ensure the registers are explicitly altered. As well as updating the list of volatile registers, this change will fix a corner case discovered in the DA9063 ONKEY which is used by the DA9063 core. In the ONKEY case, the CONTROL_B register is now listed as volatile in the regmap_range because it contains the bit field NONKEY_LOCK. This bit can be altered by hardware, in which case regmap must be notified of its ability to be manpiulated outside of software control. Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: mt6397: Add MT6323 support to MT6397 driverJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: mt6397: Add support for different Slave typesJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: mt6397: int_con and int_status may vary in locationJohn Crispin
MT6323 has the INT_CON and INT_STATUS located at a different position. Make the registers locations configurable. Signed-off-by: John Crispin <blogic@openwrt.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: da9062: Fix missing volatile registers in the core regmap_range ↵Steve Twiss
volatile lists Add an updated set of registers listed in the core regmap_range volatile ranges defined for the DA9062. These new registers contain bits that cannot be considered under the full control of software. Under various conditions the hardware will set and/or automatically clear bit(s) contained in these registers. When using a cached version of regmap, the volatility of these registers must be identified otherwise the regmap operations may not ensure the registers are explicitly altered. As well as updating the list of volatile registers, this change will fix a corner case discovered in the DA9063 ONKEY which is used by the DA9062 core. In the ONKEY case, the CONTROL_B register is now listed as volatile in the regmap_range because it contains the bit field NONKEY_LOCK. This bit can be altered by hardware, in which case regmap must be notified of its ability to be manpiulated outside of software control. Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: act8945a: Add Active-semi ACT8945A PMIC MFD driverWenyou Yang
This patch adds support for the Active-semi ACT8945A PMIC. It is a Multi Function Device with the following subdevices: - Regulator - Charger It is interfaced to the host controller using I2C interface, ACT8945A is a child device of the I2C. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: arizona: Remove duplicate select of MFD_CORECharles Keepax
MFD_ARIZONA_I2C and MFD_ARIZONA_SPI both select MFD_ARIZONA and all three of those select MFD_CORE, this makes the selects of MFD_CORE in MFD_ARIZONA_I2C and MFD_ARIZONA_SPI redundant, so we remove them. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: cs47l24: Fix defaults array based on testingCharles Keepax
My automated test is back and now can check defaults against the actual hardware. This patch updates the defaults array for the differences detected and removes a couple of completely unused registers. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: wm8998: Fix defaults array based on testingCharles Keepax
My automated test is back and now can check defaults against the actual hardware. This patch updates the defaults array for the differences detected and removes a couple of completely unused registers. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: wm5102: Fix defaults array based on testingCharles Keepax
My automated test is back and now can check defaults against the actual hardware. This patch updates the defaults array for the differences detected and removes a couple of completely unused registers. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: wm5110: Fix defaults array based on testingCharles Keepax
My automated test is back and now can check defaults against the actual hardware. This patch updates the defaults array for the differences detected and removes a couple of completely unused registers. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: arizona: Update small typo in Arizona SPI KconfigCharles Keepax
The help text had a copy and paste error and refers to I2C in the SPI section. This patch corrects this typo. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: syscon: Make syscon_regmap_config constPhilipp Zabel
syscon_regmap_config can be made const if syscon_probe() creates a local copy on the stack, just like syscon_register() does. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: syscon: Set regmap max_register in of_syscon_registerPhilipp Zabel
Determine the regmap max_register configuration from the io resource size and the reg-io-width device tree property. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: db8500: Avoid uninitialized variable referenceArnd Bergmann
The prcmu_config_clkout() function ensures that the 'clkout' argument can only be '0' or '1' using an appropriate BUG_ON(), so the compiler should know that the div_mask, mask, and bits variables are always initialized later on. However, it doesn't understand this in gcc-5.2 and produces a false positive warning instead: drivers/mfd/db8500-prcmu.c: In function 'prcmu_config_clkout': drivers/mfd/db8500-prcmu.c:762:10: error: 'div_mask' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (val & div_mask) { ^ drivers/mfd/db8500-prcmu.c:769:13: error: 'mask' may be used uninitialized in this function [-Werror=maybe-uninitialized] if ((val & mask & ~div_mask) != bits) { ^ drivers/mfd/db8500-prcmu.c:757:7: error: 'bits' may be used uninitialized in this function [-Werror=maybe-uninitialized] Replacing the switch() statement with an equivalent if() lets gcc figure this out reliably and avoids the warnings. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16mfd: tps65086: Add driver for the TPS65086 PMICAndrew F. Davis
Add support for the TPS65912 device. It provides communication through I2C and contains the following components: - Regulators - Load switches - GPO controller Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-15Merge tag 'rtc-4.6' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Core: - New sysfs interface to set and read clock offset - Drivers can now be both I2C and SPI (see pcf2127 and ds3232) New drivers: - Alphascale ASM9260 - Epson RX6110SA - Maxim max20024 and max77620 (in max77686) - Microchip PIC32 - NXP pcf2129 (in pcf2127) Subsystem wide cleanups: - remove IRQF_EARLY_RESUME when unecessary Drivers: - ds1307: clock output, temperature sensor and wakeup-source support - ds1685: actually spin forever in poweroff error path - ds3232: many cleanups - ds3234: merged in ds3232 - hym8563: fix invalid year calculation - max77686: many cleanups - max77802 merged in max77686 - pcf2123: cleanups and offset support - pcf85063: cleanups - pcf8523: propely handle oscillator stop bit - rv3029: many cleanups, trickle charger and temperature sensor support - rv8803: convert spin_lock to mutex_lock - rx8025: many fixes - vr41xx: restore alarm_irq_enable" * tag 'rtc-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (86 commits) rtc: pcf2127: add pcf2129 device id rtc: pcf2127: add support for spi interface rtc: pcf2127: convert to use regmap rtc: rv3029: Add thermometer hwmon support rtc: rv3029: Add update_bits helper for eeprom access rtc: ds1685: actually spin forever in poweroff error path rtc: hym8563: fix invalid year calculation rtc: ds3232: use rtc->ops_lock to protect alarm operations rtc: ds3232: fix issue when irq is shared several devices rtc: ds3232: remove unused UIE code rtc: ds3232: add register access error checks rtc: ds3232: fix read on /dev/rtc after RTC_AIE_ON rtc: merge ds3232 and ds3234 rtc: ds3232: convert to use regmap rtc: pxa: fix Kconfig indentation rtc: rv3029: Add device tree property for trickle charger rtc: rv3029: Add functions for EEPROM access rtc: rv3029: Add i2c register update-bits helper rtc: rv3029: Add missing register definitions rtc: rv3029: Add "rv3029" I2C device id ...
2016-03-14rtc: max77686: move initialisation of rtc regmap, irq chip locallyLaxman Dewangan
To make RTC block of MAX77686/MAX77802 as independent driver, move the registration of i2c device, regmap for register access and irq_chip for interrupt support inside the RTC driver. Removed the same initialisation from MFD driver. Having this change will allow to reuse this driver for different PMIC/devices from Maxim Semiconductor if they kept same RTC IP on different PMIC. Some of examples as PMIC MAX77620, MAX20024 where same RTC IP used and hence driver for these chips will use this driver only for RTC support. Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Lee Jones <lee.jones@linaro.org> Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14mfd: max77686: do not set i2c client data for rtc i2c clientLaxman Dewangan
There is different RTC I2C address for RTC block in MAX77686. Driver is creating dummy i2c client for this address to access the register of this IP block. As there is no call to i2c_get_clientdata() for rtc_i2c client, there is no need to store pointer and hence removing the call to set client data for rtc i2c client. Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-09Merge branch 'ib-mfd-regulator-gpio-4.6' of ↵Linus Walleij
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into devel
2016-03-09mfd: lpss: Add PCI IDs for Intel Broxton B-Step platformHuiquan Zhong
Add PCI IDs for Intel Broxton B-Step platform, which have same LPSS devices with A-Step. Signed-off-by: Huiquan Zhong <huiquan.zhong@intel.com> Signed-off-by: Qipeng Zha <qipeng.zha@intel.com> cked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-09mfd: Allow i2c modular drivers to build with I2C=mAxel Lin
These drivers can be built as module, so make them depend on I2C rather than I2C=y. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-09mfd: intel-lpss: Remove clock tree on error pathAndy Shevchenko
We forgot to remove the clock tree if something goes wrong in ->probe(). Add a call to intel_lpss_unregister_clock() on error path in ->probe() to fix the potential issue. Fixes: 4b45efe85263 (mfd: Add support for Intel Sunrisepoint LPSS devices) Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-09mfd: tps65010: Fix init when the driver is built-inAaro Koskinen
tps65010 driver's initcall cannot succeed when the driver is built-in, because it expects that the I2C probe is completed at initcall time; this cannot happen as MFD is initialized before I2C. Also on systems where the chip is not present there is unnecessary 30 ms delay during the boot. Instead of waiting for probe to finish, just register the I2C device. If some boards need retry mechanism for startup glitches, that should be done in the actual probe function. Also delete the driver banner message. The patch allows to use tps65010 again with OMAP1 (where it's required to be built-in) and enables e.g. USB and LED functionality on OMAP5912 OSK. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-09Merge branches 'ib-mfd-clk-4.6', 'ib-mfd-input-iio-4.6', ↵Lee Jones
'ib-mfd-regulator-4.6' and 'ib-mfd-regulator-gpio-4.6' into ibs-for-mfd-merged
2016-02-16gpio: Include linux/gpio.h instead of asm/gpio.hBjorn Helgaas
Most arches have an asm/gpio.h that merely includes linux/gpio.h. The others select ARCH_HAVE_CUSTOM_GPIO_H, and when that's selected, linux/gpio.h includes asm/gpio.h. Therefore, code should include linux/gpio.h instead of including asm/gpio.h directly. Remove includes of asm/gpio.h, adding an include of linux/gpio.h when necessary. This is a follow-on to 7563bbf89d06 ("gpiolib/arches: Centralise bolierplate asm/gpio.h"). Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-02-12mfd: axp20x: Add support for RSB based AXP223 PMICChen-Yu Tsai
The AXP223 is a new PMIC commonly paired with Allwinner A23/A33 SoCs. It is functionally identical to AXP221; only the regulator default voltage/status and the external host interface are different. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12mfd: axp20x: Whitespace, open parenthesis alignment code style fixesChen-Yu Tsai
This fixes some leftover code style issues in the axp20x core. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12mfd: axp20x: Split the driver into core and i2c bitsChen-Yu Tsai
The axp20x driver assumes the device is i2c based. This is not the case with later chips, which use a proprietary 2 wire serial bus by Allwinner called "Reduced Serial Bus". This patch follows the example of mfd/wm831x and splits it into an interface independent core, and an i2c specific glue layer. MFD_AXP20X and the new MFD_AXP20X_I2C are changed to tristate symbols, allowing the driver to be built as modules. Whitespace and other style errors in the moved i2c specific code have been fixed. Included but unused header files are removed as well. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12mfd: axp20x: Add missing copyright noticeChen-Yu Tsai
Supply a backdated copyright notice. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Carlo Caione <carlo@caione.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12mfd: axp20x: Use dev->driver->of_match_table in axp20x_match_device()Chen-Yu Tsai
In axp20x_match_device(), match the of_device_id table bound to the device driver instead of pointing to axp20x_of_match directly. This will allow us to keep axp20x_match_device() unmodified when we expand the axp20x driver into multiple ones covering different interface types. of_device_get_match_data() cannot be used here as we need to know if it failed to get a match, or if the match data value just happened to be 0, as it is for the AXP152. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12mfd: axp20x: Remove second struct device * parameter for axp20x_match_device()Chen-Yu Tsai
The first argument passed to axp20x_match_device(), struct axp20x_dev *, already contains a pointer to the device. By rearranging some code, moving the assignment of the pointer before axp20x_match_device() is called, we can eliminate the second parameter. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>