Revert "arm: msm7x30: 1 higher pll2 clockstate to 1.7GHz+"

This reverts commit 438399d0c543a81af92ae7bd10bc22ba2e12865f.
Revert "USB forced fast charge v2 (adapted) [REVISIT]"

This reverts commit 009ba480760ddbf08c07650c82eadfc98a479b57.
ARM: msm: if CONFIG_FORCE_FAST_CHARGE=y then always force
Revert "video: msm: Add support for VSYNC notify via sysfs"

This reverts commit 016118c761420f061fd71595b00b8b0d2195d7a5.
msm_fb: display: Update mdp clocks based on perf patch

MDP clock was not getting updated to the correct values
causing underrun issues.

Change-Id: I4902ede1a8dda7408384261ca352e1ca1057a69c
Crs-Fixed: 395054, 395166
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: free base layer pipe at adb stop

Base layer pipe need to be freed at adb stop so that same
pipe can be allocated at adb start.

CRs-fixed: 390644
Change-Id: I948bb27687cfe1c96cc3b071b7bb9bb84b2c52c6
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm: kgsl: In kgsl release do not idle if device is in HUNG state

When recovery fails we are in HUNG state and clocks are turned off,
If a client closes kgsl device, driver release gets called and
we will try to idle the device which leads to accessing GPU registers
without clock being on. This leads to excessive kernel logging
"kgsl_pre_hwaccess hw access while clocks off from state HUNG"
and this eventually leads to watchdog.

Change-Id: Ib15c83fa06f6d32382b20c68a3ceb5081f1cfd69
CRs-fixed: 397149
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
tty: hold lock across tty buffer finding and buffer filling

tty_buffer_request_room is well protected, but while after it returns,
 it releases the port->lock. tty->buf.tail might be modified
by either irq handler or other threads. The patch adds more protection
by holding the lock across tty buffer finding and buffer filling.

Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Xiaobing Tu <xiaobing.tu@intel.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CRs-Fixed: 387308
Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
(cherry picked from commit 09236b0fbea5268bce3568d974654f8d9ddb83ec)

Change-Id: If383e12d6e65cfde1e2df2e65df8c3a4c30385ed
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
msm: kgsl: In kgsl release do not idle if device is in HUNG state

When recovery fails we are in HUNG state and clocks are turned off,
If a client closes kgsl device, driver release gets called and
we will try to idle the device which leads to accessing GPU registers
without clock being on. This leads to excessive kernel logging
"kgsl_pre_hwaccess hw access while clocks off from state HUNG"
and this eventually leads to watchdog.

Change-Id: Ib15c83fa06f6d32382b20c68a3ceb5081f1cfd69
CRs-fixed: 397149
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
Signed-off-by: Subrahmanyam Uppala <csuppal@codeaurora.org>
msm_fb: display: Send vsync events using sysfs for MDP4 targets (ADAPTED)

Replace sending of vsync timestamp using uevents with sysfs entry
as uevent result in increase in power numbers due to broadcast in
nature. Also, for smart panel, wait4vsync is removed.

(cherry picked from commit ca47ab601b9d36b2a96685a6e93042318ebbba8b)

Ported to htc msm7x30 (primou) base by @synergydev

Change-Id: I96577a3408fa0e2e1b54cf97434ddcf75bee589c
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Jessica Gonzalez <jgaona@codeaurora.org>
msm_fb: display: Send vsync events using sysfs for MDP3 targets (ADAPTED)

Replace sending of vsync timestamp using uevents with sysfs entry
as uevent result in increase in power numbers due to broadcast in
nature.

(cherry picked from commit 4ae2fcc7a3e2f1e68efe57ea0a42e7a4b83e87da)

Adapted for htc msm7x30 base (primou) by @synergydev

Change-Id: I89bebef35e04c1b5e1e5a56d26482c95f1928b68
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Jessica Gonzalez <jgaona@codeaurora.org>
video: msm: Fix build (bad resolution)
msm_fb: display: turn vsync irq off at suspend

Turn off vsycn irq at suspend to prevent vsync irq firing
before vsycn enabled ioctl called at resume.

Change-Id: I2428cdeb5cf7008e50f6d8dabfad52416db2fff7
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb : display : Block RGB downscale in MDP 4.0 and 4.1

Downscale is not allowed on RGB pipes in MDP 4.0 and 4.1. Hence,
fail the OVERLAY_SET ioctl for such configurations.

Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
(cherry picked from commit 3545573720822ce97ec37586f10fdf74a6d4f090)

Change-Id: I8445c18ac21cb7322eb9eb4c802623df5da07eb7
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
video: msm: Dynamically toggle histogram interrupt (adapted)

Make histogram enable/disable functions also enable/disable the histogram
"interrupt enabled" bit on the MDP enabled interrupts register.

CRs-Fixed: 398556
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Change-Id: I56f811e88cf3fd44ae0a2df8a6e5de32ba9a0c1c

Adapted to htc msm7x30 (priou) base by @synergydev
video: msm: Defer histogram reset to workqueue (Adapted)

Currently, when an underrun occurs, a reset request is sent to the
histogram hardware. This has been observed to cause a hang in the histogram
collection cycle. The fix for this hang is to instead rely on the existing
checks for histogram validity in the histgram read worker. When the
underrun occurs, the histogram is invalidated, which in turn causes the
histogram read worker to reset the histogram collection when it attempts to
read its contents.

Change-Id: I66d33ddedef76fdcb6c4a3d8095c0e8ca695e33d
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>

Adapted for htc msm7x30 (primou) base by @synergydev
video: msm: Ensure idle state before enabling histogram (Adapted)

Disable interrupt, set state flags to false, cancel histogram collection,
and clear the workqueue before attempting to enable the histogram. This
guarantees that this is the only configuration of the histogram running.

Change-Id: I222932db40494724b3efdb2e5bea08a849095c1e
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>

Adapted for htc msm7x30 (primou) base by @synergydev
msm: rotator: Add pseudo-planar 422 H1V2 dst format for MDP4

For interleaved 422 inputs, rotator outputs MDP_Y_CRCB_H1V2
format on 90 degree rotation. Add support as destination format
for MDP4.

CRs-Fixed: 371303
Change-Id: Ie0f98d40f58bf2cb9bc3298a94cae9c4e89b2f7a
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm_fb: display: Add pseudo-planar 422 H1V2 support in the MDP4

Rotator outputs pseudo-planar 422 H1V2 for interleaved inputs
on 90 degree rotation. Add changes to support MDP_Y_CRCB_H1V2
in MDP4.

CRs-Fixed: 371303
Change-Id: I8083bf44f9e2addf9e8732268147c1c3f6c0e2af
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm_fb: display: Program source address registers correctly

Scale filter FIR uses the adjacent pixels as part of the
processing. Source address registers should be program such that
they point to the first valid pixel so that non-ROI pixels are
ignored. This is done by making source x,y offsets to zero and
adding the computed offset to source address.

CRs-Fixed: 380020
Change-Id: I998fdd46f39dc67f32c422ec209da59d1add2e95
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>