Commit graph

362138 commits

Author SHA1 Message Date
Jingoo Han bf5ea28a98 mfd: lm3533: Use devm_gpio_request_one()
Use devm_gpio_request_one() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 17:25:23 +02:00
Jingoo Han 85529575b6 mfd: 88pm860x: Drop devm_kfree of devm_kzalloc'd data
devm_kfree() allocates memory that is released when a driver detaches.
Thus, there is no reason to explicitly call devm_kfree() in probe or remove
functions.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 17:25:18 +02:00
Lars-Peter Clausen c6cc25fda5 mfd: adp5520: Restore mode bits on resume
The adp5520 unfortunately also clears the BL_EN bit when the nSTNDBY bit is
cleared. So we need to make sure to restore it during resume if it was set
before suspend.

Cc: stable@vger.kernel.org
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 16:48:06 +02:00
Samuel Ortiz 7aa3d7c8d5 MFD portions of the ux500 multiplatform branch.
A second tag for the ARM SoC tree will build upon
 this one. This mainly removes the header file
 dependencies from the PRCMU driver in the MFD
 subsystem, and moves the PM functions to the
 machine.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
 iQIcBAABAgAGBQJRYrRUAAoJEEEQszewGV1zNvQP/RxVhoNg/H4uQUjDs7z//gEe
 iLrrVZVgWJcbBeREsv8o9jaECTceejui18zqmR0Vi5ygMX4ZG9EWCCwyG5dG6TKm
 jctfqBi9J/oSzZWijm0Xt3qiq+a1PURfVXGA2lsH+pK2ZeOXZGt2qlsUiGt+8VYH
 A/TNkwle56Ntig2pMcxRAhb9nzSU5hHE3S4FKRPP1HTE95f1xlF3VvBs/irheNuE
 b58tPAAL+Gb1Oq8hcURTvKsVO0D0W+3Ww8TwIiBUrl934q+65Flt9gXM9YbDH/88
 ptG0T8xG3j1HvxUuRuhgXfqygTYFVA+unpIny1l3/BoBvluKHiulyP4+nAvMIZKJ
 hz0YMMZl1rgMxfScLdbCpqz+vaYAARYReEnbdDOb3EvcTWvTXYcrfpuGJAbCwQ6I
 khkeJULp+j3k0CMVoSAf6CLmfaNC17s4gwD909qjF6bOQAZxecB2s/2xv+R1zRPG
 WI882oX/DDqIseczBB67gomEy+Bv4d40wHefD4g2SAsI4VWnssjtMtdeH43w417B
 KoktySHpdoUBa/HkUKrKCm9TVPVMTkA9XCbHBAWpW73pZZ1MTG3C9SdgExW8h15N
 nxdsuqqqTVe5Jr9OO38nFYlzuIBdOrWSnJUd9aEk03VghEqOuaBh0xI+rh12LZ1U
 AJmjm3vidOGXxl/SDSuQ
 =3zJl
 -----END PGP SIGNATURE-----

Merge tag 'ux500-multiplatform-mfd' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson

MFD portions of the ux500 multiplatform branch.
A second tag for the ARM SoC tree will build upon
this one. This mainly removes the header file
dependencies from the PRCMU driver in the MFD
subsystem, and moves the PM functions to the
machine.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 16:36:52 +02:00
Pali Rohár 8059c1c6be power: rx51_battery: Fix reporting correct values
Tell twl4030_madc_conversion that this driver needs raw values.
Driver twl4030_madc has some hardcoded values and conversation
functions which are incorrect for Nokia RX-51 board. This driver
rx51_battery expects raw values which convert itself.

This patch fixing values reported by power supply interface.
Before this patch driver reported always incorrect values on
3.8 kernel (sometimes design capacity was negative).

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Anton Vorontsov <anton@enomsg.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 16:36:27 +02:00
Pali Rohár a5055d5d68 mfd: twl4030-madc: Add support for raw value in twl4030_madc_conversion
Driver twl4030-madc has hardcoded channel types (10 - battery current,
1 - battery temperature) and also conversation data in variable
twl4030_divider_ratios. These hardcoded channels are incorrect for
Nokia RX-51 board (where is channel 0 - battery temperature).

For Nokia RX-51 there is rx51_battery power_supply driver which reporting
battery information via twl4030_madc_conversion. But this driver needs
raw values (not converted via some hardcoded functions). So this patch
adding new parameter "raw" to struct twl4030_madc_request which tell
twl4030-madc driver to not convert values, but rather return raw.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Anton Vorontsov <anton@enomsg.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 16:36:23 +02:00
Charles Keepax d955cba86d mfd: wm5102: Don't wait for boot when boot sequencer is disabled
As we are using a custom boot sequence we don't need to wait for the
standard boot sequence in device init when the normal write sequence is
disabled.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:21:03 +02:00
Charles Keepax c25feaa53c mfd: arizona: Wait for internal clocks to startup after reset
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:21:03 +02:00
Mark Brown 87d3af4ac0 mfd: arizona: Hold device in reset while ramping supplies
Acquire the /RESET GPIO before we enable regulators and hold the device
in reset while the regulators power up in order to improve robustness
during the initial power up.

Also fix the error path so that the device is left in reset while we're
at it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:21:02 +02:00
Charles Keepax 9bf7e0e83f mfd: wm5102: Update defaults to match patch
Registers which have defaults and are updated by the patch file should
have their defaults updated to match the value set by the patch file,
otherwise incorrect values will be read from the cache.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:21:02 +02:00
Charles Keepax 12bb68ed45 mfd: wm5102: Deactivate standard boot sequence
This patch deactivates the standard, currently noop, boot sequence
because we now have facilities in place for running a custom boot
sequence.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:21:02 +02:00
Charles Keepax e80436bbb2 mfd: arizona: Add a hardware patch mechanism
This patch adds facilities for apply a register patch contained within
the chip using the write sequencer.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:21:01 +02:00
Charles Keepax 9d53dfdc82 mfd: arizona: Factor out register polling
Factor out the polling of the interrupt status register whilst we wait
for boot done to allow the polling to be reused in other situations.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:21:01 +02:00
Charles Keepax 4c9bb8bc35 mfd: wm5102: Manually apply register patch
Future updates will require us to manually apply the register patch for
wm5102.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:21:00 +02:00
Mark Brown c6d6bfb186 mfd: wm5102: Only use the lowest three bits of device revision
Only the lowest three bits contain device revision for WM5102, the high
bits have been repurposed.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:21:00 +02:00
Mark Brown 767c6dc032 mfd: arizona: Unconditionally enable 32kHz clock
If we have a directly provided 32kHz clock unconditionally enable it,
substantial chip functionality relies on it so dynamic management is
not worthwhile.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:21:00 +02:00
Mark Brown 247fa1920d mfd: arizona: Fully support the use of MCLK1 as the 32kHz clock source
MCLK1 is not in the AoD power domain so if it is used as the 32kHz clock
source we need to hold a runtime PM reference to keep the device from going
into low power mode.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:20:59 +02:00
Mark Brown 7adafc5d97 mfd: wm5102: Update patch for latest evaluation
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:20:59 +02:00
Mark Brown 544c7aadd7 mfd: arizona: Support configuring MICBIASes into bypass mode
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:20:58 +02:00
Mark Brown 22c75fe7c7 mfd: arizona: Try to use interrupt flags from interrupt controller
If no irq_flags are passed in platform data then query the interrupt
controller for the trigger type and try to use that. This provides
default operation with a wider range of hardware and will be needed
for device tree support where the interrupt flags are configured on
the interrupt controller.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:20:58 +02:00
Mark Brown 3092f8050e mfd: arizona: Allow GPIO to be specified for IRQ line
If a GPIO is specified for the chip IRQ line then request it. This
improves support for systems that do not put pins into input mode when
used as interrupts.

Also use this GPIO when the primary IRQ is in edge triggered mode to
detect if we have handled pending interrupts in order to improve
robustness.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:20:58 +02:00
Mark Brown f8a0941f1b mfd: arizona: Basic support for edge triggered IRQs
Allow the user to configure edge triggered IRQs, though we do not yet
fully handle new interrupts occurring while an interrupt is being handled.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:20:57 +02:00
Mark Brown 7994c664bd mfd: arizona: Clarify error message for failed primary IRQ request
regmap has a very similar looking error, help identify where the error
comes from by changing the error message.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:20:57 +02:00
Mark Brown 4816bd1c6d mfd: arizona: Clean up on failed runtime resume
Make sure that we don't leave the device enabled needlessly.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:20:56 +02:00
Mark Brown 1816cb3409 mfd: arizona: Disable all wake sources by default
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 15:20:56 +02:00
Arnd Bergmann 55b175d7e6 ARM: ux500: split out prcmu initialization
This untangles the final bits of the prcmu code from the platform
code:

* The IRQ_PRCMU_* definitions move from irqs-db8500.h into prcmu.c
  because they are only of local significance.
* u8500_thsens_device goes into the prcmu, because it uses a PRCMU
  IRQ that the platform does not see.
* IRQ_DB8500_AB8500 and IRQ_PRCMU_BASE go into the platform data
  because the PRCMU does not see it.

Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixed a oneliner bug]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-04-08 13:58:15 +02:00
Linus Walleij 90c29f9802 mfd: db8500-prcmu: drop unused includes
These two <mach/*> includes are no longer used in the
PRCMU driver, so drop them.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-04-08 13:58:11 +02:00
Linus Walleij 1e22a8c614 ARM: ux500: move PM-related PRCMU functions to machine
We are trying to decompose and decentralize the code in
the DB8500 PRCMU out into subdrivers. The code moved in
this patch concerns a group of functions used for
decoupling and recoupling the IRQs from the GIC. During
sleep and idle the Ux500 system will transfer all IRQ
handling to the PRCMU using these functions.

Basically we are left with the two alternatives of code
placement as:

- arch/arm/mach-ux500/pm.c - this because the code is
  closely related to the GIC, and takes ownership of
  some of the registers from the PRCMU related to this
  PM functionality.

- drivers/mfd/db8500-prcmu-pm.c - because the code is
  affecting stuff in the PRCMU register range. But then
  this code needs to remap and handle GIC registers.

This patch implementation is taking the first approach.

Currently the cpuidle driver is the only piece of code
using this set of functions, but it will later also be
used by the suspend/resume code which is currently under
review.

The header file is moved to:
<linux/platform_data/arm-ux500-pm.h>
The function prototypes need to be placed in a globally
visible header since the CPUidle code is planned to move
out to drivers/cpuidle.

Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Acked-by: Rickard Andersson <rickard.andersson@stericsson.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-04-08 13:57:53 +02:00
Linus Walleij b047d98127 mfd: db8500-prcmu: get base address from resource
We cannot use a global variable stored in <mach/hardware.h> to
find the base address of the PRCMU. The real resource is already
there from the board, so use this to look up the base address
instead.

Currently the patch is kept minimal so as not to interfere with
other work being done on refactoring this driver, but at a later
point the defines using (prcmu_base + 0xnnn) need to be replaced
by pure offset defined for (0xnnn) and the base inlined with the
readl()/writel() and similar codepaths.

Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-04-08 13:57:38 +02:00
Linus Walleij 9a47a8dccf mfd: prcmu: pass a base and size with the early initcall
This patch will make an early remapping of the PRCMU, to be
used when setting up the clocks, that will call down into parts
of the PRCMU driver before it is probed.

Going forward this will be removed like this:

- The mailbox subsystem need to be merged.
  http://marc.info/?l=linux-kernel&m=136314559201983&w=2

- At this point the PRCMU clock code can be moved over to the
  ux500 clock driver in drivers/clk/ux500/* and maintained
  there in a decentralized manner.

- This early initcall and PRCMU base parameters become part of
  the ux500_clk_init() call instead.

Cc: Suman Anna <s-anna@ti.com>
Cc: Loic Pallardy <loic.pallardy@st.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-04-08 13:57:27 +02:00
Jingoo Han 222bc784dc mfd: wm8994: Silence bogus warning in wm8994_device_init()
'patch_regs' cannot be used uninitialized in wm8994_device_init(),
because 'patch_regs' was already guarded by 'regmap_patch'.
Thus, that's a bogus warning.

Without this patch, the build warning happens as below:

drivers/mfd/wm8994-core.c: In function 'wm8994_i2c_probe':
drivers/mfd/wm8994-core.c:595:7: warning: 'patch_regs' may be used uninitialized in this function [-Wuninitialized]
drivers/mfd/wm8994-core.c:408:14: note: 'patch_regs' was declared here

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 11:57:20 +02:00
Sachin Kamat d1ac2c092d mfd: max77686: Use NULL instead of 0
'data' is a pointer and hence use NULL instead of 0.
Silences the following warning:
drivers/mfd/max77686.c:49:50: warning: Using plain integer as NULL pointer

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 11:47:15 +02:00
Sachin Kamat 099bb952b0 mfd: adp5520: Use module_i2c_driver()
module_i2c_driver() removes some boilerplate and makes the code
simple.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 11:21:14 +02:00
Samuel Ortiz 8b5fd8516c Merge branch 'for-mfd-and-power' of git://git.linaro.org/people/ljones/linux-3.0-ux500
Conflicts:
	drivers/mfd/ab8500-gpadc.c

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08 11:20:34 +02:00
Jiri Slaby 9d66b568a2 MFD: rtsx_pcr: Fix probe fail path
When rtsx_pci_acquire_irq fails in rtsx_pci_probe, we forget to
disable an MSI (if we enabled it). This results in this warning on the
next attempt to load the module:
WARNING: at drivers/pci/msi.c:834 pci_enable_msi_block+0x2a4/0x2b0()
Hardware name: HP EliteBook 840 G1
Modules linked in: rtsx_pci(+) ...
Pid: 4056, comm: modprobe Tainted: G          I  3.8.0-9405-gd895cb1-1-vanilla #1
Call Trace:
 [<ffffffff81045c6a>] warn_slowpath_common+0x7a/0xc0
 [<ffffffff81045cc5>] warn_slowpath_null+0x15/0x20
 [<ffffffff81302544>] pci_enable_msi_block+0x2a4/0x2b0
 [<ffffffffa05e335a>] rtsx_pci_probe+0x55a/0x720 [rtsx_pci]
...

So properly disable MSI in that case.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 18:40:14 +02:00
Linus Walleij 58eb893da9 mfd: abx500: Move the AB8500 Kconfig fragment
Move the AB8500 Kconfig fragment below the AB3100 so the
menuconfig menu gets hierarchically nested and looks nice.
Having the EZX PCAP in the middle disturbs the nice
hierarchical layout from kconfig.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 18:10:30 +02:00
Jingoo Han 3de764d4aa mfd: davinci_voicecodec: use module_platform_driver_probe()
This patch uses module_platform_driver_probe() macro which makes
the code smaller and simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 18:08:45 +02:00
Jingoo Han e8fe6a8279 mfd: htc-pasic3: use module_platform_driver_probe()
This patch uses module_platform_driver_probe() macro which makes
the code smaller and simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 18:08:45 +02:00
Jingoo Han bbc48c6aaa mfd: ab3100-otp: use module_platform_driver_probe()
This patch uses module_platform_driver_probe() macro which makes
the code smaller and simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 18:08:31 +02:00
Gabriel Fernandez 408a3fa867 mfd: stmpe: DT: Add stmpe-i2c dt alias to get id device
This patch augments the STMP driver to read the device id
from the stmpe-i2c dt alias if present.

Cc: devicetree-discuss@lists.ozlabs.org
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 18:05:54 +02:00
Gabriel Fernandez a200e320f7 mfd: stmpe: DT: Enable no-irq mode configuration
If there is no interrupt property into stmpe node
then activate the no-irq mode by setting the irq
value to -1.

Cc: devicetree-discuss@lists.ozlabs.org
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 18:05:54 +02:00
Alexander Shiyan 5ab3a89a74 mfd: syscon: Add non-DT support
This patch allow using syscon driver from the platform data, i.e.
possibility using driver on systems without oftree support.
For search syscon device from the client drivers,
"syscon_regmap_lookup_by_pdevname" function was added.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 17:58:22 +02:00
Alexander Shiyan ed21465a09 mfd: syscon: Removed unneeded field "dev" from private driver structure
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 17:58:13 +02:00
J Keerthy 2154a2b347 mfd: palmas: Change the DT node property names to follow the convention
DT node properties should not have "_". Replacing them by "-".

Signed-off-by: J Keerthy <j-keerthy@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 17:53:42 +02:00
Guennadi Liakhovetski 64710af3e2 mfd: as3711: Add OF support
Add Flat Device Tree support to the AS3711 MFD driver. This patch just
allows to bind the driver to I2C devices, instantiated from the DT.
DT support for AS3711 cell drivers will be added in separate drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 11:20:14 +02:00
David Rientjes 5a324acfce mfd: cros_ec: Add MFD_CORE dependency
CONFIG_MFD_CROS_EC requires CONFIG_MFD_CORE for a couple of functions that
are declared but not defined:

	ERROR: "mfd_remove_devices" [drivers/mfd/cros_ec.ko] undefined!
	ERROR: "mfd_add_devices" [drivers/mfd/cros_ec.ko] undefined!

Fix it by selecting CONFIG_MFD_CORE anytime CONFIG_MFD_CROS_EC is enabled.

Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 11:20:14 +02:00
Samuel Ortiz 5c29e47e6a mfd: cros_ec_spi: Warnings fix
To silent those:

 CC [M]  drivers/mfd/cros_ec_spi.o
drivers/mfd/cros_ec_spi.c: In function ‘cros_ec_spi_receive_response’:
drivers/mfd/cros_ec_spi.c:123:5: warning: format ‘%d’ expects argument of type
‘int’, but argument 4 has type ‘long int’ [-Wformat]
drivers/mfd/cros_ec_spi.c:157:3: warning: format ‘%d’ expects argument of type
‘int’, but argument 6 has type ‘long int’ [-Wformat]
drivers/mfd/cros_ec_spi.c:181:2: warning: format ‘%d’ expects argument of type
‘int’, but argument 4 has type ‘long int’ [-Wformat]

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 11:20:13 +02:00
Samuel Ortiz 5ebeaff5c5 mfd: cros_ec: Export needed symbols for the i2c and spi modules
In order to fix those, when all cros code is modular:

ERROR: "cros_ec_prepare_tx" [drivers/mfd/cros_ec_spi.ko] undefined!
ERROR: "cros_ec_register" [drivers/mfd/cros_ec_spi.ko] undefined!
ERROR: "cros_ec_remove" [drivers/mfd/cros_ec_spi.ko] undefined!
ERROR: "cros_ec_suspend" [drivers/mfd/cros_ec_spi.ko] undefined!
ERROR: "cros_ec_resume" [drivers/mfd/cros_ec_spi.ko] undefined!
ERROR: "cros_ec_register" [drivers/mfd/cros_ec_i2c.ko] undefined!
ERROR: "cros_ec_remove" [drivers/mfd/cros_ec_i2c.ko] undefined!
ERROR: "cros_ec_suspend" [drivers/mfd/cros_ec_i2c.ko] undefined!
ERROR: "cros_ec_resume" [drivers/mfd/cros_ec_i2c.ko] undefined!

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 11:20:13 +02:00
Simon Glass 6af6dc2d2a input: Add ChromeOS EC keyboard driver
Use the key-matrix layer to interpret key scan information from the EC
and inject input based on the FDT-supplied key map. This driver registers
itself with the ChromeOS EC driver to perform communications.

The matrix-keypad FDT binding is used with a small addition to control
ghosting.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 11:20:13 +02:00
Simon Glass 4384041533 input: matrix-keymap: Add function to read the new DT binding
We now have a binding which adds two parameters to the matrix keypad DT
node. This is separate from the GPIO-driven matrix keypad binding, and
unfortunately incompatible, since that uses row-gpios/col-gpios for the
row and column counts.

So the easiest option here is to provide a function for non-GPIO drivers
to use to decode the binding.

Note: We could in fact create an entirely separate structure to hold
these two fields, but it does not seem worth it, yet. If we have more
parameters then we can add this, and then refactor each driver to hold
such a structure.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: Sourav Poddar <sourav.poddar@ti.com> (v2)
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 11:20:13 +02:00