@@ -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;
@@ -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;
}
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@wolfvision.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(-)