[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240220-v6-8-topic-rk3568-vicap-v1-6-2680a1fa640b@wolfvision.net>
Date: Tue, 20 Feb 2024 10:39:16 +0100
From: Michael Riesch <michael.riesch@...fvision.net>
To: Mehdi Djait <mehdi.djait.k@...il.com>,
Théo Lebrun <theo.lebrun@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>, Heiko Stuebner <heiko@...ech.de>,
Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: linux-media@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org,
Michael Riesch <michael.riesch@...fvision.net>
Subject: [PATCH 06/14] media: rockchip: cif: store endpoint information in
private data
The endpoint information such as bus width or flags are required
to set CIF (and on certain variants GRF) registers correctly. Store
the information in the private data of the driver in order to make
it accessible.
Signed-off-by: Michael Riesch <michael.riesch@...fvision.net>
---
drivers/media/platform/rockchip/cif/cif-common.h | 1 +
drivers/media/platform/rockchip/cif/cif-dev.c | 11 +++++------
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/media/platform/rockchip/cif/cif-common.h b/drivers/media/platform/rockchip/cif/cif-common.h
index 89ed9dd6f36d..34da800a0504 100644
--- a/drivers/media/platform/rockchip/cif/cif-common.h
+++ b/drivers/media/platform/rockchip/cif/cif-common.h
@@ -108,6 +108,7 @@ struct cif_device {
struct media_device media_dev;
struct v4l2_async_notifier notifier;
struct v4l2_async_connection asd;
+ struct v4l2_fwnode_endpoint vep;
struct cif_remote remote;
struct cif_stream stream;
diff --git a/drivers/media/platform/rockchip/cif/cif-dev.c b/drivers/media/platform/rockchip/cif/cif-dev.c
index 660e28397916..923831827be4 100644
--- a/drivers/media/platform/rockchip/cif/cif-dev.c
+++ b/drivers/media/platform/rockchip/cif/cif-dev.c
@@ -79,9 +79,7 @@ static int cif_subdev_notifier(struct cif_device *cif_dev)
struct v4l2_async_notifier *ntf = &cif_dev->notifier;
struct device *dev = cif_dev->dev;
struct v4l2_async_connection *asd;
- struct v4l2_fwnode_endpoint vep = {
- .bus_type = V4L2_MBUS_UNKNOWN,
- };
+ struct v4l2_fwnode_endpoint *vep = &cif_dev->vep;
struct fwnode_handle *ep;
int ret;
@@ -92,12 +90,13 @@ static int cif_subdev_notifier(struct cif_device *cif_dev)
if (!ep)
return -ENODEV;
- ret = v4l2_fwnode_endpoint_parse(ep, &vep);
+ vep->bus_type = V4L2_MBUS_UNKNOWN;
+ ret = v4l2_fwnode_endpoint_parse(ep, vep);
if (ret)
goto complete;
- if (vep.bus_type != V4L2_MBUS_BT656 &&
- vep.bus_type != V4L2_MBUS_PARALLEL) {
+ if (vep->bus_type != V4L2_MBUS_BT656 &&
+ vep->bus_type != V4L2_MBUS_PARALLEL) {
v4l2_err(&cif_dev->v4l2_dev, "unsupported bus type\n");
goto complete;
}
--
2.30.2
Powered by blists - more mailing lists