* [PATCH 1/8] iio: hid_sensor_hub: Common PM functions
2015-01-07 18:55 [PATCH 0/8] Adding PM support to hid sensor iio drivers Srinivas Pandruvada
@ 2015-01-07 18:55 ` Srinivas Pandruvada
2015-01-07 18:55 ` [PATCH 2/8] iio: hid-sensor-accel-3d: Introduce PM Srinivas Pandruvada
` (4 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Srinivas Pandruvada @ 2015-01-07 18:55 UTC (permalink / raw)
To: jkosina, jic23; +Cc: linux-iio, linux-input, Srinivas Pandruvada
To improvement power and performance, both regular and run time callbacks
are introduced. Because of auto suspend delay, two consecutive read
don't have to go through full power on/off procedure. The auto suspend
time can be adjusted using regular power attributes of PM sysfs.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
.../iio/common/hid-sensors/hid-sensor-trigger.c | 76 +++++++++++++++++++++-
.../iio/common/hid-sensors/hid-sensor-trigger.h | 5 ++
2 files changed, 79 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
index 910e82a..d128070 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
@@ -22,16 +22,18 @@
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/slab.h>
+#include <linux/delay.h>
#include <linux/hid-sensor-hub.h>
#include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include <linux/iio/sysfs.h>
#include "hid-sensor-trigger.h"
-int hid_sensor_power_state(struct hid_sensor_common *st, bool state)
+static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state)
{
int state_val;
int report_val;
+ s32 poll_value = 0;
if (state) {
if (sensor_hub_device_open(st->hsdev))
@@ -47,6 +49,8 @@ int hid_sensor_power_state(struct hid_sensor_common *st, bool state)
st->report_state.report_id,
st->report_state.index,
HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM);
+
+ poll_value = hid_sensor_read_poll_value(st);
} else {
if (!atomic_dec_and_test(&st->data_ready))
return 0;
@@ -79,7 +83,34 @@ int hid_sensor_power_state(struct hid_sensor_common *st, bool state)
sensor_hub_get_feature(st->hsdev, st->power_state.report_id,
st->power_state.index,
sizeof(state_val), &state_val);
+
+ if (state && poll_value)
+ msleep_interruptible(poll_value * 2);
+
+ return 0;
+}
+
+int hid_sensor_power_state(struct hid_sensor_common *st, bool state)
+{
+#ifdef CONFIG_PM
+ int ret;
+
+ if (state)
+ ret = pm_runtime_get_sync(&st->pdev->dev);
+ else {
+ pm_runtime_mark_last_busy(&st->pdev->dev);
+ ret = pm_runtime_put_autosuspend(&st->pdev->dev);
+ }
+ if (ret < 0) {
+ if (state)
+ pm_runtime_put_noidle(&st->pdev->dev);
+ return ret;
+ }
+
return 0;
+#else
+ return _hid_sensor_power_state(st, state);
+#endif
}
EXPORT_SYMBOL(hid_sensor_power_state);
@@ -126,8 +157,21 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name,
attrb->trigger = trig;
indio_dev->trig = iio_trigger_get(trig);
- return ret;
+ ret = pm_runtime_set_active(&indio_dev->dev);
+ if (ret)
+ goto error_unreg_trigger;
+
+ iio_device_set_drvdata(indio_dev, attrb);
+ pm_suspend_ignore_children(&attrb->pdev->dev, true);
+ pm_runtime_enable(&attrb->pdev->dev);
+ /* Default to 3 seconds, but can be changed from sysfs */
+ pm_runtime_set_autosuspend_delay(&attrb->pdev->dev,
+ 3000);
+ pm_runtime_use_autosuspend(&attrb->pdev->dev);
+ return ret;
+error_unreg_trigger:
+ iio_trigger_unregister(trig);
error_free_trig:
iio_trigger_free(trig);
error_ret:
@@ -135,6 +179,34 @@ error_ret:
}
EXPORT_SYMBOL(hid_sensor_setup_trigger);
+#ifdef CONFIG_PM
+static int hid_sensor_suspend(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct iio_dev *indio_dev = platform_get_drvdata(pdev);
+ struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
+
+ return _hid_sensor_power_state(attrb, false);
+}
+
+static int hid_sensor_resume(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct iio_dev *indio_dev = platform_get_drvdata(pdev);
+ struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
+
+ return _hid_sensor_power_state(attrb, true);
+}
+
+#endif
+
+const struct dev_pm_ops hid_sensor_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(hid_sensor_suspend, hid_sensor_resume)
+ SET_RUNTIME_PM_OPS(hid_sensor_suspend,
+ hid_sensor_resume, NULL)
+};
+EXPORT_SYMBOL(hid_sensor_pm_ops);
+
MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@intel.com>");
MODULE_DESCRIPTION("HID Sensor trigger processing");
MODULE_LICENSE("GPL");
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.h b/drivers/iio/common/hid-sensors/hid-sensor-trigger.h
index 0f8e78c..9f4713f 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.h
+++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.h
@@ -19,6 +19,11 @@
#ifndef _HID_SENSOR_TRIGGER_H
#define _HID_SENSOR_TRIGGER_H
+#include <linux/pm.h>
+#include <linux/pm_runtime.h>
+
+extern const struct dev_pm_ops hid_sensor_pm_ops;
+
int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name,
struct hid_sensor_common *attrb);
void hid_sensor_remove_trigger(struct hid_sensor_common *attrb);
--
1.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/8] iio: hid-sensor-accel-3d: Introduce PM
2015-01-07 18:55 [PATCH 0/8] Adding PM support to hid sensor iio drivers Srinivas Pandruvada
2015-01-07 18:55 ` [PATCH 1/8] iio: hid_sensor_hub: Common PM functions Srinivas Pandruvada
@ 2015-01-07 18:55 ` Srinivas Pandruvada
2015-01-07 18:55 ` [PATCH 3/8] iio: hid-sensor-gyro-3d: " Srinivas Pandruvada
` (3 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Srinivas Pandruvada @ 2015-01-07 18:55 UTC (permalink / raw)
To: jkosina, jic23; +Cc: linux-iio, linux-input, Srinivas Pandruvada
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/iio/accel/hid-sensor-accel-3d.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
index 0085c2f..2b4fad6 100644
--- a/drivers/iio/accel/hid-sensor-accel-3d.c
+++ b/drivers/iio/accel/hid-sensor-accel-3d.c
@@ -111,19 +111,12 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev,
int report_id = -1;
u32 address;
int ret_type;
- s32 poll_value;
*val = 0;
*val2 = 0;
switch (mask) {
case 0:
- poll_value = hid_sensor_read_poll_value(
- &accel_state->common_attributes);
- if (poll_value < 0)
- return -EINVAL;
-
hid_sensor_power_state(&accel_state->common_attributes, true);
- msleep_interruptible(poll_value * 2);
report_id = accel_state->accel[chan->scan_index].report_id;
address = accel_3d_addresses[chan->scan_index];
if (report_id >= 0)
@@ -420,6 +413,7 @@ static struct platform_driver hid_accel_3d_platform_driver = {
.id_table = hid_accel_3d_ids,
.driver = {
.name = KBUILD_MODNAME,
+ .pm = &hid_sensor_pm_ops,
},
.probe = hid_accel_3d_probe,
.remove = hid_accel_3d_remove,
--
1.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/8] iio: hid-sensor-gyro-3d: Introduce PM
2015-01-07 18:55 [PATCH 0/8] Adding PM support to hid sensor iio drivers Srinivas Pandruvada
2015-01-07 18:55 ` [PATCH 1/8] iio: hid_sensor_hub: Common PM functions Srinivas Pandruvada
2015-01-07 18:55 ` [PATCH 2/8] iio: hid-sensor-accel-3d: Introduce PM Srinivas Pandruvada
@ 2015-01-07 18:55 ` Srinivas Pandruvada
2015-01-07 18:55 ` [PATCH 4/8] iio: hid-sensor-als: " Srinivas Pandruvada
` (2 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Srinivas Pandruvada @ 2015-01-07 18:55 UTC (permalink / raw)
To: jkosina, jic23; +Cc: linux-iio, linux-input, Srinivas Pandruvada
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/iio/gyro/hid-sensor-gyro-3d.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index bdcd105..b5883b6 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -111,19 +111,12 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev,
int report_id = -1;
u32 address;
int ret_type;
- s32 poll_value;
*val = 0;
*val2 = 0;
switch (mask) {
case 0:
- poll_value = hid_sensor_read_poll_value(
- &gyro_state->common_attributes);
- if (poll_value < 0)
- return -EINVAL;
-
hid_sensor_power_state(&gyro_state->common_attributes, true);
- msleep_interruptible(poll_value * 2);
report_id = gyro_state->gyro[chan->scan_index].report_id;
address = gyro_3d_addresses[chan->scan_index];
if (report_id >= 0)
@@ -417,6 +410,7 @@ static struct platform_driver hid_gyro_3d_platform_driver = {
.id_table = hid_gyro_3d_ids,
.driver = {
.name = KBUILD_MODNAME,
+ .pm = &hid_sensor_pm_ops,
},
.probe = hid_gyro_3d_probe,
.remove = hid_gyro_3d_remove,
--
1.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/8] iio: hid-sensor-als: Introduce PM
2015-01-07 18:55 [PATCH 0/8] Adding PM support to hid sensor iio drivers Srinivas Pandruvada
` (2 preceding siblings ...)
2015-01-07 18:55 ` [PATCH 3/8] iio: hid-sensor-gyro-3d: " Srinivas Pandruvada
@ 2015-01-07 18:55 ` Srinivas Pandruvada
2015-01-07 18:55 ` [PATCH 5/8] iio: hid-sensor-prox: " Srinivas Pandruvada
[not found] ` <1420656960-7365-1-git-send-email-srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
5 siblings, 0 replies; 11+ messages in thread
From: Srinivas Pandruvada @ 2015-01-07 18:55 UTC (permalink / raw)
To: jkosina, jic23; +Cc: linux-iio, linux-input, Srinivas Pandruvada
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/iio/light/hid-sensor-als.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index 321862d..1609ecd 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -80,7 +80,6 @@ static int als_read_raw(struct iio_dev *indio_dev,
int report_id = -1;
u32 address;
int ret_type;
- s32 poll_value;
*val = 0;
*val2 = 0;
@@ -97,15 +96,8 @@ static int als_read_raw(struct iio_dev *indio_dev,
break;
}
if (report_id >= 0) {
- poll_value = hid_sensor_read_poll_value(
- &als_state->common_attributes);
- if (poll_value < 0)
- return -EINVAL;
-
hid_sensor_power_state(&als_state->common_attributes,
true);
- msleep_interruptible(poll_value * 2);
-
*val = sensor_hub_input_attr_get_raw_value(
als_state->common_attributes.hsdev,
HID_USAGE_SENSOR_ALS, address,
@@ -382,6 +374,7 @@ static struct platform_driver hid_als_platform_driver = {
.id_table = hid_als_ids,
.driver = {
.name = KBUILD_MODNAME,
+ .pm = &hid_sensor_pm_ops,
},
.probe = hid_als_probe,
.remove = hid_als_remove,
--
1.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/8] iio: hid-sensor-prox: Introduce PM
2015-01-07 18:55 [PATCH 0/8] Adding PM support to hid sensor iio drivers Srinivas Pandruvada
` (3 preceding siblings ...)
2015-01-07 18:55 ` [PATCH 4/8] iio: hid-sensor-als: " Srinivas Pandruvada
@ 2015-01-07 18:55 ` Srinivas Pandruvada
[not found] ` <1420656960-7365-1-git-send-email-srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
5 siblings, 0 replies; 11+ messages in thread
From: Srinivas Pandruvada @ 2015-01-07 18:55 UTC (permalink / raw)
To: jkosina, jic23; +Cc: linux-iio, linux-input, Srinivas Pandruvada
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/iio/light/hid-sensor-prox.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c
index db9c60e..91ecc46 100644
--- a/drivers/iio/light/hid-sensor-prox.c
+++ b/drivers/iio/light/hid-sensor-prox.c
@@ -75,7 +75,6 @@ static int prox_read_raw(struct iio_dev *indio_dev,
int report_id = -1;
u32 address;
int ret_type;
- s32 poll_value;
*val = 0;
*val2 = 0;
@@ -92,16 +91,8 @@ static int prox_read_raw(struct iio_dev *indio_dev,
break;
}
if (report_id >= 0) {
- poll_value = hid_sensor_read_poll_value(
- &prox_state->common_attributes);
- if (poll_value < 0)
- return -EINVAL;
-
hid_sensor_power_state(&prox_state->common_attributes,
true);
-
- msleep_interruptible(poll_value * 2);
-
*val = sensor_hub_input_attr_get_raw_value(
prox_state->common_attributes.hsdev,
HID_USAGE_SENSOR_PROX, address,
@@ -374,6 +365,7 @@ static struct platform_driver hid_prox_platform_driver = {
.id_table = hid_prox_ids,
.driver = {
.name = KBUILD_MODNAME,
+ .pm = &hid_sensor_pm_ops,
},
.probe = hid_prox_probe,
.remove = hid_prox_remove,
--
1.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
[parent not found: <1420656960-7365-1-git-send-email-srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>]
* [PATCH 6/8] iio: hid-sensor-magn-3d: Introduce PM
[not found] ` <1420656960-7365-1-git-send-email-srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2015-01-07 18:55 ` Srinivas Pandruvada
2015-01-07 18:55 ` [PATCH 7/8] iio: hid-sensor-incl-3d: " Srinivas Pandruvada
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Srinivas Pandruvada @ 2015-01-07 18:55 UTC (permalink / raw)
To: jkosina-AlSwsSmVLrQ, jic23-DgEjT+Ai2ygdnm+yROfE0A
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA, Srinivas Pandruvada
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
drivers/iio/magnetometer/hid-sensor-magn-3d.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
index 4d299f3..4f9c0be 100644
--- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
+++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
@@ -157,20 +157,12 @@ static int magn_3d_read_raw(struct iio_dev *indio_dev,
int report_id = -1;
u32 address;
int ret_type;
- s32 poll_value;
*val = 0;
*val2 = 0;
switch (mask) {
case 0:
- poll_value = hid_sensor_read_poll_value(
- &magn_state->common_attributes);
- if (poll_value < 0)
- return -EINVAL;
-
hid_sensor_power_state(&magn_state->common_attributes, true);
- msleep_interruptible(poll_value * 2);
-
report_id =
magn_state->magn[chan->address].report_id;
address = magn_3d_addresses[chan->address];
@@ -531,6 +523,7 @@ static struct platform_driver hid_magn_3d_platform_driver = {
.id_table = hid_magn_3d_ids,
.driver = {
.name = KBUILD_MODNAME,
+ .pm = &hid_sensor_pm_ops,
},
.probe = hid_magn_3d_probe,
.remove = hid_magn_3d_remove,
--
1.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 7/8] iio: hid-sensor-incl-3d: Introduce PM
[not found] ` <1420656960-7365-1-git-send-email-srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-01-07 18:55 ` [PATCH 6/8] iio: hid-sensor-magn-3d: " Srinivas Pandruvada
@ 2015-01-07 18:55 ` Srinivas Pandruvada
2015-01-07 18:56 ` [PATCH 8/8] iio: hid-sensor-press: " Srinivas Pandruvada
2015-01-21 21:39 ` [PATCH 0/8] Adding PM support to hid sensor iio drivers Jonathan Cameron
3 siblings, 0 replies; 11+ messages in thread
From: Srinivas Pandruvada @ 2015-01-07 18:55 UTC (permalink / raw)
To: jkosina-AlSwsSmVLrQ, jic23-DgEjT+Ai2ygdnm+yROfE0A
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA, Srinivas Pandruvada
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
drivers/iio/orientation/hid-sensor-incl-3d.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/iio/orientation/hid-sensor-incl-3d.c b/drivers/iio/orientation/hid-sensor-incl-3d.c
index 45bed08..5930fa3 100644
--- a/drivers/iio/orientation/hid-sensor-incl-3d.c
+++ b/drivers/iio/orientation/hid-sensor-incl-3d.c
@@ -111,20 +111,12 @@ static int incl_3d_read_raw(struct iio_dev *indio_dev,
int report_id = -1;
u32 address;
int ret_type;
- s32 poll_value;
*val = 0;
*val2 = 0;
switch (mask) {
case IIO_CHAN_INFO_RAW:
- poll_value = hid_sensor_read_poll_value(
- &incl_state->common_attributes);
- if (poll_value < 0)
- return -EINVAL;
-
hid_sensor_power_state(&incl_state->common_attributes, true);
- msleep_interruptible(poll_value * 2);
-
report_id =
incl_state->incl[chan->scan_index].report_id;
address = incl_3d_addresses[chan->scan_index];
@@ -438,6 +430,7 @@ static struct platform_driver hid_incl_3d_platform_driver = {
.id_table = hid_incl_3d_ids,
.driver = {
.name = KBUILD_MODNAME,
+ .pm = &hid_sensor_pm_ops,
},
.probe = hid_incl_3d_probe,
.remove = hid_incl_3d_remove,
--
1.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 8/8] iio: hid-sensor-press: Introduce PM
[not found] ` <1420656960-7365-1-git-send-email-srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-01-07 18:55 ` [PATCH 6/8] iio: hid-sensor-magn-3d: " Srinivas Pandruvada
2015-01-07 18:55 ` [PATCH 7/8] iio: hid-sensor-incl-3d: " Srinivas Pandruvada
@ 2015-01-07 18:56 ` Srinivas Pandruvada
2015-01-21 21:39 ` [PATCH 0/8] Adding PM support to hid sensor iio drivers Jonathan Cameron
3 siblings, 0 replies; 11+ messages in thread
From: Srinivas Pandruvada @ 2015-01-07 18:56 UTC (permalink / raw)
To: jkosina-AlSwsSmVLrQ, jic23-DgEjT+Ai2ygdnm+yROfE0A
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA, Srinivas Pandruvada
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
drivers/iio/pressure/hid-sensor-press.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
index ac150f0..7bb8d4c 100644
--- a/drivers/iio/pressure/hid-sensor-press.c
+++ b/drivers/iio/pressure/hid-sensor-press.c
@@ -79,7 +79,6 @@ static int press_read_raw(struct iio_dev *indio_dev,
int report_id = -1;
u32 address;
int ret_type;
- s32 poll_value;
*val = 0;
*val2 = 0;
@@ -96,15 +95,8 @@ static int press_read_raw(struct iio_dev *indio_dev,
break;
}
if (report_id >= 0) {
- poll_value = hid_sensor_read_poll_value(
- &press_state->common_attributes);
- if (poll_value < 0)
- return -EINVAL;
hid_sensor_power_state(&press_state->common_attributes,
true);
-
- msleep_interruptible(poll_value * 2);
-
*val = sensor_hub_input_attr_get_raw_value(
press_state->common_attributes.hsdev,
HID_USAGE_SENSOR_PRESSURE, address,
@@ -383,6 +375,7 @@ static struct platform_driver hid_press_platform_driver = {
.id_table = hid_press_ids,
.driver = {
.name = KBUILD_MODNAME,
+ .pm = &hid_sensor_pm_ops,
},
.probe = hid_press_probe,
.remove = hid_press_remove,
--
1.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/8] Adding PM support to hid sensor iio drivers
[not found] ` <1420656960-7365-1-git-send-email-srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
` (2 preceding siblings ...)
2015-01-07 18:56 ` [PATCH 8/8] iio: hid-sensor-press: " Srinivas Pandruvada
@ 2015-01-21 21:39 ` Jonathan Cameron
3 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2015-01-21 21:39 UTC (permalink / raw)
To: Srinivas Pandruvada, jkosina-AlSwsSmVLrQ
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA
On 07/01/15 18:55, Srinivas Pandruvada wrote:
> Linux PM and runtime PM support.
>
> Srinivas Pandruvada (8):
> iio: hid_sensor_hub: Common PM functions
> iio: hid-sensor-accel-3d: Introduce PM
> iio: hid-sensor-gyro-3d: Introduce PM
> iio: hid-sensor-als: Introduce PM
> iio: hid-sensor-prox: Introduce PM
> iio: hid-sensor-magn-3d: Introduce PM
> iio: hid-sensor-incl-3d: Introduce PM
> iio: hid-sensor-press: Introduce PM
>
> drivers/iio/accel/hid-sensor-accel-3d.c | 8 +--
> .../iio/common/hid-sensors/hid-sensor-trigger.c | 76 +++++++++++++++++++++-
> .../iio/common/hid-sensors/hid-sensor-trigger.h | 5 ++
> drivers/iio/gyro/hid-sensor-gyro-3d.c | 8 +--
> drivers/iio/light/hid-sensor-als.c | 9 +--
> drivers/iio/light/hid-sensor-prox.c | 10 +--
> drivers/iio/magnetometer/hid-sensor-magn-3d.c | 9 +--
> drivers/iio/orientation/hid-sensor-incl-3d.c | 9 +--
> drivers/iio/pressure/hid-sensor-press.c | 9 +--
> 9 files changed, 86 insertions(+), 57 deletions(-)
>
Series applied to the togreg branch of iio.git.
First patch caused a bit of fuzz- probably due to my picking up the
series you sent based on time I have to review them (rather than in
the original order).
Anyhow, pushed out as testing for the autobuilders to play with it.
^ permalink raw reply [flat|nested] 11+ messages in thread