Input: atmel_mxt_ts - Verify Information Block checksum on probe

By reading the information block and the object table into a contiguous region
of memory, we can verify the checksum at probe time. This means we verify that
we are indeed talking to a chip that supports object protocol correctly. We
also detect I2C comms problems much earlier, resulting in easier diagnosis.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Benson Leung <bleung@chromium.org>
(cherry picked from commit e1e2da0772ebfbc39e4f3d5138fd87ec5fff9455)
Input: atmel_mxt_ts - Use T18 RETRIGEN to handle IRQF_TRIGGER_LOW

The workaround of reading all messages until an invalid is received is a way
of forcing the CHG line high, which means that when using edge-triggered
interrupts the interrupt can be acquired.

With level-triggered interrupts this is unnecessary.

Also, most recent maXTouch chips have a feature called RETRIGEN which, when
enabled, reasserts the interrupt line every cycle if there are messages
waiting. This also makes the workaround unnecessary.

Note: the RETRIGEN feature is only in some firmware versions/chips, it's not
valid simply to enable the bit.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Benson Leung <bleung@chromium.org>
Acked-by: Yufeng Shen <miletus@chromium.org>
(cherry picked from commit dca27c2562bca4c75ea60f2f5ceab7e153943a78)
Input: atmel_mxt_ts - Handle reports from T47 Stylus object

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Benson Leung <bleung@chromium.org>
Acked-by: Yufeng Shen <miletus@chromium.org>
(cherry picked from commit 716d202fe6383210859fbecf6e329dbfc8fa608b)
Input: atmel_mxt_ts - Release touch state during suspend

If fingers are down as the MXT chip goes into suspend it does not send a lift
message. In addition, it may not complete its final measurement cycle
immediately, which means touch messages may be received by the interrupt
handler after mxt_stop() has completed.

So:
- disable irq during suspend
- flush any messages created after suspend
- tell app layer that slots were released at suspend

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Benson Leung <bleung@chromium.org>
Acked-by: Yufeng Shen <miletus@chromium.org>
(cherry picked from commit a20a6220011a5b1f4bafa5e76179224a60772b36)
Input: atmel_mxt_ts - Initialize power config before and after downloading cfg

If the power configuration is zero then the configuration download may fail to
work properly, so initialize T7 before config download. The downloaded
configuration may reset the T7 power configuration so it must be
re-initialized afterwards.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Benson Leung <bleung@chromium.org>
Acked-by: Yufeng Shen <miletus@chromium.org>
(cherry picked from commit 3cf72bc61d8e21339a42e11bc11305049cffbeeb)
Input: atmel_mxt_ts - Add regulator control support

Allow the driver to optionally manage enabling/disable power to the touch
controller itself. If the regulators are not present then use the deep sleep
power mode instead.

For a correct power on sequence, it is required that we have control over the
RESET line.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Benson Leung <bleung@chromium.org>
Acked-by: Yufeng Shen <miletus@chromium.org>
(cherry picked from commit a84e191eb48008e85d877e82ef3b55192c101893)
Input: atmel_mxt_ts - Implement support for T100 touch object

The T100 object replaces the old T9 multitouch touchscreen object in new
chips.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Yufeng Shen <miletus@chromium.org>
(cherry picked from commit 4201c613debf1f3cf72678b24a2fe992a6a94119)
Input: atmel_mxt_ts - Allow specification of firmware file name

On platforms which have multiple device instances using this driver, the
firmware may be different on each device. This patch makes the user give the
name of the firmware file when flashing.

This also prevents accidental triggering of the firmware load process.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Benson Leung <bleung@chromium.org>
Acked-by: Yufeng Shen <miletus@chromium.org>
(cherry picked from commit 8cc2d071dd694a84577afeb7fdb6c8658da27590)
Input: atmel_mxt_ts - Handle cfg filename via pdata/sysfs

There may be multiple maXTouch chips on a single device which will require
different configuration files. Add a platform data value for the configuration
filename.

Add sysfs entry to write configuration file if the platform data is not set.

Split out the object initialisation code from mxt_initialize() into
mxt_configure_objects() to allow this.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Yufeng Shen <miletus@chromium.org>
(cherry picked from commit 979b4add169c5d6526ec0a092ad6dd6cd072f03e)
Input: atmel_mxt_ts - Only use first T9 instance

The driver only registers one input device, which uses the screen parameters
from the first T9 instance. The first T63 instance also uses those parameters.

It is incorrect to send input reports from the second instances of these
objects if they are enabled: the input scaling will be wrong and the positions
will be mashed together.

This also causes problems on Android if the number of slots exceeds 32.

In the future, this could be handled by looking for enabled touch object
instances and creating an input device for each one.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Acked-by: Benson Leung <bleung@chromium.org>
Acked-by: Yufeng Shen <miletus@chromium.org>
(cherry picked from commit 86eb1e7ed1b3d368c0e969a13588897268d035ff)

Change-Id: I1f3eebe54aec4abd0712f38f3b2683952c835bf9
arm/dt: 8974: switch green and red leds

HW has switched red and green on purpose to use green
as SOL in dead battery recovery state.
Also change names of leds to be compatible with HAL
and test commands.

Change-Id: Ie9f5d036c19accde8baf982a46be375136ffe8f9
Signed-off-by: Dmitry Ornatsky <cdo021c@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/564661
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Tested-by: Jason Hrycay <jason.hrycay@motorola.com>
Reviewed-by: Dmitry Ornatsky <ornatsky@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
ASoC: msm: Add loopback dai for external DSP

- code from WolfsonMicro that adds basic framework to enable
comm between C55-WM5110 I2S

Change-Id: Ie165e167aaf6a45a3355958f72e36a93dc069b26
Signed-off-by: Pratik Kamdar <djc637@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/564472
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Vladimir Karpovich <vkarpovich@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
ASoC: msm: Add DAPM widgets for I/P-O/P for ext DSP

- Code from WolfsonMicro to enable communication between
C55-WM5110 I2S

Change-Id: Ia798e6ffd0e5070f7ccf4202fdfc099348f94446
Signed-off-by: Pratik Kamdar <djc637@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/564474
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Vladimir Karpovich <vkarpovich@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
ASoC: wm5110: Hook up ADSP2 cores

Change-Id: I5d91bab104f2789a72918e88ac4a7246cbfa4b50
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-on: http://gerrit.pcs.mot.com/564896
Submit-Approved: Jira Key <jirakey@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
mfd: wm5110: Add register patch for Rev D

Change-Id: Id10a9dc660112ee3f2e8524f05517d64c1549fff
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Reviewed-on: http://gerrit.pcs.mot.com/564897
Submit-Approved: Jira Key <jirakey@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
ASoC: wm5110: Expand ADSP memory for wm5110 rev D

Change-Id: I2002f3cece62e78e0985b6ae6bd96ef0e5bb340f
Signed-off-by: D.J. Barrow <dbarrow@wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Reviewed-on: http://gerrit.pcs.mot.com/564898
Submit-Approved: Jira Key <jirakey@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
mfd: wm5110: Ensure known register state exiting sleep mode

Change-Id: I9f37592ce7ba3e498dc5c8255e03fcb55acd8639
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Reviewed-on: http://gerrit.pcs.mot.com/564899
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
ASoC: wm5110-tables: Remove control and clocking from volatile

Change-Id: Ie29879499097f864e7090a14e011ce3fcd7be79e
Signed-off-by: Vladimir Karpovich <cvk011c@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/564900
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
drivers: misc: stm401: Driver updates

Copy the flashing functions from the MSP430 driver
into the STM401 driver. Names have been changed as
appropriate.

Change-Id: Iecbff451b7e91fb46aad56f22e90750e52de0190
Signed-off-by: Robert Wiegand <qa2113@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/564158
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Jagatkumar Shah <jagat@motorola.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
defconfig: 8974: Enable the STM401 kernel module

Include the STM401 kernel driver in the kernel.

Change-Id: Ibf81ee5fc4c00e8cb28f55e3bd4eaf981d7a2d3b
Signed-off-by: Robert Wiegand <qa2113@motorola.com>