From patchwork Wed Oct 17 11:11:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 12299 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 7507A1D5170 for ; Wed, 17 Oct 2012 11:16:42 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 096F7A184CA for ; Wed, 17 Oct 2012 11:16:41 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so11154661iej.11 for ; Wed, 17 Oct 2012 04:16:41 -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 :x-gm-message-state; bh=NZ8mxG2JT/riY+sdp3zaGwuFMtFAAWqRFamPY+NX3C8=; b=E+zXaHnq863G/rhHh/N1u3n+ClZ0lKEYABrPHGFlVVj1C7Y7SazzfHA4KuUqpcu827 D3HANmctdYmWzShtmZDsF/BhQSSk29kUPK6xphbXJKSgCM19vVDV+GAyTwUhlA7U5dNT Jta7y4UcK98UEg1H2cZfAdeLNbhUfUuA5zKn3wENP8fSd7xa6Y65IWKnfapn8rIy/s9t fCsB6H1UvqU8ufoPhpgDmXMxGX4ntyuO/NK63FiqE3J0M7h8bICf21jeTHwOYWfaPE31 OGeIuHdiBiUefPG6WJOx+pdanSEkF6qSbpesI/g7g5Qq86J3FOb9hIwvjcVpsI6kc3X6 rJBA== Received: by 10.50.168.37 with SMTP id zt5mr1145225igb.57.1350472601726; Wed, 17 Oct 2012 04:16:41 -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 n20csp878436igt; Wed, 17 Oct 2012 04:16:41 -0700 (PDT) Received: by 10.66.85.227 with SMTP id k3mr49440038paz.79.1350472601165; Wed, 17 Oct 2012 04:16:41 -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.41 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2012 04:16:41 -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:41 -0700 (PDT) Received: by 10.66.73.6 with SMTP id h6mr49692150pav.69.1350472600869; Wed, 17 Oct 2012 04:16:40 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id vu7sm12365003pbc.9.2012.10.17.04.16.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2012 04:16:40 -0700 (PDT) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org, Tomasz Stanislawski Subject: [PATCH 4/8] [media] s5p-tv: Use clk_prepare_enable and clk_disable_unprepare Date: Wed, 17 Oct 2012 16:41:47 +0530 Message-Id: <1350472311-9748-4-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1350472311-9748-1-git-send-email-sachin.kamat@linaro.org> References: <1350472311-9748-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQnqP+IhXgDxTQLtBMfVpw7aWMO6RzHb9+/WD5gceoXANo3/pqwdslAcrcQk40Ixa5miRsYU Replace clk_enable/clk_disable with clk_prepare_enable/clk_disable_unprepare as required by the common clock framework. Signed-off-by: Sachin Kamat Cc: Tomasz Stanislawski --- drivers/media/platform/s5p-tv/hdmi_drv.c | 20 ++++++++++---------- drivers/media/platform/s5p-tv/mixer_drv.c | 12 ++++++------ drivers/media/platform/s5p-tv/sdo_drv.c | 12 ++++++------ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/media/platform/s5p-tv/hdmi_drv.c b/drivers/media/platform/s5p-tv/hdmi_drv.c index 8a9cf43..497e8ab 100644 --- a/drivers/media/platform/s5p-tv/hdmi_drv.c +++ b/drivers/media/platform/s5p-tv/hdmi_drv.c @@ -542,9 +542,9 @@ static int hdmi_streamon(struct hdmi_device *hdev) } /* hdmiphy clock is used for HDMI in streaming mode */ - clk_disable(res->sclk_hdmi); + clk_disable_unprepare(res->sclk_hdmi); clk_set_parent(res->sclk_hdmi, res->sclk_hdmiphy); - clk_enable(res->sclk_hdmi); + clk_prepare_enable(res->sclk_hdmi); /* enable HDMI and timing generator */ hdmi_write_mask(hdev, HDMI_CON_0, ~0, HDMI_EN); @@ -564,9 +564,9 @@ static int hdmi_streamoff(struct hdmi_device *hdev) hdmi_write_mask(hdev, HDMI_TG_CMD, 0, HDMI_TG_EN); /* pixel(vpll) clock is used for HDMI in config mode */ - clk_disable(res->sclk_hdmi); + clk_disable_unprepare(res->sclk_hdmi); clk_set_parent(res->sclk_hdmi, res->sclk_pixel); - clk_enable(res->sclk_hdmi); + clk_prepare_enable(res->sclk_hdmi); v4l2_subdev_call(hdev->mhl_sd, video, s_stream, 0); v4l2_subdev_call(hdev->phy_sd, video, s_stream, 0); @@ -591,19 +591,19 @@ static void hdmi_resource_poweron(struct hdmi_resources *res) /* turn HDMI power on */ regulator_bulk_enable(res->regul_count, res->regul_bulk); /* power-on hdmi physical interface */ - clk_enable(res->hdmiphy); + clk_prepare_enable(res->hdmiphy); /* use VPP as parent clock; HDMIPHY is not working yet */ clk_set_parent(res->sclk_hdmi, res->sclk_pixel); /* turn clocks on */ - clk_enable(res->sclk_hdmi); + clk_prepare_enable(res->sclk_hdmi); } static void hdmi_resource_poweroff(struct hdmi_resources *res) { /* turn clocks off */ - clk_disable(res->sclk_hdmi); + clk_disable_unprepare(res->sclk_hdmi); /* power-off hdmiphy */ - clk_disable(res->hdmiphy); + clk_disable_unprepare(res->hdmiphy); /* turn HDMI power off */ regulator_bulk_disable(res->regul_count, res->regul_bulk); } @@ -947,7 +947,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) } } - clk_enable(hdmi_dev->res.hdmi); + clk_prepare_enable(hdmi_dev->res.hdmi); pm_runtime_enable(dev); @@ -986,7 +986,7 @@ static int __devexit hdmi_remove(struct platform_device *pdev) struct hdmi_device *hdmi_dev = sd_to_hdmi_dev(sd); pm_runtime_disable(dev); - clk_disable(hdmi_dev->res.hdmi); + clk_disable_unprepare(hdmi_dev->res.hdmi); v4l2_device_unregister(&hdmi_dev->v4l2_dev); disable_irq(hdmi_dev->irq); hdmi_resources_cleanup(hdmi_dev); diff --git a/drivers/media/platform/s5p-tv/mixer_drv.c b/drivers/media/platform/s5p-tv/mixer_drv.c index ca0f297..dea0520 100644 --- a/drivers/media/platform/s5p-tv/mixer_drv.c +++ b/drivers/media/platform/s5p-tv/mixer_drv.c @@ -339,9 +339,9 @@ static int mxr_runtime_resume(struct device *dev) mxr_dbg(mdev, "resume - start\n"); mutex_lock(&mdev->mutex); /* turn clocks on */ - clk_enable(res->mixer); - clk_enable(res->vp); - clk_enable(res->sclk_mixer); + clk_prepare_enable(res->mixer); + clk_prepare_enable(res->vp); + clk_prepare_enable(res->sclk_mixer); /* apply default configuration */ mxr_reg_reset(mdev); mxr_dbg(mdev, "resume - finished\n"); @@ -357,9 +357,9 @@ static int mxr_runtime_suspend(struct device *dev) mxr_dbg(mdev, "suspend - start\n"); mutex_lock(&mdev->mutex); /* turn clocks off */ - clk_disable(res->sclk_mixer); - clk_disable(res->vp); - clk_disable(res->mixer); + clk_disable_unprepare(res->sclk_mixer); + clk_disable_unprepare(res->vp); + clk_disable_unprepare(res->mixer); mutex_unlock(&mdev->mutex); mxr_dbg(mdev, "suspend - finished\n"); return 0; diff --git a/drivers/media/platform/s5p-tv/sdo_drv.c b/drivers/media/platform/s5p-tv/sdo_drv.c index ad68bbe..21d213a 100644 --- a/drivers/media/platform/s5p-tv/sdo_drv.c +++ b/drivers/media/platform/s5p-tv/sdo_drv.c @@ -199,7 +199,7 @@ static int sdo_streamon(struct sdo_device *sdev) clk_get_rate(sdev->fout_vpll)); /* enable clock in SDO */ sdo_write_mask(sdev, SDO_CLKCON, ~0, SDO_TVOUT_CLOCK_ON); - clk_enable(sdev->dacphy); + clk_prepare_enable(sdev->dacphy); /* enable DAC */ sdo_write_mask(sdev, SDO_DAC, ~0, SDO_POWER_ON_DAC); sdo_reg_debug(sdev); @@ -211,7 +211,7 @@ static int sdo_streamoff(struct sdo_device *sdev) int tries; sdo_write_mask(sdev, SDO_DAC, 0, SDO_POWER_ON_DAC); - clk_disable(sdev->dacphy); + clk_disable_unprepare(sdev->dacphy); sdo_write_mask(sdev, SDO_CLKCON, 0, SDO_TVOUT_CLOCK_ON); for (tries = 100; tries; --tries) { if (sdo_read(sdev, SDO_CLKCON) & SDO_TVOUT_CLOCK_READY) @@ -254,7 +254,7 @@ static int sdo_runtime_suspend(struct device *dev) dev_info(dev, "suspend\n"); regulator_disable(sdev->vdet); regulator_disable(sdev->vdac); - clk_disable(sdev->sclk_dac); + clk_disable_unprepare(sdev->sclk_dac); return 0; } @@ -264,7 +264,7 @@ static int sdo_runtime_resume(struct device *dev) struct sdo_device *sdev = sd_to_sdev(sd); dev_info(dev, "resume\n"); - clk_enable(sdev->sclk_dac); + clk_prepare_enable(sdev->sclk_dac); regulator_enable(sdev->vdac); regulator_enable(sdev->vdet); @@ -386,7 +386,7 @@ static int __devinit sdo_probe(struct platform_device *pdev) } /* enable gate for dac clock, because mixer uses it */ - clk_enable(sdev->dac); + clk_prepare_enable(sdev->dac); /* configure power management */ pm_runtime_enable(dev); @@ -425,7 +425,7 @@ static int __devexit sdo_remove(struct platform_device *pdev) struct sdo_device *sdev = sd_to_sdev(sd); pm_runtime_disable(&pdev->dev); - clk_disable(sdev->dac); + clk_disable_unprepare(sdev->dac); clk_put(sdev->fout_vpll); clk_put(sdev->dacphy); clk_put(sdev->dac);