Commit graph

633295 commits

Author SHA1 Message Date
Milo Kim 6d2c2b9f80 mfd: tps65217: Update register interrupt mask bits instead of writing operation
TPS65217 interrupt register includes read/writeable mask bits with
read-only status bits. (bit 4, 5, 6 are R/W, bit 0, 1, 2 are RO)
And reserved bit is not required.

Register update operation is preferred for disabling all interrupts during
the device initialisation.

Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:39 +00:00
Milo Kim f660206403 mfd: tps65217: Specify the IRQ name
TPS65217 MFD is an interrupt controller and MFD slave devices like
tps65217-charger and tps65217-pwrbutton request an interrupt to handle
each HW event.

Currently, TPS65217 IRQ name is not defined, so the result is as below.

root@arm:~# cat /proc/interrupts
...
182:          0      INTC   7 Level     tps65217-irq
183:          0         -   1 Edge      tps65217-charger
185:          0         -   2 Edge      tps65217_pwrbutton

This patch specifies the name of the interrupt controller.

182:          0      INTC   7 Level     tps65217-irq
183:          0  tps65217   1 Edge      tps65217-charger
185:          0  tps65217   2 Edge      tps65217_pwrbutton

Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:39 +00:00
Milo Kim 40a50f8b30 mfd: tps65217: Fix page fault on unloading modules
TPS65217 IRQ domain should be removed and initialised as NULL when the
module is unloaded for the next use. When tps65217.ko is loaded again,
it causes the page fault. This patch fixes the error below.

root@arm:~# lsmod | grep "tps"
tps65217_charger        3538  0
tps65218_pwrbutton      2974  0
tps65217                6710  1 tps65217_charger

root@arm:~# modprobe -r tps65217_charger

root@arm:~# modprobe tps65217.ko
[   71.990277] Unable to handle kernel paging request at virtual address bf055944
[   71.998063] pgd = dd3a4000
[   72.000904] [bf055944] *pgd=9e6f7811, *pte=00000000, *ppte=00000000
[   72.007567] Internal error: Oops: 7 [#1] SMP ARM
[   72.012404] Modules linked in: tps65217(+) evdev musb_dsps musb_hdrc udc_core tps65218_pwrbutton usbcore phy_am335]
[   72.055700] CPU: 0 PID: 243 Comm: modprobe Not tainted 4.9.0-rc5-next-20161114 #3
[   72.063531] Hardware name: Generic AM33XX (Flattened Device Tree)
[   72.069899] task: de714380 task.stack: de7e6000
[   72.074655] PC is at irq_find_matching_fwspec+0x88/0x100
[   72.080211] LR is at 0xde7e79d8
[   72.083496] pc : [<c01a5d88>]    lr : [<de7e79d8>]    psr: 200e0013
[   72.083496] sp : de7e7a78  ip : 00000000  fp : dd138a68
[   72.095506] r10: c0ca04f8  r9 : 00000018  r8 : de7e7ab8
[   72.100973] r7 : 00000001  r6 : c0c4517c  r5 : df963f68  r4 : de321980
[   72.107797] r3 : bf055940  r2 : de714380  r1 : 00000000  r0 : 00000000
[   72.114633] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   72.122084] Control: 10c5387d  Table: 9d3a4019  DAC: 00000051
[   72.128097] Process modprobe (pid: 243, stack limit = 0xde7e6218)
[   72.134489] Stack: (0xde7e7a78 to 0xde7e8000)
[   72.139060] 7a60:                                                       df963f68 de7e7ab8
[   72.147643] 7a80: 00000000 dd0e1000 dd491e20 c01a6ea0 600e0013 c01a5dc0 dd138a68 c0c45138
[   72.156216] 7aa0: df963f68 00000000 df963f68 dd0e1010 00000000 c01a71a4 df963f68 00000001
[   72.164800] 7ac0: 00000002 de7e7ac0 c80048b8 dd0adf00 df963f68 c0c4517c 00000000 de7e7b50
[   72.173369] 7ae0: 00000018 c0ca04f8 dd138a68 c01a5dc0 df963f68 dd0e1010 00000000 dd0e1000
[   72.181942] 7b00: dd491e20 c0653a70 df963f58 00000001 00000002 00000000 00000000 00000000
[   72.190522] 7b20: 600e0093 c0cbf8f0 c0c0512c c0193674 00000001 00000080 00000000 c0554984
[   72.199096] 7b40: 00000000 00000000 800e0013 c0553858 df963f68 00000000 00000000 00000000
[   72.207674] 7b60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   72.216239] 7b80: 00000000 00000000 00000000 00000000 00000000 00000000 dd0e1000 c0544d24
[   72.224816] 7ba0: dd491e10 dd0e1010 dd16e800 bf1d517c bf1d5620 dd0e1010 c1497ed4 bf1d5620
[   72.233398] 7bc0: dd0e1010 fffffdfb bf1d5620 bf1d5620 00000000 c054537c c0545330 dd0e1010
[   72.241967] 7be0: c1497ed4 00000000 bf1d5620 c05433ac 00000000 00000000 de7e7c28 c0543570
[   72.250537] 7c00: 00000001 c1497e90 00000000 c0541884 de080cd4 dd44b7d4 dd0e1010 dd0e1010
[   72.259109] 7c20: dd0e1044 c05430c8 dd0e1010 00000001 dd0e1010 dd0e1018 dd0e1010 c0c9e328
[   72.267676] 7c40: de5d4020 c0542760 dd0e1018 dd0e1010 00000000 c0540ba8 dd138a40 c048dec4
[   72.276253] 7c60: 00000000 dd0e1000 00000001 dd0e1000 dd0e1010 dd0e1000 bf233de0 dd138a40
[   72.284829] 7c80: dd0e1010 c05450a0 000000bf 00000000 dd138a60 00000001 dd0e1000 c0571240
[   72.293398] 7ca0: 00000000 dd1ce9c0 00000040 dd1ce9cc bf233de0 00000003 de5d4020 ffffffff
[   72.301969] 7cc0: 00000004 dd0adf00 00000000 c0571408 00000000 00000000 dd0adf00 de5d4020
[   72.310543] 7ce0: c057146c dd1ce9c0 bf233d14 de5d4020 de7fb3d0 00000004 bf233d14 ffffffff
[   72.319120] 7d00: 00000018 dd49bf30 c01cedc0 c05714d0 00000000 00000000 dd0adf00 de322810
[   72.327692] 7d20: de322810 00000000 dd033000 000000f0 00000001 bf2333fc 00000000 00000000
[   72.336269] 7d40: dd0adf00 de5d4020 000000b6 bf233e40 de5d4020 bf233968 de5d4004 de5d4000
[   72.344848] 7d60: bf233314 c06148ac de5d4020 c1497ed4 00000000 bf233e40 00000000 c05433ac
[   72.353422] 7d80: 00000000 de5d4020 bf233e40 de5d4054 00000000 bf236000 00000000 c0543538
[   72.362002] 7da0: 00000000 bf233e40 c0543484 c05417e4 de1442a4 de5d04d0 bf233e40 de321300
[   72.370582] 7dc0: c0caa5a4 c05429fc bf233be0 bf233e40 c0cbfa44 bf233e40 c0cbfa44 dd2f7740
[   72.379148] 7de0: bf233f00 c05442f0 bf233e8c bf233e24 c0cbfa44 c0615ae0 00000000 bf233f00
[   72.387718] 7e00: c0cbfa44 c010186c 200f0013 c0191650 de714380 00000000 600f0013 00000040
[   72.396286] 7e20: dd2f7740 c018f1ac 00000001 c0c8356c 024000c0 c01a8854 c0c56e0e c028225c
[   72.404863] 7e40: dd2f7740 c0191984 de714380 dd2f7740 00000001 bf233f00 bf233f00 c0cbfa44
[   72.413440] 7e60: dd2f7740 bf233f00 00000001 dd49bf08 dd49bf30 c0230998 00000001 c0c8356c
[   72.421997] 7e80: c0c4c536 c0cbfa44 c0c0512c c01d2070 bf233f0c 00007fff bf233f00 c01cf5b8
[   72.430570] 7ea0: 00000000 c1475134 c01cee34 bf23411c bf233f48 bf234054 bf234150 00000000
[   72.439144] 7ec0: 024002c2 de7fbf40 0009bc20 c02776ac ff800000 00000000 00000000 bf233670
[   72.447723] 7ee0: 00000004 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   72.456298] 7f00: 00000000 00000000 00000000 00000000 c01d2590 0000aa41 00000000 00000000
[   72.464862] 7f20: 000b2549 e12c3a41 00000051 de7e6000 0009bc20 c01d2630 00000530 e12b9000
[   72.473438] 7f40: 0000aa41 e12c1434 e12c1211 e12c336c 00001150 00001620 00000000 00000000
[   72.482003] 7f60: 00000000 000010fc 00000035 00000036 0000001d 0000001a 00000017 00000000
[   72.490564] 7f80: de7e6000 3ba39a00 0009b008 0009b718 00000080 c0107704 de7e6000 00000000
[   72.499141] 7fa0: 0009f609 c0107560 3ba39a00 0009b008 000a7b08 0000aa41 0009bc20 0000aa41
[   72.507717] 7fc0: 3ba39a00 0009b008 0009b718 00000080 00000001 00000008 0009ab14 0009f609
[   72.516290] 7fe0: bea31ab8 bea31aa8 0001e5eb b6e83b42 800f0030 000a7b08 0000ffff 0840ffff
[   72.524883] [<c01a5d88>] (irq_find_matching_fwspec) from [<c01a6ea0>] (irq_create_fwspec_mapping+0x28/0x2e0)
[   72.535174] [<c01a6ea0>] (irq_create_fwspec_mapping) from [<c01a71a4>] (irq_create_of_mapping+0x4c/0x54)
[   72.545115] [<c01a71a4>] (irq_create_of_mapping) from [<c0653a70>] (of_irq_get+0x58/0x68)
[   72.553699] [<c0653a70>] (of_irq_get) from [<c0544d24>] (platform_get_irq+0x1c/0xec)
[   72.561828] [<c0544d24>] (platform_get_irq) from [<bf1d517c>] (tps6521x_pb_probe+0xd0/0x1a8 [tps65218_pwrbutton])
[   72.572581] [<bf1d517c>] (tps6521x_pb_probe [tps65218_pwrbutton]) from [<c054537c>] (platform_drv_probe+0x4c/0xac)
[   72.583426] [<c054537c>] (platform_drv_probe) from [<c05433ac>] (driver_probe_device+0x204/0x2dc)
[   72.592729] [<c05433ac>] (driver_probe_device) from [<c0541884>] (bus_for_each_drv+0x58/0x8c)
[   72.601657] [<c0541884>] (bus_for_each_drv) from [<c05430c8>] (__device_attach+0xb0/0x114)
[   72.610324] [<c05430c8>] (__device_attach) from [<c0542760>] (bus_probe_device+0x88/0x90)
[   72.618898] [<c0542760>] (bus_probe_device) from [<c0540ba8>] (device_add+0x3b8/0x560)
[   72.627203] [<c0540ba8>] (device_add) from [<c05450a0>] (platform_device_add+0xa8/0x208)
[   72.635693] [<c05450a0>] (platform_device_add) from [<c0571240>] (mfd_add_device+0x240/0x338)
[   72.644634] [<c0571240>] (mfd_add_device) from [<c0571408>] (mfd_add_devices+0xa0/0x104)
[   72.653120] [<c0571408>] (mfd_add_devices) from [<c05714d0>] (devm_mfd_add_devices+0x60/0xa8)
[   72.662077] [<c05714d0>] (devm_mfd_add_devices) from [<bf2333fc>] (tps65217_probe+0xe8/0x2ec [tps65217])
[   72.672026] [<bf2333fc>] (tps65217_probe [tps65217]) from [<c06148ac>] (i2c_device_probe+0x168/0x1f4)
[   72.681695] [<c06148ac>] (i2c_device_probe) from [<c05433ac>] (driver_probe_device+0x204/0x2dc)
[   72.690816] [<c05433ac>] (driver_probe_device) from [<c0543538>] (__driver_attach+0xb4/0xb8)
[   72.699657] [<c0543538>] (__driver_attach) from [<c05417e4>] (bus_for_each_dev+0x60/0x94)
[   72.708224] [<c05417e4>] (bus_for_each_dev) from [<c05429fc>] (bus_add_driver+0x18c/0x214)
[   72.716892] [<c05429fc>] (bus_add_driver) from [<c05442f0>] (driver_register+0x78/0xf8)
[   72.725280] [<c05442f0>] (driver_register) from [<c0615ae0>] (i2c_register_driver+0x38/0x80)
[   72.734120] [<c0615ae0>] (i2c_register_driver) from [<c010186c>] (do_one_initcall+0x3c/0x178)
[   72.743055] [<c010186c>] (do_one_initcall) from [<c0230998>] (do_init_module+0x5c/0x1d0)
[   72.751537] [<c0230998>] (do_init_module) from [<c01d2070>] (load_module+0x1d10/0x21c0)
[   72.759933] [<c01d2070>] (load_module) from [<c01d2630>] (SyS_init_module+0x110/0x154)
[   72.768242] [<c01d2630>] (SyS_init_module) from [<c0107560>] (ret_fast_syscall+0x0/0x1c)
[   72.776725] Code: e5944000 e1540006 0a00001b e594300c (e593c004)
[   72.783181] ---[ end trace 0278ec325f4689b8 ]---

Fixes: 6556bdacf6 ("mfd: tps65217: Add support for IRQs")
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:38 +00:00
Keerthy 445c93093d mfd: palmas: Remove redundant check in palmas_power_off
palmas_dev and palmas_power_off are always assigned together.
So the check for palmas_dev inside palmas_power_off function
is redundant. Removing the same.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:38 +00:00
Charles Keepax fb36f77efe mfd: arizona: Disable IRQs during driver remove
As DCVDD will often be supplied by a child node of the MFD, we
can't call mfd_remove_devices as the first step in arizona_dev_exit
as might be expected (tidy up the children before we tidy up the
MFD). We need to disable and put the DCVDD regulator before we call
mfd_remove_devices, to prevent PM runtime from turning this back on we
also need to disable the PM runtime before we do this. Finally we can
not clean up the IRQs until all the MFD children have been removed, as
they may have registered IRQs themselves.

This creates a window of time where the interrupts are enabled but
the PM runtime, on which the IRQ handler depends, is not available,
any interrupts in this window will go unhandled and fill the log with
failed to resume device messages. To avoid this we simply disable the
main IRQ at the start of arizona_dev_exit, we don't need to actually
handle any IRQs in this window as we are removing the driver.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:37 +00:00
Srinivas Kandagatla 953f432b3d mfd: pm8xxx: add support to pm8821
This patch adds support to PM8821 PMIC and interrupt support.
PM8821 is companion device that supplements primary PMIC PM8921 IC.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:36 +00:00
Andy Shevchenko 85a9419a25 mfd: intel-lpss: Try to enable Memory-Write-Invalidate
Enable MWI mechanism if PCI bus master supports it.

It might be potential benefit in some cases. Documentation [1] says that
standard Memory Write might supply more current data than in the CPU modified
cache line and "trashing a line in the cache may trash some data that is more
current that in the memory line". This allows to avoid potential retries and
other performance degradation issues on the bus.

[1] PCI System Architecture, 4th edition, ISBN: 0-201-30974-2, pp.117-119.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:36 +00:00
Pierre-Hugues Husson c5e589a171 mfd: rn5t618: Add Ricoh RC5T619 PMIC support
The Ricoh RN5T567 is from the same family as the Ricoh RN5T618 is,
the differences are:

+ DCDC4/DCDC5
+ LDO7-10
+ Slightly different output voltage/currents
+ 32kHz Output
+ RTC
+ USB Charger detection

Signed-off-by: Pierre-Hugues Husson <phh@phh.me>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:35 +00:00
Chen-Yu Tsai 34d9030b5d mfd: axp20x: Add address extension registers for AXP806 regmap
The AXP806 supports either master/standalone or slave mode.
Slave mode allows sharing the serial bus, even with multiple
AXP806 which all have the same hardware address.

This is done with extra "serial interface address extension",
or AXP806_BUS_ADDR_EXT, and "register address extension", or
AXP806_REG_ADDR_EXT, registers. The former is read-only, with
1 bit customizable at the factory, and 1 bit depending on the
state of an external pin. The latter is writable. Only when
the these device addressing bits (in the upper 4 bits of the
registers) match, will the device respond to operations on
its other registers.

Add these 2 registers to the regmap so we can access them.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:35 +00:00
Wei Yongjun f57576e73c mfd: intel_soc_pmic_bxtwc: Fix a typo in MODULE_DEVICE_TABLE()
Fix a typo in MODULE_DEVICE_TABLE(). 'pmic_acpi_ids' should be
'bxtwc_acpi_ids'.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:34 +00:00
Johan Hovold dd5a8f20c2 mfd: core: Fix device reference leak in mfd_clone_cell
Make sure to drop the reference taken by bus_find_device_by_name()
before returning from mfd_clone_cell().

Fixes: a9bbba9963 ("mfd: add platform_device sharing support for mfd")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:34 +00:00
Christophe JAILLET 794550ffbf mfd: bcm590xx: Simplify a test
'i2c_new_dummy()' does not return an error pointer, so the test can be
simplified to be more consistent.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:33 +00:00
Arnd Bergmann 51a6c60b2f mfd: sun4i-gpadc: Select regmap-irq
The new sun4i mfd driver is lacking a dependency, triggering very rarely
int randconfig kernel builds:

drivers/mfd/sun4i-gpadc.o: In function `sun4i_gpadc_probe':
sun4i-gpadc.c:(.text.sun4i_gpadc_probe+0x110): undefined reference to `devm_regmap_add_irq_chip'

This adds a 'select REGMAP_IRQ', as the other drivers with this problem do.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:33 +00:00
Paul Gortmaker fdae7ba31c mfd: abx500-core: drop unused MODULE_ tags from non-modular code
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config ABX500_CORE
drivers/mfd/Kconfig:    bool "ST-Ericsson ABX500 Mixed Signal Circuit register functions"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that
when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

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-11-29 08:21:32 +00:00
Paul Gortmaker dac94efad2 mfd: ab8500: make sysctrl explicitly non-modular
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 couple traces of modular infrastructure use, so that
when reading the driver there is no doubt it is builtin-only.

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.

We replace module.h with init.h and export.h -- the latter since the file
does make use of EXPORT_SYMBOL.

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-11-29 08:21:32 +00:00
Paul Gortmaker 1d57c39d00 mfd: ab8500-gpadc: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config AB8500_GPADC
drivers/mfd/Kconfig:    bool "ST-Ericsson AB8500 GPADC driver"

...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 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>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:31 +00:00
Paul Gortmaker 4b3f2b60b5 mfd: ab8500-debugfs: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config AB8500_DEBUG
drivers/mfd/Kconfig:       bool "Enable debug info via debugfs"

...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 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-11-29 08:21:30 +00:00
Paul Gortmaker 31cbae2224 mfd: ab8500-core: Make it explicitly non-modular
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-11-29 08:21:30 +00:00
Paul Gortmaker 4be85fc4f8 mfd: ab3100-core: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config AB3100_CORE
drivers/mfd/Kconfig:    bool "ST-Ericsson AB3100 Mixed Signal Circuit core functions"

...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.  In doing
so, the debugfs unregister fcn becomes unused so we remove it too.

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.

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>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:29 +00:00
Colin Ian King d4c55da236 mfd: si476x-i2c: Fix spelling mistakes "Failet" and "gett"
Trivial spelling mistake fixes in dev_err message.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:29 +00:00
Charles Keepax d34bffb5c5 mfd: arizona: Use irq_find_mapping when appropriate
No need to use irq_create_mapping (although there is no issue with
doing so) when we are only looking up an existing mapping. Just to
streamline things a little and make the code a little more clear
change some calls from irq_create_mapping to irq_find_mapping.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:28 +00:00
Viresh Kumar 202b56890a mfd: wm8994-core: Don't use managed regulator bulk get API
The kernel WARNs and then crashes today if wm8994_device_init() fails
after calling devm_regulator_bulk_get().

That happens because there are multiple devices involved here and the
order in which managed resources are freed isn't correct.

The regulators are added as children of wm8994->dev.  Whereas,
devm_regulator_bulk_get() receives wm8994->dev as the device, though it
gets the same regulators which were added as children of wm8994->dev
earlier.

During failures, the children are removed first and the core eventually
calls regulator_unregister() for them. As regulator_put() was never done
for them (opposite of devm_regulator_bulk_get()), the kernel WARNs at

	WARN_ON(rdev->open_count);

And eventually it crashes from debugfs_remove_recursive().

Fix the kernel warnings and crashes by using regulator_bulk_get()
instead of devm_regulator_bulk_get() and explicitly freeing the supplies
in exit paths.

Tested on Exynos 5250, dual core ARM A15 machine.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:27 +00:00
Kuninori Morimoto 8ca9edc837 mfd: davinci_voicecodec: Tidyup header difinitions
mach/hardware.h is needed on C source code side, not header.
And struct davinci_vc is duplicated definition.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:27 +00:00
Richard Fitzgerald ba28f54675 mfd: wm5102: Remove spurious trailing spaces
Remove the trailing spaces on the register default lines to
stop checkpatch complaining.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:26 +00:00
Lee Jones e8ae79d674 mfd: sun4i-gpadc: Fix 'cast from pointer to integer of different size' warning
When building for X86 using COMPILE_TEST we get this warning:

../drivers/mfd/sun4i-gpadc.c: In function ‘sun4i_gpadc_probe’:
../drivers/mfd/sun4i-gpadc.c:110:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Since an integer and a pointer are difference sizes on 64bit architectures.

Convert to case to a long instead.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:26 +00:00
Hans de Goede 41751b033a mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading
The i2c subsys does not load modules by compatible, only by
i2c-id, with e.g. a modalias of: "i2c:axp209".

Populate the axp20x_i2c_id[] table with supported ids, so that
module auto-loading will work.

Reported-by: Dennis Gilmore <dennis@ausil.us>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:25 +00:00
Paul Burton 8e52b61cc8 mfd: syscon: Support native-endian regmaps
The regmap devicetree binding documentation states that a native-endian
property should be supported as well as big-endian & little-endian,
however syscon in its duplication of the parsing of these properties
omits support for native-endian. Fix this by setting
REGMAP_ENDIAN_NATIVE when a native-endian property is found.

Cc: linux-mips@linux-mips.org
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Tested-by: Maciej W. Rozycki <macro@imgtec.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:25 +00:00
Jianhong Chen b2e2c85091 mfd: rk808: RK818 uses DEV_OFF to power off supplies
DEV_OFF and DEV_OFF_RST functions for RK808 are designed error that
only DEV_OFF_RST can power off supplies. RK818 has been fixed this
issue, so that DEV_OFF is used to power off supplies.

Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:24 +00:00
Javier Martinez Canillas a893764ca8 mfd: fsl-imx25-tsadc: Fix module autoload when registered via OF
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/mfd/fsl-imx25-tsadc.ko | grep alias
alias:          platform:mx25-tsadc

After this patch:

$ modinfo drivers/mfd/fsl-imx25-tsadc.ko | grep alias
alias:          platform:mx25-tsadc
alias:          of:N*T*Cfsl,imx25-tsadcC*
alias:          of:N*T*Cfsl,imx25-tsadc

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:24 +00:00
Javier Martinez Canillas e45b6c80b8 mfd: hi655x-pmic: Fix module autoload when registered via OF
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/mfd/hi655x-pmic.ko | grep alias

After this patch:

$ modinfo drivers/mfd/hi655x-pmic.ko | grep alias
alias:          of:N*T*Chisilicon,hi655x-pmicC*
alias:          of:N*T*Chisilicon,hi655x-pmic

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:23 +00:00
Javier Martinez Canillas 108fbd6198 mfd: abx500-core: Allow driver to built if COMPILE_TEST is enabled
The driver only has runtime but no build time dependency with ARCH_U300 ||
ARCH_U8500 So it can be built for testing purposes if COMPILE_TEST option
is enabled.

This is useful to have more build coverage and make sure that the driver
is not affected by changes that could cause build regressions.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:22 +00:00
Jean Delvare 23feb7c6e1 mfd: exynos-lpass: Add hardware dependency
This driver is meant for Exynos systems so do not offer the option
elsewhere unless build-testing.

Cc: Inha Song <ideal.song@samsung.com>
Cc: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:22 +00:00
Arnd Bergmann 054814b863 mfd: tps65912: Move regmap config into core driver
When building with extra warnings enabled, most files including
linux/mfd/tps65912.h warn about a static variable defined in the
header:

include/linux/mfd/tps65912.h:331:35: warning: 'tps65912_regmap_config' defined but not used [-Wunused-const-variable=]

We also duplicate the data structure between the i2c and spi front-end
drivers. Moving it into the driver code avoids the warning and
the duplication.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:21 +00:00
Viresh Kumar bb63f7d33d mfd: wm8994-core: Disable regulators before removing them
The order in which resources were freed in wm8994_device_exit() isn't
correct. The regulators are removed before they are disabled.

Fix it by reordering code a bit, which makes it exact opposite of
wm8994_device_init() as well.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:21 +00:00
Viresh Kumar 3e56c4688e mfd: wm8994-core: Don't split lines unnecessarily
These can fit in a single line (80 columns), don't split lines
unnecessarily.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:20 +00:00
Krzysztof Kozlowski 28e9e55ed3 mfd: Enable compile testing for max77620 and max77686
The OF is not a strict build-time dependency so max77620 and max77686
can be compile tested to increase build coverage.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:20 +00:00
Julia Lawall d87814a3e8 mfd: tc3589x: Improve function-level documentation
Use the correct function name in one case and adjust a variable name to
that of the corresponding function parameter in another case.

Issue detected using Coccinelle (http://coccinelle.lip6.fr/)

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:19 +00:00
Quentin Schulz 937d3a0af5 mfd: Add support for Allwinner SoCs ADC
The Allwinner SoCs all have an ADC that can also act as a touchscreen
controller and a thermal sensor. For now, only the ADC and the thermal
sensor drivers are probed by the MFD, the touchscreen controller support
will be added later.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:19 +00:00
Thor Thayer 7fff7d9b15 dt-bindings: mfd: Add Altera Arria10 System Resource Chip bindings
The Altera Arria10 Devkit System Resource chip is a Multi-Function
Device with a GPIO expander.

This patch adds documentation for the Altera A10-SR DT bindings.

Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:18 +00:00
Praveen Kumar Vegivada b7c5005378 mfd: arizona: Mark AIFx_TX_BCLK_RATE as readable for cs47l24
This register is used in the AIF code but is missing from the register
tables.

Signed-off-by: Praveen Kumar Vegivada <praveen.vegivada@cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-21 13:00:18 +00:00
Dan Gora e420d6a181 mfd: lpc_ich: Use gpio-ich driver for 8-series and 9-series Intel PCH devices
The Intel 8-series and 9-series PCH devices, described by the descriptors
LPC_LPT and LPC_9S although codenamed 'lynxpoint' do not use the same GPIO
register layout which is used by the gpio-lynxpoint driver.  They use the
same ICH_V5_GPIO layout as the gpio-ich driver.

See:
http://www.intel.com/content/www/us/en/chipsets/8-series-chipset-pch-datasheet.html
http://www.intel.com/content/www/us/en/chipsets/9-series-chipset-pch-datasheet.html

The devices described by "Mobile 4th Generation Intel Core Processor
Family I/O" manual use the gpio-lynxpoint driver and are described by the
LPC_LPT_LP descriptor.

See:
http://www.intel.com/content/www/us/en/processors/core/4th-gen-core-family-mobile-i-o-datasheet.html

Signed-off-by: Dan Gora <dg@adax.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-21 13:00:17 +00:00
Icenowy Zheng 3f89586bc1 mfd: axp20x: Add adc volatile ranges for axp22x
AXP22x has also some different register map than axp20x, they're also
added here.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-21 13:00:17 +00:00
Lee Jones 94662d3075 Merge branches 'ib-mfd-arm-leds-4.10' and 'ib-mfd-gpio-input-regulator-4.10' into ibs-for-mfd-merged 2016-11-21 12:59:46 +00:00
Linus Walleij 40a3a0f2ba mfd: qcom-pm8xxx: Clean up PM8XXX namespace
The Kconfig and file naming for the PM8xxx driver is totally
confusing:

- Kconfig options MFD_PM8XXX and MFD_PM8921_CORE, some in-kernel
  users depending on or selecting either at random.
- A driver file named pm8921-core.c even if it is indeed
  used by the whole PM8xxx family of chips.
- An irqchip named pm8xxx since it was (I guess) realized that
  the driver was generic for all pm8xxx PMICs.

As I may want to add support for PM8901 this is starting to get
really messy. Fix this situation by:

- Remove the MFD_PM8921_CORE symbol and rely solely on MFD_PM8XXX
  and convert all users, including LEDs Kconfig and ARM defconfigs
  for qcom and multi_v7 to use that single symbol.
- Renaming the driver to qcom-pm8xxx.c to fit along the two
  other qcom* prefixed drivers.
- Rename functions withing the driver from 8921 to 8xxx to
  indicate it is generic.
- Just drop the =m config from the pxa_defconfig, I have no clue
  why it is even there, it is not a Qualcomm platform. (Possibly
  older Kconfig noise from saveconfig.)

Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Gross <andy.gross@linaro.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-21 12:54:28 +00:00
Keerthy 2dc4940360 regulator: tps65218: Remove all the compatibles
Remove all the individual compatibles for all the regulators
and introduce id_table and update the driver accordingly
to parse device tree nodes using the regulator framework.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-10-26 10:30:39 +01:00
Keerthy 4531156db7 mfd: tps65218: Use mfd_add_devices instead of of_platform_populate
mfd_add_devices enables parsing device tree nodes without compatibles
for regulators and gpio modules. Replace of_platform_populate with
mfd_add_devices. mfd_cell currently is populated with regulators,
gpio and powerbutton.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-10-26 10:30:29 +01:00
Keerthy 77aa99265a input: tps65218-pwrbutton: Add platform_device_id table
platform_device_id table is needed for adding the tps65218-pwrbutton
module to the mfd_cell array.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-10-26 10:30:20 +01:00
Keerthy 38eceb3a44 Documentation: regulator: tps65218: Update examples
This updates the Device Tree according to the preferred way of parsing
the nodes using the regulator framework.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-10-26 10:30:11 +01:00
Keerthy 0aced35575 mfd: tps65218: Remove redundant read wrapper
Currently read directly calls the repmap read function. Hence
remove the redundant wrapper and use regmap read wherever
needed.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-10-26 10:30:02 +01:00
Linus Torvalds 1001354ca3 Linux 4.9-rc1 2016-10-15 12:17:50 -07:00