From patchwork Wed Apr 1 14:49:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 15704 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n31EqRdd017387 for ; Wed, 1 Apr 2009 14:52:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755176AbZDAOw1 (ORCPT ); Wed, 1 Apr 2009 10:52:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761580AbZDAOw1 (ORCPT ); Wed, 1 Apr 2009 10:52:27 -0400 Received: from rv-out-0506.google.com ([209.85.198.232]:24018 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755176AbZDAOw0 (ORCPT ); Wed, 1 Apr 2009 10:52:26 -0400 Received: by rv-out-0506.google.com with SMTP id f9so80874rvb.1 for ; Wed, 01 Apr 2009 07:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=ophZuFMocBLt8z7/0K/FPODwHaAQOX+BlFTQdrQHubM=; b=b8bv/DktkCxLHzr5cPwSpyXChld507a4jHy3vffh48emm4kB1r4m9BzMZvexJhN9IH q8P39uEJTCw5vZMWaCFEnMWtwK/AQWZr+Uls8R1oseluANm1BkPmkkfgW9IlY9OhbXFM 2MHT21mOwgde8EbbRQ43uej8sFJLQQhJHpbh8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=rG8JQtL6mgnsZRpuqTq6Shfdx6wm7SKLv3yCj3VGfiTy3+Wb5zGyzMdg0quiaeYw1t E8+NhbRqeww4WX+Lke3pAvScNJ5sxUD1ch/fKumQHcriXAW6KoOD+r0aZ+Jq3hfL7MKq p0xqGlR/aTePmzty3//Pj8Z7p1rpqHJgLU2jE= Received: by 10.141.171.3 with SMTP id y3mr4060912rvo.263.1238597545021; Wed, 01 Apr 2009 07:52:25 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id b8sm65465rvf.22.2009.04.01.07.52.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 01 Apr 2009 07:52:19 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Wed, 01 Apr 2009 23:49:41 +0900 Message-Id: <20090401144941.385.70861.sendpatchset@rx1.opensource.se> Subject: [PATCH] migor_ts: add wakeup support Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm Add wakeup support to the migor_ts driver. If user space has enabled wakeup, use set_irq_wake() during suspend and resume. With this patch the migor_ts driver can be used to wake the system from suspend. Signed-off-by: Magnus Damm --- Tested with wakeup enabled and disabled on a Migo-R board. drivers/input/touchscreen/migor_ts.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/drivers/input/touchscreen/migor_ts.c +++ work/drivers/input/touchscreen/migor_ts.c 2009-04-01 22:59:07.000000000 +0900 @@ -198,6 +198,7 @@ static int migor_ts_probe(struct i2c_cli goto err2; } + device_init_wakeup(&client->dev, 1); return 0; err2: @@ -224,6 +225,26 @@ static int migor_ts_remove(struct i2c_cl return 0; } +static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg) +{ + struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); + + if (device_may_wakeup(&client->dev)) + enable_irq_wake(priv->irq); + + return 0; +} + +static int migor_ts_resume(struct i2c_client *client) +{ + struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); + + if (device_may_wakeup(&client->dev)) + disable_irq_wake(priv->irq); + + return 0; +} + static const struct i2c_device_id migor_ts_id[] = { { "migor_ts", 0 }, { } @@ -236,6 +257,8 @@ static struct i2c_driver migor_ts_driver }, .probe = migor_ts_probe, .remove = migor_ts_remove, + .suspend = migor_ts_suspend, + .resume = migor_ts_resume, .id_table = migor_ts_id, };