Commit 66a4c0c7 authored by Daniel Scheller's avatar Daniel Scheller Committed by Mauro Carvalho Chehab

media: ngene: use defines to identify the demod_type

Make it more clear which demod_type is used for which hardware by having
defines for the possible demod_type values. With that, change the
demod_type evaluation in tuner_attach_probe() to a switch-case instead
of an if() for each possible value.
Signed-off-by: default avatarDaniel Scheller <d.scheller@gmx.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 6795bf62
...@@ -123,10 +123,13 @@ static int tuner_attach_tda18271(struct ngene_channel *chan) ...@@ -123,10 +123,13 @@ static int tuner_attach_tda18271(struct ngene_channel *chan)
static int tuner_attach_probe(struct ngene_channel *chan) static int tuner_attach_probe(struct ngene_channel *chan)
{ {
if (chan->demod_type == 0) switch (chan->demod_type) {
case DEMOD_TYPE_STV090X:
return tuner_attach_stv6110(chan); return tuner_attach_stv6110(chan);
if (chan->demod_type == 1) case DEMOD_TYPE_DRXK:
return tuner_attach_tda18271(chan); return tuner_attach_tda18271(chan);
}
return -EINVAL; return -EINVAL;
} }
...@@ -251,7 +254,7 @@ static int cineS2_probe(struct ngene_channel *chan) ...@@ -251,7 +254,7 @@ static int cineS2_probe(struct ngene_channel *chan)
i2c = &chan->dev->channel[1].i2c_adapter; i2c = &chan->dev->channel[1].i2c_adapter;
if (port_has_stv0900(i2c, chan->number)) { if (port_has_stv0900(i2c, chan->number)) {
chan->demod_type = 0; chan->demod_type = DEMOD_TYPE_STV090X;
fe_conf = chan->dev->card_info->fe_config[chan->number]; fe_conf = chan->dev->card_info->fe_config[chan->number];
/* demod found, attach it */ /* demod found, attach it */
rc = demod_attach_stv0900(chan); rc = demod_attach_stv0900(chan);
...@@ -280,7 +283,7 @@ static int cineS2_probe(struct ngene_channel *chan) ...@@ -280,7 +283,7 @@ static int cineS2_probe(struct ngene_channel *chan)
return -EIO; return -EIO;
} }
} else if (port_has_drxk(i2c, chan->number^2)) { } else if (port_has_drxk(i2c, chan->number^2)) {
chan->demod_type = 1; chan->demod_type = DEMOD_TYPE_DRXK;
demod_attach_drxk(chan, i2c); demod_attach_drxk(chan, i2c);
} else { } else {
dev_err(pdev, "No demod found on chan %d\n", chan->number); dev_err(pdev, "No demod found on chan %d\n", chan->number);
......
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
#define VIDEO_CAP_MPEG4 512 #define VIDEO_CAP_MPEG4 512
#endif #endif
#define DEMOD_TYPE_STV090X 0
#define DEMOD_TYPE_DRXK 1
enum STREAM { enum STREAM {
STREAM_VIDEOIN1 = 0, /* ITU656 or TS Input */ STREAM_VIDEOIN1 = 0, /* ITU656 or TS Input */
STREAM_VIDEOIN2, STREAM_VIDEOIN2,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment