summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-07-06 20:36:24 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-07-19 10:29:49 +0200
commit539e7c5d7c028180ea16fc3b816cd07e0a09155d (patch)
treec1273229821e8fc3a0bcf20e2932befa1d2c344b /drivers/media
parenta539a0536f6e22a26e3e85a4cfb87344f800016f (diff)
media: ti-vpe: cal: Replace context with phy in async notifier entries
The async notifier is meant to bind to subdevs connected to the CSI-2 ports. Those ports are modelled by the CAMERARX phy instances. To prepare for additional decoupling of contexts and phys, make the notifier operate on phys. We still initialize and register the context V4L2 support in the async notifier complete operation as that's our signal that the userspace API is ready to be exposed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/ti-vpe/cal.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index 55528b4d749c..59fa1f8c1564 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -2112,7 +2112,7 @@ static void cal_ctx_v4l2_cleanup(struct cal_ctx *ctx)
struct cal_v4l2_async_subdev {
struct v4l2_async_subdev asd;
- struct cal_ctx *ctx;
+ struct cal_camerarx *phy;
};
static inline struct cal_v4l2_async_subdev *
@@ -2125,16 +2125,16 @@ static int cal_async_notifier_bound(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *subdev,
struct v4l2_async_subdev *asd)
{
- struct cal_ctx *ctx = to_cal_asd(asd)->ctx;
+ struct cal_camerarx *phy = to_cal_asd(asd)->phy;
- if (ctx->phy->sensor) {
- ctx_info(ctx, "Rejecting subdev %s (Already set!!)",
+ if (phy->sensor) {
+ phy_info(phy, "Rejecting subdev %s (Already set!!)",
subdev->name);
return 0;
}
- ctx->phy->sensor = subdev;
- ctx_dbg(1, ctx, "Using sensor %s for capture\n", subdev->name);
+ phy->sensor = subdev;
+ phy_dbg(1, phy, "Using sensor %s for capture\n", subdev->name);
return 0;
}
@@ -2174,27 +2174,27 @@ static int cal_async_notifier_register(struct cal_dev *cal)
v4l2_async_notifier_init(&cal->notifier);
cal->notifier.ops = &cal_async_notifier_ops;
- for (i = 0; i < ARRAY_SIZE(cal->ctx); ++i) {
- struct cal_ctx *ctx = cal->ctx[i];
+ for (i = 0; i < ARRAY_SIZE(cal->phy); ++i) {
+ struct cal_camerarx *phy = cal->phy[i];
struct cal_v4l2_async_subdev *casd;
struct v4l2_async_subdev *asd;
struct fwnode_handle *fwnode;
- if (!ctx)
+ if (!phy || !phy->sensor_node)
continue;
- fwnode = of_fwnode_handle(ctx->phy->sensor_node);
+ fwnode = of_fwnode_handle(phy->sensor_node);
asd = v4l2_async_notifier_add_fwnode_subdev(&cal->notifier,
fwnode,
sizeof(*asd));
if (IS_ERR(asd)) {
- ctx_err(ctx, "Failed to add subdev to notifier\n");
+ phy_err(phy, "Failed to add subdev to notifier\n");
ret = PTR_ERR(asd);
goto error;
}
casd = to_cal_asd(asd);
- casd->ctx = ctx;
+ casd->phy = phy;
}
ret = v4l2_async_notifier_register(&cal->v4l2_dev, &cal->notifier);