summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/max77686.c
Commit message (Collapse)AuthorAgeFilesLines
* mfd: max77686: Convert to use maple tree register cacheMark Brown2023-11-011-1/+1
| | | | | | | | | | | | The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown <broonie@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Link: https://lore.kernel.org/r/20231001-mfd-maxim-maple-v1-2-cdfeb48a4d15@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
* mfd: Explicitly include correct DT includesRob Herring2023-08-181-1/+0
| | | | | | | | | | | | | | | The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230714174731.4059811-1-robh@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
* mfd: Switch i2c drivers back to use .probe()Uwe Kleine-König2023-06-151-1/+1
| | | | | | | | | | | | After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230515182752.10050-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones <lee@kernel.org>
* mfd: max77686: Remove #ifdef guards for PM related functionsPaul Cercueil2022-12-071-4/+2
| | | | | | | | | | | | | | | | | Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to handle the .suspend/.resume callbacks. These macros allow the suspend and resume functions to be automatically dropped by the compiler when CONFIG_SUSPEND is disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org>
* rtc: max77686: Rename day-of-month definesLuca Ceresoli2022-03-071-1/+1
| | | | | | | | | | RTC_DATE and REG_RTC_DATE are used for the registers holding the day of month. Rename these constants to mean what they mean. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Do not enforce (incorrect) interrupt trigger typeKrzysztof Kozlowski2021-11-051-2/+1
| | | | | | | | | | | | | | | | | | | | | Interrupt line can be configured on different hardware in different way, even inverted. Therefore driver should not enforce specific trigger type - edge falling - but instead rely on Devicetree to configure it. The Maxim 77686 datasheet describes the interrupt line as active low with a requirement of acknowledge from the CPU therefore the edge falling is not correct. The interrupt line is shared between PMIC and RTC driver, so using level sensitive interrupt is here especially important to avoid races. With an edge configuration in case if first PMIC signals interrupt followed shortly after by the RTC, the interrupt might not be yet cleared/acked thus the second one would not be noticed. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20210602110445.33536-2-krzysztof.kozlowski@canonical.com
* mfd: max77686: Drop of_match_ptr from of_device_id tableKrzysztof Kozlowski2020-11-271-1/+1
| | | | | | | | | | | | | The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here). This fixes compile warning (!CONFIG_OF on x86_64): drivers/mfd/max77686.c:148:34: warning: ‘max77686_pmic_dt_match’ defined but not used [-Wunused-const-variable=] Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: maxim: Add SPDX license identifiersKrzysztof Kozlowski2018-10-231-23/+9
| | | | | | | Replace GPL v2.0+ license statements with SPDX license identifiers. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Remove I2C device ID tableJavier Martinez Canillas2017-02-131-8/+0
| | | | | | | | | | | The driver is only used in DT platforms so there's no need to have an i2c_device_id table. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Tested-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Use the struct i2c_driver .probe_new instead of .probeJavier Martinez Canillas2017-02-131-3/+2
| | | | | | | | | | | | | | | | If a driver is only used in DT platforms, there's no need to get the i2c_device_id as an argument of the probe function. Since this data can be get from the matching of_device_id. There's a temporary .probe_new field in struct i2c_driver that can be used as probe callback for the case when i2c_device_id won't be used. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Tested-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Use of_device_get_match_data() helperJavier Martinez Canillas2017-02-131-7/+2
| | | | | | | | | | | | | | | | | | Use the generic helper to get the matched of_device_id .data, instead of open coding it. The driver was checking if matching the OF node with the driver's OF table was failing, but this doesn't make too much sense since this can't happen in practice. The fact the probe function was called, means OF registered a device with a valid compatible string so a of_device_get_match_data() call will always succeed. So just remove this unneeded check. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Tested-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Don't attempt to get i2c_device_id .dataJavier Martinez Canillas2017-02-131-8/+5
| | | | | | | | | | | | | The driver is only used in platforms that have DT support so always the I2C device .data will be get from the matched OF node and never will be from the I2C device ID table. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Tested-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Use devm_mfd_add_devices and devm_regmap_add_irq_chipLaxman Dewangan2016-05-091-23/+8
| | | | | | | | | | | | | Use devm_mfd_add_devices() for adding MFD child devices and devm_regmap_add_irq_chip() for IRQ chip registration. This reduces the error code path and .remove callback for removing MFD child devices and deleting IRQ chip data. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Use module_i2c_driver() instead of subsys initcallJavier Martinez Canillas2016-04-191-12/+1
| | | | | | | | | | | | | | | The driver's init and exit function don't do anything besides adding and deleting the I2C driver so the module_i2c_driver() macro could be used. Currently is not being used because the driver is initialized at subsys initcall level, claiming that this is done to allow consumers devices to use the resources provided by this driver. But dependencies are in DT so manual ordering of init calls is not necessary any more. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Andi Shyti <andi.shyti@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686/max77693: Fix misspelled Samsung addressKrzysztof Kozlowski2016-04-191-1/+1
| | | | | | | Correct smasung.com into samsung.com. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* Merge tag 'mfd-for-linus-4.6' of ↵Linus Torvalds2016-03-181-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ...
| * mfd: max77686: Add max77802 to I2C device ID tableJavier Martinez Canillas2016-03-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: max77686: Export OF module alias informationJavier Martinez Canillas2016-03-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | rtc: max77686: move initialisation of rtc regmap, irq chip locallyLaxman Dewangan2016-03-141-82/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | mfd: max77686: do not set i2c client data for rtc i2c clientLaxman Dewangan2016-03-141-1/+0
|/ | | | | | | | | | | | | | | | | | | 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>
* mfd: Use to_i2c_client() instead of open-coding itGeliang Tang2016-01-141-2/+2
| | | | | Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: Drop owner assignment from i2c_driversKrzysztof Kozlowski2015-08-111-1/+0
| | | | | | | | i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686/802: Remove support for board filesKrzysztof Kozlowski2015-01-221-23/+0
| | | | | | | | | | | | | | | | | | | | The driver is used only on Exynos based boards with DTS support. After removal of board file support from max77686 and max77802 regulator drivers, the MFD driver can be converted to DTS-only version. This simplifies a little the code: 1. No dead (unused) entries in platform_data structure. 2. More code removed. 3. Regulator driver does not depend on allocated memory from MFD driver. 4. It makes also easier extending the regulator driver. Add to the max77686 MFD driver dependency on CONFIG_OF because without DTS the regulator drivers (max77686 and max77802) won't bind. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Constify struct regmap_configKrzysztof Kozlowski2015-01-221-3/+3
| | | | | | | | The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Remove check which is always trueLee Jones2014-09-261-1/+1
| | | | | | | As 'reg' is unsigned, it can't be less than 0, so checking if it is greater than or equal to 0 will always result in a true condition. Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Ensure device type IDs are architecture agnosticLee Jones2014-07-251-3/+2
| | | | | | | | | | Extinguishes: ../drivers/mfd/max77686.c: In function ‘max77686_i2c_probe’: ../drivers/mfd/max77686.c:254:20: warning: cast from pointer to integer of different size Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Add Maxim 77802 PMIC supportJavier Martinez Canillas2014-07-251-27/+170
| | | | | | | | | | | | | | | Maxim MAX77802 is a power management chip that contains 10 high efficiency Buck regulators, 32 Low-dropout (LDO) regulators used to power up application processors and peripherals, a 2-channel 32kHz clock outputs, a Real-Time-Clock (RTC) and a I2C interface to program the individual regulators, clocks outputs and the RTC. This patch adds support for MAX77802 to the MAX77686 driver and is based on a driver added to the Chrome OS kernel 3.8 by Simon Glass. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Fix 'line over 80 chars' warningLee Jones2014-07-211-1/+1
| | | | | | | | | | | This is part of an effort to clean-up the MFD subsystem. +WARNING: line over 80 characters + &max77686_rtc_regmap_config); total: 0 errors, 1 warnings, 299 lines checked Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Remove unneeded OOM error messageJavier Martinez Canillas2014-07-211-3/+1
| | | | | | | | There is no need to print out-of-memory errors since this is already done by the memory management subsystem which even calls dump_stack(). Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Make error checking consistentJavier Martinez Canillas2014-07-211-5/+5
| | | | | | | | | Error checking across the driver is mostly consistent besides a few exceptions, so change these exceptions for consistency. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Return correct error when pdata isn't foundJavier Martinez Canillas2014-07-211-1/+1
| | | | | | | | | When platform data is not found an -EIO (I/O error) code is returned. This doesn't seem to be the correct error so better return -EINVAL (Invalid argument) which is what most drivers do in this case. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Make platform data over-rule DTJavier Martinez Canillas2014-07-211-1/+1
| | | | | | | | The function max77802_i2c_parse_dt_pdata() should only be called if there isn't already platform data for the device. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Don't define dummy function if OF isn't enabledJavier Martinez Canillas2014-07-211-9/+1
| | | | | | | | | | When the CONFIG_OF option was not enabled, a dummy function max77686_i2c_parse_dt_pdata() was defined since this is called unconditionally on probe(). Just always define the real function and conditionally call it if CONFIG_OF is enabled instead. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Add power management supportJavier Martinez Canillas2014-07-211-0/+40
| | | | | | | | | | The driver doesn't have PM operations defined so add a suspend and resume function handlers to allow the PMIC IRQ to wakeup the system when it is put into a sleep state. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Convert to use regmap_irqJavier Martinez Canillas2014-07-211-6/+91
| | | | | | | | | | | By using the generic IRQ support in the Register map API, it is possible to get rid max77686-irq.c and simplify the code. Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Doug Anderson <dianders@chromium.org> Tested-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Make of_device_id array constKrzysztof Kozlowski2014-06-031-1/+1
| | | | | | | | Array of struct of_device_id may be be const as expected by of_match_table field. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Fix possible NULL pointer dereference on i2c_new_dummy errorKrzysztof Kozlowski2014-03-191-0/+4
| | | | | | | | | | | | | | | | 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. Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Fix regmap resource leak on driver removeKrzysztof Kozlowski2014-01-211-1/+1
| | | | | | | | | | | | | 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>
* mfd: maxim: Constify struct mfd_cell where possibleGeert Uytterhoeven2014-01-061-1/+1
| | | | | | | | | | As of commit 03e361b25ee8dfb1fd9b890072c23c4aae01c6c7 ("mfd: Stop setting refcounting pointers in original mfd_cell arrays"), the "cell" parameter of mfd_add_devices() is "const" again. Hence make all cell data passed to mfd_add_devices() const where possible. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Include linux/of.h headerSachin Kamat2013-10-231-0/+1
| | | | | | | | 'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid breakage in the future. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: Use dev_get_platdata()Jingoo Han2013-07-311-1/+1
| | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: max77686: Convert to managed resources for allocating memoryLee Jones2013-06-131-17/+8
| | | | | Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: max77687: Add registration of max77686-clkOlof Johansson2013-06-111-0/+1
| | | | | | | | | | The MAX77686 clock driver has been in-tree for over 6 months, but never actually enabled through the MFD registration before. Add it to the table so the device will probe and configure properly. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: max77686: Use NULL instead of 0Sachin Kamat2013-04-081-1/+1
| | | | | | | | | | 'data' is a pointer and hence use NULL instead of 0. Silences the following warning: drivers/mfd/max77686.c:49:50: warning: Using plain integer as NULL pointer Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: max77686: Init max77686->dev before using itAxel Lin2013-01-221-9/+9
| | | | | | | | Current code uses max77686->dev in the dev_err call before setting it to &i2c->dev. Fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: remove use of __devinitdataBill Pemberton2012-11-281-1/+1
| | | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devinitdata is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Peter Tyser <ptyser@xes-inc.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mfd: core: Push irqdomain mapping out into devicesMark Brown2012-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | Currently the MFD core supports remapping MFD cell interrupts using an irqdomain but only if the MFD is being instantiated using device tree and only if the device tree bindings use the pattern of registering IPs in the device tree with compatible properties. This will be actively harmful for drivers which support non-DT platforms and use this pattern for their DT bindings as it will mean that the core will silently change remapping behaviour and it is also limiting for drivers which don't do DT with this particular pattern. There is also a potential fragility if there are interrupts not associated with MFD cells and all the cells are omitted from the device tree for some reason. Instead change the code to take an IRQ domain as an optional argument, allowing drivers to take the decision about the parent domain for their interrupts. The one current user of this feature is ab8500-core, it has the domain lookup pushed out into the driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Guard max77686_pmic_dt_match with CONFIG_OFAxel Lin2012-07-101-5/+5
| | | | | | | | | | This fixes below build warning if CONFIG_OF is not set. CC drivers/mfd/max77686.o drivers/mfd/max77686.c:37:42: warning: 'max77686_pmic_dt_match' defined but not used [-Wunused-variable] Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Add device tree support for max77686Yadwinder Singh Brar2012-07-091-6/+39
| | | | | | | | | | | This patch adds device tree support for mfd driver and adds Documentation/devicetree/bindings/mfd/max77686.txt. This patch also intialize max77686 pointer to NULL in max77686_i2c_probe to silent a compile time warning. Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com> Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Allow to specify max77686 interrupt through DT or platform file alsoYadwinder Singh Brar2012-07-091-0/+1
| | | | | | | | Presently driver expects irq_gpio pin in platform data and maps it to irq itself. But we can also directly specify the interrupt in DT or platform file. Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>