From patchwork Thu Nov 8 13:40:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 1715911 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AFF8E3FD2B for ; Thu, 8 Nov 2012 13:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755408Ab2KHNmS (ORCPT ); Thu, 8 Nov 2012 08:42:18 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:64060 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755405Ab2KHNmR (ORCPT ); Thu, 8 Nov 2012 08:42:17 -0500 Received: by mail-pa0-f46.google.com with SMTP id hz1so1994438pad.19 for ; Thu, 08 Nov 2012 05:42:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=E41ViliBjnkXqcVvkC1PnFBFX4ktEwIsHb18n5qO8MY=; b=HHzgWWAusufOvU1w3CZTAL1i1ZDcqWAdQGk8lgM59n/F/tk3/lpJq1LtZOnLzDB2Xe eWkLcjEKen8Wausv+HQxLXB6QG3E/xLn35JvH1Ip9jK05MnByJRDXeY8PgwaR6q0yszX WQyacB5Ez69bMDVdJbBB98t7c3MHpyJLpKIDKR5dFwK5KBnCJOhs+ofvxF0fGiI9j9AT m4wT5fEX9opjUKTO45V0VQOKRmHbWhPQxHq3mXYaUH7+jd6PNfcPtANH8u468C7z9K6d N2Gfc5rRrPxnAVgWcYEGvM8Va2C9YiPnPgXihNbN4MYZr3BZGT6ZVuDiAa5KXoeDhwSo Zu2A== Received: by 10.68.225.3 with SMTP id rg3mr24342930pbc.27.1352382137414; Thu, 08 Nov 2012 05:42:17 -0800 (PST) Received: from localhost ([122.167.75.112]) by mx.google.com with ESMTPS id pw2sm15963019pbb.59.2012.11.08.05.42.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Nov 2012 05:42:16 -0800 (PST) From: Viresh Kumar To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, spear-devel@list.st.com, Vipul Kumar Samar , Viresh Kumar Subject: [PATCH 2/3] Input: spear-keyboard: Add clk_{un}prepare() support Date: Thu, 8 Nov 2012 19:10:48 +0530 Message-Id: <27d9eea3815593df228c85958096bc14d7985e7e.1352381962.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: <9f07bb7dbf29978970d901bbe89add0a333cc925.1352381962.git.viresh.kumar@linaro.org> References: <9f07bb7dbf29978970d901bbe89add0a333cc925.1352381962.git.viresh.kumar@linaro.org> In-Reply-To: <9f07bb7dbf29978970d901bbe89add0a333cc925.1352381962.git.viresh.kumar@linaro.org> References: <9f07bb7dbf29978970d901bbe89add0a333cc925.1352381962.git.viresh.kumar@linaro.org> X-Gm-Message-State: ALoCoQmUolNm3aEpljVM0aqp8wAETQqjFg87B5llVXF34piHTYXqXT5UALwP7DCIamRdZqXZ29Vv Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 ones in probe/remove. Signed-off-by: Vipul Kumar Samar Signed-off-by: Viresh Kumar --- drivers/input/keyboard/spear-keyboard.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index 1d24fb2..9792924 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -245,6 +245,10 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev) goto err_free_mem; } + error = clk_prepare(kbd->clk); + if (error) + goto err_free_mem; + input_dev->name = "Spear Keyboard"; input_dev->phys = "keyboard/input0"; input_dev->dev.parent = &pdev->dev; @@ -259,7 +263,7 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev) kbd->keycodes, input_dev); if (error) { dev_err(&pdev->dev, "Failed to build keymap\n"); - goto err_free_mem; + goto err_unprepare_clk; } if (kbd->rep) @@ -272,13 +276,13 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev) "keyboard", kbd); if (error) { dev_err(&pdev->dev, "request_irq fail\n"); - goto err_free_mem; + goto err_unprepare_clk; } error = input_register_device(input_dev); if (error) { dev_err(&pdev->dev, "Unable to register keyboard device\n"); - goto err_free_mem; + goto err_unprepare_clk; } device_init_wakeup(&pdev->dev, 1); @@ -286,6 +290,8 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev) return 0; +err_unprepare_clk: + clk_unprepare(kbd->clk); err_free_mem: input_free_device(input_dev); @@ -297,6 +303,7 @@ static int __devexit 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);