From patchwork Thu Nov 1 14:20:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 12647 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3234A23F9D for ; Thu, 1 Nov 2012 14:20:37 +0000 (UTC) Received: from mail-pb0-f52.google.com (mail-pb0-f52.google.com [209.85.160.52]) by fiordland.canonical.com (Postfix) with ESMTP id 9E62CA18AD3 for ; Thu, 1 Nov 2012 14:20:36 +0000 (UTC) Received: by mail-pb0-f52.google.com with SMTP id rr13so1698998pbb.11 for ; Thu, 01 Nov 2012 07:20:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:x-gm-message-state; bh=w907EAsfBFUViYcdBdvjnSq4xPmFzaA5IZ6lpj72u4A=; b=Cz+i4OLGxUcIpn1eLuGhSMDPCqDiJaLAihgCNMLLlAQ4ekMiceotFQBtso349G0Rt8 afdFT/aTmpdLRIlmVkkTCe/p04alquwoFH/ajDCSlx8vd3LeEISvMaladXWzvsEgfX7S bFAmqzOMmSY01gKSx9GyN6r3KXQb5qizKLzCRbOAEzPNb7k+Sqc5DcKdPJeOtoLMCdoU nYpYADEHZ4e9p6D0q0EN6u+/iluhHzMHKo/+AcklDDqhovvPC8l0h8Afl8UkloBiwooY /9Dy9B1qwhsP0NAUufDyjEqeqKJJhOZg/pElAvjAtogXf95AEobiHLv8Q0bws4kouIeP yaQQ== Received: by 10.66.89.98 with SMTP id bn2mr111345550pab.72.1351779635711; Thu, 01 Nov 2012 07:20:35 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.68.34.137 with SMTP id z9csp703524pbi; Thu, 1 Nov 2012 07:20:34 -0700 (PDT) Received: by 10.14.0.68 with SMTP id 44mr98769465eea.1.1351779633976; Thu, 01 Nov 2012 07:20:33 -0700 (PDT) Received: from eu1sys200aog111.obsmtp.com (eu1sys200aog111.obsmtp.com [207.126.144.131]) by mx.google.com with SMTP id f44si279515eep.83.2012.11.01.07.20.26 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Nov 2012 07:20:33 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.131 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.131; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.131 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob111.postini.com ([207.126.147.11]) with SMTP ID DSNKUJKFKhRnsBC1u1JeOAjo0xr9QQdPtCB1@postini.com; Thu, 01 Nov 2012 14:20:33 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id F1F8738B; Thu, 1 Nov 2012 14:20:16 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 443C5474F; Thu, 1 Nov 2012 14:20:16 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id C662A24C080; Thu, 1 Nov 2012 15:20:08 +0100 (CET) Received: from steludxu1397.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 1 Nov 2012 15:20:15 +0100 From: Ulf Hansson To: Dmitry Torokhov , , Cc: , Linus Walleij , Naveen Kumar Gaddipati , Ulf Hansson Subject: [PATCH 2/2] Input: nomadik-ske-keypad - start using the apb_pclk Date: Thu, 1 Nov 2012 15:20:02 +0100 Message-ID: <1351779602-13818-3-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1351779602-13818-1-git-send-email-ulf.hansson@stericsson.com> References: <1351779602-13818-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlPzrs4cEnBuNcbK+/IYuVVM4r6LGLycP1TMHeMqnaiAhwyMMn3YQJXPrdDk/XQHKSYg6+w From: Ulf Hansson Previously this clock was handled internally by the clockdriver, but now this is separate clk. So we need take care of it. Signed-off-by: Ulf Hansson --- drivers/input/keyboard/nomadik-ske-keypad.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c index 95dcc9b..a1a9375 100644 --- a/drivers/input/keyboard/nomadik-ske-keypad.c +++ b/drivers/input/keyboard/nomadik-ske-keypad.c @@ -67,6 +67,7 @@ struct ske_keypad { const struct ske_keypad_platform_data *board; unsigned short keymap[SKE_KPD_NUM_ROWS * SKE_KPD_NUM_COLS]; struct clk *clk; + struct clk *pclk; spinlock_t ske_keypad_lock; }; @@ -271,11 +272,18 @@ static int __init ske_keypad_probe(struct platform_device *pdev) goto err_free_mem_region; } + keypad->pclk = clk_get(&pdev->dev, "apb_pclk"); + if (IS_ERR(keypad->pclk)) { + dev_err(&pdev->dev, "failed to get pclk\n"); + error = PTR_ERR(keypad->pclk); + goto err_iounmap; + } + keypad->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(keypad->clk)) { dev_err(&pdev->dev, "failed to get clk\n"); error = PTR_ERR(keypad->clk); - goto err_iounmap; + goto err_pclk; } input->id.bustype = BUS_HOST; @@ -294,10 +302,16 @@ static int __init ske_keypad_probe(struct platform_device *pdev) if (!plat->no_autorepeat) __set_bit(EV_REP, input->evbit); + error = clk_prepare_enable(keypad->pclk); + if (error) { + dev_err(&pdev->dev, "Failed to prepare/enable pclk\n"); + goto err_clk; + } + error = clk_prepare_enable(keypad->clk); if (error) { dev_err(&pdev->dev, "Failed to prepare/enable clk\n"); - goto err_clk; + goto err_pclk_disable; } @@ -336,8 +350,12 @@ err_free_irq: free_irq(keypad->irq, keypad); err_clk_disable: clk_disable_unprepare(keypad->clk); +err_pclk_disable: + clk_disable_unprepare(keypad->pclk); err_clk: clk_put(keypad->clk); +err_pclk: + clk_put(keypad->pclk); err_iounmap: iounmap(keypad->reg_base); err_free_mem_region: