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
msm: actuator: fix to prevent untrusted pointer to lead DoS

fix to prevent untrusted userspace pointer in actuator kernel
driver to lead DoS

Change-Id: I1b64270deb494530d268539e7b420be5ec79b658
Signed-off-by: Vasko Kalanoski <vaskok@codeaurora.org>
msm: actuator: fix to prevent kernel heap buffer overflow

fix to prevent kernel heap buffer overflow allows user
controlled data to be written to the heap via the
msm_camera actuator IOCTLs

Change-Id: I4458831e28e0081fb2f5ae55506be866100e1b4f
Signed-off-by: Vasko Kalanoski <vaskok@codeaurora.org>
msm: cpufreq: Only apply driver limits for scaling_min/max_freq writes

When new values are written to scaling_min/max_freq sysfs files, the
current code applies all the limits imposed by various ADJUST and
INCOMPATIBLE notifiers handlers before storing them.

When the ADJUST and/or INCOMPATIBLE notifiers change their limits
frequently, this behavior makes it almost impossible for a
user/userspace process to store the scaling_min/max_freq limits
that go beyond the instantaneous limits imposed by the notifiers.
Since these sysfs nodes are typically meant to set limits that need
to be enforced for the foreseeable future, this is not a very user
friendly behavior.

So, change the behavior to only apply limits that are enforced by
the cpufreq driver. Typically, these are just the absolute limits
of the HW and don't change very often.

Change-Id: I1ccfaa2d1ee4ea595f882485d359dbdb407a0176
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
intelli_plug: add touch input logic

changed intelli_plug sampling rates and bump to version 2.0

Signed-off-by: Paul Reioux <reioux@gmail.com>
kernel/power/powersuspend: remove userspace dependency from powersuspend

make powersuspend not depend on a userspace initiator anymore, but use a hook
in autosleep instead.

Signed-off-by: Paul Reioux <reioux@gmail.com>
kernel/power/powersuspend: add back userpace control w/ default kernel control

make kernel / userspace mode switchable

Signed-off-by: Paul Reioux <reioux@gmail.com>
kernel/power/powersuspend: default to userspace for now

Signed-off-by: Paul Reioux <reioux@gmail.com>
intelliplug: add mutext protection around input work

once in a while, during atomic ops, new input event could cause atomic
violations

Signed-off-by: Paul Reioux <reioux@gmail.com>
Revert "intelliplug: add mutext protection around input work"

This reverts commit 3454bd3aef66bd2c54f75d5e908e45f686600ac5.
intelli_plug: use a context safe function call instead

Signed-off-by: Paul Reioux <reioux@gmail.com>
SELinux: include definition of new capabilities

The kernel has added CAP_WAKE_ALARM and CAP_EPOLLWAKEUP.  We need to
define these in SELinux so they can be mediated by policy.

Change-Id: I8a3e0db15ec5f4eb05d455a57e8446a8c2b484c2
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
[sds: rename epollwakeup to block_suspend to match upstream merge]
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
msm: mdss: Fix possible buffer overflow in ppp

Correct the limit check for the buffer format and avoid the
possible buffer overflow.

CRs-Fixed: 542730
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
Change-Id: I78f86cf8e7dcd0b3f4e124fbbf70353796583a47
jiffies conversions: Use compile time constants when possible

Date	Fri, 04 Jan 2013 13:15:43 -0800

Do the multiplications and divisions at compile time
instead of runtime when the converted value is a constant.

Make the calculation functions static __always_inline to jiffies.h.

Add #defines with __builtin_constant_p to test and use the
static inline or the runtime functions as appropriate.

Prefix the old exported symbols/functions with __

Signed-off-by: Paul Reioux <reioux@gmail.com>