From patchwork Thu Jan 6 12:12:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 459131 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 p06CDLB8030130 for ; Thu, 6 Jan 2011 12:14:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753493Ab1AFMO3 (ORCPT ); Thu, 6 Jan 2011 07:14:29 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:37449 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752187Ab1AFMO2 (ORCPT ); Thu, 6 Jan 2011 07:14:28 -0500 Received: from rakim.wolfsonmicro.main (lumison.wolfsonmicro.com [87.246.78.27]) by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id 9DD0E1105F4; Thu, 6 Jan 2011 12:14:27 +0000 (GMT) Received: by rakim.wolfsonmicro.main (Postfix, from userid 1000) id 0980623B655F; Thu, 6 Jan 2011 12:12:48 +0000 (GMT) From: Mark Brown To: Dmitry Torokhov , Joonyoung Shim Cc: linux-input@vger.kernel.org, Mark Brown Subject: [PATCH v2] Input: mcs5000_ts - Convert to dev_pm_ops Date: Thu, 6 Jan 2011 12:12:47 +0000 Message-Id: <1294315967-9600-1-git-send-email-broonie@opensource.wolfsonmciro.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]); Thu, 06 Jan 2011 12:14:30 +0000 (UTC) diff --git a/drivers/input/touchscreen/mcs5000_ts.c b/drivers/input/touchscreen/mcs5000_ts.c index 6ee9940..2d84c80 100644 --- a/drivers/input/touchscreen/mcs5000_ts.c +++ b/drivers/input/touchscreen/mcs5000_ts.c @@ -261,25 +261,27 @@ static int __devexit mcs5000_ts_remove(struct i2c_client *client) } #ifdef CONFIG_PM -static int mcs5000_ts_suspend(struct i2c_client *client, pm_message_t mesg) +static int mcs5000_ts_suspend(struct device *dev) { + struct i2c_client *client = to_i2c_client(dev); + /* Touch sleep mode */ i2c_smbus_write_byte_data(client, MCS5000_TS_OP_MODE, OP_MODE_SLEEP); return 0; } -static int mcs5000_ts_resume(struct i2c_client *client) +static int mcs5000_ts_resume(struct device *dev) { + struct i2c_client *client = to_i2c_client(dev); struct mcs5000_ts_data *data = i2c_get_clientdata(client); mcs5000_ts_phys_init(data); return 0; } -#else -#define mcs5000_ts_suspend NULL -#define mcs5000_ts_resume NULL + +static SIMPLE_DEV_PM_OPS(mcs5000_ts_pm, mcs5000_ts_suspend, mcs5000_ts_resume); #endif static const struct i2c_device_id mcs5000_ts_id[] = { @@ -291,10 +293,11 @@ MODULE_DEVICE_TABLE(i2c, mcs5000_ts_id); static struct i2c_driver mcs5000_ts_driver = { .probe = mcs5000_ts_probe, .remove = __devexit_p(mcs5000_ts_remove), - .suspend = mcs5000_ts_suspend, - .resume = mcs5000_ts_resume, .driver = { .name = "mcs5000_ts", +#ifdef CONFIG_PM + .pm = &mcs5000_ts_pm, +#endif }, .id_table = mcs5000_ts_id, };