aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChethan Krishna N <chethan.krishna@stericsson.com>2011-05-25 19:36:32 +0530
committersaid m bagheri <ebgheri@steludxu2848.(none)>2011-06-17 13:42:04 +0200
commitda1417e8a9a9c05c79c68d792128ad7c302b3239 (patch)
treea0a69696546238a1e31bc593dd915bf7c921e934 /drivers
parentf5dcdcd0a68eedbfdbc96d5de42e51cba4ac8520 (diff)
lsm303dlh: adding functions under CONFIG_SENSORS_INPUT_DEVICE
Functions that are called only when CONFIG_SENSORS_INPUT_DEVICE is enabled are put under the same switch Change-Id: If652e8ab2ca0d3482d24145bb5d908f5dbacf965 Signed-off-by: Chethan Krishna N <chethan.krishna@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/23882 Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/lsm303dlh_a.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/hwmon/lsm303dlh_a.c b/drivers/hwmon/lsm303dlh_a.c
index 678f35a7730..af0ceee2e45 100644
--- a/drivers/hwmon/lsm303dlh_a.c
+++ b/drivers/hwmon/lsm303dlh_a.c
@@ -307,6 +307,7 @@ static int lsm303dlh_a_restore(struct lsm303dlh_a_data *ddata)
if (ret < 0)
goto fail;
+#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE
ret = lsm303dlh_a_write(ddata, CTRL_REG3, ddata->interrupt_control,
"CTRL_REG3");
@@ -348,6 +349,7 @@ static int lsm303dlh_a_restore(struct lsm303dlh_a_data *ddata)
if (ret < 0)
goto fail;
+#endif
fail:
if (ret < 0)
@@ -465,7 +467,6 @@ static irqreturn_t lsm303dlh_a_gpio_irq(int irq, void *device_data)
return IRQ_HANDLED;
}
-#endif
static ssize_t lsm303dlh_a_show_interrupt_control(struct device *dev,
struct device_attribute *attr,
@@ -692,6 +693,7 @@ static ssize_t lsm303dlh_a_store_interrupt_threshold(struct device *dev,
return count;
}
+#endif
static ssize_t lsm303dlh_a_show_range(struct device *dev,
struct device_attribute *attr,
@@ -1002,6 +1004,7 @@ static DEVICE_ATTR(rate, S_IWUGO | S_IRUGO,
static DEVICE_ATTR(sleep_wake, S_IWUGO | S_IRUGO,
lsm303dlh_a_show_sleepwake, lsm303dlh_a_store_sleepwake);
+#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE
static DEVICE_ATTR(interrupt_control, S_IWUGO | S_IRUGO,
lsm303dlh_a_show_interrupt_control,
lsm303dlh_a_store_interrupt_control);
@@ -1021,6 +1024,7 @@ static DEVICE_ATTR(interrupt_duration, S_IWUGO | S_IRUGO,
static DEVICE_ATTR(interrupt_threshold, S_IWUGO | S_IRUGO,
lsm303dlh_a_show_interrupt_threshold,
lsm303dlh_a_store_interrupt_threshold);
+#endif
static struct attribute *lsm303dlh_a_attributes[] = {
&dev_attr_data.attr,
@@ -1028,11 +1032,13 @@ static struct attribute *lsm303dlh_a_attributes[] = {
&dev_attr_mode.attr,
&dev_attr_rate.attr,
&dev_attr_sleep_wake.attr,
+#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE
&dev_attr_interrupt_control.attr,
&dev_attr_interrupt_channel.attr,
&dev_attr_interrupt_configure.attr,
&dev_attr_interrupt_duration.attr,
&dev_attr_interrupt_threshold.attr,
+#endif
NULL
};