public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Figa <t.figa@samsung.com>
To: Mateusz Krawczuk <m.krawczuk@partner.samsung.com>
Cc: kyungmin.park@samsung.com, t.stanislaws@samsung.com,
	m.chehab@samsung.com, linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	rob.herring@calxeda.com, pawel.moll@arm.com,
	mark.rutland@arm.com, swarren@wwwdotorg.org,
	ian.campbell@citrix.com, rob@landley.net, mturquette@linaro.org,
	tomasz.figa@gmail.com, kgene.kim@samsung.com,
	thomas.abraham@linaro.org, s.nawrocki@samsung.com,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux@arm.linux.org.uk, ben-linux@fluff.org,
	linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH v3 3/6] media: s5p-tv: Fix sdo driver to work with CCF
Date: Thu, 29 Aug 2013 15:14:44 +0200	[thread overview]
Message-ID: <2653159.4aiM8FeBLq@amdc1227> (raw)
In-Reply-To: <1377706384-3697-4-git-send-email-m.krawczuk@partner.samsung.com>

Hi Mateusz,

On Wednesday 28 of August 2013 18:13:01 Mateusz Krawczuk wrote:
> Replace clk_enable by clock_enable_prepare and clk_disable with
> clk_disable_unprepare. Clock prepare is required by Clock Common
> Framework, and old clock driver didn`t support it. Without it Common
> Clock Framework prints a warning.
> 
> Signed-off-by: Mateusz Krawczuk <m.krawczuk@partner.samsung.com>
> ---
>  drivers/media/platform/s5p-tv/sdo_drv.c | 25 +++++++++++++++----------
>  1 file changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/media/platform/s5p-tv/sdo_drv.c
> b/drivers/media/platform/s5p-tv/sdo_drv.c index 9dbdfe6..a79e620 100644
> --- a/drivers/media/platform/s5p-tv/sdo_drv.c
> +++ b/drivers/media/platform/s5p-tv/sdo_drv.c
> @@ -209,10 +209,10 @@ 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);
> -	ret = clk_enable(sdev->dacphy);
> +	ret = clk_prepare_enable(sdev->dacphy);
>  	if (ret < 0) {
>  		dev_err(sdev->dev,
> -			"clk_enable(dacphy) failed !\n");
> +			"clk_prepare_enable(dacphy) failed !\n");

nit: I haven't noticed this when reviewing previous patch, but please tone 
down those errors messages a bit, by removing the exclamation mark (and the 
space before it). We shouldn't be shouting at users. ;)

>  		goto fail;
>  	}
>  	/* enable DAC */
> @@ -230,7 +230,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)
> @@ -274,7 +274,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;
>  }
> 
> @@ -286,7 +286,7 @@ static int sdo_runtime_resume(struct device *dev)
> 
>  	dev_info(dev, "resume\n");
> 
> -	ret = clk_enable(sdev->sclk_dac);
> +	ret = clk_prepare_enable(sdev->sclk_dac);
>  	if (ret < 0)
>  		return ret;
> 
> @@ -319,7 +319,7 @@ static int sdo_runtime_resume(struct device *dev)
>  vdac_r_dis:
>  	regulator_disable(sdev->vdac);
>  dac_clk_dis:
> -	clk_disable(sdev->sclk_dac);
> +	clk_disable_unprepare(sdev->sclk_dac);
>  	return ret;
>  }
> 
> @@ -333,7 +333,7 @@ static int sdo_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct sdo_device *sdev;
>  	struct resource *res;
> -	int ret = 0;
> +	int ret;

Hmm, this change doesn't look like belonging to this patch.

>  	struct clk *sclk_vpll;
> 
>  	dev_info(dev, "probe start\n");
> @@ -425,8 +425,13 @@ static int sdo_probe(struct platform_device *pdev)
>  	}
> 
>  	/* enable gate for dac clock, because mixer uses it */
> -	clk_enable(sdev->dac);
> -
> +	ret = clk_prepare_enable(sdev->dac);
> +	if (ret < 0) {
> +		dev_err(dev,
> +			"clk_prepare_enable_enable(dac) failed !\n");
> +		ret = PTR_ERR(sdev->dac);

Hmm, ret already contains the error value returned by clk_prepare_enable() 
here, so this looks like a copy paste error.

Best regards,
Tomasz

> +		goto fail_fout_vpll;
> +	}
>  	/* configure power management */
>  	pm_runtime_enable(dev);
> 
> @@ -464,7 +469,7 @@ static int 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);

  reply	other threads:[~2013-08-29 13:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 16:12 [PATCH v3 0/6] ARM: S5PV210: move to common clk framework Mateusz Krawczuk
2013-08-28 16:12 ` [PATCH v3 1/6] media: s5p-tv: Replace mxr_ macro by default dev_ Mateusz Krawczuk
2013-08-29 10:14   ` Tomasz Figa
2013-08-28 16:13 ` [PATCH v3 2/6] media: s5p-tv: Restore vpll clock rate Mateusz Krawczuk
2013-08-29 13:07   ` Tomasz Figa
2013-08-28 16:13 ` [PATCH v3 3/6] media: s5p-tv: Fix sdo driver to work with CCF Mateusz Krawczuk
2013-08-29 13:14   ` Tomasz Figa [this message]
2013-08-28 16:13 ` [PATCH v3 4/6] media: s5p-tv: Fix mixer " Mateusz Krawczuk
2013-08-29 13:17   ` Tomasz Figa
2013-08-28 16:13 ` [PATCH v3 5/6] clk: samsung: Add clock driver for s5pc110/s5pv210 Mateusz Krawczuk
2013-08-29 14:39   ` Tomasz Figa
2013-08-28 16:13 ` [PATCH v3 6/6] ARM: s5pv210: Migrate clock handling to Common Clock Framework Mateusz Krawczuk
2013-08-29 14:45   ` Tomasz Figa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2653159.4aiM8FeBLq@amdc1227 \
    --to=t.figa@samsung.com \
    --cc=ben-linux@fluff.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ian.campbell@citrix.com \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=m.chehab@samsung.com \
    --cc=m.krawczuk@partner.samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@linaro.org \
    --cc=pawel.moll@arm.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=s.nawrocki@samsung.com \
    --cc=swarren@wwwdotorg.org \
    --cc=t.stanislaws@samsung.com \
    --cc=thomas.abraham@linaro.org \
    --cc=tomasz.figa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox