* [PATCH] input: samsung-keypad: add clk_prepare and clk_unprepare
@ 2012-10-02 23:31 Thomas Abraham
2012-10-04 7:25 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Abraham @ 2012-10-02 23:31 UTC (permalink / raw)
To: linux-input; +Cc: dmitry.torokhov, dtor, kgene.kim, linux-samsung-soc
Add calls to clk_prepare and clk_unprepare as required by commom clock
framework.
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
drivers/input/keyboard/samsung-keypad.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
index 277e26d..9d7a111 100644
--- a/drivers/input/keyboard/samsung-keypad.c
+++ b/drivers/input/keyboard/samsung-keypad.c
@@ -431,6 +431,12 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
goto err_unmap_base;
}
+ error = clk_prepare(keypad->clk);
+ if (error) {
+ dev_err(&pdev->dev, "keypad clock prepare failed\n");
+ goto err_put_clk;
+ }
+
keypad->input_dev = input_dev;
keypad->pdev = pdev;
keypad->row_shift = row_shift;
@@ -461,7 +467,7 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
keypad->keycodes, input_dev);
if (error) {
dev_err(&pdev->dev, "failed to build keymap\n");
- goto err_put_clk;
+ goto err_unprepare_clk;
}
input_set_capability(input_dev, EV_MSC, MSC_SCAN);
@@ -503,6 +509,8 @@ err_free_irq:
pm_runtime_disable(&pdev->dev);
device_init_wakeup(&pdev->dev, 0);
platform_set_drvdata(pdev, NULL);
+err_unprepare_clk:
+ clk_unprepare(keypad->clk);
err_put_clk:
clk_put(keypad->clk);
samsung_keypad_dt_gpio_free(keypad);
@@ -531,6 +539,7 @@ static int __devexit samsung_keypad_remove(struct platform_device *pdev)
*/
free_irq(keypad->irq, keypad);
+ clk_unprepare(keypad->clk);
clk_put(keypad->clk);
samsung_keypad_dt_gpio_free(keypad);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] input: samsung-keypad: add clk_prepare and clk_unprepare
2012-10-02 23:31 [PATCH] input: samsung-keypad: add clk_prepare and clk_unprepare Thomas Abraham
@ 2012-10-04 7:25 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2012-10-04 7:25 UTC (permalink / raw)
To: Thomas Abraham; +Cc: linux-input, kgene.kim, linux-samsung-soc
On Wed, Oct 03, 2012 at 08:31:52AM +0900, Thomas Abraham wrote:
> Add calls to clk_prepare and clk_unprepare as required by commom clock
> framework.
>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Applied, thank you Thomas.
> ---
> drivers/input/keyboard/samsung-keypad.c | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
> index 277e26d..9d7a111 100644
> --- a/drivers/input/keyboard/samsung-keypad.c
> +++ b/drivers/input/keyboard/samsung-keypad.c
> @@ -431,6 +431,12 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
> goto err_unmap_base;
> }
>
> + error = clk_prepare(keypad->clk);
> + if (error) {
> + dev_err(&pdev->dev, "keypad clock prepare failed\n");
> + goto err_put_clk;
> + }
> +
> keypad->input_dev = input_dev;
> keypad->pdev = pdev;
> keypad->row_shift = row_shift;
> @@ -461,7 +467,7 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
> keypad->keycodes, input_dev);
> if (error) {
> dev_err(&pdev->dev, "failed to build keymap\n");
> - goto err_put_clk;
> + goto err_unprepare_clk;
> }
>
> input_set_capability(input_dev, EV_MSC, MSC_SCAN);
> @@ -503,6 +509,8 @@ err_free_irq:
> pm_runtime_disable(&pdev->dev);
> device_init_wakeup(&pdev->dev, 0);
> platform_set_drvdata(pdev, NULL);
> +err_unprepare_clk:
> + clk_unprepare(keypad->clk);
> err_put_clk:
> clk_put(keypad->clk);
> samsung_keypad_dt_gpio_free(keypad);
> @@ -531,6 +539,7 @@ static int __devexit samsung_keypad_remove(struct platform_device *pdev)
> */
> free_irq(keypad->irq, keypad);
>
> + clk_unprepare(keypad->clk);
> clk_put(keypad->clk);
> samsung_keypad_dt_gpio_free(keypad);
>
> --
> 1.7.4.1
>
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-04 7:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02 23:31 [PATCH] input: samsung-keypad: add clk_prepare and clk_unprepare Thomas Abraham
2012-10-04 7:25 ` Dmitry Torokhov
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).