From ca73dc99644bd2ae8ea754634279eeb0f959cba6 Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Fri, 12 Aug 2011 18:29:10 -0300 Subject: [PATCH] --- yaml --- r: 285151 b: refs/heads/master c: b682ad1d178d1686a4db07535d1e611342cde012 h: refs/heads/master i: 285149: 35a3f4532acd88ebccdf9da70cbaed5b8edc2907 285147: 5550e0f25641e66c2977abd23a0be7c873dd0e6d 285143: e5203b6546472df4f908e49384a3f539556dd6cf 285135: 8c72105a1d519b787ab4b38c543b3c56c2930b9c 285119: a467fa92f0aad123bd97422f5fc16f79cbf51e3a v: v3 --- [refs] | 2 +- trunk/drivers/media/common/tuners/tda18212.c | 49 ++++++++++++++++---- trunk/drivers/media/common/tuners/tda18212.h | 4 ++ 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 5c19e3864122..e94fccc272af 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 33cdf5b0e75142096d79cbe3cb7c3dc797499562 +refs/heads/master: b682ad1d178d1686a4db07535d1e611342cde012 diff --git a/trunk/drivers/media/common/tuners/tda18212.c b/trunk/drivers/media/common/tuners/tda18212.c index e29cc2bc113a..6374a1e010bf 100644 --- a/trunk/drivers/media/common/tuners/tda18212.c +++ b/trunk/drivers/media/common/tuners/tda18212.c @@ -136,12 +136,24 @@ static int tda18212_set_params(struct dvb_frontend *fe, int ret, i; u32 if_khz; u8 buf[9]; + #define DVBT_6 0 + #define DVBT_7 1 + #define DVBT_8 2 + #define DVBT2_6 3 + #define DVBT2_7 4 + #define DVBT2_8 5 + #define DVBC_6 6 + #define DVBC_8 7 static const u8 bw_params[][3] = { - /* 0f 13 23 */ - { 0xb3, 0x20, 0x03 }, /* DVB-T 6 MHz */ - { 0xb3, 0x31, 0x01 }, /* DVB-T 7 MHz */ - { 0xb3, 0x22, 0x01 }, /* DVB-T 8 MHz */ - { 0x92, 0x53, 0x03 }, /* DVB-C */ + /* reg: 0f 13 23 */ + [DVBT_6] = { 0xb3, 0x20, 0x03 }, + [DVBT_7] = { 0xb3, 0x31, 0x01 }, + [DVBT_8] = { 0xb3, 0x22, 0x01 }, + [DVBT2_6] = { 0xbc, 0x20, 0x03 }, + [DVBT2_7] = { 0xbc, 0x72, 0x03 }, + [DVBT2_8] = { 0xbc, 0x22, 0x01 }, + [DVBC_6] = { 0x92, 0x50, 0x03 }, + [DVBC_8] = { 0x92, 0x53, 0x03 }, }; dbg("delsys=%d RF=%d BW=%d\n", @@ -155,15 +167,34 @@ static int tda18212_set_params(struct dvb_frontend *fe, switch (c->bandwidth_hz) { case 6000000: if_khz = priv->cfg->if_dvbt_6; - i = 0; + i = DVBT_6; break; case 7000000: if_khz = priv->cfg->if_dvbt_7; - i = 1; + i = DVBT_7; break; case 8000000: if_khz = priv->cfg->if_dvbt_8; - i = 2; + i = DVBT_8; + break; + default: + ret = -EINVAL; + goto error; + } + break; + case SYS_DVBT2: + switch (c->bandwidth_hz) { + case 6000000: + if_khz = priv->cfg->if_dvbt2_6; + i = DVBT2_6; + break; + case 7000000: + if_khz = priv->cfg->if_dvbt2_7; + i = DVBT2_7; + break; + case 8000000: + if_khz = priv->cfg->if_dvbt2_8; + i = DVBT2_8; break; default: ret = -EINVAL; @@ -172,7 +203,7 @@ static int tda18212_set_params(struct dvb_frontend *fe, break; case SYS_DVBC_ANNEX_AC: if_khz = priv->cfg->if_dvbc; - i = 3; + i = DVBC_8; break; default: ret = -EINVAL; diff --git a/trunk/drivers/media/common/tuners/tda18212.h b/trunk/drivers/media/common/tuners/tda18212.h index 83b497f59e1b..9bd5da4aabb7 100644 --- a/trunk/drivers/media/common/tuners/tda18212.h +++ b/trunk/drivers/media/common/tuners/tda18212.h @@ -29,6 +29,10 @@ struct tda18212_config { u16 if_dvbt_6; u16 if_dvbt_7; u16 if_dvbt_8; + u16 if_dvbt2_5; + u16 if_dvbt2_6; + u16 if_dvbt2_7; + u16 if_dvbt2_8; u16 if_dvbc; };