[media] tuner-core: add an input pad
Tuners actually have at least one connector on its input. Add a PAD to connect it. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
a08fad1ec8
commit
188d2d5512
@ -34,6 +34,9 @@
|
|||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include "dvbdev.h"
|
#include "dvbdev.h"
|
||||||
|
|
||||||
|
/* Due to enum tuner_pad_index */
|
||||||
|
#include <media/tuner.h>
|
||||||
|
|
||||||
static DEFINE_MUTEX(dvbdev_mutex);
|
static DEFINE_MUTEX(dvbdev_mutex);
|
||||||
static int dvbdev_debug;
|
static int dvbdev_debug;
|
||||||
|
|
||||||
@ -552,7 +555,7 @@ void dvb_create_media_graph(struct dvb_adapter *adap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tuner && demod)
|
if (tuner && demod)
|
||||||
media_create_pad_link(tuner, 0, demod, 0, 0);
|
media_create_pad_link(tuner, TUNER_PAD_IF_OUTPUT, demod, 0, 0);
|
||||||
|
|
||||||
if (demod && demux)
|
if (demod && demux)
|
||||||
media_create_pad_link(demod, 1, demux, 0, MEDIA_LNK_FL_ENABLED);
|
media_create_pad_link(demod, 1, demux, 0, MEDIA_LNK_FL_ENABLED);
|
||||||
|
@ -27,6 +27,9 @@
|
|||||||
#include <media/v4l2-common.h>
|
#include <media/v4l2-common.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
|
|
||||||
|
/* Due to enum tuner_pad_index */
|
||||||
|
#include <media/tuner.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 1 = General debug messages
|
* 1 = General debug messages
|
||||||
* 2 = USB handling
|
* 2 = USB handling
|
||||||
@ -260,7 +263,7 @@ static void au0828_create_media_graph(struct au0828_dev *dev)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (tuner)
|
if (tuner)
|
||||||
media_create_pad_link(tuner, 0, decoder, 0,
|
media_create_pad_link(tuner, TUNER_PAD_IF_OUTPUT, decoder, 0,
|
||||||
MEDIA_LNK_FL_ENABLED);
|
MEDIA_LNK_FL_ENABLED);
|
||||||
media_create_pad_link(decoder, 1, &dev->vdev.entity, 0,
|
media_create_pad_link(decoder, 1, &dev->vdev.entity, 0,
|
||||||
MEDIA_LNK_FL_ENABLED);
|
MEDIA_LNK_FL_ENABLED);
|
||||||
|
@ -1264,7 +1264,7 @@ static void cx231xx_create_media_graph(struct cx231xx *dev)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (tuner)
|
if (tuner)
|
||||||
media_create_pad_link(tuner, 0, decoder, 0,
|
media_create_pad_link(tuner, TUNER_PAD_IF_OUTPUT, decoder, 0,
|
||||||
MEDIA_LNK_FL_ENABLED);
|
MEDIA_LNK_FL_ENABLED);
|
||||||
media_create_pad_link(decoder, 1, &dev->vdev.entity, 0,
|
media_create_pad_link(decoder, 1, &dev->vdev.entity, 0,
|
||||||
MEDIA_LNK_FL_ENABLED);
|
MEDIA_LNK_FL_ENABLED);
|
||||||
|
@ -134,8 +134,9 @@ struct tuner {
|
|||||||
unsigned int type; /* chip type id */
|
unsigned int type; /* chip type id */
|
||||||
void *config;
|
void *config;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
#if defined(CONFIG_MEDIA_CONTROLLER)
|
#if defined(CONFIG_MEDIA_CONTROLLER)
|
||||||
struct media_pad pad;
|
struct media_pad pad[TUNER_NUM_PADS];
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -695,11 +696,12 @@ static int tuner_probe(struct i2c_client *client,
|
|||||||
/* Should be just before return */
|
/* Should be just before return */
|
||||||
register_client:
|
register_client:
|
||||||
#if defined(CONFIG_MEDIA_CONTROLLER)
|
#if defined(CONFIG_MEDIA_CONTROLLER)
|
||||||
t->pad.flags = MEDIA_PAD_FL_SOURCE;
|
t->pad[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK;
|
||||||
|
t->pad[TUNER_PAD_IF_OUTPUT].flags = MEDIA_PAD_FL_SOURCE;
|
||||||
t->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_TUNER;
|
t->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_TUNER;
|
||||||
t->sd.entity.name = t->name;
|
t->sd.entity.name = t->name;
|
||||||
|
|
||||||
ret = media_entity_init(&t->sd.entity, 1, &t->pad);
|
ret = media_entity_init(&t->sd.entity, TUNER_NUM_PADS, &t->pad[0]);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
tuner_err("failed to initialize media entity!\n");
|
tuner_err("failed to initialize media entity!\n");
|
||||||
kfree(t);
|
kfree(t);
|
||||||
|
@ -21,6 +21,14 @@
|
|||||||
|
|
||||||
#include <linux/videodev2.h>
|
#include <linux/videodev2.h>
|
||||||
|
|
||||||
|
/* Tuner PADs */
|
||||||
|
/* FIXME: is this the right place for it? */
|
||||||
|
enum tuner_pad_index {
|
||||||
|
TUNER_PAD_RF_INPUT,
|
||||||
|
TUNER_PAD_IF_OUTPUT,
|
||||||
|
TUNER_NUM_PADS
|
||||||
|
};
|
||||||
|
|
||||||
#define ADDR_UNSET (255)
|
#define ADDR_UNSET (255)
|
||||||
|
|
||||||
#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */
|
#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */
|
||||||
|
Loading…
Reference in New Issue
Block a user