summaryrefslogtreecommitdiff
path: root/drivers/misc/modem_if
diff options
context:
space:
mode:
authorKamil Debski <k.debski@samsung.com>2013-05-21 16:54:10 +0200
committerChanho Park <chanho61.park@samsung.com>2014-03-20 17:34:15 +0900
commite1f89ef21fa681c085979c8bbdc610ec0d2e18d7 (patch)
tree91ca94a962c3b1072701f8e9519fa81549a63e8f /drivers/misc/modem_if
parentf0167e0799e45304621c5c7da6985d4e421f6a0f (diff)
downloadlinux-3.10-e1f89ef21fa681c085979c8bbdc610ec0d2e18d7.tar.gz
linux-3.10-e1f89ef21fa681c085979c8bbdc610ec0d2e18d7.tar.bz2
linux-3.10-e1f89ef21fa681c085979c8bbdc610ec0d2e18d7.zip
modem_if: ifdef wake_lock support in the modem driver
Wake_locks are not supported outside of Android so it is essential to make their use optional. Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/misc/modem_if')
-rw-r--r--drivers/misc/modem_if/modem_link_device_hsic.h2
-rw-r--r--drivers/misc/modem_if/modem_prj.h8
-rw-r--r--drivers/misc/modem_if/modem_utils.c2
-rw-r--r--drivers/misc/modem_if/sipc5_io_device.c4
-rw-r--r--drivers/misc/modem_if/sipc5_modem.c4
5 files changed, 20 insertions, 0 deletions
diff --git a/drivers/misc/modem_if/modem_link_device_hsic.h b/drivers/misc/modem_if/modem_link_device_hsic.h
index 604b06784e2..50a6485d8c4 100644
--- a/drivers/misc/modem_if/modem_link_device_hsic.h
+++ b/drivers/misc/modem_if/modem_link_device_hsic.h
@@ -92,10 +92,12 @@ struct link_pm_data {
bool link_pm_active;
int resume_retry_cnt;
+#ifdef CONFIG_HAS_WAKELOCK
struct wake_lock l2_wake;
struct wake_lock boot_wake;
struct wake_lock rpm_wake;
struct wake_lock tx_async_wake;
+#endif
struct notifier_block pm_notifier;
bool dpm_suspending;
diff --git a/drivers/misc/modem_if/modem_prj.h b/drivers/misc/modem_if/modem_prj.h
index 4780bef3676..d7ab4843687 100644
--- a/drivers/misc/modem_if/modem_prj.h
+++ b/drivers/misc/modem_if/modem_prj.h
@@ -20,7 +20,9 @@
#include <linux/miscdevice.h>
#include <linux/skbuff.h>
#include <linux/completion.h>
+#ifdef CONFIG_HAS_WAKELOCK
#include <linux/wakelock.h>
+#endif
#include <linux/rbtree.h>
#include <linux/spinlock.h>
#include <linux/types.h>
@@ -351,7 +353,9 @@ struct io_device {
struct modem_ctl *mc;
struct modem_shared *msd;
+#ifdef CONFIG_HAS_WAKELOCK
struct wake_lock wakelock;
+#endif
long waketime;
/* DO NOT use __current_link directly
@@ -554,6 +558,8 @@ struct modem_ctl {
#endif /*CONFIG_LTE_MODEM_CMC221*/
#if defined(CONFIG_MACH_GRANDE)
struct delayed_work sim_det_dwork;
+#ifdef CONFIG_HAS_WAKELOCK
+#endif
#endif /* For checking sim detect pin */
struct work_struct work;
@@ -570,7 +576,9 @@ struct modem_ctl {
struct io_device *bootd;
/* Wakelock for modem_ctl */
+#ifdef CONFIG_HAS_WAKELOCK
struct wake_lock mc_wake_lock;
+#endif
void (*gpio_revers_bias_clear)(void);
void (*gpio_revers_bias_restore)(void);
diff --git a/drivers/misc/modem_if/modem_utils.c b/drivers/misc/modem_if/modem_utils.c
index a2def11dc7e..229e93f49ab 100644
--- a/drivers/misc/modem_if/modem_utils.c
+++ b/drivers/misc/modem_if/modem_utils.c
@@ -37,7 +37,9 @@
#include <linux/irq.h>
#include <linux/gpio.h>
#include <linux/delay.h>
+#ifdef CONFIG_HAS_WAKELOCK
#include <linux/wakelock.h>
+#endif
#include <linux/platform_data/modem.h>
#include "modem_prj.h"
diff --git a/drivers/misc/modem_if/sipc5_io_device.c b/drivers/misc/modem_if/sipc5_io_device.c
index 9e22e9cb718..636e191997b 100644
--- a/drivers/misc/modem_if/sipc5_io_device.c
+++ b/drivers/misc/modem_if/sipc5_io_device.c
@@ -855,8 +855,10 @@ static int io_dev_recv_data_from_link_dev(struct io_device *iod,
case IPC_RAW:
case IPC_RFS:
case IPC_MULTI_RAW:
+#ifdef CONFIG_HAS_WAKELOCK
if (iod->waketime)
wake_lock_timeout(&iod->wakelock, iod->waketime);
+#endif
if (ld->link_type == LINKDEV_DPRAM && ld->aligned)
err = rx_frame_from_mem(iod, ld, data, len);
@@ -957,8 +959,10 @@ static int io_dev_recv_skb_from_link_dev(struct io_device *iod,
case IPC_RAW:
case IPC_RFS:
case IPC_MULTI_RAW:
+#ifdef CONFIG_HAS_WAKELOCK
if (iod->waketime)
wake_lock_timeout(&iod->wakelock, iod->waketime);
+#endif
err = rx_frame_from_skb(iod, ld, skb);
if (err < 0) {
diff --git a/drivers/misc/modem_if/sipc5_modem.c b/drivers/misc/modem_if/sipc5_modem.c
index ccfad5fee3d..f7662df189c 100644
--- a/drivers/misc/modem_if/sipc5_modem.c
+++ b/drivers/misc/modem_if/sipc5_modem.c
@@ -31,7 +31,9 @@
#include <linux/irq.h>
#include <linux/gpio.h>
#include <linux/delay.h>
+#ifdef CONFIG_HAS_WAKELOCK
#include <linux/wakelock.h>
+#endif
#include <linux/rbtree.h>
#include <linux/platform_data/modem.h>
@@ -196,6 +198,7 @@ static int attach_devices(struct io_device *iod, enum modem_link tx_link)
BUG();
}
+#ifdef CONFIG_HAS_WAKELOCK
switch (iod->format) {
case IPC_FMT:
wake_lock_init(&iod->wakelock, WAKE_LOCK_SUSPEND, iod->name);
@@ -225,6 +228,7 @@ static int attach_devices(struct io_device *iod, enum modem_link tx_link)
default:
break;
}
+#endif
return 0;
}