From e08fef4fe271b640bab2bf794e82a4ef39f4c869 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 28 Sep 2008 02:24:44 -0300 Subject: [PATCH] --- yaml --- r: 114008 b: refs/heads/master c: 0975fc68719c75cbe14132c6f0dead57cd4d5210 h: refs/heads/master v: v3 --- [refs] | 2 +- .../media/common/tuners/tuner-xc2028.c | 33 ++++++++++++++----- .../media/common/tuners/tuner-xc2028.h | 8 ++++- .../drivers/media/video/cx23885/cx23885-dvb.c | 3 +- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index 47bd8d1dcd73..32ba132bd3d4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 767f3b3bf23244d52be0492df20b0eaf14f501c5 +refs/heads/master: 0975fc68719c75cbe14132c6f0dead57cd4d5210 diff --git a/trunk/drivers/media/common/tuners/tuner-xc2028.c b/trunk/drivers/media/common/tuners/tuner-xc2028.c index fc82d154c8c2..b65e6803e6c6 100644 --- a/trunk/drivers/media/common/tuners/tuner-xc2028.c +++ b/trunk/drivers/media/common/tuners/tuner-xc2028.c @@ -1013,11 +1013,6 @@ static int xc2028_set_params(struct dvb_frontend *fe, tuner_dbg("%s called\n", __func__); - if (priv->ctrl.d2633) - type |= D2633; - else - type |= D2620; - switch(fe->ops.info.type) { case FE_OFDM: bw = p->u.ofdm.bandwidth; @@ -1032,10 +1027,8 @@ static int xc2028_set_params(struct dvb_frontend *fe, break; case FE_ATSC: bw = BANDWIDTH_6_MHZ; - /* The only ATSC firmware (at least on v2.7) is D2633, - so overrides ctrl->d2633 */ - type |= ATSC| D2633; - type &= ~D2620; + /* The only ATSC firmware (at least on v2.7) is D2633 */ + type |= ATSC | D2633; break; /* DVB-S is not supported */ default: @@ -1068,6 +1061,28 @@ static int xc2028_set_params(struct dvb_frontend *fe, tuner_err("error: bandwidth not supported.\n"); }; + /* + Selects between D2633 or D2620 firmware. + It doesn't make sense for ATSC, since it should be D2633 on all cases + */ + if (fe->ops.info.type != FE_ATSC) { + switch (priv->ctrl.type) { + case XC2028_D2633: + type |= D2633; + break; + case XC2028_D2620: + type |= D2620; + break; + case XC2028_AUTO: + default: + /* Zarlink seems to need D2633 */ + if (priv->ctrl.demod == XC3028_FE_ZARLINK456) + type |= D2633; + else + type |= D2620; + } + } + /* All S-code tables need a 200kHz shift */ if (priv->ctrl.demod) demod = priv->ctrl.demod + 200; diff --git a/trunk/drivers/media/common/tuners/tuner-xc2028.h b/trunk/drivers/media/common/tuners/tuner-xc2028.h index 1af69f49f8e1..19de7928a74e 100644 --- a/trunk/drivers/media/common/tuners/tuner-xc2028.h +++ b/trunk/drivers/media/common/tuners/tuner-xc2028.h @@ -24,16 +24,22 @@ #define XC3028_FE_ZARLINK456 4560 #define XC3028_FE_CHINA 5200 +enum firmware_type { + XC2028_AUTO = 0, /* By default, auto-detects */ + XC2028_D2633, + XC2028_D2620, +}; + struct xc2028_ctrl { char *fname; int max_len; unsigned int scode_table; unsigned int mts :1; - unsigned int d2633 :1; unsigned int input1:1; unsigned int vhfbw7:1; unsigned int uhfbw8:1; unsigned int demod; + enum firmware_type type:2; }; struct xc2028_config { diff --git a/trunk/drivers/media/video/cx23885/cx23885-dvb.c b/trunk/drivers/media/video/cx23885/cx23885-dvb.c index 6c5475d7d321..24bd18327aa0 100644 --- a/trunk/drivers/media/video/cx23885/cx23885-dvb.c +++ b/trunk/drivers/media/video/cx23885/cx23885-dvb.c @@ -444,7 +444,8 @@ static int dvb_register(struct cx23885_tsport *port) .fname = XC3028L_DEFAULT_FIRMWARE, .max_len = 64, .demod = 5000, - .d2633 = 1 + /* This is true for all demods with v36 firmware? */ + .type = XC2028_D2633, }; fe = dvb_attach(xc2028_attach,