video: msm: display: Bandwidth requirement for 3D display

Increase Bandwidth requirement for 3D display to avoid the
blank display

Change-Id: I09e56828b3bd1bbb33222fc76b5df7ff3103e708
CRs-fixed: 277304
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
msm_fb: display: Configure MDP clock depending on dsi_pclk rate.

In MDP 4.1, the MDP core clock should be greater than
1.5 times the dsi_pclk frequency. Add code to set the
minimum frequency for MDP core clock depending the
MIPI dsi pixel clock frequency.

For LCDC panel, add code to set the minimum frequency
for MDP core clock to be atleast 1.15 times the pixel
clock.

CRs-Fixed: 279386
(cherry picked from commit 9e0698f6708ed4da35b2da7281fb7a5044ba0801)

Change-Id: Ied8c4c93eb210dc9c0ba3a5c77297cf123eb0a65
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
msm: acpuclock: Remove unused variable for 8x60 and 8x50a

(cherry picked from commit 010e23de8b64a873a6a902a112241f452a29be5a)

Change-Id: I1c2ca049906539a01de9844d80fc72ea70f00c24
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: acpuclock-8x60: Protect L2 programming with a spinlock

It's possible for acpuclk_set_rate() to be executing concurrently
on both cores, where at least one core is executing it with
reason = SETRATE_PC.  In this case, the CPU executing with
SETRATE_PC will not acquire a mutex, since it may be executing
in an atomic context.

For SETRATE_PC, voltage and bus bandwidth setting are not
updated, so no locking is needed to protect them, but the L2
rate is updated and needs protection.  Fix this by adding a
spinlock.

(cherry picked from commit 845b57066b6066f664aed89ed1efa1f1c42d323d)

Change-Id: Iccbe5cb88504036ff7eb98f4766e1b96cb50a6be
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: acpuclock-8x60: Use for_each_present_cpu for L2 voting

In the hotplug insertion path, acpuclk_set_rate() gets called
before the CPU has been brought online to the scheduler. As a
result calls to for_each_online_cpu() in this path will not
include the CPU that's being brought online

compute_l2_speed() returns an incorrect value because of this.
Replacing the use of for_each_online_cpu() in that function
with with for_each_present_cpu() resolves this.

(cherry picked from commit 7482ee72c51a569321132bff30fa032336db86b0)

Change-Id: I1ee872cc79eaa8d8cd9f70a80f6aafabea80356e
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: acpuclock-8x60: Increase boot-up frequency to max supported

The voltage regulator driver now allows the CPU core voltages
to be set at the point in arch_init when the acpuclock driver
initializes.  Therefore, it's now possible to increase the CPU
clock rates at boot to rates that require voltages above what
the bootloaders have set.

(cherry picked from commit ae5be6b10bbef1fdf86537e5a0c5362d2f561f84)

Change-Id: Ica63967c420cf3c0fe8ff8078f7b6a0adbe5cd79
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: acpuclock-8x60: Use hotplug notifications for CPU, L2, bus, voltage

Voltage and bandwidth requests from a CPU should be dropped when that
CPU is unplugged.  Subscribe to hotplug notifications to accomplish
this, replacing the calls to acpuclock from pm-8x60 in the hotplug path.

Now, a hotplug-removed CPU's clock, PLL, L2 vote, bus bandwidth vote,
and voltage votes are not removed until after the CPU has been shut
down. These settings are all restored to their previous values just
prior to bringing the CPU back online.

CRs-Fixed: 280501
(cherry picked from commit f2e8137194a25e21807d4af782e079400ac8a6a3)

Change-Id: I13a1bb75ed95f5f4ebda35448fb6c22231e64f80
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: kgsl: Avoid calling wakeup from isr and put irq off in NAP

Switch irq off in NAP and set the device to active state
before turning on irq.

CRs-Fixed: 281996

Change-Id: I1fb7ecec9aac717c5cc54cdd7061841ed346cc38
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
msm_fb: Disabling DTV timing Generator after hdmi off.

DTV timing Generator should be enable for updating Audio
Packet Control(0x0020) and Audio Configuration(0x01D0) register
in HDMI core. Need to checks Bit[0] of both registers before
doing the HDMI Audio Shutdown.

CRs-fixed: 274278,274284
(cherry picked from commit 58979b79f5ca8211aac7faad413934ee8f09bf8e)

Change-Id: I7376bda85a4e6fa8f7b6bf2601d813babcf65146
Signed-off-by: Abhishek Kharbanda  <akharban@codeaurora.org>
msm: kgsl: Do not call fput when holding a spinlock

When calling fput ensure that we are not holding a spinlock.

Change-Id: If4a929f60d3f659178653e110a27b1c713b4309f
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
msm: kgsl: Reduce the wait for gpu ready time to 10 ms.

(cherry picked from commit cae8a48db98c0d1f34bf8aac1d94105217107a67)

Change-Id: Iffe4e90fef74a17ca487e7b0035d3e45f211ee6d
Signed-off-by: Wei Zou <wzou@codeaurora.org>
thermal: pmic8058-tm: Use non-interruptible sleep

If the current thread is signaled, wait_for_completion_interruptible()
could return -ERESTARTSYS resulting in the pm8058_tz_get_temp function
returning without reading the adc result.

Because the completion structure is stored on the stack, when the
adc thread eventually completes, it will write into the no longer
valid completion structure.

Replace wait_for_completion_interruptible() calls with
wait_for_completion() calls to avoid this problem.

(cherry picked from commit a211eccc1ce67ec0a69a188efa942d0ac579fa84)

Change-Id: I7ca4c8cdc4ab0c7de8dc5e24579eaf220c9ccebf
Signed-off-by: David Collins <collinsd@codeaurora.org>
msm: Ensure unique handles for remote storage clients

The find_first_zero_bit function was passed a size of 4,
limiting the number of handles that can be issued. The
number has been increased to span 32 bits.

CRs-Fixed: 281678
(cherry picked from commit 6cd71462245db7da9e8467dcbc8f25d3779d5276)

Change-Id: I40756740c04d7943c7bd63f18bc6383ae29947a1
Signed-off-by: Oluwafemi Adeyemi <aadeyemi@codeaurora.org>
mmc: Add helper function to check if a card is removable

There are two checks that need to be made when determining whether a
card is removable. A host controller may set MMC_CAP_NONREMOVABLE if the
controller does not support removing cards (e.g. eMMC), in which case
the card is physically non-removable. Also the 'mmc_assume_removable'
module parameter can be configured at module load time, in which case
the card may be logically non-removable.

A helper function keeps the logic in one place so that code always
checks both conditions.

Because this new function is likely to be called from modules we now
need to export the mmc_assume_removable symbol.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
CRs-fixed: 280184
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
(cherry picked from commit f55d00de5699129c56e5f91c3a83d649a3982817)

Change-Id: I1d20f87fa4a8d28ab05f699998b97ac4574d4b24
Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
mmc: skip detection of nonremovable cards on rescan

mmc_rescan() checks whether registered cards are still present before
skipping them, by calling the bus-specific ->detect() handler.

With buses that support runtime PM, the card may be powered off at
this point, so they need to be powered on and fully reinitialized before
->detect() executes.

This whole process is redundant with nonremovable cards; in those cases,
we can safely skip calling ->detect() and implicitly assume its success.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Reviewed-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
CRs-fixed: 280184
[stummala@codeaurora.org: Resolved merge conflicts]
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
(cherry picked from commit 20a7a1c2e376bc514f53c1bf0cfe05d421cbdded)

Change-Id: I7f51e16474ef87cf30d2fb0ed834af0b0146785f
Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
mmc: fix CONFIG_MMC_UNSAFE_RESUME regression

30201e7f3 ("mmc: skip detection of nonremovable cards on rescan")
allowed skipping detection of nonremovable cards on mmc_rescan().
The intention was to only skip detection of hardwired cards that
cannot be removed, so make sure this is indeed the case by directly
checking for (lack of) MMC_CAP_NONREMOVABLE, instead of using
mmc_card_is_removable(), which is overloaded with
CONFIG_MMC_UNSAFE_RESUME semantics.

The user-visible symptom of the bug this patch fixes is that no
"mmc: card XXXX removed" message appears in dmesg when a card is
removed and CONFIG_MMC_UNSAFE_RESUME=y.

Reported-and-tested-by: Dmitry Shmidt <dimitrysh@google.com>
Reported-and-tested-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
CRs-fixed: 280184
[stummala@codeaurora.org: Resolved merge conflicts]
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
(cherry picked from commit 3c9922776632a21a357ed8707eb4404f67ae4eb2)

Change-Id: Ie53c76faf7b818c59a970a4140c482d942a38074
Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
mmc: sdio: Fix sdio_disable_wide to properly handle 8 bit bus width.

Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
(cherry picked from commit 2b134537d25acde33bfdae18814229777de3de8c)

Change-Id: I547e5ede74dd7ee6e5c492132cbcce4510dfde66
Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
msm: sdio: Allow backward compatibility for old modem builds

The sdioc version should be different for different platforms
to allow changes that are HW dependent.
Also, for 7x30 sdio_al should support older version numbers.

(cherry picked from commit 26406051841d2766dbc230a95424e1bff4cf9443)

Conflicts:

	arch/arm/mach-msm/sdio_al.c

Change-Id: Ie15102dcb699fd624d6c5c96235983253c3c4b89
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Jessica Gonzalez <jgaona@codeaurora.org>
Merge "mmc: sdio: Fix sdio_disable_wide to properly handle 8 bit bus width." into gingerbread_rel
Merge "video: msm: display: Bandwidth requirement for 3D display" into gingerbread_rel