From patchwork Tue Mar 24 20:28:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 3314 Return-Path: Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F27A562CE7 for ; Tue, 24 Mar 2020 21:25:57 +0100 (CET) Received: from localhost.localdomain (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id B7973100011; Tue, 24 Mar 2020 20:25:56 +0000 (UTC) From: Jacopo Mondi To: linux-media@vger.kernel.org, libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , mchehab@kernel.org, hverkuil-cisco@xs4all.nl, sakari.ailus@linux.intel.com Date: Tue, 24 Mar 2020 21:28:43 +0100 Message-Id: <20200324202844.1518292-4-jacopo@jmondi.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324202844.1518292-1-jacopo@jmondi.org> References: <20200324202844.1518292-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/4] media: bcm2835: Register sensor devnode as read-only X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2020 20:25:58 -0000 The bcm2835 bridge drivers controls the camera sensor configuration through direct calls to the kapi realized by the v4l2 sub-device operations and does not allow userspace to change the sensor parameter through the sub-device devnode. In order to expose to userspace the current sensor configuration, register the device node in read-only mode by using the newly introduced v4l2_device_register_subdev_ro_nodes() function. Signed-off-by: Jacopo Mondi --- drivers/media/platform/bcm2835/bcm2835-unicam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/bcm2835/bcm2835-unicam.c b/drivers/media/platform/bcm2835/bcm2835-unicam.c index 89bd1c842d38..5001976dcebc 100644 --- a/drivers/media/platform/bcm2835/bcm2835-unicam.c +++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c @@ -2875,7 +2875,7 @@ static int unicam_probe_complete(struct unicam_device *unicam) goto unregister; } - ret = v4l2_device_register_subdev_nodes(&unicam->v4l2_dev); + ret = v4l2_device_register_ro_subdev_nodes(&unicam->v4l2_dev); if (ret) { unicam_err(unicam, "Unable to register subdev nodes.\n"); goto unregister;