From patchwork Tue Dec 14 15:30:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 410461 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 oBEFUQGw029246 for ; Tue, 14 Dec 2010 15:30:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756698Ab0LNPa0 (ORCPT ); Tue, 14 Dec 2010 10:30:26 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:45488 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756540Ab0LNPaZ (ORCPT ); Tue, 14 Dec 2010 10:30:25 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id oBEFULi7000588 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Dec 2010 09:30:23 -0600 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id oBEFUJnH012014; Tue, 14 Dec 2010 21:00:20 +0530 (IST) From: shubhrajyoti@ti.com To: linux-input@vger.kernel.org Cc: linux-omap@vger.kernel.org, Abraham Arce , Kevin Hilman Subject: [PATCH v7] Enable Runtime PM functionality in OMAP4 driver based on the following assumptions: Date: Tue, 14 Dec 2010 21:00:19 +0530 Message-Id: <1292340619-14504-1-git-send-email-a0393217@india.ti.com> X-Mailer: git-send-email 1.5.6.6 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 (demeter1.kernel.org [140.211.167.41]); Tue, 14 Dec 2010 15:30:27 +0000 (UTC) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 45bd097..36239e2 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -239,7 +240,8 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev) matrix_keypad_build_keymap(pdata->keymap_data, row_shift, input_dev->keycode, input_dev->keybit); - omap4_keypad_config(keypad_data); + pm_runtime_enable(&pdev->dev); + pm_runtime_get_sync(&pdev->dev); error = request_irq(keypad_data->irq, omap4_keypad_interrupt, IRQF_TRIGGER_RISING, @@ -255,8 +257,9 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev) goto err_free_irq; } - + omap4_keypad_config(keypad_data); platform_set_drvdata(pdev, keypad_data); + return 0; err_free_irq: @@ -278,6 +281,10 @@ static int __devexit omap4_keypad_remove(struct platform_device *pdev) struct resource *res; free_irq(keypad_data->irq, keypad_data); + + pm_runtime_put_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); + input_unregister_device(keypad_data->input); iounmap(keypad_data->base);