From patchwork Wed Jan 7 00:58:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: srinivas pandruvada X-Patchwork-Id: 5578631 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E8AB3BF6C3 for ; Wed, 7 Jan 2015 00:59:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3560020251 for ; Wed, 7 Jan 2015 00:59:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DA3F202E9 for ; Wed, 7 Jan 2015 00:59:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754409AbbAGA7q (ORCPT ); Tue, 6 Jan 2015 19:59:46 -0500 Received: from mga02.intel.com ([134.134.136.20]:8033 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754110AbbAGA7p (ORCPT ); Tue, 6 Jan 2015 19:59:45 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 06 Jan 2015 16:59:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,711,1413270000"; d="scan'208";a="665491857" Received: from spandruv-desktop.jf.intel.com ([10.7.199.150]) by orsmga002.jf.intel.com with ESMTP; 06 Jan 2015 16:59:39 -0800 From: Srinivas Pandruvada To: jkosina@suse.cz, jic23@kernel.org Cc: linux-iio@vger.kernel.org, linux-input@vger.kernel.org, Srinivas Pandruvada Subject: [PATCH 8/8] iio: hid-sensor-press: Introduce PM Date: Tue, 6 Jan 2015 16:58:47 -0800 Message-Id: <1420592328-9942-24-git-send-email-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1420592328-9942-1-git-send-email-srinivas.pandruvada@linux.intel.com> References: <1420592328-9942-1-git-send-email-srinivas.pandruvada@linux.intel.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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,