From patchwork Fri Feb 11 15:13:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 549691 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 p1BFCOB6023307 for ; Fri, 11 Feb 2011 15:12:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756698Ab1BKPMw (ORCPT ); Fri, 11 Feb 2011 10:12:52 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:59196 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756467Ab1BKPMv (ORCPT ); Fri, 11 Feb 2011 10:12:51 -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 5488C110067; 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-00069x-5H; 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 1/2] Input: ad714x-i2c - Convert to dev_pm_ops Date: Fri, 11 Feb 2011 15:13:02 +0000 Message-Id: <1297437183-23648-1-git-send-email-broonie@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.2.3 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-i2c.c b/drivers/input/misc/ad714x-i2c.c index 2bef8fa..e21deb1 100644 --- a/drivers/input/misc/ad714x-i2c.c +++ b/drivers/input/misc/ad714x-i2c.c @@ -10,23 +10,23 @@ #include #include #include +#include #include "ad714x.h" #ifdef CONFIG_PM -static int ad714x_i2c_suspend(struct i2c_client *client, pm_message_t message) +static int ad714x_i2c_suspend(struct device *dev) { - return ad714x_disable(i2c_get_clientdata(client)); + return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev))); } -static int ad714x_i2c_resume(struct i2c_client *client) +static int ad714x_i2c_resume(struct device *dev) { - return ad714x_enable(i2c_get_clientdata(client)); + return ad714x_enable(i2c_get_clientdata(to_i2c_client(dev))); } -#else -# define ad714x_i2c_suspend NULL -# define ad714x_i2c_resume NULL #endif +static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume); + static int ad714x_i2c_write(struct device *dev, unsigned short reg, unsigned short data) { @@ -114,11 +114,10 @@ MODULE_DEVICE_TABLE(i2c, ad714x_id); static struct i2c_driver ad714x_i2c_driver = { .driver = { .name = "ad714x_captouch", + .pm = &ad714x_i2c_pm, }, .probe = ad714x_i2c_probe, .remove = __devexit_p(ad714x_i2c_remove), - .suspend = ad714x_i2c_suspend, - .resume = ad714x_i2c_resume, .id_table = ad714x_id, };