bluesleep: Implemented 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

This basic implementation is from tegra kernel.

Change-Id: I2ded86ceb5b80d34d37f97f692b4d31acfb62057
Signed-off-by: Devin Kim <dojip.kim@lge.com>
signed-off-by: hyungjung0521.kim <hyungjung0521.kim@lge.com>
bluesleep: Support for device tree

Bluesleep driver is able to get the board specific configrations from
device tree.

Change-Id: If9ede425c5a7134511e4fbbc82edf440015bdcc1
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: hyungjung0521.kim <hyungjung0521.kim@lge.com>
bluesleep: Change the polarity for IO and UART ID

BT wake is active low and Qualcomm UART 99 is used for BT

Change-Id: If2a5b5cbffe7b8a3d1659150ed96142758ea037a
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: hyungjung0521.kim <hyungjung0521.kim@lge.com>
bluesleep: Set the file permission for /proc/bluetooth/sleep/*

Set the writable permission only for user and group

Change-Id: I47f3784cf80369816168c3d6846ecee6b99aef73
Signed-off-by: Devin Kim@lge.com <dojip.kim@lge.com>
Signed-off-by: hyungjung0521.kim <hyungjung0521.kim@lge.com>
bluesleep: unlock spin before controlling the hsuart power

Kernel might be in sleep to wait for rpm communication when it
controls the hsuart power. So should unlock the spinlock before
controlling the hsuart power.

Change-Id: I7248bc35645666c86c924bba0d47262c911cd8ae
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: hyungjung0521.kim <hyungjung0521.kim@lge.com>
bluesleep: Add debugmask to print the debug messages out

enum {
       DEBUG_USER_STATE = 1U << 0,
       DEBUG_SUSPEND = 1U << 1,
       DEBUG_BTWAKE = 1U << 2,
       DEBUG_VERBOSE = 1U << 3,
};

eg. if you wanto to see the messages for both suspend and btwake, set like below
echo 6 > /sys/module/msm_bt_sleep/parameters/debug_mask

Change-Id: I37237bfafa1d04d9e8d3ad50c3a7c0a445785aeb
Signed-off-by: Devin Kim <dojip.kim@lge.com>
bluesleep: Fix the bt wake flag mismatch

BT_EXT_WAKE and BT flag should be same. Set the BT WAKE to WAKE and
also set the flag as WAKE.

Change-Id: Iff3f4f13eddbbde1f13f41954742be5ca0df57aa
Signed-off-by: Devin Kim <dojip.kim@lge.com>
bluetooth: unlock spin on bluesleep_stop before controling the hsuart power

Kernel migh be in sleep to wait for rpm communication when it controls the
hsuart power. So should unlock the spin before controling the hsuart
power.

Change-Id: Ic051ee95df8be3e7dcea1bc71cba85bdbab34bef
Signed-off-by: Devin Kim <dojip.kim@lge.com>
drivers : bluesleep : port the shinano BCM4339 rfkill driver

Change-Id: Iec6117749b295a6e9070c03bfe94c963fd76fa21