From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH 2/3] Input: spear-keyboard: Add clk_{un}prepare() support Date: Mon, 26 Nov 2012 08:56:09 -0800 Message-ID: <20121126165609.GC14623@core.coreip.homeip.net> References: <9f07bb7dbf29978970d901bbe89add0a333cc925.1352381962.git.viresh.kumar@linaro.org> <27d9eea3815593df228c85958096bc14d7985e7e.1352381962.git.viresh.kumar@linaro.org> <20121120084758.GA29199@core.coreip.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-pa0-f46.google.com ([209.85.220.46]:40206 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755109Ab2KZQ4P (ORCPT ); Mon, 26 Nov 2012 11:56:15 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Viresh Kumar Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, spear-devel@list.st.com, Vipul Kumar Samar On Mon, Nov 26, 2012 at 09:57:45PM +0530, Viresh Kumar wrote: > On 20 November 2012 14:17, Dmitry Torokhov wrote: > > No, not really, it just does not work well with devm_* patches that got > > applied: on removal you unprepare clock as the very first operation and > > then devm_* does the rest which is wrong order. > > > > I am looking at adding dem_* for clocks. > > I haven't seen your clock patch in your tree. I am asking because i want to > push this patch :) Yeah, I think I am not going to rush it and let it take its normal course instead of short-cutting through my tree. I am going to apply the patcch below in the meantime. Thanks. -- Dmitry Input: spear-keyboard - Add clk_{un}prepare() support From: Vipul Kumar Samar clk_{un}prepare is mandatory for platforms using common clock framework. Because for SPEAr we don't do anything in clk_{un}prepare() calls, just call them once in probe/remove. Signed-off-by: Vipul Kumar Samar Signed-off-by: Viresh Kumar Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/spear-keyboard.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index d70093b..695d237 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -267,9 +267,14 @@ static int spear_kbd_probe(struct platform_device *pdev) return error; } + error = clk_prepare(kbd->clk); + if (error) + return error; + error = input_register_device(input_dev); if (error) { dev_err(&pdev->dev, "Unable to register keyboard device\n"); + clk_unprepare(kbd->clk); return error; } @@ -281,6 +286,11 @@ static int spear_kbd_probe(struct platform_device *pdev) static int spear_kbd_remove(struct platform_device *pdev) { + struct spear_kbd *kbd = platform_get_drvdata(pdev); + + input_unregister_device(kbd->input); + clk_unprepare(kbd->clk); + device_init_wakeup(&pdev->dev, 0); platform_set_drvdata(pdev, NULL);