linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Estevam <fabio.estevam@freescale.com>
To: dmitry.torokhov@gmail.com
Cc: kernel@pengutronix.de, linux-input@vger.kernel.org,
	Fabio Estevam <fabio.estevam@freescale.com>
Subject: [PATCH v2 1/3] keyboard: imx_keypad: Use clock_prepare_enable/clk_disable_unprepare()
Date: Fri, 6 Jul 2012 14:41:52 -0300	[thread overview]
Message-ID: <1341596514-15972-1-git-send-email-fabio.estevam@freescale.com> (raw)

Adapt clock handling to the new i.mx clock framework and fix the following warning:

input: imx-keypad as /devices/platform/imx-keypad/input/input0                  
------------[ cut here ]------------                                            
WARNING: at drivers/clk/clk.c:511 __clk_enable+0x98/0xa8()                      
Modules linked in:                                                              
[<c001a680>] (unwind_backtrace+0x0/0xf4) from [<c002452c>] (warn_slowpath_commo)
[<c002452c>] (warn_slowpath_common+0x48/0x60) from [<c0024560>] (warn_slowpath_)
[<c0024560>] (warn_slowpath_null+0x1c/0x24) from [<c02c4ec4>] (__clk_enable+0x9)
[<c02c4ec4>] (__clk_enable+0x98/0xa8) from [<c02c4ef8>] (clk_enable+0x24/0x5c)  
[<c02c4ef8>] (clk_enable+0x24/0x5c) from [<c027ac6c>] (imx_keypad_open+0x28/0xc)
[<c027ac6c>] (imx_keypad_open+0x28/0xc8) from [<c0274b14>] (input_open_device+0)
[<c0274b14>] (input_open_device+0x78/0xa8) from [<c01ec884>] (kbd_connect+0x60/)
[<c01ec884>] (kbd_connect+0x60/0x80) from [<c0273b94>] (input_attach_handler+0x)
[<c0273b94>] (input_attach_handler+0x220/0x258) from [<c02755d4>] (input_regist)
[<c02755d4>] (input_register_device+0x31c/0x390) from [<c038da1c>] (imx_keypad_)
[<c038da1c>] (imx_keypad_probe+0x2e4/0x3b8) from [<c020326c>] (platform_drv_pro)
[<c020326c>] (platform_drv_probe+0x18/0x1c) from [<c0201f64>] (driver_probe_dev)
[<c0201f64>] (driver_probe_device+0x84/0x210) from [<c020217c>] (__driver_attac)
[<c020217c>] (__driver_attach+0x8c/0x90) from [<c02008f8>] (bus_for_each_dev+0x)
[<c02008f8>] (bus_for_each_dev+0x68/0x90) from [<c0201064>] (bus_add_driver+0xa)
[<c0201064>] (bus_add_driver+0xa4/0x23c) from [<c020275c>] (driver_register+0x7)
[<c020275c>] (driver_register+0x78/0x12c) from [<c00087c0>] (do_one_initcall+0x)
[<c00087c0>] (do_one_initcall+0x34/0x188) from [<c04b9310>] (kernel_init+0xe4/0)
[<c04b9310>] (kernel_init+0xe4/0x1a8) from [<c0015bd8>] (kernel_thread_exit+0x0)
---[ end trace 1d550e891d03d7ce ]--- 

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Split the changes into 3 patches
- Handle the error code returne by clk_prepare_enable
- Do not convert to devm_clk_get

 drivers/input/keyboard/imx_keypad.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 6ee7421..9d57945 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -378,7 +378,7 @@ static void imx_keypad_close(struct input_dev *dev)
 	imx_keypad_inhibit(keypad);
 
 	/* Disable clock unit */
-	clk_disable(keypad->clk);
+	clk_disable_unprepare(keypad->clk);
 }
 
 static int imx_keypad_open(struct input_dev *dev)
@@ -391,7 +391,7 @@ static int imx_keypad_open(struct input_dev *dev)
 	keypad->enabled = true;
 
 	/* Enable the kpp clock */
-	clk_enable(keypad->clk);
+	clk_prepare_enable(keypad->clk);
 	imx_keypad_config(keypad);
 
 	/* Sanity control, not all the rows must be actived now. */
@@ -581,7 +581,7 @@ static int imx_kbd_suspend(struct device *dev)
 	mutex_lock(&input_dev->mutex);
 
 	if (input_dev->users)
-		clk_disable(kbd->clk);
+		clk_disable_unprepare(kbd->clk);
 
 	mutex_unlock(&input_dev->mutex);
 
@@ -603,7 +603,7 @@ static int imx_kbd_resume(struct device *dev)
 	mutex_lock(&input_dev->mutex);
 
 	if (input_dev->users)
-		clk_enable(kbd->clk);
+		clk_prepare_enable(kbd->clk);
 
 	mutex_unlock(&input_dev->mutex);
 
-- 
1.7.1



             reply	other threads:[~2012-07-06 17:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06 17:41 Fabio Estevam [this message]
2012-07-06 17:41 ` [PATCH v2 2/3] keyboard: imx_keypad: Adapt the new kpp clock name Fabio Estevam
2012-07-06 17:41 ` [PATCH v2 3/3] keyboard: imx_keypad: Check error returned by clk_prepare_enable() Fabio Estevam
2012-07-06 18:34   ` Dmitry Torokhov
2012-07-06 18:46     ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1341596514-15972-1-git-send-email-fabio.estevam@freescale.com \
    --to=fabio.estevam@freescale.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).