drivers/cpufreq/cpufreq_interactive.c/cpufreq_ondemand squashed commits from msm8930

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>

Conflicts:
	drivers/cpufreq/cpufreq_interactive.c
cpufreq: ondemand: Fix store_powersave_bias() race with hotplug

store_powersave_bias() assumes that CPUs will not be taken offline or
brought online while executing its for_each_online_cpu() loops. Fix
this race by blocking hotplug while executing in these loop.

CRs-Fixed: 494407
Change-Id: I0d5520444ec21a8d9b12fb73c06ac8442449fa85
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>

Conflicts:
	drivers/cpufreq/cpufreq_ondemand.c
cpufreq: ondemand: Fix locking in store_powersave_bias

store_powersave_bias() assumes that dbs_info->cur_policy will
not change while it is executing. If it does, memory corruption
can potentially result. Fix this by acquiring the dbs_lock.

Most noticeably, this resolves timer-related list corruptions
encountered when queue_delayed_work_on() is called from within
store_powersave_bias() while a CPU is being hotplugged in and
out.

CRs-Fixed: 494407
Change-Id: I0fd5cbef6834545274cad9481e574ec50b37b871
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>

Conflicts:
	drivers/cpufreq/cpufreq_ondemand.c
cpufreq: ondemand: Fix hotplug deadlock with store_powersave_bias

store_powersave_bias() acquires the hotplug lock and the dbs_mutex
lock, but does so in the wrong order.  Deadlocks like the following
can result.

Thread A:
    get_online_cpus+0x3c/0x5c           <- acquires 'cpu_hotplug.lock'
    store_powersave_bias+0x80/0x3f4     <- acquires 'dbs_mutex'
    kobj_attr_store+0x14/0x20
    sysfs_write_file+0x108/0x13c
    vfs_write+0xb0/0x128
    sys_write+0x38/0x64

Thread B:
    cpufreq_governor_dbs+0x7c/0x55c     <- acquires 'dbs_mutex'
    __cpufreq_governor+0x90/0xe0
    __cpufreq_set_policy+0x1b0/0x258
    cpufreq_add_dev_interface+0x2cc/0x334
    cpufreq_add_dev+0x514/0x580
    cpufreq_cpu_callback+0x88/0x9c
    notifier_call_chain+0x38/0x68
    __cpu_notify+0x28/0x40
    _cpu_up+0xe4/0x118                  <- acquires 'cpu_hotplug.lock'
    cpu_up+0x64/0x80
    store_online+0x48/0x78
    dev_attr_store+0x18/0x24
    sysfs_write_file+0x108/0x13c
    vfs_write+0xb0/0x128
    sys_write+0x38/0x64

Fix this by flipping the order in which the locks are acquired and
released in store_powersave_bias so that it is the same as in the
hotplug path.

Change-Id: Idc59fb29d60b8f7fceb8ed0f2bb9eff4670abda7
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: ondemand: Use interruptible wait to not affect load average

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Compile with Gcc 4.9
Doubletap2wake/sweep2wake

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
fixes for doubletap2wake

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
DoubleTap2Wake/Sweep2Wake: powersuspend fix and enabled by default Sw2s/sw2w

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
dt2w: improve accuracy of single touch detection and bus CPU improvements

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
s2w/dt2w: Some implementations for make a usable in Deep sleep

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
s2w/dt2w: separate PocketMode and more fixes Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
proximity: power off the sensor if dt2w/s2w is disabled Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
input: declare variables dependant on s2w/dt2w when the features are disabled

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
input: doubletap2wake: Make more sensitive

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
intput: dt2w/s2w: disable s2w/dt2w after timeout

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
add make file of time wakeout

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
msm: mdss: Adding lcd notifier

Supports notifier for start&end of LCD power on&off
and update wake_timeout

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
fix wake_timeout build

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
Fix missing ; on mdss_dsi from my last patch about lcd_notify

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>