aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/max8998.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-06-02mfd: max8998: Simplify getting of_device_id match dataKrzysztof Kozlowski1-5/+3
Use of_device_get_match_data() to make the code slightly smaller. There is also no need to wrap it in a check for CONFIG_OF, because dev.of_node will be set only with OF support. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-08-12mfd: max8998: Convert to i2c_new_dummy_deviceWolfram Sang1-3/+3
Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an ERRPTR which we use in error handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-10-23mfd: maxim: Add SPDX license identifiersKrzysztof Kozlowski1-21/+7
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>
2017-09-05mfd: max8998: Fix potential NULL pointer dereferenceChristophe JAILLET1-4/+2
if 'max8998_i2c_parse_dt_pdata() fails (when out of memory), a NULL pointer dereference will occur in the error handling code. Return directly instead. Fixes: ee999fb3f17f("mfd: max8998: Add support for Device Tree") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29mfd: max8998: Make it explicitly non-modularPaul Gortmaker1-26/+1
The Kconfig currently controlling compilation of this code is: mfd/Kconfig:config MFD_MAX8998 mfd/Kconfig: bool "Maxim Semiconductor MAX8998/National LP3974 PMIC Support" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. We explicitly disallow a driver unbind, since that doesn't have a sensible use case anyway, and it allows us to drop the ".remove" code for non-modular drivers. Since module_init was not in use by this code, the init ordering remains unchanged with this commit. We delete the include of module.h as well as an unused include of moduleparam.h too. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14mfd: Use to_i2c_client() instead of open-coding itGeliang Tang1-4/+4
Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-11mfd: Drop owner assignment from i2c_driversKrzysztof Kozlowski1-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>
2014-06-03mfd: max8998: Make of_device_id array constKrzysztof Kozlowski1-1/+1
Array of struct of_device_id may be be const as expected by both of_match_table field and of_match_node() call. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: max8998: Fix possible NULL pointer dereference on i2c_new_dummy errorKrzysztof Kozlowski1-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>
2014-02-19mfd: max8998: Naturalise cross-architecture discrepanciesLee Jones1-3/+3
If we compile the MAX8998 for a 64bit architecture we receive the following warnings: drivers/mfd/max8998.c: In function ‘max8998_i2c_get_driver_data’: drivers/mfd/max8998.c:178:10: warning: cast from pointer to integer of different size return (int)match->data; ^ Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-23drivers/mfd/max8998.c: fix pointer-integer size mismatch warning in max8998_i2c_get_driver_data()David Howells1-1/+1
Fix up the following pointer-integer size mismatch warning in max8998_i2c_get_driver_data(): drivers/mfd/max8998.c: In function 'max8998_i2c_get_driver_data': drivers/mfd/max8998.c:178:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] return (int)match->data; ^ Signed-off-by: David Howells <dhowells@redhat.com> Cc: Tomasz Figa <t.figa@samsung.com> Cc: Mark Brown <broonie@linaro.org> Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-01-06mfd: maxim: Constify struct mfd_cell where possibleGeert Uytterhoeven1-2/+2
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>
2013-08-20mfd: max8998: Use devm_*() functionsJingoo Han1-3/+2
Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-07-31mfd: Use dev_get_platdata()Jingoo Han1-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>
2013-06-30mfd: max8998: Add support for Device TreeTomasz Figa1-2/+65
This patch adds Device Tree support to max8998 driver. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Acked-by: Mark Brown <broonie@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-15mfd: core: Push irqdomain mapping out into devicesMark Brown1-4/+4
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>
2012-01-09mfd: Use standard device wakeup for handling max8998 wakeup deviceJonghwan Choi1-2/+4
Use device_init_wakeup & device_may_wakeup to init wakeup Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-07-08power_supply: Add charger driver for MAX8998/LP3974Donggeun Kim1-0/+2
This patch supports power supply APIs for MAX8998/LP3974. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: KyungMin Park <kyungmin.park@samsung.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-03-27mfd: Cleanup irq namespaceThomas Gleixner1-2/+2
Converted with coccinelle. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-23mfd: Staticise non-exported symbols in MAX8998 driverMark Brown1-2/+2
No need to have them in the global namespace and sparse complains. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-01-14mfd: Support LP3974 RTCMyungJoo Ham1-3/+23
The first releases of LP3974 have a large delay in RTC registers, which requires 2 seconds of delay after writing to a rtc register (recommended by National Semiconductor's engineers) before reading it. If "rtc_delay" field of the platform data is true, the rtc driver assumes that such delays are required. Although we have not seen LP3974s without requiring such delays, we assume that such LP3974s will be released soon (or they have done so already) and they are supported by "lp3974" without setting "rtc_delay" at the platform data. This patch adds delays with msleep when writing values to RTC registers if the platform data has rtc_delay set. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-01-14mfd: MAX8998/LP3974 hibernation supportMyungJoo Ham1-0/+108
This patch makes the driver to save and restore register values for hibernation. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-29mfd: Fix resource reclaim for max8998Axel Lin1-0/+4
Properly free irq and unregister max8998->rtc device in max8998_i2c_probe() error path and max8998_i2c_remove(). Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-29mfd: Remove unneeded ret value checking for max8998 register updatesAxel Lin1-2/+0
i2c_smbus_write_byte_data() returns zero or negative value, therefore no need to check if ret is greater than zero or not. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-29mfd: Support for ICs compliant with max8998Lukasz Majewski1-2/+3
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-29rtc: Add MAX8998 rtc driverJoonyoung Shim1-1/+23
This adds support for the RTC provided by the Maxim 8998 chip. This driver was tested on a GONI board by using the rtc-test application from the Documentation/rtc.txt. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-29mfd: Add MAX8998 interrupts supportJoonyoung Shim1-1/+24
Use genirq and provide seperated file for interrupts support. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-29mfd: Use i2c_client as an argument on MAX8998 i2c routinesJoonyoung Shim1-15/+14
The MAX8998 chip have regulator and rtc features. The i2c slave address of regulator and rtc is different, so needs each i2c client on i2c operation functions. Also, this patch exports i2c operation functions instead of callback to make easy to read. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-29mfd: LP3974 PMIC supportKyungmin Park1-2/+3
LP3974 PMIC support. It has same functionality as max8998. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-11mfd: max8998 - fix incorrect kfree(i2c) in i2c_driver probe callback handlerAxel Lin1-3/+1
The i2c_client received in probe() should not be kfree()'d. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-11drivers: regulator: add Maxim 8998 driverKyungmin Park1-0/+160
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> This patch adds voltage regulator driver for Maxim 8998 chip. This chip is used on Samsung Aquila and GONI boards and provides following functionalities: - 4 BUCK voltage converters, 17 LDO power regulators and 5 other power controllers - battery charger This patch adds basic driver for voltage regulators and MAX 8998 MFD core. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>