From patchwork Fri Apr 19 16:38:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 2466151 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E9806E01D7 for ; Fri, 19 Apr 2013 16:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030929Ab3DSQif (ORCPT ); Fri, 19 Apr 2013 12:38:35 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:36185 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030927Ab3DSQic (ORCPT ); Fri, 19 Apr 2013 12:38:32 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MLI00BAWGW63TU0@mailout3.samsung.com>; Sat, 20 Apr 2013 01:38:30 +0900 (KST) X-AuditID: cbfee61a-b7fa86d0000045ae-2c-517173059a4d Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 53.C0.17838.50371715; Sat, 20 Apr 2013 01:38:30 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MLI007XRGVRC400@mmp2.samsung.com>; Sat, 20 Apr 2013 01:38:29 +0900 (KST) From: Lukasz Majewski To: Kukjin Kim Cc: Mike Turquette , Zhang Rui , devicetree-discuss@lists.ozlabs.org, linux-samsung-soc@vger.kernel.org, Linux PM list , Amit Daniel Kachhap , Lukasz Majewski , Kyungmin Park Subject: [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit) Date: Fri, 19 Apr 2013 18:38:09 +0200 Message-id: <1366389493-8239-3-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1366389493-8239-1-git-send-email-l.majewski@samsung.com> References: <1366389493-8239-1-git-send-email-l.majewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHLMWRmVeSWpSXmKPExsVy+t9jQV224sJAg81/mCyWPJjCaHFg9kNW i94FV9kszja9Ybd483Azo8Xn3iOMFjPO72OyeDrhIpvFk4d9bA6cHov3vGTyuHNtD5vH+RkL GT36tqxi9Pi8SS6ANYrLJiU1J7MstUjfLoErY+fKqYwFHRIVjacnMjUwrhLpYuTkkBAwkTiy cQcjhC0mceHeerYuRi4OIYHpjBLbHn2EcrqYJBoa37KBVLEJ6El8vvuUCcQWEVCT6Fm8lRGk iFngNJPExNdLWUESwgI5Eif3vGIHsVkEVCXuLDoCFOfg4BVwlWhdxgqxTV7i6f0+sJmcAm4S /2a0gF0hBFTS/fQ48wRG3gWMDKsYRVMLkguKk9JzDfWKE3OLS/PS9ZLzczcxgkPtmdQOxpUN FocYBTgYlXh4PeIKA4VYE8uKK3MPMUpwMCuJ8C43AwrxpiRWVqUW5ccXleakFh9ilOZgURLn PdBqHSgkkJ5YkpqdmlqQWgSTZeLglGpg1F21ZP31/SlH5//ZPJPn33mDXW8NnSMXnWL06C6e cnATJ+tz2crw5cwdJ1X3Xf0Zce9T4TxxpVR+h1nWq9Y+3qtkEyJyTJRJlI/T6qa/zK/NsuEl z3RaF4lwqk10a+StlOPZ8m27778qJr/rDhXBKw8xdsU9DuXiLu8zPVOaPrs77GCvzgcVJZbi jERDLeai4kQAr+69XzECAAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch modifies exynos_thermal.c file to use clk_disable_unprepare() and clk_prepare_enable() instead of clk_{enable|disable}. Signed-off-by: Lukasz Majewski Signed-off-by: Kyungmin Park --- drivers/thermal/exynos_thermal.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c index 46568c0..ba6094c 100644 --- a/drivers/thermal/exynos_thermal.c +++ b/drivers/thermal/exynos_thermal.c @@ -584,7 +584,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) int ret = 0, threshold_code, i, trigger_levs = 0; mutex_lock(&data->lock); - clk_enable(data->clk); + clk_prepare_enable(data->clk); status = readb(data->base + EXYNOS_TMU_REG_STATUS); if (!status) { @@ -655,7 +655,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) data->base + EXYNOS_TMU_REG_INTCLEAR); } out: - clk_disable(data->clk); + clk_disable_unprepare(data->clk); mutex_unlock(&data->lock); return ret; @@ -668,7 +668,7 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on) unsigned int con, interrupt_en; mutex_lock(&data->lock); - clk_enable(data->clk); + clk_prepare_enable(data->clk); con = pdata->reference_voltage << EXYNOS_TMU_REF_VOLTAGE_SHIFT | pdata->gain << EXYNOS_TMU_GAIN_SHIFT; @@ -693,7 +693,7 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on) writel(interrupt_en, data->base + EXYNOS_TMU_REG_INTEN); writel(con, data->base + EXYNOS_TMU_REG_CONTROL); - clk_disable(data->clk); + clk_disable_unprepare(data->clk); mutex_unlock(&data->lock); } @@ -703,12 +703,12 @@ static int exynos_tmu_read(struct exynos_tmu_data *data) int temp; mutex_lock(&data->lock); - clk_enable(data->clk); + clk_prepare_enable(data->clk); temp_code = readb(data->base + EXYNOS_TMU_REG_CURRENT_TEMP); temp = code_to_temp(data, temp_code); - clk_disable(data->clk); + clk_disable_unprepare(data->clk); mutex_unlock(&data->lock); return temp; @@ -721,7 +721,7 @@ static void exynos_tmu_work(struct work_struct *work) exynos_report_trigger(); mutex_lock(&data->lock); - clk_enable(data->clk); + clk_prepare_enable(data->clk); if (data->soc == SOC_ARCH_EXYNOS) writel(EXYNOS_TMU_CLEAR_RISE_INT | EXYNOS_TMU_CLEAR_FALL_INT, @@ -729,7 +729,7 @@ static void exynos_tmu_work(struct work_struct *work) else writel(EXYNOS4210_TMU_INTCLEAR_VAL, data->base + EXYNOS_TMU_REG_INTCLEAR); - clk_disable(data->clk); + clk_disable_unprepare(data->clk); mutex_unlock(&data->lock); enable_irq(data->irq); @@ -985,7 +985,7 @@ static int exynos_tmu_probe(struct platform_device *pdev) return ret; } - data->clk = clk_get(NULL, "tmu_apbif"); + data->clk = clk_get(&pdev->dev, "tmu_apbif"); if (IS_ERR(data->clk)) { dev_err(&pdev->dev, "Failed to get clock\n"); return PTR_ERR(data->clk);