summaryrefslogtreecommitdiff
path: root/drivers/misc/ti-st/st_ll.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/ti-st/st_ll.c')
-rw-r--r--drivers/misc/ti-st/st_ll.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/drivers/misc/ti-st/st_ll.c b/drivers/misc/ti-st/st_ll.c
index 0025dde6a6d9..82558a36ceb2 100644
--- a/drivers/misc/ti-st/st_ll.c
+++ b/drivers/misc/ti-st/st_ll.c
@@ -38,9 +38,6 @@ static void send_ll_cmd(struct st_data_s *st_data,
static void ll_device_want_to_sleep(struct st_data_s *st_data)
{
- struct kim_data_s *kim_data;
- struct ti_st_plat_data *pdata;
-
pr_debug("%s", __func__);
/* sanity check */
if (st_data->ll_state != ST_LL_AWAKE)
@@ -52,24 +49,20 @@ static void ll_device_want_to_sleep(struct st_data_s *st_data)
st_data->ll_state = ST_LL_ASLEEP;
/* 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();
+#ifdef CONFIG_WAKELOCK
+ wake_unlock(&st_data->st_wk_lock);
+#endif
}
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();
-
+#ifdef CONFIG_WAKELOCK
+ wake_lock(&st_data->st_wk_lock);
+#endif
send_ll_cmd(st_data, LL_WAKE_UP_ACK); /* send wake_ack */
break;
case ST_LL_ASLEEP_TO_AWAKE:
@@ -97,12 +90,10 @@ 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)
{
- 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();
-
+#ifdef CONFIG_WAKELOCK
+ wake_lock(&ll->st_wk_lock);
+#endif
ll->ll_state = ST_LL_AWAKE;
}
@@ -110,25 +101,22 @@ void st_ll_enable(struct st_data_s *ll)
* disable ST LL */
void st_ll_disable(struct st_data_s *ll)
{
- 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();
-
+#ifdef CONFIG_WAKELOCK
+ wake_unlock(&ll->st_wk_lock);
+#endif
ll->ll_state = ST_LL_INVALID;
}
/* called when ST Core wants to update the state */
void st_ll_wakeup(struct st_data_s *ll)
{
- struct kim_data_s *kim_data = ll->kim_data;
- struct ti_st_plat_data *pdata = kim_data->kim_pdev->dev.platform_data;
if (likely(ll->ll_state != ST_LL_AWAKE)) {
/* communicate to platform about chip wakeup */
- if (pdata->chip_awake)
- pdata->chip_awake();
+#ifdef CONFIG_WAKELOCK
+ wake_lock(&ll->st_wk_lock);
+#endif
send_ll_cmd(ll, LL_WAKE_UP_IND); /* WAKE_IND */
ll->ll_state = ST_LL_ASLEEP_TO_AWAKE;
} else {