diff mbox

[v6,20/25] gpio/omap: skip operations in runtime callbacks

Message ID 1314798161-19523-21-git-send-email-tarun.kanti@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tarun Kanti DebBarma Aug. 31, 2011, 1:42 p.m. 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 <tarun.kanti@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 drivers/gpio/gpio-omap.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Comments

Kevin Hilman Sept. 6, 2011, 11:54 p.m. UTC | #1
Tarun Kanti DebBarma <tarun.kanti@ti.com> writes:

> 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(). 

Why?  

(again, I know the answer, but should be described in the changelog for
folks not familiar with this driver, or when we come back to this in 3
months and have forgotten why.

> We just need clock enable/disable.
>
> Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tarun Kanti DebBarma Sept. 7, 2011, 5:33 a.m. UTC | #2
On Wed, Sep 7, 2011 at 5:24 AM, Kevin Hilman <khilman@ti.com> wrote:
> Tarun Kanti DebBarma <tarun.kanti@ti.com> writes:
>
>> 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().
>
> Why?
>
> (again, I know the answer, but should be described in the changelog for
> folks not familiar with this driver, or when we come back to this in 3
> months and have forgotten why.
Ok.

>
>> We just need clock enable/disable.
>>
>> Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
>> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>
> Kevin
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 9d68b15..67c5a96 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1136,6 +1136,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
@@ -1177,6 +1180,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) {
 		context_lost_cnt_after =
 			bank->get_context_loss_count(bank->dev);