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

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
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -123,10 +123,13 @@ static int tuner_attach_tda18271(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);
	if (chan->demod_type == 1)
	case DEMOD_TYPE_DRXK:
		return tuner_attach_tda18271(chan);
	}

	return -EINVAL;
}

@@ -251,7 +254,7 @@ static int cineS2_probe(struct ngene_channel *chan)
		i2c = &chan->dev->channel[1].i2c_adapter;

	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];
		/* demod found, attach it */
		rc = demod_attach_stv0900(chan);
@@ -280,7 +283,7 @@ static int cineS2_probe(struct ngene_channel *chan)
			return -EIO;
		}
	} else if (port_has_drxk(i2c, chan->number^2)) {
		chan->demod_type = 1;
		chan->demod_type = DEMOD_TYPE_DRXK;
		demod_attach_drxk(chan, i2c);
	} else {
		dev_err(pdev, "No demod found on chan %d\n", chan->number);
+3 −0
Original line number Diff line number Diff line
@@ -51,6 +51,9 @@
#define VIDEO_CAP_MPEG4 512
#endif

#define DEMOD_TYPE_STV090X	0
#define DEMOD_TYPE_DRXK		1

enum STREAM {
	STREAM_VIDEOIN1 = 0,        /* ITU656 or TS Input */
	STREAM_VIDEOIN2,