public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Gergo Koteles <soyer@irl.hu>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL
Date: Wed, 12 Jun 2024 23:31:24 +0300	[thread overview]
Message-ID: <20240612203124.GU28989@pendragon.ideasonboard.com> (raw)
In-Reply-To: <163b1aee53fa78fe1a8d0b8bb7b0f7be1f1975c9.1718216718.git.soyer@irl.hu>

On Wed, Jun 12, 2024 at 08:31:14PM +0200, Gergo Koteles wrote:
> Some new UVC cameras can report whether they are mounted in 'portrait
> mode'.
> 
> Current roll degrees (-90, 0, 90, 180) are reported with
> UVC_CT_ROLL_ABSOLUTE_CONTROL.

UVC_CT_ROLL_ABSOLUTE_CONTROL is about controlling the motion of the
camera along the roll axis, while this patch series sounds like you want
to support reporting the mounting orientation of the device, not cause
the device to rotate. Is that right ?

If that's the case, the right V4L2 control to use would be
V4L2_CID_CAMERA_SENSOR_ROTATION. Mapping it to
UVC_CT_ROLL_ABSOLUTE_CONTROL is problematic though, as
UVC_CT_ROLL_ABSOLUTE_CONTROL is not meant for this in the UVC spec. We
would likely need a quirk to control how it gets used.

> Map UVC_CT_ROLL_ABSOLUTE_CONTROL to V4L2_CID_ROLL_ABSOLUTE to
> make it available to userspace.
> 
> Signed-off-by: Gergo Koteles <soyer@irl.hu>
> ---
>  drivers/media/usb/uvc/uvc_ctrl.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
> index 4b685f883e4d..bc3272b6ceb1 100644
> --- a/drivers/media/usb/uvc/uvc_ctrl.c
> +++ b/drivers/media/usb/uvc/uvc_ctrl.c
> @@ -748,6 +748,15 @@ static const struct uvc_control_mapping uvc_ctrl_mappings[] = {
>  		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
>  		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
>  	},
> +	{
> +		.id		= V4L2_CID_ROLL_ABSOLUTE,
> +		.entity		= UVC_GUID_UVC_CAMERA,
> +		.selector	= UVC_CT_ROLL_ABSOLUTE_CONTROL,
> +		.size		= 16,
> +		.offset		= 0,
> +		.v4l2_type	= V4L2_CTRL_TYPE_INTEGER,
> +		.data_type	= UVC_CTRL_DATA_TYPE_SIGNED,
> +	},
>  };
>  
>  const struct uvc_control_mapping uvc_ctrl_power_line_mapping_limited = {

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2024-06-12 20:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12 18:31 [PATCH 0/2] media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL Gergo Koteles
2024-06-12 18:31 ` [PATCH 1/2] media: v4l2: ctrls: Add ROLL_ABSOLUTE control Gergo Koteles
2024-06-12 18:31 ` [PATCH 2/2] media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL Gergo Koteles
2024-06-12 20:31   ` Laurent Pinchart [this message]
2024-06-14 16:26     ` Gergo Koteles

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=20240612203124.GU28989@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=soyer@irl.hu \
    /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