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: 15041 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1TORcC-0007Uy-O3 for patchwork@linuxtv.org; Wed, 17 Oct 2012 13:16:44 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp for id 1TORcB-0006oA-CT; Wed, 17 Oct 2012 13:16:44 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756266Ab2JQLQm (ORCPT ); Wed, 17 Oct 2012 07:16:42 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:42343 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756022Ab2JQLQl (ORCPT ); Wed, 17 Oct 2012 07:16:41 -0400 Received: by mail-pa0-f46.google.com with SMTP id hz1so6997024pad.19 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=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=NZ8mxG2JT/riY+sdp3zaGwuFMtFAAWqRFamPY+NX3C8=; b=Cx5pvDXaPC0e4O/K4UHOugCoeKvtglzwQFhKRuCIprcH1LS0mZomOGtKDFUdT5B3KP R8sTIShTEG3TB7yqVujbJ71Sx5lBBpbEZLi5LxEwOGzgaSj64PFopYJEcZlMlB9h3JjY Ki6rnPiinKNFYalPT6iPbayxJJKx3wV6+yMFkWmZtTmg/Bp17Wpk6P0+U40iJmwxOt1r 8mH32wGtY/GvJKGLcDxLWcFDwn/5fnf/3vTUIVV7LEIbeFdCBZipXmttN0PVeqqo7eCu 1j09ZSMY8IHxNqsqqb9VMCKJHJsrmVzzsMfEjAyKLaN88FqaNvMx0QE9GeSS4mYSek4p NaDg== 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: ALoCoQkJrrrz5whRuiXSMYanIVKTM8R0N2UsfIfU86UF14mHCAmmvf64KuhBSVbhodlGLwU1cYUL Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.10.17.110917 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_6000_6999 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __INT_PROD_TV 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' 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);