From patchwork Fri Jan 24 00:00:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Courtney Cavin X-Patchwork-Id: 3532461 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 32BD69F39B for ; Thu, 23 Jan 2014 23:59:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B0E6201BC for ; Thu, 23 Jan 2014 23:59:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EEAB201BB for ; Thu, 23 Jan 2014 23:59:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755518AbaAWX7j (ORCPT ); Thu, 23 Jan 2014 18:59:39 -0500 Received: from seldrel01.sonyericsson.com ([212.209.106.2]:19794 "EHLO seldrel01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753624AbaAWX7j (ORCPT ); Thu, 23 Jan 2014 18:59:39 -0500 From: Courtney Cavin To: CC: , Subject: [PATCH 06/15] Input: synaptics-rmi4 - remove platform suspend callbacks Date: Thu, 23 Jan 2014 16:00:14 -0800 Message-ID: <1390521623-6491-7-git-send-email-courtney.cavin@sonymobile.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1390521623-6491-6-git-send-email-courtney.cavin@sonymobile.com> References: <1390521623-6491-1-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-2-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-3-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-4-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-5-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-6-git-send-email-courtney.cavin@sonymobile.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 These are unnecessary and ugly. Remove them, and all related code. Cc: Christopher Heiny Cc: Dmitry Torokhov Signed-off-by: Courtney Cavin --- drivers/input/rmi4/rmi_driver.c | 57 ++--------------------------------------- drivers/input/rmi4/rmi_driver.h | 10 -------- include/linux/rmi.h | 20 --------------- 3 files changed, 2 insertions(+), 85 deletions(-) diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index 780742f..691b6fb 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -621,60 +621,16 @@ error_exit: #ifdef CONFIG_PM_SLEEP static int rmi_driver_suspend(struct device *dev) { - struct rmi_driver_data *data; - int retval = 0; struct rmi_device *rmi_dev = to_rmi_device(dev); - data = dev_get_drvdata(&rmi_dev->dev); - - mutex_lock(&data->suspend_mutex); - - if (data->pre_suspend) { - retval = data->pre_suspend(data->pm_data); - if (retval) - goto exit; - } - disable_sensor(rmi_dev); - - if (data->post_suspend) - retval = data->post_suspend(data->pm_data); - -exit: - mutex_unlock(&data->suspend_mutex); - return retval; + return 0; } static int rmi_driver_resume(struct device *dev) { - struct rmi_driver_data *data; - int retval = 0; struct rmi_device *rmi_dev = to_rmi_device(dev); - - data = dev_get_drvdata(&rmi_dev->dev); - mutex_lock(&data->suspend_mutex); - - if (data->pre_resume) { - retval = data->pre_resume(data->pm_data); - if (retval) - goto exit; - } - - retval = enable_sensor(rmi_dev); - if (retval) - goto exit; - - - if (data->post_resume) { - retval = data->post_resume(data->pm_data); - if (retval) - goto exit; - } - - data->suspended = false; -exit: - mutex_unlock(&data->suspend_mutex); - return retval; + return enable_sensor(rmi_dev); } #endif /* CONFIG_PM_SLEEP */ @@ -811,15 +767,6 @@ static int rmi_driver_probe(struct device *dev) retval = -ENOMEM; goto err_free_data; } - if (IS_ENABLED(CONFIG_PM)) { - data->pm_data = pdata->pm_data; - data->pre_suspend = pdata->pre_suspend; - data->post_suspend = pdata->post_suspend; - data->pre_resume = pdata->pre_resume; - data->post_resume = pdata->post_resume; - - mutex_init(&data->suspend_mutex); - } data->irq = pdata->irq; if (data->irq < 0) { diff --git a/drivers/input/rmi4/rmi_driver.h b/drivers/input/rmi4/rmi_driver.h index aef5521..f28166f 100644 --- a/drivers/input/rmi4/rmi_driver.h +++ b/drivers/input/rmi4/rmi_driver.h @@ -53,16 +53,6 @@ struct rmi_driver_data { u8 bsr; bool enabled; -#ifdef CONFIG_PM_SLEEP - bool suspended; - struct mutex suspend_mutex; - - void *pm_data; - int (*pre_suspend) (const void *pm_data); - int (*post_suspend) (const void *pm_data); - int (*pre_resume) (const void *pm_data); - int (*post_resume) (const void *pm_data); -#endif #ifdef CONFIG_RMI4_DEBUG struct dentry *debugfs_delay; diff --git a/include/linux/rmi.h b/include/linux/rmi.h index 326e741..41c2c04 100644 --- a/include/linux/rmi.h +++ b/include/linux/rmi.h @@ -204,8 +204,6 @@ struct rmi_device_platform_data_spi { * @f11_rezero_wait - if non-zero, this is how may milliseconds the F11 2D * sensor will wait before being be rezeroed on exit from suspend. If * this value is zero, the F11 2D sensor will not be rezeroed on resume. - * @pre_suspend - this will be called before any other suspend operations are - * done. * @power_management - overrides default touch sensor doze mode settings (see * above) * @f19_button_map - provide initial input subsystem key mappings for F19. @@ -213,16 +211,6 @@ struct rmi_device_platform_data_spi { * @gpioled_map - provides initial settings for GPIOs and LEDs controlled by * F30. * @f41_button_map - provide initial input subsystem key mappings for F41. - * - * @post_suspend - this will be called after all suspend operations are - * completed. This is the ONLY safe place to power off an RMI sensor - * during the suspend process. - * @pre_resume - this is called before any other resume operations. If you - * powered off the RMI4 sensor in post_suspend(), then you MUST power it back - * here, and you MUST wait an appropriate time for the ASIC to come up - * (100ms to 200ms, depending on the sensor) before returning. - * @pm_data - this will be passed to the various (pre|post)_(suspend/resume) - * functions. */ struct rmi_device_platform_data { int irq; @@ -242,14 +230,6 @@ struct rmi_device_platform_data { #ifdef CONFIG_RMI4_FWLIB char *firmware_name; #endif - -#ifdef CONFIG_PM - void *pm_data; - int (*pre_suspend) (const void *pm_data); - int (*post_suspend) (const void *pm_data); - int (*pre_resume) (const void *pm_data); - int (*post_resume) (const void *pm_data); -#endif }; /**