From patchwork Thu Aug 4 11:04:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tarun Kanti DebBarma X-Patchwork-Id: 1034742 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p74B5gQR024276 for ; Thu, 4 Aug 2011 11:05:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753610Ab1HDLFl (ORCPT ); Thu, 4 Aug 2011 07:05:41 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:41596 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753196Ab1HDLFb (ORCPT ); Thu, 4 Aug 2011 07:05:31 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p74B59Bx028072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Aug 2011 06:05:14 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p74B59jZ006175; Thu, 4 Aug 2011 16:35:09 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 8.3.106.1; Thu, 4 Aug 2011 16:35:09 +0530 Received: from localhost.localdomain ([172.24.190.79]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p74B523F004289; Thu, 4 Aug 2011 16:35:09 +0530 (IST) From: Tarun Kanti DebBarma To: CC: , , , , Tarun Kanti DebBarma Subject: [PATCH v5 21/22] gpio/omap: skip operations in runtime callbacks Date: Thu, 4 Aug 2011 16:34:52 +0530 Message-ID: <1312455893-14922-22-git-send-email-tarun.kanti@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1312455893-14922-1-git-send-email-tarun.kanti@ti.com> References: <1312455893-14922-1-git-send-email-tarun.kanti@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 04 Aug 2011 11:05:42 +0000 (UTC) Most operations within runtime callbacks should be skipped when *_runtime_get_sync() and *_runtime_put_sync() are called in probe(), *_gpio_request() and *_gpio_free(). We just need clock enable/disable. Signed-off-by: Tarun Kanti DebBarma Reviewed-by: Santosh Shilimkar --- drivers/gpio/gpio-omap.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index ba743f5..eae955a 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1142,6 +1142,9 @@ static int omap_gpio_runtime_suspend(struct device *dev) for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++) clk_disable(bank->dbck); + if (!bank->mod_usage) + return 0; + /* If going to OFF, remove triggering for all * non-wakeup GPIOs. Otherwise spurious IRQs will be * generated. See OMAP2420 Errata item 1.101. */ @@ -1180,6 +1183,9 @@ static int omap_gpio_runtime_resume(struct device *dev) for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++) clk_enable(bank->dbck); + if (!bank->mod_usage) + return 0; + if (bank->get_context_loss_count) { ctx_lost_cnt_after = bank->get_context_loss_count(bank->dev);