Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2235718ybl; Thu, 15 Aug 2019 08:35:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwj2lu6/o1iOfmBUZ7cqSXKANAQZdhZ848Qf1wxvt3gbec3fBoPuwltx4+Jv84xDW1LArYj X-Received: by 2002:a63:5648:: with SMTP id g8mr3881305pgm.81.1565883356570; Thu, 15 Aug 2019 08:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565883356; cv=none; d=google.com; s=arc-20160816; b=ufTMNzaurraXoUmoLjnGF1IoyMpnqSqVhOHioKH+5RaJDmqV9NOKVbv0O0YqeWMmpz xqoxQ6dcUxZ8scMCABOjU3Opz19vZODmiSg5TtFiJ1m+rUmBGpIsXRdFbiYUPhnYLM1Y 48/NJFu4ivraeIcFDn0xskbDh7cerRd/XnLUy/TxhqDRCQrTYSQ3BqmZwSjQt05seaTw 09rxnrqNkuWeeRKwqhMNCRcya7XYWdGm7wql712bidaGYbIafaKjzj+vSTTBIXg/WHFQ lw03p3pupz4wBcUD6OQeRsmn3Tl5wVbuR08lDZOqDcvAbmO4GH214DBy+B+M8CPg5sMo 7cDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=+3aplmeRVTtbaZHMYdZGf3VZyb5GO9b2cL1zbSOSyxo=; b=i34cp7yKEPTN0cleI/3sV0oNb5CuNNUnp5KM3djEWHTzaNr1mQcJNyxDQfXpdtAiYu 6OTZLSYC07RtYK0GktzSUl91Gh4qaCWJRKWQWmjZmDKSooEyBCkF81vXB7UBVa5PEF4N /31skWcXXOVhJ6uRLzc77iDVoQLqMvVDiuIIg+vLY2AYgBgGUjLhhar8S/73aG3KYC9A 6ETTfqe32lmRs5RYiNXYxtWN6vj5BazgXZdolYrX5wCjdXIkuVYjfKVywUJTCC90jCjb sQutzB598bX5BXyxjwCoggYkXTEgp2DSVRNsOty6IuO//Eg0y82sAI3BF8HRDWWfAUWX mgIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37si2039676pgz.39.2019.08.15.08.35.41; Thu, 15 Aug 2019 08:35:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733049AbfHOOkJ (ORCPT + 99 others); Thu, 15 Aug 2019 10:40:09 -0400 Received: from lb1-smtp-cloud8.xs4all.net ([194.109.24.21]:50157 "EHLO lb1-smtp-cloud8.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731530AbfHOOkJ (ORCPT ); Thu, 15 Aug 2019 10:40:09 -0400 Received: from [IPv6:2001:420:44c1:2579:f038:4b04:f67a:276f] ([IPv6:2001:420:44c1:2579:f038:4b04:f67a:276f]) by smtp-cloud8.xs4all.net with ESMTPA id yGv5hwP37DqPeyGv8hYYW0; Thu, 15 Aug 2019 16:40:07 +0200 Subject: Re: [RFC 2/5] media: v4l2-ctrl: Document V4L2_CID_LOCATION To: Jacopo Mondi Cc: Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus , "open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)" , open list References: <20190814202815.32491-1-jacopo@jmondi.org> <20190814202815.32491-3-jacopo@jmondi.org> <20190814224340.GD5015@pendragon.ideasonboard.com> <664fe7b3-9051-30da-736e-710a4e9cecde@xs4all.nl> <20190815143423.vaoswb4jvzd2blxp@uno.localdomain> From: Hans Verkuil Message-ID: Date: Thu, 15 Aug 2019 16:40:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190815143423.vaoswb4jvzd2blxp@uno.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfBXmdoRG6SqSWrIh2Ld6aZRwkKsBqGQCUhW+GjxLiXTbYf4+n0aNJb8LBfyk0kWf0UDuV1Wu3QWpYEuUh14tqeZGTuIbcFC1X8DwZPzTo1LVldc7+6sR ku9tqsCbG41mtmdmHUIHTwk+8QkXeUAEwOKM6FNE6/N7DXo3elUIefDZNjEghImgvW2JphtX8j4OAsFftMq30sj7mSAPov5HljuG631NRjx8+REkwz8wIPi2 049j6QlGyF9PEvqIxFNgF60UZv39LWgHzYi+JalgyE+YHEZmXrNt09G9bkuy+zbEdVJNgIvkROp98swKdcsmibmMYWr7CvgH9sydBR84O43TZyg8QCjOnZBQ 5HSJ6C5mGZLv7PkmBUjTVQsQmHV/HG7BxfLaCF9Y3cDXKlH5vJHIzJKRLMCrtMQLwhHrEzmhzKf20ovg8XELOp1XLh4iGKGwfgwbQQAtUSB/ljcKTIZVg8gp 6NW3NNuSu9bi9UKr Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/15/19 4:34 PM, Jacopo Mondi wrote: > Hi Hans, > > On Thu, Aug 15, 2019 at 04:14:38PM +0200, Hans Verkuil wrote: >> On 8/15/19 4:10 PM, Hans Verkuil wrote: >>> On 8/15/19 12:43 AM, Laurent Pinchart wrote: >>>> Hi Jacopo, >>>> >>>> Thank you for the patch. >>>> >>>> On Wed, Aug 14, 2019 at 10:28:12PM +0200, Jacopo Mondi wrote: >>>>> Add documentation for the V4L2_CID_LOCATION camera control. The newly >>>>> added read-only control reports the camera device mounting position. >>>>> >>>>> Signed-off-by: Jacopo Mondi >>>>> --- >>>>> .../media/uapi/v4l/ext-ctrls-camera.rst | 23 +++++++++++++++++++ >>>>> 1 file changed, 23 insertions(+) >>>>> >>>>> diff --git a/Documentation/media/uapi/v4l/ext-ctrls-camera.rst b/Documentation/media/uapi/v4l/ext-ctrls-camera.rst >>>>> index 51c1d5c9eb00..fc0a02eee6d4 100644 >>>>> --- a/Documentation/media/uapi/v4l/ext-ctrls-camera.rst >>>>> +++ b/Documentation/media/uapi/v4l/ext-ctrls-camera.rst >>>>> @@ -510,6 +510,29 @@ enum v4l2_scene_mode - >>>>> value down. A value of zero stops the motion if one is in progress >>>>> and has no effect otherwise. >>>>> >>>>> +``V4L2_CID_LOCATION (integer)`` >>>> >>>> Maybe V4L2_CID_CAMERA_SENSOR_LOCATION ? Same for the values below. >>> >>> Probably a better name, if a bit long. But we might need other location >>> controls in the future (e.g. flash location), so CID_LOCATION is just too >>> generic. >> > > Thanks for the feedback. > >> Note that the location defines themselves can most likely be used with any >> LOCATION control, so V4L2_LOCATION_FRONT would be fine with any control. >> > > What do you think instead of the control type? Would a single integer > control do or an integer menu one would be better? I see merit in both > proposals actually... Single integer. It's read-only, so it just reports the location. It would be different if this was a writable control: then you need to know which locations are possible to set, and that requires a menu type. But it doesn't make sense to set the location from software. However, the location might change as a result of other changes: e.g. if the camera has motor control of the tilt and the tilt changes from forward facing to downward facing, then the driver might change the location from FRONT to DOWN. A convoluted example perhaps, but this is just brainstorming. Regards, Hans > > Once this is clarified, I can send a proper v1. > > Thanks > j > >> Regards, >> >> Hans >> >>> >>> Regards, >>> >>> Hans >>> >>>> >>>>> + This read-only control describes the camera location by reporting its >>>> >>>> Here too I would mention camera sensor instead of just camera (or >>>> possibly imaging sensor). >>>> >>>>> + mounting position on the device where the camera is installed. This >>>>> + control is particularly meaningful for devices which have a well defined >>>>> + orientation, such as phones, laptops and portable devices as the camera >>>>> + location is expressed as a position relative to the device intended >>>>> + usage position. In example, a camera installed on the user-facing side >>>>> + of a phone device is said to be installed in the ``V4L2_LOCATION_FRONT`` >>>>> + position. >>>> >>>> The DT bindings could use such an example :-) I would extend this to >>>> tablets and laptops. >>>> >>>>> + >>>>> + >>>>> + >>>> >>>> Do we need three blank lines ? >>>> >>>>> +.. flat-table:: >>>>> + :header-rows: 0 >>>>> + :stub-columns: 0 >>>>> + >>>>> + * - ``V4L2_LOCATION_FRONT`` >>>>> + - The camera device is located on the front side of the device. >>>>> + * - ``V4L2_LOCATION_BACK`` >>>>> + - The camera device is located on the back side of the device. >>>>> + >>>>> + >>>>> + >>>>> .. [#f1] >>>>> This control may be changed to a menu control in the future, if more >>>>> options are required. >>>> >>> >>