@@ -1136,13 +1136,6 @@ static const struct file_operations dvb_demux_fops = {
.llseek = default_llseek,
};
-static struct dvb_device dvbdev_demux = {
- .priv = NULL,
- .users = 1,
- .writers = 1,
- .fops = &dvb_demux_fops
-};
-
static int dvb_dvr_do_ioctl(struct file *file,
unsigned int cmd, void *parg)
{
@@ -1209,16 +1202,29 @@ static const struct file_operations dvb_dvr_fops = {
.llseek = default_llseek,
};
-static struct dvb_device dvbdev_dvr = {
- .priv = NULL,
- .readers = 1,
- .users = 1,
- .fops = &dvb_dvr_fops
-};
-
int dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *dvb_adapter)
{
int i;
+ struct dvb_device dvbdev_demux = {
+ .priv = NULL,
+ .users = 1,
+ .writers = 1,
+ .fops = &dvb_demux_fops,
+#if defined(CONFIG_MEDIA_CONTROLLER)
+ .mdev = dmxdev->mdev,
+ .name = "demux",
+#endif
+ };
+ struct dvb_device dvbdev_dvr = {
+ .priv = NULL,
+ .readers = 1,
+ .users = 1,
+ .fops = &dvb_dvr_fops,
+#if defined(CONFIG_MEDIA_CONTROLLER)
+ .mdev = dmxdev->mdev,
+ .name = "dvr",
+#endif
+ };
if (dmxdev->demux->open(dmxdev->demux) < 0)
return -EUSERS;
@@ -36,6 +36,8 @@
#include <linux/dvb/dmx.h>
+#include <media/media-device.h>
+
#include "dvbdev.h"
#include "demux.h"
#include "dvb_ringbuffer.h"
@@ -110,6 +112,10 @@ struct dmxdev {
struct mutex mutex;
spinlock_t lock;
+
+#if defined(CONFIG_MEDIA_CONTROLLER)
+ struct media_device *mdev;
+#endif
};
Make the dvb core demux support aware of the media controller and register the corresponding devices. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>