From patchwork Fri Feb 11 15:13:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 549701 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1BFCOB7023307 for ; Fri, 11 Feb 2011 15:12:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756467Ab1BKPMw (ORCPT ); Fri, 11 Feb 2011 10:12:52 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:59200 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756590Ab1BKPMw (ORCPT ); Fri, 11 Feb 2011 10:12:52 -0500 Received: from finisterre.wolfsonmicro.main (cpc3-sgyl4-0-0-cust125.sgyl.cable.virginmedia.com [82.41.240.126]) by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id AD00111006C; Fri, 11 Feb 2011 15:12:50 +0000 (GMT) Received: from broonie by finisterre.wolfsonmicro.main with local (Exim 4.72) (envelope-from ) id 1PnugL-00069z-76; Fri, 11 Feb 2011 15:13:13 +0000 From: Mark Brown To: Bryan Wu , Michael Hennerich , Mike Frysinger , Dmitry Torokhov Cc: linux-input@vger.kernel.org, Mark Brown Subject: [PATCH 2/2] Input: ad714x-spi - Convert to dev_pm_ops Date: Fri, 11 Feb 2011 15:13:03 +0000 Message-Id: <1297437183-23648-2-git-send-email-broonie@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1297437183-23648-1-git-send-email-broonie@opensource.wolfsonmicro.com> References: <1297437183-23648-1-git-send-email-broonie@opensource.wolfsonmicro.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 11 Feb 2011 15:12:53 +0000 (UTC) diff --git a/drivers/input/misc/ad714x-spi.c b/drivers/input/misc/ad714x-spi.c index 7f8dedf..4120dd5 100644 --- a/drivers/input/misc/ad714x-spi.c +++ b/drivers/input/misc/ad714x-spi.c @@ -9,6 +9,7 @@ #include /* BUS_I2C */ #include #include +#include #include #include "ad714x.h" @@ -16,20 +17,19 @@ #define AD714x_SPI_READ BIT(10) #ifdef CONFIG_PM -static int ad714x_spi_suspend(struct spi_device *spi, pm_message_t message) +static int ad714x_spi_suspend(struct device *dev) { - return ad714x_disable(spi_get_drvdata(spi)); + return ad714x_disable(spi_get_drvdata(to_spi_device(dev))); } -static int ad714x_spi_resume(struct spi_device *spi) +static int ad714x_spi_resume(struct device *dev) { - return ad714x_enable(spi_get_drvdata(spi)); + return ad714x_enable(spi_get_drvdata(to_spi_device(dev))); } -#else -# define ad714x_spi_suspend NULL -# define ad714x_spi_resume NULL #endif +static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume); + static int ad714x_spi_read(struct device *dev, unsigned short reg, unsigned short *data) { @@ -79,11 +79,10 @@ static struct spi_driver ad714x_spi_driver = { .driver = { .name = "ad714x_captouch", .owner = THIS_MODULE, + .pm = &ad714x_spi_pm, }, .probe = ad714x_spi_probe, .remove = __devexit_p(ad714x_spi_remove), - .suspend = ad714x_spi_suspend, - .resume = ad714x_spi_resume, }; static __init int ad714x_spi_init(void)