linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: davinci: vpif: add check for NULL handler
@ 2012-08-16 14:02 Prabhakar Lad
  2012-08-16 15:13 ` Laurent Pinchart
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Prabhakar Lad @ 2012-08-16 14:02 UTC (permalink / raw)
  To: LMML
  Cc: dlos, linux-kernel, Mauro Carvalho Chehab, Lad, Prabhakar,
	Manjunath Hadli, Hans Verkuil

From: Lad, Prabhakar <prabhakar.lad@ti.com>

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/video/davinci/vpif_capture.c |   12 +++++++-----
 drivers/media/video/davinci/vpif_display.c |   14 ++++++++------
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index 266025e..a87b7a5 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
 	}
 
 	/* configure 1 or 2 channel mode */
-	ret = vpif_config_data->setup_input_channel_mode
-					(vpif->std_info.ycmux_mode);
+	if (vpif_config_data->setup_input_channel_mode) {
+		ret = vpif_config_data->setup_input_channel_mode
+						(vpif->std_info.ycmux_mode);
 
-	if (ret < 0) {
-		vpif_dbg(1, debug, "can't set vpif channel mode\n");
-		return ret;
+		if (ret < 0) {
+			vpif_dbg(1, debug, "can't set vpif channel mode\n");
+			return ret;
+		}
 	}
 
 	/* Call vpif_set_params function to set the parameters and addresses */
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index e129c98..1e35f92 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
 	}
 
 	/* clock settings */
-	ret =
-	    vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
-					ch->vpifparams.std_info.hd_sd);
-	if (ret < 0) {
-		vpif_err("can't set clock\n");
-		return ret;
+	if (vpif_config_data->set_clock) {
+		ret =
+		vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
+						ch->vpifparams.std_info.hd_sd);
+		if (ret < 0) {
+			vpif_err("can't set clock\n");
+			return ret;
+		}
 	}
 
 	/* set the parameters and addresses */
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] media: davinci: vpif: add check for NULL handler
  2012-08-16 14:02 [PATCH] media: davinci: vpif: add check for NULL handler Prabhakar Lad
@ 2012-08-16 15:13 ` Laurent Pinchart
  2012-08-17  5:21   ` Prabhakar Lad
  2012-09-17 10:41 ` Hans Verkuil
  2012-09-26 20:07 ` Mauro Carvalho Chehab
  2 siblings, 1 reply; 10+ messages in thread
From: Laurent Pinchart @ 2012-08-16 15:13 UTC (permalink / raw)
  To: davinci-linux-open-source
  Cc: Prabhakar Lad, LMML, linux-kernel, Hans Verkuil,
	Mauro Carvalho Chehab

Hi Prabhakar,

Thanks for the patch.

On Thursday 16 August 2012 19:32:00 Prabhakar Lad wrote:
> From: Lad, Prabhakar <prabhakar.lad@ti.com>
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> ---
>  drivers/media/video/davinci/vpif_capture.c |   12 +++++++-----
>  drivers/media/video/davinci/vpif_display.c |   14 ++++++++------
>  2 files changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/media/video/davinci/vpif_capture.c
> b/drivers/media/video/davinci/vpif_capture.c index 266025e..a87b7a5 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
> unsigned int count) }
> 
>  	/* configure 1 or 2 channel mode */
> -	ret = vpif_config_data->setup_input_channel_mode
> -					(vpif->std_info.ycmux_mode);
> +	if (vpif_config_data->setup_input_channel_mode) {
> +		ret = vpif_config_data->setup_input_channel_mode
> +						(vpif->std_info.ycmux_mode);
> 
> -	if (ret < 0) {
> -		vpif_dbg(1, debug, "can't set vpif channel mode\n");
> -		return ret;
> +		if (ret < 0) {
> +			vpif_dbg(1, debug, "can't set vpif channel mode\n");
> +			return ret;
> +		}

This change looks good to me. However, note that you will need to get rid of 
board code callbacks at some point to implement device tree support. It would 
be worth thinking about how to do so now.

>  	}
> 
>  	/* Call vpif_set_params function to set the parameters and addresses */
> diff --git a/drivers/media/video/davinci/vpif_display.c
> b/drivers/media/video/davinci/vpif_display.c index e129c98..1e35f92 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
> unsigned int count) }
> 
>  	/* clock settings */
> -	ret =
> -	    vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
> -					ch->vpifparams.std_info.hd_sd);
> -	if (ret < 0) {
> -		vpif_err("can't set clock\n");
> -		return ret;
> +	if (vpif_config_data->set_clock) {

Does the DaVinci platform use the common clock framework ? If so, a better fix 
for this would be to pass a clock name through platform data instead of using 
a callback function.

> +		ret =
> +		vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
> +						ch->vpifparams.std_info.hd_sd);
> +		if (ret < 0) {
> +			vpif_err("can't set clock\n");
> +			return ret;
> +		}
>  	}
> 
>  	/* set the parameters and addresses */
-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] media: davinci: vpif: add check for NULL handler
  2012-08-16 15:13 ` Laurent Pinchart
@ 2012-08-17  5:21   ` Prabhakar Lad
  2012-08-17  5:37     ` Sekhar Nori
  0 siblings, 1 reply; 10+ messages in thread
From: Prabhakar Lad @ 2012-08-17  5:21 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: davinci-linux-open-source, LMML, linux-kernel, Hans Verkuil,
	Mauro Carvalho Chehab, Manjunath Hadli

Hi Laurent,

Thanks for the review.

On Thursday 16 August 2012 08:43 PM, Laurent Pinchart wrote:
> Hi Prabhakar,
> 
> Thanks for the patch.
> 
> On Thursday 16 August 2012 19:32:00 Prabhakar Lad wrote:
>> From: Lad, Prabhakar <prabhakar.lad@ti.com>
>>
>> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
>> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
>> Cc: Hans Verkuil <hans.verkuil@cisco.com>
>> ---
>>  drivers/media/video/davinci/vpif_capture.c |   12 +++++++-----
>>  drivers/media/video/davinci/vpif_display.c |   14 ++++++++------
>>  2 files changed, 15 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/media/video/davinci/vpif_capture.c
>> b/drivers/media/video/davinci/vpif_capture.c index 266025e..a87b7a5 100644
>> --- a/drivers/media/video/davinci/vpif_capture.c
>> +++ b/drivers/media/video/davinci/vpif_capture.c
>> @@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
>> unsigned int count) }
>>
>>  	/* configure 1 or 2 channel mode */
>> -	ret = vpif_config_data->setup_input_channel_mode
>> -					(vpif->std_info.ycmux_mode);
>> +	if (vpif_config_data->setup_input_channel_mode) {
>> +		ret = vpif_config_data->setup_input_channel_mode
>> +						(vpif->std_info.ycmux_mode);
>>
>> -	if (ret < 0) {
>> -		vpif_dbg(1, debug, "can't set vpif channel mode\n");
>> -		return ret;
>> +		if (ret < 0) {
>> +			vpif_dbg(1, debug, "can't set vpif channel mode\n");
>> +			return ret;
>> +		}
> 
> This change looks good to me. However, note that you will need to get rid of 
> board code callbacks at some point to implement device tree support. It would 
> be worth thinking about how to do so now.
> 
Currently VPIF driver is only used by dm646x, and the handlers for this
in the the board code are not null. This patch is intended for da850
where this handlers will be null.

>>  	}
>>
>>  	/* Call vpif_set_params function to set the parameters and addresses */
>> diff --git a/drivers/media/video/davinci/vpif_display.c
>> b/drivers/media/video/davinci/vpif_display.c index e129c98..1e35f92 100644
>> --- a/drivers/media/video/davinci/vpif_display.c
>> +++ b/drivers/media/video/davinci/vpif_display.c
>> @@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
>> unsigned int count) }
>>
>>  	/* clock settings */
>> -	ret =
>> -	    vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
>> -					ch->vpifparams.std_info.hd_sd);
>> -	if (ret < 0) {
>> -		vpif_err("can't set clock\n");
>> -		return ret;
>> +	if (vpif_config_data->set_clock) {
> 
> Does the DaVinci platform use the common clock framework ? If so, a better fix 
> for this would be to pass a clock name through platform data instead of using 
> a callback function.
> 
Currently DaVinci is not using the common clock framework.

Can you ACK this patch?

Thanks and Regards,
--Prabhakar

>> +		ret =
>> +		vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
>> +						ch->vpifparams.std_info.hd_sd);
>> +		if (ret < 0) {
>> +			vpif_err("can't set clock\n");
>> +			return ret;
>> +		}
>>  	}
>>
>>  	/* set the parameters and addresses */


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] media: davinci: vpif: add check for NULL handler
  2012-08-17  5:21   ` Prabhakar Lad
@ 2012-08-17  5:37     ` Sekhar Nori
  2012-08-17  8:32       ` Prabhakar Lad
  0 siblings, 1 reply; 10+ messages in thread
From: Sekhar Nori @ 2012-08-17  5:37 UTC (permalink / raw)
  To: Prabhakar Lad
  Cc: Laurent Pinchart, davinci-linux-open-source, linux-kernel,
	Mauro Carvalho Chehab, Hans Verkuil, LMML

On 8/17/2012 10:51 AM, Prabhakar Lad wrote:
> Hi Laurent,
> 
> Thanks for the review.
> 
> On Thursday 16 August 2012 08:43 PM, Laurent Pinchart wrote:
>> Hi Prabhakar,
>>
>> Thanks for the patch.
>>
>> On Thursday 16 August 2012 19:32:00 Prabhakar Lad wrote:
>>> From: Lad, Prabhakar <prabhakar.lad@ti.com>
>>>
>>> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
>>> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
>>> Cc: Hans Verkuil <hans.verkuil@cisco.com>
>>> ---
>>>  drivers/media/video/davinci/vpif_capture.c |   12 +++++++-----
>>>  drivers/media/video/davinci/vpif_display.c |   14 ++++++++------
>>>  2 files changed, 15 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/drivers/media/video/davinci/vpif_capture.c
>>> b/drivers/media/video/davinci/vpif_capture.c index 266025e..a87b7a5 100644
>>> --- a/drivers/media/video/davinci/vpif_capture.c
>>> +++ b/drivers/media/video/davinci/vpif_capture.c
>>> @@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
>>> unsigned int count) }
>>>
>>>  	/* configure 1 or 2 channel mode */
>>> -	ret = vpif_config_data->setup_input_channel_mode
>>> -					(vpif->std_info.ycmux_mode);
>>> +	if (vpif_config_data->setup_input_channel_mode) {
>>> +		ret = vpif_config_data->setup_input_channel_mode
>>> +						(vpif->std_info.ycmux_mode);
>>>
>>> -	if (ret < 0) {
>>> -		vpif_dbg(1, debug, "can't set vpif channel mode\n");
>>> -		return ret;
>>> +		if (ret < 0) {
>>> +			vpif_dbg(1, debug, "can't set vpif channel mode\n");
>>> +			return ret;
>>> +		}
>>
>> This change looks good to me. However, note that you will need to get rid of 
>> board code callbacks at some point to implement device tree support. It would 
>> be worth thinking about how to do so now.
>>
> Currently VPIF driver is only used by dm646x, and the handlers for this
> in the the board code are not null. This patch is intended for da850
> where this handlers will be null.
> 
>>>  	}
>>>
>>>  	/* Call vpif_set_params function to set the parameters and addresses */
>>> diff --git a/drivers/media/video/davinci/vpif_display.c
>>> b/drivers/media/video/davinci/vpif_display.c index e129c98..1e35f92 100644
>>> --- a/drivers/media/video/davinci/vpif_display.c
>>> +++ b/drivers/media/video/davinci/vpif_display.c
>>> @@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
>>> unsigned int count) }
>>>
>>>  	/* clock settings */
>>> -	ret =
>>> -	    vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
>>> -					ch->vpifparams.std_info.hd_sd);
>>> -	if (ret < 0) {
>>> -		vpif_err("can't set clock\n");
>>> -		return ret;
>>> +	if (vpif_config_data->set_clock) {
>>
>> Does the DaVinci platform use the common clock framework ? If so, a better fix 
>> for this would be to pass a clock name through platform data instead of using 
>> a callback function.
>>
> Currently DaVinci is not using the common clock framework.
> 
> Can you ACK this patch?

Yes, DaVinci has not migrated to common clock framework (yet). However,
even without that it should be possible to use clock API in driver code.
Using a callback to enable clocks or even passing the clock name from
platform data would be bypassing an existing framework. Clock name
should be IP specific, so it should be possible to use that in driver.

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] media: davinci: vpif: add check for NULL handler
  2012-08-17  5:37     ` Sekhar Nori
@ 2012-08-17  8:32       ` Prabhakar Lad
  2012-08-17  9:15         ` Laurent Pinchart
  0 siblings, 1 reply; 10+ messages in thread
From: Prabhakar Lad @ 2012-08-17  8:32 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: Laurent Pinchart, davinci-linux-open-source, linux-kernel,
	Mauro Carvalho Chehab, Hans Verkuil, LMML, Manjunath Hadli

Hi Sekhar,

On Friday 17 August 2012 11:07 AM, Sekhar Nori wrote:
> On 8/17/2012 10:51 AM, Prabhakar Lad wrote:
>> Hi Laurent,
>>
>> Thanks for the review.
>>
>> On Thursday 16 August 2012 08:43 PM, Laurent Pinchart wrote:
>>> Hi Prabhakar,
>>>
>>> Thanks for the patch.
>>>
>>> On Thursday 16 August 2012 19:32:00 Prabhakar Lad wrote:
>>>> From: Lad, Prabhakar <prabhakar.lad@ti.com>
>>>>
>>>> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
>>>> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
>>>> Cc: Hans Verkuil <hans.verkuil@cisco.com>
>>>> ---
>>>>  drivers/media/video/davinci/vpif_capture.c |   12 +++++++-----
>>>>  drivers/media/video/davinci/vpif_display.c |   14 ++++++++------
>>>>  2 files changed, 15 insertions(+), 11 deletions(-)
>>>>
>>>> diff --git a/drivers/media/video/davinci/vpif_capture.c
>>>> b/drivers/media/video/davinci/vpif_capture.c index 266025e..a87b7a5 100644
>>>> --- a/drivers/media/video/davinci/vpif_capture.c
>>>> +++ b/drivers/media/video/davinci/vpif_capture.c
>>>> @@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
>>>> unsigned int count) }
>>>>
>>>>  	/* configure 1 or 2 channel mode */
>>>> -	ret = vpif_config_data->setup_input_channel_mode
>>>> -					(vpif->std_info.ycmux_mode);
>>>> +	if (vpif_config_data->setup_input_channel_mode) {
>>>> +		ret = vpif_config_data->setup_input_channel_mode
>>>> +						(vpif->std_info.ycmux_mode);
>>>>
>>>> -	if (ret < 0) {
>>>> -		vpif_dbg(1, debug, "can't set vpif channel mode\n");
>>>> -		return ret;
>>>> +		if (ret < 0) {
>>>> +			vpif_dbg(1, debug, "can't set vpif channel mode\n");
>>>> +			return ret;
>>>> +		}
>>>
>>> This change looks good to me. However, note that you will need to get rid of 
>>> board code callbacks at some point to implement device tree support. It would 
>>> be worth thinking about how to do so now.
>>>
>> Currently VPIF driver is only used by dm646x, and the handlers for this
>> in the the board code are not null. This patch is intended for da850
>> where this handlers will be null.
>>
>>>>  	}
>>>>
>>>>  	/* Call vpif_set_params function to set the parameters and addresses */
>>>> diff --git a/drivers/media/video/davinci/vpif_display.c
>>>> b/drivers/media/video/davinci/vpif_display.c index e129c98..1e35f92 100644
>>>> --- a/drivers/media/video/davinci/vpif_display.c
>>>> +++ b/drivers/media/video/davinci/vpif_display.c
>>>> @@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue *vq,
>>>> unsigned int count) }
>>>>
>>>>  	/* clock settings */
>>>> -	ret =
>>>> -	    vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
>>>> -					ch->vpifparams.std_info.hd_sd);
>>>> -	if (ret < 0) {
>>>> -		vpif_err("can't set clock\n");
>>>> -		return ret;
>>>> +	if (vpif_config_data->set_clock) {
>>>
>>> Does the DaVinci platform use the common clock framework ? If so, a better fix 
>>> for this would be to pass a clock name through platform data instead of using 
>>> a callback function.
>>>
>> Currently DaVinci is not using the common clock framework.
>>
>> Can you ACK this patch?
> 
> Yes, DaVinci has not migrated to common clock framework (yet). However,
> even without that it should be possible to use clock API in driver code.
> Using a callback to enable clocks or even passing the clock name from
> platform data would be bypassing an existing framework. Clock name
> should be IP specific, so it should be possible to use that in driver.
> 
The callback is not actually dealing with PSC clock's but with system
module registers.

Thx,
--Prabhakar

> Thanks,
> Sekhar
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] media: davinci: vpif: add check for NULL handler
  2012-08-17  8:32       ` Prabhakar Lad
@ 2012-08-17  9:15         ` Laurent Pinchart
  2012-08-17  9:31           ` Sekhar Nori
  0 siblings, 1 reply; 10+ messages in thread
From: Laurent Pinchart @ 2012-08-17  9:15 UTC (permalink / raw)
  To: Prabhakar Lad
  Cc: Sekhar Nori, davinci-linux-open-source, linux-kernel,
	Mauro Carvalho Chehab, Hans Verkuil, LMML, Manjunath Hadli

Hi Prabhakar,

On Friday 17 August 2012 14:02:19 Prabhakar Lad wrote:
> On Friday 17 August 2012 11:07 AM, Sekhar Nori wrote:
> > On 8/17/2012 10:51 AM, Prabhakar Lad wrote:
> >> On Thursday 16 August 2012 08:43 PM, Laurent Pinchart wrote:
> >>> On Thursday 16 August 2012 19:32:00 Prabhakar Lad wrote:
> >>>> From: Lad, Prabhakar <prabhakar.lad@ti.com>
> >>>> 
> >>>> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
> >>>> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> >>>> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> >>>> ---
> >>>> 
> >>>>  drivers/media/video/davinci/vpif_capture.c |   12 +++++++-----
> >>>>  drivers/media/video/davinci/vpif_display.c |   14 ++++++++------
> >>>>  2 files changed, 15 insertions(+), 11 deletions(-)
> >>>> 
> >>>> diff --git a/drivers/media/video/davinci/vpif_capture.c
> >>>> b/drivers/media/video/davinci/vpif_capture.c index 266025e..a87b7a5
> >>>> 100644
> >>>> --- a/drivers/media/video/davinci/vpif_capture.c
> >>>> +++ b/drivers/media/video/davinci/vpif_capture.c
> >>>> @@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue
> >>>> *vq,
> >>>> unsigned int count) }
> >>>> 
> >>>>  	/* configure 1 or 2 channel mode */
> >>>> 
> >>>> -	ret = vpif_config_data->setup_input_channel_mode
> >>>> -					(vpif->std_info.ycmux_mode);
> >>>> +	if (vpif_config_data->setup_input_channel_mode) {
> >>>> +		ret = vpif_config_data->setup_input_channel_mode
> >>>> +						(vpif->std_info.ycmux_mode);
> >>>> 
> >>>> -	if (ret < 0) {
> >>>> -		vpif_dbg(1, debug, "can't set vpif channel mode\n");
> >>>> -		return ret;
> >>>> +		if (ret < 0) {
> >>>> +			vpif_dbg(1, debug, "can't set vpif channel mode\n");
> >>>> +			return ret;
> >>>> +		}
> >>> 
> >>> This change looks good to me. However, note that you will need to get
> >>> rid of board code callbacks at some point to implement device tree
> >>> support. It would be worth thinking about how to do so now.
> >> 
> >> Currently VPIF driver is only used by dm646x, and the handlers for this
> >> in the the board code are not null. This patch is intended for da850
> >> where this handlers will be null.
> >> 
> >>>>  	}
> >>>>  	
> >>>>  	/* Call vpif_set_params function to set the parameters and addresses
> >>>>  	*/
> >>>> 
> >>>> diff --git a/drivers/media/video/davinci/vpif_display.c
> >>>> b/drivers/media/video/davinci/vpif_display.c index e129c98..1e35f92
> >>>> 100644
> >>>> --- a/drivers/media/video/davinci/vpif_display.c
> >>>> +++ b/drivers/media/video/davinci/vpif_display.c
> >>>> @@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue
> >>>> *vq,
> >>>> unsigned int count) }
> >>>> 
> >>>>  	/* clock settings */
> >>>> 
> >>>> -	ret =
> >>>> -	    vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
> >>>> -					ch->vpifparams.std_info.hd_sd);
> >>>> -	if (ret < 0) {
> >>>> -		vpif_err("can't set clock\n");
> >>>> -		return ret;
> >>>> +	if (vpif_config_data->set_clock) {
> >>> 
> >>> Does the DaVinci platform use the common clock framework ? If so, a
> >>> better fix for this would be to pass a clock name through platform data
> >>> instead of using a callback function.
> >> 
> >> Currently DaVinci is not using the common clock framework.
> >> 
> >> Can you ACK this patch?
> > 
> > Yes, DaVinci has not migrated to common clock framework (yet). However,
> > even without that it should be possible to use clock API in driver code.
> > Using a callback to enable clocks or even passing the clock name from
> > platform data would be bypassing an existing framework. Clock name
> > should be IP specific, so it should be possible to use that in driver.
> 
> The callback is not actually dealing with PSC clock's but with system
> module registers.

Good to know. Then you'll have to create an API to expose the system module 
registers to drivers.

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] media: davinci: vpif: add check for NULL handler
  2012-08-17  9:15         ` Laurent Pinchart
@ 2012-08-17  9:31           ` Sekhar Nori
  0 siblings, 0 replies; 10+ messages in thread
From: Sekhar Nori @ 2012-08-17  9:31 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Prabhakar Lad, davinci-linux-open-source, linux-kernel,
	Mauro Carvalho Chehab, Hans Verkuil, LMML, Manjunath Hadli

On 8/17/2012 2:45 PM, Laurent Pinchart wrote:
> Hi Prabhakar,
> 
> On Friday 17 August 2012 14:02:19 Prabhakar Lad wrote:
>> On Friday 17 August 2012 11:07 AM, Sekhar Nori wrote:
>>> On 8/17/2012 10:51 AM, Prabhakar Lad wrote:
>>>> On Thursday 16 August 2012 08:43 PM, Laurent Pinchart wrote:
>>>>> On Thursday 16 August 2012 19:32:00 Prabhakar Lad wrote:
>>>>>> From: Lad, Prabhakar <prabhakar.lad@ti.com>
>>>>>>
>>>>>> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
>>>>>> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
>>>>>> Cc: Hans Verkuil <hans.verkuil@cisco.com>
>>>>>> ---
>>>>>>
>>>>>>  drivers/media/video/davinci/vpif_capture.c |   12 +++++++-----
>>>>>>  drivers/media/video/davinci/vpif_display.c |   14 ++++++++------
>>>>>>  2 files changed, 15 insertions(+), 11 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/media/video/davinci/vpif_capture.c
>>>>>> b/drivers/media/video/davinci/vpif_capture.c index 266025e..a87b7a5
>>>>>> 100644
>>>>>> --- a/drivers/media/video/davinci/vpif_capture.c
>>>>>> +++ b/drivers/media/video/davinci/vpif_capture.c
>>>>>> @@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue
>>>>>> *vq,
>>>>>> unsigned int count) }
>>>>>>
>>>>>>  	/* configure 1 or 2 channel mode */
>>>>>>
>>>>>> -	ret = vpif_config_data->setup_input_channel_mode
>>>>>> -					(vpif->std_info.ycmux_mode);
>>>>>> +	if (vpif_config_data->setup_input_channel_mode) {
>>>>>> +		ret = vpif_config_data->setup_input_channel_mode
>>>>>> +						(vpif->std_info.ycmux_mode);
>>>>>>
>>>>>> -	if (ret < 0) {
>>>>>> -		vpif_dbg(1, debug, "can't set vpif channel mode\n");
>>>>>> -		return ret;
>>>>>> +		if (ret < 0) {
>>>>>> +			vpif_dbg(1, debug, "can't set vpif channel mode\n");
>>>>>> +			return ret;
>>>>>> +		}
>>>>>
>>>>> This change looks good to me. However, note that you will need to get
>>>>> rid of board code callbacks at some point to implement device tree
>>>>> support. It would be worth thinking about how to do so now.
>>>>
>>>> Currently VPIF driver is only used by dm646x, and the handlers for this
>>>> in the the board code are not null. This patch is intended for da850
>>>> where this handlers will be null.
>>>>
>>>>>>  	}
>>>>>>  	
>>>>>>  	/* Call vpif_set_params function to set the parameters and addresses
>>>>>>  	*/
>>>>>>
>>>>>> diff --git a/drivers/media/video/davinci/vpif_display.c
>>>>>> b/drivers/media/video/davinci/vpif_display.c index e129c98..1e35f92
>>>>>> 100644
>>>>>> --- a/drivers/media/video/davinci/vpif_display.c
>>>>>> +++ b/drivers/media/video/davinci/vpif_display.c
>>>>>> @@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue
>>>>>> *vq,
>>>>>> unsigned int count) }
>>>>>>
>>>>>>  	/* clock settings */
>>>>>>
>>>>>> -	ret =
>>>>>> -	    vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
>>>>>> -					ch->vpifparams.std_info.hd_sd);
>>>>>> -	if (ret < 0) {
>>>>>> -		vpif_err("can't set clock\n");
>>>>>> -		return ret;
>>>>>> +	if (vpif_config_data->set_clock) {
>>>>>
>>>>> Does the DaVinci platform use the common clock framework ? If so, a
>>>>> better fix for this would be to pass a clock name through platform data
>>>>> instead of using a callback function.
>>>>
>>>> Currently DaVinci is not using the common clock framework.
>>>>
>>>> Can you ACK this patch?
>>>
>>> Yes, DaVinci has not migrated to common clock framework (yet). However,
>>> even without that it should be possible to use clock API in driver code.
>>> Using a callback to enable clocks or even passing the clock name from
>>> platform data would be bypassing an existing framework. Clock name
>>> should be IP specific, so it should be possible to use that in driver.
>>
>> The callback is not actually dealing with PSC clock's but with system
>> module registers.
> 
> Good to know. Then you'll have to create an API to expose the system module 
> registers to drivers.

Yes something like that is needed. Konstantin Baydarov is working on a
MFD driver for a similar module that exists in OMAP world called
"control module".

I guess this patch can go in though since it does not add any new
accesses but merely lets the existing function be passed as NULL.

Thanks,
Sekhar

[1] https://patchwork.kernel.org/patch/1236491/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] media: davinci: vpif: add check for NULL handler
  2012-08-16 14:02 [PATCH] media: davinci: vpif: add check for NULL handler Prabhakar Lad
  2012-08-16 15:13 ` Laurent Pinchart
@ 2012-09-17 10:41 ` Hans Verkuil
  2012-09-26 20:07 ` Mauro Carvalho Chehab
  2 siblings, 0 replies; 10+ messages in thread
From: Hans Verkuil @ 2012-09-17 10:41 UTC (permalink / raw)
  To: davinci-linux-open-source
  Cc: Prabhakar Lad, LMML, linux-kernel, Hans Verkuil,
	Mauro Carvalho Chehab

On Thu August 16 2012 16:02:00 Prabhakar Lad wrote:
> From: Lad, Prabhakar <prabhakar.lad@ti.com>
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> ---
>  drivers/media/video/davinci/vpif_capture.c |   12 +++++++-----
>  drivers/media/video/davinci/vpif_display.c |   14 ++++++++------
>  2 files changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
> index 266025e..a87b7a5 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
>  	}
>  
>  	/* configure 1 or 2 channel mode */
> -	ret = vpif_config_data->setup_input_channel_mode
> -					(vpif->std_info.ycmux_mode);
> +	if (vpif_config_data->setup_input_channel_mode) {
> +		ret = vpif_config_data->setup_input_channel_mode
> +						(vpif->std_info.ycmux_mode);
>  
> -	if (ret < 0) {
> -		vpif_dbg(1, debug, "can't set vpif channel mode\n");
> -		return ret;
> +		if (ret < 0) {
> +			vpif_dbg(1, debug, "can't set vpif channel mode\n");
> +			return ret;
> +		}
>  	}
>  
>  	/* Call vpif_set_params function to set the parameters and addresses */
> diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
> index e129c98..1e35f92 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
>  	}
>  
>  	/* clock settings */
> -	ret =
> -	    vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
> -					ch->vpifparams.std_info.hd_sd);
> -	if (ret < 0) {
> -		vpif_err("can't set clock\n");
> -		return ret;
> +	if (vpif_config_data->set_clock) {
> +		ret =
> +		vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
> +						ch->vpifparams.std_info.hd_sd);
> +		if (ret < 0) {
> +			vpif_err("can't set clock\n");
> +			return ret;
> +		}
>  	}
>  
>  	/* set the parameters and addresses */
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] media: davinci: vpif: add check for NULL handler
  2012-08-16 14:02 [PATCH] media: davinci: vpif: add check for NULL handler Prabhakar Lad
  2012-08-16 15:13 ` Laurent Pinchart
  2012-09-17 10:41 ` Hans Verkuil
@ 2012-09-26 20:07 ` Mauro Carvalho Chehab
  2012-09-27  5:21   ` Prabhakar Lad
  2 siblings, 1 reply; 10+ messages in thread
From: Mauro Carvalho Chehab @ 2012-09-26 20:07 UTC (permalink / raw)
  To: Prabhakar Lad; +Cc: LMML, dlos, linux-kernel, Manjunath Hadli, Hans Verkuil

Em Thu, 16 Aug 2012 19:32:00 +0530
Prabhakar Lad <prabhakar.lad@ti.com> escreveu:

It is amazing how many SOB's/acks are in this patch and nobody
asked you to provide a patch description... the subject just
tells what the code is also telling. Could you please provide
a better patch description?

Thanks!
Mauro

> From: Lad, Prabhakar <prabhakar.lad@ti.com>
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> ---
>  drivers/media/video/davinci/vpif_capture.c |   12 +++++++-----
>  drivers/media/video/davinci/vpif_display.c |   14 ++++++++------
>  2 files changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
> index 266025e..a87b7a5 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
>  	}
>  
>  	/* configure 1 or 2 channel mode */
> -	ret = vpif_config_data->setup_input_channel_mode
> -					(vpif->std_info.ycmux_mode);
> +	if (vpif_config_data->setup_input_channel_mode) {
> +		ret = vpif_config_data->setup_input_channel_mode
> +						(vpif->std_info.ycmux_mode);
>  
> -	if (ret < 0) {
> -		vpif_dbg(1, debug, "can't set vpif channel mode\n");
> -		return ret;
> +		if (ret < 0) {
> +			vpif_dbg(1, debug, "can't set vpif channel mode\n");
> +			return ret;
> +		}
>  	}
>  
>  	/* Call vpif_set_params function to set the parameters and addresses */
> diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
> index e129c98..1e35f92 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
>  	}
>  
>  	/* clock settings */
> -	ret =
> -	    vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
> -					ch->vpifparams.std_info.hd_sd);
> -	if (ret < 0) {
> -		vpif_err("can't set clock\n");
> -		return ret;
> +	if (vpif_config_data->set_clock) {
> +		ret =
> +		vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
> +						ch->vpifparams.std_info.hd_sd);
> +		if (ret < 0) {
> +			vpif_err("can't set clock\n");
> +			return ret;
> +		}
>  	}
>  
>  	/* set the parameters and addresses */




Cheers,
Mauro

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] media: davinci: vpif: add check for NULL handler
  2012-09-26 20:07 ` Mauro Carvalho Chehab
@ 2012-09-27  5:21   ` Prabhakar Lad
  0 siblings, 0 replies; 10+ messages in thread
From: Prabhakar Lad @ 2012-09-27  5:21 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Prabhakar Lad, LMML, dlos, linux-kernel, Manjunath Hadli,
	Hans Verkuil

Hi Mauro,

On Thu, Sep 27, 2012 at 1:37 AM, Mauro Carvalho Chehab
<mchehab@infradead.org> wrote:
> Em Thu, 16 Aug 2012 19:32:00 +0530
> Prabhakar Lad <prabhakar.lad@ti.com> escreveu:
>
> It is amazing how many SOB's/acks are in this patch and nobody
> asked you to provide a patch description... the subject just
> tells what the code is also telling. Could you please provide
> a better patch description?
>
My bad I'll post a v2.

Regards,
--Prabhakar Lad

> Thanks!
> Mauro
>
>> From: Lad, Prabhakar <prabhakar.lad@ti.com>
>>
>> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
>> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
>> Cc: Hans Verkuil <hans.verkuil@cisco.com>
>> ---
>>  drivers/media/video/davinci/vpif_capture.c |   12 +++++++-----
>>  drivers/media/video/davinci/vpif_display.c |   14 ++++++++------
>>  2 files changed, 15 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
>> index 266025e..a87b7a5 100644
>> --- a/drivers/media/video/davinci/vpif_capture.c
>> +++ b/drivers/media/video/davinci/vpif_capture.c
>> @@ -311,12 +311,14 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
>>       }
>>
>>       /* configure 1 or 2 channel mode */
>> -     ret = vpif_config_data->setup_input_channel_mode
>> -                                     (vpif->std_info.ycmux_mode);
>> +     if (vpif_config_data->setup_input_channel_mode) {
>> +             ret = vpif_config_data->setup_input_channel_mode
>> +                                             (vpif->std_info.ycmux_mode);
>>
>> -     if (ret < 0) {
>> -             vpif_dbg(1, debug, "can't set vpif channel mode\n");
>> -             return ret;
>> +             if (ret < 0) {
>> +                     vpif_dbg(1, debug, "can't set vpif channel mode\n");
>> +                     return ret;
>> +             }
>>       }
>>
>>       /* Call vpif_set_params function to set the parameters and addresses */
>> diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
>> index e129c98..1e35f92 100644
>> --- a/drivers/media/video/davinci/vpif_display.c
>> +++ b/drivers/media/video/davinci/vpif_display.c
>> @@ -280,12 +280,14 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
>>       }
>>
>>       /* clock settings */
>> -     ret =
>> -         vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
>> -                                     ch->vpifparams.std_info.hd_sd);
>> -     if (ret < 0) {
>> -             vpif_err("can't set clock\n");
>> -             return ret;
>> +     if (vpif_config_data->set_clock) {
>> +             ret =
>> +             vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode,
>> +                                             ch->vpifparams.std_info.hd_sd);
>> +             if (ret < 0) {
>> +                     vpif_err("can't set clock\n");
>> +                     return ret;
>> +             }
>>       }
>>
>>       /* set the parameters and addresses */
>
>
>
>
> Cheers,
> Mauro
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-09-27  5:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-16 14:02 [PATCH] media: davinci: vpif: add check for NULL handler Prabhakar Lad
2012-08-16 15:13 ` Laurent Pinchart
2012-08-17  5:21   ` Prabhakar Lad
2012-08-17  5:37     ` Sekhar Nori
2012-08-17  8:32       ` Prabhakar Lad
2012-08-17  9:15         ` Laurent Pinchart
2012-08-17  9:31           ` Sekhar Nori
2012-09-17 10:41 ` Hans Verkuil
2012-09-26 20:07 ` Mauro Carvalho Chehab
2012-09-27  5:21   ` Prabhakar Lad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).