rtc: alarm: Set power-on alarm 120 sec before actual alarm time

This will add extra buffer time for booting-up the device before
actual alarm expiration time.

Change-Id: I02cad84c394a6aab943fff37a1a0de56bb511f56
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
kernel: alarm: :fix the BUG that device automatically powers on

The value of alarm.time is invalid if we get it by:
    memset(&alarm, 0, sizeof(alarm)).
So function of rtc_set_alarm aborts before it really calls into:
    rtc->ops->set_alarm.
Then we can`t disable the RTC alarm by that. The result is some
alarms enabled by alarm_suspend are not disabled correctly during
alarm_resume. And device will automatically power on.

CRs-fixed: 524051
Change-Id: Ibc99e62878d17ad4f50325630bf0862207e2cf3f
Signed-off-by: Figo Wang <figow@codeaurora.org>
kernel: alarm: add dedicated alarm type for poweroff alarm

Now we use type of RTC_WAKEUP for the poweroff alarm.
Actually lots of other applications also use this type.
But these applications never expect the device will
power on after it has been shut down. So we need to
add dedicated alarm type for the Deskclock or similar
applications.

CRs-fixed: 529674
Change-Id: I9b7911906446daa1aeb5835478c9837f8ef797f2
Signed-off-by: Figo Wang <figow@codeaurora.org>
kernel: alarm: Do not call rtc_alarm_irq_enable in IRQ Disabled context

Currently shutdown hook of alarm driver is calling
the rtc_alarm_irq_enable API in interrupts disabled
context. So fix the alarm_shutdown function to call
in API rtc_alarm_irq_enable in interrupt enabled context.

CRs-Fixed: 591790
Change-Id: Iebd82482be1dc95c6c978b617e1c18eb36e1b6eb
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
arm: msm: add alarm reboot reason

Add alarm reboot reason for power off charging.

Change-Id: If94d0e4a7ec250cfaa61bf578cae9324db05d32c
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
msm: clock-a7: fix memory corruption due to out of boundary write

Out of bounds memory write is seen while reading the "qcom,speed-bin"
property from DTSI. Correct the memory allocation size to fix this
issue.

CRs-Fixed: 594553
Change-Id: Ica250132e9139b874102a7d6c388a76517dea6c3
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
msm: sps: Enable the clocks when BAMDMA available

The dfab and bamdma clocks are used only by bamdma.
Move the clocks api under bamdma option.

Update local device node data with platform device
node data from probe to avoid clock failures.

Change-Id: I97bd107eed400a989f0638c958f6361330bc6091
Signed-off-by: Dipen Parmar <dipenp@codeaurora.org>
ARM: dts: msm: Add L2 perf monitor interrupts to bypass list

Corrected L2 perf monitor interrupt name to APCC_qgicL2PerfMonIrptReq in the list.

The L2 perf monitor interrupts can only come when the CPU subsystem is active
and powered on. So, put it in the bypass list so that XO shutdown is not
blocked to allow processing this interrupt when the CPU subsystem is power
collapsed.

Change-Id: I1ae4dc9e800ac2d7188d45ef7634530d93049340
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Signed-off-by: Girish Ghongdemath <girishsg@codeaurora.org>
msm: Remove old unused sdio related code

Cleanup mach-msm by removing unused sdio related code.

Change-Id: I485deb7d6499771294b494f5542ba510c10255cb
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
ion: invalidate cache after zero'ing buffers even if uncached

Currently, we don't invalidate the cache if we're working with uncached
buffers. However, the memory for those mappings might actually be stale
in the cache since someone else might have touched it. Just invalidate
the cache for everyone, cached or uncached.

Without this change, corruption was observed on the display due to stale
data in graphics buffers from Ion.

CRs-Fixed: 585524
Change-Id: I0037beaadfde983af15d8f45918f7798264dd3ca
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
msm: mdss: Returning NOTIFY_SUSPEND while polling NOTIFY_UPDATE

mdss_fb_update_notify does not return Suspend in NOTIFY_UPDATE
case. Daemon polls on NOTIFY_UPDATE but does not get Suspend
notification. Hence Daemon would not stop polling.

Suspend Case is added in UPDATE case.

Change-Id: Iaeaf819a6849acda2eb7eb78f0fc3306866d1b64
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
msm: kgsl: Don't open kgsl device in erroneous case

If kgsl_get_process_private() returns NULL, it goes to
err_stop with result = -ENOMEM. If open_count is 0,
adreno_stop() overwrites the result variable with 0.
This leads to kgsl_open() to be successful while it
shouldn't.

Change-Id: Ic12d92a099280e4d958fa192fa5128211120d361
Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
msm: clock-krait-8974: Expose PVS table data through module parameters

For debugging purposes, it's sometimes useful to retrieve part
PVS and speed bin data at runtime. Export this data via a module
parameters for easy access. Having a static copy of this data also
makes its recovery from a ramdump convenient.

A 'qcom,pvs-config-ver' device-tree property is also introduced.
It will not be used by software, but can be queried to see the
which version of the voltage configuration data is present in
the build.

Change-Id: I233919d8c4970fe4e1263423ab9f08cabcc0986d
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/clock-krait-8974.c