Skip to content

Commit b11d913

Browse files
paulkocialkowskimchehab
authored andcommitted
media: sun6i-csi: Add media ops with link notify callback
In order to keep the power use count fields balanced when link changes happen between v4l2_pipeline_pm_get/set calls (in open/close), the link_notify media operation callback needs to be registered. Signed-off-by: Paul Kocialkowski <[email protected]> Acked-by: Jernej Skrabec <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent daafbb9 commit b11d913

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/sched.h>
2424
#include <linux/sizes.h>
2525
#include <linux/slab.h>
26+
#include <media/v4l2-mc.h>
2627

2728
#include "sun6i_csi.h"
2829
#include "sun6i_csi_reg.h"
@@ -574,6 +575,12 @@ void sun6i_csi_set_stream(struct sun6i_csi_device *csi_dev, bool enable)
574575
CSI_CAP_CH0_VCAP_ON);
575576
}
576577

578+
/* Media */
579+
580+
static const struct media_device_ops sun6i_csi_media_ops = {
581+
.link_notify = v4l2_pipeline_link_notify,
582+
};
583+
577584
/* V4L2 */
578585

579586
static int sun6i_csi_link_entity(struct sun6i_csi_device *csi_dev,
@@ -681,6 +688,7 @@ static int sun6i_csi_v4l2_setup(struct sun6i_csi_device *csi_dev)
681688
strscpy(media_dev->model, SUN6I_CSI_DESCRIPTION,
682689
sizeof(media_dev->model));
683690
media_dev->hw_revision = 0;
691+
media_dev->ops = &sun6i_csi_media_ops;
684692
media_dev->dev = dev;
685693

686694
media_device_init(media_dev);

0 commit comments

Comments
 (0)