summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorAnjan Rao <anjan.rao@ti.com>2012-03-05 18:11:13 +0530
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-03-15 08:43:42 -0700
commitdb46fd5f031a3b9f826d72fc1d17284b3f55282e (patch)
treecd937ce99b7f01160c2665fccb67973d72d59a96 /drivers/misc
parentd748841ab04d0cb829e426cd0301cd4de48a3983 (diff)
TI Wl128x support of bluesleep & Wake on BT Driver changes
Bug 933054 Bug 931931 Change-Id: Id84bcc1791114a50d26547de41daeb4774f6026b Signed-off-by: Anjan Rao <anjan.rao@ti.com> Reviewed-on: http://git-master/r/89136 Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com> Tested-by: Nagarjuna Kristam <nkristam@nvidia.com> Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/ti-st/st_core.c1
-rw-r--r--drivers/misc/ti-st/st_kim.c31
-rw-r--r--drivers/misc/ti-st/st_ll.c30
3 files changed, 54 insertions, 8 deletions
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index dde6d57dea55..67026f87dcd9 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -50,6 +50,7 @@ static void remove_channel_from_table(struct st_data_s *st_gdata,
struct st_proto_s *proto)
{
pr_info("%s: id %d\n", __func__, proto->chnl_id);
+/* st_gdata->list[proto->chnl_id] = NULL; */
st_gdata->is_registered[proto->chnl_id] = false;
}
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 154cee0e5afc..5996b934abf0 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -35,6 +35,7 @@
#include <linux/skbuff.h>
#include <linux/ti_wilink_st.h>
+#include <linux/serial_core.h>
#define MAX_ST_DEVICES 3 /* Imagine 1 on each UART for now */
@@ -450,8 +451,8 @@ long st_kim_start(void *kim_data)
do {
/* platform specific enabling code here */
- /*if (pdata->chip_enable)
- pdata->chip_enable();*/
+ if (pdata->chip_enable)
+ pdata->chip_enable();
/* Configure BT nShutdown to HIGH state */
gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
@@ -516,6 +517,8 @@ long st_kim_stop(void *kim_data)
{
long err = 0;
struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data;
+ struct ti_st_plat_data *pdata =
+ kim_gdata->kim_pdev->dev.platform_data;
INIT_COMPLETION(kim_gdata->ldisc_installed);
@@ -543,6 +546,9 @@ long st_kim_stop(void *kim_data)
mdelay(1);
gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
+ /* platform specific disable */
+ if (pdata->chip_disable)
+ pdata->chip_disable();
return err;
}
@@ -777,10 +783,31 @@ static int kim_remove(struct platform_device *pdev)
return 0;
}
+static unsigned long retry_suspend;
+
int kim_suspend(struct platform_device *pdev, pm_message_t state)
{
struct ti_st_plat_data *pdata = pdev->dev.platform_data;
int ret;
+ struct kim_data_s *kim_gdata;
+ struct st_data_s *core_data;
+ kim_gdata = dev_get_drvdata(&pdev->dev);
+ core_data = kim_gdata->core_data;
+ struct uart_state *uart_state;
+ struct uart_port *uport;
+
+
+
+ if (st_ll_getstate(core_data) != ST_LL_INVALID) {
+ uart_state = core_data->tty->driver_data;
+ uport = uart_state->uart_port;
+#ifdef CONFIG_BT_TIBLUESLEEP
+ pr_info(" Bluesleep Start");
+ bluesleep_start(uport);
+#endif
+
+
+ }
if (pdata->suspend) {
ret = pdata->suspend(pdev, state);
diff --git a/drivers/misc/ti-st/st_ll.c b/drivers/misc/ti-st/st_ll.c
index 9e2c257f65fe..0025dde6a6d9 100644
--- a/drivers/misc/ti-st/st_ll.c
+++ b/drivers/misc/ti-st/st_ll.c
@@ -54,25 +54,31 @@ static void ll_device_want_to_sleep(struct st_data_s *st_data)
/* communicate to platform about chip asleep */
kim_data = st_data->kim_data;
pdata = kim_data->kim_pdev->dev.platform_data;
+ if (pdata->chip_asleep)
+ pdata->chip_asleep();
}
static void ll_device_want_to_wakeup(struct st_data_s *st_data)
{
+ struct kim_data_s *kim_data = st_data->kim_data;
+ struct ti_st_plat_data *pdata = kim_data->kim_pdev->dev.platform_data;
+
/* diff actions in diff states */
switch (st_data->ll_state) {
case ST_LL_ASLEEP:
/* communicate to platform about chip wakeup */
+ if (pdata->chip_awake)
+ pdata->chip_awake();
+
send_ll_cmd(st_data, LL_WAKE_UP_ACK); /* send wake_ack */
break;
case ST_LL_ASLEEP_TO_AWAKE:
/* duplicate wake_ind */
- pr_debug("duplicate wake_ind while waiting for Wake ack");
- send_ll_cmd(st_data, LL_WAKE_UP_ACK); /* send wake_ack */
+ pr_err("duplicate wake_ind while waiting for Wake ack");
break;
case ST_LL_AWAKE:
/* duplicate wake_ind */
- pr_debug("duplicate wake_ind already AWAKE");
- send_ll_cmd(st_data, LL_WAKE_UP_ACK); /* send wake_ack */
+ pr_err("duplicate wake_ind already AWAKE");
break;
case ST_LL_AWAKE_TO_ASLEEP:
/* duplicate wake_ind */
@@ -91,7 +97,12 @@ static void ll_device_want_to_wakeup(struct st_data_s *st_data)
* enable ST LL */
void st_ll_enable(struct st_data_s *ll)
{
- /* communicate to platform about chip enable */
+ struct kim_data_s *kim_data = ll->kim_data;
+ struct ti_st_plat_data *pdata = kim_data->kim_pdev->dev.platform_data;
+ /* communicate to platform about chip enable */
+ if (pdata->chip_enable)
+ pdata->chip_enable();
+
ll->ll_state = ST_LL_AWAKE;
}
@@ -99,7 +110,12 @@ void st_ll_enable(struct st_data_s *ll)
* disable ST LL */
void st_ll_disable(struct st_data_s *ll)
{
- /* communicate to platform about chip disable */
+ struct kim_data_s *kim_data = ll->kim_data;
+ struct ti_st_plat_data *pdata = kim_data->kim_pdev->dev.platform_data;
+ /* communicate to platform about chip disable */
+ if (pdata->chip_disable)
+ pdata->chip_disable();
+
ll->ll_state = ST_LL_INVALID;
}
@@ -111,6 +127,8 @@ void st_ll_wakeup(struct st_data_s *ll)
if (likely(ll->ll_state != ST_LL_AWAKE)) {
/* communicate to platform about chip wakeup */
+ if (pdata->chip_awake)
+ pdata->chip_awake();
send_ll_cmd(ll, LL_WAKE_UP_IND); /* WAKE_IND */
ll->ll_state = ST_LL_ASLEEP_TO_AWAKE;
} else {