1
0
Fork 0
Commit Graph

3623 Commits (392910cf3f8a0161d3da45d02ea17f2910d9193b)

Author SHA1 Message Date
Colin Ian King 521d93579f mfd: si476x-i2c: Fix spelling mistake "comptible" -> "compatible"
trivial fix to spelling mistake in dev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29 10:14:31 +01:00
Paul Gortmaker 9eb5f9ba17 mfd: max8925-i2c: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig: config MFD_MAX8925
drivers/mfd/Kconfig:    bool "Maxim Semiconductor MAX8925 PMIC Support"

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

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

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>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29 10:14:30 +01:00
Paul Gortmaker 9cf0c21f40 mfd: max8997: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_MAX8997
drivers/mfd/Kconfig:    bool "Maxim Semiconductor MAX8997/8966 PMIC Support"

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

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

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

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29 10:14:30 +01:00
Paul Gortmaker b9e38338e4 mfd: max8998: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

mfd/Kconfig:config MFD_MAX8998
mfd/Kconfig:    bool "Maxim Semiconductor MAX8998/National LP3974 PMIC Support"

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

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

We delete the include of module.h as well as an unused include of
moduleparam.h too.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

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

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29 10:14:29 +01:00
Paul Gortmaker c1fe7c4526 mfd: max77620: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_MAX77620
drivers/mfd/Kconfig:    bool "Maxim Semiconductor MAX77620 and MAX20024 PMIC Support"

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

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_i2c_driver() uses the same init level priority as
builtin_i2c_driver() 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
was (or is now) contained at the top of the file in the comments.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29 10:14:29 +01:00
Paul Gortmaker 38f70da3c9 mfd: max77843: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_MAX77843
drivers/mfd/Kconfig:    bool "Maxim Semiconductor MAX77843 PMIC Support"

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

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_i2c_driver() uses the same init level priority as
builtin_i2c_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29 10:14:28 +01:00
Hans de Goede 150932506a mfd: axp20x: Extend axp22x_volatile_ranges
The axp22x pmic has a bunch of volatile registers besides the interrupt
ones, extend axp22x_volatile_ranges with these.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29 10:14:27 +01:00
Stefan Agner a370f60a58 mfd: rn5t618: Register restart handler
Use the PMIC's repower capability for reboots. Register a restart
handler and use a slightly elevated priority of 192 since the PMIC
has suprior reset capability (causing a system wide reset).

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29 10:11:35 +01:00
Stefan Agner fd65ae4cb6 mfd: rn5t618: Register power off callback optionally
Only register power off if the PMIC is defined as system power
controller (see Documentation/devicetree/bindings/power/
power-controller.txt).

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29 10:11:35 +01:00
Stefan Agner a99ab50dbb mfd: rn5t618: Add Ricoh RN5T567 PMIC support
The Ricoh RN5T567 is from the same family as the Ricoh RN5T618 is,
the differences are:

+ DCDC4
+ Slightly different output voltage/currents
+ 32kHz Output
- ADC/Charger capabilities

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-29 10:11:23 +01:00
Arnd Bergmann 287980e49f remove lots of IS_ERR_VALUE abuses
Most users of IS_ERR_VALUE() in the kernel are wrong, as they
pass an 'int' into a function that takes an 'unsigned long'
argument. This happens to work because the type is sign-extended
on 64-bit architectures before it gets converted into an
unsigned type.

However, anything that passes an 'unsigned short' or 'unsigned int'
argument into IS_ERR_VALUE() is guaranteed to be broken, as are
8-bit integers and types that are wider than 'unsigned long'.

Andrzej Hajda has already fixed a lot of the worst abusers that
were causing actual bugs, but it would be nice to prevent any
users that are not passing 'unsigned long' arguments.

This patch changes all users of IS_ERR_VALUE() that I could find
on 32-bit ARM randconfig builds and x86 allmodconfig. For the
moment, this doesn't change the definition of IS_ERR_VALUE()
because there are probably still architecture specific users
elsewhere.

Almost all the warnings I got are for files that are better off
using 'if (err)' or 'if (err < 0)'.
The only legitimate user I could find that we get a warning for
is the (32-bit only) freescale fman driver, so I did not remove
the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
For 9pfs, I just worked around one user whose calling conventions
are so obscure that I did not dare change the behavior.

I was using this definition for testing:

 #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
       unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))

which ends up making all 16-bit or wider types work correctly with
the most plausible interpretation of what IS_ERR_VALUE() was supposed
to return according to its users, but also causes a compile-time
warning for any users that do not pass an 'unsigned long' argument.

I suggested this approach earlier this year, but back then we ended
up deciding to just fix the users that are obviously broken. After
the initial warning that caused me to get involved in the discussion
(fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
asked me to send the whole thing again.

[ Updated the 9p parts as per Al Viro  - Linus ]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: https://lkml.org/lkml/2016/1/7/363
Link: https://lkml.org/lkml/2016/5/27/486
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-27 15:26:11 -07:00
Linus Torvalds 6eb59af580 - New Drivers
- Add new driver for MAXIM MAX77620/MAX20024 PMIC
    - Add new driver for Hisilicon HI665X PMIC
  - New Device Support
    - Add support for AXP809 in axp20x-rsb
    - Add support for Power Supply in axp20x
  - New core features
    - devm_mfd_* managed resources
  - Fix-ups
    - Remove unused code; da9063-irq, wm8400-core, tps6105x, smsc-ece1099,
 			 twl4030-power
    - Improve clean-up in error path; intel_quark_i2c_gpio
    - Explicitly include headers; syscon.h
    - Allow building as modules; max77693
    - Use IS_ENABLED() instead of rolling your own; dm355evm_msp, wm8400-core
    - DT adaptions; axp20x, hi655x, arizona, max77620
    - Remove CLK_IS_ROOT flag; intel-lpss, intel_quark
    - Move to gpiochip API; asic3, dm355evm_msp, htc-egpio, htc-i2cpld, sm501,
 				  tc6393xb, tps65010, ucb1x00, vexpress
    - Make use of devm_mfd_* calls; act8945a, as3711, atmel-hlcdc, bcm590xx,
 				   hi6421-pmic-core, lp3943, menf21bmc, mt6397,
 				   rdc321x, rk808, rn5t618, rt5033, sky81452,
 				   stw481x, tps6507x, tps65217, wm8400,
  - Bug Fixes
    - Fix ACPI child matching; mfd-core
    - Fix start-up ordering issues; mt6397-core, arizona-core
    - Fix forgotten register state on resume; intel-lpss
    - Fix Clock related issues; twl6040
    - Fix scheduling whilst atomic; omap-usb-tll
    - Kconfig changes; vexpress
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJXPzwAAAoJEFGvii+H/HdhkPEP/iTvgiL+CpAk7UwAhCNolR5j
 l3vb49lOlmqx87zELdToJmySAd/byiZN0YQEmcn+t4BCs/8CeaWeNkb8vltJvuac
 Fmz88bhXfgFYk87nx/6tRMvuM3fKXlk/YYRZkklV7mkBjcPLiqBZSi/MG/SV53a9
 A+vGW56B2/vHiUgTBkYs9UZNqkFCkmhuVYbHjtFwTfL84lwy9u4tNRrktss6g1lx
 Ak9uiDhaUP/vxKe/7/qCTZXgV/IYb2+tcNjMJ+Cztmyht8VTrhGSXbDPH7MyRYUI
 EBBWRXAQelR5qHxOYDSBNIemZe3AniCBp7tjqcwlN9cdE8q9pJxOk+0XStjC+XeW
 Qt1aIwQisk8jfII8BIGr2pAzc8Jh9/TtcK+wKMRQ2o5g2tvcG90hHIJWQlbdy4ST
 SX799w0KvTItdaMhTHThTOfJRj777v/H2cj8DBCCEeoBHOCHnzbJSIuKahPa9PM3
 W0dyZOpsDXoegyksjBUYjdhGoggjEdirt+oXJe4rY7UxeEml+YZS54fseVzgNzNq
 //Nxk1GMNOVXgo3NrlO8JTs2G5gFPc8VOuPW60G1fm8DyNW13RbUG74QPpSd4U7S
 zZM/OZ3D0E4nrPjXf/GCS3QRwM7p1ubiOgSTTZkaLJYGBcHSezGXK8XpFSNReRop
 Un13GPM09Sl9VN9a2Ybi
 =FSmn
 -----END PGP SIGNATURE-----

Merge tag 'mfd-for-linus-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Drivers:
   - Add new driver for MAXIM MAX77620/MAX20024 PMIC
   - Add new driver for Hisilicon HI665X PMIC

  New Device Support:
   - Add support for AXP809 in axp20x-rsb
   - Add support for Power Supply in axp20x

  New core features:
   - devm_mfd_* managed resources

  Fix-ups:
   - Remove unused code (da9063-irq, wm8400-core, tps6105x,
     smsc-ece1099, twl4030-power)
   - Improve clean-up in error path (intel_quark_i2c_gpio)
   - Explicitly include headers (syscon.h)
   - Allow building as modules (max77693)
   - Use IS_ENABLED() instead of rolling your own (dm355evm_msp,
     wm8400-core)
   - DT adaptions (axp20x, hi655x, arizona, max77620)
   - Remove CLK_IS_ROOT flag (intel-lpss, intel_quark)
   - Move to gpiochip API (asic3, dm355evm_msp, htc-egpio, htc-i2cpld,
     sm501, tc6393xb, tps65010, ucb1x00, vexpress)
   - Make use of devm_mfd_* calls (act8945a, as3711, atmel-hlcdc,
     bcm590xx, hi6421-pmic-core, lp3943, menf21bmc, mt6397, rdc321x,
     rk808, rn5t618, rt5033, sky81452, stw481x, tps6507x, tps65217,
     wm8400)

  Bug Fixes"
   - Fix ACPI child matching (mfd-core)
   - Fix start-up ordering issues (mt6397-core, arizona-core)
   - Fix forgotten register state on resume (intel-lpss)
   - Fix Clock related issues (twl6040)
   - Fix scheduling whilst atomic (omap-usb-tll)
   - Kconfig changes (vexpress)"

* tag 'mfd-for-linus-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (73 commits)
  mfd: hi655x: Add MFD driver for hi655x
  mfd: ab8500-debugfs: Trivial fix of spelling mistake on "between"
  mfd: vexpress: Add !ARCH_USES_GETTIMEOFFSET dependency
  mfd: Add device-tree binding doc for PMIC MAX77620/MAX20024
  mfd: max77620: Add core driver for MAX77620/MAX20024
  mfd: arizona: Add defines for GPSW values that can be used from DT
  mfd: omap-usb-tll: Fix scheduling while atomic BUG
  mfd: wm5110: ARIZONA_CLOCK_CONTROL should be volatile
  mfd: axp20x: Add a cell for the ac power_supply part of the axp20x PMICs
  mfd: intel_soc_pmic_core: Terminate panel control GPIO lookup table correctly
  mfd: wl1273-core: Use devm_mfd_add_devices() for mfd_device registration
  mfd: tps65910: Use devm_mfd_add_devices and devm_regmap_add_irq_chip
  mfd: sec: Use devm_mfd_add_devices and devm_regmap_add_irq_chip
  mfd: rc5t583: Use devm_mfd_add_devices and devm_request_threaded_irq
  mfd: max77686: Use devm_mfd_add_devices and devm_regmap_add_irq_chip
  mfd: as3722: Use devm_mfd_add_devices and devm_regmap_add_irq_chip
  mfd: twl4030-power: Remove driver path in file comment
  MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers
  mfd: smsc-ece1099: Remove unnecessarily remove callback
  mfd: Use IS_ENABLED(CONFIG_FOO) instead of checking FOO || FOO_MODULE
  ...
2016-05-20 11:10:24 -07:00
Chen Feng b52207ef4e mfd: hi655x: Add MFD driver for hi655x
Add PMIC MFD driver to support hisilicon hi665x.

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Fei Wang <w.f@huawei.com>
Signed-off-by: Xinwei Kong <kong.kongxinwei@hisilicon.com>
Reviewed-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-18 08:25:26 +01:00
Linus Torvalds 1eccc6e152 This is the bulk of GPIO changes for kernel cycle v4.7:
Core infrastructural changes:
 
 - Support for natively single-ended GPIO driver stages. This
   means that if the hardware has registers to configure open
   drain or open source configuration, we use that rather than
   (as we did before) try to emulate it by switching the line
   to an input to get high impedance. This is also documented
   throughly in Documentation/gpio/driver.txt for those of you
   who did not understand one word of what I just wrote.
 
 - Start to do away with the unnecessarily complex and
   unitelligible ARCH_REQUIRE_GPIOLIB and
   ARCH_WANT_OPTIONAL_GPIOLIB, another evolutional artifact from
   the time when the GPIO subsystem was unmaintained. Archs can
   now just select GPIOLIB and be done with it, cleanups to
   arches will trickle in for the next kernel. Some minor archs
   ACKed the changes immediately so these are included in this
   pull request.
 
 - Advancing the use of the data pointer inside the GPIO device
   for storing driver data by switching the PowerPC, Super-H
   Unicore and a few other subarches or subsystem drivers in
   ALSA SoC, Input, serial, SSB, staging etc to use it.
 
 - The initialization now reads the input/output state of the
   GPIO lines, so that each GPIO descriptor knows - if this
   callback is implemented - whether the line is input or
   output. This also reflects nicely in userspace "lsgpio".
 
 - It is now possible to name GPIO producer names, line names,
   from the device tree. (Platform data has been supported for
   a while.) I bet we will get a similar mechanism for ACPI
   one of those days. This makes is possible to get sensible
   producer names for e.g. GPIO rails in "lsgpio" in userspace.
 
 New drivers:
 
 - New driver for the Loongson1.
 
 - The XLP driver now supports Broadcom Vulcan ARM64.
 
 - The IT87 driver now supports IT8620 and IT8628.
 
 - The PCA953X driver now supports Galileo Gen2.
 
 Driver improvements:
 
 - MCP23S08 was switched to use the gpiolib irqchip helpers and
   now also suppors level-triggered interrupts.
 
 - 74x164 and RCAR now supports the .set_multiple() callback
 
 - AMDPT was converted to use generic GPIO.
 
 - TC3589x, TPS65218, SX150X, F7188X, MENZ127, VX855, WM831X, WM8994
   support the new single ended callback for open drain
   and in some cases open source.
 
 - Implement the .get_direction() callback for a few more drivers
   like PL061, Xgene.
 
 Cleanups:
 
 - Paul Gortmaker combed through the drivers and de-modularized
   those who are not really modules.
 
 - Move the GPIO poweroff DT bindings to the power subdir where
   they belong.
 
 - Rename gpio-generic.c to gpio-mmio.c, which is much more to the
   point. That's what it is handling, nothing more, nothing less.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXOuJ5AAoJEEEQszewGV1zNXsQAII5wtkP69WRJ3goYBKg1dZN
 DkuLqZyVI4hCgRhptzUW10gDLHKKOCVubfetTJHSpyG/dWDJXPCyH6FHF+pW6lMX
 y+em8kAvWctKpaosy4EM7O55/IohW0/fNCTOfzfrUNivjydFuA2XwPUiPqC7111O
 DeKlC/t+W1JEvZTiKMi83pKq+9wqhiHmD0qxRHhV57S+MT8e7mdlSKOp7uUkKPkg
 LPlerXosnmeFjL2emuSnKl/tq8pOyruU6uaIGG/uwpbo2W86Dok9GY2GWkQ4pANT
 pDtprc4aJ/Clf6Q0CoKwQbmAozqTDeJo+Und9tRs2KuZRly2bWOcyVE0lyK+Y4s0
 544LcKw2q6cB9ARZ6JExEVRJejPISGKMqo9TaHkyNSIJoiiatKYvNS4WVeFtTgbI
 W+1WfM1svPymNRqVPO1PMLV+3m9dalDH2WjtaFF21uCAQ/G0AuPEHjEDbbx0HIpb
 qrvWmYzZ97Rm/LdYROFRO53nEdCp2jh6c3n4/2kGYM8H0suvGxXZsB1g4i+Dm+B+
 qKVTS282azlDuH9ohXeXizeb6atK6s8TC3Rmew97SmXDO00cUQzEQO/ZquRLHY9r
 n83afQ4OL2Z9yruAxAk7pCshVSyheOsHuFPuZ7bwPW31VMdoWNRkhnaTUXMjGfYg
 3y39IHrCKWNMCCVM1iNl
 =z4d6
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v4.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO updates from Linus Walleij:
 "This is the bulk of GPIO changes for kernel cycle v4.7:

  Core infrastructural changes:

   - Support for natively single-ended GPIO driver stages.

     This means that if the hardware has registers to configure open
     drain or open source configuration, we use that rather than (as we
     did before) try to emulate it by switching the line to an input to
     get high impedance.

     This is also documented throughly in Documentation/gpio/driver.txt
     for those of you who did not understand one word of what I just
     wrote.

   - Start to do away with the unnecessarily complex and unitelligible
     ARCH_REQUIRE_GPIOLIB and ARCH_WANT_OPTIONAL_GPIOLIB, another
     evolutional artifact from the time when the GPIO subsystem was
     unmaintained.

     Archs can now just select GPIOLIB and be done with it, cleanups to
     arches will trickle in for the next kernel.  Some minor archs ACKed
     the changes immediately so these are included in this pull request.

   - Advancing the use of the data pointer inside the GPIO device for
     storing driver data by switching the PowerPC, Super-H Unicore and
     a few other subarches or subsystem drivers in ALSA SoC, Input,
     serial, SSB, staging etc to use it.

   - The initialization now reads the input/output state of the GPIO
     lines, so that each GPIO descriptor knows - if this callback is
     implemented - whether the line is input or output.  This also
     reflects nicely in userspace "lsgpio".

   - It is now possible to name GPIO producer names, line names, from
     the device tree.  (Platform data has been supported for a while).
     I bet we will get a similar mechanism for ACPI one of those days.
     This makes is possible to get sensible producer names for e.g.
     GPIO rails in "lsgpio" in userspace.

  New drivers:

   - New driver for the Loongson1.

   - The XLP driver now supports Broadcom Vulcan ARM64.

   - The IT87 driver now supports IT8620 and IT8628.

   - The PCA953X driver now supports Galileo Gen2.

  Driver improvements:

   - MCP23S08 was switched to use the gpiolib irqchip helpers and now
     also suppors level-triggered interrupts.

   - 74x164 and RCAR now supports the .set_multiple() callback

   - AMDPT was converted to use generic GPIO.

   - TC3589x, TPS65218, SX150X, F7188X, MENZ127, VX855, WM831X, WM8994
     support the new single ended callback for open drain and in some
     cases open source.

   - Implement the .get_direction() callback for a few more drivers like
     PL061, Xgene.

  Cleanups:

   - Paul Gortmaker combed through the drivers and de-modularized those
     who are not really modules.

   - Move the GPIO poweroff DT bindings to the power subdir where they
     belong.

   - Rename gpio-generic.c to gpio-mmio.c, which is much more to the
     point.  That's what it is handling, nothing more, nothing less"

* tag 'gpio-v4.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (126 commits)
  MIPS: do away with ARCH_[WANT_OPTIONAL|REQUIRE]_GPIOLIB
  gpio: zevio: make it explicitly non-modular
  gpio: timberdale: make it explicitly non-modular
  gpio: stmpe: make it explicitly non-modular
  gpio: sodaville: make it explicitly non-modular
  pinctrl: sh-pfc: Let gpio_chip.to_irq() return zero on error
  gpio: dwapb: Add ACPI device ID for DWAPB GPIO controller on X-Gene platforms
  gpio: dt-bindings: add wd,mbl-gpio bindings
  gpio: of: make it possible to name GPIO lines
  gpio: make gpiod_to_irq() return negative for NO_IRQ
  gpio: xgene: implement .get_direction()
  gpio: xgene: Enable ACPI support for X-Gene GFC GPIO driver
  gpio: tegra: Implement gpio_get_direction callback
  gpio: set up initial state from .get_direction()
  gpio: rename gpio-generic.c into gpio-mmio.c
  gpio: generic: fix GPIO_GENERIC_PLATFORM is set to module case
  gpio: dwapb: add gpio-signaled acpi event support
  gpio: dwapb: convert device node to fwnode
  gpio: dwapb: remove name from dwapb_port_property
  gpio/qoriq: select IRQ_DOMAIN
  ...
2016-05-17 17:39:42 -07:00
Linus Torvalds 16bf834805 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial tree updates from Jiri Kosina.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (21 commits)
  gitignore: fix wording
  mfd: ab8500-debugfs: fix "between" in printk
  memstick: trivial fix of spelling mistake on management
  cpupowerutils: bench: fix "average"
  treewide: Fix typos in printk
  IB/mlx4: printk fix
  pinctrl: sirf/atlas7: fix printk spelling
  serial: mctrl_gpio: Grammar s/lines GPIOs/line GPIOs/, /sets/set/
  w1: comment spelling s/minmum/minimum/
  Blackfin: comment spelling s/divsor/divisor/
  metag: Fix misspellings in comments.
  ia64: Fix misspellings in comments.
  hexagon: Fix misspellings in comments.
  tools/perf: Fix misspellings in comments.
  cris: Fix misspellings in comments.
  c6x: Fix misspellings in comments.
  blackfin: Fix misspelling of 'register' in comment.
  avr32: Fix misspelling of 'definitions' in comment.
  treewide: Fix typos in printk
  Doc: treewide : Fix typos in DocBook/filesystem.xml
  ...
2016-05-17 17:05:30 -07:00
Colin Ian King 68b21094ef mfd: ab8500-debugfs: Trivial fix of spelling mistake on "between"
fix spelling mistake, beetween -> between

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 16:26:15 +01:00
Arnd Bergmann fcdad4210f mfd: vexpress: Add !ARCH_USES_GETTIMEOFFSET dependency
The MFD_VEXPRESS_SYSREG driver selects CLKSRC_MMIO, which in turn
conflicts with ARCH_USES_GETTIMEOFFSET, causing a harmless Kconfig
warning when it is set:

warning: (ARCH_MVEBU && ARCH_DIGICOLOR && ARCH_GEMINI && ARCH_KEYSTONE && ARCH_MOXART && ARCH_MXS && PLAT_SPEAR && ARCH_SUNXI && ARCH_TEGRA && ARCH_U300 && PLAT_ORION && ARCH_CLPS711X && ARCH_EP93XX && ARCH_NETX && ARCH_IXP4XX && ARCH_KS8695 && ARCH_W90X900 && ARCH_PXA && ARCH_SA1100 && ARCH_OMAP1 && ARCH_BCM_IPROC && ARCH_INTEGRATOR_AP && ARCH_OMAP2PLUS && MFD_VEXPRESS_SYSREG) selects CLKSRC_MMIO which has unmet direct dependencies (!ARCH_USES_GETTIMEOFFSET)

This was apparently hidden by the fact that no ARM platform that
still sets ARCH_USES_GETTIMEOFFSET has gpiolib support, and we
already have a dependency on GPIOLIB that I added a while ago.

However, after 296ad4acb8 ("gpio: remove deps on
ARCH_[WANT_OPTIONAL|REQUIRE]_GPIOLIB"), any platform can enable
CONFIG_GPIOLIB, and that lets us enable MFD_VEXPRESS_SYSREG
as well.

This adds an explicit dependency on !ARCH_USES_GETTIMEOFFSET
to guarantee that we can enable the CLKSRC_MMIO driver without
getting warnings.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 16:26:04 +01:00
Laxman Dewangan 327156c593 mfd: max77620: Add core driver for MAX77620/MAX20024
MAX77620/MAX20024 are Power Management IC from the MAXIM.
It supports RTC, multiple GPIOs, multiple DCDC and LDOs,
watchdog, clock etc.

Add MFD drier to provides common support for accessing the
device; additional drivers is developed on respected subsystem
in order to use the functionality of the device.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 15:42:00 +01:00
Roger Quadros b49b927f16 mfd: omap-usb-tll: Fix scheduling while atomic BUG
We shouldn't be calling clk_prepare_enable()/clk_prepare_disable()
in an atomic context.

Fixes the following issue:

[    5.830970] ehci-omap: OMAP-EHCI Host Controller driver
[    5.830974] driver_register 'ehci-omap'
[    5.895849] driver_register 'wl1271_sdio'
[    5.896870] BUG: scheduling while atomic: udevd/994/0x00000002
[    5.896876] 4 locks held by udevd/994:
[    5.896904]  #0:  (&dev->mutex){......}, at: [<c049597c>] __driver_attach+0x60/0xac
[    5.896923]  #1:  (&dev->mutex){......}, at: [<c049598c>] __driver_attach+0x70/0xac
[    5.896946]  #2:  (tll_lock){+.+...}, at: [<c04c2630>] omap_tll_enable+0x2c/0xd0
[    5.896966]  #3:  (prepare_lock){+.+...}, at: [<c05ce9c8>] clk_prepare_lock+0x48/0xe0
[    5.897042] Modules linked in: wlcore_sdio(+) ehci_omap(+) dwc3_omap snd_soc_ts3a225e leds_is31fl319x bq27xxx_battery_i2c tsc2007 bq27xxx_battery bq2429x_charger ina2xx tca8418_keypad as5013 leds_tca6507 twl6040_vibra gpio_twl6040 bmp085_i2c(+) palmas_gpadc usb3503 palmas_pwrbutton bmg160_i2c(+) bmp085 bma150(+) bmg160_core bmp280 input_polldev snd_soc_omap_mcbsp snd_soc_omap_mcpdm snd_soc_omap snd_pcm_dmaengine
[    5.897048] Preemption disabled at:[<  (null)>]   (null)
[    5.897051]
[    5.897059] CPU: 0 PID: 994 Comm: udevd Not tainted 4.6.0-rc5-letux+ #233
[    5.897062] Hardware name: Generic OMAP5 (Flattened Device Tree)
[    5.897076] [<c010e714>] (unwind_backtrace) from [<c010af34>] (show_stack+0x10/0x14)
[    5.897087] [<c010af34>] (show_stack) from [<c040aa7c>] (dump_stack+0x88/0xc0)
[    5.897099] [<c040aa7c>] (dump_stack) from [<c020c558>] (__schedule_bug+0xac/0xd0)
[    5.897111] [<c020c558>] (__schedule_bug) from [<c06f3d44>] (__schedule+0x88/0x7e4)
[    5.897120] [<c06f3d44>] (__schedule) from [<c06f46d8>] (schedule+0x9c/0xc0)
[    5.897129] [<c06f46d8>] (schedule) from [<c06f4904>] (schedule_preempt_disabled+0x14/0x20)
[    5.897140] [<c06f4904>] (schedule_preempt_disabled) from [<c06f64e4>] (mutex_lock_nested+0x258/0x43c)
[    5.897150] [<c06f64e4>] (mutex_lock_nested) from [<c05ce9c8>] (clk_prepare_lock+0x48/0xe0)
[    5.897160] [<c05ce9c8>] (clk_prepare_lock) from [<c05d0e7c>] (clk_prepare+0x10/0x28)
[    5.897169] [<c05d0e7c>] (clk_prepare) from [<c04c2668>] (omap_tll_enable+0x64/0xd0)
[    5.897180] [<c04c2668>] (omap_tll_enable) from [<c04c1728>] (usbhs_runtime_resume+0x18/0x17c)
[    5.897192] [<c04c1728>] (usbhs_runtime_resume) from [<c049d404>] (pm_generic_runtime_resume+0x2c/0x40)
[    5.897202] [<c049d404>] (pm_generic_runtime_resume) from [<c049f180>] (__rpm_callback+0x38/0x68)
[    5.897210] [<c049f180>] (__rpm_callback) from [<c049f220>] (rpm_callback+0x70/0x88)
[    5.897218] [<c049f220>] (rpm_callback) from [<c04a0a00>] (rpm_resume+0x4ec/0x7ec)
[    5.897227] [<c04a0a00>] (rpm_resume) from [<c04a0f48>] (__pm_runtime_resume+0x4c/0x64)
[    5.897236] [<c04a0f48>] (__pm_runtime_resume) from [<c04958dc>] (driver_probe_device+0x30/0x70)
[    5.897246] [<c04958dc>] (driver_probe_device) from [<c04959a4>] (__driver_attach+0x88/0xac)
[    5.897256] [<c04959a4>] (__driver_attach) from [<c04940f8>] (bus_for_each_dev+0x50/0x84)
[    5.897267] [<c04940f8>] (bus_for_each_dev) from [<c0494e40>] (bus_add_driver+0xcc/0x1e4)
[    5.897276] [<c0494e40>] (bus_add_driver) from [<c0496914>] (driver_register+0xac/0xf4)
[    5.897286] [<c0496914>] (driver_register) from [<c01018e0>] (do_one_initcall+0x100/0x1b8)
[    5.897296] [<c01018e0>] (do_one_initcall) from [<c01c7a54>] (do_init_module+0x58/0x1c0)
[    5.897304] [<c01c7a54>] (do_init_module) from [<c01c8a3c>] (SyS_finit_module+0x88/0x90)
[    5.897313] [<c01c8a3c>] (SyS_finit_module) from [<c0107120>] (ret_fast_syscall+0x0/0x1c)
[    5.912697] ------------[ cut here ]------------
[    5.912711] WARNING: CPU: 0 PID: 994 at kernel/sched/core.c:2996 _raw_spin_unlock+0x28/0x58
[    5.912717] DEBUG_LOCKS_WARN_ON(val > preempt_count())

Cc: <stable@vger.kernel.org>
Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
Tested-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 15:41:48 +01:00
Richard Fitzgerald 409b6246cd mfd: wm5110: ARIZONA_CLOCK_CONTROL should be volatile
Some of the bits in this register can be changed by the codec
so we must mark it volatile.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 15:41:35 +01:00
Michael Haas cd7cf27b8f mfd: axp20x: Add a cell for the ac power_supply part of the axp20x PMICs
As a counterpart to the usb power_supply cell, this commit adds an AC
power_supply cell to the axp20x driver.

Still missing are the RTC backup battery and the main battery charger
cells.

Signed-off-by: Michael Haas <haas@computerlinguist.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 15:41:14 +01:00
Ville Syrjälä 36e6d081cf mfd: intel_soc_pmic_core: Terminate panel control GPIO lookup table correctly
GPIO lookup tables are supposed to be zero terminated. Let's do that
and avoid accidentally walking off the end.

Cc: stable@vger.kernel.org
Fixes: 61dd2ca2d4 ("mfd: intel_soc_pmic_core: Add lookup table for Panel Control as GPIO signal")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 13:27:40 +01:00
Laxman Dewangan 14856f7582 mfd: wl1273-core: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 13:27:39 +01:00
Laxman Dewangan 6167c5bcef mfd: tps65910: Use devm_mfd_add_devices and devm_regmap_add_irq_chip
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>
2016-05-09 13:27:39 +01:00
Laxman Dewangan 3dc6f4aaaf mfd: sec: Use devm_mfd_add_devices and devm_regmap_add_irq_chip
Use devm_mfd_add_devices() for adding MFD child devices and
devm_regmap_add_irq_chip() for IRQ chip registration.

This reduces the error code path and .remove callback for removing
MFD child devices and deleting IRQ chip data.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 13:27:38 +01:00
Laxman Dewangan b36c82724f mfd: rc5t583: Use devm_mfd_add_devices and devm_request_threaded_irq
Use devm_mfd_add_devices() for adding MFD child devices and
devm_request_threaded_irq() for IRQ registration.

This reduces the need of remove callback for removing MFD child
devices and unregistering IRQ.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 13:27:38 +01:00
Laxman Dewangan 1a5422c9e5 mfd: max77686: Use devm_mfd_add_devices and devm_regmap_add_irq_chip
Use devm_mfd_add_devices() for adding MFD child devices and
devm_regmap_add_irq_chip() for IRQ chip registration.

This reduces the error code path and .remove callback for removing
MFD child devices and deleting IRQ chip data.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 13:27:20 +01:00
Laxman Dewangan 0bbfb87c56 mfd: as3722: Use devm_mfd_add_devices and devm_regmap_add_irq_chip
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>
2016-05-09 08:24:46 +01:00
Javier Martinez Canillas ae9810e275 mfd: twl4030-power: Remove driver path in file comment
The driver's file path in the comment is wrong, so just remove it since
these tends to get out of date and they serve very little purpose.

Suggested-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:24:41 +01:00
Laxman Dewangan 030ab2beb4 mfd: smsc-ece1099: Remove unnecessarily remove callback
SMSC MFD driver does not add any MFD child devices via
mfd_add_devices() and hence it is not required to call
mfd_remove_devices() to remove MFD child devices.

Remove the call of the API mfd_remove_devices() which will
result as remove of .remove callback for driver.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:24:01 +01:00
Javier Martinez Canillas 5eb519f3f6 mfd: Use IS_ENABLED(CONFIG_FOO) instead of checking FOO || FOO_MODULE
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:23:56 +01:00
Javier Martinez Canillas d6441dc5ce mfd: twl6040: Disable and unprepare clk32k in twl6040_power() error path
The clk32k clock is prepared and enabled in twl6040_power() but the clock
is left enabled in case of an error while it should be disable/unprepared.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:23:52 +01:00
Javier Martinez Canillas 32852bcab2 mfd: twl6040: Check clk_prepare_enable() return value in twl6040_power()
The clk_prepare_enable() function can fail so check the return
value and propagate the error in case of a failure.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:23:45 +01:00
Mark Brown 38fc2eec95 mfd: tps6105x: Remove linux/regulator/driver.h include
This driver makes no use of linux/regulator/driver.h which should only
be used by drivers implementing a regulator.  Since it's unlikely to
ever need anything from there remove the include.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:21:11 +01:00
Stephen Boyd 36a0c08848 mfd: intel_quark_i2c_gpio: Remove CLK_IS_ROOT
This flag is a no-op now (see commit 47b0eeb3dc "clk: Deprecate
CLK_IS_ROOT", 2016-02-02) so remove it.

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:21:06 +01:00
Stephen Boyd 0f7e70e7da mfd: intel-lpss: Remove CLK_IS_ROOT
This flag is a no-op now (see commit 47b0eeb3dc "clk: Deprecate
CLK_IS_ROOT", 2016-02-02) so remove it.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:21:02 +01:00
Heikki Krogerus 41a3da2b8e mfd: intel-lpss: Save register context on suspend
All configurations are lost and the registers will have
default values when the hardware is suspended and resumed,
so saving the private register space context on suspend, and
restoring it on resume.

Fixes: 4b45efe852 (mfd: Add support for Intel Sunrisepoint LPSS devices)
Cc: stable@vger.kernel.org # v4.3+
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:20:54 +01:00
Dan Carpenter 0e10d549f6 mfd: wm8400-core: Delete wm8400_reg_read()
There was a static checker warning in wm8400_reg_read() because we were
returning u16 and that can't hold the negative error codes.  The
function isn't used, so let's just delete it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:20:45 +01:00
Charles Keepax f83c218c17 mfd: arizona: Update device ordering to allow clean driver removal
Since this commit:

commit b9a8a271c3 ("mfd: make mfd_remove_devices() iterate in reverse
order")

The order in which the MFD children remove has been reversed, as our
driver contains some dependencies between the devices we need to make
some changes to ensure the driver unloads cleanly.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:20:37 +01:00
Henry Chen 1387ff5356 mfd: mt6397: IRQ domain should initialize before mfd_add_devices()
Some sub driver like RTC module need irq domain from parent to create
irq mapping when driver initialize. so move mt6397_irq_init() before
mfd_add_devices().

Acked-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-05-09 08:20:22 +01:00
Jiang Qiu 4ba8cfa79f gpio: dwapb: convert device node to fwnode
This patch converts device node to fwnode for dwapb driver, so
as to provide a unified fwnode for DT and ACPI bindings.

Tested-by: Alan Tull <delicious.quinoa@gmail.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jiang Qiu <qiujiang@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-04-29 11:23:53 +02:00
Jiang Qiu e81591815d gpio: dwapb: remove name from dwapb_port_property
This patch removed the name property from dwapb_port_property.
The name property is redundant, since we can get this info
from dwapb_gpio dev node.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jiang Qiu <qiujiang@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-04-29 11:22:53 +02:00
Colin Ian King c094cf13e5 mfd: ab8500-debugfs: fix "between" in printk
fix spelling mistake, beetween -> between

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-04-28 11:00:50 +02:00
Brian Norris ba5776ab6f mfd: cros_ec: Allow building for ARM64
There are platforms using the ChromeOS embeded controller on ARM64 now,
so let's allow using this driver (without having to use COMPILE_TEST).

Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:59:59 +01:00
Javier Martinez Canillas 8a0aee4a7c mfd: max77686: Use module_i2c_driver() instead of subsys initcall
The driver's init and exit function don't do anything besides adding and
deleting the I2C driver so the module_i2c_driver() macro could be used.

Currently is not being used because the driver is initialized at subsys
initcall level, claiming that this is done to allow consumers devices to
use the resources provided by this driver. But dependencies are in DT so
manual ordering of init calls is not necessary any more.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:59:28 +01:00
Krzysztof Kozlowski 630fd98c0a mfd: max77686/max77693: Fix misspelled Samsung address
Correct smasung.com into samsung.com.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:59:14 +01:00
Linus Walleij 7ad073695d mfd: vexpress-sysreg: Switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:59:06 +01:00
Linus Walleij 7d94352eba mfd: ucb1x00: Use gpiochip data pointer
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:59:00 +01:00
Linus Walleij 22e5e747e7 mfd: tps65010: Use gpiochip data pointer
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:58:51 +01:00
Linus Walleij 4e125f62b7 mfd: tc6393xb: Use gpiochip data pointer
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:58:44 +01:00
Linus Walleij 3a504105f0 mfd: sm501: Use gpiochip data pointer
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Ben Dooks <ben@fluff.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:58:37 +01:00
Linus Walleij ed1c9b3c18 mfd: htc-i2cpld: Use gpiochip data pointer
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:58:30 +01:00
Linus Walleij 8d5f095fc5 mfd: htc-egpio: Use gpiochip data pointer
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Acked-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:58:23 +01:00
Linus Walleij 4363765c85 mfd: dm355evm_msp: Switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:58:16 +01:00
Linus Walleij 082cc46838 mfd: asic3: Use gpiochip data pointer
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:58:06 +01:00
Laxman Dewangan 7825dc0560 mfd: wm8400: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Mark Brown <broonie@kernel.org>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:57:03 +01:00
Laxman Dewangan f3466e7764 mfd: tps65910: Use devm_mfd_add_devices() for mfd_device registration
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>
2016-04-19 07:56:56 +01:00
Laxman Dewangan b89b6b6bcd mfd: tps65217: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .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>
2016-04-19 07:56:49 +01:00
Laxman Dewangan 5635d994fe mfd: tps6507x: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Todd Fischer <todd.fischer@ridgerun.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:56:42 +01:00
Laxman Dewangan e253fb0472 mfd: stw481x: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:56:35 +01:00
Laxman Dewangan 69633beaeb mfd: sky81452: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.
CC: Gyungoh Yoo <jack.yoo@skyworksinc.com>

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:56:28 +01:00
Laxman Dewangan 6b719eba9f mfd: rt5033: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Ingi Kim <ingi2.kim@samsung.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:56:17 +01:00
Laxman Dewangan f41206c9fd mfd: rn5t618: Use devm_mfd_add_devices() for mfd_device registration
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: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:56:06 +01:00
Laxman Dewangan d5623161ac mfd: rk808: Use devm_mfd_add_devices() for mfd_device registration
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: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:55:59 +01:00
Laxman Dewangan 7360544c2b mfd: rdc321x: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:55:52 +01:00
Laxman Dewangan 08e380a53a mfd: mt6397: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: John Crispin <blogic@openwrt.org>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:55:40 +01:00
Laxman Dewangan 7990ad17a9 mfd: menf21bmc: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Andreas Werner <andreas.werner@men.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:55:30 +01:00
Laxman Dewangan c5f2445494 mfd: lp3943: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Milo Kim <milo.kim@ti.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:55:23 +01:00
Laxman Dewangan 9c384b0268 mfd: hi6421-pmic: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:55:15 +01:00
Laxman Dewangan 9148f2c018 mfd: bcm590xx: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Matt Porter <mporter@linaro.org>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:55:05 +01:00
Laxman Dewangan f32fb9a593 mfd: atmel-hlcdc: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:54:58 +01:00
Laxman Dewangan 9c9983267d mfd: as3711: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:54:50 +01:00
Laxman Dewangan f9932c6e66 mfd: act8945a: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Wenyou Yang <wenyou.yang@atmel.com>
CC: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:54:40 +01:00
Laxman Dewangan a8f447be80 mfd: Add resource managed APIs for mfd_add_devices
Add resource managed API devm_mfd_add_devices() for the mfd_add_devices().

This helps in reducing code in error path as it is not required
to call mfd_remove_devices() explicitly to remove all child-devices.
In some cases, it also helps not to implement .remove() callback
which get called during driver unbind.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:54:19 +01:00
Chen-Yu Tsai 20147f0d4f mfd: axp20x: Add support for AXP809 PMIC
The X-Powers AXP809 is a new PMIC that is paired with Allwinner's A80
SoC, along with a slave AXP806 PMIC.

This PMIC is quite similar to the earlier AXP223, though the interrupts
and regulator have changed a bit.

This patch adds support for the interrupts and power button of the PMIC.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:54:08 +01:00
Charles Keepax dedf24a28d mfd: arizona: Fix lockdep recursion warning on set_irq_wake
Avoid a false recursive locking warning from lockdep by adding a lock
class for the arizona IRQ chip.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:54:00 +01:00
Krzysztof Kozlowski 073d4aca34 mfd: max77693: Allow building as a module
The consumer of max77693 regulators on Trats2 board (samsung-usb2-phy
driver) supports deferred probing so the max77693 main MFD driver can be
built now as a module. This gives more flexibility and removes manual
ordering of init calls.

Suggested-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:53:52 +01:00
Steve Twiss c796c50b9c mfd: da9063: Remove unused struct da9063_irq_data and define EVENTS_BUF_LEN
The structure da9063_irq_data and define EVENTS_BUF_LEN are not used, so
remove the redundant entries.

Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:53:42 +01:00
Dan Carpenter 22aab38e7b mfd: lp8788-irq: Uninitialized variable in irq handler
Instead to being true/false, the "handled" is true/uninitialized.
Presumably this doesn't cause that many problems in real life because
normally we handle the IRQ.

Fixes: eea6b7cc53 ('mfd: Add lp8788 mfd driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-11 13:31:40 +01:00
Irina Tirdea ee414de525 mfd: core: Fix ACPI child matching by _HID/_CID
If MDF child devices have separate ACPI nodes identified
by _HID/_CID, they will not be assigned the intended
ACPI companion.

acpi_match_device_ids will return 0 if a the child device
matches the _HID/_CID, so this patch changes the matching
condition to check for 0 on success.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Acked-by: Mika Westerberg <mika.westeberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-11 13:31:40 +01:00
Andy Shevchenko 9caac88639 mfd: intel_quark_i2c_gpio: Switch to use struct device *
There is no need to pass struct pci_dev * to intel_quark_register_i2c_clk() and
intel_quark_unregister_i2c_clk(). Change the parameter to struct device *. As a
result store it in the private struct instead of struct pci_dev *.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-11 13:31:39 +01:00
Andy Shevchenko 7f0c5ae18d mfd: intel_quark_i2c_gpio: Remove clock tree on error path
There is a potential resource leak in case when ->probe() fails. We have to
unregister and remove clock tree which is done here.

This is a follow up to previously pushed commit c4726abce6 ("mfd:
intel_quark_i2c_gpio: Use clkdev_create()") that prevents double free() when
clkdev_drop() followed by kfree() in devm_kcalloc() release stage.

I leave Fixes tag here, but the backporting will require to backport the commit
c4726abce6 ("mfd: intel_quark_i2c_gpio: Use clkdev_create()") first.

Cc: stable@vger.kernel.org
Fixes: 60ae5b9f5c (mfd: intel_quark_i2c_gpio: Add Intel Quark X1000 I2C-GPIO MFD Driver)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-11 13:31:39 +01:00
Colin Ian King 65433fd561 mfd: da9063: Remove unused array mask_events_buf
mask_events_buf is not used, so remove this redundant array.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-11 13:31:38 +01:00
Heikki Krogerus f4d0526603 device property: don't bother the drivers with struct property_set
Since device_add_property_set() now always takes a copy of
the property_set, and also since the fwnode type is always
hard coded to be FWNODE_PDATA, there is no need for the
drivers to deliver the entire struct property_set. The
function can just create the instance of it on its own and
bind the properties from the drivers to it on the spot.

This renames device_add_property_set() to
device_add_properties(). The function now takes struct
property_entry as its parameter instead of struct
property_set.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-09 03:10:50 +02:00
Linus Torvalds 12e7b0a627 - New Drivers
- Freescale Touch Screen ADC
    - X-Powers AXP PMIC with RSB
    - TI TPS65086 Power Management IC (PMIC)
  - New Device Support
    - Supply device PCI IDs for Intel Broxton
  - Fix-ups
    - Move to clkdev_create() API; intel_quark_i2c_gpio
    - Complete re-write of TI's TPS65912 Power Management IC (PMIC)
    - Remove unnecessary function argument; axp20x
    - Separate out bus related code; axp20x
    - Coding Style changes; axp20x
    - Allow more drivers to be compiled as modules
    - Work around false positive 'used uninitialised' warning; db8500-prcmu
  - Bug Fixes
    - Remove do_div(); fsl-imx25-gcq
    - Fix driver init when built-in; tps65010
    - Fix clock-unregister leak; intel-lpss
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJW6+LJAAoJEFGvii+H/Hdh8kQP/2AKYzPZiw9fhLufsDPvXO5m
 BVdLYVyA11oQjQk7/Bh+5Rjz8mR5Tfv4uAJUReC3FOIfC/oJNBfBxYJLDV/P8S0/
 KaCEaZrpNmecKrsy+TjmFYtcRa51THAdjlWEUKRks/ZBjwP4YsNnh5reWe+wB7bS
 NFbCNhpXFvYXaDGH8MRhKqdChzZkxi+lgOBcFCKvUYO5/o6g/ZRUD/0TXUItJDwh
 F8ps5jImHC1imHeRIKWPNrrZqcYasKmObIhvOKMDcwNQPnjrAWq5QuFH4LFhGQ7d
 7NMQrBpaGvZyUNBVtL7ZF1xCJ68wAg/ZvZUkKVkax9ubLbSgf6VXYLQEbq+lyFn7
 H9A79xPAGN2nC9HsGnCqW0c0qgTOz0DIkbpuaxAGlzBt0zooc19i3cuUd7LX0NG8
 ttLaIP1hX6rgvXSFnF0Ihe3iN5A90LTT3ldbn3A8awyS42vEAbUVL9ivRL21BUbB
 ilSTO2W05a9HlIVe43o2euytaGvDYX7RbL/g3WcJLF1pA01RCIDQAI5usMpgF3bf
 fJ7cszll0OVTTb5UzbfrNsxAn4oNtbwMIspMMFe17pbmxqh+4oomM3CkuTrMVQfB
 pA7Uv0jh/mLCV6P52ZEsNiecn0/l0rID8d/DCHjunr2xBWIOrglzZ7n+vLTJMNJ6
 72GVBkYRMLbRm+eph1Tp
 =gTBA
 -----END PGP SIGNATURE-----

Merge tag 'mfd-for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Drivers:
   - Freescale Touch Screen ADC
   - X-Powers AXP PMIC with RSB
   - TI TPS65086 Power Management IC (PMIC)

  New Device Support:
   - Supply device PCI IDs for Intel Broxton

  Fix-ups:
   - Move to clkdev_create() API; intel_quark_i2c_gpio
   - Complete re-write of TI's TPS65912 Power Management IC (PMIC)
   - Remove unnecessary function argument; axp20x
   - Separate out bus related code; axp20x
   - Coding Style changes; axp20x
   - Allow more drivers to be compiled as modules
   - Work around false positive 'used uninitialised' warning; db8500-prcmu

  Bug Fixes:
   - Remove do_div(); fsl-imx25-gcq
   - Fix driver init when built-in; tps65010
   - Fix clock-unregister leak; intel-lpss"

* tag 'mfd-for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (53 commits)
  mfd: intel-lpss: Pass I2C configuration via properties on BXT
  mfd: imx6sx: Add PCIe register definitions for iomuxc gpr
  mfd: ipaq-micro: Use __maybe_unused to hide pm functions
  mfd: max77686: Add max77802 to I2C device ID table
  mfd: max77686: Export OF module alias information
  mfd: max77686: Allow driver to be built as a module
  mfd: stmpe: Add the proper PWM resources
  mfd: tps65090: Set regmap config reg counts properly
  mfd: syscon: Return ENOTSUPP instead of ENOSYS when disabled
  mfd: as3711: Set regmap config reg counts properly
  mfd: rc5t583: Set regmap config reg counts properly
  gpio: tps65086: Add GPO driver for the TPS65086 PMIC
  mfd: mt6397: Add platform device ID table
  mfd: da9063: Fix missing volatile registers in the core regmap_range volatile lists
  mfd: mt6397: Add MT6323 support to MT6397 driver
  mfd: mt6397: Add support for different Slave types
  mfd: mt6397: int_con and int_status may vary in location
  dt-bindings: mfd: Add bindings for the MediaTek MT6323 PMIC
  mfd: da9062: Fix missing volatile registers in the core regmap_range volatile lists
  mfd: Add documentation for ACT8945A DT bindings
  ...
2016-03-18 10:15:11 -07:00
Linus Torvalds 1a46712aa9 This is the bulk of GPIO changes for kernel v4.6:
Core changes:
 
 - The gpio_chip is now a *real device*. Until now the gpio chips
   were just piggybacking the parent device or (gasp) floating in
   space outside of the device model. We now finally make GPIO chips
   devices. The gpio_chip will create a gpio_device which contains
   a struct device, and this gpio_device struct is kept private.
   Anything that needs to be kept private from the rest of the kernel
   will gradually be moved over to the gpio_device.
 
 - As a result of making the gpio_device a real device, we have added
   resource management, so devm_gpiochip_add_data() will cut down on
   overhead and reduce code lines. A huge slew of patches convert
   almost all drivers in the subsystem to use this.
 
 - Building on making the GPIO a real device, we add the first step
   of a new userspace ABI: the GPIO character device. We take small
   steps here, so we first add a pure *information* ABI and the tool
   "lsgpio" that will list all GPIO devices on the system and all
   lines on these devices. We can now discover GPIOs properly from
   userspace. We still have not come up with a way to actually *use*
   GPIOs from userspace.
 
 - To encourage people to use the character device for the future,
   we have it always-enabled when using GPIO. The old sysfs ABI is
   still opt-in (and can be used in parallel), but is marked as
   deprecated. We will keep it around for the foreseeable future,
   but it will not be extended to cover ever more use cases.
 
 Cleanup:
 
 - Bjorn Helgaas removed a whole slew of per-architecture <asm/gpio.h>
   includes. This dates back to when GPIO was an opt-in feature and
   no shared library even existed: just a header file with proper
   prototypes was provided and all semantics were up to the arch to
   implement. These patches make the GPIO chip even more a proper
   device and cleans out leftovers of the old in-kernel API here
   and there. Still some cruft is left but it's very little now.
 
 - There is still some clamping of return values for .get() going
   on, but we now return sane values in the vast majority of drivers
   and the errorpath is sanitized. Some patches for powerpc, blackfin
   and unicore still drop in.
 
 - We continue to switch the ARM, MIPS, blackfin, m68k local GPIO
   implementations to use gpiochip_add_data() and cut down on code
   lines.
 
 - MPC8xxx is converted to use the generic GPIO helpers.
 
 - ATH79 is converted to use the generic GPIO helpers.
 
 New drivers:
 
 - WinSystems WS16C48
 
 - Acces 104-DIO-48E
 
 - F81866 (a F7188x variant)
 
 - Qoric (a MPC8xxx variant)
 
 - TS-4800
 
 - SPI serializers (pisosr): simple 74xx shift registers connected
   to SPI to obtain a dirt-cheap output-only GPIO expander.
 
 - Texas Instruments TPIC2810
 
 - Texas Instruments TPS65218
 
 - Texas Instruments TPS65912
 
 - X-Gene (ARM64) standby GPIO controller
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJW6m24AAoJEEEQszewGV1zUasP/RpTrjRcNI5QFHjudd2oioDx
 R/IljC06Q072ZqVy/MR7QxwhoU8jUnCgKgv4rgMa1OcfHblxC2R1+YBKOUSij831
 E+SYmYDYmoMhN7j5Aslr66MXg1rLdFSdCZWemuyNruAK8bx6cTE1AWS8AELQzzTn
 Re/CPpCDbujLy0ZK2wJHgr9ZkdcBGICtDRCrOR3Kyjpwk/DSZcruK1PDN+VQMI3k
 bJlwgtGenOHINgCq/16edpwj/hzmoJXhTOZXJHI5XVR6czTwb3SvCYACvCkauI/a
 /N7b3quG88b5y0OPQPVxp5+VVl9GyVcv5oGzIfTNat/g5QinShZIT4kVV9r0xu6/
 TQHh1HlXleh+QI3yX0oRv9ztHreMf+vdpw1dhIwLqHqfJ7AWdOGk7BbKjwCrsOoq
 t/qUVFnyvooLpyr53Z5JY8+LqyynHF68G+jUQyHLgTZ0GCE+z+1jqNl1T501n3kv
 3CSlNYxSN/YUBN3cnroAIU/ZWcV4YRdxmOtEWP+7xgcdzTE6s/JHb2fuEfVHzWPf
 mHWtJGy8U0IR4VSSEln5RtjhRr0PAjTHeTOGAmivUnaIGDziTowyUVF+X5hwC77E
 DGTuLVx/Kniv173DK7xNAsUZNAETBa3fQZTgu+RfOpMiM1FZc7tI1rd7K7PjbyCc
 d2M0gcq+d11ITJTxC7OM
 =9AJ4
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO updates from Linus Walleij:
 "This is the bulk of GPIO changes for kernel v4.6.  There is quite a
  lot of interesting stuff going on.

  The patches to other subsystems and arch-wide are ACKed as far as
  possible, though I consider things like per-arch <asm/gpio.h> as
  essentially a part of the GPIO subsystem so it should not be needed.

  Core changes:

   - The gpio_chip is now a *real device*.  Until now the gpio chips
     were just piggybacking the parent device or (gasp) floating in
     space outside of the device model.

     We now finally make GPIO chips devices.  The gpio_chip will create
     a gpio_device which contains a struct device, and this gpio_device
     struct is kept private.  Anything that needs to be kept private
     from the rest of the kernel will gradually be moved over to the
     gpio_device.

   - As a result of making the gpio_device a real device, we have added
     resource management, so devm_gpiochip_add_data() will cut down on
     overhead and reduce code lines.  A huge slew of patches convert
     almost all drivers in the subsystem to use this.

   - Building on making the GPIO a real device, we add the first step of
     a new userspace ABI: the GPIO character device.  We take small
     steps here, so we first add a pure *information* ABI and the tool
     "lsgpio" that will list all GPIO devices on the system and all
     lines on these devices.

     We can now discover GPIOs properly from userspace.  We still have
     not come up with a way to actually *use* GPIOs from userspace.

   - To encourage people to use the character device for the future, we
     have it always-enabled when using GPIO.  The old sysfs ABI is still
     opt-in (and can be used in parallel), but is marked as deprecated.

     We will keep it around for the foreseeable future, but it will not
     be extended to cover ever more use cases.

  Cleanup:

   - Bjorn Helgaas removed a whole slew of per-architecture <asm/gpio.h>
     includes.

     This dates back to when GPIO was an opt-in feature and no shared
     library even existed: just a header file with proper prototypes was
     provided and all semantics were up to the arch to implement.  These
     patches make the GPIO chip even more a proper device and cleans out
     leftovers of the old in-kernel API here and there.

     Still some cruft is left but it's very little now.

   - There is still some clamping of return values for .get() going on,
     but we now return sane values in the vast majority of drivers and
     the errorpath is sanitized.  Some patches for powerpc, blackfin and
     unicore still drop in.

   - We continue to switch the ARM, MIPS, blackfin, m68k local GPIO
     implementations to use gpiochip_add_data() and cut down on code
     lines.

   - MPC8xxx is converted to use the generic GPIO helpers.

   - ATH79 is converted to use the generic GPIO helpers.

  New drivers:

   - WinSystems WS16C48

   - Acces 104-DIO-48E

   - F81866 (a F7188x variant)

   - Qoric (a MPC8xxx variant)

   - TS-4800

   - SPI serializers (pisosr): simple 74xx shift registers connected to
     SPI to obtain a dirt-cheap output-only GPIO expander.

   - Texas Instruments TPIC2810

   - Texas Instruments TPS65218

   - Texas Instruments TPS65912

   - X-Gene (ARM64) standby GPIO controller"

* tag 'gpio-v4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (194 commits)
  Revert "Share upstreaming patches"
  gpio: mcp23s08: Fix clearing of interrupt.
  gpiolib: Fix comment referring to gpio_*() in gpiod_*()
  gpio: pca953x: Fix pca953x_gpio_set_multiple() on 64-bit
  gpio: xgene: Fix kconfig for standby GIPO contoller
  gpio: Add generic serializer DT binding
  gpio: uapi: use 0xB4 as ioctl() major
  gpio: tps65912: fix bad merge
  Revert "gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free"
  gpio: omap: drop dev field from gpio_bank structure
  gpio: mpc8xxx: Slightly update the code for better readability
  gpio: mpc8xxx: Remove *read_reg and *write_reg from struct mpc8xxx_gpio_chip
  gpio: mpc8xxx: Fixup setting gpio direction output
  gpio: mcp23s08: Add support for mcp23s18
  dt-bindings: gpio: altera: Fix altr,interrupt-type property
  gpio: add driver for MEN 16Z127 GPIO controller
  gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free
  gpio: timberdale: Switch to devm_ioremap_resource()
  gpio: ts4800: Add IMX51 dependency
  gpiolib: rewrite gpiodev_add_to_list
  ...
2016-03-17 21:05:32 -07:00
Mika Westerberg 0343b2f4e4 mfd: intel-lpss: Pass I2C configuration via properties on BXT
I2C host controller need to be configured properly in order to meet I2C
timings specified in the I2C protocol specification. Some Intel Broxton
based machines do not have this information in the ACPI namespace (or the
boot firmware does not support ACPI at all) so we use build-in device
properties instead.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:42 +00:00
Arnd Bergmann dcdf11739d mfd: ipaq-micro: Use __maybe_unused to hide pm functions
The ipaq-micro driver uses SET_SYSTEM_SLEEP_PM_OPS() to
remove the reference to its resume function, but does
not use an #ifdef around the definition, so we get
a build warning:

drivers/mfd/ipaq-micro.c:379:12: error: 'micro_resume' defined but not used [-Werror=unused-function]

This adds a __maybe_unused annotation so the compiler knows
it can silently drop it instead of warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:41 +00:00
Javier Martinez Canillas 95a6f715bc mfd: max77686: Add max77802 to I2C device ID table
The max77686 MFD driver supports both the Maxim 77686 and Maxim 77802
PMICs but only the OF device table contains entries for both devices.

The max77802 entry is missing in the I2C device ID table which isn't
a problem currently since the driver only supports DT but it will be
needed if the driver is changed to be built as a module since the I2C
core always reports a I2C modalias uevent so auto-load will not work.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:40 +00:00
Javier Martinez Canillas 7f8ada1a84 mfd: max77686: Export OF module alias information
When the device is registered via OF, the OF table is used to match the
driver instead of the I2C device ID table but the entries in the latter
are used as aliasses to load the module if the driver was not built-in.

This is because the I2C core always reports an I2C module alias instead
of an OF one but that could change so it is better to always export it.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:39 +00:00
Javier Martinez Canillas a52e46ce9c mfd: max77686: Allow driver to be built as a module
The driver's Kconfig symbol is a boolean but nothing prevents the driver
to be built as a module instead of built-in. It is true that most system
integrators will choose the latter but the config should not restrict it.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:38 +00:00
Linus Walleij b273c5e0b6 mfd: stmpe: Add the proper PWM resources
This adds the PWM resources to the STMPE MFD driver, so that
it can properly grab and use them.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:37 +00:00
Maciej S. Szmigiero 5c1488906f mfd: tps65090: Set regmap config reg counts properly
Regmap config max_register field should contain number of
device last register, however num_reg_defaults_raw field
should be set to register count instead
(usually one register more than max_register).

tps65090 driver had both of these fields set to the same value,
fix this by introducing separate defines for max register
number and total count of registers.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:36 +00:00
Maciej S. Szmigiero e9b7ba7954 mfd: as3711: Set regmap config reg counts properly
Regmap config max_register field should contain number of
device last register, however num_reg_defaults_raw field
should be set to register count instead
(usually one register more than max_register).

as3711 driver had both of these fields set to the same value,
fix this by introducing separate defines for max register
number and total count of registers.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:34 +00:00
Maciej S. Szmigiero a862dc3ea7 mfd: rc5t583: Set regmap config reg counts properly
Regmap config max_register field should contain number of
device last register, however num_reg_defaults_raw field
should be set to register count instead
(usually one register more than max_register).

rc5t583 driver had both of these fields set to the same value,
fix this by introducing separate defines for max register
number and total count of registers.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:34 +00:00
Javier Martinez Canillas e1d9a10918 mfd: mt6397: Add platform device ID table
The platform bus_type .match callback attempts to match the platform device
name with an entry on the .id_table if provided and fallbacks to match with
the driver's name if a table is not provided.

Using a platform device ID to match is more explicit, allows the driver to
support more than one device and also the MODULE_DEVICE_TABLE macro can be
used to export the module aliases information instead of the MODULE_ALIAS.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:32 +00:00
Steve Twiss 0e5df61d26 mfd: da9063: Fix missing volatile registers in the core regmap_range volatile lists
Add an updated set of registers listed in the core regmap_range volatile
ranges defined for the DA9063.

These new registers contain bits that cannot be considered under the full
control of software. Under various conditions the hardware will set and/or
automatically clear bit(s) contained in these registers.

When using a cached version of regmap, the volatility of these registers must
be identified otherwise the regmap operations may not ensure the registers
are explicitly altered.

As well as updating the list of volatile registers, this change will fix a
corner case discovered in the DA9063 ONKEY which is used by the DA9063 core.

In the ONKEY case, the CONTROL_B register is now listed as volatile in the
regmap_range because it contains the bit field NONKEY_LOCK. This bit can be
altered by hardware, in which case regmap must be notified of its ability
to be manpiulated outside of software control.

Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:31 +00:00
John Crispin 44760cf3bf mfd: mt6397: Add MT6323 support to MT6397 driver
Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:30 +00:00
John Crispin 1d2c25ed45 mfd: mt6397: Add support for different Slave types
Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:29 +00:00
John Crispin feec4799ac mfd: mt6397: int_con and int_status may vary in location
MT6323 has the INT_CON and INT_STATUS located at a different position.
Make the registers locations configurable.

Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:28 +00:00
Steve Twiss bf742a53ce mfd: da9062: Fix missing volatile registers in the core regmap_range volatile lists
Add an updated set of registers listed in the core regmap_range volatile
ranges defined for the DA9062.

These new registers contain bits that cannot be considered under the full
control of software. Under various conditions the hardware will set and/or
automatically clear bit(s) contained in these registers.

When using a cached version of regmap, the volatility of these registers must
be identified otherwise the regmap operations may not ensure the registers
are explicitly altered.

As well as updating the list of volatile registers, this change will fix a
corner case discovered in the DA9063 ONKEY which is used by the DA9062 core.

In the ONKEY case, the CONTROL_B register is now listed as volatile in the
regmap_range because it contains the bit field NONKEY_LOCK. This bit can be
altered by hardware, in which case regmap must be notified of its ability
to be manpiulated outside of software control.

Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:27 +00:00
Wenyou Yang b25c6b7d28 mfd: act8945a: Add Active-semi ACT8945A PMIC MFD driver
This patch adds support for the Active-semi ACT8945A PMIC.
It is a Multi Function Device with the following subdevices:
 - Regulator
 - Charger

It is interfaced to the host controller using I2C interface,
ACT8945A is a child device of the I2C.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:25 +00:00
Charles Keepax f4d34c94ff mfd: arizona: Remove duplicate select of MFD_CORE
MFD_ARIZONA_I2C and MFD_ARIZONA_SPI both select MFD_ARIZONA and all
three of those select MFD_CORE, this makes the selects of MFD_CORE in
MFD_ARIZONA_I2C and MFD_ARIZONA_SPI redundant, so we remove them.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:23 +00:00
Charles Keepax 21aca3bf0d mfd: cs47l24: Fix defaults array based on testing
My automated test is back and now can check defaults against the actual
hardware. This patch updates the defaults array for the differences
detected and removes a couple of completely unused registers.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:22 +00:00
Charles Keepax 9edd83c782 mfd: wm8998: Fix defaults array based on testing
My automated test is back and now can check defaults against the actual
hardware. This patch updates the defaults array for the differences
detected and removes a couple of completely unused registers.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:22 +00:00
Charles Keepax 516c95f0b0 mfd: wm5102: Fix defaults array based on testing
My automated test is back and now can check defaults against the actual
hardware. This patch updates the defaults array for the differences
detected and removes a couple of completely unused registers.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:21 +00:00
Charles Keepax 036fa859cd mfd: wm5110: Fix defaults array based on testing
My automated test is back and now can check defaults against the actual
hardware. This patch updates the defaults array for the differences
detected and removes a couple of completely unused registers.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:20 +00:00
Charles Keepax 5dbd47840a mfd: arizona: Update small typo in Arizona SPI Kconfig
The help text had a copy and paste error and refers to I2C in the SPI
section. This patch corrects this typo.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:19 +00:00
Philipp Zabel c131045d5b mfd: syscon: Make syscon_regmap_config const
syscon_regmap_config can be made const if syscon_probe() creates a local
copy on the stack, just like syscon_register() does.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:18 +00:00
Philipp Zabel ca668f0edf mfd: syscon: Set regmap max_register in of_syscon_register
Determine the regmap max_register configuration from the io resource size
and the reg-io-width device tree property.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:17 +00:00
Arnd Bergmann a7e4631772 mfd: db8500: Avoid uninitialized variable reference
The prcmu_config_clkout() function ensures that the 'clkout' argument
can only be '0' or '1' using an appropriate BUG_ON(), so the compiler
should know that the div_mask, mask, and bits variables are always
initialized later on. However, it doesn't understand this in gcc-5.2
and produces a false positive warning instead:

drivers/mfd/db8500-prcmu.c: In function 'prcmu_config_clkout':
drivers/mfd/db8500-prcmu.c:762:10: error: 'div_mask' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  if (val & div_mask) {
          ^
drivers/mfd/db8500-prcmu.c:769:13: error: 'mask' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    if ((val & mask & ~div_mask) != bits) {
             ^
drivers/mfd/db8500-prcmu.c:757:7: error: 'bits' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Replacing the switch() statement with an equivalent if() lets
gcc figure this out reliably and avoids the warnings.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:16 +00:00
Andrew F. Davis b45b719ee0 mfd: tps65086: Add driver for the TPS65086 PMIC
Add support for the TPS65912 device. It provides communication
through I2C and contains the following components:

 - Regulators
 - Load switches
 - GPO controller

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:15 +00:00
Linus Torvalds 13f6f62f61 RTC for 4.6
Core:
  - New sysfs interface to set and read clock offset
  - Drivers can now be both I2C and SPI (see pcf2127 and ds3232)
 
 New drivers:
  - Alphascale ASM9260
  - Epson RX6110SA
  - Maxim max20024 and max77620 (in max77686)
  - Microchip PIC32
  - NXP pcf2129 (in pcf2127)
 
 Subsystem wide cleanups:
  - remove IRQF_EARLY_RESUME when unecessary
 
 Drivers:
  - ds1307: clock output, temperature sensor and wakeup-source support
  - ds1685: actually spin forever in poweroff error path
  - ds3232: many cleanups
  - ds3234: merged in ds3232
  - hym8563: fix invalid year calculation
  - max77686: many cleanups
  - max77802 merged in max77686
  - pcf2123: cleanups and offset support
  - pcf85063: cleanups
  - pcf8523: propely handle oscillator stop bit
  - rv3029: many cleanups, trickle charger and temperature sensor support
  - rv8803: convert spin_lock to mutex_lock
  - rx8025: many fixes
  - vr41xx: restore alarm_irq_enable
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJW5uWTAAoJEKbNnwlvZCyzUmAP/3/bxOtQ9QUq4nLIVb/dR9G0
 yNY5L/RmgQ/x3CJqMkGQImyj4rSEmwdHJSWakv/hGh5iTINtZrw4sl79YKNoTQlB
 LaXAse1sXzhyfLzH8jYrrzpq14z1kv/LlUPtgFf1arcaRMdjw1kabdIqHnsv0nH2
 fvyj3O0qW/KWWYongViiXW94dr8uQXoMVR4M/M8OmG6j6Lw1Kd7gKDZx02dqbo8+
 NNQQYAswSxzHCZirIv5Xyjdrz1gIuaWghEdbaVY6BW+CuT8NcC2if1BoYo6xR/Qe
 KC6M5MGY4xogOxP8+EkH1/GycXx1mwrisJSTxJh9YKMDnLgi9YnTjXnO4t9kQyoK
 HOspgaHhGHRONNc2dADJqm55SbLUKBEXVTk/Tzq6BJvTKmZmrisAUhWxISLscHwP
 QPU//fLxyerC/tMKoFyuG7yDtd5VofWThLQV8sF0wcX8AKfLaUIEnN69euCk9mVj
 +eCwkYyOly0UeYdeXkrnHczIFffzMTENpz9Q8TkrLF1UOMI7nCOb/jCo6hKidEEB
 ymgHHzhhGeppfEQgU+MsXOxG0E9Ku4gXGOaVk/q7zxyiBhXOmMpoHk6nshKq0A0S
 eBKmd0BWS0GwXJ+dABfHuI6MSay3A7Bn+fLLoD8LTPMJEONyvOGxDNSH3DymD9JR
 LpDO4HnalG1ao+eXcD+U
 =+x1Q
 -----END PGP SIGNATURE-----

Merge tag 'rtc-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux

Pull RTC updates from Alexandre Belloni:
 "Core:
   - New sysfs interface to set and read clock offset
   - Drivers can now be both I2C and SPI (see pcf2127 and ds3232)

  New drivers:
   - Alphascale ASM9260
   - Epson RX6110SA
   - Maxim max20024 and max77620 (in max77686)
   - Microchip PIC32
   - NXP pcf2129 (in pcf2127)

  Subsystem wide cleanups:
   - remove IRQF_EARLY_RESUME when unecessary

  Drivers:
   - ds1307: clock output, temperature sensor and wakeup-source support
   - ds1685: actually spin forever in poweroff error path
   - ds3232: many cleanups
   - ds3234: merged in ds3232
   - hym8563: fix invalid year calculation
   - max77686: many cleanups
   - max77802 merged in max77686
   - pcf2123: cleanups and offset support
   - pcf85063: cleanups
   - pcf8523: propely handle oscillator stop bit
   - rv3029: many cleanups, trickle charger and temperature sensor support
   - rv8803: convert spin_lock to mutex_lock
   - rx8025: many fixes
   - vr41xx: restore alarm_irq_enable"

* tag 'rtc-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (86 commits)
  rtc: pcf2127: add pcf2129 device id
  rtc: pcf2127: add support for spi interface
  rtc: pcf2127: convert to use regmap
  rtc: rv3029: Add thermometer hwmon support
  rtc: rv3029: Add update_bits helper for eeprom access
  rtc: ds1685: actually spin forever in poweroff error path
  rtc: hym8563: fix invalid year calculation
  rtc: ds3232: use rtc->ops_lock to protect alarm operations
  rtc: ds3232: fix issue when irq is shared several devices
  rtc: ds3232: remove unused UIE code
  rtc: ds3232: add register access error checks
  rtc: ds3232: fix read on /dev/rtc after RTC_AIE_ON
  rtc: merge ds3232 and ds3234
  rtc: ds3232: convert to use regmap
  rtc: pxa: fix Kconfig indentation
  rtc: rv3029: Add device tree property for trickle charger
  rtc: rv3029: Add functions for EEPROM access
  rtc: rv3029: Add i2c register update-bits helper
  rtc: rv3029: Add missing register definitions
  rtc: rv3029: Add "rv3029" I2C device id
  ...
2016-03-15 21:58:58 -07:00
Laxman Dewangan f3937549a9 rtc: max77686: move initialisation of rtc regmap, irq chip locally
To make RTC block of MAX77686/MAX77802 as independent driver,
move the registration of i2c device, regmap for register access
and irq_chip for interrupt support inside the RTC driver.
Removed the same initialisation from MFD driver.

Having this change will allow to reuse this driver for different
PMIC/devices from Maxim Semiconductor if they kept same RTC IP on
different PMIC. Some of examples as PMIC MAX77620, MAX20024 where
same RTC IP used and hence driver for these chips will use this
driver only for RTC support.

Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14 17:08:13 +01:00
Laxman Dewangan 08e37ef17d mfd: max77686: do not set i2c client data for rtc i2c client
There is different RTC I2C address for RTC block in MAX77686.
Driver is creating dummy i2c client for this address to access
the register of this IP block.

As there is no call to i2c_get_clientdata() for rtc_i2c client,
there is no need to store pointer and hence removing the call
to set client data for rtc i2c client.

Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14 17:08:12 +01:00
Linus Walleij 0bae2f1732 Merge branch 'ib-mfd-regulator-gpio-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into devel 2016-03-09 17:40:37 +07:00
Huiquan Zhong 023269cc98 mfd: lpss: Add PCI IDs for Intel Broxton B-Step platform
Add PCI IDs for Intel Broxton B-Step platform, which have same
LPSS devices with A-Step.

Signed-off-by: Huiquan Zhong <huiquan.zhong@intel.com>
Signed-off-by: Qipeng Zha <qipeng.zha@intel.com>
cked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-09 12:58:53 +07:00
Axel Lin c2e04af072 mfd: Allow i2c modular drivers to build with I2C=m
These drivers can be built as module, so make them depend on I2C rather
than I2C=y.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-09 12:58:52 +07:00
Andy Shevchenko 84cb36cac5 mfd: intel-lpss: Remove clock tree on error path
We forgot to remove the clock tree if something goes wrong in ->probe(). Add a
call to intel_lpss_unregister_clock() on error path in ->probe() to fix the
potential issue.

Fixes: 4b45efe852 (mfd: Add support for Intel Sunrisepoint LPSS devices)
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-03-09 12:58:51 +07:00
Aaro Koskinen dbc352b9f1 mfd: tps65010: Fix init when the driver is built-in
tps65010 driver's initcall cannot succeed when the driver is built-in,
because it expects that the I2C probe is completed at initcall time;
this cannot happen as MFD is initialized before I2C. Also on systems
where the chip is not present there is unnecessary 30 ms delay during
the boot.

Instead of waiting for probe to finish, just register the I2C device.
If some boards need retry mechanism for startup glitches, that should be
done in the actual probe function. Also delete the driver banner message.

The patch allows to use tps65010 again with OMAP1 (where it's required
to be built-in) and enables e.g. USB and LED functionality on OMAP5912 OSK.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-09 12:58:50 +07:00
Lee Jones bab070620e Merge branches 'ib-mfd-clk-4.6', 'ib-mfd-input-iio-4.6', 'ib-mfd-regulator-4.6' and 'ib-mfd-regulator-gpio-4.6' into ibs-for-mfd-merged 2016-03-09 12:56:47 +07:00
Bjorn Helgaas 288e6eaa06 gpio: Include linux/gpio.h instead of asm/gpio.h
Most arches have an asm/gpio.h that merely includes linux/gpio.h.  The
others select ARCH_HAVE_CUSTOM_GPIO_H, and when that's selected,
linux/gpio.h includes asm/gpio.h.

Therefore, code should include linux/gpio.h instead of including asm/gpio.h
directly.

Remove includes of asm/gpio.h, adding an include of linux/gpio.h when
necessary.

This is a follow-on to 7563bbf89d ("gpiolib/arches: Centralise
bolierplate asm/gpio.h").

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-02-16 00:20:03 +01:00
Chen-Yu Tsai 02071f0f79 mfd: axp20x: Add support for RSB based AXP223 PMIC
The AXP223 is a new PMIC commonly paired with Allwinner A23/A33 SoCs.
It is functionally identical to AXP221; only the regulator default
voltage/status and the external host interface are different.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12 08:54:42 +00:00
Chen-Yu Tsai 2260a45356 mfd: axp20x: Whitespace, open parenthesis alignment code style fixes
This fixes some leftover code style issues in the axp20x core.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12 08:53:51 +00:00
Chen-Yu Tsai 4fd4115142 mfd: axp20x: Split the driver into core and i2c bits
The axp20x driver assumes the device is i2c based. This is not the
case with later chips, which use a proprietary 2 wire serial bus
by Allwinner called "Reduced Serial Bus".

This patch follows the example of mfd/wm831x and splits it into
an interface independent core, and an i2c specific glue layer.
MFD_AXP20X and the new MFD_AXP20X_I2C are changed to tristate
symbols, allowing the driver to be built as modules.

Whitespace and other style errors in the moved i2c specific code
have been fixed. Included but unused header files are removed as
well.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12 08:53:03 +00:00
Chen-Yu Tsai e740235ddd mfd: axp20x: Add missing copyright notice
Supply a backdated copyright notice.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Carlo Caione <carlo@caione.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12 08:52:08 +00:00
Chen-Yu Tsai af7acc3df7 mfd: axp20x: Use dev->driver->of_match_table in axp20x_match_device()
In axp20x_match_device(), match the of_device_id table bound to the
device driver instead of pointing to axp20x_of_match directly. This
will allow us to keep axp20x_match_device() unmodified when we expand
the axp20x driver into multiple ones covering different interface
types.

of_device_get_match_data() cannot be used here as we need to know if
it failed to get a match, or if the match data value just happened to
be 0, as it is for the AXP152.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12 08:51:17 +00:00
Chen-Yu Tsai e47a3cf741 mfd: axp20x: Remove second struct device * parameter for axp20x_match_device()
The first argument passed to axp20x_match_device(), struct axp20x_dev *,
already contains a pointer to the device. By rearranging some code,
moving the assignment of the pointer before axp20x_match_device() is
called, we can eliminate the second parameter.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-12 08:50:30 +00:00
Andrew F. Davis 796f5692da mfd: tps65912: Add driver for the TPS65912 PMIC
This patch adds support for TPS65912 PMIC MFD core. It provides
communication through the I2C and SPI interfaces. It contains
the following components:

 - Regulators
 - GPIO controller

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-11 16:30:59 +00:00
Andrew F. Davis 65b6555971 mfd: tps65912: Remove old driver in preparation for new driver
The old tps65912 driver is being replaced, delete old driver.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-11 16:30:31 +00:00
Markus Pargmann e2fccf5c15 mfd: fsl-imx25-tsadc: Register touchscreen ADC driver
This is the core driver for imx25 touchscreen/adc driver. The module
has one shared ADC and two different conversion queues which use the
ADC. The two queues are identical. Both can be used for general purpose
ADC but one is meant to be used for touchscreens.

This driver is the core which manages the central components and
registers of the TSC/ADC unit. It manages the IRQs and forwards them to
the correct components.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Denis Carikli <denis@eukrea.com>
[ensure correct ADC clock depending on the IPG clock]
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-11 15:40:41 +00:00
Stephen Boyd c4726abce6 mfd: intel_quark_i2c_gpio: Use clkdev_create()
Convert this driver to use clkdev_create() instead of
clk_register_clkdevs(). The latter API is only used by this driver,
although this driver only allocates one clk to add anyway.
Furthermore, this driver allocates the clk_lookup structure with
devm, but clkdev_drop() will free that structure when passed,
leading to a double free when this driver is removed. Clean it
all up and pave the way for the removal of clk_register_clkdevs().

Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-02-11 11:03:07 +00:00
Arnd Bergmann 26716ce124 thermal: allow u8500-thermal driver to be a module
When the thermal subsystem is a loadable module, the u8500 driver
fails to build:

drivers/thermal/built-in.o: In function `db8500_thermal_probe':
db8500_thermal.c:(.text+0x96c): undefined reference to `thermal_zone_device_register'
drivers/thermal/built-in.o: In function `db8500_thermal_work':
db8500_thermal.c:(.text+0xab4): undefined reference to `thermal_zone_device_update'

This changes the symbol to a tristate, so Kconfig can track the
dependency correctly.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2016-02-09 14:18:23 -08:00
Linus Torvalds 58cf279aca GPIO bulk updates for the v4.5 kernel cycle:
Infrastructural changes:
 
 - In struct gpio_chip, rename the .dev node to .parent to better reflect
   the fact that this is not the GPIO struct device abstraction. We will
   add that soon so this would be totallt confusing.
 
 - It was noted that the driver .get_value() callbacks was
   sometimes reporting negative -ERR values to the gpiolib core, expecting
   them to be propagated to consumer gpiod_get_value() and gpio_get_value()
   calls. This was not happening, so as there was a mess of drivers
   returning negative errors and some returning "anything else than zero"
   to indicate that a line was active. As some would have bit 31 set to
   indicate "line active" it clashed with negative error codes. This is
   fixed by the largeish series clamping values in all drivers with
   !!value to [0,1] and then augmenting the code to propagate error codes
   to consumers. (Includes some ACKed patches in other subsystems.)
 
 - Add a void *data pointer to struct gpio_chip. The container_of() design
   pattern is indeed very nice, but we want to reform the struct gpio_chip
   to be a non-volative, stateless business, and keep states internal to
   the gpiolib to be able to hold on to the state when adding a proper
   userspace ABI (character device) further down the road. To achieve this,
   drivers need a handle at the internal state that is not dependent on
   their struct gpio_chip() so we add gpiochip_add_data() and
   gpiochip_get_data() following the pattern of many other subsystems.
   All the "use gpiochip data pointer" patches transforms drivers to this
   scheme.
 
 - The Generic GPIO chip header has been merged into the general
   <linux/gpio/driver.h> header, and the custom header for that removed.
   Instead of having a separate mm_gpio_chip struct for these generic
   drivers, merge that into struct gpio_chip, simplifying the code and
   removing the need for separate and confusing includes.
 
 Misc improvements:
 
 - Stabilize the way GPIOs are looked up from the ACPI legacy
   specification.
 
 - Incremental driver features for PXA, PCA953X, Lantiq (patches from the
   OpenWRT community), RCAR, Zynq, PL061, 104-idi-48
 
 New drivers:
 
 - Add a GPIO chip to the ALSA SoC AC97 driver.
 
 - Add a new Broadcom NSP SoC driver (this lands in the pinctrl dir, but
   the branch is merged here too to account for infrastructural changes).
 
 - The sx150x driver now supports the sx1502.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWmsZhAAoJEEEQszewGV1ztq0QAJ1KbNOpmf/s3INkOH4r771Z
 WIrNEsmwwLIAryo8gKNOM0H1zCwhRUV7hIE5jYWgD6JvjuAN6vobMlZAq21j6YpB
 pKgqnI5DuoND450xjb8wSwGQ5NTYp1rFXNmwCrtyTjOle6AAW+Kp2cvVWxVr77Av
 uJinRuuBr9GOKW/yYM1Fw/6EPjkvvhVOb+LBguRyVvq0s5Peyw7ZVeY1tjgPHJLn
 oSZ9dmPUjHEn91oZQbtfro3plOObcxdgJ8vo//pgEmyhMeR8XjXES+aUfErxqWOU
 PimrZuMMy4cxnsqWwh3Dyxo7KSWfJKfSPRwnGwc/HgbHZEoWxOZI1ezRtGKrRQtj
 vubxp5dUBA5z66TMsOCeJtzKVSofkvgX2Wr/Y9jKp5oy9cHdAZv9+jEHV1pr6asz
 Tas97MmmO77XuRI/GPDqVHx8dfa15OIz9s92+Gu64KxNzVxTo4+NdoPSNxkbCILO
 FKn7EmU3D0OjmN2NJ9GAURoFaj3BBUgNhaxacG9j2bieyh+euuUHRtyh2k8zXR9y
 8OnY1UOrTUYF8YIq9pXZxMQRD/lqwCNHvEjtI6BqMcNx4MptfTL+FKYUkn/SgCYk
 QTNV6Ui+ety5D5aEpp5q0ItGsrDJ2LYSItsS+cOtMy2ieOxbQav9NWwu7eI3l5ly
 gwYTZjG9p9joPXLW0E3g
 =63rR
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO updates from Linus Walleij:
 "Here is the bulk of GPIO changes for v4.5.

  Notably there are big refactorings mostly by myself, aimed at getting
  the gpio_chip into a shape that makes me believe I can proceed to
  preserve state for a proper userspace ABI (character device) that has
  already been proposed once, but resulted in the feedback that I need
  to go back and restructure stuff.  So I've been restructuring stuff.
  On the way I ran into brokenness (return code from the get_value()
  callback) and had to fix it.  Also, refactored generic GPIO to be
  simpler.

  Some of that is still waiting to trickle down from the subsystems all
  over the kernel that provide random gpio_chips, I've touched every
  single GPIO driver in the kernel now, oh man I didn't know I was
  responsible for so much...

  Apart from that we're churning along as usual.

  I took some effort to test and retest so it should merge nicely and we
  shook out a couple of bugs in -next.

  Infrastructural changes:

   - In struct gpio_chip, rename the .dev node to .parent to better
     reflect the fact that this is not the GPIO struct device
     abstraction.  We will add that soon so this would be totallt
     confusing.

   - It was noted that the driver .get_value() callbacks was sometimes
     reporting negative -ERR values to the gpiolib core, expecting them
     to be propagated to consumer gpiod_get_value() and gpio_get_value()
     calls.  This was not happening, so as there was a mess of drivers
     returning negative errors and some returning "anything else than
     zero" to indicate that a line was active.  As some would have bit
     31 set to indicate "line active" it clashed with negative error
     codes.  This is fixed by the largeish series clamping values in all
     drivers with !!value to [0,1] and then augmenting the code to
     propagate error codes to consumers.  (Includes some ACKed patches
     in other subsystems.)

   - Add a void *data pointer to struct gpio_chip.  The container_of()
     design pattern is indeed very nice, but we want to reform the
     struct gpio_chip to be a non-volative, stateless business, and keep
     states internal to the gpiolib to be able to hold on to the state
     when adding a proper userspace ABI (character device) further down
     the road.  To achieve this, drivers need a handle at the internal
     state that is not dependent on their struct gpio_chip() so we add
     gpiochip_add_data() and gpiochip_get_data() following the pattern
     of many other subsystems.  All the "use gpiochip data pointer"
     patches transforms drivers to this scheme.

   - The Generic GPIO chip header has been merged into the general
     <linux/gpio/driver.h> header, and the custom header for that
     removed.  Instead of having a separate mm_gpio_chip struct for
     these generic drivers, merge that into struct gpio_chip,
     simplifying the code and removing the need for separate and
     confusing includes.

  Misc improvements:

   - Stabilize the way GPIOs are looked up from the ACPI legacy
     specification.

   - Incremental driver features for PXA, PCA953X, Lantiq (patches from
     the OpenWRT community), RCAR, Zynq, PL061, 104-idi-48

  New drivers:

   - Add a GPIO chip to the ALSA SoC AC97 driver.

   - Add a new Broadcom NSP SoC driver (this lands in the pinctrl dir,
     but the branch is merged here too to account for infrastructural
     changes).

   - The sx150x driver now supports the sx1502"

* tag 'gpio-v4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (220 commits)
  gpio: generic: make bgpio_pdata always visible
  gpiolib: fix chip order in gpio list
  gpio: mpc8xxx: Do not use gpiochip_get_data() in mpc8xxx_gpio_save_regs()
  gpio: mm-lantiq: Do not use gpiochip_get_data() in ltq_mm_save_regs()
  gpio: brcmstb: Allow building driver for BMIPS_GENERIC
  gpio: brcmstb: Set endian flags for big-endian MIPS
  gpio: moxart: fix build regression
  gpio: xilinx: Do not use gpiochip_get_data() in xgpio_save_regs()
  leds: pca9532: use gpiochip data pointer
  leds: tca6507: use gpiochip data pointer
  hid: cp2112: use gpiochip data pointer
  bcma: gpio: use gpiochip data pointer
  avr32: gpio: use gpiochip data pointer
  video: fbdev: via: use gpiochip data pointer
  gpio: pch: Optimize pch_gpio_get()
  Revert "pinctrl: lantiq: Implement gpio_chip.to_irq"
  pinctrl: nsp-gpio: use gpiochip data pointer
  pinctrl: vt8500-wmt: use gpiochip data pointer
  pinctrl: exynos5440: use gpiochip data pointer
  pinctrl: at91-pio4: use gpiochip data pointer
  ...
2016-01-17 12:32:01 -08:00
Linus Torvalds cf8d7e3850 - New Device Support
- Add support for s2mps15; sec-core
    - Add support for Lewisburg; lpc_ich
    - Add support for cs47l24 and wm1831; arizona
  - New Functionality
    - Allow user to select syscon register width; syscon
  - Fix-ups
    - Lots of Checkpatch fixes
    - Rename -pmic/-regulator; s2mps11
    - Build driver components into a single module; wm8994-*
    - Better handing of IRQ during suspend/resume; as3722
    - Constify things; da903x
    - Remove unused code; ab8500-core
    - Improve error handing; qcom_rpm
    - Simplify code: wm831x-otp, sta2x11-mfd
    - Improve locking; cros_ec_spi
    - Fix incorrect DT binding filename reference; arizona, palmas,
                                                   snps-dwapb-gpio, wm8994
  - Bug Fixes
    - Fix broken SYSFS 'show ID' call; wm831x-otp
    - Protect reads from non-existent registers; qcom-spmi-pmic
    - Repair build warnings; as3722
    - Fix IRQ request ordering; arizona-irq
    - Ensure return value is boolean; ucb1x00-core, tps65010, tc6393xb,
                                      htc-egpio, dm355evm_msp, asic3,
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWl2AcAAoJEFGvii+H/Hdh3OQP/0h84f++G5lPznRRf6Vmevbl
 XnACJHbM+L5jilTr9ISHzrzZrsf5y7FYPEVH3MyJnzFSqeAKwhI0kZ39P5imntOf
 4wvDvmxU+2V/JcSVNaZHxTiKEnEKQMseht4WQo5xaGx44FB+f9nIDJt7XQPG/2E4
 S7X8UG6wH8q0NiV7nesIldFL16EtO2EGY6Pjm62/v6EZQYHoy33QhjqrL4Iyigai
 BA4bsLg8Cz1ihfPFEynkMHL8A1sgG9UDJFvxa97b3w44GINLD42h3LGoIQ4isfIO
 XR6VEhDF7FIeaBqiYW106FYN+DmmBNLDp1I01hdWORYFY3U4q3uw0qDAIw8ZQIeJ
 Gx8OBeQgbJQ84PcA+EYWStEP0fteKqFpWo7ZEeueWZLqY8EQJKx1v2wvQF0eiyVt
 MCD6mmAZbLJ1CbPrMu5E8HWA/YjJs6SLS6BpcFqlSgmnEWLsIkYmtMCsUWfzQlxg
 zSNrXCH5IVafxGVHJYaUyudqd88idUnXXthOag8A+Yita5dnlnNBvvRlNjPXJFM+
 4U/OP2peMVsSPa99S2KfAtiNmZc9kUuwZmERaAOiFAGou1yKtGgLayNb0Kxtc1qo
 Icf508V7Gvom1jN14aQ0/H5tagyy0/bKRpF+7ikV1Q+2767dEjiIeigtUuQI2447
 3+7HAsrNSK4CE2f57Nrk
 =IY7O
 -----END PGP SIGNATURE-----

Merge tag 'mfd-for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Device Support:
   - Add support for s2mps15; sec-core
   - Add support for Lewisburg; lpc_ich
   - Add support for cs47l24 and wm1831; arizona

  New Functionality:
   - Allow user to select syscon register width; syscon

  Fix-ups:
   - Lots of Checkpatch fixes
   - Rename -pmic/-regulator; s2mps11
   - Build driver components into a single module; wm8994-*
   - Better handing of IRQ during suspend/resume; as3722
   - Constify things; da903x
   - Remove unused code; ab8500-core
   - Improve error handing; qcom_rpm
   - Simplify code: wm831x-otp, sta2x11-mfd
   - Improve locking; cros_ec_spi
   - Fix incorrect DT binding filename reference; arizona, palmas,
     snps-dwapb-gpio, wm8994

  Bug Fixes:
   - Fix broken SYSFS 'show ID' call; wm831x-otp
   - Protect reads from non-existent registers; qcom-spmi-pmic
   - Repair build warnings; as3722
   - Fix IRQ request ordering; arizona-irq
   - Ensure return value is boolean; ucb1x00-core, tps65010, tc6393xb,
     htc-egpio, dm355evm_msp, asic3"

* tag 'mfd-for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (58 commits)
  mfd: davinci_voicecodec: Remove pointless 'out of memory' error message
  mfd: da9052-irq: Fix trivial 'space before comma' error
  mfd: da9052-i2c: Fix tabbing/whitespace issue
  mfd: da903x: Fix white space and split string issues
  mfd: cs5535-mfd: Add missing line spacing and make local array static
  mfd: cros_ec_spi: Repair comparison ordering issue
  mfd: cros_ec_i2c: Fix trivial 'tabs before spaces' whitespace issue.
  mfd: asic3: Fix a plethora of Checkpatch errors and warnings
  mfd: as3711: Repair OOM and 'line over 80 chars' formatting warnings
  mfd: arizona-i2c: Add blank line formatting after declaration
  mfd: arizona-core: msleep() is unreliable for anything <20ms use usleep_range() instead
  mfd: adp5520: Some trivial 'no space before tab' fixes
  mfd: ab8500-sysctrl: Fix Constify, printk => pr_info and formatting issues
  mfd: ab8500-gpadc: Squash a whole bunch of Checkpatch warnings and one error
  mfd: ab8500-debugfs: Clean-up non-conforming commenting and print formatting
  mfd: ab8500-core: Fix many warnings reported by Checkpatch
  mfd: ab2100-otp: Remove pointless 'out of memory' error message
  mfd: ab3100-core.c: Fix multiple warnings reported by Checkpatch
  mfd: aat2870-core: Remove unnecessary 'out of memory' message
  mfd: 88pm860x-core: Fix commenting and declaration spacing
  ...
2016-01-14 10:53:15 -08:00
Lee Jones 9fb4116607 mfd: davinci_voicecodec: Remove pointless 'out of memory' error message
WARNING: Possible unnecessary 'out of memory' message
+       if (!davinci_vc) {
+               dev_dbg(&pdev->dev,

total: 0 errors, 1 warnings, 154 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:44:05 +00:00
Lee Jones 997eea4691 mfd: da9052-irq: Fix trivial 'space before comma' error
ERROR: space prohibited before that ',' (ctx:WxW)
+       da9052_free_irq(da9052, DA9052_IRQ_ADC_EOM , da9052);

total: 1 errors, 0 warnings, 290 lines checked

Cc: Support Opensource <support.opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:44:04 +00:00
Lee Jones 5b7b2ac152 mfd: da9052-i2c: Fix tabbing/whitespace issue
WARNING: suspect code indent for conditional statements (8, 24)
+       if (!i2c_safe_reg(reg))
+                       return regmap_read(da9052->regmap,

total: 0 errors, 1 warnings, 226 lines checked

Cc: Support Opensource <support.opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:44:03 +00:00
Lee Jones 8b2775787f mfd: da903x: Fix white space and split string issues
While we're at it, let's also match the MODULE_LICENSE with the header.

WARNING: please, no space before tabs
+ * ^IMike Rapoport <mike@compulab.co.il>$

WARNING: please, no space before tabs
+ * ^IEric Miao <eric.miao@marvell.com>$

WARNING: quoted string split across lines
+MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>"
+             "Mike Rapoport <mike@compulab.co.il>");

total: 0 errors, 3 warnings, 574 lines checked

Cc: Support Opensource <support.opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:44:03 +00:00
Lee Jones 740c198959 mfd: cs5535-mfd: Add missing line spacing and make local array static
WARNING: Missing a blank line after declarations
+       struct resource *res;
+       res = platform_get_resource(pdev, IORESOURCE_IO, 0);

WARNING: char * array declaration might be better as static const
+       const char *acpi_clones[] = { "olpc-xo1-pm-acpi", "olpc-xo1-sci-acpi" };

total: 0 errors, 2 warnings, 192 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:44:02 +00:00
Lee Jones 8827a642a4 mfd: cros_ec_spi: Repair comparison ordering issue
WARNING: Comparisons should place the constant on the right side of the test
+       BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size);

WARNING: Comparisons should place the constant on the right side of the test
+       BUG_ON(EC_MSG_PREAMBLE_COUNT > ec_dev->din_size);

total: 0 errors, 2 warnings, 731 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:44:01 +00:00
Lee Jones 2756db6c63 mfd: cros_ec_i2c: Fix trivial 'tabs before spaces' whitespace issue.
ERROR: code indent should use tabs where possible
+ ^Iec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL);$

WARNING: please, no space before tabs
+ ^Iec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL);$

WARNING: please, no spaces at the start of a line
+ ^Iec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL);$

total: 1 errors, 2 warnings, 366 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:44:01 +00:00
Lee Jones d43c4290ff mfd: asic3: Fix a plethora of Checkpatch errors and warnings
ERROR: Macros with complex values should be enclosed in parentheses
+#define INIT_CDEX(_name, _rate)        \
+       [ASIC3_CLOCK_##_name] = {               \
+               .cdex = CLOCK_CDEX_##_name,     \
+               .rate = _rate,                  \
+       }

WARNING: line over 80 characters
+                                                           ASIC3_GPIO_INT_STATUS);

WARNING: void function return statements are not generally useful
+       return;
+}

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+       msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+       msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+       msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+       msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+       msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+       msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+               msleep(1);
WARNING: line over 80 characters
+               asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> asic->bus_shift) +

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then p
r_err(...  to printk(KERN_ERR ...
+               printk(KERN_ERR "kzalloc failed\n");

WARNING: Possible unnecessary 'out of memory' message
+       if (asic == NULL) {
+               printk(KERN_ERR "kzalloc failed\n");

WARNING: Missing a blank line after declarations
+       int retval = 0;
+       retval = platform_driver_probe(&asic3_device_driver, asic3_probe);

total: 1 errors, 13 warnings, 1081 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:44:00 +00:00
Lee Jones ae487ae2ac mfd: as3711: Repair OOM and 'line over 80 chars' formatting warnings
WARNING: Possible unnecessary 'out of memory' message
+               if (!pdata) {
+                       dev_err(&client->dev, "Failed to allocate pdata\n");

WARNING: Possible unnecessary 'out of memory' message
+       if (!as3711) {
+               dev_err(&client->dev, "Memory allocation failed\n");

WARNING: line over 80 characters
+               dev_err(&client->dev, "regmap initialization failed: %d\n", ret);

WARNING: line over 80 characters
+       /* We can reuse as3711_subdevs[], it will be copied in mfd_add_devices() */

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_REGULATOR].platform_data = &pdata->regulator;

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_REGULATOR].pdata_size = sizeof(pdata->regulator);

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_BACKLIGHT].platform_data = &pdata->backlight;

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_BACKLIGHT].pdata_size = sizeof(pdata->backlight);

total: 0 errors, 8 warnings, 236 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:59 +00:00
Lee Jones 9f6e872a70 mfd: arizona-i2c: Add blank line formatting after declaration
WARNING: Missing a blank line after declarations
+       struct arizona *arizona = dev_get_drvdata(&i2c->dev);
+       arizona_dev_exit(arizona);

total: 0 errors, 1 warnings, 120 lines checked

Cc: patches@opensource.wolfsonmicro.com
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:58 +00:00
Lee Jones b79a980f71 mfd: arizona-core: msleep() is unreliable for anything <20ms use usleep_range() instead
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+               msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+                       msleep(5);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+               msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+               msleep(1);

total: 0 errors, 4 warnings, 1407 lines checked

Cc: patches@opensource.wolfsonmicro.com
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:58 +00:00
Lee Jones 3103d44e45 mfd: adp5520: Some trivial 'no space before tab' fixes
WARNING: please, no space before tabs
+ * ^IMike Rapoport <mike@compulab.co.il>$

WARNING: please, no space before tabs
+ * ^IEric Miao <eric.miao@marvell.com>$

WARNING: please, no space before tabs
+^I.id_table ^I= adp5520_id,$

total: 0 errors, 3 warnings, 365 lines checked

Cc: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:57 +00:00
Lee Jones 63b4fd7502 mfd: ab8500-sysctrl: Fix Constify, printk => pr_info and formatting issues
WARNING: char * array declaration might be better as static const
+       static char *pss[] = {"ab8500_ac", "pm2301", "ab8500_usb"};

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then
 pr_info(...  to printk(KERN_INFO ...
+                       printk(KERN_INFO

WARNING: quoted string split across lines
+                              "Charger \"%s\" is connected with known battery."
+                              " Rebooting.\n",

WARNING: quoted string split across lines
+                                       "unable to set sysClkReq%dRfClkBuf: "
+                                       "%d\n", j + 1, ret);

total: 0 errors, 4 warnings, 199 lines checked

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:56 +00:00
Lee Jones df36442cfe mfd: ab8500-gpadc: Squash a whole bunch of Checkpatch warnings and one error
WARNING: line over 80 characters
+#define ADC_CH_IBAT_MIN                        (-6000) /* mA range measured by ADC for ib
t*/

WARNING: line over 80 characters
+#define ADC_CH_IBAT_MIN_V              (-60)   /* mV range measured by ADC for ibat*/

WARNING: suspect code indent for conditional statements (16, 20)
+               if (!strcmp(name, dev_name(gpadc->dev)))
+                   return gpadc;

WARNING: suspect code indent for conditional statements (0, 16)
+if (ad_value < 0) {
+               dev_err(gpadc->dev, "GPADC raw value failed ch: %d\n",

WARNING: quoted string split across lines
+               dev_err(gpadc->dev, "GPADC to voltage conversion failed ch:"
+                       " %d AD: 0x%x\n", channel, ad_value);

WARNING: Missing a blank line after declarations
+       int raw_data;
+       raw_data = ab8500_gpadc_double_read_raw(gpadc, channel,

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+               msleep(10);

ERROR: else should follow close brace '}'
+       }
+       else

WARNING: line over 80 characters
+                       delay_max = 10000; /* large range to optimise sleep mode */

WARNING: line over 80 characters
+                       gpadc->cal_data[ADC_INPUT_IBAT].gain = V_gain * V2A_gain;

WARNING: line over 80 characters
+       gpadc = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_gpadc), GFP_KERNEL);

WARNING: Possible unnecessary 'out of memory' message
+       if (!gpadc) {
+               dev_err(&pdev->dev, "Error: No memory\n");

WARNING: space prohibited before semicolon
+       return ;

WARNING: void function return statements are not generally useful
+       return ;
+}

WARNING: quoted string split across lines
+MODULE_AUTHOR("Arun R Murthy, Daniel Willerud, Johan Palsson,"
+               "M'boumba Cedric Madianga");

total: 1 errors, 14 warnings, 1089 lines checked

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:56 +00:00
Lee Jones de6a769333 mfd: ab8500-debugfs: Clean-up non-conforming commenting and print formatting
WARNING: Block comments use a trailing */ on a separate line
+                        * not be accessed from here */

WARNING: Block comments use a trailing */ on a separate line
+                        * not be accessed from here */

WARNING: Block comments use a trailing */ on a separate line
+                                * the output is wanted in any case */

WARNING: Consecutive strings are generally better as a single string
+               "  addr=0x%08X, mask=0x%X, shift=%d" "value=0x%X\n",

total: 0 errors, 4 warnings, 3331 lines checked

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:55 +00:00
Lee Jones 500e69a101 mfd: ab8500-core: Fix many warnings reported by Checkpatch
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>
2016-01-14 08:43:54 +00:00
Lee Jones 845b76f891 mfd: ab2100-otp: Remove pointless 'out of memory' error message
WARNING: Possible unnecessary 'out of memory' message
+       if (!otp) {
+               dev_err(&pdev->dev, "could not allocate AB3100 OTP device\n");

total: 0 errors, 1 warnings, 250 lines checked

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:53 +00:00
Lee Jones 15544cab28 mfd: ab3100-core.c: Fix multiple warnings reported by Checkpatch
WARNING: Missing a blank line after declarations
+       struct ab3100 *ab3100 = dev_get_drvdata(dev->parent);
+       if (!ab3100->startup_events_read)

WARNING: Possible unnecessary 'out of memory' message
+       if (!ab3100) {
+               dev_err(&client->dev, "could not allocate AB3100 device\n");

WARNING: else is not generally useful after a break or return
+                               break;
+                       } else {

total: 0 errors, 3 warnings, 996 lines checked

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:53 +00:00
Lee Jones 4374b20c6c mfd: aat2870-core: Remove unnecessary 'out of memory' message
WARNING: Possible unnecessary 'out of memory' message
+       if (!aat2870) {
+               dev_err(&client->dev,

total: 0 errors, 1 warnings, 524 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:52 +00:00
Lee Jones f90dff4464 mfd: 88pm860x-core: Fix commenting and declaration spacing
Checkpatch output:

WARNING: Block comments use a trailing */ on a separate line
+        * - turn off */

WARNING: Missing a blank line after declarations
+       int ret;
+       ret = i2c_add_driver(&pm860x_driver);

total: 0 errors, 2 warnings, 1283 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:51 +00:00
Geliang Tang 1b5420e1f5 mfd: Use to_i2c_client() instead of open-coding it
Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:50 +00:00
Linus Walleij f8e3a514bf mfd: asic3: Be sure to clamp return value
As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:43 +00:00
Linus Walleij fe0b486729 mfd: dm355evm_mps: Be sure to clamp return value
As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:37 +00:00
Linus Walleij f7d6236696 mfd: htc-egpio: Be sure to clamp return value
As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:26 +00:00
Linus Walleij 2d5f72b85a mfd: tc6393xb: Be sure to clamp return value
As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:21 +00:00
Linus Walleij bf3de47f1a mfd: tps65010: Be sure to clamp return value
As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

This also start to propagate the negative error code from the
smbus call if there is one, as the last commit of this series
will make the gpiolib core deal with that properly.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:13 +00:00
Linus Torvalds 67990608c8 Power management and ACPI updates for v4.5-rc1
- Add a debugfs-based interface for interacting with the ACPICA's
    AML debugger introduced in the previous cycle and a new user
    space tool for that, fix some bugs related to the AML debugger
    and clean up the code in question (Lv Zheng, Dan Carpenter,
    Colin Ian King, Markus Elfring).
 
  - Update ACPICA to upstream revision 20151218 including a number
    of fixes and cleanups in the ACPICA core (Bob Moore, Lv Zheng,
    Labbe Corentin, Prarit Bhargava, Colin Ian King, David E Box,
    Rafael Wysocki).
 
    In particular, the previously added erroneous support for the
    _SUB object is dropped, the concatenate operator will support
    all ACPI objects now, the Debug Object handling is improved,
    the SuperName handling of parameters being control methods is
    fixed, the ObjectType operator handling is updated to follow
    ACPI 5.0A and the handling of CondRefOf and RefOf is updated
    accordingly, module-level code will be executed after loading
    each ACPI table now (instead of being run once after all tables
    containing AML have been loaded), the Operation Region handlers
    management is updated to fix some reported problems and a the
    ACPICA code in the kernel is more in line with the upstream
    now.
 
  - Update the ACPI backlight driver to provide information on
    whether or not it will generate key-presses for brightness
    change hotkeys and update some platform drivers (dell-wmi,
    thinkpad_acpi) to use that information to avoid sending double
    key-events to users pace for these, add new ACPI backlight
    quirks (Hans de Goede, Aaron Lu, Adrien Schildknecht).
 
  - Improve the ACPI handling of interrupt GPIOs (Christophe Ricard).
 
  - Fix the handling of the list of device IDs of device objects
    found in the ACPI namespace and add a helper for checking if
    there is a device object for a given device ID (Lukas Wunner).
 
  - Change the logic in the ACPI namespace scanning code to create
    struct acpi_device objects for all ACPI device objects found in
    the namespace even if _STA fails for them which helps to avoid
    device enumeration problems on Microsoft Surface 3 (Aaron Lu).
 
  - Add support for the APM X-Gene ACPI I2C device to the ACPI
    driver for AMD SoCs (Loc Ho).
 
  - Fix the long-standing issue with the DMA controller on Intel
    SoCs where ACPI tables have no power management support for
    the DMA controller itself, but it can be powered off automatically
    when the last (other) device on the SoC is powered off via ACPI
    and clean up the ACPI driver for Intel SoCs (acpi-lpss) after
    previous attempts to fix that problem (Andy Shevchenko).
 
  - Assorted ACPI fixes and cleanups (Andy Lutomirski, Colin Ian King,
    Javier Martinez Canillas, Ken Xue, Mathias Krause, Rafael Wysocki,
    Sinan Kaya).
 
  - Update the device properties framework for better handling of
    built-in properties, add support for built-in properties to
    the platform bus type, update the MFD subsystem's handling
    of device properties and add support for passing default
    configuration data as device properties to the intel-lpss MFD
    drivers, convert the designware I2C driver to use the unified
    device properties API and add a fallback mechanism for using
    default built-in properties if the platform firmware fails
    to provide the properties as expected by drivers (Andy Shevchenko,
    Mika Westerberg, Heikki Krogerus, Andrew Morton).
 
  - Add new Device Tree bindings to the Operating Performance Points
    (OPP) framework and update the exynos4412 DT binding accordingly,
    introduce debugfs support for the OPP framework (Viresh Kumar,
    Bartlomiej Zolnierkiewicz).
 
  - Migrate the mt8173 cpufreq driver to the new OPP bindings
    (Pi-Cheng Chen).
 
  - Update the cpufreq core to make the handling of governors
    more efficient, especially on systems where policy objects
    are shared between multiple CPUs (Viresh Kumar, Rafael Wysocki).
 
  - Fix cpufreq governor handling on configurations with
    CONFIG_HZ_PERIODIC set (Chen Yu).
 
  - Clean up the cpufreq core code related to the boost sysfs knob
    support and update the ACPI cpufreq driver accordingly (Rafael
    Wysocki).
 
  - Add a new cpufreq driver for ST platforms and corresponding
    Device Tree bindings (Lee Jones).
 
  - Update the intel_pstate driver to allow the P-state selection
    algorithm used by it to depend on the CPU ID of the processor it
    is running on, make it use a special P-state selection algorithm
    (with an IO wait time compensation tweak) on Atom CPUs based on
    the Airmont and Silvermont cores so as to reduce their energy
    consumption and improve intel_pstate documentation (Philippe
    Longepe, Srinivas Pandruvada).
 
  - Update the cpufreq-dt driver to support registering cooling
    devices that use the (P * V^2 * f) dynamic power draw formula
    where V is the voltage, f is the frequency and P is a constant
    coefficient provided by Device Tree and update the arm_big_little
    cpufreq driver to use that support (Punit Agrawal).
 
  - Assorted cpufreq driver (cpufreq-dt, qoriq, pcc-cpufreq,
    blackfin-cpufreq) updates (Andrzej Hajda, Hongtao Jia,
    Jacob Tanenbaum, Markus Elfring).
 
  - cpuidle core tweaks related to polling and measured_us
    calculation (Rik van Riel).
 
  - Removal of modularity from a few cpuidle drivers (clps711x,
    ux500, exynos) that cannot be built as modules in practice
    (Paul Gortmaker).
 
  - PM core update to prevent devices from being probed during
    system suspend/resume which is generally problematic and may
    lead to inconsistent behavior (Grygorii Strashko).
 
  - Assorted updates of the PM core and related code (Julia Lawall,
    Manuel Pégourié-Gonnard, Maruthi Bayyavarapu, Rafael Wysocki,
    Ulf Hansson).
 
  - PNP bus type updates (Christophe Le Roy, Heiner Kallweit).
 
  - PCI PM code cleanups (Jarkko Nikula, Julia Lawall).
 
  - cpupower tool updates (Jacob Tanenbaum, Thomas Renninger).
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJWlZOmAAoJEILEb/54YlRxxtEP/ioR0xMOJQcWd5F6Oyj1PZsx
 vJeXsmL3fXFAlr6riaE966QqclhUTDhhex3kbFmNQvM8WukxOmBWy5UMSjRg2UmM
 PHrogc/KrrE+xb8hjGZPgqVr+/L9O3C6lZmM+AUciT0hWZJckYgRh5TpHb1xN/Kx
 MptvtSXRBM62LWytug+EwA4SHt7OFS0yJ/CI1pKvODVtLaYDIPI5k+4ilPU7y6Be
 vfoysvmUozNTEYxgPOPXfoQqW2P5t2df32Re31uKtLenLXbc8KW0wIYm24DXgSK6
 V/TyDVZTNaZk6OpTqWrjqFbedpGvcBpViwYEY7yv33GDCpXGdHQl3ga+Jy6PAUem
 7oGDZtA+5Di/8szhH/wSdpXwSaKEeUdFiaj6Uw2MAwiY4wzv5+WmLRcuIjQFDAxT
 elrTbQhAgaMlMsUkQ9NV4GC7ByUeeQX2NpCielsHngOQgKdYRQHyYUgGXc2Wgjdq
 UnVrIWRHzXSED0RtPI7IT0Y4PSxkM9UoSEiVUwt3srCue2CFzuENs23qaDgAzeDa
 5uwnDl4RhI2BrLVT1WhioIFgFE5Yh5Xx6dSGC+jcU2ss8r2oN6DdUbqOzWAa1iR4
 sFhgwwwizpCCfB6pSqEuDdg8W56HjvE9kQY9kcTPPNPbktL0VImC+iiSN/CgZJv9
 MH9NbQM8uHkfNcpjsN7V
 =OlYA
 -----END PGP SIGNATURE-----

Merge tag 'pm+acpi-4.5-rc1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull oower management and ACPI updates from Rafael Wysocki:
 "As far as the number of commits goes, ACPICA takes the lead this time,
  followed by cpufreq and the device properties framework changes.

  The most significant new feature is the debugfs-based interface to the
  ACPICA's AML debugger added in the previous cycle and a new user space
  tool for accessing it.

  On the cpufreq front, the core is updated to handle governors more
  efficiently, particularly on systems where a single cpufreq policy
  object is shared between multiple CPUs, and there are quite a few
  changes in drivers (intel_pstate, cpufreq-dt etc).

  The device properties framework is updated to handle built-in (ie
  included in the kernel itself) device properties better, among other
  things by adding a fallback mechanism that will allow drivers to
  provide default properties to be used in case the plaform firmware
  doesn't provide the properties expected by them.

  The Operating Performance Points (OPP) framework gets new DT bindings
  and debugfs support.

  A new cpufreq driver for ST platforms is added and the ACPI driver for
  AMD SoCs will now support the APM X-Gene ACPI I2C device.

  The rest is mostly fixes and cleanups all over.

  Specifics:

   - Add a debugfs-based interface for interacting with the ACPICA's AML
     debugger introduced in the previous cycle and a new user space tool
     for that, fix some bugs related to the AML debugger and clean up
     the code in question (Lv Zheng, Dan Carpenter, Colin Ian King,
     Markus Elfring).

   - Update ACPICA to upstream revision 20151218 including a number of
     fixes and cleanups in the ACPICA core (Bob Moore, Lv Zheng, Labbe
     Corentin, Prarit Bhargava, Colin Ian King, David E Box, Rafael
     Wysocki).

     In particular, the previously added erroneous support for the _SUB
     object is dropped, the concatenate operator will support all ACPI
     objects now, the Debug Object handling is improved, the SuperName
     handling of parameters being control methods is fixed, the
     ObjectType operator handling is updated to follow ACPI 5.0A and the
     handling of CondRefOf and RefOf is updated accordingly, module-
     level code will be executed after loading each ACPI table now
     (instead of being run once after all tables containing AML have
     been loaded), the Operation Region handlers management is updated
     to fix some reported problems and a the ACPICA code in the kernel
     is more in line with the upstream now.

   - Update the ACPI backlight driver to provide information on whether
     or not it will generate key-presses for brightness change hotkeys
     and update some platform drivers (dell-wmi, thinkpad_acpi) to use
     that information to avoid sending double key-events to users pace
     for these, add new ACPI backlight quirks (Hans de Goede, Aaron Lu,
     Adrien Schildknecht).

   - Improve the ACPI handling of interrupt GPIOs (Christophe Ricard).

   - Fix the handling of the list of device IDs of device objects found
     in the ACPI namespace and add a helper for checking if there is a
     device object for a given device ID (Lukas Wunner).

   - Change the logic in the ACPI namespace scanning code to create
     struct acpi_device objects for all ACPI device objects found in the
     namespace even if _STA fails for them which helps to avoid device
     enumeration problems on Microsoft Surface 3 (Aaron Lu).

   - Add support for the APM X-Gene ACPI I2C device to the ACPI driver
     for AMD SoCs (Loc Ho).

   - Fix the long-standing issue with the DMA controller on Intel SoCs
     where ACPI tables have no power management support for the DMA
     controller itself, but it can be powered off automatically when the
     last (other) device on the SoC is powered off via ACPI and clean up
     the ACPI driver for Intel SoCs (acpi-lpss) after previous attempts
     to fix that problem (Andy Shevchenko).

   - Assorted ACPI fixes and cleanups (Andy Lutomirski, Colin Ian King,
     Javier Martinez Canillas, Ken Xue, Mathias Krause, Rafael Wysocki,
     Sinan Kaya).

   - Update the device properties framework for better handling of
     built-in properties, add support for built-in properties to the
     platform bus type, update the MFD subsystem's handling of device
     properties and add support for passing default configuration data
     as device properties to the intel-lpss MFD drivers, convert the
     designware I2C driver to use the unified device properties API and
     add a fallback mechanism for using default built-in properties if
     the platform firmware fails to provide the properties as expected
     by drivers (Andy Shevchenko, Mika Westerberg, Heikki Krogerus,
     Andrew Morton).

   - Add new Device Tree bindings to the Operating Performance Points
     (OPP) framework and update the exynos4412 DT binding accordingly,
     introduce debugfs support for the OPP framework (Viresh Kumar,
     Bartlomiej Zolnierkiewicz).

   - Migrate the mt8173 cpufreq driver to the new OPP bindings (Pi-Cheng
     Chen).

   - Update the cpufreq core to make the handling of governors more
     efficient, especially on systems where policy objects are shared
     between multiple CPUs (Viresh Kumar, Rafael Wysocki).

   - Fix cpufreq governor handling on configurations with
     CONFIG_HZ_PERIODIC set (Chen Yu).

   - Clean up the cpufreq core code related to the boost sysfs knob
     support and update the ACPI cpufreq driver accordingly (Rafael
     Wysocki).

   - Add a new cpufreq driver for ST platforms and corresponding Device
     Tree bindings (Lee Jones).

   - Update the intel_pstate driver to allow the P-state selection
     algorithm used by it to depend on the CPU ID of the processor it is
     running on, make it use a special P-state selection algorithm (with
     an IO wait time compensation tweak) on Atom CPUs based on the
     Airmont and Silvermont cores so as to reduce their energy
     consumption and improve intel_pstate documentation (Philippe
     Longepe, Srinivas Pandruvada).

   - Update the cpufreq-dt driver to support registering cooling devices
     that use the (P * V^2 * f) dynamic power draw formula where V is
     the voltage, f is the frequency and P is a constant coefficient
     provided by Device Tree and update the arm_big_little cpufreq
     driver to use that support (Punit Agrawal).

   - Assorted cpufreq driver (cpufreq-dt, qoriq, pcc-cpufreq,
     blackfin-cpufreq) updates (Andrzej Hajda, Hongtao Jia, Jacob
     Tanenbaum, Markus Elfring).

   - cpuidle core tweaks related to polling and measured_us calculation
     (Rik van Riel).

   - Removal of modularity from a few cpuidle drivers (clps711x, ux500,
     exynos) that cannot be built as modules in practice (Paul
     Gortmaker).

   - PM core update to prevent devices from being probed during system
     suspend/resume which is generally problematic and may lead to
     inconsistent behavior (Grygorii Strashko).

   - Assorted updates of the PM core and related code (Julia Lawall,
     Manuel Pégourié-Gonnard, Maruthi Bayyavarapu, Rafael Wysocki, Ulf
     Hansson).

   - PNP bus type updates (Christophe Le Roy, Heiner Kallweit).

   - PCI PM code cleanups (Jarkko Nikula, Julia Lawall).

   - cpupower tool updates (Jacob Tanenbaum, Thomas Renninger)"

* tag 'pm+acpi-4.5-rc1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (177 commits)
  PM / clk: don't leave clocks enabled when driver not bound
  i2c: dw: Add APM X-Gene ACPI I2C device support
  ACPI / APD: Add APM X-Gene ACPI I2C device support
  ACPI / LPSS: change 'does not have' to 'has' in comment
  Revert "dmaengine: dw: platform: provide platform data for Intel"
  dmaengine: dw: return immediately from IRQ when DMA isn't in use
  dmaengine: dw: platform: power on device on shutdown
  ACPI / LPSS: override power state for LPSS DMA device
  PM / OPP: Use snprintf() instead of sprintf()
  Documentation: cpufreq: intel_pstate: enhance documentation
  ACPI, PCI, irq: remove redundant check for null string pointer
  ACPI / video: driver must be registered before checking for keypresses
  cpufreq-dt: fix handling regulator_get_voltage() result
  cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC
  PM / sleep: Add support for read-only sysfs attributes
  ACPI: Fix white space in a structure definition
  ACPI / SBS: fix inconsistent indenting inside if statement
  PNP: respect PNP_DRIVER_RES_DO_NOT_CHANGE when detaching
  ACPI / PNP: constify device IDs
  ACPI / PCI: Simplify acpi_penalize_isa_irq()
  ...
2016-01-12 20:25:09 -08:00
Linus Walleij 0c7f3f92ff mfd: ucb1x00-core: Be sure to clamp return value
As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.

Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-11 07:53:10 +00:00
Charles Keepax f199d39349 mfd: arizona: Add device tree binding to specify mono outputs
Add device tree bindings to support specifying outputs from the chip as
mono outputs. Whilst we are doing it change the out_mono pdata from a
bool to an int, because Sparse gets upset about using ARRAY_SIZE on
bools.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-11 07:33:16 +00:00
Geert Uytterhoeven 8726cacc7f mfd: da9063: Allow modular build
Allow support for the DA9063 PMIC to be modular, cfr. DA9062, which
allows to decrease size of multi-platform kernels (e.g.
multi_v7_defconfig).

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-11 06:41:52 +00:00
Charles Keepax 6c006b1b17 mfd: arizona: Request parent IRQ before we request child IRQs
Currently the driver requests the boot done and control interface IRQs
before it has requested its own IRQ line. This can cause problems on
edge triggered IRQ systems as if an edge occurs before the parent IRQ is
enabled it will be missed. Whilst we are changing the error handling
remove an unused label as well.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-11 06:41:47 +00:00
Arnd Bergmann a7b956fd38 mfd: as3722: Mark PM functions as __maybe_unused
The newly introduced as3722_i2c_suspend/resume functions are built
unconditionally, but only used when power management is enabled,
so we get a warning otherwise:

drivers/mfd/as3722.c:427:12: warning: 'as3722_i2c_suspend' defined but not used [-Wunused-function]
drivers/mfd/as3722.c:438:12: warning: 'as3722_i2c_resume' defined but not used [-Wunused-function]

This marks them both as __maybe_unused, which avoids an ugly #ifdef
and gives us best compile-time coverage. When they are unused, the
compiler will silently drop the functions from its output.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 35deff7eb2 ("mfd: as3722: Handle interrupts on suspend")
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-11 06:23:43 +00:00
Thierry Reding d91d76d84c mfd: sta2x11: Use platform_register/unregister_drivers()
These new helpers simplify implementing multi-driver modules and
properly handle failure to register one driver by unregistering all
previously registered drivers.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-11 06:23:38 +00:00
Ivan T. Ivanov 742dcd115c mfd: qcom-spmi-pmic: Don't access non-existing registers
Revision ID registers are available only on devices with
Slave IDs that are even, so don't make access to unavailable
registers.

Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
[sboyd@codeaurora.org: Consider all slave ids that are even]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-11 06:23:32 +00:00
Rasmus Villemoes a5656a7080 mfd: wm831x: Fix broken wm831x_unique_id_show
wm831x_unique_id_show currently displays an interesting pattern of '0'
and '3' characters which isn't very useful (figuring out why is left
as an exercise for the reader). Presumably "buf[i]" should have been
"id[i] & 0xff".

But while there, it is much simpler to simply use %phN and do all the
formatting at once.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-11 06:23:21 +00:00
Damien Riegel db2fb60cd3 mfd: syscon: Add a DT property to set value width
Currently syscon has a fixed configuration of 32 bits for register and
values widths. In some cases, it would be desirable to be able to
customize the value width.

For example, certain boards (like the ones manufactured by Technologic
Systems) have a FPGA that is memory-mapped, but its registers are only
16-bit wide.

This patch adds an optional "reg-io-width" DT binding for syscon that
allows to change the width for the data bus (i.e. val_bits). If this
property is provided, it will also set the register stride to
reg-io-width's value. If not provided, the default configuration is
used.

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-11 06:08:02 +00:00
Charles Keepax 32e9725d9a mfd: wm5110: Correct defaults for micbias control registers
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-11 06:08:01 +00:00
Nicolas Boichat 6d6e44a953 mfd: cros ec: Lock the SPI bus while holding chipselect
cros_ec_cmd_xfer_spi and cros_ec_pkt_xfer_spi generally work like
this:
 - Pull CS down (active), wait a bit, then send a command
 - Wait for response (multiple requests)
 - Wait a while, pull CS up (inactive)

These operations, individually, lock the SPI bus, but there is
nothing preventing the SPI framework from interleaving messages
intended for other devices as the bus is unlocked in between.

This is a problem as the EC expects CS to be held low for the
whole duration.

Solution: Lock the SPI bus during the whole transaction, to make
sure that no other messages can be interleaved.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-11 06:07:51 +00:00
Linus Walleij 0f4630f372 gpio: generic: factor into gpio_chip struct
The separate struct bgpio_chip has been a pain to handle, both
by being confusingly similar in name to struct gpio_chip and
for being contained inside a struct so that struct gpio_chip
is contained in a struct contained in a struct, making several
steps of dereferencing necessary.

Make things simpler: include the fields directly into
<linux/gpio/driver.h>, #ifdef:ed for CONFIG_GENERIC_GPIO, and
get rid of the <linux/basic_mmio_gpio.h> altogether. Prefix
some of the member variables with bgpio_* and add proper
kerneldoc while we're at it.

Modify all users to handle the change and use a struct
gpio_chip directly. And while we're at it: replace all
container_of() dereferencing by gpiochip_get_data() and
registering the gpio_chip with gpiochip_add_data().

Cc: arm@kernel.org
Cc: Alexander Shiyan <shc_work@mail.ru>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Olof Johansson <olof@lixom.net>
Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: Rabin Vincent <rabin@rab.in>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com
Acked-by: Gregory Fong <gregory.0xf0@gmail.com>
Acked-by: Liviu Dudau <Liviu.Dudau@arm.com>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-01-05 11:21:00 +01:00
Andy Shevchenko ec14c5395d mfd: intel-lpss: Pass HSUART configuration via properties
The HS-UART host controller driver needs to know certain properties like
width of the register set if it cannot get that information from ACPI or
DT. In order to support non-ACPI systems we pass this information to the
driver via device properties.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-12-07 02:29:24 +01:00
Mika Westerberg 028af5941d mfd: intel-lpss: Pass SDA hold time to I2C host controller driver
Intel Skylake the LPSS I2C pad circuit has internal delays that require
programming non-zero SDA hold time for the I2C host controller. If this is
not done communication to slave devices may fail with arbitration lost
errors like the one seen below taken from Lenovo Yoga 900:

  i2c_hid i2c-SYNA2B29:00: Fetching the HID descriptor
  i2c_hid i2c-SYNA2B29:00: __i2c_hid_command: cmd=20 00
  i2c_designware i2c_designware.1: i2c_dw_handle_tx_abort: lost arbitration

To fix this we follow what the Windows driver is doing and pass the default
SDA hold time of 230 ns to all Intel Skylake host controllers. This still
allows the platform to override these values by passing special ACPI
methods SSCN and FMCN.

Reported-by: Kevin Fenzi <kevin@scrye.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-12-07 02:29:24 +01:00
Mika Westerberg e15ad2154b mfd: intel-lpss: Add support for passing device properties
If the boot firmware does not support ACPI we need a way to pass device
configuration information to the drivers. The unified device properties API
already supports passing platform data via properties so let's take
advantage of that and allow probe drivers to pass set of properties to the
host controller driver.

In order to do that we need to be able to modify the MFD cell corresponding
the host controller, so make the core driver to take copy of the cell
instead of using it directly. Then we can assign info->pset to the
resulting copy of a cell and let the MFD core to assign that to the
resulting device.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-12-07 02:29:23 +01:00
Andy Shevchenko 4d215cabc7 mfd: core: propagate device properties to sub devices drivers
In the similar way like we do for the platform data we propagate the device
properties. For example, in case of Intel LPSS drivers we may provide a
specific property to tell the actual device driver an additional information
such as platform name.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-12-07 02:29:23 +01:00
Richard Fitzgerald ea1f333990 mfd: arizona: Support Cirrus Logic CS47L24 and WM1831
This patch adds the regmap configuration tables and
core MFD handling for the CS47L24 and WM1831 codecs.

Note that compared to the other Arizona codecs, these devices
do not have an LDO1 or micsupp regulators, extcon driver, or
the DCVDD isolation control.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-12-04 08:46:39 +00:00
LABBE Corentin cf1199f792 mfd: qcom_rpm: Fix a possible NULL dereference
of_match_device could return NULL, and so cause a NULL pointer
dereference later.

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-12-04 08:46:23 +00:00
Linus Walleij bdd5dcf513 mfd: ab8500: Delete static IRQ resources
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-12-04 08:46:17 +00:00
Julia Lawall f83e7d8140 mfd: da903x: Constify da903x_chip_ops structure
The da903x_chip_ops structure is never modified, so declare it
as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-12-04 08:46:03 +00:00
Saurabh Sengar 505b9e573c mfd: mc13xxx-core: Use of_property_read_bool()
For checking if a property is present or not,
use of_property_read_bool instead of of_get_property()

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-12-04 08:45:54 +00:00
Jon Hunter 35deff7eb2 mfd: as3722: Handle interrupts on suspend
The as3722 device is registered as an irqchip and the as3722-rtc interrupt
is one of it's interrupt sources. When using the as3722-rtc as a wake-up
device from suspend, the following is seen:

  PM: Syncing filesystems ... done.
  Freezing user space processes ... (elapsed 0.001 seconds) done.
  Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
  Suspending console(s) (use no_console_suspend to debug)
  PM: suspend of devices complete after 161.119 msecs
  PM: late suspend of devices complete after 1.048 msecs
  PM: noirq suspend of devices complete after 0.756 msecs
  Disabling non-boot CPUs ...
  CPU1: shutdown
  CPU2: shutdown
  CPU3: shutdown
  Entering suspend state LP1
  Enabling non-boot CPUs ...
  CPU1 is up
  CPU2 is up
  CPU3 is up
  PM: noirq resume of devices complete after 0.487 msecs
  as3722 4-0040: Failed to read IRQ status: -16
  as3722 4-0040: Failed to read IRQ status: -16
  as3722 4-0040: Failed to read IRQ status: -16
  as3722 4-0040: Failed to read IRQ status: -16
  ...

The reason why the as3722 interrupt status cannot be read is because the
as3722 interrupt is not masked during suspend and when the as3722-rtc
interrupt occurs, to wake-up the device, the interrupt is seen before the
i2c controller has been resumed in order to read the as3722 interrupt
status.

The as3722-rtc driver sets it's interrupt as a wake-up source during
suspend, which gets propagated to the parent as3722 interrupt. However,
the as3722-rtc driver cannot disable it's interrupt during suspend
otherwise we would never be woken up and so the as3722 must disable it's
interrupt instead.

Fix this by disabling the as3722 interrupt during suspend. To ensure that
a wake-up event from the as3722 is not missing, enable the as3722 interrupt
as a wake-up source before disabling the interrupt on entering suspend.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-12-04 08:45:44 +00:00
Charles Keepax cc509d5ba2 mfd: wm8994: Ensure that the whole MFD is built into a single module
The MFD part of wm8994 consists of three files wm8994-core.c,
wm8994-irq.c and wm8994-regmap.c only wm8994-core.c has a
MODULE_DESCRIPTION / LICENSE. These were clearly intended to be built
as a single module, but currently are not. This will lead to a tainted
kernel when loading modules for wm8894-irq.c and wm8994-regmap.c because
are missing a license.

This patch fixes this issue by grouping the three files together into a
single module.

Reported-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-11-24 11:11:18 +00:00
Alim Akhtar 2fadbbf02d mfd: sec-core: Rename MFD and regulator names differently
Currently S2MPSXX multifunction device is named as *-pmic,
and these MFDs also supports regulator as a one of its MFD cell which
has the same name, because current name is confusing and we want to
sort it out.

We did discussed different approaches about how the MFD and it
cells need to be named here [1].
Based in the discussion this patch rename MFD regulator name as
*-regulator instead of current *-pmic.

This patch also changes the corresponding entries in the regulator driver
to keep git-bisect happy.

[1]-> https://lkml.org/lkml/2015/10/28/417

Suggested-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-11-24 11:11:16 +00:00
Alexandra Yates 6223a30935 mfd: lpc_ich: Intel device IDs for PCH
Adding Intel codename Lewisburg platform device IDs for PCH.

Signed-off-by: Alexandra Yates <alexandra.yates@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-11-24 11:10:46 +00:00
Thomas Abraham 9e4808d2c6 mfd: sec: Add support for S2MPS15 PMIC
Add support for S2MPS15 PMIC which is similar to S2MPS11 PMIC. The S2MPS15
PMIC supports 27 LDO regulators, 10 buck regulators, RTC, three 32.768KHz
clock outputs and battery charger. This patch adds initial support for
LDO and buck regulators of S2MPS15 device.

Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
[Alim: Added s2mps15_devs like rtc and clk and related changes]
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-11-23 10:33:16 +00:00
Linus Walleij 58383c7842 gpio: change member .dev to .parent
The name .dev in a struct is normally reserved for a struct device
that is let us say a superclass to the thing described by the struct.
struct gpio_chip stands out by confusingly using a struct device *dev
to point to the parent device (such as a platform_device) that
represents the hardware. As we want to give gpio_chip:s real devices,
this is not working. We need to rename this member to parent.

This was done by two coccinelle scripts, I guess it is possible to
combine them into one, but I don't know such stuff. They look like
this:

@@
struct gpio_chip *var;
@@
-var->dev
+var->parent

and:

@@
struct gpio_chip var;
@@
-var.dev
+var.parent

and:

@@
struct bgpio_chip *var;
@@
-var->gc.dev
+var->gc.parent

Plus a few instances of bgpio that I couldn't figure out how
to teach Coccinelle to rewrite.

This patch hits all over the place, but I *strongly* prefer this
solution to any piecemal approaches that just exercise patch
mechanics all over the place. It mainly hits drivers/gpio and
drivers/pinctrl which is my own backyard anyway.

Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Rafał Miłecki <zajec5@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Alek Du <alek.du@intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-11-19 09:24:35 +01:00
Mauro Carvalho Chehab eb4b0ec75e [media] include/media: move platform_data to linux/platform_data/media
Let's not mix platform_data headers with the core headers. Instead, let's
create a subdir at linux/platform_data and move the headers to that
common place, adding it to MAINTAINERS.

The headers were moved with:
	mkdir include/linux/platform_data/media/; git mv include/media/gpio-ir-recv.h include/media/ir-rx51.h include/media/mmp-camera.h include/media/omap1_camera.h include/media/omap4iss.h include/media/s5p_hdmi.h include/media/si4713.h include/media/sii9234.h include/media/smiapp.h include/media/soc_camera.h include/media/soc_camera_platform.h include/media/timb_radio.h include/media/timb_video.h include/linux/platform_data/media/

And the references fixed with this script:
    MAIN_DIR="linux/platform_data/"
    PREV_DIR="media/"
    DIRS="media/"

    echo "Checking affected files" >&2
    for i in $DIRS; do
	for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do
		 n=`basename $j`
		git grep -l $n
	done
    done|sort|uniq >files && (
	echo "Handling files..." >&2;
	echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\";
	(
		cd include/$MAIN_DIR;
		for j in $DIRS; do
			for i in $(ls $j); do
				echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\";
			done;
		done;
		echo "cat > a && mv a \$i; done";
	);
	echo "Handling documentation..." >&2;
	echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\";
	(
		cd include/$MAIN_DIR;
		for j in $DIRS; do
			for i in $(ls $j); do
				echo "  perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\";
			done;
		done;
		echo "cat > a && mv a \$i; done"
	);
    ) >script && . ./script

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2015-11-17 06:58:42 -02:00
Linus Torvalds 9cf5c095b6 asm-generic cleanups
The asm-generic changes for 4.4 are mostly a series from Christoph Hellwig
 to clean up various abuses of headers in there. The patch to rename the
 io-64-nonatomic-*.h headers caused some conflicts with new users, so I
 added a workaround that we can remove in the next merge window.
 
 The only other patch is a warning fix from Marek Vasut
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIVAwUAVjzaf2CrR//JCVInAQImmhAA20fZ91sUlnA5skKNPT1phhF6Z7UF2Sx5
 nPKcHQD3HA3lT1OKfPBYvCo+loYflvXFLaQThVylVcnE/8ecAEMtft4nnGW2nXvh
 sZqHIZ8fszTB53cynAZKTjdobD1wu33Rq7XRzg0ugn1mdxFkOzCHW/xDRvWRR5TL
 rdQjzzgvn2PNlqFfHlh6cZ5ykShM36AIKs3WGA0H0Y/aYsE9GmDOAUp41q1mLXnA
 4lKQaIxoeOa+kmlsUB0wEHUecWWWJH4GAP+CtdKzTX9v12bGNhmiKUMCETG78BT3
 uL8irSqaViNwSAS9tBxSpqvmVUsa5aCA5M3MYiO+fH9ifd7wbR65g/wq39D3Pc01
 KnZ3BNVRW5XSA3c86pr8vbg/HOynUXK8TN0lzt6rEk8bjoPBNEDy5YWzy0t6reVe
 wX65F+ver8upjOKe9yl2Jsg+5Kcmy79GyYjLUY3TU2mZ+dIdScy/jIWatXe/OTKZ
 iB4Ctc4MDe9GDECmlPOWf98AXqsBUuKQiWKCN/OPxLtFOeWBvi4IzvFuO8QvnL9p
 jZcRDmIlIWAcDX/2wMnLjV+Hqi3EeReIrYznxTGnO7HHVInF555GP51vFaG5k+SN
 smJQAB0/sostmC1OCCqBKq5b6/li95/No7+0v0SUhJJ5o76AR5CcNsnolXesw1fu
 vTUkB/I66Hk=
 =dQKG
 -----END PGP SIGNATURE-----

Merge tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

Pull asm-generic cleanups from Arnd Bergmann:
 "The asm-generic changes for 4.4 are mostly a series from Christoph
  Hellwig to clean up various abuses of headers in there.  The patch to
  rename the io-64-nonatomic-*.h headers caused some conflicts with new
  users, so I added a workaround that we can remove in the next merge
  window.

  The only other patch is a warning fix from Marek Vasut"

* tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  asm-generic: temporarily add back asm-generic/io-64-nonatomic*.h
  asm-generic: cmpxchg: avoid warnings from macro-ized cmpxchg() implementations
  gpio-mxc: stop including <asm-generic/bug>
  n_tracesink: stop including <asm-generic/bug>
  n_tracerouter: stop including <asm-generic/bug>
  mlx5: stop including <asm-generic/kmap_types.h>
  hifn_795x: stop including <asm-generic/kmap_types.h>
  drbd: stop including <asm-generic/kmap_types.h>
  move count_zeroes.h out of asm-generic
  move io-64-nonatomic*.h out of asm-generic
2015-11-06 14:22:15 -08:00
Linus Torvalds 4dcee4d843 mfd: avoid newly introduced compiler warning
Commit b158b69a37 ("mfd: rtsx: Simplify function return logic")
removed the use of the 'err' variable, but left the variable itself
around, resulting in gcc quite reasonably warning:

    drivers/mfd/rtsx_pcr.c: In function ‘rtsx_pci_set_pull_ctl’:
    drivers/mfd/rtsx_pcr.c:565:6: warning: unused variable ‘err’ [-Wunused-variable]
      int err;
          ^

Get rid of the unused variable, and avoid the new warning.

Cc: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-11-06 10:47:12 -08:00
Linus Torvalds bc914532a0 - New Device Support
- Add support for 88pm860; 88pm80x
    - Add support for 24c08 EEPROM; at24
    - Add support for Broxton Whiskey Cove; intel*
    - Add support for RTS522A; rts5227
    - Add support for I2C devices; intel_quark_i2c_gpio
  - New Functionality
    - Add microphone support; arizona
    - Add general purpose switch support; arizona
    - Add fuel-gauge support; da9150-core
    - Add shutdown support; sec-core
    - Add charger support; tps65217
    - Add flexible serial communication unit support; atmel-flexcom
    - Add power button support; axp20x
    - Add led-flash support; rt5033
  - Core Frameworks
    - Supply a generic macro for defining Regmap IRQs
    - Rework ACPI child device matching
  - Fix-ups
    - Use Regmap to access registers; tps6105x
    - Use DEFINE_RES_IRQ_NAMED() macro; da9150
    - Re-arrange device registration order; intel_quark_i2c_gpio
    - Allow OF matching; cros_ec_i2c, atmel-hlcdc, hi6421-pmic, max8997, sm501
    - Handle deferred probe; twl6040
    - Improve accuracy of headphone detect; arizona
    - Unnecessary MODULE_ALIAS() removal; bcm590xx, rt5033
    - Remove unused code; htc-i2cpld, arizona, pcf50633-irq, sec-core
    - Simplify code; kempld, rts5209, da903x, lm3533, da9052, arizona
    - Remove #iffery; arizona
    - DT binding adaptions; many
  - Bug Fixes
    - Fix possible NULL pointer dereference; wm831x, tps6105x
    - Fix 64bit bug; intel_soc_pmic_bxtwc
    - Fix signedness issue; arizona
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWOzEbAAoJEFGvii+H/HdhbUEQAIBHvNaunWp362L2D2lOOQMa
 cBlGiR2yXCpsFGAcvpr50zX5soFuNITGea1CidJmp/ZIHIG7hVUz5E8wQZ8HdiyG
 03UKsa6xkVx9i+PhV5agUjxi6MDgUvxsPwdbVw6LTw1wQejIrfxq7ObdcPo30OTI
 4r0tjLonQkGaFFdGqC4Jr7Grs7pvzmKzHu08AaknaoTyhUl/E9Wtq12HJFr8kUCw
 WNgEyiPzNk0h9EByCUiG7iFwyg1EJLsF1U973Th8Utvl7PFe8REQVZ46v9iYAM9J
 1OeSrsKhtyhQqAP/FJ5odZCXwTy9q6ifGfELyyS26/okCYWDzxDcF+hAp0VNbzb4
 zYvEnKue101Y+WEsF9bNaya3avf45obJuRaRukoGMZ/brW6+d1ub0kwUKMD8MqOn
 UFL3oZwfPQ8mWB5ddELl97dzJDwHbEIhWe7yKQVpTaJ2pCm6JSS5Vb0TU+A1Zywp
 Hie1Yr0y36npnCbml4W74O9H/rblpNpgFlaupfB6mHRWZyTsyQNeKJ6FWTirncgQ
 xy8Ti+ZsXlMTvWCzzS3GcjP9rAK0e5dKurOE8t+krZmTul96+OYsnvxRC0nyo7XC
 1PKomkWO+3if2DsnurFX/QKfE55PCKermJRO5mDZbsWp6aJAhKW5UwxAgkHpUHsJ
 hHaT+npBczXbq8jvEMTt
 =99/D
 -----END PGP SIGNATURE-----

Merge tag 'mfd-for-linus-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Device Support:
   - Add support for 88pm860; 88pm80x
   - Add support for 24c08 EEPROM; at24
   - Add support for Broxton Whiskey Cove; intel*
   - Add support for RTS522A; rts5227
   - Add support for I2C devices; intel_quark_i2c_gpio

  New Functionality:
   - Add microphone support; arizona
   - Add general purpose switch support; arizona
   - Add fuel-gauge support; da9150-core
   - Add shutdown support; sec-core
   - Add charger support; tps65217
   - Add flexible serial communication unit support; atmel-flexcom
   - Add power button support; axp20x
   - Add led-flash support; rt5033

  Core Frameworks:
   - Supply a generic macro for defining Regmap IRQs
   - Rework ACPI child device matching

  Fix-ups:
   - Use Regmap to access registers; tps6105x
   - Use DEFINE_RES_IRQ_NAMED() macro; da9150
   - Re-arrange device registration order; intel_quark_i2c_gpio
   - Allow OF matching; cros_ec_i2c, atmel-hlcdc, hi6421-pmic, max8997, sm501
   - Handle deferred probe; twl6040
   - Improve accuracy of headphone detect; arizona
   - Unnecessary MODULE_ALIAS() removal; bcm590xx, rt5033
   - Remove unused code; htc-i2cpld, arizona, pcf50633-irq, sec-core
   - Simplify code; kempld, rts5209, da903x, lm3533, da9052, arizona
   - Remove #iffery; arizona
   - DT binding adaptions; many

  Bug Fixes:
   - Fix possible NULL pointer dereference; wm831x, tps6105x
   - Fix 64bit bug; intel_soc_pmic_bxtwc
   - Fix signedness issue; arizona"

* tag 'mfd-for-linus-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (73 commits)
  bindings: mfd: s2mps11: Add documentation for s2mps15 PMIC
  mfd: sec-core: Remove unused s2mpu02-rtc and s2mpu02-clk children
  extcon: arizona: Add extcon specific device tree binding document
  MAINTAINERS: Add binding docs for Cirrus Logic/Wolfson Arizona devices
  mfd: arizona: Remove bindings covered in new subsystem specific docs
  mfd: rt5033: Add RT5033 Flash led sub device
  mfd: lpss: Add Intel Broxton PCI IDs
  mfd: lpss: Add Broxton ACPI IDs
  mfd: arizona: Signedness bug in arizona_runtime_suspend()
  mfd: axp20x: Add a cell for the power button part of the, axp288 PMICs
  mfd: dt-bindings: Document pulled down WRSTBI pin on S2MPS1X
  mfd: sec-core: Disable buck voltage reset on watchdog falling edge
  mfd: sec-core: Dump PMIC revision to find out the HW
  mfd: arizona: Use correct type ID for device tree config
  mfd: arizona: Remove use of codec build config #ifdefs
  mfd: arizona: Simplify adding subdevices
  mfd: arizona: Downgrade type mismatch messages to dev_warn
  mfd: arizona: Factor out checking of jack detection state
  mfd: arizona: Factor out DCVDD isolation control
  mfd: Make TPS6105X select REGMAP_I2C
  ...
2015-11-06 10:23:50 -08:00
Linus Torvalds 75f5db39ff spi: Updates for v4.4
Quite a lot of activity in SPI this cycle, almost all of it in drivers
 with a few minor improvements and tweaks in the core.
 
  - Updates to pxa2xx to support Intel Broxton and multiple chip selects.
  - Support for big endian in the bcm63xx driver.
  - Multiple slave support for the mt8173
  - New driver for the auxiliary SPI controller in bcm2835 SoCs.
  - Support for Layerscale SoCs in the Freescale DSPI driver.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWOehzAAoJECTWi3JdVIfQTPYH+wYMDG8gAIw2s0AJ4DvVe4qZ
 sOAm1UgUJZxssrEA6BNqbfM0dfRo+oQJKmRd0Dc5n7LEMsYHdI/5yKHk8PCS6ZzD
 iQyQCzbd0thDAqwuPaMP62cyPDHwyJX22VGTsgVnj6AZqAQ+9+g4SPKhFnm1Mlm4
 hmDi6fdSrsqo8k8gkpVN8RFOfVsjAV1dLtAauQRWDHrqMxXURSrKG76eqAqUa5bn
 BLPXBoj5PA0DMLPO2j+ADZwWN723LrI2mSSlc+ThjEX/OIt2OhAoiOTV5RPqaafy
 TIsCkh68q/gYAsL5HtvvmgZByl41FLYiO0Z+rXmWUyMMbnvhZTLws9S2BNpBLuk=
 =DgXG
 -----END PGP SIGNATURE-----

Merge tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi updates from Mark Brown:
 "Quite a lot of activity in SPI this cycle, almost all of it in drivers
  with a few minor improvements and tweaks in the core.

   - Updates to pxa2xx to support Intel Broxton and multiple chip selects.
   - Support for big endian in the bcm63xx driver.
   - Multiple slave support for the mt8173
   - New driver for the auxiliary SPI controller in bcm2835 SoCs.
   - Support for Layerscale SoCs in the Freescale DSPI driver"

* tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (87 commits)
  spi: pxa2xx: Rework self-initiated platform data creation for non-ACPI
  spi: pxa2xx: Add support for Intel Broxton
  spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals
  spi: pxa2xx: Add output control for multiple Intel LPSS chip selects
  spi: pxa2xx: Use LPSS prefix for defines that are Intel LPSS specific
  spi: Add DSPI support for layerscape family
  spi: ti-qspi: improve ->remove() callback
  spi/spi-xilinx: Fix race condition on last word read
  spi: Drop owner assignment from spi_drivers
  spi: Add THIS_MODULE to spi_driver in SPI core
  spi: Setup the master controller driver before setting the chipselect
  spi: dw: replace magic constant by DW_SPI_DR
  spi: mediatek: mt8173 spi multiple devices support
  spi: mediatek: handle controller_data in mtk_spi_setup
  spi: mediatek: remove mtk_spi_config
  spi: mediatek: Update document devicetree bindings to support multiple devices
  spi: fix kernel-doc warnings about missing return desc in spi.c
  spi: fix kernel-doc warnings about missing return desc in spi.h
  spi: pxa2xx: Align a few defines
  spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select
  ...
2015-11-05 13:15:12 -08:00
Linus Torvalds 52787e91bf regulator: Updates for v4.4
This is quite a quiet release in terms of volume of patches but it
 includes a couple of really nice core changes - the work Sascha has done
 in particular is something I've wanted to get done for a long time but
 just never got round to myself.  Highlights include:
 
  - Support from Sascha Hauer for setting the voltage of parent supplies
    based on requests from their children.  This is used both to allow
    set_voltage() to work through a dumb switch and to improve the
    efficiency of systems where DCDCs are used to supply LDOs by minimising
    the voltage drop over the LDOs.
  - Removal of regulator_list by Tomeu Vizoso, meaning we're not
    duplicating the device list maintained by the driver core.
  - Support for Wolfson/Cirrus WM8998 and WM1818.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWOez1AAoJECTWi3JdVIfQZSoH/jk2EQCG7hSIY6qVviHh+zQI
 TWULXDnldyfT4eCYNAhwe/oQjFs7ngPXz9UpMAQwtWfWNoLBifF+Y5+X413nHY82
 pKoRd+DQ1sIzGZb2YB0kS22Zg49Jilgv3y2Cw0aZuL7aqq7CEUGN3itEeWxqW9j8
 a1ORD4d2zgki4gK9fUBTiur/dIhMn+8Gi4CmBvujsSCQR4Z5UNOjiodTU0NONiBX
 znejoAoLJXzAyAoWN+p6sEvi9Gpx4QTV6tBOo56WPlzBgTX2qOFhhmJiQQ1rIJOv
 MucgNn+cocarWfMyQwvqa0CL4ufjJm2DcYoIhfc2jZip/mAeqcbxpj5bxWzaLec=
 =CX2S
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "This is quite a quiet release in terms of volume of patches but it
  includes a couple of really nice core changes - the work Sascha has
  done in particular is something I've wanted to get done for a long
  time but just never got round to myself.

  Highlights include:

   - Support from Sascha Hauer for setting the voltage of parent
     supplies based on requests from their children.  This is used both
     to allow set_voltage() to work through a dumb switch and to improve
     the efficiency of systems where DCDCs are used to supply LDOs by
     minimising the voltage drop over the LDOs.

   - Removal of regulator_list by Tomeu Vizoso, meaning we're not
     duplicating the device list maintained by the driver core.

   - Support for Wolfson/Cirrus WM8998 and WM1818"

* tag 'regulator-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (29 commits)
  regulator: Use regulator_lock_supply() for get_voltage() too
  regulator: arizona: Add regulator specific device tree binding document
  regulator: stw481x: compile on COMPILE_TEST
  regulator: qcom-smd: Correct set_load() unit
  regulator: core: Propagate voltage changes to supply regulators
  regulator: core: Factor out regulator_map_voltage
  regulator: i.MX anatop: Allow supply regulator
  regulator: introduce min_dropout_uV
  regulator: core: create unlocked version of regulator_set_voltage
  regulator: arizona-ldo1: Fix handling of GPIO 0
  regulator: da9053: Update regulator for DA9053 BC silicon support
  regulator: max77802: Separate sections for nodes and properties
  regulator: max77802: Add input supply properties to DT binding doc
  regulator: axp20x: set supply names for AXP22X DC1SW/DC5LDO internally
  regulator: axp20x: Drop AXP221 DC1SW and DC5LDO regulator supplies from bindings
  mfd: tps6105x: Use i2c regmap to access registers
  regulator: act8865: add DT binding for property "active-semi,vsel-high"
  regulator: act8865: support output voltage by VSET2[] bits
  regulator: arizona: add support for WM8998 and WM1814
  regulator: core: create unlocked version of regulator_list_voltage
  ...
2015-11-05 13:06:22 -08:00
Linus Torvalds 8e483ed134 char/misc drivers for 4.4-rc1
Here is the big char/misc driver update for 4.4-rc1.  Lots of different
 driver and subsystem updates, hwtracing being the largest with the
 addition of some new platforms that are now supported.  Full details in
 the shortlog.
 
 All of these have been in linux-next for a long time with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlY6d/oACgkQMUfUDdst+yl93ACcCf91y+ufwU3cmcnq5LpwHPfx
 VbkAn08Cn6Wu6IcihoEpR4hqGgIOtjqW
 =1a3d
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver updates from Greg KH:
 "Here is the big char/misc driver update for 4.4-rc1.  Lots of
  different driver and subsystem updates, hwtracing being the largest
  with the addition of some new platforms that are now supported.  Full
  details in the shortlog.

  All of these have been in linux-next for a long time with no reported
  issues"

* tag 'char-misc-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (181 commits)
  fpga: socfpga: Fix check of return value of devm_request_irq
  lkdtm: fix ACCESS_USERSPACE test
  mcb: Destroy IDA on module unload
  mcb: Do not return zero on error path in mcb_pci_probe()
  mei: bus: set the device name before running fixup
  mei: bus: use correct lock ordering
  mei: Fix debugfs filename in error output
  char: ipmi: ipmi_ssif: Replace timeval with timespec64
  fpga: zynq-fpga: Fix issue with drvdata being overwritten.
  fpga manager: remove unnecessary null pointer checks
  fpga manager: ensure lifetime with of_fpga_mgr_get
  fpga: zynq-fpga: Change fw format to handle bin instead of bit.
  fpga: zynq-fpga: Fix unbalanced clock handling
  misc: sram: partition base address belongs to __iomem space
  coresight: etm3x: adding documentation for sysFS's cpu interface
  vme: 8-bit status/id takes 256 values, not 255
  fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000
  ARM: zynq: dt: Updated devicetree for Zynq 7000 platform.
  ARM: dt: fpga: Added binding docs for Xilinx Zynq FPGA manager.
  ver_linux: proc/modules, limit text processing to 'sed'
  ...
2015-11-04 22:15:15 -08:00
Mark Brown 62e544b983 Merge remote-tracking branches 'regulator/topic/supply', 'regulator/topic/tps6105x' and 'regulator/topic/tps65023' into regulator-next 2015-11-04 11:19:43 +00:00
Mark Brown 4c84518523 Merge remote-tracking branches 'spi/topic/omap-100k', 'spi/topic/omap-uwire', 'spi/topic/owner', 'spi/topic/pxa' and 'spi/topic/pxa2xx' into spi-next 2015-11-04 11:02:12 +00:00
Krzysztof Kozlowski 644a3746d9 mfd: sec-core: Remove unused s2mpu02-rtc and s2mpu02-clk children
The commit 54e8827d5f ("mfd: sec-core: Add support for S2MPU02
device") added new MFD child devices for S2MPU02: RTC and clock
provider (the clock provider with new compatible). However support for
these devices was not added to existing drivers (rtc-s5m, clk-s2mps11).
New drivers were not submitted neither.

This means that the name of children devices is completely unused. The
"samsung,s2mpu02-clk" compatible remains undocumented so it is unclear
what is provided by that compatible.

Clean up this by removing unused child devices and undocumented
compatible.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 18:57:38 +00:00
Ingi Kim b487c17d5f mfd: rt5033: Add RT5033 Flash led sub device
This patch adds rt5033-led sub device to support it.

Signed-off-by: Ingi Kim <ingi2.kim@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 18:57:35 +00:00
Andy Shevchenko ff0a04a699 mfd: lpss: Add Intel Broxton PCI IDs
Intel Broxton has the same LPSS block than Intel Sunrisepoint so add
Broxton PCI IDs to the list.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 18:57:34 +00:00
Mika Westerberg 6a636ec0ab mfd: lpss: Add Broxton ACPI IDs
Intel Broxton has the same LPSS block than Intel Sunrisepoint so add
Broxton ACPI IDs to the list.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 18:57:33 +00:00
Dan Carpenter a05950a445 mfd: arizona: Signedness bug in arizona_runtime_suspend()
The "jd_active" variable needs to be signed for the error handling to
work.

Fixes: 143e5887ae57 ('mfd: arizona: factor out checking of jack detection state')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 18:56:58 +00:00
Borun Fu e56e5ad67d mfd: axp20x: Add a cell for the power button part of the, axp288 PMICs
This patch adds the mfd cell info for axp288 power key device.

Signed-off-by: Borun Fu <borun.fu@linux.intel.com>
Signed-off-by: Fei Yang <fei.yang@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:20:39 +00:00
Krzysztof Kozlowski 8a97d4287e mfd: sec-core: Disable buck voltage reset on watchdog falling edge
The WRSTBI bit (disabled by default but enabled by bootloader), when
set, is responsible for resetting voltages to default values of
certain bucks on falling edge of Warm Reset Input pin from AP.

However on some boards (with S2MPS13) the pin is pulled down so any
suspend will effectively trigger the reset of bucks supplying the power
to the little and big cores. In the same time when resuming, these bucks
must provide voltage greater or equal to voltage before suspend to match
the frequency chosen by cpufreq. If voltage (default value of voltage
after reset) is lower than one set by cpufreq before suspend, then
system will hang during resuming.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reported-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:20:37 +00:00
Krzysztof Kozlowski c2c9f1fe4b mfd: sec-core: Dump PMIC revision to find out the HW
There are different revisions of the same chipset. For example S2MPS13 has
more than 2 revisions. They differ slightly in regulator constraints.
Print the revision number to easily find which PMIC is used on the board.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:20:37 +00:00
Richard Fitzgerald 2e44e28ad2 mfd: arizona: Use correct type ID for device tree config
In the case of a device tree config the code uses the device ID
from the DT entry to check which codec is required but when storing
the ID into struct arizona it was always using the non-DT SPI device
table to get an ID.

This patch changes the code to store the correct ID into struct arizona.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:20:30 +00:00
Richard Fitzgerald b61c1ec058 mfd: arizona: Remove use of codec build config #ifdefs
Remove the use of #ifdefs around each case statement of the chip ID
and type validation switches.

We must ensure that the contained code still compiles to nothing if
support for that codec was not built into the kernel, to prevent
creation of link references to missing functions. So the ifdefs are
replaced with a use of the IS_ENABLED() macro.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:20:29 +00:00
Richard Fitzgerald ae05ea36d1 mfd: arizona: Simplify adding subdevices
The code was using a switch on the code type to execute
one of several mfd_add_devices() calls. We're already
switching on the code type earlier in the function to
select the correct patch function so we can roll selection
of the mfd device table into the same switch.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:20:28 +00:00
Richard Fitzgerald 161ad30bd2 mfd: arizona: Downgrade type mismatch messages to dev_warn
If the declared codec type doesn't match the detected type
we issue a log message but carry on registering the device,
so a dev_warn() is appropriate rather than a dev_err()

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:20:27 +00:00
Richard Fitzgerald e342427354 mfd: arizona: Factor out checking of jack detection state
Currently runtime_suspend will fully power off the codec if
the jack detection is not enabled. Not all future codecs will
have jack detection so to prepare for these codecs this patch
factors out the check so that it be called as needed in the
existing codec-specific switch cases.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:20:20 +00:00
Richard Fitzgerald e7811147aa mfd: arizona: Factor out DCVDD isolation control
Currently DCVDD isolation is enabled and disabled for
runtime_suspend and runtime_resume. Future codecs will not
have the isolation control so to prepare for these codecs
this patch factors out the isolation control allowing it to
be called as needed in the existing codec-specific switch cases.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:20:13 +00:00
Axel Lin 18eb3f041a mfd: Make TPS6105X select REGMAP_I2C
This is required since
commit 7e50711993 ("mfd: tps6105x: Use i2c regmap to access registers").

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:20:12 +00:00
Sudip Mukherjee 0a27186448 mfd: lm3533: Fix unused variable build warning
We were getting build warning about unused variable 'ret'.
The commit c749db571dcf has removed the use of ret but missed removing
the variable which is unused now.

Fixes: c749db571dcf ("mfd: lm3533: Simplify function return logic")
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:52 +00:00
Micky Ching ce6a5acc93 mfd: rtsx: Add support for rts522A
rts522a(rts5227s) is derived from rts5227, and mainly same with rts5227.
Add it to file mfd/rts5227.c to support this chip.

Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:51 +00:00
Axel Lin 6f44b14870 mfd: da9062-core: Rename get_device_type to da9062_get_device_type
Rename get_device_type() to da9062_get_device_type().
This function is only used in this file so make it static.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:51 +00:00
Luis de Bethencourt 5349ca11ca mfd: Kconfig: Compile MFD_STW481X with COMPILE_TEST
The driver depends on ARCH_NOMADIK but there isn't a build dependency
so it's a good idea to allow the driver to always be built when the
COMPILE_TEST option is enabled.

That way, the driver can be built with a config generated by make
allyesconfig and check if a patch would break the build.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:50 +00:00
Steve Twiss 0386af30d3 mfd: da9053: Addition of extra registers for GPIOs 8-13
Definitions for GPIO registers 8, 9, 10, 11, 12 and 13 are added into
the register header file.

- DA9052_GPIO_8_9_REG    25
- DA9052_GPIO_10_11_REG  26
- DA9052_GPIO_12_13_REG  27

A modification is also made to the MFD core code to define these registers
as readable and writable. The functions for da9052_reg_readable() and
da9052_reg_writeable() have had their case statements altered to include
these new registers.

Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:49 +00:00
Cyrille Pitchen 5c41f11c62 mfd: atmel-flexcom: Add a driver for Atmel Flexible Serial Communication Unit
This driver supports the new Atmel Flexcom. The Flexcom is a wrapper which
integrates one SPI controller, one I2C controller and one USART. Only one
function can be enabled at a time. This driver selects the function once
for all, when the Flexcom is probed, according to the value of the new
"atmel,flexcom-mode" device tree property.

This driver has chosen to present the Flexcom to the system as a MFD so
the implementation is seamless for the existing Atmel SPI, I2C and USART
drivers.

Also the Flexcom embeds FIFOs: the latest patches of the SPI, I2C and
USART drivers take advantage of this new feature.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:49 +00:00
Dan Carpenter f3a654c519 mfd: intel_soc_pmic_bxtwc: 64 bit bug in bxtwc_val_store()
The call to kstrtoul() will corrupt memory on 64 bit systems because an
int is 4 bytes and a long is 8.

Also it's not a good idea to let users trigger a dev_err() because it
just ends up flooding /var/log/messages so I removed the printk.

Fixes: 2ddd2086ea9c ('mfd: add Intel Broxton Whiskey Cove PMIC driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:47 +00:00
Javier Martinez Canillas ad698ea425 mfd: da9052: Simplify function return logic
The invoked functions already return zero on success or a negative
errno code so there is no need to open code the logic in the caller.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:46 +00:00
Javier Martinez Canillas a1c16d71bc mfd: lm3533: Simplify function return logic
The invoked functions already return zero on success or a negative
errno code so there is no need to open code the logic in the caller.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:45 +00:00
Javier Martinez Canillas 5597da2949 mfd: da903x: Simplify function return logic
The invoked function already returns zero on success or a negative
errno code so there is no need to open code the logic in the caller.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:45 +00:00
Javier Martinez Canillas b158b69a37 mfd: rtsx: Simplify function return logic
The invoked functions already return zero on success or a negative
errno code so there is no need to open code the logic in the caller.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:44 +00:00
Javier Martinez Canillas d8498df1e4 mfd: kempld-core: Simplify function return logic
The invoked functions already return zero on success or a negative
errno code so there is no need to open code the logic in the caller.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:43 +00:00
Javier Martinez Canillas e7238fd255 mfd: pcf50633: Remove unneded ret variable
The ret variable is not needed since is not used in the
function. Remove the variable and just return 0 instead.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:42 +00:00
Javier Martinez Canillas a260fba115 mfd: arizona: Remove unneded ret variable
The ret variable is not needed since is not used in the
function. Remove the variable and just return 0 instead.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:42 +00:00
Javier Martinez Canillas a48baac52a mfd: htc-i2cpld: Remove unneded ret variable
The ret variable is not needed since is not used in the
function. Remove the variable and just return 0 instead.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:41 +00:00
Grigoryev Denis ea50e9d3c4 mfd: tps6105x: Fix possible NULL pointer access
tps6105 driver provides two cells. One is for GPIO and another one is
for selected mode depending on platform data. When tps6105x is used in
GPIO-only mode, this driver calls mfd_add_devices() with mfd_cell
.name == NULL. This value causes an oops in platform_device_register()
later.

The following patch adds a mfd_cell for each possible mode thereby
excluding .name assignment in runtime.

Signed-off-by: Denis Grigoryev <grigoryev@fastwel.ru>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:40 +00:00
Sudeep Holla ced7e09355 mfd: qcom_rpm: Drop use of IRQF_NO_SUSPEND flag
The driver handles wakeup irq correctly using irq_set_irq_wake. There's
no need to use IRQF_NO_SUSPEND while registering the interrupt.

This patch removes the use of IRQF_NO_SUSPEND flag.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:40 +00:00
Aaron Sierra 3dab794f50 mfd: lpc_ich: Separate device cells for clarity
The lpc_ich_cells array gives the wrong impression about the
relationship between the watchdog and GPIO devices. They are
completely distinct devices, so this patch separates the
array into distinct mfd_cell structs per device.

A side effect of removing the array, is that the lpc_cells enum
is no longer needed.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:18:50 +00:00
Qipeng Zha 39d047c0b1 mfd: add Intel Broxton Whiskey Cove PMIC driver
Add MFD core driver for Intel Broxton Whiskey Cove PMIC,
which is specially accessed by hardware IPC, not a generic
I2C device

Signed-off-by: Qipeng Zha <qipeng.zha@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:18:50 +00:00
Andrew F. Davis 3821a065f5 spi: Drop owner assignment from spi_drivers
An spi_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-28 10:30:17 +09:00
Javier Martinez Canillas 4a32229668 mfd: rt5033: Remove unnecessary MODULE_ALIAS()
The driver has a I2C device id table that is used to create the module
aliases which already contains a "rt5033". So the alias is not needed.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:10 +00:00
Javier Martinez Canillas 9828ab4711 mfd: bcm590xx: Remove unnecessary MODULE_ALIAS()
The driver has a I2C device id table that is used to create the module
aliases and also "bcm590xx" isn't a supported I2C id, so it's never used.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:09 +00:00
Enric Balletbo i Serra 55cec67aa3 mfd: tps65217: Add battery charger as subdevice
Add tps65217 battery charger subdevice.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:08 +00:00
Charles Keepax 26fade40a0 mfd: wm8998: Fixup register defaults/readables
Remove defaults for a bunch of volatile registers and remove
ARIZONA_CTRL_IF_SPI_CFG_1 from the readable list since it doesn't exist
on wm8998 which is I2C only.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:07 +00:00
Charles Keepax 9111fa5c40 mfd: arizona: Add register bits to support the ANC block
Some Arizona devices have a hardware ANC block present. This patch adds
the registers necessary to configure this hardware block.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:06 +00:00
Charles Keepax 0a464dfdf8 mfd: arizona: Fix typo in arizona_irq_map
The type of the data for the main Arizona IRQ chip should be struct
arizona not struct regmap_irq_chip_data. The bug is harmless but should
probably be corrected anyway.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:05 +00:00
Javier Martinez Canillas 16dfd10375 mfd: wm831x: Fix possible NULL pointer dereference
The driver always checks for pdata being NULL except in one place.
Add a check to prevent a possible NULL pointer deference error.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:04 +00:00
Krzysztof Kozlowski d785334a0d mfd: s2mps11: Add manual shutdown method for Odroid XU3
On Odroid XU3 board (with S2MPS11 PMIC) the PWRHOLD bit in CTRL1
register must be manually set to 0 before initiating power off sequence.

One of usual power down methods for Exynos based devices looks like:
1. PWRHOLD pin of PMIC is connected to PSHOLD of Exynos SoC.
2. Exynos holds up this pin during system operation.
3. ACOKB pin of PMIC is pulled up to VBATT and optionally to pin in
   other device.
4. When PWRHOLD/PSHOLD goes low, the PMIC will turn off the power if
   ACOKB goes high.

On Odroid XU3 family the difference is in (3) - the ACOKB is grounded.
This means that PMIC must manually set PWRHOLD field to low and then
wait for signal from Application Processor (the usual change in
PWRHOLD/PSHOLD pin will actually cut off the power).

The patch adds respective binding allowing Odroid XU3 device to be
powered off.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Reported-by: Anand Moon <linux.amoon@gmail.com>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:04 +00:00
Andy Shevchenko 689d4453ed mfd: intel-lpss: Use writeq() helper
There are already helper functions to do 64-bit I/O on 32-bit machines, thus we
don't need to reinvent the wheel. In our case we can't use readq() / writeq()
even on 64-bit kernel since there is a hardware limitation (OCP bus is a 32-bit
bus).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:03 +00:00
Luis de Bethencourt 327cc18e76 mfd: sm501: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:02 +00:00
Luis de Bethencourt 01bd09f040 mfd: max8997: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:01 +00:00
Luis de Bethencourt 544507362d mfd: hi6421-pmic: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:49:00 +00:00
Luis de Bethencourt a0aef1f529 mfd: atmel-hlcdc: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:48:59 +00:00
Nariman Poushin c6d005ad79 mfd: Fixup clients of multi_reg_write/register_patch
Introduced by:
commit 8019ff6cfc ("regmap: Use reg_sequence for multi_reg_write / register_patch")

Interacting with:
commit 561629755a21 ("mfd: arizona: Add support for WM8998 and WM1814")
commit 81207880ce ("mfd: wm5110: Add register patch for rev E and above")

Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:48:58 +00:00
Linus Walleij f6d1034139 mfd: stmpe: PWM on 24xx has altfunc 1
On the STMPE2401 and STMPE2401 altfunction 1 corresponds to the
PWM channels. This oneliner was missing in the case-switch, making
it impossible to enable the PWM channel output.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:48:57 +00:00
Tony Lindgren 75c08f17ec mfd: twl6040: Fix deferred probe handling for clk32k
Commit 68bab8662f ("mfd: twl6040: Optional clk32k clock handling")
added clock handling for the 32k clock from palmas-clk. However, that
patch did not consider a typical situation where twl6040 is built-in,
and palmas-clk is a loadable module like we have in omap2plus_defconfig.

If palmas-clk is not loaded before twl6040 probes, we will get a
"clk32k is not handled" warning during booting. This means that any
drivers relying on this clock will mysteriously fail, including
omap5-uevm WLAN and audio.

Note that for WLAN, we probably should also eventually get
the clk32kgaudio for MMC3 directly as that's shared between
audio and WLAN SDIO at least for omap5-uevm. It seems the
WLAN chip cannot get it as otherwise MMC3 won't get properly
probed.

Fixes: 68bab8662f ("mfd: twl6040: Optional clk32k clock handling")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:48:56 +00:00
Vaibhav Hiremath 62a2e63347 mfd: 88pm80x: Add 88pm860 chip type support
Add chip identification support for 88PM860 device
to the pm80x_chip_mapping table.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-26 14:48:56 +00:00