Commit e07a41f9 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: v4l: fwnode: Obtain data bus type from FW

Just obtain it. It'll actually get used soon with CSI-1/CCP2.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
Tested-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent f3112735
...@@ -28,6 +28,14 @@ ...@@ -28,6 +28,14 @@
#include <media/v4l2-fwnode.h> #include <media/v4l2-fwnode.h>
enum v4l2_fwnode_bus_type {
V4L2_FWNODE_BUS_TYPE_GUESS = 0,
V4L2_FWNODE_BUS_TYPE_CSI2_CPHY,
V4L2_FWNODE_BUS_TYPE_CSI1,
V4L2_FWNODE_BUS_TYPE_CCP2,
NR_OF_V4L2_FWNODE_BUS_TYPE,
};
static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode, static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
struct v4l2_fwnode_endpoint *vep) struct v4l2_fwnode_endpoint *vep)
{ {
...@@ -168,6 +176,7 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus( ...@@ -168,6 +176,7 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus(
int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode, int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
struct v4l2_fwnode_endpoint *vep) struct v4l2_fwnode_endpoint *vep)
{ {
u32 bus_type = 0;
int rval; int rval;
fwnode_graph_parse_endpoint(fwnode, &vep->base); fwnode_graph_parse_endpoint(fwnode, &vep->base);
...@@ -176,6 +185,8 @@ int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode, ...@@ -176,6 +185,8 @@ int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
memset(&vep->bus_type, 0, sizeof(*vep) - memset(&vep->bus_type, 0, sizeof(*vep) -
offsetof(typeof(*vep), bus_type)); offsetof(typeof(*vep), bus_type));
fwnode_property_read_u32(fwnode, "bus-type", &bus_type);
rval = v4l2_fwnode_endpoint_parse_csi2_bus(fwnode, vep); rval = v4l2_fwnode_endpoint_parse_csi2_bus(fwnode, vep);
if (rval) if (rval)
return rval; return rval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment