msm: compile v4l2 files for 8x60.

Change-Id: I9484318bdca498186ebcccb34be222c42f7a947b
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
(cherry picked from commit 872130ed749c3109d15d32b31c7b11b85c97cb31)

Signed-off-by: Roja Rani Yarubandi <rojay@codeaurora.org>
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
msm: Use immediate operations instead of PC-relative loads

Use immediate operations for creating constants in
__enable_mmu to avoid a situation where the constant area
may not have been fully mapped by the initial identity
mapping.

CRs-Fixed: 375963
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
(cherry picked from commit c00dfe2cd0edb8d891261e7c3f24a50ccd233d17)

Change-Id: Ia607d5580f5ad9b26aff40ad4ff6f3a8f821283c
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm: idle-v7: Write Krait-specific bits before WFI

Certain variants of the Krait processor require a
modification of an implementation-defined register prior to
executing the WFI instruction.

Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
(cherry picked from commit ae920e776de8271232a524031f07e9fd605b5b30)

Change-Id: Id9b26685db9a9a8a59fd1ca425c3dd57970a97ff
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
arm: Make the WFE macro unconditional

Remove the condition argument from the WFE macro in the
spinlock code so it can support a WFE fixup needed on
certain Krait CPUs.

Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
(cherry picked from commit 470d134db676e23982676061971a3a201f32b4a6)

Change-Id: Ic5f072ed40d3802b4d0d7f3339d2f5688cebc828
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
arm: Convert spinlocks to new inline assembly style

Refactor the inline assembly code in spinlock.h in
preparation for supporting the Krait safe WFE sequence.

Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
(cherry picked from commit 68e1d7476e66911f9722a5dd82554e883cdb35ba)

Change-Id: I9f98c3a01fa1f0565723e7ba8e5a842a8f05e6b9
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
arm: Support the safe WFE sequence for Krait CPUs

Certain version of the Krait processor require a specific
code sequence to be executed prior to executing a WFE
instruction to permit that instruction to place the
processor into a low-power state.

Change-Id: I614f8ce24936c793c91d5c43c7a7931a04f11dda
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
cpufreq: Fix sysfs deadlock with concurrent hotplug/frequency switch

Running one program that continuously hotplugs and replugs a cpu
concurrently with another program that continuously writes to the
scaling_set_speed node eventually deadlocks with:

=============================================
[ INFO: possible recursive locking detected ]
3.4.0 #37 Tainted: G        W
---------------------------------------------
filemonkey/122 is trying to acquire lock:
 (s_active#13){++++.+}, at: [<c01a3d28>] sysfs_remove_dir+0x9c/0xb4

but task is already holding lock:
 (s_active#13){++++.+}, at: [<c01a22f0>] sysfs_write_file+0xe8/0x140

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(s_active#13);
  lock(s_active#13);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

2 locks held by filemonkey/122:
 #0:  (&buffer->mutex){+.+.+.}, at: [<c01a2230>] sysfs_write_file+0x28/0x140
 #1:  (s_active#13){++++.+}, at: [<c01a22f0>] sysfs_write_file+0xe8/0x140

stack backtrace:
[<c0014fcc>] (unwind_backtrace+0x0/0x120) from [<c00ca600>] (validate_chain+0x6f8/0x1054)
[<c00ca600>] (validate_chain+0x6f8/0x1054) from [<c00cb778>] (__lock_acquire+0x81c/0x8d8)
[<c00cb778>] (__lock_acquire+0x81c/0x8d8) from [<c00cb9c0>] (lock_acquire+0x18c/0x1e8)
[<c00cb9c0>] (lock_acquire+0x18c/0x1e8) from [<c01a3ba8>] (sysfs_addrm_finish+0xd0/0x180)
[<c01a3ba8>] (sysfs_addrm_finish+0xd0/0x180) from [<c01a3d28>] (sysfs_remove_dir+0x9c/0xb4)
[<c01a3d28>] (sysfs_remove_dir+0x9c/0xb4) from [<c02d0e5c>] (kobject_del+0x10/0x38)
[<c02d0e5c>] (kobject_del+0x10/0x38) from [<c02d0f74>] (kobject_release+0xf0/0x194)
[<c02d0f74>] (kobject_release+0xf0/0x194) from [<c0565a98>] (cpufreq_cpu_put+0xc/0x24)
[<c0565a98>] (cpufreq_cpu_put+0xc/0x24) from [<c05683f0>] (store+0x6c/0x74)
[<c05683f0>] (store+0x6c/0x74) from [<c01a2314>] (sysfs_write_file+0x10c/0x140)
[<c01a2314>] (sysfs_write_file+0x10c/0x140) from [<c014af44>] (vfs_write+0xb0/0x128)
[<c014af44>] (vfs_write+0xb0/0x128) from [<c014b06c>] (sys_write+0x3c/0x68)
[<c014b06c>] (sys_write+0x3c/0x68) from [<c000e0e0>] (ret_fast_syscall+0x0/0x3c)

This is because store() in cpufreq.c indirectly grabs a kobject
with kobject_get() and is the last one to call kobject_put()
indirectly via cpufreq_cpu_put().

Fix this deadlock by introducing two new functions,
cpufreq_cpu_get_sysfs() and cpufreq_cpu_put_sysfs() which do the
same thing as cpufreq_cpu_{get,put}() but don't grab the kobject.

CRs-fixed: 366560

Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
(cherry picked from commit ddda0cf21dc6cb487aacd81fdb1a7343d2746d94)

Change-Id: I6ac89789e89099cff315d7a02de216423376b7f7
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm: bam_dmux: Add locking around platform device calls

The channel state is used to determine if a platform device has been
registered on a particular channel.  In the case of a subsystem restart
while a channel is being opened, the subsystem restart can occur between
the channel state being set to opened and the platform device being
added.  This will result in the subsystem restart code seeing that the
channel is open and attempting to remove a platform device that has been
added.

This change adds mutex protection around the channel state updates and
the platform device add/remove calls to handle any race conditions.

CRs-Fixed: 378060
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
(cherry picked from commit a623da8bda62e95acf5991905af2847e8e326e09)

Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
(cherry picked from commit 18111f0391832697ed0aaa1212169319328e6a0e)

Change-Id: Id113a056c7955956215a4e8d10355b16e358d9df
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm: display: Set max MDP bandwidths for larger primary resolutions

To avoid underruns for larger primary display resolutions,
set max MDP clock/bandwidths for dynamic boot parameter
cases with HDMI as primary and WUXGA panels

Change-Id: I1e020de0cbd4082edd26d4b03ebee4d4b976c26a
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: fix iommu leaking

Fixed iommu map buffer dropped after overlay unset by saving
origianl iommu list before zero out overlay pipe structure.

Change-Id: I498dd4cf62e93f4571883fe20a0298e9fad4ccab
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: free dtv iommu buffer

Free iommu buffer after pipe is committed to hardware.

Change-Id: I00506d6fd55d99fec7921c02953fd755a7536d3e
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
 msm_fb: display: clear correct pending isr

Clear correct pending isr during irq enable/disable
to avoid un expected side effects

Change-Id: I5e7afc778cb8d5feda40f359ff2aae6493dc7cd2
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: fix fake iommu buffer drop

During pipe free, some content of pipe is backed up and then after
pipe is zeroed out, the content get restored, in between there should
be no actions to change the content since any change will be wiped out
by the restore.

Change-Id: Ia6da0162d1f9b614682e1fc36edab1db003b42ab
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: camera: Add retry logic if stream ops fails.

During monkey/stability runs the open/close sequence is going out of
sync. This patch ensures that the sequence is maintained and also add
retry mechanism in case stream ops fails.

Signed-off-by: Azam Sadiq Pasha Kapatrala Syed <akapatra@codeaurora.org>
(cherry picked from commit 2ddecacee48508b4a89d568c01c9e5ddbdd29999)

Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
(cherry picked from commit 3351b3811abdd9e2158223bda15aac2d01091cd6)

Change-Id: I0f214b4e38ad53dffde5b211b3f54ed7f6e0d914
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm: camera: Not allocate memory for the buffer done event.

Unnecessary code cleaned.

Signed-off-by: Mingcheng Zhu <mingchen@codeaurora.org>
(cherry picked from commit a236290fa341c3bd10ffd7295e65eceb600f5b6c)

Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
(cherry picked from commit 269fd3713401028c4db9e21ddf615a59a92c1f31)

Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
(cherry picked from commit 07d49ca235577e2c35f3f52c620eb07a9a209405)

Change-Id: Iac57aec7aaf92d241c90dc4f5407f224991b3bf5
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>

Conflicts:

	drivers/media/video/msm/msm_vfe32.c
msm_fb: display: add stage commit before kickoff to WFD

Since stage commit had been splited out of stage up fucnction,
it needed to be called to stage pipes into mixer befroe
kickoff mixer. Add this function into overlay writeback for WFD.

Change-Id: I11e4486d92b89a15e58531033d474b3137b5935a
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
msm_fb: display: upgrade MDP blt mechanism

Upgrade  mdp blt mechanism so that future patches can be
applied without confliction.

Change-Id: I7fef96e2f9e2ad12fa8918f40caf1c6a44f8bf37
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_video.c
msm_fb: display: vsync support for HDMI as primary

When HDMI is primary, dtv is associated with node 0. In this case,
DTV vsync and ctrl need to be called for node 0.

CRs-Fixed: 383877
Change-Id: I425cddf453dd159259883e71f92c32918ca8e6c7
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>