From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: jkosina@suse.cz, jic23@kernel.org
Cc: linux-iio@vger.kernel.org, linux-input@vger.kernel.org,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [PATCH 2/8] iio: hid-sensor-accel-3d: Introduce PM
Date: Wed, 7 Jan 2015 10:55:54 -0800 [thread overview]
Message-ID: <1420656960-7365-3-git-send-email-srinivas.pandruvada@linux.intel.com> (raw)
In-Reply-To: <1420656960-7365-1-git-send-email-srinivas.pandruvada@linux.intel.com>
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
next prev parent reply other threads:[~2015-01-07 18:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2015-01-07 18:55 ` [PATCH 3/8] iio: hid-sensor-gyro-3d: Introduce PM Srinivas Pandruvada
2015-01-07 18:55 ` [PATCH 4/8] iio: hid-sensor-als: " 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>
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 ` [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
-- strict thread matches above, loose matches on Subject: below --
2015-01-07 0:58 [PATCH] HID: hid-sensor-hub: Correct documentation Srinivas Pandruvada
[not found] ` <1420592328-9942-1-git-send-email-srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-01-07 0:58 ` [PATCH 2/8] iio: hid-sensor-accel-3d: Introduce PM Srinivas Pandruvada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420656960-7365-3-git-send-email-srinivas.pandruvada@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=jic23@kernel.org \
--cc=jkosina@suse.cz \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).