From patchwork Wed Oct 17 11:11:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 12296 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 5A4A51D5170 for ; Wed, 17 Oct 2012 11:16:34 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id E0C53A18243 for ; Wed, 17 Oct 2012 11:16:33 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so5203519iag.11 for ; Wed, 17 Oct 2012 04:16:33 -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:x-gm-message-state; bh=KEq5aAljS0HUTLn5Zl2QZE1j0ige2wWVC4akA0fa31A=; b=DVFz9cmvq640+Hs/5y8YB203Fd1pHa6kAoFitI2rCNRuJzMO35Fg0IkLK5JxvGkN6k i7ABcc+JMO/fNaoKiLVft2ncAsRhVzzzuNKzkD2bgujy5bo/T3DZ/rIRH1IxILB6/gi9 m+Tf9J51ZEClGTIwujCrl4LHA1SRGRNLFensp5CaP1UIMiFGeH4oHBEFLf+n/yZlTDN0 5vxG5itSDvymwwe8DgK+W9DR3QEwphqcBNK45dDwVfeCkYFoUjHEUIerjO7nSzPSE7Dd 2xE7AVW8SD+pZJheF36J3Q34qMTeB7UKUKc8Pe4DjmL5J+8/IH1rczqPuZ6NMLF64QE6 Ua0w== Received: by 10.50.194.169 with SMTP id hx9mr1127147igc.70.1350472593279; Wed, 17 Oct 2012 04:16:33 -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.50.67.148 with SMTP id n20csp878421igt; Wed, 17 Oct 2012 04:16:32 -0700 (PDT) Received: by 10.68.235.106 with SMTP id ul10mr56017551pbc.83.1350472592432; Wed, 17 Oct 2012 04:16:32 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id vz2si30778301pbc.33.2012.10.17.04.16.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2012 04:16:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pb0-f50.google.com with SMTP id md4so7863362pbc.37 for ; Wed, 17 Oct 2012 04:16:32 -0700 (PDT) Received: by 10.66.80.65 with SMTP id p1mr49657937pax.20.1350472592062; Wed, 17 Oct 2012 04:16:32 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id vu7sm12365003pbc.9.2012.10.17.04.16.29 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2012 04:16:31 -0700 (PDT) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/8] [media] s5p-fimc: Use clk_prepare_enable and clk_disable_unprepare Date: Wed, 17 Oct 2012 16:41:44 +0530 Message-Id: <1350472311-9748-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQkDXTUxfH1ViF9M0aedofT+Xh7uTGUF8OmetrdeFf1nRh1UonCJ1jNM2l7p6GqI+R+3RD7n Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework. Signed-off-by: Sachin Kamat --- drivers/media/platform/s5p-fimc/fimc-core.c | 10 +++++----- drivers/media/platform/s5p-fimc/fimc-lite.c | 4 ++-- drivers/media/platform/s5p-fimc/fimc-mdevice.c | 4 ++-- drivers/media/platform/s5p-fimc/mipi-csis.c | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/s5p-fimc/fimc-core.c b/drivers/media/platform/s5p-fimc/fimc-core.c index 8d0d2b9..92308ba 100644 --- a/drivers/media/platform/s5p-fimc/fimc-core.c +++ b/drivers/media/platform/s5p-fimc/fimc-core.c @@ -827,7 +827,7 @@ static int fimc_clk_get(struct fimc_dev *fimc) fimc->clock[i] = clk_get(&fimc->pdev->dev, fimc_clocks[i]); if (IS_ERR(fimc->clock[i])) goto err; - ret = clk_prepare(fimc->clock[i]); + ret = clk_prepare_enable(fimc->clock[i]); if (ret < 0) { clk_put(fimc->clock[i]); fimc->clock[i] = NULL; @@ -925,7 +925,7 @@ static int fimc_probe(struct platform_device *pdev) if (ret) return ret; clk_set_rate(fimc->clock[CLK_BUS], drv_data->lclk_frequency); - clk_enable(fimc->clock[CLK_BUS]); + clk_prepare_enable(fimc->clock[CLK_BUS]); ret = devm_request_irq(&pdev->dev, res->start, fimc_irq_handler, 0, dev_name(&pdev->dev), fimc); @@ -970,7 +970,7 @@ static int fimc_runtime_resume(struct device *dev) dbg("fimc%d: state: 0x%lx", fimc->id, fimc->state); /* Enable clocks and perform basic initalization */ - clk_enable(fimc->clock[CLK_GATE]); + clk_prepare_enable(fimc->clock[CLK_GATE]); fimc_hw_reset(fimc); /* Resume the capture or mem-to-mem device */ @@ -990,7 +990,7 @@ static int fimc_runtime_suspend(struct device *dev) else ret = fimc_m2m_suspend(fimc); if (!ret) - clk_disable(fimc->clock[CLK_GATE]); + clk_disable_unprepare(fimc->clock[CLK_GATE]); dbg("fimc%d: state: 0x%lx", fimc->id, fimc->state); return ret; @@ -1045,7 +1045,7 @@ static int __devexit fimc_remove(struct platform_device *pdev) fimc_unregister_capture_subdev(fimc); vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx); - clk_disable(fimc->clock[CLK_BUS]); + clk_disable_unprepare(fimc->clock[CLK_BUS]); fimc_clk_put(fimc); dev_info(&pdev->dev, "driver unloaded\n"); diff --git a/drivers/media/platform/s5p-fimc/fimc-lite.c b/drivers/media/platform/s5p-fimc/fimc-lite.c index 70bcf39..4a12847 100644 --- a/drivers/media/platform/s5p-fimc/fimc-lite.c +++ b/drivers/media/platform/s5p-fimc/fimc-lite.c @@ -1479,7 +1479,7 @@ static int fimc_lite_runtime_resume(struct device *dev) { struct fimc_lite *fimc = dev_get_drvdata(dev); - clk_enable(fimc->clock); + clk_prepare_enable(fimc->clock); return 0; } @@ -1487,7 +1487,7 @@ static int fimc_lite_runtime_suspend(struct device *dev) { struct fimc_lite *fimc = dev_get_drvdata(dev); - clk_disable(fimc->clock); + clk_disable_unprepare(fimc->clock); return 0; } diff --git a/drivers/media/platform/s5p-fimc/fimc-mdevice.c b/drivers/media/platform/s5p-fimc/fimc-mdevice.c index 61fab00..e1f7cbe 100644 --- a/drivers/media/platform/s5p-fimc/fimc-mdevice.c +++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.c @@ -779,7 +779,7 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, if (camclk->use_count++ == 0) { clk_set_rate(camclk->clock, pdata->clk_frequency); camclk->frequency = pdata->clk_frequency; - ret = clk_enable(camclk->clock); + ret = clk_prepare_enable(camclk->clock); dbg("Enabled camclk %d: f: %lu", pdata->clk_id, clk_get_rate(camclk->clock)); } @@ -790,7 +790,7 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, return 0; if (--camclk->use_count == 0) { - clk_disable(camclk->clock); + clk_disable_unprepare(camclk->clock); dbg("Disabled camclk %d", pdata->clk_id); } return ret; diff --git a/drivers/media/platform/s5p-fimc/mipi-csis.c b/drivers/media/platform/s5p-fimc/mipi-csis.c index 4c961b1..f02c95b 100644 --- a/drivers/media/platform/s5p-fimc/mipi-csis.c +++ b/drivers/media/platform/s5p-fimc/mipi-csis.c @@ -710,7 +710,7 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev) if (ret) goto e_clkput; - clk_enable(state->clock[CSIS_CLK_MUX]); + clk_prepare_enable(state->clock[CSIS_CLK_MUX]); if (pdata->clk_rate) clk_set_rate(state->clock[CSIS_CLK_MUX], pdata->clk_rate); else @@ -754,7 +754,7 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev) e_regput: regulator_bulk_free(CSIS_NUM_SUPPLIES, state->supplies); e_clkput: - clk_disable(state->clock[CSIS_CLK_MUX]); + clk_disable_unprepare(state->clock[CSIS_CLK_MUX]); s5pcsis_clk_put(state); return ret; } @@ -779,7 +779,7 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime) state->supplies); if (ret) goto unlock; - clk_disable(state->clock[CSIS_CLK_GATE]); + clk_disable_unprepare(state->clock[CSIS_CLK_GATE]); state->flags &= ~ST_POWERED; if (!runtime) state->flags |= ST_SUSPENDED; @@ -816,7 +816,7 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime) state->supplies); goto unlock; } - clk_enable(state->clock[CSIS_CLK_GATE]); + clk_prepare_enable(state->clock[CSIS_CLK_GATE]); } if (state->flags & ST_STREAMING) s5pcsis_start_stream(state); @@ -858,7 +858,7 @@ static int __devexit s5pcsis_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); s5pcsis_pm_suspend(&pdev->dev, false); - clk_disable(state->clock[CSIS_CLK_MUX]); + clk_disable_unprepare(state->clock[CSIS_CLK_MUX]); pm_runtime_set_suspended(&pdev->dev); s5pcsis_clk_put(state); regulator_bulk_free(CSIS_NUM_SUPPLIES, state->supplies);