提交 3fc46d35 编写于 作者: M Michael Krufky 提交者: Mauro Carvalho Chehab

V4L/DVB (3436): move config byte from tuner_params to tuner_range struct.

- Move config byte from tuner_params to tuner_range struct.
- dvb tuners must be able to set different config byte for each range.
Signed-off-by: NMichael Krufky <mkrufky@m1k.net>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 ab66b22f
...@@ -133,7 +133,7 @@ static int tuner_stereo(struct i2c_client *c) ...@@ -133,7 +133,7 @@ static int tuner_stereo(struct i2c_client *c)
static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
{ {
struct tuner *t = i2c_get_clientdata(c); struct tuner *t = i2c_get_clientdata(c);
u8 cb, tuneraddr; u8 config, cb, tuneraddr;
u16 div; u16 div;
struct tunertype *tun; struct tunertype *tun;
u8 buffer[4]; u8 buffer[4];
...@@ -152,6 +152,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) ...@@ -152,6 +152,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
freq, tun->params[j].ranges[i - 1].limit); freq, tun->params[j].ranges[i - 1].limit);
freq = tun->params[j].ranges[--i].limit; freq = tun->params[j].ranges[--i].limit;
} }
config = tun->params[j].ranges[i].config;
cb = tun->params[j].ranges[i].cb; cb = tun->params[j].ranges[i].cb;
/* i == 0 -> VHF_LO */ /* i == 0 -> VHF_LO */
/* i == 1 -> VHF_HI */ /* i == 1 -> VHF_HI */
...@@ -215,7 +216,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) ...@@ -215,7 +216,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
case TUNER_MICROTUNE_4042FI5: case TUNER_MICROTUNE_4042FI5:
/* Set the charge pump for fast tuning */ /* Set the charge pump for fast tuning */
tun->params[j].config |= TUNER_CHARGE_PUMP; config |= TUNER_CHARGE_PUMP;
break; break;
case TUNER_PHILIPS_TUV1236D: case TUNER_PHILIPS_TUV1236D:
...@@ -276,14 +277,14 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) ...@@ -276,14 +277,14 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
div); div);
if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) { if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) {
buffer[0] = tun->params[j].config; buffer[0] = config;
buffer[1] = cb; buffer[1] = cb;
buffer[2] = (div>>8) & 0x7f; buffer[2] = (div>>8) & 0x7f;
buffer[3] = div & 0xff; buffer[3] = div & 0xff;
} else { } else {
buffer[0] = (div>>8) & 0x7f; buffer[0] = (div>>8) & 0x7f;
buffer[1] = div & 0xff; buffer[1] = div & 0xff;
buffer[2] = tun->params[j].config; buffer[2] = config;
buffer[3] = cb; buffer[3] = cb;
} }
t->last_div = div; t->last_div = div;
...@@ -312,10 +313,10 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) ...@@ -312,10 +313,10 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
} }
/* Set the charge pump for optimized phase noise figure */ /* Set the charge pump for optimized phase noise figure */
tun->params[j].config &= ~TUNER_CHARGE_PUMP; config &= ~TUNER_CHARGE_PUMP;
buffer[0] = (div>>8) & 0x7f; buffer[0] = (div>>8) & 0x7f;
buffer[1] = div & 0xff; buffer[1] = div & 0xff;
buffer[2] = tun->params[j].config; buffer[2] = config;
buffer[3] = cb; buffer[3] = cb;
tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
buffer[0],buffer[1],buffer[2],buffer[3]); buffer[0],buffer[1],buffer[2],buffer[3]);
...@@ -337,7 +338,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) ...@@ -337,7 +338,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
j = TUNER_PARAM_ANALOG; j = TUNER_PARAM_ANALOG;
div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */ div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */
buffer[2] = (tun->params[j].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */ buffer[2] = (tun->params[j].ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */
switch (t->type) { switch (t->type) {
case TUNER_TENA_9533_DI: case TUNER_TENA_9533_DI:
......
此差异已折叠。
...@@ -14,6 +14,7 @@ enum param_type { ...@@ -14,6 +14,7 @@ enum param_type {
struct tuner_range { struct tuner_range {
unsigned short limit; unsigned short limit;
unsigned char config;
unsigned char cb; unsigned char cb;
}; };
...@@ -38,7 +39,6 @@ struct tuner_params { ...@@ -38,7 +39,6 @@ struct tuner_params {
* static unless the control byte was sent first. * static unless the control byte was sent first.
*/ */
unsigned int cb_first_if_lower_freq:1; unsigned int cb_first_if_lower_freq:1;
unsigned char config; /* to be moved into struct tuner_range for dvb-pll merge */
unsigned int count; unsigned int count;
struct tuner_range *ranges; struct tuner_range *ranges;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册