public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH RESEND v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
@ 2011-02-25 12:46 Kim, HeungJun
  2011-02-25 12:58 ` Laurent Pinchart
  0 siblings, 1 reply; 8+ messages in thread
From: Kim, HeungJun @ 2011-02-25 12:46 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 |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
index 59f8a9a..b98b9f1 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[] = {
+	{ 1, "Auto Mode" },
+	{ 0, "Manual Mode" },
+};
+
 static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
 	__u8 query, const __u8 *data)
 {
@@ -560,8 +565,10 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
 		.selector	= UVC_CT_FOCUS_AUTO_CONTROL,
 		.size		= 1,
 		.offset		= 0,
-		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
+		.v4l2_type	= V4L2_CTRL_TYPE_MENU,
 		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
+		.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] 8+ messages in thread

* Re: [RFC PATCH RESEND v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
  2011-02-25 12:46 Kim, HeungJun
@ 2011-02-25 12:58 ` Laurent Pinchart
  2011-02-28  5:15   ` Kim, HeungJun
  0 siblings, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2011-02-25 12:58 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 13:46:01 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 |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/media/video/uvc/uvc_ctrl.c
> b/drivers/media/video/uvc/uvc_ctrl.c index 59f8a9a..b98b9f1 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[] = {
> +	{ 1, "Auto Mode" },
> +	{ 0, "Manual Mode" },

Now that manual focus has value 0 and auto focus value 1, the menu entries 
need to be the other way around.

> +};
> +
>  static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
>  	__u8 query, const __u8 *data)
>  {
> @@ -560,8 +565,10 @@ static struct uvc_control_mapping uvc_ctrl_mappings[]
> = { .selector	= UVC_CT_FOCUS_AUTO_CONTROL,
>  		.size		= 1,
>  		.offset		= 0,
> -		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
> +		.v4l2_type	= V4L2_CTRL_TYPE_MENU,
>  		.data_type	= UVC_CTRL_DATA_TYPE_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] 8+ messages in thread

* Re: [RFC PATCH RESEND v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
  2011-02-25 12:58 ` Laurent Pinchart
@ 2011-02-28  5:15   ` Kim, HeungJun
  2011-02-28 10:01     ` Laurent Pinchart
  0 siblings, 1 reply; 8+ messages in thread
From: Kim, HeungJun @ 2011-02-28  5:15 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 오후 9:58, Laurent Pinchart 쓴 글:
> Hi,
> 
> On Friday 25 February 2011 13:46:01 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 |    9 ++++++++-
>>  1 files changed, 8 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/media/video/uvc/uvc_ctrl.c
>> b/drivers/media/video/uvc/uvc_ctrl.c index 59f8a9a..b98b9f1 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[] = {
>> +	{ 1, "Auto Mode" },
>> +	{ 0, "Manual Mode" },
> 
> Now that manual focus has value 0 and auto focus value 1, the menu entries 
> need to be the other way around.
I don't really get it. My understanding is that your words are structure
uvc_menu_info should be changed as fitted to focus menu type. right?
But, I thinks they don't need to be changed, and I don't find wrong,
I don't know how to fix what you telling me exactly.

So, could you explain more details? Some examples helps to me.

Sorry to bother if you are busy, but it's good for me your advice.
I'll waiting.

Thanks and Regards,
Heungjun Kim


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

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

Hi,

On Monday 28 February 2011 06:15:23 Kim, HeungJun wrote:
> 2011-02-25 오후 9:58, Laurent Pinchart 쓴 글:
> > On Friday 25 February 2011 13:46:01 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 |    9 ++++++++-
> >>  1 files changed, 8 insertions(+), 1 deletions(-)
> >> 
> >> diff --git a/drivers/media/video/uvc/uvc_ctrl.c
> >> b/drivers/media/video/uvc/uvc_ctrl.c index 59f8a9a..b98b9f1 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[] = {
> >> +	{ 1, "Auto Mode" },
> >> +	{ 0, "Manual Mode" },
> > 
> > Now that manual focus has value 0 and auto focus value 1, the menu
> > entries need to be the other way around.
> 
> I don't really get it. My understanding is that your words are structure
> uvc_menu_info should be changed as fitted to focus menu type. right?
> But, I thinks they don't need to be changed, and I don't find wrong,
> I don't know how to fix what you telling me exactly.
> 
> So, could you explain more details? Some examples helps to me.

The menu entries are indexed by the V4L2 menu value. The first field is the 
UVC menu entry value, and the second field its name. As the V4L2 manual focus 
control has a value of 0, it must be the first entry.

> Sorry to bother if you are busy, but it's good for me your advice.
> I'll waiting.

No worries.

-- 
Regards,

Laurent Pinchart

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

* [RFC PATCH RESEND v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
@ 2011-03-03  2:16 Kim, HeungJun
  2011-03-03 10:10 ` Laurent Pinchart
  0 siblings, 1 reply; 8+ messages in thread
From: Kim, HeungJun @ 2011-03-03  2:16 UTC (permalink / raw)
  To: linux-media@vger.kernel.org
  Cc: Hans Verkuil, Laurent Pinchart, Sylwester Nawrocki,
	???/Mobile S/W Platform Lab(DMC?)/E4(??)/????,
	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, maintaining v4l2 menu
index.

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 |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
index 59f8a9a..064827f 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[] = {
+	{ 0, "Manual Mode" },
+	{ 1, "Auto Mode" },
+};
+
 static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
 	__u8 query, const __u8 *data)
 {
@@ -560,8 +565,10 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
 		.selector	= UVC_CT_FOCUS_AUTO_CONTROL,
 		.size		= 1,
 		.offset		= 0,
-		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
+		.v4l2_type	= V4L2_CTRL_TYPE_MENU,
 		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
+		.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] 8+ messages in thread

* Re: [RFC PATCH RESEND v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
  2011-03-03  2:16 [RFC PATCH RESEND v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO Kim, HeungJun
@ 2011-03-03 10:10 ` Laurent Pinchart
  2011-03-22  0:27   ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2011-03-03 10:10 UTC (permalink / raw)
  To: riverful.kim
  Cc: linux-media@vger.kernel.org, Hans Verkuil, Sylwester Nawrocki,
	???/Mobile S/W Platform Lab(DMC?)/E4(??)/????,
	kyungmin.park@samsung.com

On Thursday 03 March 2011 03:16: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, maintaining
> v4l2 menu index.
> 
> Signed-off-by: Heungjun Kim <riverful.kim@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/video/uvc/uvc_ctrl.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/media/video/uvc/uvc_ctrl.c
> b/drivers/media/video/uvc/uvc_ctrl.c index 59f8a9a..064827f 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[] = {
> +	{ 0, "Manual Mode" },
> +	{ 1, "Auto Mode" },
> +};
> +
>  static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
>  	__u8 query, const __u8 *data)
>  {
> @@ -560,8 +565,10 @@ static struct uvc_control_mapping uvc_ctrl_mappings[]
> = { .selector	= UVC_CT_FOCUS_AUTO_CONTROL,
>  		.size		= 1,
>  		.offset		= 0,
> -		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
> +		.v4l2_type	= V4L2_CTRL_TYPE_MENU,
>  		.data_type	= UVC_CTRL_DATA_TYPE_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] 8+ messages in thread

* Re: [RFC PATCH RESEND v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
  2011-03-03 10:10 ` Laurent Pinchart
@ 2011-03-22  0:27   ` Mauro Carvalho Chehab
  2011-03-22  9:22     ` Laurent Pinchart
  0 siblings, 1 reply; 8+ messages in thread
From: Mauro Carvalho Chehab @ 2011-03-22  0:27 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: riverful.kim, linux-media@vger.kernel.org, Hans Verkuil,
	Sylwester Nawrocki, ???/Mobile S/W Platform Lab(DMC?)/E4(??)/????,
	kyungmin.park@samsung.com

Hi Laurent,

Em 03-03-2011 07:10, Laurent Pinchart escreveu:
> On Thursday 03 March 2011 03:16: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, maintaining
>> v4l2 menu index.
>>
>> Signed-off-by: Heungjun Kim <riverful.kim@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> 
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I'm assuming that you'll be applying those patches on your tree and sending
me a pull request, right?

Thanks!
Mauro

> 
>> ---
>>  drivers/media/video/uvc/uvc_ctrl.c |    9 ++++++++-
>>  1 files changed, 8 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/media/video/uvc/uvc_ctrl.c
>> b/drivers/media/video/uvc/uvc_ctrl.c index 59f8a9a..064827f 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[] = {
>> +	{ 0, "Manual Mode" },
>> +	{ 1, "Auto Mode" },
>> +};
>> +
>>  static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
>>  	__u8 query, const __u8 *data)
>>  {
>> @@ -560,8 +565,10 @@ static struct uvc_control_mapping uvc_ctrl_mappings[]
>> = { .selector	= UVC_CT_FOCUS_AUTO_CONTROL,
>>  		.size		= 1,
>>  		.offset		= 0,
>> -		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
>> +		.v4l2_type	= V4L2_CTRL_TYPE_MENU,
>>  		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
>> +		.menu_info	= focus_auto_controls,
>> +		.menu_count	= ARRAY_SIZE(focus_auto_controls),
>>  	},
>>  	{
>>  		.id		= V4L2_CID_IRIS_ABSOLUTE,
> 


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

* Re: [RFC PATCH RESEND v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO
  2011-03-22  0:27   ` Mauro Carvalho Chehab
@ 2011-03-22  9:22     ` Laurent Pinchart
  0 siblings, 0 replies; 8+ messages in thread
From: Laurent Pinchart @ 2011-03-22  9:22 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: riverful.kim, linux-media@vger.kernel.org, Hans Verkuil,
	Sylwester Nawrocki, ???/Mobile S/W Platform Lab(DMC?)/E4(??)/????,
	kyungmin.park@samsung.com

Hi Mauro,

On Tuesday 22 March 2011 01:27:44 Mauro Carvalho Chehab wrote:
> Em 03-03-2011 07:10, Laurent Pinchart escreveu:
> > On Thursday 03 March 2011 03:16: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, maintaining
> >> v4l2 menu index.
> >> 
> >> Signed-off-by: Heungjun Kim <riverful.kim@samsung.com>
> >> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > 
> > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> I'm assuming that you'll be applying those patches on your tree and sending
> me a pull request, right?

The patch depends on other V4L2 core patches in the same series, so I wasn't 
planning to push it through my tree, but it can be done. There are still 
issues with this series though, as we haven't reached an agreement on the 
auto-focus ABI yet.

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2011-03-22  9:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-03  2:16 [RFC PATCH RESEND v2 2/3] v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO Kim, HeungJun
2011-03-03 10:10 ` Laurent Pinchart
2011-03-22  0:27   ` Mauro Carvalho Chehab
2011-03-22  9:22     ` Laurent Pinchart
  -- strict thread matches above, loose matches on Subject: below --
2011-02-25 12:46 Kim, HeungJun
2011-02-25 12:58 ` Laurent Pinchart
2011-02-28  5:15   ` Kim, HeungJun
2011-02-28 10:01     ` Laurent Pinchart

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