public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
@ 2011-02-25  6:21 Kim, HeungJun
  2011-02-25  9:20 ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: Kim, HeungJun @ 2011-02-25  6:21 UTC (permalink / raw)
  To: linux-media@vger.kernel.org
  Cc: Hans Verkuil, Laurent Pinchart, Sylwester Nawrocki,
	kyungmin.park@samsung.com

As following to change the boolean type of V4L2_CID_FOCUS_AUTO to menu type,
this uvc is modified the usage of V4L2_CID_FOCUS_AUTO.

Signed-off-by: Heungjun Kim <riverful.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/media/video/uvc/uvc_ctrl.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
index 59f8a9a..795fd3f 100644
--- a/drivers/media/video/uvc/uvc_ctrl.c
+++ b/drivers/media/video/uvc/uvc_ctrl.c
@@ -333,6 +333,11 @@ static struct uvc_menu_info exposure_auto_controls[] = {
 	{ 8, "Aperture Priority Mode" },
 };
 
+static struct uvc_menu_info focus_auto_controls[] = {
+	{ 2, "Auto Mode" },
+	{ 1, "Manual Mode" },
+};
+
 static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
 	__u8 query, const __u8 *data)
 {
@@ -558,10 +563,12 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
 		.name		= "Focus, Auto",
 		.entity		= UVC_GUID_UVC_CAMERA,
 		.selector	= UVC_CT_FOCUS_AUTO_CONTROL,
-		.size		= 1,
+		.size		= 2,
 		.offset		= 0,
-		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
-		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
+		.v4l2_type	= V4L2_CTRL_TYPE_MENU,
+		.data_type	= UVC_CTRL_DATA_TYPE_BITMASK,
+		.menu_info	= focus_auto_controls,
+		.menu_count	= ARRAY_SIZE(focus_auto_controls),
 	},
 	{
 		.id		= V4L2_CID_IRIS_ABSOLUTE,
-- 
1.7.0.4

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

* Re: [RFC PATCH v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
  2011-02-25  6:21 [RFC PATCH v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO Kim, HeungJun
@ 2011-02-25  9:20 ` Laurent Pinchart
  2011-02-25 10:18   ` Kim, HeungJun
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2011-02-25  9:20 UTC (permalink / raw)
  To: riverful.kim
  Cc: linux-media@vger.kernel.org, Hans Verkuil, Sylwester Nawrocki,
	kyungmin.park@samsung.com

On Friday 25 February 2011 07:21:32 Kim, HeungJun wrote:
> As following to change the boolean type of V4L2_CID_FOCUS_AUTO to menu
> type, this uvc is modified the usage of V4L2_CID_FOCUS_AUTO.
> 
> Signed-off-by: Heungjun Kim <riverful.kim@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/media/video/uvc/uvc_ctrl.c |   13 ++++++++++---
>  1 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/video/uvc/uvc_ctrl.c
> b/drivers/media/video/uvc/uvc_ctrl.c index 59f8a9a..795fd3f 100644
> --- a/drivers/media/video/uvc/uvc_ctrl.c
> +++ b/drivers/media/video/uvc/uvc_ctrl.c
> @@ -333,6 +333,11 @@ static struct uvc_menu_info exposure_auto_controls[] =
> { { 8, "Aperture Priority Mode" },
>  };
> 
> +static struct uvc_menu_info focus_auto_controls[] = {
> +	{ 2, "Auto Mode" },
> +	{ 1, "Manual Mode" },

According to the UVC spec, this should be 0 for manual mode and 1 for auto 
mode.

> +};
> +
>  static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
>  	__u8 query, const __u8 *data)
>  {
> @@ -558,10 +563,12 @@ static struct uvc_control_mapping uvc_ctrl_mappings[]
> = { .name		= "Focus, Auto",
>  		.entity		= UVC_GUID_UVC_CAMERA,
>  		.selector	= UVC_CT_FOCUS_AUTO_CONTROL,
> -		.size		= 1,
> +		.size		= 2,

Why do you change the control size ?

>  		.offset		= 0,
> -		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
> -		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
> +		.v4l2_type	= V4L2_CTRL_TYPE_MENU,
> +		.data_type	= UVC_CTRL_DATA_TYPE_BITMASK,

The UVC control is still a boolean.

> +		.menu_info	= focus_auto_controls,
> +		.menu_count	= ARRAY_SIZE(focus_auto_controls),
>  	},
>  	{
>  		.id		= V4L2_CID_IRIS_ABSOLUTE,

-- 
Regards,

Laurent Pinchart

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

* Re: [RFC PATCH v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
  2011-02-25  9:20 ` Laurent Pinchart
@ 2011-02-25 10:18   ` Kim, HeungJun
  2011-02-25 10:25     ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: Kim, HeungJun @ 2011-02-25 10:18 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-media@vger.kernel.org, Hans Verkuil, Sylwester Nawrocki,
	kyungmin.park@samsung.com

Hi Laurent,


2011-02-25 오후 6:20, Laurent Pinchart 쓴 글:
> On Friday 25 February 2011 07:21:32 Kim, HeungJun wrote:
>> As following to change the boolean type of V4L2_CID_FOCUS_AUTO to menu
>> type, this uvc is modified the usage of V4L2_CID_FOCUS_AUTO.
>>
>> Signed-off-by: Heungjun Kim <riverful.kim@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>  drivers/media/video/uvc/uvc_ctrl.c |   13 ++++++++++---
>>  1 files changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/media/video/uvc/uvc_ctrl.c
>> b/drivers/media/video/uvc/uvc_ctrl.c index 59f8a9a..795fd3f 100644
>> --- a/drivers/media/video/uvc/uvc_ctrl.c
>> +++ b/drivers/media/video/uvc/uvc_ctrl.c
>> @@ -333,6 +333,11 @@ static struct uvc_menu_info exposure_auto_controls[] =
>> { { 8, "Aperture Priority Mode" },
>>  };
>>
>> +static struct uvc_menu_info focus_auto_controls[] = {
>> +	{ 2, "Auto Mode" },
>> +	{ 1, "Manual Mode" },
> 
> According to the UVC spec, this should be 0 for manual mode and 1 for auto 
> mode.
OK, I'll modify this values depends on below my question......

> 
>> +};
>> +
>>  static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
>>  	__u8 query, const __u8 *data)
>>  {
>> @@ -558,10 +563,12 @@ static struct uvc_control_mapping uvc_ctrl_mappings[]
>> = { .name		= "Focus, Auto",
>>  		.entity		= UVC_GUID_UVC_CAMERA,
>>  		.selector	= UVC_CT_FOCUS_AUTO_CONTROL,
>> -		.size		= 1,
>> +		.size		= 2,
> 
> Why do you change the control size ?
> 
>>  		.offset		= 0,
>> -		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
>> -		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
>> +		.v4l2_type	= V4L2_CTRL_TYPE_MENU,
>> +		.data_type	= UVC_CTRL_DATA_TYPE_BITMASK,
> 
> The UVC control is still a boolean.
You're saying that, the control size should be 1 because it's right to maintain the boolean type,
So, then, the uvc driver dosen't needed to be changed. is it right?

Thanks for the reviews, and I'll wait answer.

Regards,
Heungjun KIm

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

* Re: [RFC PATCH v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
  2011-02-25 10:18   ` Kim, HeungJun
@ 2011-02-25 10:25     ` Laurent Pinchart
  2011-02-25 12:27       ` Kim, HeungJun
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2011-02-25 10:25 UTC (permalink / raw)
  To: riverful.kim
  Cc: linux-media@vger.kernel.org, Hans Verkuil, Sylwester Nawrocki,
	kyungmin.park@samsung.com

Hi,

On Friday 25 February 2011 11:18:43 Kim, HeungJun wrote:
> 2011-02-25 오후 6:20, Laurent Pinchart 쓴 글:
> > On Friday 25 February 2011 07:21:32 Kim, HeungJun wrote:
> >> As following to change the boolean type of V4L2_CID_FOCUS_AUTO to menu
> >> type, this uvc is modified the usage of V4L2_CID_FOCUS_AUTO.
> >> 
> >> Signed-off-by: Heungjun Kim <riverful.kim@samsung.com>
> >> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >> ---
> >> 
> >>  drivers/media/video/uvc/uvc_ctrl.c |   13 ++++++++++---
> >>  1 files changed, 10 insertions(+), 3 deletions(-)
> >> 
> >> diff --git a/drivers/media/video/uvc/uvc_ctrl.c
> >> b/drivers/media/video/uvc/uvc_ctrl.c index 59f8a9a..795fd3f 100644
> >> --- a/drivers/media/video/uvc/uvc_ctrl.c
> >> +++ b/drivers/media/video/uvc/uvc_ctrl.c
> >> @@ -333,6 +333,11 @@ static struct uvc_menu_info
> >> exposure_auto_controls[] = { { 8, "Aperture Priority Mode" },
> >> 
> >>  };
> >> 
> >> +static struct uvc_menu_info focus_auto_controls[] = {
> >> +	{ 2, "Auto Mode" },
> >> +	{ 1, "Manual Mode" },
> > 
> > According to the UVC spec, this should be 0 for manual mode and 1 for
> > auto mode.
> 
> OK, I'll modify this values depends on below my question......
> 
> >> +};
> >> +
> >> 
> >>  static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
> >>  
> >>  	__u8 query, const __u8 *data)
> >>  
> >>  {
> >> 
> >> @@ -558,10 +563,12 @@ static struct uvc_control_mapping
> >> uvc_ctrl_mappings[] = { .name		= "Focus, Auto",
> >> 
> >>  		.entity		= UVC_GUID_UVC_CAMERA,
> >>  		.selector	= UVC_CT_FOCUS_AUTO_CONTROL,
> >> 
> >> -		.size		= 1,
> >> +		.size		= 2,
> > 
> > Why do you change the control size ?
> > 
> >>  		.offset		= 0,
> >> 
> >> -		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
> >> -		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
> >> +		.v4l2_type	= V4L2_CTRL_TYPE_MENU,
> >> +		.data_type	= UVC_CTRL_DATA_TYPE_BITMASK,
> > 
> > The UVC control is still a boolean.
> 
> You're saying that, the control size should be 1 because it's right to
> maintain the boolean type, So, then, the uvc driver dosen't needed to be
> changed. is it right?

You still need to change v4l2_type from V4L2_CTRL_TYPE_BOOLEAN to 
V4L2_CTRL_TYPE_MENU, and add the menu entries. I don't see a need to change 
anything else.

-- 
Regards,

Laurent Pinchart

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

* Re: [RFC PATCH v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
  2011-02-25 10:25     ` Laurent Pinchart
@ 2011-02-25 12:27       ` Kim, HeungJun
  0 siblings, 0 replies; 5+ messages in thread
From: Kim, HeungJun @ 2011-02-25 12:27 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-media@vger.kernel.org, Hans Verkuil, Sylwester Nawrocki,
	kyungmin.park@samsung.com

2011-02-25 오후 7:25, Laurent Pinchart 쓴 글:
> Hi,
> 
> On Friday 25 February 2011 11:18:43 Kim, HeungJun wrote:
>> 2011-02-25 오후 6:20, Laurent Pinchart 쓴 글:
>>> On Friday 25 February 2011 07:21:32 Kim, HeungJun wrote:
>>>> As following to change the boolean type of V4L2_CID_FOCUS_AUTO to menu
>>>> type, this uvc is modified the usage of V4L2_CID_FOCUS_AUTO.
>>>>
>>>> Signed-off-by: Heungjun Kim <riverful.kim@samsung.com>
>>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>>> ---
>>>>
>>>>  drivers/media/video/uvc/uvc_ctrl.c |   13 ++++++++++---
>>>>  1 files changed, 10 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/media/video/uvc/uvc_ctrl.c
>>>> b/drivers/media/video/uvc/uvc_ctrl.c index 59f8a9a..795fd3f 100644
>>>> --- a/drivers/media/video/uvc/uvc_ctrl.c
>>>> +++ b/drivers/media/video/uvc/uvc_ctrl.c
>>>> @@ -333,6 +333,11 @@ static struct uvc_menu_info
>>>> exposure_auto_controls[] = { { 8, "Aperture Priority Mode" },
>>>>
>>>>  };
>>>>
>>>> +static struct uvc_menu_info focus_auto_controls[] = {
>>>> +	{ 2, "Auto Mode" },
>>>> +	{ 1, "Manual Mode" },
>>>
>>> According to the UVC spec, this should be 0 for manual mode and 1 for
>>> auto mode.
>>
>> OK, I'll modify this values depends on below my question......
>>
>>>> +};
>>>> +
>>>>
>>>>  static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
>>>>  
>>>>  	__u8 query, const __u8 *data)
>>>>  
>>>>  {
>>>>
>>>> @@ -558,10 +563,12 @@ static struct uvc_control_mapping
>>>> uvc_ctrl_mappings[] = { .name		= "Focus, Auto",
>>>>
>>>>  		.entity		= UVC_GUID_UVC_CAMERA,
>>>>  		.selector	= UVC_CT_FOCUS_AUTO_CONTROL,
>>>>
>>>> -		.size		= 1,
>>>> +		.size		= 2,
>>>
>>> Why do you change the control size ?
>>>
>>>>  		.offset		= 0,
>>>>
>>>> -		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
>>>> -		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
>>>> +		.v4l2_type	= V4L2_CTRL_TYPE_MENU,
>>>> +		.data_type	= UVC_CTRL_DATA_TYPE_BITMASK,
>>>
>>> The UVC control is still a boolean.
>>
>> You're saying that, the control size should be 1 because it's right to
>> maintain the boolean type, So, then, the uvc driver dosen't needed to be
>> changed. is it right?
> 
> You still need to change v4l2_type from V4L2_CTRL_TYPE_BOOLEAN to 
> V4L2_CTRL_TYPE_MENU, and add the menu entries. I don't see a need to change 
> anything else.
> 

Ah ok. I I confused a little. Thanks for the good catch.

Together focus name patch, I'll re-send patch.

Regards,
Heungjun Kim



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

end of thread, other threads:[~2011-02-25 12:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25  6:21 [RFC PATCH v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO Kim, HeungJun
2011-02-25  9:20 ` Laurent Pinchart
2011-02-25 10:18   ` Kim, HeungJun
2011-02-25 10:25     ` Laurent Pinchart
2011-02-25 12:27       ` Kim, HeungJun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox