From patchwork Thu Mar 11 05:35:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjith Lohithakshan X-Patchwork-Id: 84787 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2B5ZDuP030357 for ; Thu, 11 Mar 2010 05:35:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751262Ab0CKFfM (ORCPT ); Thu, 11 Mar 2010 00:35:12 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:49046 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751046Ab0CKFfL (ORCPT ); Thu, 11 Mar 2010 00:35:11 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o2B5Z5EC001776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 10 Mar 2010 23:35:07 -0600 Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o2B5Z2rT003967; Thu, 11 Mar 2010 11:05:03 +0530 (IST) Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by psplinux050.india.ti.com (8.13.1/8.13.1) with ESMTP id o2B5Z2d5024121; Thu, 11 Mar 2010 11:05:02 +0530 Received: (from a0876318@localhost) by psplinux050.india.ti.com (8.13.1/8.13.1/Submit) id o2B5Z1pO024118; Thu, 11 Mar 2010 11:05:01 +0530 From: Ranjith Lohithakshan To: linux-input@vger.kernel.org Cc: dtor@mail.ru, ranjithl@ti.com Subject: [PATCH] Input: ads7846 - add wakeup support Date: Thu, 11 Mar 2010 11:05:01 +0530 Message-Id: <1268285701-24086-1-git-send-email-ranjithl@ti.com> X-Mailer: git-send-email 1.6.2.4 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.3 (demeter.kernel.org [140.211.167.41]); Thu, 11 Mar 2010 05:35:13 +0000 (UTC) diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 8b05d8e..38022dd 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -817,6 +817,8 @@ static int ads7846_suspend(struct spi_device *spi, pm_message_t message) spin_lock_irq(&ts->lock); ts->is_suspended = 1; + if (device_may_wakeup(&ts->spi->dev)) + enable_irq_wake(ts->spi->irq); ads7846_disable(ts); spin_unlock_irq(&ts->lock); @@ -833,6 +835,8 @@ static int ads7846_resume(struct spi_device *spi) ts->is_suspended = 0; ads7846_enable(ts); + if (device_may_wakeup(&ts->spi->dev)) + disable_irq_wake(ts->spi->irq); spin_unlock_irq(&ts->lock); @@ -1191,6 +1195,9 @@ static int __devinit ads7846_probe(struct spi_device *spi) if (err) goto err_remove_attr_group; + if (pdata->wakeup == true) + device_init_wakeup(&spi->dev, 1); + return 0; err_remove_attr_group: @@ -1220,6 +1227,7 @@ static int __devexit ads7846_remove(struct spi_device *spi) { struct ads7846 *ts = dev_get_drvdata(&spi->dev); + device_init_wakeup(&spi->dev, 0); ads784x_hwmon_unregister(spi, ts); input_unregister_device(ts->input); diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 51948eb..116e611 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h @@ -53,5 +53,6 @@ struct ads7846_platform_data { int (*filter) (void *filter_data, int data_idx, int *val); void (*filter_cleanup)(void *filter_data); void (*wait_for_sync)(void); + bool wakeup; };