[media] v4l: Switch from V4L2 OF not V4L2 fwnode API
Switch users of the v4l2_of_ APIs to the more generic v4l2_fwnode_ APIs. Async OF matching is replaced by fwnode matching and OF matching support is removed. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Benoit Parrot <bparrot@ti.com> # i2c/ov2569.c, am437x/am437x-vpfe.c and ti-vpe/cal.c Tested-by: Hans Verkuil <hans.verkuil@cisco.com> # Atmel sama5d3 board + ov2640 sensor Tested-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
048ea05b4f
commit
859969b38e
@@ -21,7 +21,7 @@
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/of_graph.h>
|
||||
|
||||
#include <media/v4l2-of.h>
|
||||
#include <media/v4l2-fwnode.h>
|
||||
#include <media/v4l2-async.h>
|
||||
#include <media/v4l2-common.h>
|
||||
#include <media/v4l2-ctrls.h>
|
||||
@@ -270,7 +270,7 @@ struct cal_ctx {
|
||||
struct video_device vdev;
|
||||
struct v4l2_async_notifier notifier;
|
||||
struct v4l2_subdev *sensor;
|
||||
struct v4l2_of_endpoint endpoint;
|
||||
struct v4l2_fwnode_endpoint endpoint;
|
||||
|
||||
struct v4l2_async_subdev asd;
|
||||
struct v4l2_async_subdev *asd_list[1];
|
||||
@@ -608,7 +608,8 @@ static void csi2_lane_config(struct cal_ctx *ctx)
|
||||
u32 val = reg_read(ctx->dev, CAL_CSI2_COMPLEXIO_CFG(ctx->csi2_port));
|
||||
u32 lane_mask = CAL_CSI2_COMPLEXIO_CFG_CLOCK_POSITION_MASK;
|
||||
u32 polarity_mask = CAL_CSI2_COMPLEXIO_CFG_CLOCK_POL_MASK;
|
||||
struct v4l2_of_bus_mipi_csi2 *mipi_csi2 = &ctx->endpoint.bus.mipi_csi2;
|
||||
struct v4l2_fwnode_bus_mipi_csi2 *mipi_csi2 =
|
||||
&ctx->endpoint.bus.mipi_csi2;
|
||||
int lane;
|
||||
|
||||
set_field(&val, mipi_csi2->clock_lane + 1, lane_mask);
|
||||
@@ -1643,7 +1644,7 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
|
||||
struct platform_device *pdev = ctx->dev->pdev;
|
||||
struct device_node *ep_node, *port, *remote_ep,
|
||||
*sensor_node, *parent;
|
||||
struct v4l2_of_endpoint *endpoint;
|
||||
struct v4l2_fwnode_endpoint *endpoint;
|
||||
struct v4l2_async_subdev *asd;
|
||||
u32 regval = 0;
|
||||
int ret, index, found_port = 0, lane;
|
||||
@@ -1698,15 +1699,15 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
|
||||
ctx_dbg(3, ctx, "can't get remote parent\n");
|
||||
goto cleanup_exit;
|
||||
}
|
||||
asd->match_type = V4L2_ASYNC_MATCH_OF;
|
||||
asd->match.of.node = sensor_node;
|
||||
asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
|
||||
asd->match.fwnode.fwnode = of_fwnode_handle(sensor_node);
|
||||
|
||||
remote_ep = of_parse_phandle(ep_node, "remote-endpoint", 0);
|
||||
if (!remote_ep) {
|
||||
ctx_dbg(3, ctx, "can't get remote-endpoint\n");
|
||||
goto cleanup_exit;
|
||||
}
|
||||
v4l2_of_parse_endpoint(remote_ep, endpoint);
|
||||
v4l2_fwnode_endpoint_parse(of_fwnode_handle(remote_ep), endpoint);
|
||||
|
||||
if (endpoint->bus_type != V4L2_MBUS_CSI2) {
|
||||
ctx_err(ctx, "Port:%d sub-device %s is not a CSI2 device\n",
|
||||
|
Reference in New Issue
Block a user