Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp698859lqp; Wed, 12 Jun 2024 13:31:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBGBaTYj7ub4vTXJtGVUdjnhY9lsJK4OfDVIvhrk0YBw4rted8QfYgW5TvdsHhpdOfVKodH9iGH5GF9O99fkD/ccrPNTSOkAB/FDV+lQ== X-Google-Smtp-Source: AGHT+IHw2ENs84PMHsLBY1xurfllnICQvBUXoqtBbAkXhAhtkfajjjW2AHQACh3nAAjLDkxCmU4O X-Received: by 2002:a05:6512:20c:b0:52b:c192:c19c with SMTP id 2adb3069b0e04-52c9a3c7679mr1399449e87.21.1718224317931; Wed, 12 Jun 2024 13:31:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718224317; cv=pass; d=google.com; s=arc-20160816; b=SN8wHPnnLH3TvXE1HUWPCP+v7cMFsbKjhDHIm+Og98yu4yUu7jZAOGtNizH+MtsUQ9 AibsmVpZjsY/FJ4TcuMrwqp970ho0hOniXss97ryn6nzZShtOeC41BWjuIn0lCDxpvjD SCPPkfTljYtCwoBOLYZBeZihuyqS77IfDjMvAmmnt4egeNpXZrT5uAMLANc/RuMmjPY/ EXW+tjbbbyy+W8eXz94DMY762tMnWvk9e9n631qElyc7OZBrjqCHsR8UtYjRHgYngJns rf1sb9aRAFjP7rlj9UChfdf0vzCI773O7AO7jTfEHJl/EOieaw1Nz3b9n7jb/ro4mInR sxPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rmn7/MquIhMts+QkyEMBOjzpGMtaFsLDxwYHsiPsb7A=; fh=YjfPYw6XQ9+fpr3+tsyn4LJhGxyOULEqmcAwt6UxooI=; b=VDGsi7k1x5mjYzTDyjvOj2eE+8DzjXyx9mYaEN5UFhv6Gh9f426sHGMVXz2eMxfg/o nprUKg9pApUopcZze+xh/ioWWrRqRHQ0ODV8eSvuYCBPRcmdwv16V93mRJ9aanyQdYRF NPGOwpS88H3qxltrJy4rrSo+rR0lf2DRO/e7Mms8iWhWNTWQ4y7A2h3+GosJ19uHPhpV GxskEYUEvdz/AsPogtnoJTqpi1glf4cvI5j6BRXi3Ulh0i/v+beq0l2a2M78XOq+lnRC P3OaqA4GBfvahgS4NJlJZv+JpRRo92J/kp5+63OClLjk0O8DKtXrBSQlPTAA8BBhxATs JHwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=dcjnrchj; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-212225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212225-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef74189e6si510609266b.729.2024.06.12.13.31.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 13:31:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=dcjnrchj; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-212225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212225-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A37011F249F6 for ; Wed, 12 Jun 2024 20:31:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08B0684DF4; Wed, 12 Jun 2024 20:31:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="dcjnrchj" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5E6E7F7E3; Wed, 12 Jun 2024 20:31:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718224307; cv=none; b=vAJN53YeKcPy+xB87YRkIP9GSjNblO3DD6B1Lu40lzRIb9s3s4Xxv2yrKtkrCFU7xq8TXintkkJUrcfv3J0EiHVIhyCjELMn54Lc2JUIe6aquZa4RNF/AhimkbYlddDHcw3EQkfGVb6O4/hCLxaGewUXaq6rJvDQ/lnG7aQmB8s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718224307; c=relaxed/simple; bh=1TlNttQafOdr2aigwuyiH+bjl/sHPOXIwnCqNr7gAts=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=svXcA6YvVJGr0y7ap/uNLfBPUUfA3u0WrDdJolRKOuVF6cipCcJGiJJ7wgksZJQZhi2OzHOsgFtHiJ1twuBx1znt2jIHh0LbuV2QDkDtzIbDXOcDujI3i7V0NcXiW9ltGPSw7D7knzRQT1BF29ECJqMILJEJwJ9nPjNOCZ4wrXQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=dcjnrchj; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9E95512E4; Wed, 12 Jun 2024 22:31:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1718224290; bh=1TlNttQafOdr2aigwuyiH+bjl/sHPOXIwnCqNr7gAts=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dcjnrchjLlZpLD8NFkndl9LRohQkz6uvKc7Q7meFRO+Zs1eUq7fkYNaX8GMavhPjU A+LGDgU1BwMQsFqoOQrl0OCV8Lxrv+rdbVlAohHf2znCsNq5Uub102dS0dfN1ukpw4 iXhxbwClRHVNhFuk5IstWMur8tqKXn0JbnS8/t/s= Date: Wed, 12 Jun 2024 23:31:24 +0300 From: Laurent Pinchart To: Gergo Koteles Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL Message-ID: <20240612203124.GU28989@pendragon.ideasonboard.com> References: <163b1aee53fa78fe1a8d0b8bb7b0f7be1f1975c9.1718216718.git.soyer@irl.hu> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 > --- > 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