summaryrefslogtreecommitdiff
path: root/drivers/mfd/ab8500-core.c
AgeCommit message (Collapse)AuthorFilesLines
2023-08-18mfd: Explicitly include correct DT includesRob Herring1-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>
2022-03-23mfd: Use platform_get_irq() to get the interruptMinghao Chi (CGEL ZTE)1-7/+5
It is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ) for requesting IRQ's resources any more, as they can be not ready yet in case of DT-booting. platform_get_irq() instead is a recommended way for getting IRQ even if it was not retrieved earlier. It also makes code simpler because we're getting "int" value right away and no conversion from resource to int is required. The print function dev_err() is redundant because platform_get_irq() already prints an error. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220309035607.2080884-1-chi.minghao@zte.com.cn
2022-03-08mfd: ab8500: Drop debugfs moduleLinus Walleij1-20/+0
This debugfs isn't used by anyone, if we want to dump the contents of registers we should just convert the driver to regmap instead. I'm also excluding this from the device tree bindings when converting to YAML because it is not a real device, and device trees should only contain real physical devices. Delete it. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220212214724.681530-1-linus.walleij@linaro.org
2021-08-05mfd: Don't use irq_create_mapping() to resolve a mappingMarc Zyngier1-1/+1
Although irq_create_mapping() is able to deal with duplicate mappings, it really isn't supposed to be a substitute for irq_find_mapping(), and can result in allocations that take place in atomic context if the mapping didn't exist. Fix the handful of MFD drivers that use irq_create_mapping() in interrupt context by using irq_find_mapping() instead. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Lee Jones <lee.jones@linaro.org> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-06-15mfd: ab8500-core: Use DEVICE_ATTR_RO/RW macroZhen Lei1-17/+16
Use DEVICE_ATTR_RO/RW macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-04-14mfd: ab8500: Drop bm disable parameterLinus Walleij1-14/+6
Nobody is passing the module parameter to disable the battery management portions so just drop this parameter. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-03-22mfd/power: ab8500: Push data to power supply codeLinus Walleij1-9/+8
The global definition of platform data for the battery management code has no utility after the OF conversion, move the <linux/mfd/abx500/ab8500-bm.h> to be a local file in drivers/power/supply and stop defining the platform data in drivers/power/supply/ab8500_bmdata.c and broadcast to the kernel only to have it assigned as platform data to the MFD cells and then picked back into the same subsystem that defined it in the first place. This kills off a layer of indirection. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-02-22Merge tag 'mfd-next-5.12' of ↵Linus Torvalds1-21/+21
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Standardise MFD_CELL_* helpers New Drivers: - Add support for Acer Iconia Tab A500 Embedded Controller New Device Support: - Add support for ROHM BD9574MWF to BD9571MWV - Add support for Intel Alder Lake PCH-P PCI to LPSS - Add support for Intel Alder Lake PCH-S PCI to LPSS New Functionality: - Support ACPI enumeration; arizona Fix-ups: - Managed resources; bd9571mwv - DT additions/fix-ups; bd9571mwv, iqs62x, max8997, gateworks-gsc, ene-kb930 - Convert to SPDX; bd9571mw - Fix return values/error handling; sunxi - Provide SOFTDEP; arizona - Make use of DIV_ROUND_UP; mcp-sa11x0 - Use generic APIs; arizona - Add MAC address sysfs entries; intel-m10-bmc - Trivial: Coding-style fix-ups; iqs62x - Trivial: Remove superflouous code; iqs62x - Clear-up naming conventions; iqs62x Bug Fixes: - Fix 'pointer from integer' error; altera-sysmgr - Convert SGI_MFD_IOC3 from tristate to bool; Kconfig - Fix interrupt handling; gateworks-gsc - Extend required delay; iqs62x - Do not use I2C polling during calibration; iqs62x - Do no adjust clock frequency during calibration; iqs62x - Fix use-after-free; wm831x-auxad" * tag 'mfd-next-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (32 commits) mfd: wm831x-auxadc: Prevent use after free in wm831x_auxadc_read_irq() mfd: iqs62x: Do not change clock frequency during ATI mfd: iqs62x: Do not poll during ATI mfd: iqs62x: Increase interrupt handler return delay mfd: iqs62x: Rename regmap_config struct mfd: iqs62x: Remove unused bit mask mfd: iqs62x: Remove superfluous whitespace above fallthroughs mfd: intel-lpss: Add Intel Alder Lake PCH-S PCI IDs mfd: intel-m10-bmc: Expose MAC address and count mfd: Add driver for Embedded Controller found on Acer Iconia Tab A500 dt-bindings: mfd: Add ENE KB930 Embedded Controller binding dt-bindings: mfd: gateworks-gsc: Add fan-tach mode mfd: intel-lpss: Add Intel Alder Lake PCH-P PCI IDs mfd: gateworks-gsc: Fix interrupt type mfd: Standardise MFD_CELL_* helper names mfd: mcp-sa11x0: Use DIV_ROUND_UP to calculate rw_timeout mfd: max8997: Add of_compatible to Extcon and Charger mfd_cell dt-bindings: mfd: Correct the node name of the panel LED mfd: sgi-ioc3: Turn Kconfig option into a bool mfd: altera-sysmgr: Fix physical address storing more ...
2021-02-08mfd: Standardise MFD_CELL_* helper namesLee Jones1-21/+21
Start all helpers with "MFD_CELL_". Cc: Gene Chen <gene_chen@richtek.com> Cc: linux-mediatek@lists.infradead.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-01-13regulator: ab8500: Decomission platform data headerLinus Walleij1-1/+0
The platform data header was only used to pass platform data from board files. We now populate the regulators exclusively from device tree, so the header contents can be moved into the regulator drivers. Cc: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20201205004057.1712753-2-linus.walleij@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-24mfd: ab8500: Fix ab8500-clk typoLinus Walleij1-2/+2
Commit f4d41ad84433 ("mfd: ab8500: Example using new OF_MFD_CELL MACRO") has a typo error renaming "ab8500-clk" to "abx500-clk" with the result att ALSA SoC audio broke as the clock driver was not probing anymore. Fixed it up. Fixes: f4d41ad84433 ("mfd: ab8500: Example using new OF_MFD_CELL MACRO") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Stephan Gerhold <stephan@gerhold.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2020-01-24mfd: ab8500-core: Add device tree support for AB8505Stephan Gerhold1-2/+12
AB8505 support was never fully converted to the device tree. Most of the MFD cells for AB8505 lack an "of_compatible", which prevents them from being configured through the device tree. Align the definition of the AB8505 MFD cells with the ones for AB8500, and add device tree compatibles. Except for GPIO and regulators the compatibles are equal to those used for AB8500 because the hardware does not differ much. Finally, change db8500_prcmu_register_ab8500() to check for the AB8505 device tree node additionally, and probe it if it is found. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-11-11mfd: ab8500: Example using new OF_MFD_CELL MACROLee Jones1-96/+42
... with and without platform ID. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 197Thomas Gleixner1-1/+1
Based on 1 normalized pattern(s): license terms gnu general public license v2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 37 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528170027.724130665@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-03mfd: ab8500-core: Return zero in get_register_interruptible()Dan Carpenter1-1/+1
This function is supposed to return zero on success or negative error codes on error. Unfortunately, there is a bug so it sometimes returns non-zero, positive numbers on success. I noticed this bug during review and I can't test it. It does appear that the return is sometimes propogated back to _regmap_read() where all non-zero returns are treated as failure so this may affect run time. Fixes: 47c1697508f2 ("mfd: Align ab8500 with the abx500 interface") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-09-05mfd: ab8500-core: Constify attribute_group structuresArvind Yadav1-3/+3
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 16298 1009 184 17491 4453 drivers/mfd/ab8500-core.o File size After adding 'const': text data bss dec hex filename 16490 817 184 17491 4453 drivers/mfd/ab8500-core.o Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-02-13mfd: ab8500-core: Rename clock device and compatibleLinus Walleij1-2/+2
We didn't have proper device tree bindings for this clock, I standardized it to use the exact chipname so let's rename it "ab8500-clk" and rectify the device tree compatible string to "stericsson,ab8500-clk". Cc: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29mfd: ab8500-core: Make it explicitly non-modularPaul Gortmaker1-31/+6
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config AB8500_CORE drivers/mfd/Kconfig: bool "ST-Ericsson AB8500 Mixed Signal 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. 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 replace module.h with moduleparam.h ; the latter since this file was implicitly relying on getting it. 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> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-07-12mfd: db8500 stop passing around platform dataArnd Bergmann1-4/+0
Except for the constant DB8500_PRCMU_FW_VERSION_OFFSET number, nothing is ever passed through the platform data and used in a driver, so we can simply stop passing it around. Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-01-14mfd: ab8500-core: Fix many warnings reported by CheckpatchLee Jones1-14/+10
WARNING: Block comments use a trailing */ on a separate line + * */ WARNING: Block comments use a trailing */ on a separate line + * bank on higher 8 bits and reg in lower */ WARNING: Block comments use a trailing */ on a separate line + * bank on higher 8 bits and reg in lower */ WARNING: suspect code indent for conditional statements (8, 24) + if (unlikely(*offset == 17)) + *offset = 24; WARNING: suspect code indent for conditional statements (8, 24) + if (unlikely(*offset == 16)) + *offset = 25; WARNING: suspect code indent for conditional statements (8, 24) + if ((i == 3) && (*offset >= 24)) + *offset += 2; WARNING: ENOSYS means 'invalid syscall nr' and nothing else + return -ENOSYS; WARNING: static const char * array should probably be static const char * const + static const char *switch_off_status[] = { WARNING: static const char * array should probably be static const char * const + static const char *turn_on_status[] = { total: 0 errors, 9 warnings, 1867 lines checked Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-12-04mfd: ab8500: Delete static IRQ resourcesLinus Walleij1-482/+0
The platforms that use the AB8500 define all IRQ resources in the device tree and they are automatically populated by matching the .of_compatible string. These static resources are just surplus baggage these days. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-11mfd: Kill off set_irq_flags usageRob Herring1-4/+0
set_irq_flags is ARM specific with custom flags which have genirq equivalents. Convert drivers to use the genirq interfaces directly, so we can kill off set_irq_flags. The translation of flags is as follows: IRQF_VALID -> !IRQ_NOREQUEST IRQF_PROBE -> !IRQ_NOPROBE IRQF_NOAUTOEN -> IRQ_NOAUTOEN For IRQs managed by an irqdomain, the irqdomain core code handles clearing and setting IRQ_NOREQUEST already, so there is no need to do this in .map() functions and we can simply remove the set_irq_flags calls. Some users also modify IRQ_NOPROBE and this has been maintained although it is not clear that is really needed. There appears to be a great deal of blind copy and paste of this code. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-22mfd: Constify regmap and irq configuration dataKrzysztof Kozlowski1-1/+1
Constify in various drivers configuration data which is not modified: - regmap_irq_chip, - individual regmap_irq's in array, - regmap_config, - irq_domain_ops, Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-10-20mfd: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-08-20mfd: ab8500-core: Use 'ifdef' for config optionsFabio Estevam1-1/+1
The config symbol 'CONFIG_DEBUG_FS' should be protected by a 'ifdef' instead of a plain 'if'. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-07-09mfd: ab8500-core: Resolve code style issuesLee Jones1-21/+24
Soothes the following checkpatch warnings: WARNING: line over 80 characters #151: FILE: drivers/mfd/ab8500-core.c:151: + 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22, 23, ERROR: spaces required around that '=' (ctx:VxW) #325: FILE: drivers/mfd/ab8500-core.c:325: + ret= mask_and_set_register_interruptible(ab8500, bank, reg, ^ WARNING: line over 80 characters #418: FILE: drivers/mfd/ab8500-core.c:418: + else if (offset >= AB9540_INT_GPIO50R && offset <= AB9540_INT_GPIO54R) WARNING: line over 80 characters #420: FILE: drivers/mfd/ab8500-core.c:420: + else if (offset == AB8540_INT_GPIO43R || offset == AB8540_INT_GPIO44R) ERROR: spaces required around that '==' (ctx:VxV) #454: FILE: drivers/mfd/ab8500-core.c:454: + if ((i==3) && (*offset >= 24)) ^ ERROR: code indent should use tabs where possible #576: FILE: drivers/mfd/ab8500-core.c:576: + .map = ab8500_irq_map,$ WARNING: please, no spaces at the start of a line #576: FILE: drivers/mfd/ab8500-core.c:576: + .map = ab8500_irq_map,$ ERROR: code indent should use tabs where possible #577: FILE: drivers/mfd/ab8500-core.c:577: + .xlate = irq_domain_xlate_twocell,$ WARNING: please, no spaces at the start of a line #577: FILE: drivers/mfd/ab8500-core.c:577: + .xlate = irq_domain_xlate_twocell,$ WARNING: char * array declaration might be better as static const #1554: FILE: drivers/mfd/ab8500-core.c:1554: + static char *switch_off_status[] = { WARNING: char * array declaration might be better as static const #1563: FILE: drivers/mfd/ab8500-core.c:1563: + static char *turn_on_status[] = { WARNING: sizeof *ab8500 should be sizeof(*ab8500) #1582: FILE: drivers/mfd/ab8500-core.c:1582: + ab8500 = devm_kzalloc(&pdev->dev, sizeof *ab8500, GFP_KERNEL); ERROR: space required after that close brace '}' #1639: FILE: drivers/mfd/ab8500-core.c:1639: + }/* Configure AB8500 or AB9540 IRQ */ WARNING: line over 80 characters #1652: FILE: drivers/mfd/ab8500-core.c:1652: + ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL); WARNING: Prefer [subsystem eg: netdev]_cont([subsystem]dev, ... then dev_cont(dev, ... then pr_cont(... to printk(KERN_CONT ... #1677: FILE: drivers/mfd/ab8500-core.c:1677: + printk(KERN_CONT " \"%s\"", WARNING: Prefer [subsystem eg: netdev]_cont([subsystem]dev, ... then dev_cont(dev, ... then pr_cont(... to printk(KERN_CONT ... #1682: FILE: drivers/mfd/ab8500-core.c:1682: + printk(KERN_CONT "\n"); WARNING: Prefer [subsystem eg: netdev]_cont([subsystem]dev, ... then dev_cont(dev, ... then pr_cont(... to printk(KERN_CONT ... #1684: FILE: drivers/mfd/ab8500-core.c:1684: + printk(KERN_CONT " None\n"); WARNING: printk() should include KERN_ facility level #1695: FILE: drivers/mfd/ab8500-core.c:1695: + printk("\"%s\" ", turn_on_status[i]); WARNING: printk() should include KERN_ facility level #1700: FILE: drivers/mfd/ab8500-core.c:1700: + printk("None\n"); total: 5 errors, 14 warnings, 1869 lines checked Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-07-09mfd: ab8500-core: Remove pointless else in if statementLee Jones1-2/+2
Save a line of code (albeit, it's replaced by a blank line, but still), as the else is superfluous. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-06-26mfd: ab8500: Fix dt irq mappingGrygorii Strashko1-1/+1
The AD8500 defines itself as interrupt-controller in DT, but it doesn't assign DT node to IRQ domain when creates it. As result, of_irq_xx() helpers don't work because they can't find necessary IRQ domain. Hence, fix it by assigning AD8500 core device DT node to IRQ domain when it's created. This patch fixes STE u8500 Snowball boot failure reported by Kevin Hilman https://lkml.org/lkml/2014/5/27/624 Reported-and-tested-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-04mfd: dbx500/abx500: root out hardcoded IRQ assignmentsLinus Walleij1-13/+14
The DBx500 and ABx500 should be getting their IRQs from the device tree and nowhere else. Get rid of all the static assignments everywhere, delete it from the driver, platform data and the board files in one swift strike. Lots of cross-dependencies in the MFD drivers for PRCMU and AB8500 makes it necessary to strike everywhere at once to eradicate IRQs passed as resources and platform data to the left and right around the platform. Cc: Mark Brown <broonie@kernel.org> Cc: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-01-21mfd: ab8500: Use irqdomain to map interruptsLinus Walleij1-1/+1
All subdrivers use the irqdomain to demux AB8500 IRQs but here in the hierarchical path we find a leftover instance using the hard-coded IRQ base. Convert it to use irqdomain with a oneliner. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-06mfd: Constify struct mfd_cell where possibleGeert Uytterhoeven1-7/+7
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-06-13mfd: ab8500-core: Add AB8500 external regulators as MFD devicesLee Jones1-0/+10
The AB8500 external regulator driver is now a device in its own right, so it requires registering and probing in the normal way. This patch will ensure the driver is probed once registered for all devices which support them. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-06-13mfd: ab8500-core: Add of_compatible property for ab8500-codecFabio Baltieri1-0/+1
Add of_compatible string to the ab8500-codec cell to allow the driver to grab handlers such as regulators from device-tree when available. Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-06-13mfd: ab8500-core: Add device for new RTC version for AB8540 cut2Alexandre Torgue1-8/+47
AB8540 RTC have changed between AB8540_cut1 and AB8540_cut2.Different ressources to define for those two version. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Julien Delacou <julien.delacou@stericsson.com> Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-06-13mfd: ab8500-core: Drop references to ab8500-ledsLee Jones1-13/+0
The ab8500-leds driver has never been upstreamed and was replaced by a PWM framework based driver, so these references are not needed anymore. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-05-17mfd: ab8500-core: Pass GPADC compatible string to MFD coreLee Jones1-0/+3
When booting with Device Tree enabled the MFD core uses each device's compatible string to find and allocate its associated of_node pointer, which in turn is passed to the driver via the platform_device struct. Without it, the driver won't be able to interrogate the Device Tree or locate suitable regulators and will most likely fail to probe. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-05-17mfd: ab8500-core: Use the correct driver name when enabling gpio/pinctrlLee Jones1-3/+3
When we're using Device Tree to enable GPIO drivers we're forced to be OS agnostic, thus we are forbidden use names like pinctrl as they are specific only to Linux, at least for the time being. However, when we are registering devices using internal systems such as MFD or platform registration, we can use such terminology. In this case we can and should use the platform device ID mechanism to specify which device we wish to utilise by detailing pinctrl-<device_name>. This patch fixes a regression that when booting with Device Tree enabled the ABx500 GPIO/Pinctrl devices are not probed. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-05-17mfd: ab8500: Pass AB8500 IRQ to debugfs code by resourceLinus Walleij1-0/+15
The AB8500 debug code which was merged in parallell with the multiplatform work incidentally introduced a new instance using the <mach/irqs.h> header which is now deleted, causing this build regression: drivers/mfd/ab8500-debugfs.c:95:23: fatal error: mach/irqs.h: No such file or directory compilation terminated. make[4]: *** [drivers/mfd/ab8500-debugfs.o] Error 1 The code most certainly never worked with device tree either since that does not rely on this kind of hard-coded interrupt numbers. Fix the problem at the root by passing it as a named resource from the ab8500-core driver. Use an untyped resource to stop the MFD core from remapping this IRQ relative to the AB8500 irqdomain. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-09mfd: ab8500-core: Add of_compatilbe property for ab8500-usbFabio Baltieri1-0/+1
Add of_comptabile string to the ab8500-usb cell to allow the driver to grab properties from device-tree when available. Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-09mfd: ab8500-core: Ignore masked out interruptsFabio Baltieri1-13/+14
AB8500 asserts LATCH bits for masked out interrupts. This patch explicitly masks those out using the cached mask value to prevent handle_nested_irq() being called for masked IRQ on the same register as unmasked ones. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07ab8500-fg: Add power cut feature for ab8505 and ab8540Lee Jones1-0/+36
Add support for a power cut feature which allows user to configure when ab8505 and ab8540 based platforms should shut down system due to low battery. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-03-07mfd: ab8500-core: Hierarchical interrupt registersDariusz Szymczak1-76/+6
Make use of the hierarchical interrupt rergister called ITLatchHier1 - 3 also for the 8500 platform (currently the hierarchical interrupt registers are used only for the 8540 and 9540 platforms). This will make the interrupt routing go faster since fewer i2c reads need to made in the most common cases. Signed-off-by: Dariusz Szymczak <dariusz.xd.szymczak@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-core: Add abx500-clk as an mfd child deviceUlf Hansson1-0/+12
Hierarchically, the abx500-clk shall be considered as a child of the ab8500 core. The abx500-clk is intiated at arch init and thus the clks will be available when clients needs them. Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com> Reviewed-by: Patrice CHOTARD <patrice.chotard@stericsson.com> Reviewed-by: Gabriel FERNANDEZ <gabriel.fernandez@stericsson.com> Reviewed-by: Philippe BEGNIC <philippe.begnic@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-core: Show turn on status at bootMattias Wallin1-0/+26
Several states can be detected when a device is initially turned on. This patch displays these states in the log. If none of the states are true, then we report that too. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-core: Add additional resources to ab8505_iddet_resourcesLee Jones1-0/+24
Add VBUS_DET_R, VBUS_DET_F IRQ, ID_DET_PLUGR and ID_DET_PLUGF IRQ information to ab8505_iddet_resources. These are required to get interrupts for AB8505 cut-2. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-debugfs: Add tests for ab8540 based platform initialisationsLee Jones1-3/+6
Signed-off-by: Alexandre Torgue <alexandre.torgue@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com> Tested-by: Maxime COQUELIN <maxime.coquelin@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-core: Add Interrupt support for ab8540Lee Jones1-7/+43
ITSource/ITLatch 7, 8, 9 and 10 don't exist on AB8540. This patch replaces them with '-1' in the interrupt list, and handles the '-1' in the code accordingly. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-core: Rework MFD sub-device initialisation structuresLee Jones1-61/+182
Here we're separating Battery Management devices into their own structure, removing the common device structure & redistribute them amongst the individual platform structs and completing the population of them. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-core: Add ADC support for ab8540Lee Jones1-15/+59
Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-core: APE Interrupts are not clearedLee Jones1-2/+3
There are missing register descriptions from the AB8505 user manual and these need to be masked so that the APEINT line can toggle. This patch also affects the behaviour of AB9540. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Maxime COQUELIN <maxime.coquelin@stericsson.com> Reviewed-by: Alexandre TORGUE <alexandre.torgue@stericsson.com> Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>