All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo@jmondi.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	tfiga@google.com, pavel@ucw.cz
Cc: Jacopo Mondi <jacopo@jmondi.org>,
	linux-media@vger.kernel.org (open list:MEDIA INPUT
	INFRASTRUCTURE (V4L/DVB))
Subject: [PATCH v4 05/11] media: v4l2-ctrls: Add camera location and rotation
Date: Mon,  7 Oct 2019 18:29:07 +0200	[thread overview]
Message-ID: <20191007162913.250743-6-jacopo@jmondi.org> (raw)
In-Reply-To: <20191007162913.250743-1-jacopo@jmondi.org>

Add support for the newly defined V4L2_CID_CAMERA_SENSOR_LOCATION
and V4L2_CID_CAMERA_SENSOR_ROTATION read-only controls used to report
the camera device mounting position and orientation respectively.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 4 ++++
 include/uapi/linux/v4l2-controls.h   | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 1d8f38824631..b7af47a25125 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -994,6 +994,8 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_AUTO_FOCUS_RANGE:		return "Auto Focus, Range";
 	case V4L2_CID_PAN_SPEED:		return "Pan, Speed";
 	case V4L2_CID_TILT_SPEED:		return "Tilt, Speed";
+	case V4L2_CID_CAMERA_SENSOR_LOCATION:	return "Camera Sensor Location";
+	case V4L2_CID_CAMERA_SENSOR_ROTATION:	return "Camera Sensor Rotation";
 
 	/* FM Radio Modulator controls */
 	/* Keep the order of the 'case's the same as in v4l2-controls.h! */
@@ -1318,6 +1320,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 		break;
 	case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE:
 	case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT:
+	case V4L2_CID_CAMERA_SENSOR_LOCATION:
+	case V4L2_CID_CAMERA_SENSOR_ROTATION:
 		*type = V4L2_CTRL_TYPE_INTEGER;
 		*flags |= V4L2_CTRL_FLAG_READ_ONLY;
 		break;
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index a2669b79b294..f2be7a99818e 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -912,6 +912,13 @@ enum v4l2_auto_focus_range {
 #define V4L2_CID_PAN_SPEED			(V4L2_CID_CAMERA_CLASS_BASE+32)
 #define V4L2_CID_TILT_SPEED			(V4L2_CID_CAMERA_CLASS_BASE+33)
 
+#define V4L2_CID_CAMERA_SENSOR_LOCATION		(V4L2_CID_CAMERA_CLASS_BASE+34)
+#define V4L2_LOCATION_FRONT			0
+#define V4L2_LOCATION_BACK			1
+#define V4L2_LOCATION_EXTERNAL			2
+
+#define V4L2_CID_CAMERA_SENSOR_ROTATION		(V4L2_CID_CAMERA_CLASS_BASE+35)
+
 /* FM Modulator class control IDs */
 
 #define V4L2_CID_FM_TX_CLASS_BASE		(V4L2_CTRL_CLASS_FM_TX | 0x900)
-- 
2.23.0


  parent reply	other threads:[~2019-10-07 16:27 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 16:29 [PATCH v4 00/11] media: Report camera sensor properties Jacopo Mondi
2019-10-07 16:29 ` [PATCH v4 01/11] dt-bindings: video-interfaces: Document 'location' property Jacopo Mondi
2019-10-08  7:40   ` Pavel Machek
2019-10-08  7:58     ` Jacopo Mondi
2019-10-08  8:06       ` Pavel Machek
2019-10-08  8:20         ` Jacopo Mondi
2019-10-22 14:27           ` Hans Verkuil
2019-10-23 14:27             ` Pavel Machek
2019-10-25  6:29               ` Tomasz Figa
2019-10-26 20:48                 ` Laurent Pinchart
2019-11-18 11:32                   ` Tomasz Figa
2019-11-21 16:02                     ` Jacopo Mondi
2019-11-22  4:53                       ` Tomasz Figa
2019-10-26 11:23               ` Jacopo Mondi
2019-10-18 19:40   ` Sakari Ailus
2019-10-07 16:29 ` [PATCH v4 02/11] media: v4l2-ctrl: Document V4L2_CID_CAMERA_SENSOR_LOCATION Jacopo Mondi
2019-10-07 16:29 ` [PATCH v4 03/11] dt-bindings: video-interface: Expand rotation description Jacopo Mondi
2019-10-07 16:29 ` [PATCH v4 04/11] media: v4l2-ctrl: Document V4L2_CID_CAMERA_SENSOR_ROTATION Jacopo Mondi
2019-10-22 14:14   ` Hans Verkuil
2019-10-07 16:29 ` Jacopo Mondi [this message]
2019-10-07 16:29 ` [PATCH v4 06/11] media: v4l2-fwnode: Add helper to parse device properties Jacopo Mondi
2019-10-18 19:36   ` Sakari Ailus
2019-11-08  9:20     ` Jacopo Mondi
2019-10-07 16:29 ` [PATCH v4 07/11] include: v4l2-ctrl: Sort forward declarations Jacopo Mondi
2019-10-07 16:29 ` [PATCH v4 08/11] media: v4l2-ctrls: Sort includes alphabetically Jacopo Mondi
2019-10-07 16:29 ` [PATCH v4 09/11] media: v4l2-ctrls: Add helper to register properties Jacopo Mondi
2019-10-07 16:29 ` [PATCH v4 10/11] media: i2c: ov5670: Parse and " Jacopo Mondi
2019-10-07 16:29 ` [PATCH v4 11/11] media: i2c: ov13858: " Jacopo Mondi
2019-10-18 19:10 ` [PATCH v4 00/11] media: Report camera sensor properties Sakari Ailus

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=20191007162913.250743-6-jacopo@jmondi.org \
    --to=jacopo@jmondi.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.