Skip to content

Commit

Permalink
media: dvb: use signal types to discover pads
Browse files Browse the repository at this point in the history
On tuner pads, multiple signals are present. Be sure to get
the right PAD by using them.

Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
mchehab committed Sep 17, 2018
1 parent caf276b commit f3efe15
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions drivers/media/dvb-core/dvbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ int dvb_create_media_graph(struct dvb_adapter *adap,
unsigned demux_pad = 0;
unsigned dvr_pad = 0;
unsigned ntuner = 0, ndemod = 0;
int ret;
int ret, pad_source, pad_sink;
static const char *connector_name = "Television";

if (!mdev)
Expand Down Expand Up @@ -681,30 +681,39 @@ int dvb_create_media_graph(struct dvb_adapter *adap,
if (ret)
return ret;

if (!ntuner)
if (!ntuner) {
ret = media_create_pad_links(mdev,
MEDIA_ENT_F_CONN_RF,
conn, 0,
MEDIA_ENT_F_DTV_DEMOD,
demod, 0,
MEDIA_LNK_FL_ENABLED,
false);
else
} else {
pad_sink = media_get_pad_index(tuner, true,
PAD_SIGNAL_ANALOG);
if (pad_sink < 0)
return -EINVAL;
ret = media_create_pad_links(mdev,
MEDIA_ENT_F_CONN_RF,
conn, 0,
MEDIA_ENT_F_TUNER,
tuner, TUNER_PAD_RF_INPUT,
tuner, pad_sink,
MEDIA_LNK_FL_ENABLED,
false);
}
if (ret)
return ret;
}

if (ntuner && ndemod) {
pad_source = media_get_pad_index(tuner, true,
PAD_SIGNAL_ANALOG);
if (pad_source)
return -EINVAL;
ret = media_create_pad_links(mdev,
MEDIA_ENT_F_TUNER,
tuner, TUNER_PAD_OUTPUT,
tuner, pad_source,
MEDIA_ENT_F_DTV_DEMOD,
demod, 0, MEDIA_LNK_FL_ENABLED,
false);
Expand Down

0 comments on commit f3efe15

Please sign in to comment.