summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/tps65910.c
Commit message (Collapse)AuthorAgeFilesLines
* 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: tps65910: Convert to i2c's .probe_new()Uwe Kleine-König2022-12-071-3/+3
| | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-474-uwe@kleine-koenig.org
* mfd: tps65910: Set PWR_OFF bit during driver probeDmitry Osipenko2021-12-291-9/+13
| | | | | | | | | | | | | The PWR_OFF bit needs to be set in order to power off properly, without hanging PMIC. This bit needs to be set early in order to allow thermal protection of NVIDIA Terga SoCs to power off hardware properly, otherwise a battery re-plug may be needed on some devices to recover after the hang. Cc: <stable@vger.kernel.org> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # ASUS TF201 Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211124190104.23554-1-digetx@gmail.com
* mfd: tps65910: Correct power-off programming sequenceDmitry Osipenko2020-11-271-2/+8
| | | | | | | | | | | | | | | | Correct power-off programming sequence in order to fix shutting down devices which are using TPS65910 PMIC. In accordance to the TPS65910 datasheet, the PMIC's state-machine transitions into the OFF state only when DEV_OFF bit of DEVCTRL_REG is set. The ON / SLEEP states also should be cleared, otherwise PMIC won't get into a proper state on shutdown. Devices like Nexus 7 tablet and Ouya game console are shutting down properly now. Tested-by: Peter Geis <pgwipeout@gmail.com> Tested-by: Zack Pearsall <zpearsall@yahoo.com> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: tps65910: Fix a bunch of alignment issues reported-by CheckpatchLee Jones2020-11-191-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CHECK: Alignment should match open parenthesis #24: FILE: drivers/mfd/tps65910.c:296: + ret = regmap_clear_bits(tps65910->regmap, TPS65910_DEVCTRL, DEVCTRL_CK32K_CTRL_MASK); CHECK: Alignment should match open parenthesis #33: FILE: drivers/mfd/tps65910.c:318: + ret = regmap_set_bits(tps65910->regmap, TPS65910_DEVCTRL, DEVCTRL_DEV_SLP_MASK); CHECK: Alignment should match open parenthesis #42: FILE: drivers/mfd/tps65910.c:326: + ret = regmap_set_bits(tps65910->regmap, TPS65910_SLEEP_KEEP_RES_ON, CHECK: Alignment should match open parenthesis #51: FILE: drivers/mfd/tps65910.c:336: + ret = regmap_set_bits(tps65910->regmap, TPS65910_SLEEP_KEEP_RES_ON, CHECK: Alignment should match open parenthesis #60: FILE: drivers/mfd/tps65910.c:346: + ret = regmap_set_bits(tps65910->regmap, TPS65910_SLEEP_KEEP_RES_ON, CHECK: Alignment should match open parenthesis #69: FILE: drivers/mfd/tps65910.c:358: + regmap_clear_bits(tps65910->regmap, TPS65910_DEVCTRL, DEVCTRL_DEV_SLP_MASK); CHECK: Alignment should match open parenthesis #78: FILE: drivers/mfd/tps65910.c:440: + if (regmap_set_bits(tps65910->regmap, TPS65910_DEVCTRL, DEVCTRL_PWR_OFF_MASK) < 0) CHECK: Alignment should match open parenthesis #83: FILE: drivers/mfd/tps65910.c:444: + regmap_clear_bits(tps65910->regmap, TPS65910_DEVCTRL, DEVCTRL_DEV_ON_MASK); Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: tps65910: Clean up after switching to regmapMichał Mirosław2020-11-191-8/+8
| | | | | | | Remove wrappers around regmap calls to remove now-useless indirection. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: tps65xxx: Constify static struct resource in OMAP2+ driversRikard Falkeborn2020-11-191-1/+1
| | | | | | | | | | Constify a number of static struct resource. The only usage of the structs are to assign their address to the resources field in the mfd_cell struct. This allows the compiler to put them in read-only memory. Done with the help of Coccinelle. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner2019-05-301-6/+1
| | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mfd: tps65910: Make it explicitly non-modularPaul Gortmaker2019-02-011-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config MFD_TPS65910 drivers/mfd/Kconfig- bool "TI TPS65910 Power Management chip" ...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. Since module_init was not in use by this code, the init ordering remains unchanged with this commit. We don't replace module.h with init.h since the file already has that. We do delete an unused moduleparam.h include though. 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 was (or is now) contained at the top of the file in the comments. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: tps65910: Move an assignment in tps65910_sleepinit()Markus Elfring2018-05-161-2/+2
| | | | | | | | Move the assignment for the local variable "dev" so that its setting will be performed after a configuration check by this function. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: tps65910: Delete an unnecessary variable initialisation in ↵Markus Elfring2018-05-161-1/+1
| | | | | | | | | | tps65910_sleepinit() The local variable "dev" will be reassigned by a following statement. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: tps65910: Delete an unnecessary variable initialisation in four functionsMarkus Elfring2018-05-161-4/+4
| | | | | | | | The local variable "ret" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: tps65910: Delete an error message for a failed memory allocation in ↵Markus Elfring2018-05-161-3/+1
| | | | | | | | | | | tps65910_parse_dt() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* regulator: tps65910: wire up sleep control configurationMichał Mirosław2017-06-151-7/+15
| | | | | | | | | | | This enables configuring the PMIC's sleep mode via device-tree. A pointer indirection to sleep mode data is removed, as it simplifies the implementation slightly. In current kernel tree, platform data structure is not used outside MFD cell drivers. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Mark Brown <broonie@kernel.org>
* mfd: tps65910: Use devm_mfd_add_devices and devm_regmap_add_irq_chipLaxman Dewangan2016-05-091-21/+4
| | | | | | | | | | | 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> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: tps65910: Use devm_mfd_add_devices() for mfd_device registrationLaxman Dewangan2016-04-191-5/+4
| | | | | | | | | | Use devm_mfd_add_devices() for MFD devices registration and remove the call of mfd_remove_devices() from .remove callback to remove MFD child-devices. This is done by managed device framework. CC: Tony Lindgren <tony@atomide.com> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.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: tps65910: Work around silicon erratum SWCZ010Arnout Vandecappelle (Essensium/Mind)2014-09-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | http://www.ti.com/lit/pdf/SWCZ010: Glitch on SDA-SCL not managed correctly by the I2C IP Impact: The standard specifies that the I2C transfer should restart on a start event in all cases. The current design does not support two consecutive Start conditions. This can cause the first real access after such a glitch to be corrupted. Description: An unexpected glitch on SDA and SCL can generate a wrong start event. In the current design, the SCL line must toggle two times to detect a new start event and completely restart the I2C access; hence the real start event is not detected in the case of a single SCL toggle. Workaround: Repeat I2C access. A simpler workaround is to make a dummy transfer just before the first access to the tps65910 chip. This can be done unconditionally. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: tps65910: Rid data size incompatibility warn when building for 64bitLee Jones2014-07-091-5/+5
| | | | | | | | | | Extinguishes: ../drivers/mfd/tps65910.c: In function ‘tps65910_parse_dt’: ../drivers/mfd/tps65910.c:404:14: warning: cast from pointer to integer of different size Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: tps65910: Make of_device_id array constJingoo Han2014-06-031-1/+1
| | | | | | | | Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* mfd: tps65910: Fix regmap_irq_chip_data leak on mfd_add_devices failKrzysztof Kozlowski2014-03-191-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>
* mfd: tps65910: Fix possible invalid pointer dereference on ↵Krzysztof Kozlowski2014-03-191-1/+3
| | | | | | | | | | | | | | | | | | | | | regmap_add_irq_chip fail 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>
* mfd: ti: 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>
* Merge tag 'mfd-lee-3.13-1' of git://git.linaro.org/people/ljones/mfdSamuel Ortiz2013-10-251-0/+1
|\ | | | | | | | | | | mfd-lee-3.13-1 MFD patches due for v3.13.
| * mfd: tps65910: 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: tps65910: Remove warning during dt node parsingLaxman Dewangan2013-10-241-4/+0
|/ | | | | | | | | | | | | | | | Driver throw the warning message if dt node does not have the info for VMBCH-Threshold and VMBCH2-Threshold. These properties are optional property and hence it is not mandatory to have these on DT node and in this case it should not throw the warning message. It creates noise from driver as follows: [ 0.384605] tps65910 4-002d: VMBCH-Threshold not specified [ 0.384616] tps65910 4-002d: VMBCH2-Threshold not specified Removing the warning message from driver. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* Merge tag 'mfd-3.8-1' of ↵Linus Torvalds2012-12-161-9/+225
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 Pull MFS update from Samuel Ortiz: "This is the MFD patch set for the 3.8 merge window. We have several new drivers, most of the time coming with their sub devices drivers: - Austria Microsystem's AS3711 - Nano River's viperboard - TI's TPS80031, AM335x TS/ADC, - Realtek's MMC/memstick card reader - Nokia's retu We also got some notable cleanups and improvements: - tps6586x got converted to IRQ domains. - tps65910 and tps65090 moved to the regmap IRQ API. - STMPE is now Device Tree aware. - A general twl6040 and twl-core cleanup, with moves to the regmap I/O and IRQ APIs and a conversion to the recently added PWM framework. - sta2x11 gained regmap support. Then the rest is mostly tiny cleanups and fixes, among which we have Mark's wm5xxx and wm8xxx patchset." Far amount of annoying but largely trivial conflicts. Many due to __devinit/exit removal, others due to one or two of the new drivers also having come in through another tree. * tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (119 commits) mfd: tps6507x: Convert to devm_kzalloc mfd: stmpe: Update DT support for stmpe driver mfd: wm5102: Add readback of DSP status 3 register mfd: arizona: Log if we fail to create the primary IRQ domain mfd: tps80031: MFD_TPS80031 needs to select REGMAP_IRQ mfd: tps80031: Add terminating entry for tps80031_id_table mfd: sta2x11: Fix potential NULL pointer dereference in __sta2x11_mfd_mask() mfd: wm5102: Add tuning for revision B mfd: arizona: Defer patch initialistation until after first device boot mfd: tps65910: Fix wrong ack_base register mfd: tps65910: Remove unused data mfd: stmpe: Get rid of irq_invert_polarity mfd: ab8500-core: Fix invalid free of devm_ allocated data mfd: wm5102: Mark DSP memory regions as volatile mfd: wm5102: Correct default for LDO1_CONTROL_2 mfd: arizona: Register haptics devices mfd: wm8994: Make current device behaviour the default mfd: tps65090: MFD_TPS65090 needs to select REGMAP_IRQ mfd: Fix stmpe.c build when OF is not enabled mfd: jz4740-adc: Use devm_kzalloc ...
| * mfd: tps65910: Fix wrong ack_base registerKim, Milo2012-11-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The interrupt status registers of TPS65910/1 should be cleared when the associated interrupt event occurs. This work is done in the regmap irq thread - using 'ack_base' register. The ACK registers should be fixed as status register, not mask registers. This patch fixes the infinite interrupt event problem by clearing interrupt status registers. Tested on the AM3517 Craneboard. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * mfd: tps65910: Remove unused dataKim, Milo2012-11-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The 'io_mutex' is not used anywhere. The regmap API supports the mutex internally, so no additional mutex is required. And 'domain' private data is unnecessary because the irq domain is already registered by using regmap_add_irq_chip(). Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * mfd: tps65910: Pass irq_domain when adding mfd sub devicesLaxman Dewangan2012-11-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | When adding the sub device "tps65910-rtc", is it passed the IO resource IRQ for the interrupt number. This interrupt needs to map in the device irq domain. Pass the irq domain of device in mfd_add_devices() so that proper irq mapping can be done when adding the sub device RTC. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * mfd: tps65910: Move interrupt implementation code to mfd fileLaxman Dewangan2012-11-201-0/+216
| | | | | | | | | | | | | | | | | | | | | | | | In place of implementing the irq support in separate file, moving implementation to main mfd file. The irq files only contains the table and init steps only and does not need extra file to have this only for this purpose. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * mfd: tps65910: Initialize mfd devices after all initialization doneLaxman Dewangan2012-11-201-8/+8
| | | | | | | | | | | | | | | | | | | | Add sub devices of tps65910 after all initialization like interrupt, clock etc. is done. This will make sure that require data gets initialized properly before sub devices probe's get called. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: remove use of __devexitBill Pemberton2012-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit 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> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Acked-by: David Brown <davidb@codeaurora.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | mfd: remove use of __devinitBill Pemberton2012-11-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devinit 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> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Acked-by: David Brown <davidb@codeaurora.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | mfd: remove use of __devexit_pBill Pemberton2012-11-281-1/+1
|/ | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit_p 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> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Acked-by: David Brown <davidb@codeaurora.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mfd: tps65910: Add alarm interrupt of TPS65910 RTC to mfd device listVenu Byravarasu2012-09-291-0/+10
| | | | | | | | Add RTC alarm interrupt details to TPS65910 MFD device list, to support RTC alarm events. Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: dt: tps65910: Add power off controlBill Huang2012-09-141-0/+22
| | | | | | | | | | | | | Add DT property "ti,system-power-controller" telling whether or not this pmic is in charge of controlling the system power, so the power off routine can be hooked up to system call "pm_power_off". Based on the work by: Dan Willemsen <dwillemsen@nvidia.com> Signed-off-by: Bill Huang <bilhuang@nvidia.com> Tested-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: core: Push irqdomain mapping out into devicesMark Brown2012-09-141-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: Add tps65910 32-kHz-crystal-input initJohan Hovold2012-07-161-10/+9
| | | | | | | | Replace tps65910_misc_init with a dedicated init function for the 32-kHz-crystal input, and make the code more readable. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Add device-tree entry to enable tps65910 external 32-kHz oscillatorJohan Hovold2012-07-091-0/+3
| | | | | | | | | | Add device-tree entry to enable external 32-kHz crystal oscillator input. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Add support for enabling tps65910 external 32-kHz oscillatorJohan Hovold2012-07-091-1/+20
| | | | | | | | | | | | | | | | | | | Add flag to platform data to enable external 32-kHz crystal oscillator (or square wave) input. The tps6591x can use either an internal 32-kHz RC oscillator or an external crystal (or square wave) to generate the 32-kHz clock. The default setting depends on the selected boot mode. In boot mode 00 the internal RC oscillator is used at power-on, but the external crystal oscillator (or square wave) can be enabled by clearing the ck32k_ctrl flag in the device control register. Note that there is no way to switch from the external crystal oscillator to the internal RC oscillator. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Remove the parsing of dt info for tps65910 gpioLaxman Dewangan2012-05-221-15/+0
| | | | | | | | | | Remove the parsing of device node information for sub devices from core file. The sub devices will parse the information as per the sub-devices specific information. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Save device node parsed platform data for tps65910 sub devicesLaxman Dewangan2012-05-221-1/+5
| | | | | | | | | | | Save the allocated memory to store the parsed device node information to the global device structure so that sub devices can directly use this pointer. In this way, the sub devices does not require to re-allocate the memory for storing the sub-devices specific device node information. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Fix tps65910 build failureSamuel Ortiz2012-05-201-2/+3
| | | | | | | | | The tps65910_parse_dt() prototype for !CONFIG_OF was not correct, leading to: drivers/mfd/tps65910.c: In function ‘tps65910_i2c_probe’: drivers/mfd/tps65910.c:218:3: error: too many arguments to function ‘tps65910_parse_dt’ Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Register tps65910 gpios as an mfd deviceLaxman Dewangan2012-05-201-3/+3
| | | | | | | | | As gpio support for tps65910 is on gpio driver, registering gpio support as the mfd sub devices instead of calling gpio_init() from the core probe. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Convert all tps65910 allocation to devm_*Laxman Dewangan2012-05-201-19/+9
| | | | | | | | | Convert memory allocation and regmap initialization to use devm_* functions. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Cache tps65910 register when we need itLaxman Dewangan2012-05-201-2/+1
| | | | | | | | | | During regmap initialization, we do not provide the default value and hence in place of caching register during regmap_init(), cache it when actually we need it i.e. after reading of that register. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Add tps65910 device-tree supportRhyland Klein2012-05-201-1/+79
| | | | | | | Add device tree based initialization support for TI's tps65910 pmic. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Commonize tps65910 regmap access through headerRhyland Klein2012-05-201-31/+9
| | | | | | | | | | This change removes the read/write callback functions in favor of common regmap accessors inside the header file. This change also makes use of regmap_read/write for single register access which maps better onto what this driver actually needs. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Fix tps65910 section annotationsMark Brown2012-05-071-5/+5
| | | | | | | | | | | A warning was being generated by the reference from tps65910_i2c_probe() to tps65910_sleepinit() since the latter was annotated as __init but the former was unannotated. Since these functions can only be called during device init make them both __devinit, and while we're at it also annotate tps65910_i2c_remove() __devexit for symmetry. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>