arm/dt: msm8974: clean up pmic gpios 13/25

PMIC gpios 13/25 are used for camera and default function
setting was inverting the inputs for toggling the gpio.

Cleaned this up and the driver as well.

Change-Id: I66d8ddf0dcc6e9b69b773fb3f394b371f0912383
Signed-off-by: Elena Satraitis <w04888@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/613098
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Dave Schmidt <d.schmidt@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
drivers: ov10820: clean up pmic gpios 13/25

PMIC gpios 13/25 are used for camera and default function
setting was inverting the inputs for toggling the gpio.

Cleaned this up and the driver as well.
Signed-off-by: Elena Satraitis <w04888@motorola.com>

Change-Id: I547cfb5f68449c2608cf417a8616fc21a68dfdff
Reviewed-on: http://gerrit.pcs.mot.com/613099
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Dave Schmidt <d.schmidt@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
drivers: ov10820/ov660: Modify VDD_PK

Since we do not load firmware into the OV660, we do
not need to leave VDD_PK on all the time.

As well, since rear imager will now be 13mp, by turning
of VDD_PK, which is the core supply the rear and
front sensor, the voltage level can shift correctly
to support all sensors since 13mp needs 1.1 V.

Change-Id: I89c722165d74377ba6eabd62af88373d257e2d5c
Signed-off-by: Elena Satraitis <w04888@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/613807
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Dave Schmidt <d.schmidt@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
drivers: IMX135: Add Support for IMX135 on 8974

Add in IMX135 (13MP) support for 8974 platforms.

Change-Id: I02abe307a6a5d1567ce2935b726be9802cb47756
Signed-off-by: Elena Satraitis <w04888@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/613509
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Dave Schmidt <d.schmidt@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
arm/dt: 8974: Add IMX135

Add in detection of the IMX135 driver into the 8974
moto camera platforms. Also change the supply for
pm8941_l3 to operate in the range between 1.05 V and
1.225 Volts since this supply is shared between
10MP (OV10820) and 13MP (IMX135) camera and both
cameras need a different voltage to operate.

Change-Id: I52974b2e010d30847c28b5b6a033cb0c88c42e89
Signed-off-by: Elena Satraitis <w04888@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/613515
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
drivers: misc: stm401: Add registration for camera key

For quick capture, we have to mimic camera key press events.

Change-Id: Icbfbe3b552d230bda1c740918d9c2f969ad8ea9c
Signed-off-by: Jagatkumar Shah <w18764@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/614311
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>
arm/dts: msm8926: reserve 8K from 0x0 instead of 1M

The temporary workaround reserved 1M memory starting at physical
address 0x0 to avoid the kernel panic:
pagealloc: memory corruption at address c0000000.
Change the reservation from 1M to 8K.

Change-Id: I576bcdb855b21f3db163fc31c4f75c5f56e93280
Signed-off-by: Yuanyuan Zhong <zyy@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/614348
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
power: make sync on suspend optional

On embedded devices with built-in batteries, it is not so
important to sync the file systems before suspend.  The chance
of losing power during suspend are no greater than they are
when the system is awake.  The sync operations can greatly
increase suspend latency when the system has accrued many dirty
pages and/or the target storage devices are not particularly
fast.

This commit adds a kernel config option to allow file system
sync in the suspend and earlysuspend paths to be disabled.  It is
enabled by default.  It also exposes two command line options to
control this feature: suspendsync and earlysuspendsync.

Change-Id: I97ff1b9d0431c9b6aee4dbd00e40d559d3ee1ec8
Signed-off-by: Russ Knize <Russ.Knize@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/614512
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
defconfig: 8974: disable sync on suspend

Change-Id: I64c3da768e46fff65b164e40ced486e9672e7fe8
Signed-off-by: Russ Knize <Russ.Knize@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/614522
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
defconfig: 8226: disable sync on suspend

Change-Id: Ic89ae7220c0fe1c1ea730fd21860826b612e4f2c
Signed-off-by: Russ Knize <Russ.Knize@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/614521
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
defconfig: 8610: disable sync on suspend

Change-Id: Ia2bc341cf0ac0aa2056fd97e175ae9c957db3454
Signed-off-by: Russ Knize <Russ.Knize@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/614520
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
mmc: sdhci_msm: implement hardware reset

Implement a "hw_reset" handler for sdhci_msm that will
actually power-cycle the SD card.  This is required because
of the sdhci core's lack of awareness of the true voltage
regulators that power a card on MSM.

Change-Id: I73d02a1c7a1d46926ee3fd7d724b71ac34c39288
Signed-off-by: Russ Knize <Russ.Knize@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/613546
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
mmc: refactor card recovery improvements

This commit refactors the "reset and retry or give up" algorithm
from K3.0 to better align it with the existing "reset and retry"
functionality from upstream.  This approach makes use of the
existing framework instead of attempting to replace it.

The logic used to determine when to give up on a card
has been improved.  Instead of giving up after a set number of
failures, we now track the failure rate when trouble starts and
forgive cards that behave themselves for a period of time.  This
improves the user experience for extremely low-cost cards that
tend to misbehave in small spurts and then work perfectly fine
for hours or days.

Change-Id: I00976e4d4a3523dfff4a18d42b1f0826f1fda6e3
Signed-off-by: Russ Knize <Russ.Knize@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/613547
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
mmc: card health reporting

Previous card recovery improvments will hide ailing and problematic
cards from user space.  This commit exposes some information about
the health of the card via the block-level sysfs tree:

total_requests - number of MMC command requests processed
total_errors - number of requests that resulted in errors
current_health - the current health of the card (0-100%)

Change-Id: I09df55b0f0d0620a91b6a733b37c6f43ee4110ce
Signed-off-by: Russ Knize <Russ.Knize@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/613548
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
input: atmel_mxt_ts_mmi: allow touch buttons

Modify T15 and T100 objects to support touch buttons. Array of
supported buttons is passed to the driver via DTS.

Change-Id: I713b7c174c4d4001cfade332213796cddc15371f
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/614778
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
defconfig: 8226: Disable RCU Dyntick-idle

This option permits CPUs to enter dynticks-idle state even if they have
RCU callbacks queued, and prevents RCU from waking these CPUs up more than
roughly once every six jiffies, thus improving energy efficiency.
On the other hand, this option increases the duration of RCU grace periods,
for example, slowing down synchronize_rcu().

The issue we meet till now is that init may stuck at synchronize_rcu for
several seconds during power up, which impact the power up KPI alot.

Change-Id: If9cf08f889b49331d076fc2dfede9bd772b69a06
Signed-off-by: Hong-Mei Li <a21834@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/614574
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Zhi-Ming Yuan <a14194@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
input: validity fps: Removing DRDY polling code

Validity's older SDK's relied on a combination of polling
the DRDY line to catch interrupts as well as the actual
interrupt handler. This caused events where the service
could be signaled from more then one source in the event
the DRDY signal went high. As of 5.0.5.1 they have removed
the dependence on polling this line. This work is to remove
that code from the kernel driver.

Change-Id: I9467506663bfb89486def0cab2fc084ae747b2d4
Signed-off-by: Thomas Merrell <atm098@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/614602
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Louis Begin <begin@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
drivers: misc: stm: use msleep, not msleep_interruptible

Ensure that we actually sleep the expected amount of time.

Change-Id: Ic8040a9b547411b64d31789830a2fb8d99f508f0
Signed-off-by: Jonathan Kliegman <kliegs@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/613516
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Robert Wiegand <Robert.P.Wiegand@motorola.com>
Reviewed-by: Jagatkumar Shah <jagat@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Revert "Revert "(CR): arm/dts: msm8226: titan: Fix Titan dev tree index""

This reverts commit 1b54b7d1cf5c6cbef6ed9be6f9efd6a7e4887475.
As bootloader has fixed the problem and been released, we don't have to
revert kernel change.

Change-Id: I2abe76330a2a5d1f18bafd86b7282dfc5521d1b3
Signed-off-by: Shiyong Li <a22381@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/614817
Submit-Approved: Jira Key <jirakey@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Reviewed-by: Qing Chang <qing@motorola.com>
msm: mdss: Log bootloader display auto detect status at boot

The bootloader will save its autodetect status to a node in the chosen
device tree.  Log its value at boot time.

Change-Id: Ia84fff8ab031c6d37ced571c3642d65d1e4348eb
Signed-off-by: Zac Crosby <azc095@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/614331
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Shi-Yong Li <a22381@motorola.com>
Reviewed-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-by: Stephen Rossbach <rossbach@motorola.com>
Reviewed-by: Dong-Hua Yan <a18317@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>