From patchwork Wed Mar 16 05:10:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 638521 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 p2G556sE002437 for ; Wed, 16 Mar 2011 05:05:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751295Ab1CPFEu (ORCPT ); Wed, 16 Mar 2011 01:04:50 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:56320 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751250Ab1CPFEt (ORCPT ); Wed, 16 Mar 2011 01:04:49 -0400 Received: by pvg12 with SMTP id 12so214906pvg.19 for ; Tue, 15 Mar 2011 22:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:date:message-id:subject; bh=NGt2ch5AmuTv/loZxfNayehhDrjtvcGsxs6dgWqwDxo=; b=aV6Sf8R9HndEp12Hf+8Qgk/EiJ3Fei9OIefQIFK29ctuJ5r1Ezo/IICi0I2AbthqFE qxjx/Psrz/KJY+LCIz2WDbiTwrrBrrX+OBupgxJKA5G0L/+8dLqMSZXFlEFEnk8CFf5r xvF00ASpx9tSNNQ3vyt7I5VoR3xNohSN6jl4o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=b9hY0i0mNfSR7NIK9Qp1bx6SWkmLffZC/pik2r9DE64Ueo5u+6siL5VuqYr+wFY1/z SM50qNfW33mdkoTmlXWxE82iigZhUcI99Fsv4iRg7xZ0T19PXiZDTXylZY3JV2iAm/1q 6gwk+zkXEgmTmtnNKr6Ofz8Fs7fvQPqXcUDP4= Received: by 10.142.163.4 with SMTP id l4mr295432wfe.206.1300251888587; Tue, 15 Mar 2011 22:04:48 -0700 (PDT) Received: from [127.0.0.1] (p1081-ipbf203yosemiya.okinawa.ocn.ne.jp [118.11.216.81]) by mx.google.com with ESMTPS id w32sm675192wfh.7.2011.03.15.22.04.46 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Mar 2011 22:04:47 -0700 (PDT) From: Magnus Damm To: dmitry.torokhov@gmail.com Cc: srk@ti.com, Magnus Damm , linux-sh@vger.kernel.org, chinyeow.sim.xt@renesas.com, linux-input@vger.kernel.org Date: Wed, 16 Mar 2011 14:10:30 +0900 Message-Id: <20110316051030.2399.19707.sendpatchset@t400s> Subject: [PATCH] Input: tca6416-keypad: Suspend/Resume wakeup support 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]); Wed, 16 Mar 2011 05:05:06 +0000 (UTC) --- 0001/drivers/input/keyboard/tca6416-keypad.c +++ work/drivers/input/keyboard/tca6416-keypad.c 2011-03-16 12:53:34.000000000 +0900 @@ -297,6 +297,7 @@ static int __devinit tca6416_keypad_prob } i2c_set_clientdata(client, chip); + device_init_wakeup(&client->dev, 1); return 0; @@ -326,10 +327,35 @@ static int __devexit tca6416_keypad_remo return 0; } +static int tca6416_keypad_suspend(struct device *dev) +{ + struct tca6416_keypad_chip *chip = dev_get_drvdata(dev); + + if (device_may_wakeup(dev)) + enable_irq_wake(chip->irqnum); + + return 0; +} + +static int tca6416_keypad_resume(struct device *dev) +{ + struct tca6416_keypad_chip *chip = dev_get_drvdata(dev); + + if (device_may_wakeup(dev)) + disable_irq_wake(chip->irqnum); + + return 0; +} + +static const struct dev_pm_ops tca6416_keypad_dev_pm_ops = { + .suspend = tca6416_keypad_suspend, + .resume = tca6416_keypad_resume, +}; static struct i2c_driver tca6416_keypad_driver = { .driver = { .name = "tca6416-keypad", + .pm = &tca6416_keypad_dev_pm_ops, }, .probe = tca6416_keypad_probe, .remove = __devexit_p(tca6416_keypad_remove),