public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: t.stanislaws@samsung.com (Tomasz Stanislawski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 2/4] media: s5p-tv: Restore vpll clock rate
Date: Wed, 25 Sep 2013 17:46:36 +0200	[thread overview]
Message-ID: <5243055C.7070205@samsung.com> (raw)
In-Reply-To: <1379775649-6331-3-git-send-email-m.krawczuk@partner.samsung.com>

Hi,

As you can see sdo, hdmi and mixer are saparate drivers that are
parts of s5p-tv drivers set. Could you rename commit name to
'media: s5p-tv: sdo: Restore vpll clock rate after streamoff'


On 09/21/2013 05:00 PM, Mateusz Krawczuk wrote:
> Restore vpll clock rate if start stream fail or stream is off.
> 
> Signed-off-by: Mateusz Krawczuk <m.krawczuk@partner.samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/media/platform/s5p-tv/sdo_drv.c | 23 +++++++++++++++++++++--
>  1 file changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/s5p-tv/sdo_drv.c b/drivers/media/platform/s5p-tv/sdo_drv.c
> index 0afa90f..e49ac6c 100644
> --- a/drivers/media/platform/s5p-tv/sdo_drv.c
> +++ b/drivers/media/platform/s5p-tv/sdo_drv.c
> @@ -55,6 +55,8 @@ struct sdo_device {
>  	struct clk *dacphy;
>  	/** clock for control of VPLL */
>  	struct clk *fout_vpll;
> +	/** vpll rate before sdo stream was on */
> +	unsigned long vpll_rate;
>  	/** regulator for SDO IP power */
>  	struct regulator *vdac;
>  	/** regulator for SDO plug detection */
> @@ -193,17 +195,33 @@ static int sdo_s_power(struct v4l2_subdev *sd, int on)
>  
>  static int sdo_streamon(struct sdo_device *sdev)
>  {
> +	int ret;
> +
>  	/* set proper clock for Timing Generator */
> -	clk_set_rate(sdev->fout_vpll, 54000000);
> +	sdev->vpll_rate = clk_get_rate(sdev->fout_vpll);
> +	ret = clk_set_rate(sdev->fout_vpll, 54000000);
> +	if (ret < 0) {
> +		dev_err(sdev->dev, "Failed to set vpll rate\n");
> +		return ret;
> +	}
>  	dev_info(sdev->dev, "fout_vpll.rate = %lu\n",

Could you also remove the line below in a new 'sdo: cleanup' patch?
Change dev_info to dev_dbg in the line above.

>  	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);
> +	ret = clk_enable(sdev->dacphy);
> +	if (ret < 0) {
> +		dev_err(sdev->dev, "clk_enable(dacphy) failed\n");
> +		goto fail;
> +	}
>  	/* enable DAC */
>  	sdo_write_mask(sdev, SDO_DAC, ~0, SDO_POWER_ON_DAC);
>  	sdo_reg_debug(sdev);
>  	return 0;
> +	
> +fail:
> +	sdo_write_mask(sdev, SDO_CLKCON, 0, SDO_TVOUT_CLOCK_ON);
> +	clk_set_rate(sdev->fout_vpll, sdev->vpll_rate);
> +	return ret;
>  }
>  
>  static int sdo_streamoff(struct sdo_device *sdev)
> @@ -220,6 +238,7 @@ static int sdo_streamoff(struct sdo_device *sdev)
>  	}
>  	if (tries == 0)
>  		dev_err(sdev->dev, "failed to stop streaming\n");

Produce some warning if the line below fails.

> +	clk_set_rate(sdev->fout_vpll, sdev->vpll_rate);
>  	return tries ? 0 : -EIO;
>  }
>  
> 

  reply	other threads:[~2013-09-25 15:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-21 15:00 [PATCH v5 0/4] media: s5p-tv: clean-up and fixes Mateusz Krawczuk
2013-09-21 15:00 ` [PATCH v5 1/4] media: s5p-tv: Replace mxr_ macro by default dev_ Mateusz Krawczuk
2013-09-23 14:50   ` Tomasz Stanislawski
2013-09-23 15:48     ` Bartlomiej Zolnierkiewicz
2013-09-23 17:44       ` Joe Perches
2013-09-24 12:52         ` Tomasz Stanislawski
2013-09-24 15:35           ` Bartlomiej Zolnierkiewicz
2013-09-24 16:24           ` Joe Perches
2013-09-24  9:43       ` Tomasz Stanislawski
2013-09-24 10:33         ` Bartlomiej Zolnierkiewicz
2013-09-24 13:02           ` Mauro Carvalho Chehab
2013-09-21 15:00 ` [PATCH v5 2/4] media: s5p-tv: Restore vpll clock rate Mateusz Krawczuk
2013-09-25 15:46   ` Tomasz Stanislawski [this message]
2013-10-12 10:06     ` Sylwester Nawrocki
2013-09-21 15:00 ` [PATCH v5 3/4] media: s5p-tv: Fix sdo driver to work with CCF Mateusz Krawczuk
2013-09-25 15:59   ` Tomasz Stanislawski
2013-10-12 10:25     ` Sylwester Nawrocki
2013-09-21 15:00 ` [PATCH v5 4/4] media: s5p-tv: Fix mixer " Mateusz Krawczuk
2013-09-23 12:44   ` Sylwester Nawrocki
2013-09-25 16:10     ` Tomasz Stanislawski
2013-09-25 16:09   ` Tomasz Stanislawski
2013-10-12 10:27     ` Sylwester Nawrocki
2013-09-23  3:52 ` [PATCH v5 0/4] media: s5p-tv: clean-up and fixes Sachin Kamat
2013-09-23 12:26 ` 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=5243055C.7070205@samsung.com \
    --to=t.stanislaws@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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