monarudo-display: actually turn the display off!

The following commit removed the code that called the display_off
panel function:

commit e984076cc333f280270d4eb930d06354b4cb49cb
Author: Chad Froebel <chad0989@rochester.rr.com>
Date:   Sun Jun 2 09:44:29 2013 -0400

    Bulk update video to JB 2.5.1

    Change-Id: I268f5e2fa933a7738bd3262b34b3de33caecc87b

Merge it with lcd_off because don't really need a separate
display_off.

Conflicts:
	arch/arm/mach-msm/board-monarudo-display.c
Merge pull request #15 from crpalmer/cm-10.1-chad-display-off

monarudo-display: actually turn the display off!
staging: restore HTC's ram_buffer to fix /proc/last_kmsg

In commit:

commit 203e830df7e962890ab9fcc26e84307abe466e35
Author: Chad Froebel <chad0989@rochester.rr.com>
Date:   Sun May 26 09:14:30 2013 -0400

    Update staging from mako

it changed from using ram_buffer_htc.c to usng ram_buffer.c.
This broke the last_kmsg support.
light-sensor: fix calibration table overflow (16 bit math)

The calibration table was incorrect in the second to last entry
because the math overflows the 16-bit numeric range.  Detect
the overflow and make a guess at a reasonable value.
Version 2.0.33-cm1
Merge pull request #16 from crpalmer/cm-10.1-chad-last_kmsg

staging: restore HTC's ram_buffer to fix /proc/last_kmsg
msm_serial_hs: Fix synchronization between ADM and UART Cores

With current UART Core programming sequence, it is seen that ADM
and UART Core are going out of sync in few usecases with regression.
It is fixed by using Force RxStale feature of UART Core from
set_termios() and sending discard flush to ADM which would terminate
currently queued UART RX CMD to ADM. Add termios_in_progress check
to make decision about what kind flush to send on receiving RxStale
interrupt. It makes set_termios() more reboust and also keeps ADM
and UART Core in-sync.

Add dma_in_flight to keep check of UART Rx CMD status and BUG_ON if
UART driver is trying to queue one more UART RX CMD to ADM as UART
driver re-uses same UART RX CMD.

This change also adds check of currently set uartclk rate and next
required uartclk rate for new baud rate. If both are same it would
not call clk_set_rate() to set same uartclk rate again.

UART baud rate change request (i.e. executing set_termios()) can come
asynchronously and time to program ADM hardware with queued CMD by ADM
driver is non-deterministic. It is required by UART driver to confirm
that queued RX CMD is programmed with ADM hardware before going with
requested baud rate change operation. Hence this change wait in
set_termios() for ADM driver to program queued RX CMD before going ahead
with baud rate. Otherwise ADM may encounter data bus error with UART RX
channel which is unrecoverable.

Change-Id: I678e91420b33a49ce8b6a5a29c6309f9ff6f5c4a
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
msm_serial_hs: Disable UART RxStale before Force RxStale in set_termios

There is possible race for handling normal RxStale event and Force
Rxstale event with UART Core, when Force RxStale is issued from
set_termios(). Hence on baud rate change request disable RxStale event
mechanism, and invoke Force RxStale. With RxStale event mechanism
disabled, Force RxStale still generates interrupt.

Fix possible race condition if before completion of previous UART RX CMD
flush, set_termios() request is received. With this case it is quite
possible that rx_tlet() queues one UART RX CMD with ADM driver and also
set_termios() queues one more UART RX CMD which would results with
queueing same UART RX CMD twice with ADM driver. With this device would
crash as the ADM driver will not be able to de-reference the second UART
RX CMD work. Hence add check in set_termios with rx.flush value as
FLUSH_DATA_READY which confirms that flush is initiated but it is not
completed and wait for rx.flush to become FLUSH_NONE which would happen
only once flush is completed and new UART RX CMD is being queued with ADM
driver.

Reduce waiting time for discard flush completion as it is already waited
for queued UART Rx CMD to be programmed with ADM hardware. Hence change
wait time out from 300 jiffies to 50 mseconds.

Add an API to get important UART core registers values which can be called
from error condition. Use the same when discard flush timeout happens with
set_termios(), when rx.dma_in_flight is not set with set_termios() and when
multiple UART RX CMD queueing condition is seen in msm_hs_start_rx_locked()
API.

CRs-Fixed: 486260
Change-Id: I9fd17e453fad619609e76e8b3a72a4f47210cff9
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
bluetooth: Remove bluesleep_bcm

Squash of the following commits:

Revert "bluetooth: Fix race conditions in BT LPM"

This reverts commit 096a4f8d351d1ed5e0cfea9dd896b89f78d2f438.

Conflicts:
	drivers/tty/serial/msm_serial_hs.c

Change-Id: Ie9f39e7976b085a80e838bba2bc820f312ee8a71

Revert "bluetooth: Add low-power mode to support Bluedroid"

This reverts commit 595c90c30e5cfa8f91b795fe57a6a796f00beb71.

Conflicts:
	drivers/tty/serial/msm_serial_hs.c

Change-Id: Ia4941f5b650dcd66a32a870e6c726b68dd46329c

Revert "Add bluedroid compatible bluesleep and utilize it."

This reverts commit df67b974ec101f4ee6b241a82313c8e85b44b237.

Change-Id: I7e1dd61062deb071c3a9d00872d63310234060b4

Conflicts:
	arch/arm/mach-msm/board-m7-rfkill.c
	drivers/bluetooth/Makefile
	drivers/bluetooth/bluesleep_bcm.c
bluetooth: bluesleep: Bluetooth active power management driver

A new driver is implemented to actively manage the bluetooth module
power. bluesleep also tries to manage the power of the transport used.

Two signals (GPIOs) are used to manage the power events.

BT_WAKE  : signal from HOST to BT chip to intimate BT chip can sleep.
HOST_WAKE: signal from BT chip to HOST to intimate HOST should wakeup/
activate the transport modules required for BT communication.

Change-Id: I96202e1cc67dbcbcfa2be874aa2d845e8350f755

Conflicts:
	arch/arm/mach-msm/Makefile
bluetooth: Fixed ld mismatched symbols

The driver data structure referenced a function point which is defined
as __init data. This caused symbol mismatch error. This could be fixed
by defined driver data with __init macro, otherwise, by cancel __init on
probe function. Have this done in a safe way.

This file is removed in upstream. It seems that is the only chance to
fix it in our own repository.

Reviewed-on: http://git-master/r/20931
Reviewed-by: David Schalig <dschalig@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Chao Jiang <chaoj@nvidia.com>

Change-Id: I3eba3578c84d8ec67707a276841d72f98c47267d
bluetooth: bluesleep: Exit early if device not registered

If the device isn't registered for this board, return out of the init
function early.

Reviewed-on: http://git-master/r/24254
Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com>
Tested-by: Daniel Willemsen <dwillemsen@nvidia.com>
Reviewed-by: Anantha Idapalapati <aidapalapati@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Change-Id: Ic806b4be1671a77a8fedc1c0376362bc177b0604
bluetooth: bluesleep: add suspend and resume

suspend and resume function() to avoid uart
api call when uart driver is not resumed.

bug 863564

Reviewed-on: http://git-master/r/48716
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Tested-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>

Change-Id: I036260f244b2067200050fd5252d91ec23518b86
bluetooth: bluesleep: workaround to enable bluesleep functionality

Enable_irq_wake function is returning error while registering bank
irqs. Commenting out enable_irq_wake,disable_irq_wake function will
not affect bluesleep functionality except wake-on-bluethooth.

Bug 890309

Reviewed-on: http://git-master/r/61090
Reviewed-by: Om Prakash Singh <omp@nvidia.com>
Tested-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

Change-Id: I25e03331ee3cd228669520c2c6db9aabe07920a7
bluetooth: bluesleep: remove blocking call in bluesleep_start

bluesleep_start is not allowed to sleep because it's called by
an atomic_notifier, so we move request_irq to the probe function

Reviewed-on: http://git-master/r/65018
Tested-by: Matt Wagner <mwagner@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Change-Id: I428bd6c9ab07cf7e5ab2029975cc9a617fea03b0
bluetooth: bluesleep: enable wake-on-bluetooth

Bug 910402

Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-on: http://git-master/r/66614
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Change-Id: I6835cacd12573c2bc6adb86ea3742d934d0fc118
bluetooth: bluesleep: call free_irq during driver unload only

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/67654
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User

Change-Id: Iabad9617752af43c7184d0335177c60fba6bd715
bluesleep: implement to support bluedroid

"#define BT_BLUEDROID_SUPPORT 1" -> support BlueDroid
"#define BT_BLUEDROID_SUPPORT 0" -> support BlueZ

Since BlueDroid does not use kernel space HCI driver now, we add the
below 2 /proc nodes to make BlueDroid able to send HCI events to
bluesleep driver.

write 1 to /proc/bluetooth/sleep/lpm -> equivalent to HCI_DEV_REG event
write 0 to /proc/bluetooth/sleep/lpm -> equivalent to HCI_DEV_UNREG event
write 1 to /proc/bluetooth/sleep/btwrite -> equivalent to HCI_DEV_WRITE event

Signed-off-by: Haley Teng <hteng@nvidia.com>

Change-Id: I9ab3e0b83610b094b569f5334557b6fe23ffcd5b
Version 2.0.33-cm2
ASoc: msm: Add lowlatency playback and recording routing
controls

- Add BT, FM, PROXY routing controls for lowlatency playback and
recording

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>

Conflicts:
	sound/soc/msm/msm-pcm-routing.c

Change-Id: I3ecef21d1c445875b6140f3c3cfdec891b5f7b24

Conflicts:
	sound/soc/msm/msm-pcm-routing.c