Reset G2 changes to msm_serial_hs
msm_serial_hs: Add ioctl support for UART Clock on/off request

This change adds support for ioctl implementation in HSUART
driver. UART Client application (e.g. Bluetooth) can make
request for UART Clock on/off using the ioctl mechanism.
UART Clock status also can be queried using this mechanism.

CRs-Fixed: 496245
Change-Id: I9531cf2f9eda487082b9719341c5ad84c15ad5f7
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
msm_serial_hs: Vote for clocks during tty close

While BT operation is in progress, it's possible for
client functions to explicitly turn off the
UART clocks without notifying TTY layer.  Then when
TTY layer try to access UART, L2 error happened because
of un-clocked registers.  Since there is no clear way
to notify clients to turn on clocks before TTY access
UART driver will implicilty turn on the clocks.

CRs-Fixed: 505225
Change-Id: Ia9958658465a6c0e5af66cd932e8e694cc12b78c
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
msm_serial_hs: check clk_state in set_mctrl() and fix unbalanced unvote

commit "msm_serial_hs: Vote for clocks during tty close"
has unbalanced unvote clock during msm_hs_shutdown(). Fix it.
Also, the following case has also unclocked register access problem.

  msm_hs_set_mctrl_locked()
  uart_dtr_rts()
  tty_port_close_start()
  uart_close()
  tty_release()

Because msm_hs_set_mctrl_locked() is called with spinlock,
can't vote for clock. Thus, just skip it if clock is off.

Change-Id: I0f75cb4a0303b6385367f087586765f3e5ff37f7
Signed-off-by: Bongkyu Kim <bongkyu.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm_serial_hs: fix unbalanced clock vote

commit "msm_serial_hs: check clk_state in set_mctrl() and
fix unbalanced unvote" removed the codes to balance clk_state.
It causes the unbalanced clock vote. So restore this.

Change-Id: I339c135c29bc48294639c0d80ae7a51b7c534af0
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: shihhao.feng <shihhao.feng@lge.com>
msm_serial_hs: fix unbalanced clock vote during shutdown

If msm_hs_shutdown() is called during MSM_HS_CLK_OFF status,
it causes unbalanced clock vote.
This situation can be occurred if bluesleep already turn off clock.
To fix this, unvote clock first and check clk_state.

Change-Id: I65a5ac421a7e3a04083fe5f5893e2cc930303e54
Signed-off-by: Bongkyu Kim <bongkyu.kim@lge.com>
bluesleep: Remove remnants of LGE_BLUESLEEP

The patching of msm_serial_hs should make the clock workarounds
unnecessary
defconfig: Disable BTlock
Revert "defconfig: Disable BTlock"

This reverts commit 5c835190f4d0e678414a86a04ebae3ac33bb4a05.
rfkill: Don't run btlock

It conflicts with userspace's invocations from bluedroid
bcmdhd: Reset the hang flag after the notifications are sent
ARM: 7527/1: uaccess: explicitly check __user pointer when !CPU_USE_DOMAINS

The {get,put}_user macros don't perform range checking on the provided
__user address when !CPU_HAS_DOMAINS.

This patch reworks the out-of-line assembly accessors to check the user
address against a specified limit, returning -EFAULT if is is out of
range.

[will: changed get_user register allocation to match put_user]
[rmk: fixed building on older ARM architectures]

CRs-Fixed: 504011
Change-Id: I3818045a136fcdf72deb1371b132e090fd7ed643
Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Git-commit: 8404663f81d212918ff85f493649a7991209fa04
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
video: msm: mdss: insert panel parameters for width and height

for calculating dpi on HAL,FB should check panel physical size.
so, this patch make panel driver parse dt and fill panel's width
and height. and provide the information to FB.

Change-Id: I0fbe12470c903e90c50e06ae2fbbe786187cc133
Signed-off-by: darren.kang <darren.kang@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm: mdss: Prevent non-zero backlight following display blank

Force the backlight to zero before entering powerdown state to prevent
backlight from staying on during blank/suspend.

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

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
msm_fb: mdss: register mdss devices for system shutdown

When device is restarted it is necessary to power down display panel
in order to avoid any residue gliches for the next session. And in order
to power down display devices, respective drivers need to support
shutdown sequence. Implement driver shutdown for fb and mdp devices.

CRs-Fixed: 504751
Change-Id: I80acbdbb8eb9bb4999617698f7314fd8482f4403
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
msm: mdss: support uneven framebuffer split

The default split ratio is 50 percent if buffer resolution width is
greater than the max width that mixer can support. This even split may
not be desired for optimal smp allocation or other usecases.

CRs-fixed: 491728
Change-Id: I8ff3f7c1bd79daf1da9ebded0c561cf96db08b73
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: mdss: only the main display can update the bl_updated flag

The backlight brightness setting might be rejected due to bl_updated flag
status was wrong

Bug: 10032778

Change-Id: Ic07251bff5db39dcb9e48c6daf5485044d73e0fc
Signed-off-by: shihhao.feng <shihhao.feng@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
msm: mdss: Initial calibration mode implementation

Enable calibration mode to be set via framebuffer ioctl.

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

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
msm: mdss: Add read/write buffer support for calibraiton tool

This change allows to process read/write operation through
buffer instead of single IOCTL call. It is part of
optimization to save DIAG packet processing time.

Change-Id: Iffaab2dd160959f8c7950ebca043b1e0cf25877c
Signed-off-by: Arpita Banerjee <cabane@codeaurora.org>
msm: mdss: Update notify returns notify state

Change update notify ioctl to return a value describing
the state that caused the update.

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