diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-15 12:22:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-15 12:22:18 -0400 |
commit | 043fe50f8085c12651c96f04576eae4d8a22f3d8 (patch) | |
tree | 214b4f985ce7d3b1a4961620e2c2f4f5f06e1c35 /drivers/media/dvb | |
parent | 227423904c709a8e60245c97081bbeb4fb500655 (diff) | |
parent | ea47689e74a1637fac4f5fc44890f3662c976849 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (213 commits)
V4L/DVB (12720): em28xx-cards: Add vendor/product id for Kworld DVD Maker 2
V4L/DVB (12713): em28xx: Cleanups at ir_i2c handler
V4L/DVB (12712): em28xx: properly load ir-kbd-i2c when needed
V4L/DVB (12701): saa7134: ir-kbd-i2c init data needs a persistent object
V4L/DVB (12699): cx18: ir-kbd-i2c initialization data should point to a persistent object
V4L/DVB (12698): em28xx: ir-kbd-i2c init data needs a persistent object
V4L/DVB (12707): gspca - sn9c20x: Add SXGA support to MT9M111
V4L/DVB (12706): gspca - sn9c20x: disable exposure/gain controls for MT9M111 sensors.
V4L/DVB (12705): gspca - sn9c20x: Add SXGA support to SOI968
V4L/DVB (12703): gspca - sn9c20x: Reduces size of object
V4L/DVB (12704): gspca - sn9c20x: Fix exposure on SOI968 sensors
V4L/DVB (12696): gspca - sonixj / sn9c102: Two drivers for 0c45:60fc and 0c45:613e.
V4L/DVB (12695): gspca - vc032x: Do the LED work with the sensor hv7131r.
V4L/DVB (12694): gspca - vc032x: Change the start exchanges of the sensor hv7131r.
V4L/DVB (12693): gspca - sunplus: The brightness is signed.
V4L/DVB (12692): gspca - sunplus: Optimize code.
V4L/DVB (12691): gspca - sonixj: Don't use mdelay().
V4L/DVB (12690): gspca - pac7311: Webcam 06f8:3009 added.
V4L/DVB (12686): dvb-core: check supported QAM modulations
V4L/DVB (12685): dvb-core: check fe->ops.set_frontend return value
...
Diffstat (limited to 'drivers/media/dvb')
62 files changed, 2917 insertions, 1637 deletions
diff --git a/drivers/media/dvb/Kconfig b/drivers/media/dvb/Kconfig index b0198691892a..1d0e4b1ef10c 100644 --- a/drivers/media/dvb/Kconfig +++ b/drivers/media/dvb/Kconfig | |||
@@ -2,6 +2,19 @@ | |||
2 | # DVB device configuration | 2 | # DVB device configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | config DVB_MAX_ADAPTERS | ||
6 | int "maximum number of DVB/ATSC adapters" | ||
7 | depends on DVB_CORE | ||
8 | default 8 | ||
9 | range 1 255 | ||
10 | help | ||
11 | Maximum number of DVB/ATSC adapters. Increasing this number | ||
12 | increases the memory consumption of the DVB subsystem even | ||
13 | if a much lower number of DVB/ATSC adapters is present. | ||
14 | Only values in the range 4-32 are tested. | ||
15 | |||
16 | If you are unsure about this, use the default value 8 | ||
17 | |||
5 | config DVB_DYNAMIC_MINORS | 18 | config DVB_DYNAMIC_MINORS |
6 | bool "Dynamic DVB minor allocation" | 19 | bool "Dynamic DVB minor allocation" |
7 | depends on DVB_CORE | 20 | depends on DVB_CORE |
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c index 9a6307a347b2..850a6c606750 100644 --- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c +++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c | |||
@@ -66,7 +66,7 @@ static int flexcop_sleep(struct dvb_frontend* fe) | |||
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | /* SkyStar2 DVB-S rev 2.3 */ | 68 | /* SkyStar2 DVB-S rev 2.3 */ |
69 | #if FE_SUPPORTED(MT312) | 69 | #if FE_SUPPORTED(MT312) && FE_SUPPORTED(PLL) |
70 | static int flexcop_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone) | 70 | static int flexcop_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone) |
71 | { | 71 | { |
72 | /* u16 wz_half_period_for_45_mhz[] = { 0x01ff, 0x0154, 0x00ff, 0x00cc }; */ | 72 | /* u16 wz_half_period_for_45_mhz[] = { 0x01ff, 0x0154, 0x00ff, 0x00cc }; */ |
@@ -155,55 +155,34 @@ static struct mt312_config skystar23_samsung_tbdu18132_config = { | |||
155 | .demod_address = 0x0e, | 155 | .demod_address = 0x0e, |
156 | }; | 156 | }; |
157 | 157 | ||
158 | static int skystar23_samsung_tbdu18132_tuner_set_params(struct dvb_frontend *fe, | ||
159 | struct dvb_frontend_parameters *params) | ||
160 | { | ||
161 | u8 buf[4]; | ||
162 | u32 div; | ||
163 | struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, | ||
164 | .len = sizeof(buf) }; | ||
165 | struct flexcop_device *fc = fe->dvb->priv; | ||
166 | div = (params->frequency + (125/2)) / 125; | ||
167 | |||
168 | buf[0] = (div >> 8) & 0x7f; | ||
169 | buf[1] = (div >> 0) & 0xff; | ||
170 | buf[2] = 0x84 | ((div >> 10) & 0x60); | ||
171 | buf[3] = 0x80; | ||
172 | |||
173 | if (params->frequency < 1550000) | ||
174 | buf[3] |= 0x02; | ||
175 | |||
176 | if (fe->ops.i2c_gate_ctrl) | ||
177 | fe->ops.i2c_gate_ctrl(fe, 1); | ||
178 | if (i2c_transfer(&fc->fc_i2c_adap[0].i2c_adap, &msg, 1) != 1) | ||
179 | return -EIO; | ||
180 | return 0; | ||
181 | } | ||
182 | |||
183 | static int skystar2_rev23_attach(struct flexcop_device *fc, | 158 | static int skystar2_rev23_attach(struct flexcop_device *fc, |
184 | struct i2c_adapter *i2c) | 159 | struct i2c_adapter *i2c) |
185 | { | 160 | { |
161 | struct dvb_frontend_ops *ops; | ||
162 | |||
186 | fc->fe = dvb_attach(mt312_attach, &skystar23_samsung_tbdu18132_config, i2c); | 163 | fc->fe = dvb_attach(mt312_attach, &skystar23_samsung_tbdu18132_config, i2c); |
187 | if (fc->fe != NULL) { | 164 | if (!fc->fe) |
188 | struct dvb_frontend_ops *ops = &fc->fe->ops; | 165 | return 0; |
189 | ops->tuner_ops.set_params = | 166 | |
190 | skystar23_samsung_tbdu18132_tuner_set_params; | 167 | if (!dvb_attach(dvb_pll_attach, fc->fe, 0x61, i2c, |
191 | ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd; | 168 | DVB_PLL_SAMSUNG_TBDU18132)) |
192 | ops->diseqc_send_burst = flexcop_diseqc_send_burst; | 169 | return 0; |
193 | ops->set_tone = flexcop_set_tone; | 170 | |
194 | ops->set_voltage = flexcop_set_voltage; | 171 | ops = &fc->fe->ops; |
195 | fc->fe_sleep = ops->sleep; | 172 | ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd; |
196 | ops->sleep = flexcop_sleep; | 173 | ops->diseqc_send_burst = flexcop_diseqc_send_burst; |
197 | return 1; | 174 | ops->set_tone = flexcop_set_tone; |
198 | } | 175 | ops->set_voltage = flexcop_set_voltage; |
199 | return 0; | 176 | fc->fe_sleep = ops->sleep; |
177 | ops->sleep = flexcop_sleep; | ||
178 | return 1; | ||
200 | } | 179 | } |
201 | #else | 180 | #else |
202 | #define skystar2_rev23_attach NULL | 181 | #define skystar2_rev23_attach NULL |
203 | #endif | 182 | #endif |
204 | 183 | ||
205 | /* SkyStar2 DVB-S rev 2.6 */ | 184 | /* SkyStar2 DVB-S rev 2.6 */ |
206 | #if FE_SUPPORTED(STV0299) | 185 | #if FE_SUPPORTED(STV0299) && FE_SUPPORTED(PLL) |
207 | static int samsung_tbmu24112_set_symbol_rate(struct dvb_frontend *fe, | 186 | static int samsung_tbmu24112_set_symbol_rate(struct dvb_frontend *fe, |
208 | u32 srate, u32 ratio) | 187 | u32 srate, u32 ratio) |
209 | { | 188 | { |
@@ -232,31 +211,6 @@ static int samsung_tbmu24112_set_symbol_rate(struct dvb_frontend *fe, | |||
232 | return 0; | 211 | return 0; |
233 | } | 212 | } |
234 | 213 | ||
235 | static int samsung_tbmu24112_tuner_set_params(struct dvb_frontend *fe, | ||
236 | struct dvb_frontend_parameters *params) | ||
237 | { | ||
238 | u8 buf[4]; | ||
239 | u32 div; | ||
240 | struct i2c_msg msg = { | ||
241 | .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) }; | ||
242 | struct flexcop_device *fc = fe->dvb->priv; | ||
243 | div = params->frequency / 125; | ||
244 | |||
245 | buf[0] = (div >> 8) & 0x7f; | ||
246 | buf[1] = div & 0xff; | ||
247 | buf[2] = 0x84; /* 0xC4 */ | ||
248 | buf[3] = 0x08; | ||
249 | |||
250 | if (params->frequency < 1500000) | ||
251 | buf[3] |= 0x10; | ||
252 | |||
253 | if (fe->ops.i2c_gate_ctrl) | ||
254 | fe->ops.i2c_gate_ctrl(fe, 1); | ||
255 | if (i2c_transfer(&fc->fc_i2c_adap[0].i2c_adap, &msg, 1) != 1) | ||
256 | return -EIO; | ||
257 | return 0; | ||
258 | } | ||
259 | |||
260 | static u8 samsung_tbmu24112_inittab[] = { | 214 | static u8 samsung_tbmu24112_inittab[] = { |
261 | 0x01, 0x15, | 215 | 0x01, 0x15, |
262 | 0x02, 0x30, | 216 | 0x02, 0x30, |
@@ -318,15 +272,18 @@ static int skystar2_rev26_attach(struct flexcop_device *fc, | |||
318 | struct i2c_adapter *i2c) | 272 | struct i2c_adapter *i2c) |
319 | { | 273 | { |
320 | fc->fe = dvb_attach(stv0299_attach, &samsung_tbmu24112_config, i2c); | 274 | fc->fe = dvb_attach(stv0299_attach, &samsung_tbmu24112_config, i2c); |
321 | if (fc->fe != NULL) { | 275 | if (!fc->fe) |
322 | struct dvb_frontend_ops *ops = &fc->fe->ops; | 276 | return 0; |
323 | ops->tuner_ops.set_params = samsung_tbmu24112_tuner_set_params; | 277 | |
324 | ops->set_voltage = flexcop_set_voltage; | 278 | if (!dvb_attach(dvb_pll_attach, fc->fe, 0x61, i2c, |
325 | fc->fe_sleep = ops->sleep; | 279 | DVB_PLL_SAMSUNG_TBMU24112)) |
326 | ops->sleep = flexcop_sleep; | 280 | return 0; |
327 | return 1; | 281 | |
328 | } | 282 | fc->fe->ops.set_voltage = flexcop_set_voltage; |
329 | return 0; | 283 | fc->fe_sleep = fc->fe->ops.sleep; |
284 | fc->fe->ops.sleep = flexcop_sleep; | ||
285 | return 1; | ||
286 | |||
330 | } | 287 | } |
331 | #else | 288 | #else |
332 | #define skystar2_rev26_attach NULL | 289 | #define skystar2_rev26_attach NULL |
@@ -421,7 +378,7 @@ static int skystar2_rev28_attach(struct flexcop_device *fc, | |||
421 | if (!fc->fe) | 378 | if (!fc->fe) |
422 | return 0; | 379 | return 0; |
423 | 380 | ||
424 | i2c_tuner = cx24123_get_tuner_i2c_adapter(fc->fe);; | 381 | i2c_tuner = cx24123_get_tuner_i2c_adapter(fc->fe); |
425 | if (!i2c_tuner) | 382 | if (!i2c_tuner) |
426 | return 0; | 383 | return 0; |
427 | 384 | ||
@@ -449,7 +406,7 @@ static int skystar2_rev28_attach(struct flexcop_device *fc, | |||
449 | #endif | 406 | #endif |
450 | 407 | ||
451 | /* AirStar DVB-T */ | 408 | /* AirStar DVB-T */ |
452 | #if FE_SUPPORTED(MT352) | 409 | #if FE_SUPPORTED(MT352) && FE_SUPPORTED(PLL) |
453 | static int samsung_tdtc9251dh0_demod_init(struct dvb_frontend *fe) | 410 | static int samsung_tdtc9251dh0_demod_init(struct dvb_frontend *fe) |
454 | { | 411 | { |
455 | static u8 mt352_clock_config[] = { 0x89, 0x18, 0x2d }; | 412 | static u8 mt352_clock_config[] = { 0x89, 0x18, 0x2d }; |
@@ -467,32 +424,6 @@ static int samsung_tdtc9251dh0_demod_init(struct dvb_frontend *fe) | |||
467 | return 0; | 424 | return 0; |
468 | } | 425 | } |
469 | 426 | ||
470 | static int samsung_tdtc9251dh0_calc_regs(struct dvb_frontend *fe, | ||
471 | struct dvb_frontend_parameters *params, u8* pllbuf, int buf_len) | ||
472 | { | ||
473 | u32 div; | ||
474 | unsigned char bs = 0; | ||
475 | |||
476 | if (buf_len < 5) | ||
477 | return -EINVAL; | ||
478 | |||
479 | #define IF_FREQUENCYx6 217 /* 6 * 36.16666666667MHz */ | ||
480 | div = (((params->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; | ||
481 | if (params->frequency >= 48000000 && params->frequency <= 154000000) \ | ||
482 | bs = 0x09; | ||
483 | if (params->frequency >= 161000000 && params->frequency <= 439000000) \ | ||
484 | bs = 0x0a; | ||
485 | if (params->frequency >= 447000000 && params->frequency <= 863000000) \ | ||
486 | bs = 0x08; | ||
487 | |||
488 | pllbuf[0] = 0x61; | ||
489 | pllbuf[1] = div >> 8; | ||
490 | pllbuf[2] = div & 0xff; | ||
491 | pllbuf[3] = 0xcc; | ||
492 | pllbuf[4] = bs; | ||
493 | return 5; | ||
494 | } | ||
495 | |||
496 | static struct mt352_config samsung_tdtc9251dh0_config = { | 427 | static struct mt352_config samsung_tdtc9251dh0_config = { |
497 | .demod_address = 0x0f, | 428 | .demod_address = 0x0f, |
498 | .demod_init = samsung_tdtc9251dh0_demod_init, | 429 | .demod_init = samsung_tdtc9251dh0_demod_init, |
@@ -502,11 +433,11 @@ static int airstar_dvbt_attach(struct flexcop_device *fc, | |||
502 | struct i2c_adapter *i2c) | 433 | struct i2c_adapter *i2c) |
503 | { | 434 | { |
504 | fc->fe = dvb_attach(mt352_attach, &samsung_tdtc9251dh0_config, i2c); | 435 | fc->fe = dvb_attach(mt352_attach, &samsung_tdtc9251dh0_config, i2c); |
505 | if (fc->fe != NULL) { | 436 | if (!fc->fe) |
506 | fc->fe->ops.tuner_ops.calc_regs = samsung_tdtc9251dh0_calc_regs; | 437 | return 0; |
507 | return 1; | 438 | |
508 | } | 439 | return !!dvb_attach(dvb_pll_attach, fc->fe, 0x61, NULL, |
509 | return 0; | 440 | DVB_PLL_SAMSUNG_TDTC9251DH0); |
510 | } | 441 | } |
511 | #else | 442 | #else |
512 | #define airstar_dvbt_attach NULL | 443 | #define airstar_dvbt_attach NULL |
@@ -580,54 +511,7 @@ static int airstar_atsc3_attach(struct flexcop_device *fc, | |||
580 | #endif | 511 | #endif |
581 | 512 | ||
582 | /* CableStar2 DVB-C */ | 513 | /* CableStar2 DVB-C */ |
583 | #if FE_SUPPORTED(STV0297) | 514 | #if FE_SUPPORTED(STV0297) && FE_SUPPORTED(PLL) |
584 | static int alps_tdee4_stv0297_tuner_set_params(struct dvb_frontend* fe, | ||
585 | struct dvb_frontend_parameters *fep) | ||
586 | { | ||
587 | struct flexcop_device *fc = fe->dvb->priv; | ||
588 | u8 buf[4]; | ||
589 | u16 div; | ||
590 | int ret; | ||
591 | |||
592 | /* 62.5 kHz * 10 */ | ||
593 | #define REF_FREQ 625 | ||
594 | #define FREQ_OFFSET 36125 | ||
595 | |||
596 | div = ((fep->frequency/1000 + FREQ_OFFSET) * 10) / REF_FREQ; | ||
597 | /* 4 MHz = 4000 KHz */ | ||
598 | |||
599 | buf[0] = (u8)( div >> 8) & 0x7f; | ||
600 | buf[1] = (u8) div & 0xff; | ||
601 | |||
602 | /* F(osc) = N * Reference Freq. (62.5 kHz) | ||
603 | * byte 2 : 0 N14 N13 N12 N11 N10 N9 N8 | ||
604 | * byte 3 : N7 N6 N5 N4 N3 N2 N1 N0 | ||
605 | * byte 4 : 1 * * AGD R3 R2 R1 R0 | ||
606 | * byte 5 : C1 * RE RTS BS4 BS3 BS2 BS1 | ||
607 | * AGD = 1, R3 R2 R1 R0 = 0 1 0 1 => byte 4 = 1**10101 = 0x95 */ | ||
608 | buf[2] = 0x95; | ||
609 | |||
610 | /* Range(MHz) C1 * RE RTS BS4 BS3 BS2 BS1 Byte 5 | ||
611 | * 47 - 153 0 * 0 0 0 0 0 1 0x01 | ||
612 | * 153 - 430 0 * 0 0 0 0 1 0 0x02 | ||
613 | * 430 - 822 0 * 0 0 1 0 0 0 0x08 | ||
614 | * 822 - 862 1 * 0 0 1 0 0 0 0x88 */ | ||
615 | |||
616 | if (fep->frequency <= 153000000) buf[3] = 0x01; | ||
617 | else if (fep->frequency <= 430000000) buf[3] = 0x02; | ||
618 | else if (fep->frequency <= 822000000) buf[3] = 0x08; | ||
619 | else buf[3] = 0x88; | ||
620 | |||
621 | if (fe->ops.i2c_gate_ctrl) | ||
622 | fe->ops.i2c_gate_ctrl(fe, 0); | ||
623 | deb_tuner("tuner buffer for %d Hz: %x %x %x %x\n", fep->frequency, | ||
624 | buf[0], buf[1], buf[2], buf[3]); | ||
625 | ret = fc->i2c_request(&fc->fc_i2c_adap[2], | ||
626 | FC_WRITE, 0x61, buf[0], &buf[1], 3); | ||
627 | deb_tuner("tuner write returned: %d\n",ret); | ||
628 | return ret; | ||
629 | } | ||
630 | |||
631 | static u8 alps_tdee4_stv0297_inittab[] = { | 515 | static u8 alps_tdee4_stv0297_inittab[] = { |
632 | 0x80, 0x01, | 516 | 0x80, 0x01, |
633 | 0x80, 0x00, | 517 | 0x80, 0x00, |
@@ -711,13 +595,25 @@ static int cablestar2_attach(struct flexcop_device *fc, | |||
711 | { | 595 | { |
712 | fc->fc_i2c_adap[0].no_base_addr = 1; | 596 | fc->fc_i2c_adap[0].no_base_addr = 1; |
713 | fc->fe = dvb_attach(stv0297_attach, &alps_tdee4_stv0297_config, i2c); | 597 | fc->fe = dvb_attach(stv0297_attach, &alps_tdee4_stv0297_config, i2c); |
714 | if (!fc->fe) { | 598 | if (!fc->fe) |
715 | /* Reset for next frontend to try */ | 599 | goto fail; |
716 | fc->fc_i2c_adap[0].no_base_addr = 0; | 600 | |
717 | return 0; | 601 | /* This tuner doesn't use the stv0297's I2C gate, but instead the |
718 | } | 602 | * tuner is connected to a different flexcop I2C adapter. */ |
719 | fc->fe->ops.tuner_ops.set_params = alps_tdee4_stv0297_tuner_set_params; | 603 | if (fc->fe->ops.i2c_gate_ctrl) |
604 | fc->fe->ops.i2c_gate_ctrl(fc->fe, 0); | ||
605 | fc->fe->ops.i2c_gate_ctrl = NULL; | ||
606 | |||
607 | if (!dvb_attach(dvb_pll_attach, fc->fe, 0x61, | ||
608 | &fc->fc_i2c_adap[2].i2c_adap, DVB_PLL_TDEE4)) | ||
609 | goto fail; | ||
610 | |||
720 | return 1; | 611 | return 1; |
612 | |||
613 | fail: | ||
614 | /* Reset for next frontend to try */ | ||
615 | fc->fc_i2c_adap[0].no_base_addr = 0; | ||
616 | return 0; | ||
721 | } | 617 | } |
722 | #else | 618 | #else |
723 | #define cablestar2_attach NULL | 619 | #define cablestar2_attach NULL |
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c index fec1d77fa855..91353a6faf1d 100644 --- a/drivers/media/dvb/bt8xx/dst.c +++ b/drivers/media/dvb/bt8xx/dst.c | |||
@@ -1059,7 +1059,7 @@ static int dst_get_tuner_info(struct dst_state *state) | |||
1059 | dprintk(verbose, DST_ERROR, 1, "DST type has TS=188"); | 1059 | dprintk(verbose, DST_ERROR, 1, "DST type has TS=188"); |
1060 | } | 1060 | } |
1061 | if (state->board_info[0] == 0xbc) { | 1061 | if (state->board_info[0] == 0xbc) { |
1062 | if (state->type_flags != DST_TYPE_IS_ATSC) | 1062 | if (state->dst_type != DST_TYPE_IS_ATSC) |
1063 | state->type_flags |= DST_TYPE_HAS_TS188; | 1063 | state->type_flags |= DST_TYPE_HAS_TS188; |
1064 | else | 1064 | else |
1065 | state->type_flags |= DST_TYPE_HAS_NEWTUNE_2; | 1065 | state->type_flags |= DST_TYPE_HAS_NEWTUNE_2; |
diff --git a/drivers/media/dvb/dm1105/dm1105.c b/drivers/media/dvb/dm1105/dm1105.c index 4dbd7d4185af..2d099e271751 100644 --- a/drivers/media/dvb/dm1105/dm1105.c +++ b/drivers/media/dvb/dm1105/dm1105.c | |||
@@ -44,6 +44,14 @@ | |||
44 | #include "cx24116.h" | 44 | #include "cx24116.h" |
45 | #include "z0194a.h" | 45 | #include "z0194a.h" |
46 | 46 | ||
47 | #define UNSET (-1U) | ||
48 | |||
49 | #define DM1105_BOARD_NOAUTO UNSET | ||
50 | #define DM1105_BOARD_UNKNOWN 0 | ||
51 | #define DM1105_BOARD_DVBWORLD_2002 1 | ||
52 | #define DM1105_BOARD_DVBWORLD_2004 2 | ||
53 | #define DM1105_BOARD_AXESS_DM05 3 | ||
54 | |||
47 | /* ----------------------------------------------- */ | 55 | /* ----------------------------------------------- */ |
48 | /* | 56 | /* |
49 | * PCI ID's | 57 | * PCI ID's |
@@ -153,20 +161,105 @@ | |||
153 | 161 | ||
154 | /* GPIO's for LNB power control */ | 162 | /* GPIO's for LNB power control */ |
155 | #define DM1105_LNB_MASK 0x00000000 | 163 | #define DM1105_LNB_MASK 0x00000000 |
164 | #define DM1105_LNB_OFF 0x00020000 | ||
156 | #define DM1105_LNB_13V 0x00010100 | 165 | #define DM1105_LNB_13V 0x00010100 |
157 | #define DM1105_LNB_18V 0x00000100 | 166 | #define DM1105_LNB_18V 0x00000100 |
158 | 167 | ||
159 | /* GPIO's for LNB power control for Axess DM05 */ | 168 | /* GPIO's for LNB power control for Axess DM05 */ |
160 | #define DM05_LNB_MASK 0x00000000 | 169 | #define DM05_LNB_MASK 0x00000000 |
170 | #define DM05_LNB_OFF 0x00020000/* actually 13v */ | ||
161 | #define DM05_LNB_13V 0x00020000 | 171 | #define DM05_LNB_13V 0x00020000 |
162 | #define DM05_LNB_18V 0x00030000 | 172 | #define DM05_LNB_18V 0x00030000 |
163 | 173 | ||
174 | static unsigned int card[] = {[0 ... 3] = UNSET }; | ||
175 | module_param_array(card, int, NULL, 0444); | ||
176 | MODULE_PARM_DESC(card, "card type"); | ||
177 | |||
164 | static int ir_debug; | 178 | static int ir_debug; |
165 | module_param(ir_debug, int, 0644); | 179 | module_param(ir_debug, int, 0644); |
166 | MODULE_PARM_DESC(ir_debug, "enable debugging information for IR decoding"); | 180 | MODULE_PARM_DESC(ir_debug, "enable debugging information for IR decoding"); |
167 | 181 | ||
182 | static unsigned int dm1105_devcount; | ||
183 | |||
168 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 184 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
169 | 185 | ||
186 | struct dm1105_board { | ||
187 | char *name; | ||
188 | }; | ||
189 | |||
190 | struct dm1105_subid { | ||
191 | u16 subvendor; | ||
192 | u16 subdevice; | ||
193 | u32 card; | ||
194 | }; | ||
195 | |||
196 | static const struct dm1105_board dm1105_boards[] = { | ||
197 | [DM1105_BOARD_UNKNOWN] = { | ||
198 | .name = "UNKNOWN/GENERIC", | ||
199 | }, | ||
200 | [DM1105_BOARD_DVBWORLD_2002] = { | ||
201 | .name = "DVBWorld PCI 2002", | ||
202 | }, | ||
203 | [DM1105_BOARD_DVBWORLD_2004] = { | ||
204 | .name = "DVBWorld PCI 2004", | ||
205 | }, | ||
206 | [DM1105_BOARD_AXESS_DM05] = { | ||
207 | .name = "Axess/EasyTv DM05", | ||
208 | }, | ||
209 | }; | ||
210 | |||
211 | static const struct dm1105_subid dm1105_subids[] = { | ||
212 | { | ||
213 | .subvendor = 0x0000, | ||
214 | .subdevice = 0x2002, | ||
215 | .card = DM1105_BOARD_DVBWORLD_2002, | ||
216 | }, { | ||
217 | .subvendor = 0x0001, | ||
218 | .subdevice = 0x2002, | ||
219 | .card = DM1105_BOARD_DVBWORLD_2002, | ||
220 | }, { | ||
221 | .subvendor = 0x0000, | ||
222 | .subdevice = 0x2004, | ||
223 | .card = DM1105_BOARD_DVBWORLD_2004, | ||
224 | }, { | ||
225 | .subvendor = 0x0001, | ||
226 | .subdevice = 0x2004, | ||
227 | .card = DM1105_BOARD_DVBWORLD_2004, | ||
228 | }, { | ||
229 | .subvendor = 0x195d, | ||
230 | .subdevice = 0x1105, | ||
231 | .card = DM1105_BOARD_AXESS_DM05, | ||
232 | }, | ||
233 | }; | ||
234 | |||
235 | static void dm1105_card_list(struct pci_dev *pci) | ||
236 | { | ||
237 | int i; | ||
238 | |||
239 | if (0 == pci->subsystem_vendor && | ||
240 | 0 == pci->subsystem_device) { | ||
241 | printk(KERN_ERR | ||
242 | "dm1105: Your board has no valid PCI Subsystem ID\n" | ||
243 | "dm1105: and thus can't be autodetected\n" | ||
244 | "dm1105: Please pass card=<n> insmod option to\n" | ||
245 | "dm1105: workaround that. Redirect complaints to\n" | ||
246 | "dm1105: the vendor of the TV card. Best regards,\n" | ||
247 | "dm1105: -- tux\n"); | ||
248 | } else { | ||
249 | printk(KERN_ERR | ||
250 | "dm1105: Your board isn't known (yet) to the driver.\n" | ||
251 | "dm1105: You can try to pick one of the existing\n" | ||
252 | "dm1105: card configs via card=<n> insmod option.\n" | ||
253 | "dm1105: Updating to the latest version might help\n" | ||
254 | "dm1105: as well.\n"); | ||
255 | } | ||
256 | printk(KERN_ERR "Here is a list of valid choices for the card=<n> " | ||
257 | "insmod option:\n"); | ||
258 | for (i = 0; i < ARRAY_SIZE(dm1105_boards); i++) | ||
259 | printk(KERN_ERR "dm1105: card=%d -> %s\n", | ||
260 | i, dm1105_boards[i].name); | ||
261 | } | ||
262 | |||
170 | /* infrared remote control */ | 263 | /* infrared remote control */ |
171 | struct infrared { | 264 | struct infrared { |
172 | struct input_dev *input_dev; | 265 | struct input_dev *input_dev; |
@@ -193,6 +286,8 @@ struct dm1105dvb { | |||
193 | struct dvb_frontend *fe; | 286 | struct dvb_frontend *fe; |
194 | struct dvb_net dvbnet; | 287 | struct dvb_net dvbnet; |
195 | unsigned int full_ts_users; | 288 | unsigned int full_ts_users; |
289 | unsigned int boardnr; | ||
290 | int nr; | ||
196 | 291 | ||
197 | /* i2c */ | 292 | /* i2c */ |
198 | struct i2c_adapter i2c_adap; | 293 | struct i2c_adapter i2c_adap; |
@@ -211,7 +306,6 @@ struct dm1105dvb { | |||
211 | unsigned int PacketErrorCount; | 306 | unsigned int PacketErrorCount; |
212 | unsigned int dmarst; | 307 | unsigned int dmarst; |
213 | spinlock_t lock; | 308 | spinlock_t lock; |
214 | |||
215 | }; | 309 | }; |
216 | 310 | ||
217 | #define dm_io_mem(reg) ((unsigned long)(&dm1105dvb->io_mem[reg])) | 311 | #define dm_io_mem(reg) ((unsigned long)(&dm1105dvb->io_mem[reg])) |
@@ -326,16 +420,20 @@ static inline struct dm1105dvb *frontend_to_dm1105dvb(struct dvb_frontend *fe) | |||
326 | static int dm1105dvb_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) | 420 | static int dm1105dvb_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) |
327 | { | 421 | { |
328 | struct dm1105dvb *dm1105dvb = frontend_to_dm1105dvb(fe); | 422 | struct dm1105dvb *dm1105dvb = frontend_to_dm1105dvb(fe); |
329 | u32 lnb_mask, lnb_13v, lnb_18v; | 423 | u32 lnb_mask, lnb_13v, lnb_18v, lnb_off; |
330 | 424 | ||
331 | switch (dm1105dvb->pdev->subsystem_device) { | 425 | switch (dm1105dvb->boardnr) { |
332 | case PCI_DEVICE_ID_DM05: | 426 | case DM1105_BOARD_AXESS_DM05: |
333 | lnb_mask = DM05_LNB_MASK; | 427 | lnb_mask = DM05_LNB_MASK; |
428 | lnb_off = DM05_LNB_OFF; | ||
334 | lnb_13v = DM05_LNB_13V; | 429 | lnb_13v = DM05_LNB_13V; |
335 | lnb_18v = DM05_LNB_18V; | 430 | lnb_18v = DM05_LNB_18V; |
336 | break; | 431 | break; |
432 | case DM1105_BOARD_DVBWORLD_2002: | ||
433 | case DM1105_BOARD_DVBWORLD_2004: | ||
337 | default: | 434 | default: |
338 | lnb_mask = DM1105_LNB_MASK; | 435 | lnb_mask = DM1105_LNB_MASK; |
436 | lnb_off = DM1105_LNB_OFF; | ||
339 | lnb_13v = DM1105_LNB_13V; | 437 | lnb_13v = DM1105_LNB_13V; |
340 | lnb_18v = DM1105_LNB_18V; | 438 | lnb_18v = DM1105_LNB_18V; |
341 | } | 439 | } |
@@ -343,8 +441,10 @@ static int dm1105dvb_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t volta | |||
343 | outl(lnb_mask, dm_io_mem(DM1105_GPIOCTR)); | 441 | outl(lnb_mask, dm_io_mem(DM1105_GPIOCTR)); |
344 | if (voltage == SEC_VOLTAGE_18) | 442 | if (voltage == SEC_VOLTAGE_18) |
345 | outl(lnb_18v , dm_io_mem(DM1105_GPIOVAL)); | 443 | outl(lnb_18v , dm_io_mem(DM1105_GPIOVAL)); |
346 | else | 444 | else if (voltage == SEC_VOLTAGE_13) |
347 | outl(lnb_13v, dm_io_mem(DM1105_GPIOVAL)); | 445 | outl(lnb_13v, dm_io_mem(DM1105_GPIOVAL)); |
446 | else | ||
447 | outl(lnb_off, dm_io_mem(DM1105_GPIOVAL)); | ||
348 | 448 | ||
349 | return 0; | 449 | return 0; |
350 | } | 450 | } |
@@ -477,7 +577,7 @@ static irqreturn_t dm1105dvb_irq(int irq, void *dev_id) | |||
477 | int __devinit dm1105_ir_init(struct dm1105dvb *dm1105) | 577 | int __devinit dm1105_ir_init(struct dm1105dvb *dm1105) |
478 | { | 578 | { |
479 | struct input_dev *input_dev; | 579 | struct input_dev *input_dev; |
480 | IR_KEYTAB_TYPE *ir_codes = ir_codes_dm1105_nec; | 580 | struct ir_scancode_table *ir_codes = &ir_codes_dm1105_nec_table; |
481 | int ir_type = IR_TYPE_OTHER; | 581 | int ir_type = IR_TYPE_OTHER; |
482 | int err = -ENOMEM; | 582 | int err = -ENOMEM; |
483 | 583 | ||
@@ -589,8 +689,8 @@ static int __devinit frontend_init(struct dm1105dvb *dm1105dvb) | |||
589 | { | 689 | { |
590 | int ret; | 690 | int ret; |
591 | 691 | ||
592 | switch (dm1105dvb->pdev->subsystem_device) { | 692 | switch (dm1105dvb->boardnr) { |
593 | case PCI_DEVICE_ID_DW2004: | 693 | case DM1105_BOARD_DVBWORLD_2004: |
594 | dm1105dvb->fe = dvb_attach( | 694 | dm1105dvb->fe = dvb_attach( |
595 | cx24116_attach, &serit_sp2633_config, | 695 | cx24116_attach, &serit_sp2633_config, |
596 | &dm1105dvb->i2c_adap); | 696 | &dm1105dvb->i2c_adap); |
@@ -598,6 +698,8 @@ static int __devinit frontend_init(struct dm1105dvb *dm1105dvb) | |||
598 | dm1105dvb->fe->ops.set_voltage = dm1105dvb_set_voltage; | 698 | dm1105dvb->fe->ops.set_voltage = dm1105dvb_set_voltage; |
599 | 699 | ||
600 | break; | 700 | break; |
701 | case DM1105_BOARD_DVBWORLD_2002: | ||
702 | case DM1105_BOARD_AXESS_DM05: | ||
601 | default: | 703 | default: |
602 | dm1105dvb->fe = dvb_attach( | 704 | dm1105dvb->fe = dvb_attach( |
603 | stv0299_attach, &sharp_z0194a_config, | 705 | stv0299_attach, &sharp_z0194a_config, |
@@ -676,11 +778,31 @@ static int __devinit dm1105_probe(struct pci_dev *pdev, | |||
676 | struct dvb_demux *dvbdemux; | 778 | struct dvb_demux *dvbdemux; |
677 | struct dmx_demux *dmx; | 779 | struct dmx_demux *dmx; |
678 | int ret = -ENOMEM; | 780 | int ret = -ENOMEM; |
781 | int i; | ||
679 | 782 | ||
680 | dm1105dvb = kzalloc(sizeof(struct dm1105dvb), GFP_KERNEL); | 783 | dm1105dvb = kzalloc(sizeof(struct dm1105dvb), GFP_KERNEL); |
681 | if (!dm1105dvb) | 784 | if (!dm1105dvb) |
682 | return -ENOMEM; | 785 | return -ENOMEM; |
683 | 786 | ||
787 | /* board config */ | ||
788 | dm1105dvb->nr = dm1105_devcount; | ||
789 | dm1105dvb->boardnr = UNSET; | ||
790 | if (card[dm1105dvb->nr] < ARRAY_SIZE(dm1105_boards)) | ||
791 | dm1105dvb->boardnr = card[dm1105dvb->nr]; | ||
792 | for (i = 0; UNSET == dm1105dvb->boardnr && | ||
793 | i < ARRAY_SIZE(dm1105_subids); i++) | ||
794 | if (pdev->subsystem_vendor == | ||
795 | dm1105_subids[i].subvendor && | ||
796 | pdev->subsystem_device == | ||
797 | dm1105_subids[i].subdevice) | ||
798 | dm1105dvb->boardnr = dm1105_subids[i].card; | ||
799 | |||
800 | if (UNSET == dm1105dvb->boardnr) { | ||
801 | dm1105dvb->boardnr = DM1105_BOARD_UNKNOWN; | ||
802 | dm1105_card_list(pdev); | ||
803 | } | ||
804 | |||
805 | dm1105_devcount++; | ||
684 | dm1105dvb->pdev = pdev; | 806 | dm1105dvb->pdev = pdev; |
685 | dm1105dvb->buffer_size = 5 * DM1105_DMA_BYTES; | 807 | dm1105dvb->buffer_size = 5 * DM1105_DMA_BYTES; |
686 | dm1105dvb->PacketErrorCount = 0; | 808 | dm1105dvb->PacketErrorCount = 0; |
@@ -853,6 +975,7 @@ static void __devexit dm1105_remove(struct pci_dev *pdev) | |||
853 | pci_release_regions(pdev); | 975 | pci_release_regions(pdev); |
854 | pci_disable_device(pdev); | 976 | pci_disable_device(pdev); |
855 | pci_set_drvdata(pdev, NULL); | 977 | pci_set_drvdata(pdev, NULL); |
978 | dm1105_devcount--; | ||
856 | kfree(dm1105dvb); | 979 | kfree(dm1105dvb); |
857 | } | 980 | } |
858 | 981 | ||
@@ -861,17 +984,12 @@ static struct pci_device_id dm1105_id_table[] __devinitdata = { | |||
861 | .vendor = PCI_VENDOR_ID_TRIGEM, | 984 | .vendor = PCI_VENDOR_ID_TRIGEM, |
862 | .device = PCI_DEVICE_ID_DM1105, | 985 | .device = PCI_DEVICE_ID_DM1105, |
863 | .subvendor = PCI_ANY_ID, | 986 | .subvendor = PCI_ANY_ID, |
864 | .subdevice = PCI_DEVICE_ID_DW2002, | 987 | .subdevice = PCI_ANY_ID, |
865 | }, { | ||
866 | .vendor = PCI_VENDOR_ID_TRIGEM, | ||
867 | .device = PCI_DEVICE_ID_DM1105, | ||
868 | .subvendor = PCI_ANY_ID, | ||
869 | .subdevice = PCI_DEVICE_ID_DW2004, | ||
870 | }, { | 988 | }, { |
871 | .vendor = PCI_VENDOR_ID_AXESS, | 989 | .vendor = PCI_VENDOR_ID_AXESS, |
872 | .device = PCI_DEVICE_ID_DM05, | 990 | .device = PCI_DEVICE_ID_DM05, |
873 | .subvendor = PCI_VENDOR_ID_AXESS, | 991 | .subvendor = PCI_ANY_ID, |
874 | .subdevice = PCI_DEVICE_ID_DM05, | 992 | .subdevice = PCI_ANY_ID, |
875 | }, { | 993 | }, { |
876 | /* empty */ | 994 | /* empty */ |
877 | }, | 995 | }, |
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c index 6d6121eb5d59..3750ff48cba1 100644 --- a/drivers/media/dvb/dvb-core/dmxdev.c +++ b/drivers/media/dvb/dvb-core/dmxdev.c | |||
@@ -430,6 +430,8 @@ static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len, | |||
430 | /* stop feed but only mark the specified filter as stopped (state set) */ | 430 | /* stop feed but only mark the specified filter as stopped (state set) */ |
431 | static int dvb_dmxdev_feed_stop(struct dmxdev_filter *dmxdevfilter) | 431 | static int dvb_dmxdev_feed_stop(struct dmxdev_filter *dmxdevfilter) |
432 | { | 432 | { |
433 | struct dmxdev_feed *feed; | ||
434 | |||
433 | dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_SET); | 435 | dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_SET); |
434 | 436 | ||
435 | switch (dmxdevfilter->type) { | 437 | switch (dmxdevfilter->type) { |
@@ -438,7 +440,8 @@ static int dvb_dmxdev_feed_stop(struct dmxdev_filter *dmxdevfilter) | |||
438 | dmxdevfilter->feed.sec->stop_filtering(dmxdevfilter->feed.sec); | 440 | dmxdevfilter->feed.sec->stop_filtering(dmxdevfilter->feed.sec); |
439 | break; | 441 | break; |
440 | case DMXDEV_TYPE_PES: | 442 | case DMXDEV_TYPE_PES: |
441 | dmxdevfilter->feed.ts->stop_filtering(dmxdevfilter->feed.ts); | 443 | list_for_each_entry(feed, &dmxdevfilter->feed.ts, next) |
444 | feed->ts->stop_filtering(feed->ts); | ||
442 | break; | 445 | break; |
443 | default: | 446 | default: |
444 | return -EINVAL; | 447 | return -EINVAL; |
@@ -449,13 +452,23 @@ static int dvb_dmxdev_feed_stop(struct dmxdev_filter *dmxdevfilter) | |||
449 | /* start feed associated with the specified filter */ | 452 | /* start feed associated with the specified filter */ |
450 | static int dvb_dmxdev_feed_start(struct dmxdev_filter *filter) | 453 | static int dvb_dmxdev_feed_start(struct dmxdev_filter *filter) |
451 | { | 454 | { |
455 | struct dmxdev_feed *feed; | ||
456 | int ret; | ||
457 | |||
452 | dvb_dmxdev_filter_state_set(filter, DMXDEV_STATE_GO); | 458 | dvb_dmxdev_filter_state_set(filter, DMXDEV_STATE_GO); |
453 | 459 | ||
454 | switch (filter->type) { | 460 | switch (filter->type) { |
455 | case DMXDEV_TYPE_SEC: | 461 | case DMXDEV_TYPE_SEC: |
456 | return filter->feed.sec->start_filtering(filter->feed.sec); | 462 | return filter->feed.sec->start_filtering(filter->feed.sec); |
457 | case DMXDEV_TYPE_PES: | 463 | case DMXDEV_TYPE_PES: |
458 | return filter->feed.ts->start_filtering(filter->feed.ts); | 464 | list_for_each_entry(feed, &filter->feed.ts, next) { |
465 | ret = feed->ts->start_filtering(feed->ts); | ||
466 | if (ret < 0) { | ||
467 | dvb_dmxdev_feed_stop(filter); | ||
468 | return ret; | ||
469 | } | ||
470 | } | ||
471 | break; | ||
459 | default: | 472 | default: |
460 | return -EINVAL; | 473 | return -EINVAL; |
461 | } | 474 | } |
@@ -487,6 +500,9 @@ static int dvb_dmxdev_feed_restart(struct dmxdev_filter *filter) | |||
487 | 500 | ||
488 | static int dvb_dmxdev_filter_stop(struct dmxdev_filter *dmxdevfilter) | 501 | static int dvb_dmxdev_filter_stop(struct dmxdev_filter *dmxdevfilter) |
489 | { | 502 | { |
503 | struct dmxdev_feed *feed; | ||
504 | struct dmx_demux *demux; | ||
505 | |||
490 | if (dmxdevfilter->state < DMXDEV_STATE_GO) | 506 | if (dmxdevfilter->state < DMXDEV_STATE_GO) |
491 | return 0; | 507 | return 0; |
492 | 508 | ||
@@ -503,13 +519,12 @@ static int dvb_dmxdev_filter_stop(struct dmxdev_filter *dmxdevfilter) | |||
503 | dmxdevfilter->feed.sec = NULL; | 519 | dmxdevfilter->feed.sec = NULL; |
504 | break; | 520 | break; |
505 | case DMXDEV_TYPE_PES: | 521 | case DMXDEV_TYPE_PES: |
506 | if (!dmxdevfilter->feed.ts) | ||
507 | break; | ||
508 | dvb_dmxdev_feed_stop(dmxdevfilter); | 522 | dvb_dmxdev_feed_stop(dmxdevfilter); |
509 | dmxdevfilter->dev->demux-> | 523 | demux = dmxdevfilter->dev->demux; |
510 | release_ts_feed(dmxdevfilter->dev->demux, | 524 | list_for_each_entry(feed, &dmxdevfilter->feed.ts, next) { |
511 | dmxdevfilter->feed.ts); | 525 | demux->release_ts_feed(demux, feed->ts); |
512 | dmxdevfilter->feed.ts = NULL; | 526 | feed->ts = NULL; |
527 | } | ||
513 | break; | 528 | break; |
514 | default: | 529 | default: |
515 | if (dmxdevfilter->state == DMXDEV_STATE_ALLOCATED) | 530 | if (dmxdevfilter->state == DMXDEV_STATE_ALLOCATED) |
@@ -521,19 +536,88 @@ static int dvb_dmxdev_filter_stop(struct dmxdev_filter *dmxdevfilter) | |||
521 | return 0; | 536 | return 0; |
522 | } | 537 | } |
523 | 538 | ||
539 | static void dvb_dmxdev_delete_pids(struct dmxdev_filter *dmxdevfilter) | ||
540 | { | ||
541 | struct dmxdev_feed *feed, *tmp; | ||
542 | |||
543 | /* delete all PIDs */ | ||
544 | list_for_each_entry_safe(feed, tmp, &dmxdevfilter->feed.ts, next) { | ||
545 | list_del(&feed->next); | ||
546 | kfree(feed); | ||
547 | } | ||
548 | |||
549 | BUG_ON(!list_empty(&dmxdevfilter->feed.ts)); | ||
550 | } | ||
551 | |||
524 | static inline int dvb_dmxdev_filter_reset(struct dmxdev_filter *dmxdevfilter) | 552 | static inline int dvb_dmxdev_filter_reset(struct dmxdev_filter *dmxdevfilter) |
525 | { | 553 | { |
526 | if (dmxdevfilter->state < DMXDEV_STATE_SET) | 554 | if (dmxdevfilter->state < DMXDEV_STATE_SET) |
527 | return 0; | 555 | return 0; |
528 | 556 | ||
557 | if (dmxdevfilter->type == DMXDEV_TYPE_PES) | ||
558 | dvb_dmxdev_delete_pids(dmxdevfilter); | ||
559 | |||
529 | dmxdevfilter->type = DMXDEV_TYPE_NONE; | 560 | dmxdevfilter->type = DMXDEV_TYPE_NONE; |
530 | dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_ALLOCATED); | 561 | dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_ALLOCATED); |
531 | return 0; | 562 | return 0; |
532 | } | 563 | } |
533 | 564 | ||
565 | static int dvb_dmxdev_start_feed(struct dmxdev *dmxdev, | ||
566 | struct dmxdev_filter *filter, | ||
567 | struct dmxdev_feed *feed) | ||
568 | { | ||
569 | struct timespec timeout = { 0 }; | ||
570 | struct dmx_pes_filter_params *para = &filter->params.pes; | ||
571 | dmx_output_t otype; | ||
572 | int ret; | ||
573 | int ts_type; | ||
574 | enum dmx_ts_pes ts_pes; | ||
575 | struct dmx_ts_feed *tsfeed; | ||
576 | |||
577 | feed->ts = NULL; | ||
578 | otype = para->output; | ||
579 | |||
580 | ts_pes = (enum dmx_ts_pes)para->pes_type; | ||
581 | |||
582 | if (ts_pes < DMX_PES_OTHER) | ||
583 | ts_type = TS_DECODER; | ||
584 | else | ||
585 | ts_type = 0; | ||
586 | |||
587 | if (otype == DMX_OUT_TS_TAP) | ||
588 | ts_type |= TS_PACKET; | ||
589 | else if (otype == DMX_OUT_TSDEMUX_TAP) | ||
590 | ts_type |= TS_PACKET | TS_DEMUX; | ||
591 | else if (otype == DMX_OUT_TAP) | ||
592 | ts_type |= TS_PACKET | TS_DEMUX | TS_PAYLOAD_ONLY; | ||
593 | |||
594 | ret = dmxdev->demux->allocate_ts_feed(dmxdev->demux, &feed->ts, | ||
595 | dvb_dmxdev_ts_callback); | ||
596 | if (ret < 0) | ||
597 | return ret; | ||
598 | |||
599 | tsfeed = feed->ts; | ||
600 | tsfeed->priv = filter; | ||
601 | |||
602 | ret = tsfeed->set(tsfeed, feed->pid, ts_type, ts_pes, 32768, timeout); | ||
603 | if (ret < 0) { | ||
604 | dmxdev->demux->release_ts_feed(dmxdev->demux, tsfeed); | ||
605 | return ret; | ||
606 | } | ||
607 | |||
608 | ret = tsfeed->start_filtering(tsfeed); | ||
609 | if (ret < 0) { | ||
610 | dmxdev->demux->release_ts_feed(dmxdev->demux, tsfeed); | ||
611 | return ret; | ||
612 | } | ||
613 | |||
614 | return 0; | ||
615 | } | ||
616 | |||
534 | static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) | 617 | static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) |
535 | { | 618 | { |
536 | struct dmxdev *dmxdev = filter->dev; | 619 | struct dmxdev *dmxdev = filter->dev; |
620 | struct dmxdev_feed *feed; | ||
537 | void *mem; | 621 | void *mem; |
538 | int ret, i; | 622 | int ret, i; |
539 | 623 | ||
@@ -631,56 +715,14 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) | |||
631 | break; | 715 | break; |
632 | } | 716 | } |
633 | case DMXDEV_TYPE_PES: | 717 | case DMXDEV_TYPE_PES: |
634 | { | 718 | list_for_each_entry(feed, &filter->feed.ts, next) { |
635 | struct timespec timeout = { 0 }; | 719 | ret = dvb_dmxdev_start_feed(dmxdev, filter, feed); |
636 | struct dmx_pes_filter_params *para = &filter->params.pes; | 720 | if (ret < 0) { |
637 | dmx_output_t otype; | 721 | dvb_dmxdev_filter_stop(filter); |
638 | int ts_type; | 722 | return ret; |
639 | enum dmx_ts_pes ts_pes; | 723 | } |
640 | struct dmx_ts_feed **tsfeed = &filter->feed.ts; | ||
641 | |||
642 | filter->feed.ts = NULL; | ||
643 | otype = para->output; | ||
644 | |||
645 | ts_pes = (enum dmx_ts_pes)para->pes_type; | ||
646 | |||
647 | if (ts_pes < DMX_PES_OTHER) | ||
648 | ts_type = TS_DECODER; | ||
649 | else | ||
650 | ts_type = 0; | ||
651 | |||
652 | if (otype == DMX_OUT_TS_TAP) | ||
653 | ts_type |= TS_PACKET; | ||
654 | else if (otype == DMX_OUT_TSDEMUX_TAP) | ||
655 | ts_type |= TS_PACKET | TS_DEMUX; | ||
656 | else if (otype == DMX_OUT_TAP) | ||
657 | ts_type |= TS_PACKET | TS_DEMUX | TS_PAYLOAD_ONLY; | ||
658 | |||
659 | ret = dmxdev->demux->allocate_ts_feed(dmxdev->demux, | ||
660 | tsfeed, | ||
661 | dvb_dmxdev_ts_callback); | ||
662 | if (ret < 0) | ||
663 | return ret; | ||
664 | |||
665 | (*tsfeed)->priv = filter; | ||
666 | |||
667 | ret = (*tsfeed)->set(*tsfeed, para->pid, ts_type, ts_pes, | ||
668 | 32768, timeout); | ||
669 | if (ret < 0) { | ||
670 | dmxdev->demux->release_ts_feed(dmxdev->demux, | ||
671 | *tsfeed); | ||
672 | return ret; | ||
673 | } | ||
674 | |||
675 | ret = filter->feed.ts->start_filtering(filter->feed.ts); | ||
676 | if (ret < 0) { | ||
677 | dmxdev->demux->release_ts_feed(dmxdev->demux, | ||
678 | *tsfeed); | ||
679 | return ret; | ||
680 | } | 724 | } |
681 | |||
682 | break; | 725 | break; |
683 | } | ||
684 | default: | 726 | default: |
685 | return -EINVAL; | 727 | return -EINVAL; |
686 | } | 728 | } |
@@ -718,7 +760,7 @@ static int dvb_demux_open(struct inode *inode, struct file *file) | |||
718 | dvb_ringbuffer_init(&dmxdevfilter->buffer, NULL, 8192); | 760 | dvb_ringbuffer_init(&dmxdevfilter->buffer, NULL, 8192); |
719 | dmxdevfilter->type = DMXDEV_TYPE_NONE; | 761 | dmxdevfilter->type = DMXDEV_TYPE_NONE; |
720 | dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_ALLOCATED); | 762 | dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_ALLOCATED); |
721 | dmxdevfilter->feed.ts = NULL; | 763 | INIT_LIST_HEAD(&dmxdevfilter->feed.ts); |
722 | init_timer(&dmxdevfilter->timer); | 764 | init_timer(&dmxdevfilter->timer); |
723 | 765 | ||
724 | dvbdev->users++; | 766 | dvbdev->users++; |
@@ -760,6 +802,55 @@ static inline void invert_mode(dmx_filter_t *filter) | |||
760 | filter->mode[i] ^= 0xff; | 802 | filter->mode[i] ^= 0xff; |
761 | } | 803 | } |
762 | 804 | ||
805 | static int dvb_dmxdev_add_pid(struct dmxdev *dmxdev, | ||
806 | struct dmxdev_filter *filter, u16 pid) | ||
807 | { | ||
808 | struct dmxdev_feed *feed; | ||
809 | |||
810 | if ((filter->type != DMXDEV_TYPE_PES) || | ||
811 | (filter->state < DMXDEV_STATE_SET)) | ||
812 | return -EINVAL; | ||
813 | |||
814 | /* only TS packet filters may have multiple PIDs */ | ||
815 | if ((filter->params.pes.output != DMX_OUT_TSDEMUX_TAP) && | ||
816 | (!list_empty(&filter->feed.ts))) | ||
817 | return -EINVAL; | ||
818 | |||
819 | feed = kzalloc(sizeof(struct dmxdev_feed), GFP_KERNEL); | ||
820 | if (feed == NULL) | ||
821 | return -ENOMEM; | ||
822 | |||
823 | feed->pid = pid; | ||
824 | list_add(&feed->next, &filter->feed.ts); | ||
825 | |||
826 | if (filter->state >= DMXDEV_STATE_GO) | ||
827 | return dvb_dmxdev_start_feed(dmxdev, filter, feed); | ||
828 | |||
829 | return 0; | ||
830 | } | ||
831 | |||
832 | static int dvb_dmxdev_remove_pid(struct dmxdev *dmxdev, | ||
833 | struct dmxdev_filter *filter, u16 pid) | ||
834 | { | ||
835 | struct dmxdev_feed *feed, *tmp; | ||
836 | |||
837 | if ((filter->type != DMXDEV_TYPE_PES) || | ||
838 | (filter->state < DMXDEV_STATE_SET)) | ||
839 | return -EINVAL; | ||
840 | |||
841 | list_for_each_entry_safe(feed, tmp, &filter->feed.ts, next) { | ||
842 | if ((feed->pid == pid) && (feed->ts != NULL)) { | ||
843 | feed->ts->stop_filtering(feed->ts); | ||
844 | filter->dev->demux->release_ts_feed(filter->dev->demux, | ||
845 | feed->ts); | ||
846 | list_del(&feed->next); | ||
847 | kfree(feed); | ||
848 | } | ||
849 | } | ||
850 | |||
851 | return 0; | ||
852 | } | ||
853 | |||
763 | static int dvb_dmxdev_filter_set(struct dmxdev *dmxdev, | 854 | static int dvb_dmxdev_filter_set(struct dmxdev *dmxdev, |
764 | struct dmxdev_filter *dmxdevfilter, | 855 | struct dmxdev_filter *dmxdevfilter, |
765 | struct dmx_sct_filter_params *params) | 856 | struct dmx_sct_filter_params *params) |
@@ -784,7 +875,10 @@ static int dvb_dmxdev_pes_filter_set(struct dmxdev *dmxdev, | |||
784 | struct dmxdev_filter *dmxdevfilter, | 875 | struct dmxdev_filter *dmxdevfilter, |
785 | struct dmx_pes_filter_params *params) | 876 | struct dmx_pes_filter_params *params) |
786 | { | 877 | { |
878 | int ret; | ||
879 | |||
787 | dvb_dmxdev_filter_stop(dmxdevfilter); | 880 | dvb_dmxdev_filter_stop(dmxdevfilter); |
881 | dvb_dmxdev_filter_reset(dmxdevfilter); | ||
788 | 882 | ||
789 | if (params->pes_type > DMX_PES_OTHER || params->pes_type < 0) | 883 | if (params->pes_type > DMX_PES_OTHER || params->pes_type < 0) |
790 | return -EINVAL; | 884 | return -EINVAL; |
@@ -795,6 +889,11 @@ static int dvb_dmxdev_pes_filter_set(struct dmxdev *dmxdev, | |||
795 | 889 | ||
796 | dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_SET); | 890 | dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_SET); |
797 | 891 | ||
892 | ret = dvb_dmxdev_add_pid(dmxdev, dmxdevfilter, | ||
893 | dmxdevfilter->params.pes.pid); | ||
894 | if (ret < 0) | ||
895 | return ret; | ||
896 | |||
798 | if (params->flags & DMX_IMMEDIATE_START) | 897 | if (params->flags & DMX_IMMEDIATE_START) |
799 | return dvb_dmxdev_filter_start(dmxdevfilter); | 898 | return dvb_dmxdev_filter_start(dmxdevfilter); |
800 | 899 | ||
@@ -958,6 +1057,24 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file, | |||
958 | &((struct dmx_stc *)parg)->base); | 1057 | &((struct dmx_stc *)parg)->base); |
959 | break; | 1058 | break; |
960 | 1059 | ||
1060 | case DMX_ADD_PID: | ||
1061 | if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { | ||
1062 | ret = -ERESTARTSYS; | ||
1063 | break; | ||
1064 | } | ||
1065 | ret = dvb_dmxdev_add_pid(dmxdev, dmxdevfilter, *(u16 *)parg); | ||
1066 | mutex_unlock(&dmxdevfilter->mutex); | ||
1067 | break; | ||
1068 | |||
1069 | case DMX_REMOVE_PID: | ||
1070 | if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { | ||
1071 | ret = -ERESTARTSYS; | ||
1072 | break; | ||
1073 | } | ||
1074 | ret = dvb_dmxdev_remove_pid(dmxdev, dmxdevfilter, *(u16 *)parg); | ||
1075 | mutex_unlock(&dmxdevfilter->mutex); | ||
1076 | break; | ||
1077 | |||
961 | default: | 1078 | default: |
962 | ret = -EINVAL; | 1079 | ret = -EINVAL; |
963 | break; | 1080 | break; |
diff --git a/drivers/media/dvb/dvb-core/dmxdev.h b/drivers/media/dvb/dvb-core/dmxdev.h index 29746e70d325..c1379b56dfb4 100644 --- a/drivers/media/dvb/dvb-core/dmxdev.h +++ b/drivers/media/dvb/dvb-core/dmxdev.h | |||
@@ -53,13 +53,20 @@ enum dmxdev_state { | |||
53 | DMXDEV_STATE_TIMEDOUT | 53 | DMXDEV_STATE_TIMEDOUT |
54 | }; | 54 | }; |
55 | 55 | ||
56 | struct dmxdev_feed { | ||
57 | u16 pid; | ||
58 | struct dmx_ts_feed *ts; | ||
59 | struct list_head next; | ||
60 | }; | ||
61 | |||
56 | struct dmxdev_filter { | 62 | struct dmxdev_filter { |
57 | union { | 63 | union { |
58 | struct dmx_section_filter *sec; | 64 | struct dmx_section_filter *sec; |
59 | } filter; | 65 | } filter; |
60 | 66 | ||
61 | union { | 67 | union { |
62 | struct dmx_ts_feed *ts; | 68 | /* list of TS and PES feeds (struct dmxdev_feed) */ |
69 | struct list_head ts; | ||
63 | struct dmx_section_feed *sec; | 70 | struct dmx_section_feed *sec; |
64 | } feed; | 71 | } feed; |
65 | 72 | ||
diff --git a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c index cfe2768d24af..eef6d3616626 100644 --- a/drivers/media/dvb/dvb-core/dvb_demux.c +++ b/drivers/media/dvb/dvb-core/dvb_demux.c | |||
@@ -425,13 +425,9 @@ no_dvb_demux_tscheck: | |||
425 | if ((DVR_FEED(feed)) && (dvr_done++)) | 425 | if ((DVR_FEED(feed)) && (dvr_done++)) |
426 | continue; | 426 | continue; |
427 | 427 | ||
428 | if (feed->pid == pid) { | 428 | if (feed->pid == pid) |
429 | dvb_dmx_swfilter_packet_type(feed, buf); | 429 | dvb_dmx_swfilter_packet_type(feed, buf); |
430 | if (DVR_FEED(feed)) | 430 | else if (feed->pid == 0x2000) |
431 | continue; | ||
432 | } | ||
433 | |||
434 | if (feed->pid == 0x2000) | ||
435 | feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK); | 431 | feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK); |
436 | } | 432 | } |
437 | } | 433 | } |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index f50ca7292a7d..d13ebcb0c6b6 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -72,6 +72,7 @@ MODULE_PARM_DESC(dvb_mfe_wait_time, "Wait up to <mfe_wait_time> seconds on open( | |||
72 | #define FESTATE_ZIGZAG_FAST 32 | 72 | #define FESTATE_ZIGZAG_FAST 32 |
73 | #define FESTATE_ZIGZAG_SLOW 64 | 73 | #define FESTATE_ZIGZAG_SLOW 64 |
74 | #define FESTATE_DISEQC 128 | 74 | #define FESTATE_DISEQC 128 |
75 | #define FESTATE_ERROR 256 | ||
75 | #define FESTATE_WAITFORLOCK (FESTATE_TUNING_FAST | FESTATE_TUNING_SLOW | FESTATE_ZIGZAG_FAST | FESTATE_ZIGZAG_SLOW | FESTATE_DISEQC) | 76 | #define FESTATE_WAITFORLOCK (FESTATE_TUNING_FAST | FESTATE_TUNING_SLOW | FESTATE_ZIGZAG_FAST | FESTATE_ZIGZAG_SLOW | FESTATE_DISEQC) |
76 | #define FESTATE_SEARCHING_FAST (FESTATE_TUNING_FAST | FESTATE_ZIGZAG_FAST) | 77 | #define FESTATE_SEARCHING_FAST (FESTATE_TUNING_FAST | FESTATE_ZIGZAG_FAST) |
77 | #define FESTATE_SEARCHING_SLOW (FESTATE_TUNING_SLOW | FESTATE_ZIGZAG_SLOW) | 78 | #define FESTATE_SEARCHING_SLOW (FESTATE_TUNING_SLOW | FESTATE_ZIGZAG_SLOW) |
@@ -269,6 +270,7 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra | |||
269 | { | 270 | { |
270 | int autoinversion; | 271 | int autoinversion; |
271 | int ready = 0; | 272 | int ready = 0; |
273 | int fe_set_err = 0; | ||
272 | struct dvb_frontend_private *fepriv = fe->frontend_priv; | 274 | struct dvb_frontend_private *fepriv = fe->frontend_priv; |
273 | int original_inversion = fepriv->parameters.inversion; | 275 | int original_inversion = fepriv->parameters.inversion; |
274 | u32 original_frequency = fepriv->parameters.frequency; | 276 | u32 original_frequency = fepriv->parameters.frequency; |
@@ -345,7 +347,11 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra | |||
345 | if (autoinversion) | 347 | if (autoinversion) |
346 | fepriv->parameters.inversion = fepriv->inversion; | 348 | fepriv->parameters.inversion = fepriv->inversion; |
347 | if (fe->ops.set_frontend) | 349 | if (fe->ops.set_frontend) |
348 | fe->ops.set_frontend(fe, &fepriv->parameters); | 350 | fe_set_err = fe->ops.set_frontend(fe, &fepriv->parameters); |
351 | if (fe_set_err < 0) { | ||
352 | fepriv->state = FESTATE_ERROR; | ||
353 | return fe_set_err; | ||
354 | } | ||
349 | 355 | ||
350 | fepriv->parameters.frequency = original_frequency; | 356 | fepriv->parameters.frequency = original_frequency; |
351 | fepriv->parameters.inversion = original_inversion; | 357 | fepriv->parameters.inversion = original_inversion; |
@@ -357,6 +363,7 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra | |||
357 | static void dvb_frontend_swzigzag(struct dvb_frontend *fe) | 363 | static void dvb_frontend_swzigzag(struct dvb_frontend *fe) |
358 | { | 364 | { |
359 | fe_status_t s = 0; | 365 | fe_status_t s = 0; |
366 | int retval = 0; | ||
360 | struct dvb_frontend_private *fepriv = fe->frontend_priv; | 367 | struct dvb_frontend_private *fepriv = fe->frontend_priv; |
361 | 368 | ||
362 | /* if we've got no parameters, just keep idling */ | 369 | /* if we've got no parameters, just keep idling */ |
@@ -370,8 +377,12 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe) | |||
370 | if (fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT) { | 377 | if (fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT) { |
371 | if (fepriv->state & FESTATE_RETUNE) { | 378 | if (fepriv->state & FESTATE_RETUNE) { |
372 | if (fe->ops.set_frontend) | 379 | if (fe->ops.set_frontend) |
373 | fe->ops.set_frontend(fe, &fepriv->parameters); | 380 | retval = fe->ops.set_frontend(fe, |
374 | fepriv->state = FESTATE_TUNED; | 381 | &fepriv->parameters); |
382 | if (retval < 0) | ||
383 | fepriv->state = FESTATE_ERROR; | ||
384 | else | ||
385 | fepriv->state = FESTATE_TUNED; | ||
375 | } | 386 | } |
376 | fepriv->delay = 3*HZ; | 387 | fepriv->delay = 3*HZ; |
377 | fepriv->quality = 0; | 388 | fepriv->quality = 0; |
@@ -449,7 +460,11 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe) | |||
449 | fepriv->delay = fepriv->min_delay; | 460 | fepriv->delay = fepriv->min_delay; |
450 | 461 | ||
451 | /* peform a tune */ | 462 | /* peform a tune */ |
452 | if (dvb_frontend_swzigzag_autotune(fe, fepriv->check_wrapped)) { | 463 | retval = dvb_frontend_swzigzag_autotune(fe, |
464 | fepriv->check_wrapped); | ||
465 | if (retval < 0) { | ||
466 | return; | ||
467 | } else if (retval) { | ||
453 | /* OK, if we've run out of trials at the fast speed. | 468 | /* OK, if we've run out of trials at the fast speed. |
454 | * Drop back to slow for the _next_ attempt */ | 469 | * Drop back to slow for the _next_ attempt */ |
455 | fepriv->state = FESTATE_SEARCHING_SLOW; | 470 | fepriv->state = FESTATE_SEARCHING_SLOW; |
@@ -823,6 +838,15 @@ static int dvb_frontend_check_parameters(struct dvb_frontend *fe, | |||
823 | } | 838 | } |
824 | } | 839 | } |
825 | 840 | ||
841 | /* check for supported modulation */ | ||
842 | if (fe->ops.info.type == FE_QAM && | ||
843 | (parms->u.qam.modulation > QAM_AUTO || | ||
844 | !((1 << (parms->u.qam.modulation + 10)) & fe->ops.info.caps))) { | ||
845 | printk(KERN_WARNING "DVB: adapter %i frontend %i modulation %u not supported\n", | ||
846 | fe->dvb->num, fe->id, parms->u.qam.modulation); | ||
847 | return -EINVAL; | ||
848 | } | ||
849 | |||
826 | return 0; | 850 | return 0; |
827 | } | 851 | } |
828 | 852 | ||
@@ -1499,7 +1523,8 @@ static int dvb_frontend_ioctl_legacy(struct inode *inode, struct file *file, | |||
1499 | 1523 | ||
1500 | /* if retune was requested but hasn't occured yet, prevent | 1524 | /* if retune was requested but hasn't occured yet, prevent |
1501 | * that user get signal state from previous tuning */ | 1525 | * that user get signal state from previous tuning */ |
1502 | if(fepriv->state == FESTATE_RETUNE) { | 1526 | if (fepriv->state == FESTATE_RETUNE || |
1527 | fepriv->state == FESTATE_ERROR) { | ||
1503 | err=0; | 1528 | err=0; |
1504 | *status = 0; | 1529 | *status = 0; |
1505 | break; | 1530 | break; |
diff --git a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h index 487919bea7ae..895e2efca8a9 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.h +++ b/drivers/media/dvb/dvb-core/dvbdev.h | |||
@@ -30,7 +30,12 @@ | |||
30 | 30 | ||
31 | #define DVB_MAJOR 212 | 31 | #define DVB_MAJOR 212 |
32 | 32 | ||
33 | #if defined(CONFIG_DVB_MAX_ADAPTERS) && CONFIG_DVB_MAX_ADAPTERS > 0 | ||
34 | #define DVB_MAX_ADAPTERS CONFIG_DVB_MAX_ADAPTERS | ||
35 | #else | ||
36 | #warning invalid CONFIG_DVB_MAX_ADAPTERS value | ||
33 | #define DVB_MAX_ADAPTERS 8 | 37 | #define DVB_MAX_ADAPTERS 8 |
38 | #endif | ||
34 | 39 | ||
35 | #define DVB_UNSET (-1) | 40 | #define DVB_UNSET (-1) |
36 | 41 | ||
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index 496c1a37034c..8b8bc04ee980 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
@@ -253,7 +253,7 @@ config DVB_USB_AF9005_REMOTE | |||
253 | Afatech AF9005 based receiver. | 253 | Afatech AF9005 based receiver. |
254 | 254 | ||
255 | config DVB_USB_DW2102 | 255 | config DVB_USB_DW2102 |
256 | tristate "DvbWorld DVB-S/S2 USB2.0 support" | 256 | tristate "DvbWorld & TeVii DVB-S/S2 USB2.0 support" |
257 | depends on DVB_USB | 257 | depends on DVB_USB |
258 | select DVB_PLL if !DVB_FE_CUSTOMISE | 258 | select DVB_PLL if !DVB_FE_CUSTOMISE |
259 | select DVB_STV0299 if !DVB_FE_CUSTOMISE | 259 | select DVB_STV0299 if !DVB_FE_CUSTOMISE |
@@ -262,9 +262,11 @@ config DVB_USB_DW2102 | |||
262 | select DVB_CX24116 if !DVB_FE_CUSTOMISE | 262 | select DVB_CX24116 if !DVB_FE_CUSTOMISE |
263 | select DVB_SI21XX if !DVB_FE_CUSTOMISE | 263 | select DVB_SI21XX if !DVB_FE_CUSTOMISE |
264 | select DVB_TDA10021 if !DVB_FE_CUSTOMISE | 264 | select DVB_TDA10021 if !DVB_FE_CUSTOMISE |
265 | select DVB_MT312 if !DVB_FE_CUSTOMISE | ||
266 | select DVB_ZL10039 if !DVB_FE_CUSTOMISE | ||
265 | help | 267 | help |
266 | Say Y here to support the DvbWorld DVB-S/S2 USB2.0 receivers | 268 | Say Y here to support the DvbWorld DVB-S/S2 USB2.0 receivers |
267 | and the TeVii S650. | 269 | and the TeVii S650, S630. |
268 | 270 | ||
269 | config DVB_USB_CINERGY_T2 | 271 | config DVB_USB_CINERGY_T2 |
270 | tristate "Terratec CinergyT2/qanu USB 2.0 DVB-T receiver" | 272 | tristate "Terratec CinergyT2/qanu USB 2.0 DVB-T receiver" |
diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c index dc8c8784caa8..6247239982e9 100644 --- a/drivers/media/dvb/dvb-usb/a800.c +++ b/drivers/media/dvb/dvb-usb/a800.c | |||
@@ -38,41 +38,41 @@ static int a800_identify_state(struct usb_device *udev, struct dvb_usb_device_pr | |||
38 | } | 38 | } |
39 | 39 | ||
40 | static struct dvb_usb_rc_key a800_rc_keys[] = { | 40 | static struct dvb_usb_rc_key a800_rc_keys[] = { |
41 | { 0x02, 0x01, KEY_PROG1 }, /* SOURCE */ | 41 | { 0x0201, KEY_PROG1 }, /* SOURCE */ |
42 | { 0x02, 0x00, KEY_POWER }, /* POWER */ | 42 | { 0x0200, KEY_POWER }, /* POWER */ |
43 | { 0x02, 0x05, KEY_1 }, /* 1 */ | 43 | { 0x0205, KEY_1 }, /* 1 */ |
44 | { 0x02, 0x06, KEY_2 }, /* 2 */ | 44 | { 0x0206, KEY_2 }, /* 2 */ |
45 | { 0x02, 0x07, KEY_3 }, /* 3 */ | 45 | { 0x0207, KEY_3 }, /* 3 */ |
46 | { 0x02, 0x09, KEY_4 }, /* 4 */ | 46 | { 0x0209, KEY_4 }, /* 4 */ |
47 | { 0x02, 0x0a, KEY_5 }, /* 5 */ | 47 | { 0x020a, KEY_5 }, /* 5 */ |
48 | { 0x02, 0x0b, KEY_6 }, /* 6 */ | 48 | { 0x020b, KEY_6 }, /* 6 */ |
49 | { 0x02, 0x0d, KEY_7 }, /* 7 */ | 49 | { 0x020d, KEY_7 }, /* 7 */ |
50 | { 0x02, 0x0e, KEY_8 }, /* 8 */ | 50 | { 0x020e, KEY_8 }, /* 8 */ |
51 | { 0x02, 0x0f, KEY_9 }, /* 9 */ | 51 | { 0x020f, KEY_9 }, /* 9 */ |
52 | { 0x02, 0x12, KEY_LEFT }, /* L / DISPLAY */ | 52 | { 0x0212, KEY_LEFT }, /* L / DISPLAY */ |
53 | { 0x02, 0x11, KEY_0 }, /* 0 */ | 53 | { 0x0211, KEY_0 }, /* 0 */ |
54 | { 0x02, 0x13, KEY_RIGHT }, /* R / CH RTN */ | 54 | { 0x0213, KEY_RIGHT }, /* R / CH RTN */ |
55 | { 0x02, 0x17, KEY_PROG2 }, /* SNAP SHOT */ | 55 | { 0x0217, KEY_PROG2 }, /* SNAP SHOT */ |
56 | { 0x02, 0x10, KEY_PROG3 }, /* 16-CH PREV */ | 56 | { 0x0210, KEY_PROG3 }, /* 16-CH PREV */ |
57 | { 0x02, 0x1e, KEY_VOLUMEDOWN }, /* VOL DOWN */ | 57 | { 0x021e, KEY_VOLUMEDOWN }, /* VOL DOWN */ |
58 | { 0x02, 0x0c, KEY_ZOOM }, /* FULL SCREEN */ | 58 | { 0x020c, KEY_ZOOM }, /* FULL SCREEN */ |
59 | { 0x02, 0x1f, KEY_VOLUMEUP }, /* VOL UP */ | 59 | { 0x021f, KEY_VOLUMEUP }, /* VOL UP */ |
60 | { 0x02, 0x14, KEY_MUTE }, /* MUTE */ | 60 | { 0x0214, KEY_MUTE }, /* MUTE */ |
61 | { 0x02, 0x08, KEY_AUDIO }, /* AUDIO */ | 61 | { 0x0208, KEY_AUDIO }, /* AUDIO */ |
62 | { 0x02, 0x19, KEY_RECORD }, /* RECORD */ | 62 | { 0x0219, KEY_RECORD }, /* RECORD */ |
63 | { 0x02, 0x18, KEY_PLAY }, /* PLAY */ | 63 | { 0x0218, KEY_PLAY }, /* PLAY */ |
64 | { 0x02, 0x1b, KEY_STOP }, /* STOP */ | 64 | { 0x021b, KEY_STOP }, /* STOP */ |
65 | { 0x02, 0x1a, KEY_PLAYPAUSE }, /* TIMESHIFT / PAUSE */ | 65 | { 0x021a, KEY_PLAYPAUSE }, /* TIMESHIFT / PAUSE */ |
66 | { 0x02, 0x1d, KEY_BACK }, /* << / RED */ | 66 | { 0x021d, KEY_BACK }, /* << / RED */ |
67 | { 0x02, 0x1c, KEY_FORWARD }, /* >> / YELLOW */ | 67 | { 0x021c, KEY_FORWARD }, /* >> / YELLOW */ |
68 | { 0x02, 0x03, KEY_TEXT }, /* TELETEXT */ | 68 | { 0x0203, KEY_TEXT }, /* TELETEXT */ |
69 | { 0x02, 0x04, KEY_EPG }, /* EPG */ | 69 | { 0x0204, KEY_EPG }, /* EPG */ |
70 | { 0x02, 0x15, KEY_MENU }, /* MENU */ | 70 | { 0x0215, KEY_MENU }, /* MENU */ |
71 | 71 | ||
72 | { 0x03, 0x03, KEY_CHANNELUP }, /* CH UP */ | 72 | { 0x0303, KEY_CHANNELUP }, /* CH UP */ |
73 | { 0x03, 0x02, KEY_CHANNELDOWN }, /* CH DOWN */ | 73 | { 0x0302, KEY_CHANNELDOWN }, /* CH DOWN */ |
74 | { 0x03, 0x01, KEY_FIRST }, /* |<< / GREEN */ | 74 | { 0x0301, KEY_FIRST }, /* |<< / GREEN */ |
75 | { 0x03, 0x00, KEY_LAST }, /* >>| / BLUE */ | 75 | { 0x0300, KEY_LAST }, /* >>| / BLUE */ |
76 | 76 | ||
77 | }; | 77 | }; |
78 | 78 | ||
diff --git a/drivers/media/dvb/dvb-usb/af9005-remote.c b/drivers/media/dvb/dvb-usb/af9005-remote.c index 7c596f926764..f4379c650a19 100644 --- a/drivers/media/dvb/dvb-usb/af9005-remote.c +++ b/drivers/media/dvb/dvb-usb/af9005-remote.c | |||
@@ -35,43 +35,43 @@ MODULE_PARM_DESC(debug, | |||
35 | 35 | ||
36 | struct dvb_usb_rc_key af9005_rc_keys[] = { | 36 | struct dvb_usb_rc_key af9005_rc_keys[] = { |
37 | 37 | ||
38 | {0x01, 0xb7, KEY_POWER}, | 38 | {0x01b7, KEY_POWER}, |
39 | {0x01, 0xa7, KEY_VOLUMEUP}, | 39 | {0x01a7, KEY_VOLUMEUP}, |
40 | {0x01, 0x87, KEY_CHANNELUP}, | 40 | {0x0187, KEY_CHANNELUP}, |
41 | {0x01, 0x7f, KEY_MUTE}, | 41 | {0x017f, KEY_MUTE}, |
42 | {0x01, 0xbf, KEY_VOLUMEDOWN}, | 42 | {0x01bf, KEY_VOLUMEDOWN}, |
43 | {0x01, 0x3f, KEY_CHANNELDOWN}, | 43 | {0x013f, KEY_CHANNELDOWN}, |
44 | {0x01, 0xdf, KEY_1}, | 44 | {0x01df, KEY_1}, |
45 | {0x01, 0x5f, KEY_2}, | 45 | {0x015f, KEY_2}, |
46 | {0x01, 0x9f, KEY_3}, | 46 | {0x019f, KEY_3}, |
47 | {0x01, 0x1f, KEY_4}, | 47 | {0x011f, KEY_4}, |
48 | {0x01, 0xef, KEY_5}, | 48 | {0x01ef, KEY_5}, |
49 | {0x01, 0x6f, KEY_6}, | 49 | {0x016f, KEY_6}, |
50 | {0x01, 0xaf, KEY_7}, | 50 | {0x01af, KEY_7}, |
51 | {0x01, 0x27, KEY_8}, | 51 | {0x0127, KEY_8}, |
52 | {0x01, 0x07, KEY_9}, | 52 | {0x0107, KEY_9}, |
53 | {0x01, 0xcf, KEY_ZOOM}, | 53 | {0x01cf, KEY_ZOOM}, |
54 | {0x01, 0x4f, KEY_0}, | 54 | {0x014f, KEY_0}, |
55 | {0x01, 0x8f, KEY_GOTO}, /* marked jump on the remote */ | 55 | {0x018f, KEY_GOTO}, /* marked jump on the remote */ |
56 | 56 | ||
57 | {0x00, 0xbd, KEY_POWER}, | 57 | {0x00bd, KEY_POWER}, |
58 | {0x00, 0x7d, KEY_VOLUMEUP}, | 58 | {0x007d, KEY_VOLUMEUP}, |
59 | {0x00, 0xfd, KEY_CHANNELUP}, | 59 | {0x00fd, KEY_CHANNELUP}, |
60 | {0x00, 0x9d, KEY_MUTE}, | 60 | {0x009d, KEY_MUTE}, |
61 | {0x00, 0x5d, KEY_VOLUMEDOWN}, | 61 | {0x005d, KEY_VOLUMEDOWN}, |
62 | {0x00, 0xdd, KEY_CHANNELDOWN}, | 62 | {0x00dd, KEY_CHANNELDOWN}, |
63 | {0x00, 0xad, KEY_1}, | 63 | {0x00ad, KEY_1}, |
64 | {0x00, 0x6d, KEY_2}, | 64 | {0x006d, KEY_2}, |
65 | {0x00, 0xed, KEY_3}, | 65 | {0x00ed, KEY_3}, |
66 | {0x00, 0x8d, KEY_4}, | 66 | {0x008d, KEY_4}, |
67 | {0x00, 0x4d, KEY_5}, | 67 | {0x004d, KEY_5}, |
68 | {0x00, 0xcd, KEY_6}, | 68 | {0x00cd, KEY_6}, |
69 | {0x00, 0xb5, KEY_7}, | 69 | {0x00b5, KEY_7}, |
70 | {0x00, 0x75, KEY_8}, | 70 | {0x0075, KEY_8}, |
71 | {0x00, 0xf5, KEY_9}, | 71 | {0x00f5, KEY_9}, |
72 | {0x00, 0x95, KEY_ZOOM}, | 72 | {0x0095, KEY_ZOOM}, |
73 | {0x00, 0x55, KEY_0}, | 73 | {0x0055, KEY_0}, |
74 | {0x00, 0xd5, KEY_GOTO}, /* marked jump on the remote */ | 74 | {0x00d5, KEY_GOTO}, /* marked jump on the remote */ |
75 | }; | 75 | }; |
76 | 76 | ||
77 | int af9005_rc_keys_size = ARRAY_SIZE(af9005_rc_keys); | 77 | int af9005_rc_keys_size = ARRAY_SIZE(af9005_rc_keys); |
@@ -131,8 +131,8 @@ int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, u32 * event, | |||
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |
133 | for (i = 0; i < af9005_rc_keys_size; i++) { | 133 | for (i = 0; i < af9005_rc_keys_size; i++) { |
134 | if (af9005_rc_keys[i].custom == cust | 134 | if (rc5_custom(&af9005_rc_keys[i]) == cust |
135 | && af9005_rc_keys[i].data == dat) { | 135 | && rc5_data(&af9005_rc_keys[i]) == dat) { |
136 | *event = af9005_rc_keys[i].event; | 136 | *event = af9005_rc_keys[i].event; |
137 | *state = REMOTE_KEY_PRESSED; | 137 | *state = REMOTE_KEY_PRESSED; |
138 | deb_decode | 138 | deb_decode |
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index 26690dfb3260..99cdd0d101ca 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c | |||
@@ -538,24 +538,22 @@ exit: | |||
538 | /* dump eeprom */ | 538 | /* dump eeprom */ |
539 | static int af9015_eeprom_dump(struct dvb_usb_device *d) | 539 | static int af9015_eeprom_dump(struct dvb_usb_device *d) |
540 | { | 540 | { |
541 | char buf[4+3*16+1], buf2[4]; | ||
542 | u8 reg, val; | 541 | u8 reg, val; |
543 | 542 | ||
544 | for (reg = 0; ; reg++) { | 543 | for (reg = 0; ; reg++) { |
545 | if (reg % 16 == 0) { | 544 | if (reg % 16 == 0) { |
546 | if (reg) | 545 | if (reg) |
547 | deb_info("%s\n", buf); | 546 | deb_info(KERN_CONT "\n"); |
548 | sprintf(buf, "%02x: ", reg); | 547 | deb_info(KERN_DEBUG "%02x:", reg); |
549 | } | 548 | } |
550 | if (af9015_read_reg_i2c(d, AF9015_I2C_EEPROM, reg, &val) == 0) | 549 | if (af9015_read_reg_i2c(d, AF9015_I2C_EEPROM, reg, &val) == 0) |
551 | sprintf(buf2, "%02x ", val); | 550 | deb_info(KERN_CONT " %02x", val); |
552 | else | 551 | else |
553 | strcpy(buf2, "-- "); | 552 | deb_info(KERN_CONT " --"); |
554 | strcat(buf, buf2); | ||
555 | if (reg == 0xff) | 553 | if (reg == 0xff) |
556 | break; | 554 | break; |
557 | } | 555 | } |
558 | deb_info("%s\n", buf); | 556 | deb_info(KERN_CONT "\n"); |
559 | return 0; | 557 | return 0; |
560 | } | 558 | } |
561 | 559 | ||
@@ -1045,8 +1043,8 @@ static int af9015_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
1045 | *state = REMOTE_NO_KEY_PRESSED; | 1043 | *state = REMOTE_NO_KEY_PRESSED; |
1046 | 1044 | ||
1047 | for (i = 0; i < d->props.rc_key_map_size; i++) { | 1045 | for (i = 0; i < d->props.rc_key_map_size; i++) { |
1048 | if (!buf[1] && keymap[i].custom == buf[0] && | 1046 | if (!buf[1] && rc5_custom(&keymap[i]) == buf[0] && |
1049 | keymap[i].data == buf[2]) { | 1047 | rc5_data(&keymap[i]) == buf[2]) { |
1050 | *event = keymap[i].event; | 1048 | *event = keymap[i].event; |
1051 | *state = REMOTE_KEY_PRESSED; | 1049 | *state = REMOTE_KEY_PRESSED; |
1052 | break; | 1050 | break; |
@@ -1266,6 +1264,7 @@ static struct usb_device_id af9015_usb_table[] = { | |||
1266 | {USB_DEVICE(USB_VID_KWORLD_2, USB_PID_CONCEPTRONIC_CTVDIGRCU)}, | 1264 | {USB_DEVICE(USB_VID_KWORLD_2, USB_PID_CONCEPTRONIC_CTVDIGRCU)}, |
1267 | {USB_DEVICE(USB_VID_KWORLD_2, USB_PID_KWORLD_MC810)}, | 1265 | {USB_DEVICE(USB_VID_KWORLD_2, USB_PID_KWORLD_MC810)}, |
1268 | {USB_DEVICE(USB_VID_KYE, USB_PID_GENIUS_TVGO_DVB_T03)}, | 1266 | {USB_DEVICE(USB_VID_KYE, USB_PID_GENIUS_TVGO_DVB_T03)}, |
1267 | /* 25 */{USB_DEVICE(USB_VID_KWORLD_2, USB_PID_KWORLD_399U_2)}, | ||
1269 | {0}, | 1268 | {0}, |
1270 | }; | 1269 | }; |
1271 | MODULE_DEVICE_TABLE(usb, af9015_usb_table); | 1270 | MODULE_DEVICE_TABLE(usb, af9015_usb_table); |
@@ -1346,7 +1345,8 @@ static struct dvb_usb_device_properties af9015_properties[] = { | |||
1346 | { | 1345 | { |
1347 | .name = "KWorld PlusTV Dual DVB-T Stick " \ | 1346 | .name = "KWorld PlusTV Dual DVB-T Stick " \ |
1348 | "(DVB-T 399U)", | 1347 | "(DVB-T 399U)", |
1349 | .cold_ids = {&af9015_usb_table[4], NULL}, | 1348 | .cold_ids = {&af9015_usb_table[4], |
1349 | &af9015_usb_table[25], NULL}, | ||
1350 | .warm_ids = {NULL}, | 1350 | .warm_ids = {NULL}, |
1351 | }, | 1351 | }, |
1352 | { | 1352 | { |
diff --git a/drivers/media/dvb/dvb-usb/af9015.h b/drivers/media/dvb/dvb-usb/af9015.h index 8d81a17c116d..c41f30e4a1b8 100644 --- a/drivers/media/dvb/dvb-usb/af9015.h +++ b/drivers/media/dvb/dvb-usb/af9015.h | |||
@@ -121,21 +121,21 @@ enum af9015_remote { | |||
121 | 121 | ||
122 | /* Leadtek WinFast DTV Dongle Gold */ | 122 | /* Leadtek WinFast DTV Dongle Gold */ |
123 | static struct dvb_usb_rc_key af9015_rc_keys_leadtek[] = { | 123 | static struct dvb_usb_rc_key af9015_rc_keys_leadtek[] = { |
124 | { 0x00, 0x1e, KEY_1 }, | 124 | { 0x001e, KEY_1 }, |
125 | { 0x00, 0x1f, KEY_2 }, | 125 | { 0x001f, KEY_2 }, |
126 | { 0x00, 0x20, KEY_3 }, | 126 | { 0x0020, KEY_3 }, |
127 | { 0x00, 0x21, KEY_4 }, | 127 | { 0x0021, KEY_4 }, |
128 | { 0x00, 0x22, KEY_5 }, | 128 | { 0x0022, KEY_5 }, |
129 | { 0x00, 0x23, KEY_6 }, | 129 | { 0x0023, KEY_6 }, |
130 | { 0x00, 0x24, KEY_7 }, | 130 | { 0x0024, KEY_7 }, |
131 | { 0x00, 0x25, KEY_8 }, | 131 | { 0x0025, KEY_8 }, |
132 | { 0x00, 0x26, KEY_9 }, | 132 | { 0x0026, KEY_9 }, |
133 | { 0x00, 0x27, KEY_0 }, | 133 | { 0x0027, KEY_0 }, |
134 | { 0x00, 0x28, KEY_ENTER }, | 134 | { 0x0028, KEY_ENTER }, |
135 | { 0x00, 0x4f, KEY_VOLUMEUP }, | 135 | { 0x004f, KEY_VOLUMEUP }, |
136 | { 0x00, 0x50, KEY_VOLUMEDOWN }, | 136 | { 0x0050, KEY_VOLUMEDOWN }, |
137 | { 0x00, 0x51, KEY_CHANNELDOWN }, | 137 | { 0x0051, KEY_CHANNELDOWN }, |
138 | { 0x00, 0x52, KEY_CHANNELUP }, | 138 | { 0x0052, KEY_CHANNELUP }, |
139 | }; | 139 | }; |
140 | 140 | ||
141 | static u8 af9015_ir_table_leadtek[] = { | 141 | static u8 af9015_ir_table_leadtek[] = { |
@@ -193,60 +193,60 @@ static u8 af9015_ir_table_leadtek[] = { | |||
193 | 193 | ||
194 | /* TwinHan AzureWave AD-TU700(704J) */ | 194 | /* TwinHan AzureWave AD-TU700(704J) */ |
195 | static struct dvb_usb_rc_key af9015_rc_keys_twinhan[] = { | 195 | static struct dvb_usb_rc_key af9015_rc_keys_twinhan[] = { |
196 | { 0x05, 0x3f, KEY_POWER }, | 196 | { 0x053f, KEY_POWER }, |
197 | { 0x00, 0x19, KEY_FAVORITES }, /* Favorite List */ | 197 | { 0x0019, KEY_FAVORITES }, /* Favorite List */ |
198 | { 0x00, 0x04, KEY_TEXT }, /* Teletext */ | 198 | { 0x0004, KEY_TEXT }, /* Teletext */ |
199 | { 0x00, 0x0e, KEY_POWER }, | 199 | { 0x000e, KEY_POWER }, |
200 | { 0x00, 0x0e, KEY_INFO }, /* Preview */ | 200 | { 0x000e, KEY_INFO }, /* Preview */ |
201 | { 0x00, 0x08, KEY_EPG }, /* Info/EPG */ | 201 | { 0x0008, KEY_EPG }, /* Info/EPG */ |
202 | { 0x00, 0x0f, KEY_LIST }, /* Record List */ | 202 | { 0x000f, KEY_LIST }, /* Record List */ |
203 | { 0x00, 0x1e, KEY_1 }, | 203 | { 0x001e, KEY_1 }, |
204 | { 0x00, 0x1f, KEY_2 }, | 204 | { 0x001f, KEY_2 }, |
205 | { 0x00, 0x20, KEY_3 }, | 205 | { 0x0020, KEY_3 }, |
206 | { 0x00, 0x21, KEY_4 }, | 206 | { 0x0021, KEY_4 }, |
207 | { 0x00, 0x22, KEY_5 }, | 207 | { 0x0022, KEY_5 }, |
208 | { 0x00, 0x23, KEY_6 }, | 208 | { 0x0023, KEY_6 }, |
209 | { 0x00, 0x24, KEY_7 }, | 209 | { 0x0024, KEY_7 }, |
210 | { 0x00, 0x25, KEY_8 }, | 210 | { 0x0025, KEY_8 }, |
211 | { 0x00, 0x26, KEY_9 }, | 211 | { 0x0026, KEY_9 }, |
212 | { 0x00, 0x27, KEY_0 }, | 212 | { 0x0027, KEY_0 }, |
213 | { 0x00, 0x29, KEY_CANCEL }, /* Cancel */ | 213 | { 0x0029, KEY_CANCEL }, /* Cancel */ |
214 | { 0x00, 0x4c, KEY_CLEAR }, /* Clear */ | 214 | { 0x004c, KEY_CLEAR }, /* Clear */ |
215 | { 0x00, 0x2a, KEY_BACK }, /* Back */ | 215 | { 0x002a, KEY_BACK }, /* Back */ |
216 | { 0x00, 0x2b, KEY_TAB }, /* Tab */ | 216 | { 0x002b, KEY_TAB }, /* Tab */ |
217 | { 0x00, 0x52, KEY_UP }, /* up arrow */ | 217 | { 0x0052, KEY_UP }, /* up arrow */ |
218 | { 0x00, 0x51, KEY_DOWN }, /* down arrow */ | 218 | { 0x0051, KEY_DOWN }, /* down arrow */ |
219 | { 0x00, 0x4f, KEY_RIGHT }, /* right arrow */ | 219 | { 0x004f, KEY_RIGHT }, /* right arrow */ |
220 | { 0x00, 0x50, KEY_LEFT }, /* left arrow */ | 220 | { 0x0050, KEY_LEFT }, /* left arrow */ |
221 | { 0x00, 0x28, KEY_ENTER }, /* Enter / ok */ | 221 | { 0x0028, KEY_ENTER }, /* Enter / ok */ |
222 | { 0x02, 0x52, KEY_VOLUMEUP }, | 222 | { 0x0252, KEY_VOLUMEUP }, |
223 | { 0x02, 0x51, KEY_VOLUMEDOWN }, | 223 | { 0x0251, KEY_VOLUMEDOWN }, |
224 | { 0x00, 0x4e, KEY_CHANNELDOWN }, | 224 | { 0x004e, KEY_CHANNELDOWN }, |
225 | { 0x00, 0x4b, KEY_CHANNELUP }, | 225 | { 0x004b, KEY_CHANNELUP }, |
226 | { 0x00, 0x4a, KEY_RECORD }, | 226 | { 0x004a, KEY_RECORD }, |
227 | { 0x01, 0x11, KEY_PLAY }, | 227 | { 0x0111, KEY_PLAY }, |
228 | { 0x00, 0x17, KEY_PAUSE }, | 228 | { 0x0017, KEY_PAUSE }, |
229 | { 0x00, 0x0c, KEY_REWIND }, /* FR << */ | 229 | { 0x000c, KEY_REWIND }, /* FR << */ |
230 | { 0x00, 0x11, KEY_FASTFORWARD }, /* FF >> */ | 230 | { 0x0011, KEY_FASTFORWARD }, /* FF >> */ |
231 | { 0x01, 0x15, KEY_PREVIOUS }, /* Replay */ | 231 | { 0x0115, KEY_PREVIOUS }, /* Replay */ |
232 | { 0x01, 0x0e, KEY_NEXT }, /* Skip */ | 232 | { 0x010e, KEY_NEXT }, /* Skip */ |
233 | { 0x00, 0x13, KEY_CAMERA }, /* Capture */ | 233 | { 0x0013, KEY_CAMERA }, /* Capture */ |
234 | { 0x01, 0x0f, KEY_LANGUAGE }, /* SAP */ | 234 | { 0x010f, KEY_LANGUAGE }, /* SAP */ |
235 | { 0x01, 0x13, KEY_TV2 }, /* PIP */ | 235 | { 0x0113, KEY_TV2 }, /* PIP */ |
236 | { 0x00, 0x1d, KEY_ZOOM }, /* Full Screen */ | 236 | { 0x001d, KEY_ZOOM }, /* Full Screen */ |
237 | { 0x01, 0x17, KEY_SUBTITLE }, /* Subtitle / CC */ | 237 | { 0x0117, KEY_SUBTITLE }, /* Subtitle / CC */ |
238 | { 0x00, 0x10, KEY_MUTE }, | 238 | { 0x0010, KEY_MUTE }, |
239 | { 0x01, 0x19, KEY_AUDIO }, /* L/R */ /* TODO better event */ | 239 | { 0x0119, KEY_AUDIO }, /* L/R */ /* TODO better event */ |
240 | { 0x01, 0x16, KEY_SLEEP }, /* Hibernate */ | 240 | { 0x0116, KEY_SLEEP }, /* Hibernate */ |
241 | { 0x01, 0x16, KEY_SWITCHVIDEOMODE }, | 241 | { 0x0116, KEY_SWITCHVIDEOMODE }, |
242 | /* A/V */ /* TODO does not work */ | 242 | /* A/V */ /* TODO does not work */ |
243 | { 0x00, 0x06, KEY_AGAIN }, /* Recall */ | 243 | { 0x0006, KEY_AGAIN }, /* Recall */ |
244 | { 0x01, 0x16, KEY_KPPLUS }, /* Zoom+ */ /* TODO does not work */ | 244 | { 0x0116, KEY_KPPLUS }, /* Zoom+ */ /* TODO does not work */ |
245 | { 0x01, 0x16, KEY_KPMINUS }, /* Zoom- */ /* TODO does not work */ | 245 | { 0x0116, KEY_KPMINUS }, /* Zoom- */ /* TODO does not work */ |
246 | { 0x02, 0x15, KEY_RED }, | 246 | { 0x0215, KEY_RED }, |
247 | { 0x02, 0x0a, KEY_GREEN }, | 247 | { 0x020a, KEY_GREEN }, |
248 | { 0x02, 0x1c, KEY_YELLOW }, | 248 | { 0x021c, KEY_YELLOW }, |
249 | { 0x02, 0x05, KEY_BLUE }, | 249 | { 0x0205, KEY_BLUE }, |
250 | }; | 250 | }; |
251 | 251 | ||
252 | static u8 af9015_ir_table_twinhan[] = { | 252 | static u8 af9015_ir_table_twinhan[] = { |
@@ -304,24 +304,24 @@ static u8 af9015_ir_table_twinhan[] = { | |||
304 | 304 | ||
305 | /* A-Link DTU(m) */ | 305 | /* A-Link DTU(m) */ |
306 | static struct dvb_usb_rc_key af9015_rc_keys_a_link[] = { | 306 | static struct dvb_usb_rc_key af9015_rc_keys_a_link[] = { |
307 | { 0x00, 0x1e, KEY_1 }, | 307 | { 0x001e, KEY_1 }, |
308 | { 0x00, 0x1f, KEY_2 }, | 308 | { 0x001f, KEY_2 }, |
309 | { 0x00, 0x20, KEY_3 }, | 309 | { 0x0020, KEY_3 }, |
310 | { 0x00, 0x21, KEY_4 }, | 310 | { 0x0021, KEY_4 }, |
311 | { 0x00, 0x22, KEY_5 }, | 311 | { 0x0022, KEY_5 }, |
312 | { 0x00, 0x23, KEY_6 }, | 312 | { 0x0023, KEY_6 }, |
313 | { 0x00, 0x24, KEY_7 }, | 313 | { 0x0024, KEY_7 }, |
314 | { 0x00, 0x25, KEY_8 }, | 314 | { 0x0025, KEY_8 }, |
315 | { 0x00, 0x26, KEY_9 }, | 315 | { 0x0026, KEY_9 }, |
316 | { 0x00, 0x27, KEY_0 }, | 316 | { 0x0027, KEY_0 }, |
317 | { 0x00, 0x2e, KEY_CHANNELUP }, | 317 | { 0x002e, KEY_CHANNELUP }, |
318 | { 0x00, 0x2d, KEY_CHANNELDOWN }, | 318 | { 0x002d, KEY_CHANNELDOWN }, |
319 | { 0x04, 0x28, KEY_ZOOM }, | 319 | { 0x0428, KEY_ZOOM }, |
320 | { 0x00, 0x41, KEY_MUTE }, | 320 | { 0x0041, KEY_MUTE }, |
321 | { 0x00, 0x42, KEY_VOLUMEDOWN }, | 321 | { 0x0042, KEY_VOLUMEDOWN }, |
322 | { 0x00, 0x43, KEY_VOLUMEUP }, | 322 | { 0x0043, KEY_VOLUMEUP }, |
323 | { 0x00, 0x44, KEY_GOTO }, /* jump */ | 323 | { 0x0044, KEY_GOTO }, /* jump */ |
324 | { 0x05, 0x45, KEY_POWER }, | 324 | { 0x0545, KEY_POWER }, |
325 | }; | 325 | }; |
326 | 326 | ||
327 | static u8 af9015_ir_table_a_link[] = { | 327 | static u8 af9015_ir_table_a_link[] = { |
@@ -347,24 +347,24 @@ static u8 af9015_ir_table_a_link[] = { | |||
347 | 347 | ||
348 | /* MSI DIGIVOX mini II V3.0 */ | 348 | /* MSI DIGIVOX mini II V3.0 */ |
349 | static struct dvb_usb_rc_key af9015_rc_keys_msi[] = { | 349 | static struct dvb_usb_rc_key af9015_rc_keys_msi[] = { |
350 | { 0x00, 0x1e, KEY_1 }, | 350 | { 0x001e, KEY_1 }, |
351 | { 0x00, 0x1f, KEY_2 }, | 351 | { 0x001f, KEY_2 }, |
352 | { 0x00, 0x20, KEY_3 }, | 352 | { 0x0020, KEY_3 }, |
353 | { 0x00, 0x21, KEY_4 }, | 353 | { 0x0021, KEY_4 }, |
354 | { 0x00, 0x22, KEY_5 }, | 354 | { 0x0022, KEY_5 }, |
355 | { 0x00, 0x23, KEY_6 }, | 355 | { 0x0023, KEY_6 }, |
356 | { 0x00, 0x24, KEY_7 }, | 356 | { 0x0024, KEY_7 }, |
357 | { 0x00, 0x25, KEY_8 }, | 357 | { 0x0025, KEY_8 }, |
358 | { 0x00, 0x26, KEY_9 }, | 358 | { 0x0026, KEY_9 }, |
359 | { 0x00, 0x27, KEY_0 }, | 359 | { 0x0027, KEY_0 }, |
360 | { 0x03, 0x0f, KEY_CHANNELUP }, | 360 | { 0x030f, KEY_CHANNELUP }, |
361 | { 0x03, 0x0e, KEY_CHANNELDOWN }, | 361 | { 0x030e, KEY_CHANNELDOWN }, |
362 | { 0x00, 0x42, KEY_VOLUMEDOWN }, | 362 | { 0x0042, KEY_VOLUMEDOWN }, |
363 | { 0x00, 0x43, KEY_VOLUMEUP }, | 363 | { 0x0043, KEY_VOLUMEUP }, |
364 | { 0x05, 0x45, KEY_POWER }, | 364 | { 0x0545, KEY_POWER }, |
365 | { 0x00, 0x52, KEY_UP }, /* up */ | 365 | { 0x0052, KEY_UP }, /* up */ |
366 | { 0x00, 0x51, KEY_DOWN }, /* down */ | 366 | { 0x0051, KEY_DOWN }, /* down */ |
367 | { 0x00, 0x28, KEY_ENTER }, | 367 | { 0x0028, KEY_ENTER }, |
368 | }; | 368 | }; |
369 | 369 | ||
370 | static u8 af9015_ir_table_msi[] = { | 370 | static u8 af9015_ir_table_msi[] = { |
@@ -390,42 +390,42 @@ static u8 af9015_ir_table_msi[] = { | |||
390 | 390 | ||
391 | /* MYGICTV U718 */ | 391 | /* MYGICTV U718 */ |
392 | static struct dvb_usb_rc_key af9015_rc_keys_mygictv[] = { | 392 | static struct dvb_usb_rc_key af9015_rc_keys_mygictv[] = { |
393 | { 0x00, 0x3d, KEY_SWITCHVIDEOMODE }, | 393 | { 0x003d, KEY_SWITCHVIDEOMODE }, |
394 | /* TV / AV */ | 394 | /* TV / AV */ |
395 | { 0x05, 0x45, KEY_POWER }, | 395 | { 0x0545, KEY_POWER }, |
396 | { 0x00, 0x1e, KEY_1 }, | 396 | { 0x001e, KEY_1 }, |
397 | { 0x00, 0x1f, KEY_2 }, | 397 | { 0x001f, KEY_2 }, |
398 | { 0x00, 0x20, KEY_3 }, | 398 | { 0x0020, KEY_3 }, |
399 | { 0x00, 0x21, KEY_4 }, | 399 | { 0x0021, KEY_4 }, |
400 | { 0x00, 0x22, KEY_5 }, | 400 | { 0x0022, KEY_5 }, |
401 | { 0x00, 0x23, KEY_6 }, | 401 | { 0x0023, KEY_6 }, |
402 | { 0x00, 0x24, KEY_7 }, | 402 | { 0x0024, KEY_7 }, |
403 | { 0x00, 0x25, KEY_8 }, | 403 | { 0x0025, KEY_8 }, |
404 | { 0x00, 0x26, KEY_9 }, | 404 | { 0x0026, KEY_9 }, |
405 | { 0x00, 0x27, KEY_0 }, | 405 | { 0x0027, KEY_0 }, |
406 | { 0x00, 0x41, KEY_MUTE }, | 406 | { 0x0041, KEY_MUTE }, |
407 | { 0x00, 0x2a, KEY_ESC }, /* Esc */ | 407 | { 0x002a, KEY_ESC }, /* Esc */ |
408 | { 0x00, 0x2e, KEY_CHANNELUP }, | 408 | { 0x002e, KEY_CHANNELUP }, |
409 | { 0x00, 0x2d, KEY_CHANNELDOWN }, | 409 | { 0x002d, KEY_CHANNELDOWN }, |
410 | { 0x00, 0x42, KEY_VOLUMEDOWN }, | 410 | { 0x0042, KEY_VOLUMEDOWN }, |
411 | { 0x00, 0x43, KEY_VOLUMEUP }, | 411 | { 0x0043, KEY_VOLUMEUP }, |
412 | { 0x00, 0x52, KEY_UP }, /* up arrow */ | 412 | { 0x0052, KEY_UP }, /* up arrow */ |
413 | { 0x00, 0x51, KEY_DOWN }, /* down arrow */ | 413 | { 0x0051, KEY_DOWN }, /* down arrow */ |
414 | { 0x00, 0x4f, KEY_RIGHT }, /* right arrow */ | 414 | { 0x004f, KEY_RIGHT }, /* right arrow */ |
415 | { 0x00, 0x50, KEY_LEFT }, /* left arrow */ | 415 | { 0x0050, KEY_LEFT }, /* left arrow */ |
416 | { 0x00, 0x28, KEY_ENTER }, /* ok */ | 416 | { 0x0028, KEY_ENTER }, /* ok */ |
417 | { 0x01, 0x15, KEY_RECORD }, | 417 | { 0x0115, KEY_RECORD }, |
418 | { 0x03, 0x13, KEY_PLAY }, | 418 | { 0x0313, KEY_PLAY }, |
419 | { 0x01, 0x13, KEY_PAUSE }, | 419 | { 0x0113, KEY_PAUSE }, |
420 | { 0x01, 0x16, KEY_STOP }, | 420 | { 0x0116, KEY_STOP }, |
421 | { 0x03, 0x07, KEY_REWIND }, /* FR << */ | 421 | { 0x0307, KEY_REWIND }, /* FR << */ |
422 | { 0x03, 0x09, KEY_FASTFORWARD }, /* FF >> */ | 422 | { 0x0309, KEY_FASTFORWARD }, /* FF >> */ |
423 | { 0x00, 0x3b, KEY_TIME }, /* TimeShift */ | 423 | { 0x003b, KEY_TIME }, /* TimeShift */ |
424 | { 0x00, 0x3e, KEY_CAMERA }, /* Snapshot */ | 424 | { 0x003e, KEY_CAMERA }, /* Snapshot */ |
425 | { 0x03, 0x16, KEY_CYCLEWINDOWS }, /* yellow, min / max */ | 425 | { 0x0316, KEY_CYCLEWINDOWS }, /* yellow, min / max */ |
426 | { 0x00, 0x00, KEY_ZOOM }, /* 'select' (?) */ | 426 | { 0x0000, KEY_ZOOM }, /* 'select' (?) */ |
427 | { 0x03, 0x16, KEY_SHUFFLE }, /* Shuffle */ | 427 | { 0x0316, KEY_SHUFFLE }, /* Shuffle */ |
428 | { 0x03, 0x45, KEY_POWER }, | 428 | { 0x0345, KEY_POWER }, |
429 | }; | 429 | }; |
430 | 430 | ||
431 | static u8 af9015_ir_table_mygictv[] = { | 431 | static u8 af9015_ir_table_mygictv[] = { |
@@ -516,41 +516,41 @@ static u8 af9015_ir_table_kworld[] = { | |||
516 | 516 | ||
517 | /* AverMedia Volar X */ | 517 | /* AverMedia Volar X */ |
518 | static struct dvb_usb_rc_key af9015_rc_keys_avermedia[] = { | 518 | static struct dvb_usb_rc_key af9015_rc_keys_avermedia[] = { |
519 | { 0x05, 0x3d, KEY_PROG1 }, /* SOURCE */ | 519 | { 0x053d, KEY_PROG1 }, /* SOURCE */ |
520 | { 0x05, 0x12, KEY_POWER }, /* POWER */ | 520 | { 0x0512, KEY_POWER }, /* POWER */ |
521 | { 0x05, 0x1e, KEY_1 }, /* 1 */ | 521 | { 0x051e, KEY_1 }, /* 1 */ |
522 | { 0x05, 0x1f, KEY_2 }, /* 2 */ | 522 | { 0x051f, KEY_2 }, /* 2 */ |
523 | { 0x05, 0x20, KEY_3 }, /* 3 */ | 523 | { 0x0520, KEY_3 }, /* 3 */ |
524 | { 0x05, 0x21, KEY_4 }, /* 4 */ | 524 | { 0x0521, KEY_4 }, /* 4 */ |
525 | { 0x05, 0x22, KEY_5 }, /* 5 */ | 525 | { 0x0522, KEY_5 }, /* 5 */ |
526 | { 0x05, 0x23, KEY_6 }, /* 6 */ | 526 | { 0x0523, KEY_6 }, /* 6 */ |
527 | { 0x05, 0x24, KEY_7 }, /* 7 */ | 527 | { 0x0524, KEY_7 }, /* 7 */ |
528 | { 0x05, 0x25, KEY_8 }, /* 8 */ | 528 | { 0x0525, KEY_8 }, /* 8 */ |
529 | { 0x05, 0x26, KEY_9 }, /* 9 */ | 529 | { 0x0526, KEY_9 }, /* 9 */ |
530 | { 0x05, 0x3f, KEY_LEFT }, /* L / DISPLAY */ | 530 | { 0x053f, KEY_LEFT }, /* L / DISPLAY */ |
531 | { 0x05, 0x27, KEY_0 }, /* 0 */ | 531 | { 0x0527, KEY_0 }, /* 0 */ |
532 | { 0x05, 0x0f, KEY_RIGHT }, /* R / CH RTN */ | 532 | { 0x050f, KEY_RIGHT }, /* R / CH RTN */ |
533 | { 0x05, 0x18, KEY_PROG2 }, /* SNAP SHOT */ | 533 | { 0x0518, KEY_PROG2 }, /* SNAP SHOT */ |
534 | { 0x05, 0x1c, KEY_PROG3 }, /* 16-CH PREV */ | 534 | { 0x051c, KEY_PROG3 }, /* 16-CH PREV */ |
535 | { 0x05, 0x2d, KEY_VOLUMEDOWN }, /* VOL DOWN */ | 535 | { 0x052d, KEY_VOLUMEDOWN }, /* VOL DOWN */ |
536 | { 0x05, 0x3e, KEY_ZOOM }, /* FULL SCREEN */ | 536 | { 0x053e, KEY_ZOOM }, /* FULL SCREEN */ |
537 | { 0x05, 0x2e, KEY_VOLUMEUP }, /* VOL UP */ | 537 | { 0x052e, KEY_VOLUMEUP }, /* VOL UP */ |
538 | { 0x05, 0x10, KEY_MUTE }, /* MUTE */ | 538 | { 0x0510, KEY_MUTE }, /* MUTE */ |
539 | { 0x05, 0x04, KEY_AUDIO }, /* AUDIO */ | 539 | { 0x0504, KEY_AUDIO }, /* AUDIO */ |
540 | { 0x05, 0x15, KEY_RECORD }, /* RECORD */ | 540 | { 0x0515, KEY_RECORD }, /* RECORD */ |
541 | { 0x05, 0x11, KEY_PLAY }, /* PLAY */ | 541 | { 0x0511, KEY_PLAY }, /* PLAY */ |
542 | { 0x05, 0x16, KEY_STOP }, /* STOP */ | 542 | { 0x0516, KEY_STOP }, /* STOP */ |
543 | { 0x05, 0x0c, KEY_PLAYPAUSE }, /* TIMESHIFT / PAUSE */ | 543 | { 0x050c, KEY_PLAYPAUSE }, /* TIMESHIFT / PAUSE */ |
544 | { 0x05, 0x05, KEY_BACK }, /* << / RED */ | 544 | { 0x0505, KEY_BACK }, /* << / RED */ |
545 | { 0x05, 0x09, KEY_FORWARD }, /* >> / YELLOW */ | 545 | { 0x0509, KEY_FORWARD }, /* >> / YELLOW */ |
546 | { 0x05, 0x17, KEY_TEXT }, /* TELETEXT */ | 546 | { 0x0517, KEY_TEXT }, /* TELETEXT */ |
547 | { 0x05, 0x0a, KEY_EPG }, /* EPG */ | 547 | { 0x050a, KEY_EPG }, /* EPG */ |
548 | { 0x05, 0x13, KEY_MENU }, /* MENU */ | 548 | { 0x0513, KEY_MENU }, /* MENU */ |
549 | 549 | ||
550 | { 0x05, 0x0e, KEY_CHANNELUP }, /* CH UP */ | 550 | { 0x050e, KEY_CHANNELUP }, /* CH UP */ |
551 | { 0x05, 0x0d, KEY_CHANNELDOWN }, /* CH DOWN */ | 551 | { 0x050d, KEY_CHANNELDOWN }, /* CH DOWN */ |
552 | { 0x05, 0x19, KEY_FIRST }, /* |<< / GREEN */ | 552 | { 0x0519, KEY_FIRST }, /* |<< / GREEN */ |
553 | { 0x05, 0x08, KEY_LAST }, /* >>| / BLUE */ | 553 | { 0x0508, KEY_LAST }, /* >>| / BLUE */ |
554 | }; | 554 | }; |
555 | 555 | ||
556 | static u8 af9015_ir_table_avermedia[] = { | 556 | static u8 af9015_ir_table_avermedia[] = { |
@@ -622,34 +622,34 @@ static u8 af9015_ir_table_avermedia_ks[] = { | |||
622 | 622 | ||
623 | /* Digittrade DVB-T USB Stick */ | 623 | /* Digittrade DVB-T USB Stick */ |
624 | static struct dvb_usb_rc_key af9015_rc_keys_digittrade[] = { | 624 | static struct dvb_usb_rc_key af9015_rc_keys_digittrade[] = { |
625 | { 0x01, 0x0f, KEY_LAST }, /* RETURN */ | 625 | { 0x010f, KEY_LAST }, /* RETURN */ |
626 | { 0x05, 0x17, KEY_TEXT }, /* TELETEXT */ | 626 | { 0x0517, KEY_TEXT }, /* TELETEXT */ |
627 | { 0x01, 0x08, KEY_EPG }, /* EPG */ | 627 | { 0x0108, KEY_EPG }, /* EPG */ |
628 | { 0x05, 0x13, KEY_POWER }, /* POWER */ | 628 | { 0x0513, KEY_POWER }, /* POWER */ |
629 | { 0x01, 0x09, KEY_ZOOM }, /* FULLSCREEN */ | 629 | { 0x0109, KEY_ZOOM }, /* FULLSCREEN */ |
630 | { 0x00, 0x40, KEY_AUDIO }, /* DUAL SOUND */ | 630 | { 0x0040, KEY_AUDIO }, /* DUAL SOUND */ |
631 | { 0x00, 0x2c, KEY_PRINT }, /* SNAPSHOT */ | 631 | { 0x002c, KEY_PRINT }, /* SNAPSHOT */ |
632 | { 0x05, 0x16, KEY_SUBTITLE }, /* SUBTITLE */ | 632 | { 0x0516, KEY_SUBTITLE }, /* SUBTITLE */ |
633 | { 0x00, 0x52, KEY_CHANNELUP }, /* CH Up */ | 633 | { 0x0052, KEY_CHANNELUP }, /* CH Up */ |
634 | { 0x00, 0x51, KEY_CHANNELDOWN },/* Ch Dn */ | 634 | { 0x0051, KEY_CHANNELDOWN },/* Ch Dn */ |
635 | { 0x00, 0x57, KEY_VOLUMEUP }, /* Vol Up */ | 635 | { 0x0057, KEY_VOLUMEUP }, /* Vol Up */ |
636 | { 0x00, 0x56, KEY_VOLUMEDOWN }, /* Vol Dn */ | 636 | { 0x0056, KEY_VOLUMEDOWN }, /* Vol Dn */ |
637 | { 0x01, 0x10, KEY_MUTE }, /* MUTE */ | 637 | { 0x0110, KEY_MUTE }, /* MUTE */ |
638 | { 0x00, 0x27, KEY_0 }, | 638 | { 0x0027, KEY_0 }, |
639 | { 0x00, 0x1e, KEY_1 }, | 639 | { 0x001e, KEY_1 }, |
640 | { 0x00, 0x1f, KEY_2 }, | 640 | { 0x001f, KEY_2 }, |
641 | { 0x00, 0x20, KEY_3 }, | 641 | { 0x0020, KEY_3 }, |
642 | { 0x00, 0x21, KEY_4 }, | 642 | { 0x0021, KEY_4 }, |
643 | { 0x00, 0x22, KEY_5 }, | 643 | { 0x0022, KEY_5 }, |
644 | { 0x00, 0x23, KEY_6 }, | 644 | { 0x0023, KEY_6 }, |
645 | { 0x00, 0x24, KEY_7 }, | 645 | { 0x0024, KEY_7 }, |
646 | { 0x00, 0x25, KEY_8 }, | 646 | { 0x0025, KEY_8 }, |
647 | { 0x00, 0x26, KEY_9 }, | 647 | { 0x0026, KEY_9 }, |
648 | { 0x01, 0x17, KEY_PLAYPAUSE }, /* TIMESHIFT */ | 648 | { 0x0117, KEY_PLAYPAUSE }, /* TIMESHIFT */ |
649 | { 0x01, 0x15, KEY_RECORD }, /* RECORD */ | 649 | { 0x0115, KEY_RECORD }, /* RECORD */ |
650 | { 0x03, 0x13, KEY_PLAY }, /* PLAY */ | 650 | { 0x0313, KEY_PLAY }, /* PLAY */ |
651 | { 0x01, 0x16, KEY_STOP }, /* STOP */ | 651 | { 0x0116, KEY_STOP }, /* STOP */ |
652 | { 0x01, 0x13, KEY_PAUSE }, /* PAUSE */ | 652 | { 0x0113, KEY_PAUSE }, /* PAUSE */ |
653 | }; | 653 | }; |
654 | 654 | ||
655 | static u8 af9015_ir_table_digittrade[] = { | 655 | static u8 af9015_ir_table_digittrade[] = { |
@@ -685,34 +685,34 @@ static u8 af9015_ir_table_digittrade[] = { | |||
685 | 685 | ||
686 | /* TREKSTOR DVB-T USB Stick */ | 686 | /* TREKSTOR DVB-T USB Stick */ |
687 | static struct dvb_usb_rc_key af9015_rc_keys_trekstor[] = { | 687 | static struct dvb_usb_rc_key af9015_rc_keys_trekstor[] = { |
688 | { 0x07, 0x04, KEY_AGAIN }, /* Home */ | 688 | { 0x0704, KEY_AGAIN }, /* Home */ |
689 | { 0x07, 0x05, KEY_MUTE }, /* Mute */ | 689 | { 0x0705, KEY_MUTE }, /* Mute */ |
690 | { 0x07, 0x06, KEY_UP }, /* Up */ | 690 | { 0x0706, KEY_UP }, /* Up */ |
691 | { 0x07, 0x07, KEY_DOWN }, /* Down */ | 691 | { 0x0707, KEY_DOWN }, /* Down */ |
692 | { 0x07, 0x09, KEY_RIGHT }, /* Right */ | 692 | { 0x0709, KEY_RIGHT }, /* Right */ |
693 | { 0x07, 0x0a, KEY_ENTER }, /* OK */ | 693 | { 0x070a, KEY_ENTER }, /* OK */ |
694 | { 0x07, 0x0b, KEY_FASTFORWARD }, /* Fast forward */ | 694 | { 0x070b, KEY_FASTFORWARD }, /* Fast forward */ |
695 | { 0x07, 0x0c, KEY_REWIND }, /* Rewind */ | 695 | { 0x070c, KEY_REWIND }, /* Rewind */ |
696 | { 0x07, 0x0d, KEY_PLAY }, /* Play/Pause */ | 696 | { 0x070d, KEY_PLAY }, /* Play/Pause */ |
697 | { 0x07, 0x0e, KEY_VOLUMEUP }, /* Volume + */ | 697 | { 0x070e, KEY_VOLUMEUP }, /* Volume + */ |
698 | { 0x07, 0x0f, KEY_VOLUMEDOWN }, /* Volume - */ | 698 | { 0x070f, KEY_VOLUMEDOWN }, /* Volume - */ |
699 | { 0x07, 0x10, KEY_RECORD }, /* Record */ | 699 | { 0x0710, KEY_RECORD }, /* Record */ |
700 | { 0x07, 0x11, KEY_STOP }, /* Stop */ | 700 | { 0x0711, KEY_STOP }, /* Stop */ |
701 | { 0x07, 0x12, KEY_ZOOM }, /* TV */ | 701 | { 0x0712, KEY_ZOOM }, /* TV */ |
702 | { 0x07, 0x13, KEY_EPG }, /* Info/EPG */ | 702 | { 0x0713, KEY_EPG }, /* Info/EPG */ |
703 | { 0x07, 0x14, KEY_CHANNELDOWN }, /* Channel - */ | 703 | { 0x0714, KEY_CHANNELDOWN }, /* Channel - */ |
704 | { 0x07, 0x15, KEY_CHANNELUP }, /* Channel + */ | 704 | { 0x0715, KEY_CHANNELUP }, /* Channel + */ |
705 | { 0x07, 0x1e, KEY_1 }, | 705 | { 0x071e, KEY_1 }, |
706 | { 0x07, 0x1f, KEY_2 }, | 706 | { 0x071f, KEY_2 }, |
707 | { 0x07, 0x20, KEY_3 }, | 707 | { 0x0720, KEY_3 }, |
708 | { 0x07, 0x21, KEY_4 }, | 708 | { 0x0721, KEY_4 }, |
709 | { 0x07, 0x22, KEY_5 }, | 709 | { 0x0722, KEY_5 }, |
710 | { 0x07, 0x23, KEY_6 }, | 710 | { 0x0723, KEY_6 }, |
711 | { 0x07, 0x24, KEY_7 }, | 711 | { 0x0724, KEY_7 }, |
712 | { 0x07, 0x25, KEY_8 }, | 712 | { 0x0725, KEY_8 }, |
713 | { 0x07, 0x26, KEY_9 }, | 713 | { 0x0726, KEY_9 }, |
714 | { 0x07, 0x08, KEY_LEFT }, /* LEFT */ | 714 | { 0x0708, KEY_LEFT }, /* LEFT */ |
715 | { 0x07, 0x27, KEY_0 }, | 715 | { 0x0727, KEY_0 }, |
716 | }; | 716 | }; |
717 | 717 | ||
718 | static u8 af9015_ir_table_trekstor[] = { | 718 | static u8 af9015_ir_table_trekstor[] = { |
diff --git a/drivers/media/dvb/dvb-usb/anysee.c b/drivers/media/dvb/dvb-usb/anysee.c index c6e7b4215d6b..7381aff4dcf6 100644 --- a/drivers/media/dvb/dvb-usb/anysee.c +++ b/drivers/media/dvb/dvb-usb/anysee.c | |||
@@ -389,8 +389,8 @@ static int anysee_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
389 | *state = REMOTE_NO_KEY_PRESSED; | 389 | *state = REMOTE_NO_KEY_PRESSED; |
390 | 390 | ||
391 | for (i = 0; i < d->props.rc_key_map_size; i++) { | 391 | for (i = 0; i < d->props.rc_key_map_size; i++) { |
392 | if (keymap[i].custom == ircode[0] && | 392 | if (rc5_custom(&keymap[i]) == ircode[0] && |
393 | keymap[i].data == ircode[1]) { | 393 | rc5_data(&keymap[i]) == ircode[1]) { |
394 | *event = keymap[i].event; | 394 | *event = keymap[i].event; |
395 | *state = REMOTE_KEY_PRESSED; | 395 | *state = REMOTE_KEY_PRESSED; |
396 | return 0; | 396 | return 0; |
@@ -400,50 +400,50 @@ static int anysee_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
400 | } | 400 | } |
401 | 401 | ||
402 | static struct dvb_usb_rc_key anysee_rc_keys[] = { | 402 | static struct dvb_usb_rc_key anysee_rc_keys[] = { |
403 | { 0x01, 0x00, KEY_0 }, | 403 | { 0x0100, KEY_0 }, |
404 | { 0x01, 0x01, KEY_1 }, | 404 | { 0x0101, KEY_1 }, |
405 | { 0x01, 0x02, KEY_2 }, | 405 | { 0x0102, KEY_2 }, |
406 | { 0x01, 0x03, KEY_3 }, | 406 | { 0x0103, KEY_3 }, |
407 | { 0x01, 0x04, KEY_4 }, | 407 | { 0x0104, KEY_4 }, |
408 | { 0x01, 0x05, KEY_5 }, | 408 | { 0x0105, KEY_5 }, |
409 | { 0x01, 0x06, KEY_6 }, | 409 | { 0x0106, KEY_6 }, |
410 | { 0x01, 0x07, KEY_7 }, | 410 | { 0x0107, KEY_7 }, |
411 | { 0x01, 0x08, KEY_8 }, | 411 | { 0x0108, KEY_8 }, |
412 | { 0x01, 0x09, KEY_9 }, | 412 | { 0x0109, KEY_9 }, |
413 | { 0x01, 0x0a, KEY_POWER }, | 413 | { 0x010a, KEY_POWER }, |
414 | { 0x01, 0x0b, KEY_DOCUMENTS }, /* * */ | 414 | { 0x010b, KEY_DOCUMENTS }, /* * */ |
415 | { 0x01, 0x19, KEY_FAVORITES }, | 415 | { 0x0119, KEY_FAVORITES }, |
416 | { 0x01, 0x20, KEY_SLEEP }, | 416 | { 0x0120, KEY_SLEEP }, |
417 | { 0x01, 0x21, KEY_MODE }, /* 4:3 / 16:9 select */ | 417 | { 0x0121, KEY_MODE }, /* 4:3 / 16:9 select */ |
418 | { 0x01, 0x22, KEY_ZOOM }, | 418 | { 0x0122, KEY_ZOOM }, |
419 | { 0x01, 0x47, KEY_TEXT }, | 419 | { 0x0147, KEY_TEXT }, |
420 | { 0x01, 0x16, KEY_TV }, /* TV / radio select */ | 420 | { 0x0116, KEY_TV }, /* TV / radio select */ |
421 | { 0x01, 0x1e, KEY_LANGUAGE }, /* Second Audio Program */ | 421 | { 0x011e, KEY_LANGUAGE }, /* Second Audio Program */ |
422 | { 0x01, 0x1a, KEY_SUBTITLE }, | 422 | { 0x011a, KEY_SUBTITLE }, |
423 | { 0x01, 0x1b, KEY_CAMERA }, /* screenshot */ | 423 | { 0x011b, KEY_CAMERA }, /* screenshot */ |
424 | { 0x01, 0x42, KEY_MUTE }, | 424 | { 0x0142, KEY_MUTE }, |
425 | { 0x01, 0x0e, KEY_MENU }, | 425 | { 0x010e, KEY_MENU }, |
426 | { 0x01, 0x0f, KEY_EPG }, | 426 | { 0x010f, KEY_EPG }, |
427 | { 0x01, 0x17, KEY_INFO }, | 427 | { 0x0117, KEY_INFO }, |
428 | { 0x01, 0x10, KEY_EXIT }, | 428 | { 0x0110, KEY_EXIT }, |
429 | { 0x01, 0x13, KEY_VOLUMEUP }, | 429 | { 0x0113, KEY_VOLUMEUP }, |
430 | { 0x01, 0x12, KEY_VOLUMEDOWN }, | 430 | { 0x0112, KEY_VOLUMEDOWN }, |
431 | { 0x01, 0x11, KEY_CHANNELUP }, | 431 | { 0x0111, KEY_CHANNELUP }, |
432 | { 0x01, 0x14, KEY_CHANNELDOWN }, | 432 | { 0x0114, KEY_CHANNELDOWN }, |
433 | { 0x01, 0x15, KEY_OK }, | 433 | { 0x0115, KEY_OK }, |
434 | { 0x01, 0x1d, KEY_RED }, | 434 | { 0x011d, KEY_RED }, |
435 | { 0x01, 0x1f, KEY_GREEN }, | 435 | { 0x011f, KEY_GREEN }, |
436 | { 0x01, 0x1c, KEY_YELLOW }, | 436 | { 0x011c, KEY_YELLOW }, |
437 | { 0x01, 0x44, KEY_BLUE }, | 437 | { 0x0144, KEY_BLUE }, |
438 | { 0x01, 0x0c, KEY_SHUFFLE }, /* snapshot */ | 438 | { 0x010c, KEY_SHUFFLE }, /* snapshot */ |
439 | { 0x01, 0x48, KEY_STOP }, | 439 | { 0x0148, KEY_STOP }, |
440 | { 0x01, 0x50, KEY_PLAY }, | 440 | { 0x0150, KEY_PLAY }, |
441 | { 0x01, 0x51, KEY_PAUSE }, | 441 | { 0x0151, KEY_PAUSE }, |
442 | { 0x01, 0x49, KEY_RECORD }, | 442 | { 0x0149, KEY_RECORD }, |
443 | { 0x01, 0x18, KEY_PREVIOUS }, /* |<< */ | 443 | { 0x0118, KEY_PREVIOUS }, /* |<< */ |
444 | { 0x01, 0x0d, KEY_NEXT }, /* >>| */ | 444 | { 0x010d, KEY_NEXT }, /* >>| */ |
445 | { 0x01, 0x24, KEY_PROG1 }, /* F1 */ | 445 | { 0x0124, KEY_PROG1 }, /* F1 */ |
446 | { 0x01, 0x25, KEY_PROG2 }, /* F2 */ | 446 | { 0x0125, KEY_PROG2 }, /* F2 */ |
447 | }; | 447 | }; |
448 | 448 | ||
449 | /* DVB USB Driver stuff */ | 449 | /* DVB USB Driver stuff */ |
diff --git a/drivers/media/dvb/dvb-usb/cinergyT2-core.c b/drivers/media/dvb/dvb-usb/cinergyT2-core.c index 80e37a0d0892..e37ac4d48602 100644 --- a/drivers/media/dvb/dvb-usb/cinergyT2-core.c +++ b/drivers/media/dvb/dvb-usb/cinergyT2-core.c | |||
@@ -85,43 +85,43 @@ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | static struct dvb_usb_rc_key cinergyt2_rc_keys[] = { | 87 | static struct dvb_usb_rc_key cinergyt2_rc_keys[] = { |
88 | { 0x04, 0x01, KEY_POWER }, | 88 | { 0x0401, KEY_POWER }, |
89 | { 0x04, 0x02, KEY_1 }, | 89 | { 0x0402, KEY_1 }, |
90 | { 0x04, 0x03, KEY_2 }, | 90 | { 0x0403, KEY_2 }, |
91 | { 0x04, 0x04, KEY_3 }, | 91 | { 0x0404, KEY_3 }, |
92 | { 0x04, 0x05, KEY_4 }, | 92 | { 0x0405, KEY_4 }, |
93 | { 0x04, 0x06, KEY_5 }, | 93 | { 0x0406, KEY_5 }, |
94 | { 0x04, 0x07, KEY_6 }, | 94 | { 0x0407, KEY_6 }, |
95 | { 0x04, 0x08, KEY_7 }, | 95 | { 0x0408, KEY_7 }, |
96 | { 0x04, 0x09, KEY_8 }, | 96 | { 0x0409, KEY_8 }, |
97 | { 0x04, 0x0a, KEY_9 }, | 97 | { 0x040a, KEY_9 }, |
98 | { 0x04, 0x0c, KEY_0 }, | 98 | { 0x040c, KEY_0 }, |
99 | { 0x04, 0x0b, KEY_VIDEO }, | 99 | { 0x040b, KEY_VIDEO }, |
100 | { 0x04, 0x0d, KEY_REFRESH }, | 100 | { 0x040d, KEY_REFRESH }, |
101 | { 0x04, 0x0e, KEY_SELECT }, | 101 | { 0x040e, KEY_SELECT }, |
102 | { 0x04, 0x0f, KEY_EPG }, | 102 | { 0x040f, KEY_EPG }, |
103 | { 0x04, 0x10, KEY_UP }, | 103 | { 0x0410, KEY_UP }, |
104 | { 0x04, 0x14, KEY_DOWN }, | 104 | { 0x0414, KEY_DOWN }, |
105 | { 0x04, 0x11, KEY_LEFT }, | 105 | { 0x0411, KEY_LEFT }, |
106 | { 0x04, 0x13, KEY_RIGHT }, | 106 | { 0x0413, KEY_RIGHT }, |
107 | { 0x04, 0x12, KEY_OK }, | 107 | { 0x0412, KEY_OK }, |
108 | { 0x04, 0x15, KEY_TEXT }, | 108 | { 0x0415, KEY_TEXT }, |
109 | { 0x04, 0x16, KEY_INFO }, | 109 | { 0x0416, KEY_INFO }, |
110 | { 0x04, 0x17, KEY_RED }, | 110 | { 0x0417, KEY_RED }, |
111 | { 0x04, 0x18, KEY_GREEN }, | 111 | { 0x0418, KEY_GREEN }, |
112 | { 0x04, 0x19, KEY_YELLOW }, | 112 | { 0x0419, KEY_YELLOW }, |
113 | { 0x04, 0x1a, KEY_BLUE }, | 113 | { 0x041a, KEY_BLUE }, |
114 | { 0x04, 0x1c, KEY_VOLUMEUP }, | 114 | { 0x041c, KEY_VOLUMEUP }, |
115 | { 0x04, 0x1e, KEY_VOLUMEDOWN }, | 115 | { 0x041e, KEY_VOLUMEDOWN }, |
116 | { 0x04, 0x1d, KEY_MUTE }, | 116 | { 0x041d, KEY_MUTE }, |
117 | { 0x04, 0x1b, KEY_CHANNELUP }, | 117 | { 0x041b, KEY_CHANNELUP }, |
118 | { 0x04, 0x1f, KEY_CHANNELDOWN }, | 118 | { 0x041f, KEY_CHANNELDOWN }, |
119 | { 0x04, 0x40, KEY_PAUSE }, | 119 | { 0x0440, KEY_PAUSE }, |
120 | { 0x04, 0x4c, KEY_PLAY }, | 120 | { 0x044c, KEY_PLAY }, |
121 | { 0x04, 0x58, KEY_RECORD }, | 121 | { 0x0458, KEY_RECORD }, |
122 | { 0x04, 0x54, KEY_PREVIOUS }, | 122 | { 0x0454, KEY_PREVIOUS }, |
123 | { 0x04, 0x48, KEY_STOP }, | 123 | { 0x0448, KEY_STOP }, |
124 | { 0x04, 0x5c, KEY_NEXT } | 124 | { 0x045c, KEY_NEXT } |
125 | }; | 125 | }; |
126 | 126 | ||
127 | /* Number of keypresses to ignore before detect repeating */ | 127 | /* Number of keypresses to ignore before detect repeating */ |
diff --git a/drivers/media/dvb/dvb-usb/cinergyT2-fe.c b/drivers/media/dvb/dvb-usb/cinergyT2-fe.c index 649f25cca49e..9cd51ac12076 100644 --- a/drivers/media/dvb/dvb-usb/cinergyT2-fe.c +++ b/drivers/media/dvb/dvb-usb/cinergyT2-fe.c | |||
@@ -275,6 +275,7 @@ static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe, | |||
275 | param.tps = cpu_to_le16(compute_tps(fep)); | 275 | param.tps = cpu_to_le16(compute_tps(fep)); |
276 | param.freq = cpu_to_le32(fep->frequency / 1000); | 276 | param.freq = cpu_to_le32(fep->frequency / 1000); |
277 | param.bandwidth = 8 - fep->u.ofdm.bandwidth - BANDWIDTH_8_MHZ; | 277 | param.bandwidth = 8 - fep->u.ofdm.bandwidth - BANDWIDTH_8_MHZ; |
278 | param.flags = 0; | ||
278 | 279 | ||
279 | err = dvb_usb_generic_rw(state->d, | 280 | err = dvb_usb_generic_rw(state->d, |
280 | (char *)¶m, sizeof(param), | 281 | (char *)¶m, sizeof(param), |
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index 406d7fba369d..f65591fb7cec 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include "mxl5005s.h" | 38 | #include "mxl5005s.h" |
39 | #include "dib7000p.h" | 39 | #include "dib7000p.h" |
40 | #include "dib0070.h" | 40 | #include "dib0070.h" |
41 | #include "lgs8gl5.h" | 41 | #include "lgs8gxx.h" |
42 | 42 | ||
43 | /* debug */ | 43 | /* debug */ |
44 | static int dvb_usb_cxusb_debug; | 44 | static int dvb_usb_cxusb_debug; |
@@ -392,8 +392,8 @@ static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
392 | *state = REMOTE_NO_KEY_PRESSED; | 392 | *state = REMOTE_NO_KEY_PRESSED; |
393 | 393 | ||
394 | for (i = 0; i < d->props.rc_key_map_size; i++) { | 394 | for (i = 0; i < d->props.rc_key_map_size; i++) { |
395 | if (keymap[i].custom == ircode[2] && | 395 | if (rc5_custom(&keymap[i]) == ircode[2] && |
396 | keymap[i].data == ircode[3]) { | 396 | rc5_data(&keymap[i]) == ircode[3]) { |
397 | *event = keymap[i].event; | 397 | *event = keymap[i].event; |
398 | *state = REMOTE_KEY_PRESSED; | 398 | *state = REMOTE_KEY_PRESSED; |
399 | 399 | ||
@@ -420,8 +420,8 @@ static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d, u32 *event, | |||
420 | return 0; | 420 | return 0; |
421 | 421 | ||
422 | for (i = 0; i < d->props.rc_key_map_size; i++) { | 422 | for (i = 0; i < d->props.rc_key_map_size; i++) { |
423 | if (keymap[i].custom == ircode[1] && | 423 | if (rc5_custom(&keymap[i]) == ircode[1] && |
424 | keymap[i].data == ircode[2]) { | 424 | rc5_data(&keymap[i]) == ircode[2]) { |
425 | *event = keymap[i].event; | 425 | *event = keymap[i].event; |
426 | *state = REMOTE_KEY_PRESSED; | 426 | *state = REMOTE_KEY_PRESSED; |
427 | 427 | ||
@@ -446,8 +446,8 @@ static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event, | |||
446 | return 0; | 446 | return 0; |
447 | 447 | ||
448 | for (i = 0; i < d->props.rc_key_map_size; i++) { | 448 | for (i = 0; i < d->props.rc_key_map_size; i++) { |
449 | if (keymap[i].custom == ircode[0] && | 449 | if (rc5_custom(&keymap[i]) == ircode[0] && |
450 | keymap[i].data == ircode[1]) { | 450 | rc5_data(&keymap[i]) == ircode[1]) { |
451 | *event = keymap[i].event; | 451 | *event = keymap[i].event; |
452 | *state = REMOTE_KEY_PRESSED; | 452 | *state = REMOTE_KEY_PRESSED; |
453 | 453 | ||
@@ -459,128 +459,128 @@ static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event, | |||
459 | } | 459 | } |
460 | 460 | ||
461 | static struct dvb_usb_rc_key dvico_mce_rc_keys[] = { | 461 | static struct dvb_usb_rc_key dvico_mce_rc_keys[] = { |
462 | { 0xfe, 0x02, KEY_TV }, | 462 | { 0xfe02, KEY_TV }, |
463 | { 0xfe, 0x0e, KEY_MP3 }, | 463 | { 0xfe0e, KEY_MP3 }, |
464 | { 0xfe, 0x1a, KEY_DVD }, | 464 | { 0xfe1a, KEY_DVD }, |
465 | { 0xfe, 0x1e, KEY_FAVORITES }, | 465 | { 0xfe1e, KEY_FAVORITES }, |
466 | { 0xfe, 0x16, KEY_SETUP }, | 466 | { 0xfe16, KEY_SETUP }, |
467 | { 0xfe, 0x46, KEY_POWER2 }, | 467 | { 0xfe46, KEY_POWER2 }, |
468 | { 0xfe, 0x0a, KEY_EPG }, | 468 | { 0xfe0a, KEY_EPG }, |
469 | { 0xfe, 0x49, KEY_BACK }, | 469 | { 0xfe49, KEY_BACK }, |
470 | { 0xfe, 0x4d, KEY_MENU }, | 470 | { 0xfe4d, KEY_MENU }, |
471 | { 0xfe, 0x51, KEY_UP }, | 471 | { 0xfe51, KEY_UP }, |
472 | { 0xfe, 0x5b, KEY_LEFT }, | 472 | { 0xfe5b, KEY_LEFT }, |
473 | { 0xfe, 0x5f, KEY_RIGHT }, | 473 | { 0xfe5f, KEY_RIGHT }, |
474 | { 0xfe, 0x53, KEY_DOWN }, | 474 | { 0xfe53, KEY_DOWN }, |
475 | { 0xfe, 0x5e, KEY_OK }, | 475 | { 0xfe5e, KEY_OK }, |
476 | { 0xfe, 0x59, KEY_INFO }, | 476 | { 0xfe59, KEY_INFO }, |
477 | { 0xfe, 0x55, KEY_TAB }, | 477 | { 0xfe55, KEY_TAB }, |
478 | { 0xfe, 0x0f, KEY_PREVIOUSSONG },/* Replay */ | 478 | { 0xfe0f, KEY_PREVIOUSSONG },/* Replay */ |
479 | { 0xfe, 0x12, KEY_NEXTSONG }, /* Skip */ | 479 | { 0xfe12, KEY_NEXTSONG }, /* Skip */ |
480 | { 0xfe, 0x42, KEY_ENTER }, /* Windows/Start */ | 480 | { 0xfe42, KEY_ENTER }, /* Windows/Start */ |
481 | { 0xfe, 0x15, KEY_VOLUMEUP }, | 481 | { 0xfe15, KEY_VOLUMEUP }, |
482 | { 0xfe, 0x05, KEY_VOLUMEDOWN }, | 482 | { 0xfe05, KEY_VOLUMEDOWN }, |
483 | { 0xfe, 0x11, KEY_CHANNELUP }, | 483 | { 0xfe11, KEY_CHANNELUP }, |
484 | { 0xfe, 0x09, KEY_CHANNELDOWN }, | 484 | { 0xfe09, KEY_CHANNELDOWN }, |
485 | { 0xfe, 0x52, KEY_CAMERA }, | 485 | { 0xfe52, KEY_CAMERA }, |
486 | { 0xfe, 0x5a, KEY_TUNER }, /* Live */ | 486 | { 0xfe5a, KEY_TUNER }, /* Live */ |
487 | { 0xfe, 0x19, KEY_OPEN }, | 487 | { 0xfe19, KEY_OPEN }, |
488 | { 0xfe, 0x0b, KEY_1 }, | 488 | { 0xfe0b, KEY_1 }, |
489 | { 0xfe, 0x17, KEY_2 }, | 489 | { 0xfe17, KEY_2 }, |
490 | { 0xfe, 0x1b, KEY_3 }, | 490 | { 0xfe1b, KEY_3 }, |
491 | { 0xfe, 0x07, KEY_4 }, | 491 | { 0xfe07, KEY_4 }, |
492 | { 0xfe, 0x50, KEY_5 }, | 492 | { 0xfe50, KEY_5 }, |
493 | { 0xfe, 0x54, KEY_6 }, | 493 | { 0xfe54, KEY_6 }, |
494 | { 0xfe, 0x48, KEY_7 }, | 494 | { 0xfe48, KEY_7 }, |
495 | { 0xfe, 0x4c, KEY_8 }, | 495 | { 0xfe4c, KEY_8 }, |
496 | { 0xfe, 0x58, KEY_9 }, | 496 | { 0xfe58, KEY_9 }, |
497 | { 0xfe, 0x13, KEY_ANGLE }, /* Aspect */ | 497 | { 0xfe13, KEY_ANGLE }, /* Aspect */ |
498 | { 0xfe, 0x03, KEY_0 }, | 498 | { 0xfe03, KEY_0 }, |
499 | { 0xfe, 0x1f, KEY_ZOOM }, | 499 | { 0xfe1f, KEY_ZOOM }, |
500 | { 0xfe, 0x43, KEY_REWIND }, | 500 | { 0xfe43, KEY_REWIND }, |
501 | { 0xfe, 0x47, KEY_PLAYPAUSE }, | 501 | { 0xfe47, KEY_PLAYPAUSE }, |
502 | { 0xfe, 0x4f, KEY_FASTFORWARD }, | 502 | { 0xfe4f, KEY_FASTFORWARD }, |
503 | { 0xfe, 0x57, KEY_MUTE }, | 503 | { 0xfe57, KEY_MUTE }, |
504 | { 0xfe, 0x0d, KEY_STOP }, | 504 | { 0xfe0d, KEY_STOP }, |
505 | { 0xfe, 0x01, KEY_RECORD }, | 505 | { 0xfe01, KEY_RECORD }, |
506 | { 0xfe, 0x4e, KEY_POWER }, | 506 | { 0xfe4e, KEY_POWER }, |
507 | }; | 507 | }; |
508 | 508 | ||
509 | static struct dvb_usb_rc_key dvico_portable_rc_keys[] = { | 509 | static struct dvb_usb_rc_key dvico_portable_rc_keys[] = { |
510 | { 0xfc, 0x02, KEY_SETUP }, /* Profile */ | 510 | { 0xfc02, KEY_SETUP }, /* Profile */ |
511 | { 0xfc, 0x43, KEY_POWER2 }, | 511 | { 0xfc43, KEY_POWER2 }, |
512 | { 0xfc, 0x06, KEY_EPG }, | 512 | { 0xfc06, KEY_EPG }, |
513 | { 0xfc, 0x5a, KEY_BACK }, | 513 | { 0xfc5a, KEY_BACK }, |
514 | { 0xfc, 0x05, KEY_MENU }, | 514 | { 0xfc05, KEY_MENU }, |
515 | { 0xfc, 0x47, KEY_INFO }, | 515 | { 0xfc47, KEY_INFO }, |
516 | { 0xfc, 0x01, KEY_TAB }, | 516 | { 0xfc01, KEY_TAB }, |
517 | { 0xfc, 0x42, KEY_PREVIOUSSONG },/* Replay */ | 517 | { 0xfc42, KEY_PREVIOUSSONG },/* Replay */ |
518 | { 0xfc, 0x49, KEY_VOLUMEUP }, | 518 | { 0xfc49, KEY_VOLUMEUP }, |
519 | { 0xfc, 0x09, KEY_VOLUMEDOWN }, | 519 | { 0xfc09, KEY_VOLUMEDOWN }, |
520 | { 0xfc, 0x54, KEY_CHANNELUP }, | 520 | { 0xfc54, KEY_CHANNELUP }, |
521 | { 0xfc, 0x0b, KEY_CHANNELDOWN }, | 521 | { 0xfc0b, KEY_CHANNELDOWN }, |
522 | { 0xfc, 0x16, KEY_CAMERA }, | 522 | { 0xfc16, KEY_CAMERA }, |
523 | { 0xfc, 0x40, KEY_TUNER }, /* ATV/DTV */ | 523 | { 0xfc40, KEY_TUNER }, /* ATV/DTV */ |
524 | { 0xfc, 0x45, KEY_OPEN }, | 524 | { 0xfc45, KEY_OPEN }, |
525 | { 0xfc, 0x19, KEY_1 }, | 525 | { 0xfc19, KEY_1 }, |
526 | { 0xfc, 0x18, KEY_2 }, | 526 | { 0xfc18, KEY_2 }, |
527 | { 0xfc, 0x1b, KEY_3 }, | 527 | { 0xfc1b, KEY_3 }, |
528 | { 0xfc, 0x1a, KEY_4 }, | 528 | { 0xfc1a, KEY_4 }, |
529 | { 0xfc, 0x58, KEY_5 }, | 529 | { 0xfc58, KEY_5 }, |
530 | { 0xfc, 0x59, KEY_6 }, | 530 | { 0xfc59, KEY_6 }, |
531 | { 0xfc, 0x15, KEY_7 }, | 531 | { 0xfc15, KEY_7 }, |
532 | { 0xfc, 0x14, KEY_8 }, | 532 | { 0xfc14, KEY_8 }, |
533 | { 0xfc, 0x17, KEY_9 }, | 533 | { 0xfc17, KEY_9 }, |
534 | { 0xfc, 0x44, KEY_ANGLE }, /* Aspect */ | 534 | { 0xfc44, KEY_ANGLE }, /* Aspect */ |
535 | { 0xfc, 0x55, KEY_0 }, | 535 | { 0xfc55, KEY_0 }, |
536 | { 0xfc, 0x07, KEY_ZOOM }, | 536 | { 0xfc07, KEY_ZOOM }, |
537 | { 0xfc, 0x0a, KEY_REWIND }, | 537 | { 0xfc0a, KEY_REWIND }, |
538 | { 0xfc, 0x08, KEY_PLAYPAUSE }, | 538 | { 0xfc08, KEY_PLAYPAUSE }, |
539 | { 0xfc, 0x4b, KEY_FASTFORWARD }, | 539 | { 0xfc4b, KEY_FASTFORWARD }, |
540 | { 0xfc, 0x5b, KEY_MUTE }, | 540 | { 0xfc5b, KEY_MUTE }, |
541 | { 0xfc, 0x04, KEY_STOP }, | 541 | { 0xfc04, KEY_STOP }, |
542 | { 0xfc, 0x56, KEY_RECORD }, | 542 | { 0xfc56, KEY_RECORD }, |
543 | { 0xfc, 0x57, KEY_POWER }, | 543 | { 0xfc57, KEY_POWER }, |
544 | { 0xfc, 0x41, KEY_UNKNOWN }, /* INPUT */ | 544 | { 0xfc41, KEY_UNKNOWN }, /* INPUT */ |
545 | { 0xfc, 0x00, KEY_UNKNOWN }, /* HD */ | 545 | { 0xfc00, KEY_UNKNOWN }, /* HD */ |
546 | }; | 546 | }; |
547 | 547 | ||
548 | static struct dvb_usb_rc_key d680_dmb_rc_keys[] = { | 548 | static struct dvb_usb_rc_key d680_dmb_rc_keys[] = { |
549 | { 0x00, 0x38, KEY_UNKNOWN }, /* TV/AV */ | 549 | { 0x0038, KEY_UNKNOWN }, /* TV/AV */ |
550 | { 0x08, 0x0c, KEY_ZOOM }, | 550 | { 0x080c, KEY_ZOOM }, |
551 | { 0x08, 0x00, KEY_0 }, | 551 | { 0x0800, KEY_0 }, |
552 | { 0x00, 0x01, KEY_1 }, | 552 | { 0x0001, KEY_1 }, |
553 | { 0x08, 0x02, KEY_2 }, | 553 | { 0x0802, KEY_2 }, |
554 | { 0x00, 0x03, KEY_3 }, | 554 | { 0x0003, KEY_3 }, |
555 | { 0x08, 0x04, KEY_4 }, | 555 | { 0x0804, KEY_4 }, |
556 | { 0x00, 0x05, KEY_5 }, | 556 | { 0x0005, KEY_5 }, |
557 | { 0x08, 0x06, KEY_6 }, | 557 | { 0x0806, KEY_6 }, |
558 | { 0x00, 0x07, KEY_7 }, | 558 | { 0x0007, KEY_7 }, |
559 | { 0x08, 0x08, KEY_8 }, | 559 | { 0x0808, KEY_8 }, |
560 | { 0x00, 0x09, KEY_9 }, | 560 | { 0x0009, KEY_9 }, |
561 | { 0x00, 0x0a, KEY_MUTE }, | 561 | { 0x000a, KEY_MUTE }, |
562 | { 0x08, 0x29, KEY_BACK }, | 562 | { 0x0829, KEY_BACK }, |
563 | { 0x00, 0x12, KEY_CHANNELUP }, | 563 | { 0x0012, KEY_CHANNELUP }, |
564 | { 0x08, 0x13, KEY_CHANNELDOWN }, | 564 | { 0x0813, KEY_CHANNELDOWN }, |
565 | { 0x00, 0x2b, KEY_VOLUMEUP }, | 565 | { 0x002b, KEY_VOLUMEUP }, |
566 | { 0x08, 0x2c, KEY_VOLUMEDOWN }, | 566 | { 0x082c, KEY_VOLUMEDOWN }, |
567 | { 0x00, 0x20, KEY_UP }, | 567 | { 0x0020, KEY_UP }, |
568 | { 0x08, 0x21, KEY_DOWN }, | 568 | { 0x0821, KEY_DOWN }, |
569 | { 0x00, 0x11, KEY_LEFT }, | 569 | { 0x0011, KEY_LEFT }, |
570 | { 0x08, 0x10, KEY_RIGHT }, | 570 | { 0x0810, KEY_RIGHT }, |
571 | { 0x00, 0x0d, KEY_OK }, | 571 | { 0x000d, KEY_OK }, |
572 | { 0x08, 0x1f, KEY_RECORD }, | 572 | { 0x081f, KEY_RECORD }, |
573 | { 0x00, 0x17, KEY_PLAYPAUSE }, | 573 | { 0x0017, KEY_PLAYPAUSE }, |
574 | { 0x08, 0x16, KEY_PLAYPAUSE }, | 574 | { 0x0816, KEY_PLAYPAUSE }, |
575 | { 0x00, 0x0b, KEY_STOP }, | 575 | { 0x000b, KEY_STOP }, |
576 | { 0x08, 0x27, KEY_FASTFORWARD }, | 576 | { 0x0827, KEY_FASTFORWARD }, |
577 | { 0x00, 0x26, KEY_REWIND }, | 577 | { 0x0026, KEY_REWIND }, |
578 | { 0x08, 0x1e, KEY_UNKNOWN }, /* Time Shift */ | 578 | { 0x081e, KEY_UNKNOWN }, /* Time Shift */ |
579 | { 0x00, 0x0e, KEY_UNKNOWN }, /* Snapshot */ | 579 | { 0x000e, KEY_UNKNOWN }, /* Snapshot */ |
580 | { 0x08, 0x2d, KEY_UNKNOWN }, /* Mouse Cursor */ | 580 | { 0x082d, KEY_UNKNOWN }, /* Mouse Cursor */ |
581 | { 0x00, 0x0f, KEY_UNKNOWN }, /* Minimize/Maximize */ | 581 | { 0x000f, KEY_UNKNOWN }, /* Minimize/Maximize */ |
582 | { 0x08, 0x14, KEY_UNKNOWN }, /* Shuffle */ | 582 | { 0x0814, KEY_UNKNOWN }, /* Shuffle */ |
583 | { 0x00, 0x25, KEY_POWER }, | 583 | { 0x0025, KEY_POWER }, |
584 | }; | 584 | }; |
585 | 585 | ||
586 | static int cxusb_dee1601_demod_init(struct dvb_frontend* fe) | 586 | static int cxusb_dee1601_demod_init(struct dvb_frontend* fe) |
@@ -1094,8 +1094,18 @@ static int cxusb_nano2_frontend_attach(struct dvb_usb_adapter *adap) | |||
1094 | return -EIO; | 1094 | return -EIO; |
1095 | } | 1095 | } |
1096 | 1096 | ||
1097 | static struct lgs8gl5_config lgs8gl5_cfg = { | 1097 | static struct lgs8gxx_config d680_lgs8gl5_cfg = { |
1098 | .prod = LGS8GXX_PROD_LGS8GL5, | ||
1098 | .demod_address = 0x19, | 1099 | .demod_address = 0x19, |
1100 | .serial_ts = 0, | ||
1101 | .ts_clk_pol = 0, | ||
1102 | .ts_clk_gated = 1, | ||
1103 | .if_clk_freq = 30400, /* 30.4 MHz */ | ||
1104 | .if_freq = 5725, /* 5.725 MHz */ | ||
1105 | .if_neg_center = 0, | ||
1106 | .ext_adc = 0, | ||
1107 | .adc_signed = 0, | ||
1108 | .if_neg_edge = 0, | ||
1099 | }; | 1109 | }; |
1100 | 1110 | ||
1101 | static int cxusb_d680_dmb_frontend_attach(struct dvb_usb_adapter *adap) | 1111 | static int cxusb_d680_dmb_frontend_attach(struct dvb_usb_adapter *adap) |
@@ -1135,7 +1145,7 @@ static int cxusb_d680_dmb_frontend_attach(struct dvb_usb_adapter *adap) | |||
1135 | msleep(100); | 1145 | msleep(100); |
1136 | 1146 | ||
1137 | /* Attach frontend */ | 1147 | /* Attach frontend */ |
1138 | adap->fe = dvb_attach(lgs8gl5_attach, &lgs8gl5_cfg, &d->i2c_adap); | 1148 | adap->fe = dvb_attach(lgs8gxx_attach, &d680_lgs8gl5_cfg, &d->i2c_adap); |
1139 | if (adap->fe == NULL) | 1149 | if (adap->fe == NULL) |
1140 | return -EIO; | 1150 | return -EIO; |
1141 | 1151 | ||
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index 818b2ab584bf..d1d6f4491403 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c | |||
@@ -310,7 +310,7 @@ static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap) | |||
310 | struct i2c_adapter *tun_i2c; | 310 | struct i2c_adapter *tun_i2c; |
311 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); | 311 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
312 | return dvb_attach(mt2266_attach, adap->fe, tun_i2c, | 312 | return dvb_attach(mt2266_attach, adap->fe, tun_i2c, |
313 | &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0;; | 313 | &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0; |
314 | } | 314 | } |
315 | 315 | ||
316 | /* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */ | 316 | /* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */ |
@@ -509,7 +509,8 @@ static int dib0700_rc_query_legacy(struct dvb_usb_device *d, u32 *event, | |||
509 | return 0; | 509 | return 0; |
510 | } | 510 | } |
511 | for (i=0;i<d->props.rc_key_map_size; i++) { | 511 | for (i=0;i<d->props.rc_key_map_size; i++) { |
512 | if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) { | 512 | if (rc5_custom(&keymap[i]) == key[3-2] && |
513 | rc5_data(&keymap[i]) == key[3-3]) { | ||
513 | st->rc_counter = 0; | 514 | st->rc_counter = 0; |
514 | *event = keymap[i].event; | 515 | *event = keymap[i].event; |
515 | *state = REMOTE_KEY_PRESSED; | 516 | *state = REMOTE_KEY_PRESSED; |
@@ -522,7 +523,8 @@ static int dib0700_rc_query_legacy(struct dvb_usb_device *d, u32 *event, | |||
522 | default: { | 523 | default: { |
523 | /* RC-5 protocol changes toggle bit on new keypress */ | 524 | /* RC-5 protocol changes toggle bit on new keypress */ |
524 | for (i = 0; i < d->props.rc_key_map_size; i++) { | 525 | for (i = 0; i < d->props.rc_key_map_size; i++) { |
525 | if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) { | 526 | if (rc5_custom(&keymap[i]) == key[3-2] && |
527 | rc5_data(&keymap[i]) == key[3-3]) { | ||
526 | if (d->last_event == keymap[i].event && | 528 | if (d->last_event == keymap[i].event && |
527 | key[3-1] == st->rc_toggle) { | 529 | key[3-1] == st->rc_toggle) { |
528 | st->rc_counter++; | 530 | st->rc_counter++; |
@@ -616,8 +618,8 @@ static int dib0700_rc_query_v1_20(struct dvb_usb_device *d, u32 *event, | |||
616 | 618 | ||
617 | /* Find the key in the map */ | 619 | /* Find the key in the map */ |
618 | for (i = 0; i < d->props.rc_key_map_size; i++) { | 620 | for (i = 0; i < d->props.rc_key_map_size; i++) { |
619 | if (keymap[i].custom == poll_reply.system_lsb && | 621 | if (rc5_custom(&keymap[i]) == poll_reply.system_lsb && |
620 | keymap[i].data == poll_reply.data) { | 622 | rc5_data(&keymap[i]) == poll_reply.data) { |
621 | *event = keymap[i].event; | 623 | *event = keymap[i].event; |
622 | found = 1; | 624 | found = 1; |
623 | break; | 625 | break; |
@@ -684,193 +686,193 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
684 | 686 | ||
685 | static struct dvb_usb_rc_key dib0700_rc_keys[] = { | 687 | static struct dvb_usb_rc_key dib0700_rc_keys[] = { |
686 | /* Key codes for the tiny Pinnacle remote*/ | 688 | /* Key codes for the tiny Pinnacle remote*/ |
687 | { 0x07, 0x00, KEY_MUTE }, | 689 | { 0x0700, KEY_MUTE }, |
688 | { 0x07, 0x01, KEY_MENU }, // Pinnacle logo | 690 | { 0x0701, KEY_MENU }, /* Pinnacle logo */ |
689 | { 0x07, 0x39, KEY_POWER }, | 691 | { 0x0739, KEY_POWER }, |
690 | { 0x07, 0x03, KEY_VOLUMEUP }, | 692 | { 0x0703, KEY_VOLUMEUP }, |
691 | { 0x07, 0x09, KEY_VOLUMEDOWN }, | 693 | { 0x0709, KEY_VOLUMEDOWN }, |
692 | { 0x07, 0x06, KEY_CHANNELUP }, | 694 | { 0x0706, KEY_CHANNELUP }, |
693 | { 0x07, 0x0c, KEY_CHANNELDOWN }, | 695 | { 0x070c, KEY_CHANNELDOWN }, |
694 | { 0x07, 0x0f, KEY_1 }, | 696 | { 0x070f, KEY_1 }, |
695 | { 0x07, 0x15, KEY_2 }, | 697 | { 0x0715, KEY_2 }, |
696 | { 0x07, 0x10, KEY_3 }, | 698 | { 0x0710, KEY_3 }, |
697 | { 0x07, 0x18, KEY_4 }, | 699 | { 0x0718, KEY_4 }, |
698 | { 0x07, 0x1b, KEY_5 }, | 700 | { 0x071b, KEY_5 }, |
699 | { 0x07, 0x1e, KEY_6 }, | 701 | { 0x071e, KEY_6 }, |
700 | { 0x07, 0x11, KEY_7 }, | 702 | { 0x0711, KEY_7 }, |
701 | { 0x07, 0x21, KEY_8 }, | 703 | { 0x0721, KEY_8 }, |
702 | { 0x07, 0x12, KEY_9 }, | 704 | { 0x0712, KEY_9 }, |
703 | { 0x07, 0x27, KEY_0 }, | 705 | { 0x0727, KEY_0 }, |
704 | { 0x07, 0x24, KEY_SCREEN }, // 'Square' key | 706 | { 0x0724, KEY_SCREEN }, /* 'Square' key */ |
705 | { 0x07, 0x2a, KEY_TEXT }, // 'T' key | 707 | { 0x072a, KEY_TEXT }, /* 'T' key */ |
706 | { 0x07, 0x2d, KEY_REWIND }, | 708 | { 0x072d, KEY_REWIND }, |
707 | { 0x07, 0x30, KEY_PLAY }, | 709 | { 0x0730, KEY_PLAY }, |
708 | { 0x07, 0x33, KEY_FASTFORWARD }, | 710 | { 0x0733, KEY_FASTFORWARD }, |
709 | { 0x07, 0x36, KEY_RECORD }, | 711 | { 0x0736, KEY_RECORD }, |
710 | { 0x07, 0x3c, KEY_STOP }, | 712 | { 0x073c, KEY_STOP }, |
711 | { 0x07, 0x3f, KEY_CANCEL }, // '?' key | 713 | { 0x073f, KEY_CANCEL }, /* '?' key */ |
712 | /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */ | 714 | /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */ |
713 | { 0xeb, 0x01, KEY_POWER }, | 715 | { 0xeb01, KEY_POWER }, |
714 | { 0xeb, 0x02, KEY_1 }, | 716 | { 0xeb02, KEY_1 }, |
715 | { 0xeb, 0x03, KEY_2 }, | 717 | { 0xeb03, KEY_2 }, |
716 | { 0xeb, 0x04, KEY_3 }, | 718 | { 0xeb04, KEY_3 }, |
717 | { 0xeb, 0x05, KEY_4 }, | 719 | { 0xeb05, KEY_4 }, |
718 | { 0xeb, 0x06, KEY_5 }, | 720 | { 0xeb06, KEY_5 }, |
719 | { 0xeb, 0x07, KEY_6 }, | 721 | { 0xeb07, KEY_6 }, |
720 | { 0xeb, 0x08, KEY_7 }, | 722 | { 0xeb08, KEY_7 }, |
721 | { 0xeb, 0x09, KEY_8 }, | 723 | { 0xeb09, KEY_8 }, |
722 | { 0xeb, 0x0a, KEY_9 }, | 724 | { 0xeb0a, KEY_9 }, |
723 | { 0xeb, 0x0b, KEY_VIDEO }, | 725 | { 0xeb0b, KEY_VIDEO }, |
724 | { 0xeb, 0x0c, KEY_0 }, | 726 | { 0xeb0c, KEY_0 }, |
725 | { 0xeb, 0x0d, KEY_REFRESH }, | 727 | { 0xeb0d, KEY_REFRESH }, |
726 | { 0xeb, 0x0f, KEY_EPG }, | 728 | { 0xeb0f, KEY_EPG }, |
727 | { 0xeb, 0x10, KEY_UP }, | 729 | { 0xeb10, KEY_UP }, |
728 | { 0xeb, 0x11, KEY_LEFT }, | 730 | { 0xeb11, KEY_LEFT }, |
729 | { 0xeb, 0x12, KEY_OK }, | 731 | { 0xeb12, KEY_OK }, |
730 | { 0xeb, 0x13, KEY_RIGHT }, | 732 | { 0xeb13, KEY_RIGHT }, |
731 | { 0xeb, 0x14, KEY_DOWN }, | 733 | { 0xeb14, KEY_DOWN }, |
732 | { 0xeb, 0x16, KEY_INFO }, | 734 | { 0xeb16, KEY_INFO }, |
733 | { 0xeb, 0x17, KEY_RED }, | 735 | { 0xeb17, KEY_RED }, |
734 | { 0xeb, 0x18, KEY_GREEN }, | 736 | { 0xeb18, KEY_GREEN }, |
735 | { 0xeb, 0x19, KEY_YELLOW }, | 737 | { 0xeb19, KEY_YELLOW }, |
736 | { 0xeb, 0x1a, KEY_BLUE }, | 738 | { 0xeb1a, KEY_BLUE }, |
737 | { 0xeb, 0x1b, KEY_CHANNELUP }, | 739 | { 0xeb1b, KEY_CHANNELUP }, |
738 | { 0xeb, 0x1c, KEY_VOLUMEUP }, | 740 | { 0xeb1c, KEY_VOLUMEUP }, |
739 | { 0xeb, 0x1d, KEY_MUTE }, | 741 | { 0xeb1d, KEY_MUTE }, |
740 | { 0xeb, 0x1e, KEY_VOLUMEDOWN }, | 742 | { 0xeb1e, KEY_VOLUMEDOWN }, |
741 | { 0xeb, 0x1f, KEY_CHANNELDOWN }, | 743 | { 0xeb1f, KEY_CHANNELDOWN }, |
742 | { 0xeb, 0x40, KEY_PAUSE }, | 744 | { 0xeb40, KEY_PAUSE }, |
743 | { 0xeb, 0x41, KEY_HOME }, | 745 | { 0xeb41, KEY_HOME }, |
744 | { 0xeb, 0x42, KEY_MENU }, /* DVD Menu */ | 746 | { 0xeb42, KEY_MENU }, /* DVD Menu */ |
745 | { 0xeb, 0x43, KEY_SUBTITLE }, | 747 | { 0xeb43, KEY_SUBTITLE }, |
746 | { 0xeb, 0x44, KEY_TEXT }, /* Teletext */ | 748 | { 0xeb44, KEY_TEXT }, /* Teletext */ |
747 | { 0xeb, 0x45, KEY_DELETE }, | 749 | { 0xeb45, KEY_DELETE }, |
748 | { 0xeb, 0x46, KEY_TV }, | 750 | { 0xeb46, KEY_TV }, |
749 | { 0xeb, 0x47, KEY_DVD }, | 751 | { 0xeb47, KEY_DVD }, |
750 | { 0xeb, 0x48, KEY_STOP }, | 752 | { 0xeb48, KEY_STOP }, |
751 | { 0xeb, 0x49, KEY_VIDEO }, | 753 | { 0xeb49, KEY_VIDEO }, |
752 | { 0xeb, 0x4a, KEY_AUDIO }, /* Music */ | 754 | { 0xeb4a, KEY_AUDIO }, /* Music */ |
753 | { 0xeb, 0x4b, KEY_SCREEN }, /* Pic */ | 755 | { 0xeb4b, KEY_SCREEN }, /* Pic */ |
754 | { 0xeb, 0x4c, KEY_PLAY }, | 756 | { 0xeb4c, KEY_PLAY }, |
755 | { 0xeb, 0x4d, KEY_BACK }, | 757 | { 0xeb4d, KEY_BACK }, |
756 | { 0xeb, 0x4e, KEY_REWIND }, | 758 | { 0xeb4e, KEY_REWIND }, |
757 | { 0xeb, 0x4f, KEY_FASTFORWARD }, | 759 | { 0xeb4f, KEY_FASTFORWARD }, |
758 | { 0xeb, 0x54, KEY_PREVIOUS }, | 760 | { 0xeb54, KEY_PREVIOUS }, |
759 | { 0xeb, 0x58, KEY_RECORD }, | 761 | { 0xeb58, KEY_RECORD }, |
760 | { 0xeb, 0x5c, KEY_NEXT }, | 762 | { 0xeb5c, KEY_NEXT }, |
761 | 763 | ||
762 | /* Key codes for the Haupauge WinTV Nova-TD, copied from nova-t-usb2.c (Nova-T USB2) */ | 764 | /* Key codes for the Haupauge WinTV Nova-TD, copied from nova-t-usb2.c (Nova-T USB2) */ |
763 | { 0x1e, 0x00, KEY_0 }, | 765 | { 0x1e00, KEY_0 }, |
764 | { 0x1e, 0x01, KEY_1 }, | 766 | { 0x1e01, KEY_1 }, |
765 | { 0x1e, 0x02, KEY_2 }, | 767 | { 0x1e02, KEY_2 }, |
766 | { 0x1e, 0x03, KEY_3 }, | 768 | { 0x1e03, KEY_3 }, |
767 | { 0x1e, 0x04, KEY_4 }, | 769 | { 0x1e04, KEY_4 }, |
768 | { 0x1e, 0x05, KEY_5 }, | 770 | { 0x1e05, KEY_5 }, |
769 | { 0x1e, 0x06, KEY_6 }, | 771 | { 0x1e06, KEY_6 }, |
770 | { 0x1e, 0x07, KEY_7 }, | 772 | { 0x1e07, KEY_7 }, |
771 | { 0x1e, 0x08, KEY_8 }, | 773 | { 0x1e08, KEY_8 }, |
772 | { 0x1e, 0x09, KEY_9 }, | 774 | { 0x1e09, KEY_9 }, |
773 | { 0x1e, 0x0a, KEY_KPASTERISK }, | 775 | { 0x1e0a, KEY_KPASTERISK }, |
774 | { 0x1e, 0x0b, KEY_RED }, | 776 | { 0x1e0b, KEY_RED }, |
775 | { 0x1e, 0x0c, KEY_RADIO }, | 777 | { 0x1e0c, KEY_RADIO }, |
776 | { 0x1e, 0x0d, KEY_MENU }, | 778 | { 0x1e0d, KEY_MENU }, |
777 | { 0x1e, 0x0e, KEY_GRAVE }, /* # */ | 779 | { 0x1e0e, KEY_GRAVE }, /* # */ |
778 | { 0x1e, 0x0f, KEY_MUTE }, | 780 | { 0x1e0f, KEY_MUTE }, |
779 | { 0x1e, 0x10, KEY_VOLUMEUP }, | 781 | { 0x1e10, KEY_VOLUMEUP }, |
780 | { 0x1e, 0x11, KEY_VOLUMEDOWN }, | 782 | { 0x1e11, KEY_VOLUMEDOWN }, |
781 | { 0x1e, 0x12, KEY_CHANNEL }, | 783 | { 0x1e12, KEY_CHANNEL }, |
782 | { 0x1e, 0x14, KEY_UP }, | 784 | { 0x1e14, KEY_UP }, |
783 | { 0x1e, 0x15, KEY_DOWN }, | 785 | { 0x1e15, KEY_DOWN }, |
784 | { 0x1e, 0x16, KEY_LEFT }, | 786 | { 0x1e16, KEY_LEFT }, |
785 | { 0x1e, 0x17, KEY_RIGHT }, | 787 | { 0x1e17, KEY_RIGHT }, |
786 | { 0x1e, 0x18, KEY_VIDEO }, | 788 | { 0x1e18, KEY_VIDEO }, |
787 | { 0x1e, 0x19, KEY_AUDIO }, | 789 | { 0x1e19, KEY_AUDIO }, |
788 | { 0x1e, 0x1a, KEY_MEDIA }, | 790 | { 0x1e1a, KEY_MEDIA }, |
789 | { 0x1e, 0x1b, KEY_EPG }, | 791 | { 0x1e1b, KEY_EPG }, |
790 | { 0x1e, 0x1c, KEY_TV }, | 792 | { 0x1e1c, KEY_TV }, |
791 | { 0x1e, 0x1e, KEY_NEXT }, | 793 | { 0x1e1e, KEY_NEXT }, |
792 | { 0x1e, 0x1f, KEY_BACK }, | 794 | { 0x1e1f, KEY_BACK }, |
793 | { 0x1e, 0x20, KEY_CHANNELUP }, | 795 | { 0x1e20, KEY_CHANNELUP }, |
794 | { 0x1e, 0x21, KEY_CHANNELDOWN }, | 796 | { 0x1e21, KEY_CHANNELDOWN }, |
795 | { 0x1e, 0x24, KEY_LAST }, /* Skip backwards */ | 797 | { 0x1e24, KEY_LAST }, /* Skip backwards */ |
796 | { 0x1e, 0x25, KEY_OK }, | 798 | { 0x1e25, KEY_OK }, |
797 | { 0x1e, 0x29, KEY_BLUE}, | 799 | { 0x1e29, KEY_BLUE}, |
798 | { 0x1e, 0x2e, KEY_GREEN }, | 800 | { 0x1e2e, KEY_GREEN }, |
799 | { 0x1e, 0x30, KEY_PAUSE }, | 801 | { 0x1e30, KEY_PAUSE }, |
800 | { 0x1e, 0x32, KEY_REWIND }, | 802 | { 0x1e32, KEY_REWIND }, |
801 | { 0x1e, 0x34, KEY_FASTFORWARD }, | 803 | { 0x1e34, KEY_FASTFORWARD }, |
802 | { 0x1e, 0x35, KEY_PLAY }, | 804 | { 0x1e35, KEY_PLAY }, |
803 | { 0x1e, 0x36, KEY_STOP }, | 805 | { 0x1e36, KEY_STOP }, |
804 | { 0x1e, 0x37, KEY_RECORD }, | 806 | { 0x1e37, KEY_RECORD }, |
805 | { 0x1e, 0x38, KEY_YELLOW }, | 807 | { 0x1e38, KEY_YELLOW }, |
806 | { 0x1e, 0x3b, KEY_GOTO }, | 808 | { 0x1e3b, KEY_GOTO }, |
807 | { 0x1e, 0x3d, KEY_POWER }, | 809 | { 0x1e3d, KEY_POWER }, |
808 | 810 | ||
809 | /* Key codes for the Leadtek Winfast DTV Dongle */ | 811 | /* Key codes for the Leadtek Winfast DTV Dongle */ |
810 | { 0x00, 0x42, KEY_POWER }, | 812 | { 0x0042, KEY_POWER }, |
811 | { 0x07, 0x7c, KEY_TUNER }, | 813 | { 0x077c, KEY_TUNER }, |
812 | { 0x0f, 0x4e, KEY_PRINT }, /* PREVIEW */ | 814 | { 0x0f4e, KEY_PRINT }, /* PREVIEW */ |
813 | { 0x08, 0x40, KEY_SCREEN }, /* full screen toggle*/ | 815 | { 0x0840, KEY_SCREEN }, /* full screen toggle*/ |
814 | { 0x0f, 0x71, KEY_DOT }, /* frequency */ | 816 | { 0x0f71, KEY_DOT }, /* frequency */ |
815 | { 0x07, 0x43, KEY_0 }, | 817 | { 0x0743, KEY_0 }, |
816 | { 0x0c, 0x41, KEY_1 }, | 818 | { 0x0c41, KEY_1 }, |
817 | { 0x04, 0x43, KEY_2 }, | 819 | { 0x0443, KEY_2 }, |
818 | { 0x0b, 0x7f, KEY_3 }, | 820 | { 0x0b7f, KEY_3 }, |
819 | { 0x0e, 0x41, KEY_4 }, | 821 | { 0x0e41, KEY_4 }, |
820 | { 0x06, 0x43, KEY_5 }, | 822 | { 0x0643, KEY_5 }, |
821 | { 0x09, 0x7f, KEY_6 }, | 823 | { 0x097f, KEY_6 }, |
822 | { 0x0d, 0x7e, KEY_7 }, | 824 | { 0x0d7e, KEY_7 }, |
823 | { 0x05, 0x7c, KEY_8 }, | 825 | { 0x057c, KEY_8 }, |
824 | { 0x0a, 0x40, KEY_9 }, | 826 | { 0x0a40, KEY_9 }, |
825 | { 0x0e, 0x4e, KEY_CLEAR }, | 827 | { 0x0e4e, KEY_CLEAR }, |
826 | { 0x04, 0x7c, KEY_CHANNEL }, /* show channel number */ | 828 | { 0x047c, KEY_CHANNEL }, /* show channel number */ |
827 | { 0x0f, 0x41, KEY_LAST }, /* recall */ | 829 | { 0x0f41, KEY_LAST }, /* recall */ |
828 | { 0x03, 0x42, KEY_MUTE }, | 830 | { 0x0342, KEY_MUTE }, |
829 | { 0x06, 0x4c, KEY_RESERVED }, /* PIP button*/ | 831 | { 0x064c, KEY_RESERVED }, /* PIP button*/ |
830 | { 0x01, 0x72, KEY_SHUFFLE }, /* SNAPSHOT */ | 832 | { 0x0172, KEY_SHUFFLE }, /* SNAPSHOT */ |
831 | { 0x0c, 0x4e, KEY_PLAYPAUSE }, /* TIMESHIFT */ | 833 | { 0x0c4e, KEY_PLAYPAUSE }, /* TIMESHIFT */ |
832 | { 0x0b, 0x70, KEY_RECORD }, | 834 | { 0x0b70, KEY_RECORD }, |
833 | { 0x03, 0x7d, KEY_VOLUMEUP }, | 835 | { 0x037d, KEY_VOLUMEUP }, |
834 | { 0x01, 0x7d, KEY_VOLUMEDOWN }, | 836 | { 0x017d, KEY_VOLUMEDOWN }, |
835 | { 0x02, 0x42, KEY_CHANNELUP }, | 837 | { 0x0242, KEY_CHANNELUP }, |
836 | { 0x00, 0x7d, KEY_CHANNELDOWN }, | 838 | { 0x007d, KEY_CHANNELDOWN }, |
837 | 839 | ||
838 | /* Key codes for Nova-TD "credit card" remote control. */ | 840 | /* Key codes for Nova-TD "credit card" remote control. */ |
839 | { 0x1d, 0x00, KEY_0 }, | 841 | { 0x1d00, KEY_0 }, |
840 | { 0x1d, 0x01, KEY_1 }, | 842 | { 0x1d01, KEY_1 }, |
841 | { 0x1d, 0x02, KEY_2 }, | 843 | { 0x1d02, KEY_2 }, |
842 | { 0x1d, 0x03, KEY_3 }, | 844 | { 0x1d03, KEY_3 }, |
843 | { 0x1d, 0x04, KEY_4 }, | 845 | { 0x1d04, KEY_4 }, |
844 | { 0x1d, 0x05, KEY_5 }, | 846 | { 0x1d05, KEY_5 }, |
845 | { 0x1d, 0x06, KEY_6 }, | 847 | { 0x1d06, KEY_6 }, |
846 | { 0x1d, 0x07, KEY_7 }, | 848 | { 0x1d07, KEY_7 }, |
847 | { 0x1d, 0x08, KEY_8 }, | 849 | { 0x1d08, KEY_8 }, |
848 | { 0x1d, 0x09, KEY_9 }, | 850 | { 0x1d09, KEY_9 }, |
849 | { 0x1d, 0x0a, KEY_TEXT }, | 851 | { 0x1d0a, KEY_TEXT }, |
850 | { 0x1d, 0x0d, KEY_MENU }, | 852 | { 0x1d0d, KEY_MENU }, |
851 | { 0x1d, 0x0f, KEY_MUTE }, | 853 | { 0x1d0f, KEY_MUTE }, |
852 | { 0x1d, 0x10, KEY_VOLUMEUP }, | 854 | { 0x1d10, KEY_VOLUMEUP }, |
853 | { 0x1d, 0x11, KEY_VOLUMEDOWN }, | 855 | { 0x1d11, KEY_VOLUMEDOWN }, |
854 | { 0x1d, 0x12, KEY_CHANNEL }, | 856 | { 0x1d12, KEY_CHANNEL }, |
855 | { 0x1d, 0x14, KEY_UP }, | 857 | { 0x1d14, KEY_UP }, |
856 | { 0x1d, 0x15, KEY_DOWN }, | 858 | { 0x1d15, KEY_DOWN }, |
857 | { 0x1d, 0x16, KEY_LEFT }, | 859 | { 0x1d16, KEY_LEFT }, |
858 | { 0x1d, 0x17, KEY_RIGHT }, | 860 | { 0x1d17, KEY_RIGHT }, |
859 | { 0x1d, 0x1c, KEY_TV }, | 861 | { 0x1d1c, KEY_TV }, |
860 | { 0x1d, 0x1e, KEY_NEXT }, | 862 | { 0x1d1e, KEY_NEXT }, |
861 | { 0x1d, 0x1f, KEY_BACK }, | 863 | { 0x1d1f, KEY_BACK }, |
862 | { 0x1d, 0x20, KEY_CHANNELUP }, | 864 | { 0x1d20, KEY_CHANNELUP }, |
863 | { 0x1d, 0x21, KEY_CHANNELDOWN }, | 865 | { 0x1d21, KEY_CHANNELDOWN }, |
864 | { 0x1d, 0x24, KEY_LAST }, | 866 | { 0x1d24, KEY_LAST }, |
865 | { 0x1d, 0x25, KEY_OK }, | 867 | { 0x1d25, KEY_OK }, |
866 | { 0x1d, 0x30, KEY_PAUSE }, | 868 | { 0x1d30, KEY_PAUSE }, |
867 | { 0x1d, 0x32, KEY_REWIND }, | 869 | { 0x1d32, KEY_REWIND }, |
868 | { 0x1d, 0x34, KEY_FASTFORWARD }, | 870 | { 0x1d34, KEY_FASTFORWARD }, |
869 | { 0x1d, 0x35, KEY_PLAY }, | 871 | { 0x1d35, KEY_PLAY }, |
870 | { 0x1d, 0x36, KEY_STOP }, | 872 | { 0x1d36, KEY_STOP }, |
871 | { 0x1d, 0x37, KEY_RECORD }, | 873 | { 0x1d37, KEY_RECORD }, |
872 | { 0x1d, 0x3b, KEY_GOTO }, | 874 | { 0x1d3b, KEY_GOTO }, |
873 | { 0x1d, 0x3d, KEY_POWER }, | 875 | { 0x1d3d, KEY_POWER }, |
874 | }; | 876 | }; |
875 | 877 | ||
876 | /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ | 878 | /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ |
@@ -1497,6 +1499,8 @@ struct usb_device_id dib0700_usb_id_table[] = { | |||
1497 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_H) }, | 1499 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_H) }, |
1498 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T3) }, | 1500 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T3) }, |
1499 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T5) }, | 1501 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T5) }, |
1502 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700D) }, | ||
1503 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700D_2) }, | ||
1500 | { 0 } /* Terminating entry */ | 1504 | { 0 } /* Terminating entry */ |
1501 | }; | 1505 | }; |
1502 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); | 1506 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); |
@@ -1624,7 +1628,7 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1624 | } | 1628 | } |
1625 | }, | 1629 | }, |
1626 | 1630 | ||
1627 | .num_device_descs = 4, | 1631 | .num_device_descs = 5, |
1628 | .devices = { | 1632 | .devices = { |
1629 | { "Pinnacle PCTV 2000e", | 1633 | { "Pinnacle PCTV 2000e", |
1630 | { &dib0700_usb_id_table[11], NULL }, | 1634 | { &dib0700_usb_id_table[11], NULL }, |
@@ -1642,6 +1646,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1642 | { &dib0700_usb_id_table[14], NULL }, | 1646 | { &dib0700_usb_id_table[14], NULL }, |
1643 | { NULL }, | 1647 | { NULL }, |
1644 | }, | 1648 | }, |
1649 | { "YUAN High-Tech DiBcom STK7700D", | ||
1650 | { &dib0700_usb_id_table[55], NULL }, | ||
1651 | { NULL }, | ||
1652 | }, | ||
1645 | 1653 | ||
1646 | }, | 1654 | }, |
1647 | 1655 | ||
@@ -1822,7 +1830,7 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1822 | }, | 1830 | }, |
1823 | }, | 1831 | }, |
1824 | 1832 | ||
1825 | .num_device_descs = 8, | 1833 | .num_device_descs = 9, |
1826 | .devices = { | 1834 | .devices = { |
1827 | { "Terratec Cinergy HT USB XE", | 1835 | { "Terratec Cinergy HT USB XE", |
1828 | { &dib0700_usb_id_table[27], NULL }, | 1836 | { &dib0700_usb_id_table[27], NULL }, |
@@ -1856,7 +1864,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1856 | { &dib0700_usb_id_table[51], NULL }, | 1864 | { &dib0700_usb_id_table[51], NULL }, |
1857 | { NULL }, | 1865 | { NULL }, |
1858 | }, | 1866 | }, |
1859 | 1867 | { "YUAN High-Tech STK7700D", | |
1868 | { &dib0700_usb_id_table[54], NULL }, | ||
1869 | { NULL }, | ||
1870 | }, | ||
1860 | }, | 1871 | }, |
1861 | .rc_interval = DEFAULT_RC_INTERVAL, | 1872 | .rc_interval = DEFAULT_RC_INTERVAL, |
1862 | .rc_key_map = dib0700_rc_keys, | 1873 | .rc_key_map = dib0700_rc_keys, |
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c index 8dbad1ec53c4..da34979b5337 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/drivers/media/dvb/dvb-usb/dibusb-common.c | |||
@@ -318,132 +318,132 @@ EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach); | |||
318 | */ | 318 | */ |
319 | struct dvb_usb_rc_key dibusb_rc_keys[] = { | 319 | struct dvb_usb_rc_key dibusb_rc_keys[] = { |
320 | /* Key codes for the little Artec T1/Twinhan/HAMA/ remote. */ | 320 | /* Key codes for the little Artec T1/Twinhan/HAMA/ remote. */ |
321 | { 0x00, 0x16, KEY_POWER }, | 321 | { 0x0016, KEY_POWER }, |
322 | { 0x00, 0x10, KEY_MUTE }, | 322 | { 0x0010, KEY_MUTE }, |
323 | { 0x00, 0x03, KEY_1 }, | 323 | { 0x0003, KEY_1 }, |
324 | { 0x00, 0x01, KEY_2 }, | 324 | { 0x0001, KEY_2 }, |
325 | { 0x00, 0x06, KEY_3 }, | 325 | { 0x0006, KEY_3 }, |
326 | { 0x00, 0x09, KEY_4 }, | 326 | { 0x0009, KEY_4 }, |
327 | { 0x00, 0x1d, KEY_5 }, | 327 | { 0x001d, KEY_5 }, |
328 | { 0x00, 0x1f, KEY_6 }, | 328 | { 0x001f, KEY_6 }, |
329 | { 0x00, 0x0d, KEY_7 }, | 329 | { 0x000d, KEY_7 }, |
330 | { 0x00, 0x19, KEY_8 }, | 330 | { 0x0019, KEY_8 }, |
331 | { 0x00, 0x1b, KEY_9 }, | 331 | { 0x001b, KEY_9 }, |
332 | { 0x00, 0x15, KEY_0 }, | 332 | { 0x0015, KEY_0 }, |
333 | { 0x00, 0x05, KEY_CHANNELUP }, | 333 | { 0x0005, KEY_CHANNELUP }, |
334 | { 0x00, 0x02, KEY_CHANNELDOWN }, | 334 | { 0x0002, KEY_CHANNELDOWN }, |
335 | { 0x00, 0x1e, KEY_VOLUMEUP }, | 335 | { 0x001e, KEY_VOLUMEUP }, |
336 | { 0x00, 0x0a, KEY_VOLUMEDOWN }, | 336 | { 0x000a, KEY_VOLUMEDOWN }, |
337 | { 0x00, 0x11, KEY_RECORD }, | 337 | { 0x0011, KEY_RECORD }, |
338 | { 0x00, 0x17, KEY_FAVORITES }, /* Heart symbol - Channel list. */ | 338 | { 0x0017, KEY_FAVORITES }, /* Heart symbol - Channel list. */ |
339 | { 0x00, 0x14, KEY_PLAY }, | 339 | { 0x0014, KEY_PLAY }, |
340 | { 0x00, 0x1a, KEY_STOP }, | 340 | { 0x001a, KEY_STOP }, |
341 | { 0x00, 0x40, KEY_REWIND }, | 341 | { 0x0040, KEY_REWIND }, |
342 | { 0x00, 0x12, KEY_FASTFORWARD }, | 342 | { 0x0012, KEY_FASTFORWARD }, |
343 | { 0x00, 0x0e, KEY_PREVIOUS }, /* Recall - Previous channel. */ | 343 | { 0x000e, KEY_PREVIOUS }, /* Recall - Previous channel. */ |
344 | { 0x00, 0x4c, KEY_PAUSE }, | 344 | { 0x004c, KEY_PAUSE }, |
345 | { 0x00, 0x4d, KEY_SCREEN }, /* Full screen mode. */ | 345 | { 0x004d, KEY_SCREEN }, /* Full screen mode. */ |
346 | { 0x00, 0x54, KEY_AUDIO }, /* MTS - Switch to secondary audio. */ | 346 | { 0x0054, KEY_AUDIO }, /* MTS - Switch to secondary audio. */ |
347 | /* additional keys TwinHan VisionPlus, the Artec seemingly not have */ | 347 | /* additional keys TwinHan VisionPlus, the Artec seemingly not have */ |
348 | { 0x00, 0x0c, KEY_CANCEL }, /* Cancel */ | 348 | { 0x000c, KEY_CANCEL }, /* Cancel */ |
349 | { 0x00, 0x1c, KEY_EPG }, /* EPG */ | 349 | { 0x001c, KEY_EPG }, /* EPG */ |
350 | { 0x00, 0x00, KEY_TAB }, /* Tab */ | 350 | { 0x0000, KEY_TAB }, /* Tab */ |
351 | { 0x00, 0x48, KEY_INFO }, /* Preview */ | 351 | { 0x0048, KEY_INFO }, /* Preview */ |
352 | { 0x00, 0x04, KEY_LIST }, /* RecordList */ | 352 | { 0x0004, KEY_LIST }, /* RecordList */ |
353 | { 0x00, 0x0f, KEY_TEXT }, /* Teletext */ | 353 | { 0x000f, KEY_TEXT }, /* Teletext */ |
354 | /* Key codes for the KWorld/ADSTech/JetWay remote. */ | 354 | /* Key codes for the KWorld/ADSTech/JetWay remote. */ |
355 | { 0x86, 0x12, KEY_POWER }, | 355 | { 0x8612, KEY_POWER }, |
356 | { 0x86, 0x0f, KEY_SELECT }, /* source */ | 356 | { 0x860f, KEY_SELECT }, /* source */ |
357 | { 0x86, 0x0c, KEY_UNKNOWN }, /* scan */ | 357 | { 0x860c, KEY_UNKNOWN }, /* scan */ |
358 | { 0x86, 0x0b, KEY_EPG }, | 358 | { 0x860b, KEY_EPG }, |
359 | { 0x86, 0x10, KEY_MUTE }, | 359 | { 0x8610, KEY_MUTE }, |
360 | { 0x86, 0x01, KEY_1 }, | 360 | { 0x8601, KEY_1 }, |
361 | { 0x86, 0x02, KEY_2 }, | 361 | { 0x8602, KEY_2 }, |
362 | { 0x86, 0x03, KEY_3 }, | 362 | { 0x8603, KEY_3 }, |
363 | { 0x86, 0x04, KEY_4 }, | 363 | { 0x8604, KEY_4 }, |
364 | { 0x86, 0x05, KEY_5 }, | 364 | { 0x8605, KEY_5 }, |
365 | { 0x86, 0x06, KEY_6 }, | 365 | { 0x8606, KEY_6 }, |
366 | { 0x86, 0x07, KEY_7 }, | 366 | { 0x8607, KEY_7 }, |
367 | { 0x86, 0x08, KEY_8 }, | 367 | { 0x8608, KEY_8 }, |
368 | { 0x86, 0x09, KEY_9 }, | 368 | { 0x8609, KEY_9 }, |
369 | { 0x86, 0x0a, KEY_0 }, | 369 | { 0x860a, KEY_0 }, |
370 | { 0x86, 0x18, KEY_ZOOM }, | 370 | { 0x8618, KEY_ZOOM }, |
371 | { 0x86, 0x1c, KEY_UNKNOWN }, /* preview */ | 371 | { 0x861c, KEY_UNKNOWN }, /* preview */ |
372 | { 0x86, 0x13, KEY_UNKNOWN }, /* snap */ | 372 | { 0x8613, KEY_UNKNOWN }, /* snap */ |
373 | { 0x86, 0x00, KEY_UNDO }, | 373 | { 0x8600, KEY_UNDO }, |
374 | { 0x86, 0x1d, KEY_RECORD }, | 374 | { 0x861d, KEY_RECORD }, |
375 | { 0x86, 0x0d, KEY_STOP }, | 375 | { 0x860d, KEY_STOP }, |
376 | { 0x86, 0x0e, KEY_PAUSE }, | 376 | { 0x860e, KEY_PAUSE }, |
377 | { 0x86, 0x16, KEY_PLAY }, | 377 | { 0x8616, KEY_PLAY }, |
378 | { 0x86, 0x11, KEY_BACK }, | 378 | { 0x8611, KEY_BACK }, |
379 | { 0x86, 0x19, KEY_FORWARD }, | 379 | { 0x8619, KEY_FORWARD }, |
380 | { 0x86, 0x14, KEY_UNKNOWN }, /* pip */ | 380 | { 0x8614, KEY_UNKNOWN }, /* pip */ |
381 | { 0x86, 0x15, KEY_ESC }, | 381 | { 0x8615, KEY_ESC }, |
382 | { 0x86, 0x1a, KEY_UP }, | 382 | { 0x861a, KEY_UP }, |
383 | { 0x86, 0x1e, KEY_DOWN }, | 383 | { 0x861e, KEY_DOWN }, |
384 | { 0x86, 0x1f, KEY_LEFT }, | 384 | { 0x861f, KEY_LEFT }, |
385 | { 0x86, 0x1b, KEY_RIGHT }, | 385 | { 0x861b, KEY_RIGHT }, |
386 | 386 | ||
387 | /* Key codes for the DiBcom MOD3000 remote. */ | 387 | /* Key codes for the DiBcom MOD3000 remote. */ |
388 | { 0x80, 0x00, KEY_MUTE }, | 388 | { 0x8000, KEY_MUTE }, |
389 | { 0x80, 0x01, KEY_TEXT }, | 389 | { 0x8001, KEY_TEXT }, |
390 | { 0x80, 0x02, KEY_HOME }, | 390 | { 0x8002, KEY_HOME }, |
391 | { 0x80, 0x03, KEY_POWER }, | 391 | { 0x8003, KEY_POWER }, |
392 | 392 | ||
393 | { 0x80, 0x04, KEY_RED }, | 393 | { 0x8004, KEY_RED }, |
394 | { 0x80, 0x05, KEY_GREEN }, | 394 | { 0x8005, KEY_GREEN }, |
395 | { 0x80, 0x06, KEY_YELLOW }, | 395 | { 0x8006, KEY_YELLOW }, |
396 | { 0x80, 0x07, KEY_BLUE }, | 396 | { 0x8007, KEY_BLUE }, |
397 | 397 | ||
398 | { 0x80, 0x08, KEY_DVD }, | 398 | { 0x8008, KEY_DVD }, |
399 | { 0x80, 0x09, KEY_AUDIO }, | 399 | { 0x8009, KEY_AUDIO }, |
400 | { 0x80, 0x0a, KEY_MEDIA }, /* Pictures */ | 400 | { 0x800a, KEY_MEDIA }, /* Pictures */ |
401 | { 0x80, 0x0b, KEY_VIDEO }, | 401 | { 0x800b, KEY_VIDEO }, |
402 | 402 | ||
403 | { 0x80, 0x0c, KEY_BACK }, | 403 | { 0x800c, KEY_BACK }, |
404 | { 0x80, 0x0d, KEY_UP }, | 404 | { 0x800d, KEY_UP }, |
405 | { 0x80, 0x0e, KEY_RADIO }, | 405 | { 0x800e, KEY_RADIO }, |
406 | { 0x80, 0x0f, KEY_EPG }, | 406 | { 0x800f, KEY_EPG }, |
407 | 407 | ||
408 | { 0x80, 0x10, KEY_LEFT }, | 408 | { 0x8010, KEY_LEFT }, |
409 | { 0x80, 0x11, KEY_OK }, | 409 | { 0x8011, KEY_OK }, |
410 | { 0x80, 0x12, KEY_RIGHT }, | 410 | { 0x8012, KEY_RIGHT }, |
411 | { 0x80, 0x13, KEY_UNKNOWN }, /* SAP */ | 411 | { 0x8013, KEY_UNKNOWN }, /* SAP */ |
412 | 412 | ||
413 | { 0x80, 0x14, KEY_TV }, | 413 | { 0x8014, KEY_TV }, |
414 | { 0x80, 0x15, KEY_DOWN }, | 414 | { 0x8015, KEY_DOWN }, |
415 | { 0x80, 0x16, KEY_MENU }, /* DVD Menu */ | 415 | { 0x8016, KEY_MENU }, /* DVD Menu */ |
416 | { 0x80, 0x17, KEY_LAST }, | 416 | { 0x8017, KEY_LAST }, |
417 | 417 | ||
418 | { 0x80, 0x18, KEY_RECORD }, | 418 | { 0x8018, KEY_RECORD }, |
419 | { 0x80, 0x19, KEY_STOP }, | 419 | { 0x8019, KEY_STOP }, |
420 | { 0x80, 0x1a, KEY_PAUSE }, | 420 | { 0x801a, KEY_PAUSE }, |
421 | { 0x80, 0x1b, KEY_PLAY }, | 421 | { 0x801b, KEY_PLAY }, |
422 | 422 | ||
423 | { 0x80, 0x1c, KEY_PREVIOUS }, | 423 | { 0x801c, KEY_PREVIOUS }, |
424 | { 0x80, 0x1d, KEY_REWIND }, | 424 | { 0x801d, KEY_REWIND }, |
425 | { 0x80, 0x1e, KEY_FASTFORWARD }, | 425 | { 0x801e, KEY_FASTFORWARD }, |
426 | { 0x80, 0x1f, KEY_NEXT}, | 426 | { 0x801f, KEY_NEXT}, |
427 | 427 | ||
428 | { 0x80, 0x40, KEY_1 }, | 428 | { 0x8040, KEY_1 }, |
429 | { 0x80, 0x41, KEY_2 }, | 429 | { 0x8041, KEY_2 }, |
430 | { 0x80, 0x42, KEY_3 }, | 430 | { 0x8042, KEY_3 }, |
431 | { 0x80, 0x43, KEY_CHANNELUP }, | 431 | { 0x8043, KEY_CHANNELUP }, |
432 | 432 | ||
433 | { 0x80, 0x44, KEY_4 }, | 433 | { 0x8044, KEY_4 }, |
434 | { 0x80, 0x45, KEY_5 }, | 434 | { 0x8045, KEY_5 }, |
435 | { 0x80, 0x46, KEY_6 }, | 435 | { 0x8046, KEY_6 }, |
436 | { 0x80, 0x47, KEY_CHANNELDOWN }, | 436 | { 0x8047, KEY_CHANNELDOWN }, |
437 | 437 | ||
438 | { 0x80, 0x48, KEY_7 }, | 438 | { 0x8048, KEY_7 }, |
439 | { 0x80, 0x49, KEY_8 }, | 439 | { 0x8049, KEY_8 }, |
440 | { 0x80, 0x4a, KEY_9 }, | 440 | { 0x804a, KEY_9 }, |
441 | { 0x80, 0x4b, KEY_VOLUMEUP }, | 441 | { 0x804b, KEY_VOLUMEUP }, |
442 | 442 | ||
443 | { 0x80, 0x4c, KEY_CLEAR }, | 443 | { 0x804c, KEY_CLEAR }, |
444 | { 0x80, 0x4d, KEY_0 }, | 444 | { 0x804d, KEY_0 }, |
445 | { 0x80, 0x4e, KEY_ENTER }, | 445 | { 0x804e, KEY_ENTER }, |
446 | { 0x80, 0x4f, KEY_VOLUMEDOWN }, | 446 | { 0x804f, KEY_VOLUMEDOWN }, |
447 | }; | 447 | }; |
448 | EXPORT_SYMBOL(dibusb_rc_keys); | 448 | EXPORT_SYMBOL(dibusb_rc_keys); |
449 | 449 | ||
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c b/drivers/media/dvb/dvb-usb/dibusb-mc.c index 059cec955318..a05b9f875663 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mc.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c | |||
@@ -42,6 +42,8 @@ static struct usb_device_id dibusb_dib3000mc_table [] = { | |||
42 | /* 11 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_WARM) }, | 42 | /* 11 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_WARM) }, |
43 | /* 12 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_COLD) }, | 43 | /* 12 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_COLD) }, |
44 | /* 13 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_WARM) }, | 44 | /* 13 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_WARM) }, |
45 | /* 14 */ { USB_DEVICE(USB_VID_HUMAX_COEX, USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD) }, | ||
46 | /* 15 */ { USB_DEVICE(USB_VID_HUMAX_COEX, USB_PID_DVB_T_USB_STICK_HIGH_SPEED_WARM) }, | ||
45 | { } /* Terminating entry */ | 47 | { } /* Terminating entry */ |
46 | }; | 48 | }; |
47 | MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table); | 49 | MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table); |
@@ -66,7 +68,7 @@ static struct dvb_usb_device_properties dibusb_mc_properties = { | |||
66 | /* parameter for the MPEG2-data transfer */ | 68 | /* parameter for the MPEG2-data transfer */ |
67 | .stream = { | 69 | .stream = { |
68 | .type = USB_BULK, | 70 | .type = USB_BULK, |
69 | .count = 7, | 71 | .count = 8, |
70 | .endpoint = 0x06, | 72 | .endpoint = 0x06, |
71 | .u = { | 73 | .u = { |
72 | .bulk = { | 74 | .bulk = { |
@@ -88,7 +90,7 @@ static struct dvb_usb_device_properties dibusb_mc_properties = { | |||
88 | 90 | ||
89 | .generic_bulk_ctrl_endpoint = 0x01, | 91 | .generic_bulk_ctrl_endpoint = 0x01, |
90 | 92 | ||
91 | .num_device_descs = 7, | 93 | .num_device_descs = 8, |
92 | .devices = { | 94 | .devices = { |
93 | { "DiBcom USB2.0 DVB-T reference design (MOD3000P)", | 95 | { "DiBcom USB2.0 DVB-T reference design (MOD3000P)", |
94 | { &dibusb_dib3000mc_table[0], NULL }, | 96 | { &dibusb_dib3000mc_table[0], NULL }, |
@@ -119,6 +121,10 @@ static struct dvb_usb_device_properties dibusb_mc_properties = { | |||
119 | { &dibusb_dib3000mc_table[12], NULL }, | 121 | { &dibusb_dib3000mc_table[12], NULL }, |
120 | { &dibusb_dib3000mc_table[13], NULL }, | 122 | { &dibusb_dib3000mc_table[13], NULL }, |
121 | }, | 123 | }, |
124 | { "Humax/Coex DVB-T USB Stick 2.0 High Speed", | ||
125 | { &dibusb_dib3000mc_table[14], NULL }, | ||
126 | { &dibusb_dib3000mc_table[15], NULL }, | ||
127 | }, | ||
122 | { NULL }, | 128 | { NULL }, |
123 | } | 129 | } |
124 | }; | 130 | }; |
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index b545cf3eab2e..955147d00756 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -162,61 +162,61 @@ static int digitv_tuner_attach(struct dvb_usb_adapter *adap) | |||
162 | } | 162 | } |
163 | 163 | ||
164 | static struct dvb_usb_rc_key digitv_rc_keys[] = { | 164 | static struct dvb_usb_rc_key digitv_rc_keys[] = { |
165 | { 0x5f, 0x55, KEY_0 }, | 165 | { 0x5f55, KEY_0 }, |
166 | { 0x6f, 0x55, KEY_1 }, | 166 | { 0x6f55, KEY_1 }, |
167 | { 0x9f, 0x55, KEY_2 }, | 167 | { 0x9f55, KEY_2 }, |
168 | { 0xaf, 0x55, KEY_3 }, | 168 | { 0xaf55, KEY_3 }, |
169 | { 0x5f, 0x56, KEY_4 }, | 169 | { 0x5f56, KEY_4 }, |
170 | { 0x6f, 0x56, KEY_5 }, | 170 | { 0x6f56, KEY_5 }, |
171 | { 0x9f, 0x56, KEY_6 }, | 171 | { 0x9f56, KEY_6 }, |
172 | { 0xaf, 0x56, KEY_7 }, | 172 | { 0xaf56, KEY_7 }, |
173 | { 0x5f, 0x59, KEY_8 }, | 173 | { 0x5f59, KEY_8 }, |
174 | { 0x6f, 0x59, KEY_9 }, | 174 | { 0x6f59, KEY_9 }, |
175 | { 0x9f, 0x59, KEY_TV }, | 175 | { 0x9f59, KEY_TV }, |
176 | { 0xaf, 0x59, KEY_AUX }, | 176 | { 0xaf59, KEY_AUX }, |
177 | { 0x5f, 0x5a, KEY_DVD }, | 177 | { 0x5f5a, KEY_DVD }, |
178 | { 0x6f, 0x5a, KEY_POWER }, | 178 | { 0x6f5a, KEY_POWER }, |
179 | { 0x9f, 0x5a, KEY_MHP }, /* labelled 'Picture' */ | 179 | { 0x9f5a, KEY_MHP }, /* labelled 'Picture' */ |
180 | { 0xaf, 0x5a, KEY_AUDIO }, | 180 | { 0xaf5a, KEY_AUDIO }, |
181 | { 0x5f, 0x65, KEY_INFO }, | 181 | { 0x5f65, KEY_INFO }, |
182 | { 0x6f, 0x65, KEY_F13 }, /* 16:9 */ | 182 | { 0x6f65, KEY_F13 }, /* 16:9 */ |
183 | { 0x9f, 0x65, KEY_F14 }, /* 14:9 */ | 183 | { 0x9f65, KEY_F14 }, /* 14:9 */ |
184 | { 0xaf, 0x65, KEY_EPG }, | 184 | { 0xaf65, KEY_EPG }, |
185 | { 0x5f, 0x66, KEY_EXIT }, | 185 | { 0x5f66, KEY_EXIT }, |
186 | { 0x6f, 0x66, KEY_MENU }, | 186 | { 0x6f66, KEY_MENU }, |
187 | { 0x9f, 0x66, KEY_UP }, | 187 | { 0x9f66, KEY_UP }, |
188 | { 0xaf, 0x66, KEY_DOWN }, | 188 | { 0xaf66, KEY_DOWN }, |
189 | { 0x5f, 0x69, KEY_LEFT }, | 189 | { 0x5f69, KEY_LEFT }, |
190 | { 0x6f, 0x69, KEY_RIGHT }, | 190 | { 0x6f69, KEY_RIGHT }, |
191 | { 0x9f, 0x69, KEY_ENTER }, | 191 | { 0x9f69, KEY_ENTER }, |
192 | { 0xaf, 0x69, KEY_CHANNELUP }, | 192 | { 0xaf69, KEY_CHANNELUP }, |
193 | { 0x5f, 0x6a, KEY_CHANNELDOWN }, | 193 | { 0x5f6a, KEY_CHANNELDOWN }, |
194 | { 0x6f, 0x6a, KEY_VOLUMEUP }, | 194 | { 0x6f6a, KEY_VOLUMEUP }, |
195 | { 0x9f, 0x6a, KEY_VOLUMEDOWN }, | 195 | { 0x9f6a, KEY_VOLUMEDOWN }, |
196 | { 0xaf, 0x6a, KEY_RED }, | 196 | { 0xaf6a, KEY_RED }, |
197 | { 0x5f, 0x95, KEY_GREEN }, | 197 | { 0x5f95, KEY_GREEN }, |
198 | { 0x6f, 0x95, KEY_YELLOW }, | 198 | { 0x6f95, KEY_YELLOW }, |
199 | { 0x9f, 0x95, KEY_BLUE }, | 199 | { 0x9f95, KEY_BLUE }, |
200 | { 0xaf, 0x95, KEY_SUBTITLE }, | 200 | { 0xaf95, KEY_SUBTITLE }, |
201 | { 0x5f, 0x96, KEY_F15 }, /* AD */ | 201 | { 0x5f96, KEY_F15 }, /* AD */ |
202 | { 0x6f, 0x96, KEY_TEXT }, | 202 | { 0x6f96, KEY_TEXT }, |
203 | { 0x9f, 0x96, KEY_MUTE }, | 203 | { 0x9f96, KEY_MUTE }, |
204 | { 0xaf, 0x96, KEY_REWIND }, | 204 | { 0xaf96, KEY_REWIND }, |
205 | { 0x5f, 0x99, KEY_STOP }, | 205 | { 0x5f99, KEY_STOP }, |
206 | { 0x6f, 0x99, KEY_PLAY }, | 206 | { 0x6f99, KEY_PLAY }, |
207 | { 0x9f, 0x99, KEY_FASTFORWARD }, | 207 | { 0x9f99, KEY_FASTFORWARD }, |
208 | { 0xaf, 0x99, KEY_F16 }, /* chapter */ | 208 | { 0xaf99, KEY_F16 }, /* chapter */ |
209 | { 0x5f, 0x9a, KEY_PAUSE }, | 209 | { 0x5f9a, KEY_PAUSE }, |
210 | { 0x6f, 0x9a, KEY_PLAY }, | 210 | { 0x6f9a, KEY_PLAY }, |
211 | { 0x9f, 0x9a, KEY_RECORD }, | 211 | { 0x9f9a, KEY_RECORD }, |
212 | { 0xaf, 0x9a, KEY_F17 }, /* picture in picture */ | 212 | { 0xaf9a, KEY_F17 }, /* picture in picture */ |
213 | { 0x5f, 0xa5, KEY_KPPLUS }, /* zoom in */ | 213 | { 0x5fa5, KEY_KPPLUS }, /* zoom in */ |
214 | { 0x6f, 0xa5, KEY_KPMINUS }, /* zoom out */ | 214 | { 0x6fa5, KEY_KPMINUS }, /* zoom out */ |
215 | { 0x9f, 0xa5, KEY_F18 }, /* capture */ | 215 | { 0x9fa5, KEY_F18 }, /* capture */ |
216 | { 0xaf, 0xa5, KEY_F19 }, /* web */ | 216 | { 0xafa5, KEY_F19 }, /* web */ |
217 | { 0x5f, 0xa6, KEY_EMAIL }, | 217 | { 0x5fa6, KEY_EMAIL }, |
218 | { 0x6f, 0xa6, KEY_PHONE }, | 218 | { 0x6fa6, KEY_PHONE }, |
219 | { 0x9f, 0xa6, KEY_PC }, | 219 | { 0x9fa6, KEY_PC }, |
220 | }; | 220 | }; |
221 | 221 | ||
222 | static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 222 | static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
@@ -238,8 +238,8 @@ static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
238 | if (key[1] != 0) | 238 | if (key[1] != 0) |
239 | { | 239 | { |
240 | for (i = 0; i < d->props.rc_key_map_size; i++) { | 240 | for (i = 0; i < d->props.rc_key_map_size; i++) { |
241 | if (d->props.rc_key_map[i].custom == key[1] && | 241 | if (rc5_custom(&d->props.rc_key_map[i]) == key[1] && |
242 | d->props.rc_key_map[i].data == key[2]) { | 242 | rc5_data(&d->props.rc_key_map[i]) == key[2]) { |
243 | *event = d->props.rc_key_map[i].event; | 243 | *event = d->props.rc_key_map[i].event; |
244 | *state = REMOTE_KEY_PRESSED; | 244 | *state = REMOTE_KEY_PRESSED; |
245 | return 0; | 245 | return 0; |
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c b/drivers/media/dvb/dvb-usb/dtt200u.c index 81a6cbf60160..a1b12b01cbe4 100644 --- a/drivers/media/dvb/dvb-usb/dtt200u.c +++ b/drivers/media/dvb/dvb-usb/dtt200u.c | |||
@@ -58,24 +58,24 @@ static int dtt200u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, | |||
58 | /* remote control */ | 58 | /* remote control */ |
59 | /* key list for the tiny remote control (Yakumo, don't know about the others) */ | 59 | /* key list for the tiny remote control (Yakumo, don't know about the others) */ |
60 | static struct dvb_usb_rc_key dtt200u_rc_keys[] = { | 60 | static struct dvb_usb_rc_key dtt200u_rc_keys[] = { |
61 | { 0x80, 0x01, KEY_MUTE }, | 61 | { 0x8001, KEY_MUTE }, |
62 | { 0x80, 0x02, KEY_CHANNELDOWN }, | 62 | { 0x8002, KEY_CHANNELDOWN }, |
63 | { 0x80, 0x03, KEY_VOLUMEDOWN }, | 63 | { 0x8003, KEY_VOLUMEDOWN }, |
64 | { 0x80, 0x04, KEY_1 }, | 64 | { 0x8004, KEY_1 }, |
65 | { 0x80, 0x05, KEY_2 }, | 65 | { 0x8005, KEY_2 }, |
66 | { 0x80, 0x06, KEY_3 }, | 66 | { 0x8006, KEY_3 }, |
67 | { 0x80, 0x07, KEY_4 }, | 67 | { 0x8007, KEY_4 }, |
68 | { 0x80, 0x08, KEY_5 }, | 68 | { 0x8008, KEY_5 }, |
69 | { 0x80, 0x09, KEY_6 }, | 69 | { 0x8009, KEY_6 }, |
70 | { 0x80, 0x0a, KEY_7 }, | 70 | { 0x800a, KEY_7 }, |
71 | { 0x80, 0x0c, KEY_ZOOM }, | 71 | { 0x800c, KEY_ZOOM }, |
72 | { 0x80, 0x0d, KEY_0 }, | 72 | { 0x800d, KEY_0 }, |
73 | { 0x80, 0x0e, KEY_SELECT }, | 73 | { 0x800e, KEY_SELECT }, |
74 | { 0x80, 0x12, KEY_POWER }, | 74 | { 0x8012, KEY_POWER }, |
75 | { 0x80, 0x1a, KEY_CHANNELUP }, | 75 | { 0x801a, KEY_CHANNELUP }, |
76 | { 0x80, 0x1b, KEY_8 }, | 76 | { 0x801b, KEY_8 }, |
77 | { 0x80, 0x1e, KEY_VOLUMEUP }, | 77 | { 0x801e, KEY_VOLUMEUP }, |
78 | { 0x80, 0x1f, KEY_9 }, | 78 | { 0x801f, KEY_9 }, |
79 | }; | 79 | }; |
80 | 80 | ||
81 | static int dtt200u_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 81 | static int dtt200u_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c index 326f7608954b..cead089bbb4f 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c | |||
@@ -19,7 +19,7 @@ int dvb_usb_i2c_init(struct dvb_usb_device *d) | |||
19 | return -EINVAL; | 19 | return -EINVAL; |
20 | } | 20 | } |
21 | 21 | ||
22 | strncpy(d->i2c_adap.name, d->desc->name, sizeof(d->i2c_adap.name)); | 22 | strlcpy(d->i2c_adap.name, d->desc->name, sizeof(d->i2c_adap.name)); |
23 | d->i2c_adap.class = I2C_CLASS_TV_DIGITAL, | 23 | d->i2c_adap.class = I2C_CLASS_TV_DIGITAL, |
24 | d->i2c_adap.algo = d->props.i2c_algo; | 24 | d->i2c_adap.algo = d->props.i2c_algo; |
25 | d->i2c_adap.algo_data = NULL; | 25 | d->i2c_adap.algo_data = NULL; |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 9593b7289994..185a5069b10b 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h | |||
@@ -58,6 +58,7 @@ | |||
58 | #define USB_VID_GIGABYTE 0x1044 | 58 | #define USB_VID_GIGABYTE 0x1044 |
59 | #define USB_VID_YUAN 0x1164 | 59 | #define USB_VID_YUAN 0x1164 |
60 | #define USB_VID_XTENSIONS 0x1ae7 | 60 | #define USB_VID_XTENSIONS 0x1ae7 |
61 | #define USB_VID_HUMAX_COEX 0x10b9 | ||
61 | 62 | ||
62 | /* Product IDs */ | 63 | /* Product IDs */ |
63 | #define USB_PID_ADSTECH_USB2_COLD 0xa333 | 64 | #define USB_PID_ADSTECH_USB2_COLD 0xa333 |
@@ -103,6 +104,7 @@ | |||
103 | #define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 | 104 | #define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 |
104 | #define USB_PID_INTEL_CE9500 0x9500 | 105 | #define USB_PID_INTEL_CE9500 0x9500 |
105 | #define USB_PID_KWORLD_399U 0xe399 | 106 | #define USB_PID_KWORLD_399U 0xe399 |
107 | #define USB_PID_KWORLD_399U_2 0xe400 | ||
106 | #define USB_PID_KWORLD_395U 0xe396 | 108 | #define USB_PID_KWORLD_395U 0xe396 |
107 | #define USB_PID_KWORLD_395U_2 0xe39b | 109 | #define USB_PID_KWORLD_395U_2 0xe39b |
108 | #define USB_PID_KWORLD_395U_3 0xe395 | 110 | #define USB_PID_KWORLD_395U_3 0xe395 |
@@ -252,6 +254,8 @@ | |||
252 | #define USB_PID_YUAN_STK7700PH 0x1f08 | 254 | #define USB_PID_YUAN_STK7700PH 0x1f08 |
253 | #define USB_PID_YUAN_PD378S 0x2edc | 255 | #define USB_PID_YUAN_PD378S 0x2edc |
254 | #define USB_PID_YUAN_MC770 0x0871 | 256 | #define USB_PID_YUAN_MC770 0x0871 |
257 | #define USB_PID_YUAN_STK7700D 0x1efc | ||
258 | #define USB_PID_YUAN_STK7700D_2 0x1e8c | ||
255 | #define USB_PID_DW2102 0x2102 | 259 | #define USB_PID_DW2102 0x2102 |
256 | #define USB_PID_XTENSIONS_XD_380 0x0381 | 260 | #define USB_PID_XTENSIONS_XD_380 0x0381 |
257 | #define USB_PID_TELESTAR_STARSTICK_2 0x8000 | 261 | #define USB_PID_TELESTAR_STARSTICK_2 0x8000 |
@@ -259,5 +263,7 @@ | |||
259 | #define USB_PID_SONY_PLAYTV 0x0003 | 263 | #define USB_PID_SONY_PLAYTV 0x0003 |
260 | #define USB_PID_ELGATO_EYETV_DTT 0x0021 | 264 | #define USB_PID_ELGATO_EYETV_DTT 0x0021 |
261 | #define USB_PID_ELGATO_EYETV_DTT_Dlx 0x0020 | 265 | #define USB_PID_ELGATO_EYETV_DTT_Dlx 0x0020 |
266 | #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD 0x5000 | ||
267 | #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_WARM 0x5001 | ||
262 | 268 | ||
263 | #endif | 269 | #endif |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c index c0c2c22ddd83..edde87c6aa3a 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c | |||
@@ -8,6 +8,71 @@ | |||
8 | #include "dvb-usb-common.h" | 8 | #include "dvb-usb-common.h" |
9 | #include <linux/usb/input.h> | 9 | #include <linux/usb/input.h> |
10 | 10 | ||
11 | static int dvb_usb_getkeycode(struct input_dev *dev, | ||
12 | int scancode, int *keycode) | ||
13 | { | ||
14 | struct dvb_usb_device *d = input_get_drvdata(dev); | ||
15 | |||
16 | struct dvb_usb_rc_key *keymap = d->props.rc_key_map; | ||
17 | int i; | ||
18 | |||
19 | /* See if we can match the raw key code. */ | ||
20 | for (i = 0; i < d->props.rc_key_map_size; i++) | ||
21 | if (keymap[i].scan == scancode) { | ||
22 | *keycode = keymap[i].event; | ||
23 | return 0; | ||
24 | } | ||
25 | |||
26 | /* | ||
27 | * If is there extra space, returns KEY_RESERVED, | ||
28 | * otherwise, input core won't let dvb_usb_setkeycode | ||
29 | * to work | ||
30 | */ | ||
31 | for (i = 0; i < d->props.rc_key_map_size; i++) | ||
32 | if (keymap[i].event == KEY_RESERVED || | ||
33 | keymap[i].event == KEY_UNKNOWN) { | ||
34 | *keycode = KEY_RESERVED; | ||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | return -EINVAL; | ||
39 | } | ||
40 | |||
41 | static int dvb_usb_setkeycode(struct input_dev *dev, | ||
42 | int scancode, int keycode) | ||
43 | { | ||
44 | struct dvb_usb_device *d = input_get_drvdata(dev); | ||
45 | |||
46 | struct dvb_usb_rc_key *keymap = d->props.rc_key_map; | ||
47 | int i; | ||
48 | |||
49 | /* Search if it is replacing an existing keycode */ | ||
50 | for (i = 0; i < d->props.rc_key_map_size; i++) | ||
51 | if (keymap[i].scan == scancode) { | ||
52 | keymap[i].event = keycode; | ||
53 | return 0; | ||
54 | } | ||
55 | |||
56 | /* Search if is there a clean entry. If so, use it */ | ||
57 | for (i = 0; i < d->props.rc_key_map_size; i++) | ||
58 | if (keymap[i].event == KEY_RESERVED || | ||
59 | keymap[i].event == KEY_UNKNOWN) { | ||
60 | keymap[i].scan = scancode; | ||
61 | keymap[i].event = keycode; | ||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | /* | ||
66 | * FIXME: Currently, it is not possible to increase the size of | ||
67 | * scancode table. For it to happen, one possibility | ||
68 | * would be to allocate a table with key_map_size + 1, | ||
69 | * copying data, appending the new key on it, and freeing | ||
70 | * the old one - or maybe just allocating some spare space | ||
71 | */ | ||
72 | |||
73 | return -EINVAL; | ||
74 | } | ||
75 | |||
11 | /* Remote-control poll function - called every dib->rc_query_interval ms to see | 76 | /* Remote-control poll function - called every dib->rc_query_interval ms to see |
12 | * whether the remote control has received anything. | 77 | * whether the remote control has received anything. |
13 | * | 78 | * |
@@ -111,6 +176,8 @@ int dvb_usb_remote_init(struct dvb_usb_device *d) | |||
111 | input_dev->phys = d->rc_phys; | 176 | input_dev->phys = d->rc_phys; |
112 | usb_to_input_id(d->udev, &input_dev->id); | 177 | usb_to_input_id(d->udev, &input_dev->id); |
113 | input_dev->dev.parent = &d->udev->dev; | 178 | input_dev->dev.parent = &d->udev->dev; |
179 | input_dev->getkeycode = dvb_usb_getkeycode; | ||
180 | input_dev->setkeycode = dvb_usb_setkeycode; | ||
114 | 181 | ||
115 | /* set the bits for the keys */ | 182 | /* set the bits for the keys */ |
116 | deb_rc("key map size: %d\n", d->props.rc_key_map_size); | 183 | deb_rc("key map size: %d\n", d->props.rc_key_map_size); |
@@ -128,6 +195,8 @@ int dvb_usb_remote_init(struct dvb_usb_device *d) | |||
128 | input_dev->rep[REP_PERIOD] = d->props.rc_interval; | 195 | input_dev->rep[REP_PERIOD] = d->props.rc_interval; |
129 | input_dev->rep[REP_DELAY] = d->props.rc_interval + 150; | 196 | input_dev->rep[REP_DELAY] = d->props.rc_interval + 150; |
130 | 197 | ||
198 | input_set_drvdata(input_dev, d); | ||
199 | |||
131 | err = input_register_device(input_dev); | 200 | err = input_register_device(input_dev); |
132 | if (err) { | 201 | if (err) { |
133 | input_free_device(input_dev); | 202 | input_free_device(input_dev); |
@@ -178,8 +247,8 @@ int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *d, | |||
178 | } | 247 | } |
179 | /* See if we can match the raw key code. */ | 248 | /* See if we can match the raw key code. */ |
180 | for (i = 0; i < d->props.rc_key_map_size; i++) | 249 | for (i = 0; i < d->props.rc_key_map_size; i++) |
181 | if (keymap[i].custom == keybuf[1] && | 250 | if (rc5_custom(&keymap[i]) == keybuf[1] && |
182 | keymap[i].data == keybuf[3]) { | 251 | rc5_data(&keymap[i]) == keybuf[3]) { |
183 | *event = keymap[i].event; | 252 | *event = keymap[i].event; |
184 | *state = REMOTE_KEY_PRESSED; | 253 | *state = REMOTE_KEY_PRESSED; |
185 | return 0; | 254 | return 0; |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index e441d274e6c1..fe2b87efb3f1 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h | |||
@@ -81,10 +81,25 @@ struct dvb_usb_device_description { | |||
81 | * @event: the input event assigned to key identified by custom and data | 81 | * @event: the input event assigned to key identified by custom and data |
82 | */ | 82 | */ |
83 | struct dvb_usb_rc_key { | 83 | struct dvb_usb_rc_key { |
84 | u8 custom,data; | 84 | u16 scan; |
85 | u32 event; | 85 | u32 event; |
86 | }; | 86 | }; |
87 | 87 | ||
88 | static inline u8 rc5_custom(struct dvb_usb_rc_key *key) | ||
89 | { | ||
90 | return (key->scan >> 8) & 0xff; | ||
91 | } | ||
92 | |||
93 | static inline u8 rc5_data(struct dvb_usb_rc_key *key) | ||
94 | { | ||
95 | return key->scan & 0xff; | ||
96 | } | ||
97 | |||
98 | static inline u8 rc5_scan(struct dvb_usb_rc_key *key) | ||
99 | { | ||
100 | return key->scan & 0xffff; | ||
101 | } | ||
102 | |||
88 | struct dvb_usb_device; | 103 | struct dvb_usb_device; |
89 | struct dvb_usb_adapter; | 104 | struct dvb_usb_adapter; |
90 | struct usb_data_stream; | 105 | struct usb_data_stream; |
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c index 75de49c0d943..5bb9479d154e 100644 --- a/drivers/media/dvb/dvb-usb/dw2102.c +++ b/drivers/media/dvb/dvb-usb/dw2102.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* DVB USB framework compliant Linux driver for the | 1 | /* DVB USB framework compliant Linux driver for the |
2 | * DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101, | 2 | * DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101, |
3 | * TeVii S600, S650 Cards | 3 | * TeVii S600, S630, S650 Cards |
4 | * Copyright (C) 2008,2009 Igor M. Liplianin (liplianin@me.by) | 4 | * Copyright (C) 2008,2009 Igor M. Liplianin (liplianin@me.by) |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
@@ -18,6 +18,8 @@ | |||
18 | #include "eds1547.h" | 18 | #include "eds1547.h" |
19 | #include "cx24116.h" | 19 | #include "cx24116.h" |
20 | #include "tda1002x.h" | 20 | #include "tda1002x.h" |
21 | #include "mt312.h" | ||
22 | #include "zl10039.h" | ||
21 | 23 | ||
22 | #ifndef USB_PID_DW2102 | 24 | #ifndef USB_PID_DW2102 |
23 | #define USB_PID_DW2102 0x2102 | 25 | #define USB_PID_DW2102 0x2102 |
@@ -39,6 +41,10 @@ | |||
39 | #define USB_PID_TEVII_S650 0xd650 | 41 | #define USB_PID_TEVII_S650 0xd650 |
40 | #endif | 42 | #endif |
41 | 43 | ||
44 | #ifndef USB_PID_TEVII_S630 | ||
45 | #define USB_PID_TEVII_S630 0xd630 | ||
46 | #endif | ||
47 | |||
42 | #define DW210X_READ_MSG 0 | 48 | #define DW210X_READ_MSG 0 |
43 | #define DW210X_WRITE_MSG 1 | 49 | #define DW210X_WRITE_MSG 1 |
44 | 50 | ||
@@ -436,6 +442,69 @@ static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
436 | return num; | 442 | return num; |
437 | } | 443 | } |
438 | 444 | ||
445 | static int s630_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | ||
446 | int num) | ||
447 | { | ||
448 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | ||
449 | int ret = 0; | ||
450 | |||
451 | if (!d) | ||
452 | return -ENODEV; | ||
453 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) | ||
454 | return -EAGAIN; | ||
455 | |||
456 | switch (num) { | ||
457 | case 2: { /* read */ | ||
458 | u8 ibuf[msg[1].len], obuf[3]; | ||
459 | obuf[0] = msg[1].len; | ||
460 | obuf[1] = (msg[0].addr << 1); | ||
461 | obuf[2] = msg[0].buf[0]; | ||
462 | |||
463 | ret = dw210x_op_rw(d->udev, 0x90, 0, 0, | ||
464 | obuf, 3, DW210X_WRITE_MSG); | ||
465 | msleep(5); | ||
466 | ret = dw210x_op_rw(d->udev, 0x91, 0, 0, | ||
467 | ibuf, msg[1].len, DW210X_READ_MSG); | ||
468 | memcpy(msg[1].buf, ibuf, msg[1].len); | ||
469 | break; | ||
470 | } | ||
471 | case 1: | ||
472 | switch (msg[0].addr) { | ||
473 | case 0x60: | ||
474 | case 0x0e: { | ||
475 | /* write to zl10313, zl10039 register, */ | ||
476 | u8 obuf[msg[0].len + 2]; | ||
477 | obuf[0] = msg[0].len + 1; | ||
478 | obuf[1] = (msg[0].addr << 1); | ||
479 | memcpy(obuf + 2, msg[0].buf, msg[0].len); | ||
480 | ret = dw210x_op_rw(d->udev, 0x80, 0, 0, | ||
481 | obuf, msg[0].len + 2, DW210X_WRITE_MSG); | ||
482 | break; | ||
483 | } | ||
484 | case (DW2102_RC_QUERY): { | ||
485 | u8 ibuf[4]; | ||
486 | ret = dw210x_op_rw(d->udev, 0xb8, 0, 0, | ||
487 | ibuf, 4, DW210X_READ_MSG); | ||
488 | msg[0].buf[0] = ibuf[3]; | ||
489 | break; | ||
490 | } | ||
491 | case (DW2102_VOLTAGE_CTRL): { | ||
492 | u8 obuf[2]; | ||
493 | obuf[0] = 0x03; | ||
494 | obuf[1] = msg[0].buf[0]; | ||
495 | ret = dw210x_op_rw(d->udev, 0x8a, 0, 0, | ||
496 | obuf, 2, DW210X_WRITE_MSG); | ||
497 | break; | ||
498 | } | ||
499 | } | ||
500 | |||
501 | break; | ||
502 | } | ||
503 | |||
504 | mutex_unlock(&d->i2c_mutex); | ||
505 | return num; | ||
506 | } | ||
507 | |||
439 | static u32 dw210x_i2c_func(struct i2c_adapter *adapter) | 508 | static u32 dw210x_i2c_func(struct i2c_adapter *adapter) |
440 | { | 509 | { |
441 | return I2C_FUNC_I2C; | 510 | return I2C_FUNC_I2C; |
@@ -466,6 +535,11 @@ static struct i2c_algorithm dw3101_i2c_algo = { | |||
466 | .functionality = dw210x_i2c_func, | 535 | .functionality = dw210x_i2c_func, |
467 | }; | 536 | }; |
468 | 537 | ||
538 | static struct i2c_algorithm s630_i2c_algo = { | ||
539 | .master_xfer = s630_i2c_transfer, | ||
540 | .functionality = dw210x_i2c_func, | ||
541 | }; | ||
542 | |||
469 | static int dw210x_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) | 543 | static int dw210x_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) |
470 | { | 544 | { |
471 | int i; | 545 | int i; |
@@ -490,6 +564,37 @@ static int dw210x_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) | |||
490 | return 0; | 564 | return 0; |
491 | }; | 565 | }; |
492 | 566 | ||
567 | static int s630_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) | ||
568 | { | ||
569 | int i, ret; | ||
570 | u8 buf[3], eeprom[256], eepromline[16]; | ||
571 | |||
572 | for (i = 0; i < 256; i++) { | ||
573 | buf[0] = 1; | ||
574 | buf[1] = 0xa0; | ||
575 | buf[2] = i; | ||
576 | ret = dw210x_op_rw(d->udev, 0x90, 0, 0, | ||
577 | buf, 3, DW210X_WRITE_MSG); | ||
578 | ret = dw210x_op_rw(d->udev, 0x91, 0, 0, | ||
579 | buf, 1, DW210X_READ_MSG); | ||
580 | if (ret < 0) { | ||
581 | err("read eeprom failed."); | ||
582 | return -1; | ||
583 | } else { | ||
584 | eepromline[i % 16] = buf[0]; | ||
585 | eeprom[i] = buf[0]; | ||
586 | } | ||
587 | |||
588 | if ((i % 16) == 15) { | ||
589 | deb_xfer("%02x: ", i - 15); | ||
590 | debug_dump(eepromline, 16, deb_xfer); | ||
591 | } | ||
592 | } | ||
593 | |||
594 | memcpy(mac, eeprom + 16, 6); | ||
595 | return 0; | ||
596 | }; | ||
597 | |||
493 | static int dw210x_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) | 598 | static int dw210x_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) |
494 | { | 599 | { |
495 | static u8 command_13v[1] = {0x00}; | 600 | static u8 command_13v[1] = {0x00}; |
@@ -535,6 +640,10 @@ static struct tda10023_config dw3101_tda10023_config = { | |||
535 | .invert = 1, | 640 | .invert = 1, |
536 | }; | 641 | }; |
537 | 642 | ||
643 | static struct mt312_config zl313_config = { | ||
644 | .demod_address = 0x0e, | ||
645 | }; | ||
646 | |||
538 | static int dw2104_frontend_attach(struct dvb_usb_adapter *d) | 647 | static int dw2104_frontend_attach(struct dvb_usb_adapter *d) |
539 | { | 648 | { |
540 | if ((d->fe = dvb_attach(cx24116_attach, &dw2104_config, | 649 | if ((d->fe = dvb_attach(cx24116_attach, &dw2104_config, |
@@ -596,6 +705,18 @@ static int dw3101_frontend_attach(struct dvb_usb_adapter *d) | |||
596 | return -EIO; | 705 | return -EIO; |
597 | } | 706 | } |
598 | 707 | ||
708 | static int s630_frontend_attach(struct dvb_usb_adapter *d) | ||
709 | { | ||
710 | d->fe = dvb_attach(mt312_attach, &zl313_config, | ||
711 | &d->dev->i2c_adap); | ||
712 | if (d->fe != NULL) { | ||
713 | d->fe->ops.set_voltage = dw210x_set_voltage; | ||
714 | info("Attached zl10313!\n"); | ||
715 | return 0; | ||
716 | } | ||
717 | return -EIO; | ||
718 | } | ||
719 | |||
599 | static int dw2102_tuner_attach(struct dvb_usb_adapter *adap) | 720 | static int dw2102_tuner_attach(struct dvb_usb_adapter *adap) |
600 | { | 721 | { |
601 | dvb_attach(dvb_pll_attach, adap->fe, 0x60, | 722 | dvb_attach(dvb_pll_attach, adap->fe, 0x60, |
@@ -619,123 +740,131 @@ static int dw3101_tuner_attach(struct dvb_usb_adapter *adap) | |||
619 | return 0; | 740 | return 0; |
620 | } | 741 | } |
621 | 742 | ||
743 | static int s630_zl10039_tuner_attach(struct dvb_usb_adapter *adap) | ||
744 | { | ||
745 | dvb_attach(zl10039_attach, adap->fe, 0x60, | ||
746 | &adap->dev->i2c_adap); | ||
747 | |||
748 | return 0; | ||
749 | } | ||
750 | |||
622 | static struct dvb_usb_rc_key dw210x_rc_keys[] = { | 751 | static struct dvb_usb_rc_key dw210x_rc_keys[] = { |
623 | { 0xf8, 0x0a, KEY_Q }, /*power*/ | 752 | { 0xf80a, KEY_Q }, /*power*/ |
624 | { 0xf8, 0x0c, KEY_M }, /*mute*/ | 753 | { 0xf80c, KEY_M }, /*mute*/ |
625 | { 0xf8, 0x11, KEY_1 }, | 754 | { 0xf811, KEY_1 }, |
626 | { 0xf8, 0x12, KEY_2 }, | 755 | { 0xf812, KEY_2 }, |
627 | { 0xf8, 0x13, KEY_3 }, | 756 | { 0xf813, KEY_3 }, |
628 | { 0xf8, 0x14, KEY_4 }, | 757 | { 0xf814, KEY_4 }, |
629 | { 0xf8, 0x15, KEY_5 }, | 758 | { 0xf815, KEY_5 }, |
630 | { 0xf8, 0x16, KEY_6 }, | 759 | { 0xf816, KEY_6 }, |
631 | { 0xf8, 0x17, KEY_7 }, | 760 | { 0xf817, KEY_7 }, |
632 | { 0xf8, 0x18, KEY_8 }, | 761 | { 0xf818, KEY_8 }, |
633 | { 0xf8, 0x19, KEY_9 }, | 762 | { 0xf819, KEY_9 }, |
634 | { 0xf8, 0x10, KEY_0 }, | 763 | { 0xf810, KEY_0 }, |
635 | { 0xf8, 0x1c, KEY_PAGEUP }, /*ch+*/ | 764 | { 0xf81c, KEY_PAGEUP }, /*ch+*/ |
636 | { 0xf8, 0x0f, KEY_PAGEDOWN }, /*ch-*/ | 765 | { 0xf80f, KEY_PAGEDOWN }, /*ch-*/ |
637 | { 0xf8, 0x1a, KEY_O }, /*vol+*/ | 766 | { 0xf81a, KEY_O }, /*vol+*/ |
638 | { 0xf8, 0x0e, KEY_Z }, /*vol-*/ | 767 | { 0xf80e, KEY_Z }, /*vol-*/ |
639 | { 0xf8, 0x04, KEY_R }, /*rec*/ | 768 | { 0xf804, KEY_R }, /*rec*/ |
640 | { 0xf8, 0x09, KEY_D }, /*fav*/ | 769 | { 0xf809, KEY_D }, /*fav*/ |
641 | { 0xf8, 0x08, KEY_BACKSPACE }, /*rewind*/ | 770 | { 0xf808, KEY_BACKSPACE }, /*rewind*/ |
642 | { 0xf8, 0x07, KEY_A }, /*fast*/ | 771 | { 0xf807, KEY_A }, /*fast*/ |
643 | { 0xf8, 0x0b, KEY_P }, /*pause*/ | 772 | { 0xf80b, KEY_P }, /*pause*/ |
644 | { 0xf8, 0x02, KEY_ESC }, /*cancel*/ | 773 | { 0xf802, KEY_ESC }, /*cancel*/ |
645 | { 0xf8, 0x03, KEY_G }, /*tab*/ | 774 | { 0xf803, KEY_G }, /*tab*/ |
646 | { 0xf8, 0x00, KEY_UP }, /*up*/ | 775 | { 0xf800, KEY_UP }, /*up*/ |
647 | { 0xf8, 0x1f, KEY_ENTER }, /*ok*/ | 776 | { 0xf81f, KEY_ENTER }, /*ok*/ |
648 | { 0xf8, 0x01, KEY_DOWN }, /*down*/ | 777 | { 0xf801, KEY_DOWN }, /*down*/ |
649 | { 0xf8, 0x05, KEY_C }, /*cap*/ | 778 | { 0xf805, KEY_C }, /*cap*/ |
650 | { 0xf8, 0x06, KEY_S }, /*stop*/ | 779 | { 0xf806, KEY_S }, /*stop*/ |
651 | { 0xf8, 0x40, KEY_F }, /*full*/ | 780 | { 0xf840, KEY_F }, /*full*/ |
652 | { 0xf8, 0x1e, KEY_W }, /*tvmode*/ | 781 | { 0xf81e, KEY_W }, /*tvmode*/ |
653 | { 0xf8, 0x1b, KEY_B }, /*recall*/ | 782 | { 0xf81b, KEY_B }, /*recall*/ |
654 | }; | 783 | }; |
655 | 784 | ||
656 | static struct dvb_usb_rc_key tevii_rc_keys[] = { | 785 | static struct dvb_usb_rc_key tevii_rc_keys[] = { |
657 | { 0xf8, 0x0a, KEY_POWER }, | 786 | { 0xf80a, KEY_POWER }, |
658 | { 0xf8, 0x0c, KEY_MUTE }, | 787 | { 0xf80c, KEY_MUTE }, |
659 | { 0xf8, 0x11, KEY_1 }, | 788 | { 0xf811, KEY_1 }, |
660 | { 0xf8, 0x12, KEY_2 }, | 789 | { 0xf812, KEY_2 }, |
661 | { 0xf8, 0x13, KEY_3 }, | 790 | { 0xf813, KEY_3 }, |
662 | { 0xf8, 0x14, KEY_4 }, | 791 | { 0xf814, KEY_4 }, |
663 | { 0xf8, 0x15, KEY_5 }, | 792 | { 0xf815, KEY_5 }, |
664 | { 0xf8, 0x16, KEY_6 }, | 793 | { 0xf816, KEY_6 }, |
665 | { 0xf8, 0x17, KEY_7 }, | 794 | { 0xf817, KEY_7 }, |
666 | { 0xf8, 0x18, KEY_8 }, | 795 | { 0xf818, KEY_8 }, |
667 | { 0xf8, 0x19, KEY_9 }, | 796 | { 0xf819, KEY_9 }, |
668 | { 0xf8, 0x10, KEY_0 }, | 797 | { 0xf810, KEY_0 }, |
669 | { 0xf8, 0x1c, KEY_MENU }, | 798 | { 0xf81c, KEY_MENU }, |
670 | { 0xf8, 0x0f, KEY_VOLUMEDOWN }, | 799 | { 0xf80f, KEY_VOLUMEDOWN }, |
671 | { 0xf8, 0x1a, KEY_LAST }, | 800 | { 0xf81a, KEY_LAST }, |
672 | { 0xf8, 0x0e, KEY_OPEN }, | 801 | { 0xf80e, KEY_OPEN }, |
673 | { 0xf8, 0x04, KEY_RECORD }, | 802 | { 0xf804, KEY_RECORD }, |
674 | { 0xf8, 0x09, KEY_VOLUMEUP }, | 803 | { 0xf809, KEY_VOLUMEUP }, |
675 | { 0xf8, 0x08, KEY_CHANNELUP }, | 804 | { 0xf808, KEY_CHANNELUP }, |
676 | { 0xf8, 0x07, KEY_PVR }, | 805 | { 0xf807, KEY_PVR }, |
677 | { 0xf8, 0x0b, KEY_TIME }, | 806 | { 0xf80b, KEY_TIME }, |
678 | { 0xf8, 0x02, KEY_RIGHT }, | 807 | { 0xf802, KEY_RIGHT }, |
679 | { 0xf8, 0x03, KEY_LEFT }, | 808 | { 0xf803, KEY_LEFT }, |
680 | { 0xf8, 0x00, KEY_UP }, | 809 | { 0xf800, KEY_UP }, |
681 | { 0xf8, 0x1f, KEY_OK }, | 810 | { 0xf81f, KEY_OK }, |
682 | { 0xf8, 0x01, KEY_DOWN }, | 811 | { 0xf801, KEY_DOWN }, |
683 | { 0xf8, 0x05, KEY_TUNER }, | 812 | { 0xf805, KEY_TUNER }, |
684 | { 0xf8, 0x06, KEY_CHANNELDOWN }, | 813 | { 0xf806, KEY_CHANNELDOWN }, |
685 | { 0xf8, 0x40, KEY_PLAYPAUSE }, | 814 | { 0xf840, KEY_PLAYPAUSE }, |
686 | { 0xf8, 0x1e, KEY_REWIND }, | 815 | { 0xf81e, KEY_REWIND }, |
687 | { 0xf8, 0x1b, KEY_FAVORITES }, | 816 | { 0xf81b, KEY_FAVORITES }, |
688 | { 0xf8, 0x1d, KEY_BACK }, | 817 | { 0xf81d, KEY_BACK }, |
689 | { 0xf8, 0x4d, KEY_FASTFORWARD }, | 818 | { 0xf84d, KEY_FASTFORWARD }, |
690 | { 0xf8, 0x44, KEY_EPG }, | 819 | { 0xf844, KEY_EPG }, |
691 | { 0xf8, 0x4c, KEY_INFO }, | 820 | { 0xf84c, KEY_INFO }, |
692 | { 0xf8, 0x41, KEY_AB }, | 821 | { 0xf841, KEY_AB }, |
693 | { 0xf8, 0x43, KEY_AUDIO }, | 822 | { 0xf843, KEY_AUDIO }, |
694 | { 0xf8, 0x45, KEY_SUBTITLE }, | 823 | { 0xf845, KEY_SUBTITLE }, |
695 | { 0xf8, 0x4a, KEY_LIST }, | 824 | { 0xf84a, KEY_LIST }, |
696 | { 0xf8, 0x46, KEY_F1 }, | 825 | { 0xf846, KEY_F1 }, |
697 | { 0xf8, 0x47, KEY_F2 }, | 826 | { 0xf847, KEY_F2 }, |
698 | { 0xf8, 0x5e, KEY_F3 }, | 827 | { 0xf85e, KEY_F3 }, |
699 | { 0xf8, 0x5c, KEY_F4 }, | 828 | { 0xf85c, KEY_F4 }, |
700 | { 0xf8, 0x52, KEY_F5 }, | 829 | { 0xf852, KEY_F5 }, |
701 | { 0xf8, 0x5a, KEY_F6 }, | 830 | { 0xf85a, KEY_F6 }, |
702 | { 0xf8, 0x56, KEY_MODE }, | 831 | { 0xf856, KEY_MODE }, |
703 | { 0xf8, 0x58, KEY_SWITCHVIDEOMODE }, | 832 | { 0xf858, KEY_SWITCHVIDEOMODE }, |
704 | }; | 833 | }; |
705 | 834 | ||
706 | static struct dvb_usb_rc_key tbs_rc_keys[] = { | 835 | static struct dvb_usb_rc_key tbs_rc_keys[] = { |
707 | { 0xf8, 0x84, KEY_POWER }, | 836 | { 0xf884, KEY_POWER }, |
708 | { 0xf8, 0x94, KEY_MUTE }, | 837 | { 0xf894, KEY_MUTE }, |
709 | { 0xf8, 0x87, KEY_1 }, | 838 | { 0xf887, KEY_1 }, |
710 | { 0xf8, 0x86, KEY_2 }, | 839 | { 0xf886, KEY_2 }, |
711 | { 0xf8, 0x85, KEY_3 }, | 840 | { 0xf885, KEY_3 }, |
712 | { 0xf8, 0x8b, KEY_4 }, | 841 | { 0xf88b, KEY_4 }, |
713 | { 0xf8, 0x8a, KEY_5 }, | 842 | { 0xf88a, KEY_5 }, |
714 | { 0xf8, 0x89, KEY_6 }, | 843 | { 0xf889, KEY_6 }, |
715 | { 0xf8, 0x8f, KEY_7 }, | 844 | { 0xf88f, KEY_7 }, |
716 | { 0xf8, 0x8e, KEY_8 }, | 845 | { 0xf88e, KEY_8 }, |
717 | { 0xf8, 0x8d, KEY_9 }, | 846 | { 0xf88d, KEY_9 }, |
718 | { 0xf8, 0x92, KEY_0 }, | 847 | { 0xf892, KEY_0 }, |
719 | { 0xf8, 0x96, KEY_CHANNELUP }, | 848 | { 0xf896, KEY_CHANNELUP }, |
720 | { 0xf8, 0x91, KEY_CHANNELDOWN }, | 849 | { 0xf891, KEY_CHANNELDOWN }, |
721 | { 0xf8, 0x93, KEY_VOLUMEUP }, | 850 | { 0xf893, KEY_VOLUMEUP }, |
722 | { 0xf8, 0x8c, KEY_VOLUMEDOWN }, | 851 | { 0xf88c, KEY_VOLUMEDOWN }, |
723 | { 0xf8, 0x83, KEY_RECORD }, | 852 | { 0xf883, KEY_RECORD }, |
724 | { 0xf8, 0x98, KEY_PAUSE }, | 853 | { 0xf898, KEY_PAUSE }, |
725 | { 0xf8, 0x99, KEY_OK }, | 854 | { 0xf899, KEY_OK }, |
726 | { 0xf8, 0x9a, KEY_SHUFFLE }, | 855 | { 0xf89a, KEY_SHUFFLE }, |
727 | { 0xf8, 0x81, KEY_UP }, | 856 | { 0xf881, KEY_UP }, |
728 | { 0xf8, 0x90, KEY_LEFT }, | 857 | { 0xf890, KEY_LEFT }, |
729 | { 0xf8, 0x82, KEY_RIGHT }, | 858 | { 0xf882, KEY_RIGHT }, |
730 | { 0xf8, 0x88, KEY_DOWN }, | 859 | { 0xf888, KEY_DOWN }, |
731 | { 0xf8, 0x95, KEY_FAVORITES }, | 860 | { 0xf895, KEY_FAVORITES }, |
732 | { 0xf8, 0x97, KEY_SUBTITLE }, | 861 | { 0xf897, KEY_SUBTITLE }, |
733 | { 0xf8, 0x9d, KEY_ZOOM }, | 862 | { 0xf89d, KEY_ZOOM }, |
734 | { 0xf8, 0x9f, KEY_EXIT }, | 863 | { 0xf89f, KEY_EXIT }, |
735 | { 0xf8, 0x9e, KEY_MENU }, | 864 | { 0xf89e, KEY_MENU }, |
736 | { 0xf8, 0x9c, KEY_EPG }, | 865 | { 0xf89c, KEY_EPG }, |
737 | { 0xf8, 0x80, KEY_PREVIOUS }, | 866 | { 0xf880, KEY_PREVIOUS }, |
738 | { 0xf8, 0x9b, KEY_MODE } | 867 | { 0xf89b, KEY_MODE } |
739 | }; | 868 | }; |
740 | 869 | ||
741 | static struct dvb_usb_rc_keys_table keys_tables[] = { | 870 | static struct dvb_usb_rc_keys_table keys_tables[] = { |
@@ -763,9 +892,9 @@ static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
763 | } | 892 | } |
764 | 893 | ||
765 | *state = REMOTE_NO_KEY_PRESSED; | 894 | *state = REMOTE_NO_KEY_PRESSED; |
766 | if (dw2102_i2c_transfer(&d->i2c_adap, &msg, 1) == 1) { | 895 | if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) { |
767 | for (i = 0; i < keymap_size ; i++) { | 896 | for (i = 0; i < keymap_size ; i++) { |
768 | if (keymap[i].data == msg.buf[0]) { | 897 | if (rc5_data(&keymap[i]) == msg.buf[0]) { |
769 | *state = REMOTE_KEY_PRESSED; | 898 | *state = REMOTE_KEY_PRESSED; |
770 | *event = keymap[i].event; | 899 | *event = keymap[i].event; |
771 | break; | 900 | break; |
@@ -792,6 +921,7 @@ static struct usb_device_id dw2102_table[] = { | |||
792 | {USB_DEVICE(0x9022, USB_PID_TEVII_S650)}, | 921 | {USB_DEVICE(0x9022, USB_PID_TEVII_S650)}, |
793 | {USB_DEVICE(USB_VID_TERRATEC, USB_PID_CINERGY_S)}, | 922 | {USB_DEVICE(USB_VID_TERRATEC, USB_PID_CINERGY_S)}, |
794 | {USB_DEVICE(USB_VID_CYPRESS, USB_PID_DW3101)}, | 923 | {USB_DEVICE(USB_VID_CYPRESS, USB_PID_DW3101)}, |
924 | {USB_DEVICE(0x9022, USB_PID_TEVII_S630)}, | ||
795 | { } | 925 | { } |
796 | }; | 926 | }; |
797 | 927 | ||
@@ -806,6 +936,7 @@ static int dw2102_load_firmware(struct usb_device *dev, | |||
806 | u8 reset16[] = {0, 0, 0, 0, 0, 0, 0}; | 936 | u8 reset16[] = {0, 0, 0, 0, 0, 0, 0}; |
807 | const struct firmware *fw; | 937 | const struct firmware *fw; |
808 | const char *filename = "dvb-usb-dw2101.fw"; | 938 | const char *filename = "dvb-usb-dw2101.fw"; |
939 | |||
809 | switch (dev->descriptor.idProduct) { | 940 | switch (dev->descriptor.idProduct) { |
810 | case 0x2101: | 941 | case 0x2101: |
811 | ret = request_firmware(&fw, filename, &dev->dev); | 942 | ret = request_firmware(&fw, filename, &dev->dev); |
@@ -1053,6 +1184,48 @@ static struct dvb_usb_device_properties dw3101_properties = { | |||
1053 | } | 1184 | } |
1054 | }; | 1185 | }; |
1055 | 1186 | ||
1187 | static struct dvb_usb_device_properties s630_properties = { | ||
1188 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | ||
1189 | .usb_ctrl = DEVICE_SPECIFIC, | ||
1190 | .firmware = "dvb-usb-s630.fw", | ||
1191 | .no_reconnect = 1, | ||
1192 | |||
1193 | .i2c_algo = &s630_i2c_algo, | ||
1194 | .rc_key_map = tevii_rc_keys, | ||
1195 | .rc_key_map_size = ARRAY_SIZE(tevii_rc_keys), | ||
1196 | .rc_interval = 150, | ||
1197 | .rc_query = dw2102_rc_query, | ||
1198 | |||
1199 | .generic_bulk_ctrl_endpoint = 0x81, | ||
1200 | .num_adapters = 1, | ||
1201 | .download_firmware = dw2102_load_firmware, | ||
1202 | .read_mac_address = s630_read_mac_address, | ||
1203 | .adapter = { | ||
1204 | { | ||
1205 | .frontend_attach = s630_frontend_attach, | ||
1206 | .streaming_ctrl = NULL, | ||
1207 | .tuner_attach = s630_zl10039_tuner_attach, | ||
1208 | .stream = { | ||
1209 | .type = USB_BULK, | ||
1210 | .count = 8, | ||
1211 | .endpoint = 0x82, | ||
1212 | .u = { | ||
1213 | .bulk = { | ||
1214 | .buffersize = 4096, | ||
1215 | } | ||
1216 | } | ||
1217 | }, | ||
1218 | } | ||
1219 | }, | ||
1220 | .num_device_descs = 1, | ||
1221 | .devices = { | ||
1222 | {"TeVii S630 USB", | ||
1223 | {&dw2102_table[6], NULL}, | ||
1224 | {NULL}, | ||
1225 | }, | ||
1226 | } | ||
1227 | }; | ||
1228 | |||
1056 | static int dw2102_probe(struct usb_interface *intf, | 1229 | static int dw2102_probe(struct usb_interface *intf, |
1057 | const struct usb_device_id *id) | 1230 | const struct usb_device_id *id) |
1058 | { | 1231 | { |
@@ -1061,6 +1234,8 @@ static int dw2102_probe(struct usb_interface *intf, | |||
1061 | 0 == dvb_usb_device_init(intf, &dw2104_properties, | 1234 | 0 == dvb_usb_device_init(intf, &dw2104_properties, |
1062 | THIS_MODULE, NULL, adapter_nr) || | 1235 | THIS_MODULE, NULL, adapter_nr) || |
1063 | 0 == dvb_usb_device_init(intf, &dw3101_properties, | 1236 | 0 == dvb_usb_device_init(intf, &dw3101_properties, |
1237 | THIS_MODULE, NULL, adapter_nr) || | ||
1238 | 0 == dvb_usb_device_init(intf, &s630_properties, | ||
1064 | THIS_MODULE, NULL, adapter_nr)) { | 1239 | THIS_MODULE, NULL, adapter_nr)) { |
1065 | return 0; | 1240 | return 0; |
1066 | } | 1241 | } |
@@ -1094,6 +1269,6 @@ module_exit(dw2102_module_exit); | |||
1094 | MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by"); | 1269 | MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by"); |
1095 | MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104," | 1270 | MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104," |
1096 | " DVB-C 3101 USB2.0," | 1271 | " DVB-C 3101 USB2.0," |
1097 | " TeVii S600, S650 USB2.0 devices"); | 1272 | " TeVii S600, S630, S650 USB2.0 devices"); |
1098 | MODULE_VERSION("0.1"); | 1273 | MODULE_VERSION("0.1"); |
1099 | MODULE_LICENSE("GPL"); | 1274 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c index 54626a0dbf68..aec7a1943b66 100644 --- a/drivers/media/dvb/dvb-usb/m920x.c +++ b/drivers/media/dvb/dvb-usb/m920x.c | |||
@@ -140,7 +140,7 @@ static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
140 | goto unlock; | 140 | goto unlock; |
141 | 141 | ||
142 | for (i = 0; i < d->props.rc_key_map_size; i++) | 142 | for (i = 0; i < d->props.rc_key_map_size; i++) |
143 | if (d->props.rc_key_map[i].data == rc_state[1]) { | 143 | if (rc5_data(&d->props.rc_key_map[i]) == rc_state[1]) { |
144 | *event = d->props.rc_key_map[i].event; | 144 | *event = d->props.rc_key_map[i].event; |
145 | 145 | ||
146 | switch(rc_state[0]) { | 146 | switch(rc_state[0]) { |
@@ -562,42 +562,42 @@ static struct m920x_inits tvwalkertwin_rc_init [] = { | |||
562 | 562 | ||
563 | /* ir keymaps */ | 563 | /* ir keymaps */ |
564 | static struct dvb_usb_rc_key megasky_rc_keys [] = { | 564 | static struct dvb_usb_rc_key megasky_rc_keys [] = { |
565 | { 0x0, 0x12, KEY_POWER }, | 565 | { 0x0012, KEY_POWER }, |
566 | { 0x0, 0x1e, KEY_CYCLEWINDOWS }, /* min/max */ | 566 | { 0x001e, KEY_CYCLEWINDOWS }, /* min/max */ |
567 | { 0x0, 0x02, KEY_CHANNELUP }, | 567 | { 0x0002, KEY_CHANNELUP }, |
568 | { 0x0, 0x05, KEY_CHANNELDOWN }, | 568 | { 0x0005, KEY_CHANNELDOWN }, |
569 | { 0x0, 0x03, KEY_VOLUMEUP }, | 569 | { 0x0003, KEY_VOLUMEUP }, |
570 | { 0x0, 0x06, KEY_VOLUMEDOWN }, | 570 | { 0x0006, KEY_VOLUMEDOWN }, |
571 | { 0x0, 0x04, KEY_MUTE }, | 571 | { 0x0004, KEY_MUTE }, |
572 | { 0x0, 0x07, KEY_OK }, /* TS */ | 572 | { 0x0007, KEY_OK }, /* TS */ |
573 | { 0x0, 0x08, KEY_STOP }, | 573 | { 0x0008, KEY_STOP }, |
574 | { 0x0, 0x09, KEY_MENU }, /* swap */ | 574 | { 0x0009, KEY_MENU }, /* swap */ |
575 | { 0x0, 0x0a, KEY_REWIND }, | 575 | { 0x000a, KEY_REWIND }, |
576 | { 0x0, 0x1b, KEY_PAUSE }, | 576 | { 0x001b, KEY_PAUSE }, |
577 | { 0x0, 0x1f, KEY_FASTFORWARD }, | 577 | { 0x001f, KEY_FASTFORWARD }, |
578 | { 0x0, 0x0c, KEY_RECORD }, | 578 | { 0x000c, KEY_RECORD }, |
579 | { 0x0, 0x0d, KEY_CAMERA }, /* screenshot */ | 579 | { 0x000d, KEY_CAMERA }, /* screenshot */ |
580 | { 0x0, 0x0e, KEY_COFFEE }, /* "MTS" */ | 580 | { 0x000e, KEY_COFFEE }, /* "MTS" */ |
581 | }; | 581 | }; |
582 | 582 | ||
583 | static struct dvb_usb_rc_key tvwalkertwin_rc_keys [] = { | 583 | static struct dvb_usb_rc_key tvwalkertwin_rc_keys [] = { |
584 | { 0x0, 0x01, KEY_ZOOM }, /* Full Screen */ | 584 | { 0x0001, KEY_ZOOM }, /* Full Screen */ |
585 | { 0x0, 0x02, KEY_CAMERA }, /* snapshot */ | 585 | { 0x0002, KEY_CAMERA }, /* snapshot */ |
586 | { 0x0, 0x03, KEY_MUTE }, | 586 | { 0x0003, KEY_MUTE }, |
587 | { 0x0, 0x04, KEY_REWIND }, | 587 | { 0x0004, KEY_REWIND }, |
588 | { 0x0, 0x05, KEY_PLAYPAUSE }, /* Play/Pause */ | 588 | { 0x0005, KEY_PLAYPAUSE }, /* Play/Pause */ |
589 | { 0x0, 0x06, KEY_FASTFORWARD }, | 589 | { 0x0006, KEY_FASTFORWARD }, |
590 | { 0x0, 0x07, KEY_RECORD }, | 590 | { 0x0007, KEY_RECORD }, |
591 | { 0x0, 0x08, KEY_STOP }, | 591 | { 0x0008, KEY_STOP }, |
592 | { 0x0, 0x09, KEY_TIME }, /* Timeshift */ | 592 | { 0x0009, KEY_TIME }, /* Timeshift */ |
593 | { 0x0, 0x0c, KEY_COFFEE }, /* Recall */ | 593 | { 0x000c, KEY_COFFEE }, /* Recall */ |
594 | { 0x0, 0x0e, KEY_CHANNELUP }, | 594 | { 0x000e, KEY_CHANNELUP }, |
595 | { 0x0, 0x12, KEY_POWER }, | 595 | { 0x0012, KEY_POWER }, |
596 | { 0x0, 0x15, KEY_MENU }, /* source */ | 596 | { 0x0015, KEY_MENU }, /* source */ |
597 | { 0x0, 0x18, KEY_CYCLEWINDOWS }, /* TWIN PIP */ | 597 | { 0x0018, KEY_CYCLEWINDOWS }, /* TWIN PIP */ |
598 | { 0x0, 0x1a, KEY_CHANNELDOWN }, | 598 | { 0x001a, KEY_CHANNELDOWN }, |
599 | { 0x0, 0x1b, KEY_VOLUMEDOWN }, | 599 | { 0x001b, KEY_VOLUMEDOWN }, |
600 | { 0x0, 0x1e, KEY_VOLUMEUP }, | 600 | { 0x001e, KEY_VOLUMEUP }, |
601 | }; | 601 | }; |
602 | 602 | ||
603 | /* DVB USB Driver stuff */ | 603 | /* DVB USB Driver stuff */ |
diff --git a/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/drivers/media/dvb/dvb-usb/nova-t-usb2.c index 07fb843c7c2b..b41d66ef8325 100644 --- a/drivers/media/dvb/dvb-usb/nova-t-usb2.c +++ b/drivers/media/dvb/dvb-usb/nova-t-usb2.c | |||
@@ -22,51 +22,51 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | |||
22 | 22 | ||
23 | /* Hauppauge NOVA-T USB2 keys */ | 23 | /* Hauppauge NOVA-T USB2 keys */ |
24 | static struct dvb_usb_rc_key haupp_rc_keys [] = { | 24 | static struct dvb_usb_rc_key haupp_rc_keys [] = { |
25 | { 0x1e, 0x00, KEY_0 }, | 25 | { 0x1e00, KEY_0 }, |
26 | { 0x1e, 0x01, KEY_1 }, | 26 | { 0x1e01, KEY_1 }, |
27 | { 0x1e, 0x02, KEY_2 }, | 27 | { 0x1e02, KEY_2 }, |
28 | { 0x1e, 0x03, KEY_3 }, | 28 | { 0x1e03, KEY_3 }, |
29 | { 0x1e, 0x04, KEY_4 }, | 29 | { 0x1e04, KEY_4 }, |
30 | { 0x1e, 0x05, KEY_5 }, | 30 | { 0x1e05, KEY_5 }, |
31 | { 0x1e, 0x06, KEY_6 }, | 31 | { 0x1e06, KEY_6 }, |
32 | { 0x1e, 0x07, KEY_7 }, | 32 | { 0x1e07, KEY_7 }, |
33 | { 0x1e, 0x08, KEY_8 }, | 33 | { 0x1e08, KEY_8 }, |
34 | { 0x1e, 0x09, KEY_9 }, | 34 | { 0x1e09, KEY_9 }, |
35 | { 0x1e, 0x0a, KEY_KPASTERISK }, | 35 | { 0x1e0a, KEY_KPASTERISK }, |
36 | { 0x1e, 0x0b, KEY_RED }, | 36 | { 0x1e0b, KEY_RED }, |
37 | { 0x1e, 0x0c, KEY_RADIO }, | 37 | { 0x1e0c, KEY_RADIO }, |
38 | { 0x1e, 0x0d, KEY_MENU }, | 38 | { 0x1e0d, KEY_MENU }, |
39 | { 0x1e, 0x0e, KEY_GRAVE }, /* # */ | 39 | { 0x1e0e, KEY_GRAVE }, /* # */ |
40 | { 0x1e, 0x0f, KEY_MUTE }, | 40 | { 0x1e0f, KEY_MUTE }, |
41 | { 0x1e, 0x10, KEY_VOLUMEUP }, | 41 | { 0x1e10, KEY_VOLUMEUP }, |
42 | { 0x1e, 0x11, KEY_VOLUMEDOWN }, | 42 | { 0x1e11, KEY_VOLUMEDOWN }, |
43 | { 0x1e, 0x12, KEY_CHANNEL }, | 43 | { 0x1e12, KEY_CHANNEL }, |
44 | { 0x1e, 0x14, KEY_UP }, | 44 | { 0x1e14, KEY_UP }, |
45 | { 0x1e, 0x15, KEY_DOWN }, | 45 | { 0x1e15, KEY_DOWN }, |
46 | { 0x1e, 0x16, KEY_LEFT }, | 46 | { 0x1e16, KEY_LEFT }, |
47 | { 0x1e, 0x17, KEY_RIGHT }, | 47 | { 0x1e17, KEY_RIGHT }, |
48 | { 0x1e, 0x18, KEY_VIDEO }, | 48 | { 0x1e18, KEY_VIDEO }, |
49 | { 0x1e, 0x19, KEY_AUDIO }, | 49 | { 0x1e19, KEY_AUDIO }, |
50 | { 0x1e, 0x1a, KEY_MEDIA }, | 50 | { 0x1e1a, KEY_MEDIA }, |
51 | { 0x1e, 0x1b, KEY_EPG }, | 51 | { 0x1e1b, KEY_EPG }, |
52 | { 0x1e, 0x1c, KEY_TV }, | 52 | { 0x1e1c, KEY_TV }, |
53 | { 0x1e, 0x1e, KEY_NEXT }, | 53 | { 0x1e1e, KEY_NEXT }, |
54 | { 0x1e, 0x1f, KEY_BACK }, | 54 | { 0x1e1f, KEY_BACK }, |
55 | { 0x1e, 0x20, KEY_CHANNELUP }, | 55 | { 0x1e20, KEY_CHANNELUP }, |
56 | { 0x1e, 0x21, KEY_CHANNELDOWN }, | 56 | { 0x1e21, KEY_CHANNELDOWN }, |
57 | { 0x1e, 0x24, KEY_LAST }, /* Skip backwards */ | 57 | { 0x1e24, KEY_LAST }, /* Skip backwards */ |
58 | { 0x1e, 0x25, KEY_OK }, | 58 | { 0x1e25, KEY_OK }, |
59 | { 0x1e, 0x29, KEY_BLUE}, | 59 | { 0x1e29, KEY_BLUE}, |
60 | { 0x1e, 0x2e, KEY_GREEN }, | 60 | { 0x1e2e, KEY_GREEN }, |
61 | { 0x1e, 0x30, KEY_PAUSE }, | 61 | { 0x1e30, KEY_PAUSE }, |
62 | { 0x1e, 0x32, KEY_REWIND }, | 62 | { 0x1e32, KEY_REWIND }, |
63 | { 0x1e, 0x34, KEY_FASTFORWARD }, | 63 | { 0x1e34, KEY_FASTFORWARD }, |
64 | { 0x1e, 0x35, KEY_PLAY }, | 64 | { 0x1e35, KEY_PLAY }, |
65 | { 0x1e, 0x36, KEY_STOP }, | 65 | { 0x1e36, KEY_STOP }, |
66 | { 0x1e, 0x37, KEY_RECORD }, | 66 | { 0x1e37, KEY_RECORD }, |
67 | { 0x1e, 0x38, KEY_YELLOW }, | 67 | { 0x1e38, KEY_YELLOW }, |
68 | { 0x1e, 0x3b, KEY_GOTO }, | 68 | { 0x1e3b, KEY_GOTO }, |
69 | { 0x1e, 0x3d, KEY_POWER }, | 69 | { 0x1e3d, KEY_POWER }, |
70 | }; | 70 | }; |
71 | 71 | ||
72 | /* Firmware bug? sometimes, when a new key is pressed, the previous pressed key | 72 | /* Firmware bug? sometimes, when a new key is pressed, the previous pressed key |
@@ -92,10 +92,11 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
92 | deb_rc("raw key code 0x%02x, 0x%02x, 0x%02x to c: %02x d: %02x toggle: %d\n",key[1],key[2],key[3],custom,data,toggle); | 92 | deb_rc("raw key code 0x%02x, 0x%02x, 0x%02x to c: %02x d: %02x toggle: %d\n",key[1],key[2],key[3],custom,data,toggle); |
93 | 93 | ||
94 | for (i = 0; i < ARRAY_SIZE(haupp_rc_keys); i++) { | 94 | for (i = 0; i < ARRAY_SIZE(haupp_rc_keys); i++) { |
95 | if (haupp_rc_keys[i].data == data && | 95 | if (rc5_data(&haupp_rc_keys[i]) == data && |
96 | haupp_rc_keys[i].custom == custom) { | 96 | rc5_custom(&haupp_rc_keys[i]) == custom) { |
97 | 97 | ||
98 | deb_rc("c: %x, d: %x\n",haupp_rc_keys[i].data,haupp_rc_keys[i].custom); | 98 | deb_rc("c: %x, d: %x\n", rc5_data(&haupp_rc_keys[i]), |
99 | rc5_custom(&haupp_rc_keys[i])); | ||
99 | 100 | ||
100 | *event = haupp_rc_keys[i].event; | 101 | *event = haupp_rc_keys[i].event; |
101 | *state = REMOTE_KEY_PRESSED; | 102 | *state = REMOTE_KEY_PRESSED; |
diff --git a/drivers/media/dvb/dvb-usb/opera1.c b/drivers/media/dvb/dvb-usb/opera1.c index 7e32d11f32b0..d4e230941679 100644 --- a/drivers/media/dvb/dvb-usb/opera1.c +++ b/drivers/media/dvb/dvb-usb/opera1.c | |||
@@ -332,32 +332,32 @@ static int opera1_pid_filter_control(struct dvb_usb_adapter *adap, int onoff) | |||
332 | } | 332 | } |
333 | 333 | ||
334 | static struct dvb_usb_rc_key opera1_rc_keys[] = { | 334 | static struct dvb_usb_rc_key opera1_rc_keys[] = { |
335 | {0x5f, 0xa0, KEY_1}, | 335 | {0x5fa0, KEY_1}, |
336 | {0x51, 0xaf, KEY_2}, | 336 | {0x51af, KEY_2}, |
337 | {0x5d, 0xa2, KEY_3}, | 337 | {0x5da2, KEY_3}, |
338 | {0x41, 0xbe, KEY_4}, | 338 | {0x41be, KEY_4}, |
339 | {0x0b, 0xf5, KEY_5}, | 339 | {0x0bf5, KEY_5}, |
340 | {0x43, 0xbd, KEY_6}, | 340 | {0x43bd, KEY_6}, |
341 | {0x47, 0xb8, KEY_7}, | 341 | {0x47b8, KEY_7}, |
342 | {0x49, 0xb6, KEY_8}, | 342 | {0x49b6, KEY_8}, |
343 | {0x05, 0xfa, KEY_9}, | 343 | {0x05fa, KEY_9}, |
344 | {0x45, 0xba, KEY_0}, | 344 | {0x45ba, KEY_0}, |
345 | {0x09, 0xf6, KEY_UP}, /*chanup */ | 345 | {0x09f6, KEY_UP}, /*chanup */ |
346 | {0x1b, 0xe5, KEY_DOWN}, /*chandown */ | 346 | {0x1be5, KEY_DOWN}, /*chandown */ |
347 | {0x5d, 0xa3, KEY_LEFT}, /*voldown */ | 347 | {0x5da3, KEY_LEFT}, /*voldown */ |
348 | {0x5f, 0xa1, KEY_RIGHT}, /*volup */ | 348 | {0x5fa1, KEY_RIGHT}, /*volup */ |
349 | {0x07, 0xf8, KEY_SPACE}, /*tab */ | 349 | {0x07f8, KEY_SPACE}, /*tab */ |
350 | {0x1f, 0xe1, KEY_ENTER}, /*play ok */ | 350 | {0x1fe1, KEY_ENTER}, /*play ok */ |
351 | {0x1b, 0xe4, KEY_Z}, /*zoom */ | 351 | {0x1be4, KEY_Z}, /*zoom */ |
352 | {0x59, 0xa6, KEY_M}, /*mute */ | 352 | {0x59a6, KEY_M}, /*mute */ |
353 | {0x5b, 0xa5, KEY_F}, /*tv/f */ | 353 | {0x5ba5, KEY_F}, /*tv/f */ |
354 | {0x19, 0xe7, KEY_R}, /*rec */ | 354 | {0x19e7, KEY_R}, /*rec */ |
355 | {0x01, 0xfe, KEY_S}, /*Stop */ | 355 | {0x01fe, KEY_S}, /*Stop */ |
356 | {0x03, 0xfd, KEY_P}, /*pause */ | 356 | {0x03fd, KEY_P}, /*pause */ |
357 | {0x03, 0xfc, KEY_W}, /*<- -> */ | 357 | {0x03fc, KEY_W}, /*<- -> */ |
358 | {0x07, 0xf9, KEY_C}, /*capture */ | 358 | {0x07f9, KEY_C}, /*capture */ |
359 | {0x47, 0xb9, KEY_Q}, /*exit */ | 359 | {0x47b9, KEY_Q}, /*exit */ |
360 | {0x43, 0xbc, KEY_O}, /*power */ | 360 | {0x43bc, KEY_O}, /*power */ |
361 | 361 | ||
362 | }; | 362 | }; |
363 | 363 | ||
@@ -405,8 +405,7 @@ static int opera1_rc_query(struct dvb_usb_device *dev, u32 * event, int *state) | |||
405 | send_key = (send_key & 0xffff) | 0x0100; | 405 | send_key = (send_key & 0xffff) | 0x0100; |
406 | 406 | ||
407 | for (i = 0; i < ARRAY_SIZE(opera1_rc_keys); i++) { | 407 | for (i = 0; i < ARRAY_SIZE(opera1_rc_keys); i++) { |
408 | if ((opera1_rc_keys[i].custom * 256 + | 408 | if (rc5_scan(&opera1_rc_keys[i]) == (send_key & 0xffff)) { |
409 | opera1_rc_keys[i].data) == (send_key & 0xffff)) { | ||
410 | *state = REMOTE_KEY_PRESSED; | 409 | *state = REMOTE_KEY_PRESSED; |
411 | *event = opera1_rc_keys[i].event; | 410 | *event = opera1_rc_keys[i].event; |
412 | opst->last_key_pressed = | 411 | opst->last_key_pressed = |
diff --git a/drivers/media/dvb/dvb-usb/vp702x.c b/drivers/media/dvb/dvb-usb/vp702x.c index 986fff9a5ba8..ef4e37d9c5ff 100644 --- a/drivers/media/dvb/dvb-usb/vp702x.c +++ b/drivers/media/dvb/dvb-usb/vp702x.c | |||
@@ -175,8 +175,8 @@ static int vp702x_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | |||
175 | 175 | ||
176 | /* keys for the enclosed remote control */ | 176 | /* keys for the enclosed remote control */ |
177 | static struct dvb_usb_rc_key vp702x_rc_keys[] = { | 177 | static struct dvb_usb_rc_key vp702x_rc_keys[] = { |
178 | { 0x00, 0x01, KEY_1 }, | 178 | { 0x0001, KEY_1 }, |
179 | { 0x00, 0x02, KEY_2 }, | 179 | { 0x0002, KEY_2 }, |
180 | }; | 180 | }; |
181 | 181 | ||
182 | /* remote control stuff (does not work with my box) */ | 182 | /* remote control stuff (does not work with my box) */ |
@@ -198,7 +198,7 @@ static int vp702x_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
198 | } | 198 | } |
199 | 199 | ||
200 | for (i = 0; i < ARRAY_SIZE(vp702x_rc_keys); i++) | 200 | for (i = 0; i < ARRAY_SIZE(vp702x_rc_keys); i++) |
201 | if (vp702x_rc_keys[i].custom == key[1]) { | 201 | if (rc5_custom(&vp702x_rc_keys[i]) == key[1]) { |
202 | *state = REMOTE_KEY_PRESSED; | 202 | *state = REMOTE_KEY_PRESSED; |
203 | *event = vp702x_rc_keys[i].event; | 203 | *event = vp702x_rc_keys[i].event; |
204 | break; | 204 | break; |
diff --git a/drivers/media/dvb/dvb-usb/vp7045.c b/drivers/media/dvb/dvb-usb/vp7045.c index acb345504e0d..a59faa27912a 100644 --- a/drivers/media/dvb/dvb-usb/vp7045.c +++ b/drivers/media/dvb/dvb-usb/vp7045.c | |||
@@ -100,56 +100,56 @@ static int vp7045_power_ctrl(struct dvb_usb_device *d, int onoff) | |||
100 | /* The keymapping struct. Somehow this should be loaded to the driver, but | 100 | /* The keymapping struct. Somehow this should be loaded to the driver, but |
101 | * currently it is hardcoded. */ | 101 | * currently it is hardcoded. */ |
102 | static struct dvb_usb_rc_key vp7045_rc_keys[] = { | 102 | static struct dvb_usb_rc_key vp7045_rc_keys[] = { |
103 | { 0x00, 0x16, KEY_POWER }, | 103 | { 0x0016, KEY_POWER }, |
104 | { 0x00, 0x10, KEY_MUTE }, | 104 | { 0x0010, KEY_MUTE }, |
105 | { 0x00, 0x03, KEY_1 }, | 105 | { 0x0003, KEY_1 }, |
106 | { 0x00, 0x01, KEY_2 }, | 106 | { 0x0001, KEY_2 }, |
107 | { 0x00, 0x06, KEY_3 }, | 107 | { 0x0006, KEY_3 }, |
108 | { 0x00, 0x09, KEY_4 }, | 108 | { 0x0009, KEY_4 }, |
109 | { 0x00, 0x1d, KEY_5 }, | 109 | { 0x001d, KEY_5 }, |
110 | { 0x00, 0x1f, KEY_6 }, | 110 | { 0x001f, KEY_6 }, |
111 | { 0x00, 0x0d, KEY_7 }, | 111 | { 0x000d, KEY_7 }, |
112 | { 0x00, 0x19, KEY_8 }, | 112 | { 0x0019, KEY_8 }, |
113 | { 0x00, 0x1b, KEY_9 }, | 113 | { 0x001b, KEY_9 }, |
114 | { 0x00, 0x15, KEY_0 }, | 114 | { 0x0015, KEY_0 }, |
115 | { 0x00, 0x05, KEY_CHANNELUP }, | 115 | { 0x0005, KEY_CHANNELUP }, |
116 | { 0x00, 0x02, KEY_CHANNELDOWN }, | 116 | { 0x0002, KEY_CHANNELDOWN }, |
117 | { 0x00, 0x1e, KEY_VOLUMEUP }, | 117 | { 0x001e, KEY_VOLUMEUP }, |
118 | { 0x00, 0x0a, KEY_VOLUMEDOWN }, | 118 | { 0x000a, KEY_VOLUMEDOWN }, |
119 | { 0x00, 0x11, KEY_RECORD }, | 119 | { 0x0011, KEY_RECORD }, |
120 | { 0x00, 0x17, KEY_FAVORITES }, /* Heart symbol - Channel list. */ | 120 | { 0x0017, KEY_FAVORITES }, /* Heart symbol - Channel list. */ |
121 | { 0x00, 0x14, KEY_PLAY }, | 121 | { 0x0014, KEY_PLAY }, |
122 | { 0x00, 0x1a, KEY_STOP }, | 122 | { 0x001a, KEY_STOP }, |
123 | { 0x00, 0x40, KEY_REWIND }, | 123 | { 0x0040, KEY_REWIND }, |
124 | { 0x00, 0x12, KEY_FASTFORWARD }, | 124 | { 0x0012, KEY_FASTFORWARD }, |
125 | { 0x00, 0x0e, KEY_PREVIOUS }, /* Recall - Previous channel. */ | 125 | { 0x000e, KEY_PREVIOUS }, /* Recall - Previous channel. */ |
126 | { 0x00, 0x4c, KEY_PAUSE }, | 126 | { 0x004c, KEY_PAUSE }, |
127 | { 0x00, 0x4d, KEY_SCREEN }, /* Full screen mode. */ | 127 | { 0x004d, KEY_SCREEN }, /* Full screen mode. */ |
128 | { 0x00, 0x54, KEY_AUDIO }, /* MTS - Switch to secondary audio. */ | 128 | { 0x0054, KEY_AUDIO }, /* MTS - Switch to secondary audio. */ |
129 | { 0x00, 0x0c, KEY_CANCEL }, /* Cancel */ | 129 | { 0x000c, KEY_CANCEL }, /* Cancel */ |
130 | { 0x00, 0x1c, KEY_EPG }, /* EPG */ | 130 | { 0x001c, KEY_EPG }, /* EPG */ |
131 | { 0x00, 0x00, KEY_TAB }, /* Tab */ | 131 | { 0x0000, KEY_TAB }, /* Tab */ |
132 | { 0x00, 0x48, KEY_INFO }, /* Preview */ | 132 | { 0x0048, KEY_INFO }, /* Preview */ |
133 | { 0x00, 0x04, KEY_LIST }, /* RecordList */ | 133 | { 0x0004, KEY_LIST }, /* RecordList */ |
134 | { 0x00, 0x0f, KEY_TEXT }, /* Teletext */ | 134 | { 0x000f, KEY_TEXT }, /* Teletext */ |
135 | { 0x00, 0x41, KEY_PREVIOUSSONG }, | 135 | { 0x0041, KEY_PREVIOUSSONG }, |
136 | { 0x00, 0x42, KEY_NEXTSONG }, | 136 | { 0x0042, KEY_NEXTSONG }, |
137 | { 0x00, 0x4b, KEY_UP }, | 137 | { 0x004b, KEY_UP }, |
138 | { 0x00, 0x51, KEY_DOWN }, | 138 | { 0x0051, KEY_DOWN }, |
139 | { 0x00, 0x4e, KEY_LEFT }, | 139 | { 0x004e, KEY_LEFT }, |
140 | { 0x00, 0x52, KEY_RIGHT }, | 140 | { 0x0052, KEY_RIGHT }, |
141 | { 0x00, 0x4f, KEY_ENTER }, | 141 | { 0x004f, KEY_ENTER }, |
142 | { 0x00, 0x13, KEY_CANCEL }, | 142 | { 0x0013, KEY_CANCEL }, |
143 | { 0x00, 0x4a, KEY_CLEAR }, | 143 | { 0x004a, KEY_CLEAR }, |
144 | { 0x00, 0x54, KEY_PRINT }, /* Capture */ | 144 | { 0x0054, KEY_PRINT }, /* Capture */ |
145 | { 0x00, 0x43, KEY_SUBTITLE }, /* Subtitle/CC */ | 145 | { 0x0043, KEY_SUBTITLE }, /* Subtitle/CC */ |
146 | { 0x00, 0x08, KEY_VIDEO }, /* A/V */ | 146 | { 0x0008, KEY_VIDEO }, /* A/V */ |
147 | { 0x00, 0x07, KEY_SLEEP }, /* Hibernate */ | 147 | { 0x0007, KEY_SLEEP }, /* Hibernate */ |
148 | { 0x00, 0x45, KEY_ZOOM }, /* Zoom+ */ | 148 | { 0x0045, KEY_ZOOM }, /* Zoom+ */ |
149 | { 0x00, 0x18, KEY_RED}, | 149 | { 0x0018, KEY_RED}, |
150 | { 0x00, 0x53, KEY_GREEN}, | 150 | { 0x0053, KEY_GREEN}, |
151 | { 0x00, 0x5e, KEY_YELLOW}, | 151 | { 0x005e, KEY_YELLOW}, |
152 | { 0x00, 0x5f, KEY_BLUE} | 152 | { 0x005f, KEY_BLUE} |
153 | }; | 153 | }; |
154 | 154 | ||
155 | static int vp7045_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 155 | static int vp7045_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
@@ -166,7 +166,7 @@ static int vp7045_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
166 | } | 166 | } |
167 | 167 | ||
168 | for (i = 0; i < ARRAY_SIZE(vp7045_rc_keys); i++) | 168 | for (i = 0; i < ARRAY_SIZE(vp7045_rc_keys); i++) |
169 | if (vp7045_rc_keys[i].data == key) { | 169 | if (rc5_data(&vp7045_rc_keys[i]) == key) { |
170 | *state = REMOTE_KEY_PRESSED; | 170 | *state = REMOTE_KEY_PRESSED; |
171 | *event = vp7045_rc_keys[i].event; | 171 | *event = vp7045_rc_keys[i].event; |
172 | break; | 172 | break; |
diff --git a/drivers/media/dvb/firewire/firedtv-avc.c b/drivers/media/dvb/firewire/firedtv-avc.c index 32526f103b59..d1b67fe0f011 100644 --- a/drivers/media/dvb/firewire/firedtv-avc.c +++ b/drivers/media/dvb/firewire/firedtv-avc.c | |||
@@ -89,15 +89,33 @@ struct avc_response_frame { | |||
89 | u8 operand[509]; | 89 | u8 operand[509]; |
90 | }; | 90 | }; |
91 | 91 | ||
92 | #define AVC_DEBUG_FCP_SUBACTIONS 1 | 92 | #define AVC_DEBUG_READ_DESCRIPTOR 0x0001 |
93 | #define AVC_DEBUG_FCP_PAYLOADS 2 | 93 | #define AVC_DEBUG_DSIT 0x0002 |
94 | #define AVC_DEBUG_DSD 0x0004 | ||
95 | #define AVC_DEBUG_REGISTER_REMOTE_CONTROL 0x0008 | ||
96 | #define AVC_DEBUG_LNB_CONTROL 0x0010 | ||
97 | #define AVC_DEBUG_TUNE_QPSK 0x0020 | ||
98 | #define AVC_DEBUG_TUNE_QPSK2 0x0040 | ||
99 | #define AVC_DEBUG_HOST2CA 0x0080 | ||
100 | #define AVC_DEBUG_CA2HOST 0x0100 | ||
101 | #define AVC_DEBUG_APPLICATION_PMT 0x4000 | ||
102 | #define AVC_DEBUG_FCP_PAYLOADS 0x8000 | ||
94 | 103 | ||
95 | static int avc_debug; | 104 | static int avc_debug; |
96 | module_param_named(debug, avc_debug, int, 0644); | 105 | module_param_named(debug, avc_debug, int, 0644); |
97 | MODULE_PARM_DESC(debug, "Verbose logging (default = 0" | 106 | MODULE_PARM_DESC(debug, "Verbose logging (none = 0" |
98 | ", FCP subactions = " __stringify(AVC_DEBUG_FCP_SUBACTIONS) | 107 | ", FCP subactions" |
99 | ", FCP payloads = " __stringify(AVC_DEBUG_FCP_PAYLOADS) | 108 | ": READ DESCRIPTOR = " __stringify(AVC_DEBUG_READ_DESCRIPTOR) |
100 | ", or all = -1)"); | 109 | ", DSIT = " __stringify(AVC_DEBUG_DSIT) |
110 | ", REGISTER_REMOTE_CONTROL = " __stringify(AVC_DEBUG_REGISTER_REMOTE_CONTROL) | ||
111 | ", LNB CONTROL = " __stringify(AVC_DEBUG_LNB_CONTROL) | ||
112 | ", TUNE QPSK = " __stringify(AVC_DEBUG_TUNE_QPSK) | ||
113 | ", TUNE QPSK2 = " __stringify(AVC_DEBUG_TUNE_QPSK2) | ||
114 | ", HOST2CA = " __stringify(AVC_DEBUG_HOST2CA) | ||
115 | ", CA2HOST = " __stringify(AVC_DEBUG_CA2HOST) | ||
116 | "; Application sent PMT = " __stringify(AVC_DEBUG_APPLICATION_PMT) | ||
117 | ", FCP payloads = " __stringify(AVC_DEBUG_FCP_PAYLOADS) | ||
118 | ", or a combination, or all = -1)"); | ||
101 | 119 | ||
102 | static const char *debug_fcp_ctype(unsigned int ctype) | 120 | static const char *debug_fcp_ctype(unsigned int ctype) |
103 | { | 121 | { |
@@ -118,48 +136,70 @@ static const char *debug_fcp_opcode(unsigned int opcode, | |||
118 | const u8 *data, int length) | 136 | const u8 *data, int length) |
119 | { | 137 | { |
120 | switch (opcode) { | 138 | switch (opcode) { |
121 | case AVC_OPCODE_VENDOR: break; | 139 | case AVC_OPCODE_VENDOR: |
122 | case AVC_OPCODE_READ_DESCRIPTOR: return "ReadDescriptor"; | 140 | break; |
123 | case AVC_OPCODE_DSIT: return "DirectSelectInfo.Type"; | 141 | case AVC_OPCODE_READ_DESCRIPTOR: |
124 | case AVC_OPCODE_DSD: return "DirectSelectData"; | 142 | return avc_debug & AVC_DEBUG_READ_DESCRIPTOR ? |
125 | default: return "?"; | 143 | "ReadDescriptor" : NULL; |
144 | case AVC_OPCODE_DSIT: | ||
145 | return avc_debug & AVC_DEBUG_DSIT ? | ||
146 | "DirectSelectInfo.Type" : NULL; | ||
147 | case AVC_OPCODE_DSD: | ||
148 | return avc_debug & AVC_DEBUG_DSD ? "DirectSelectData" : NULL; | ||
149 | default: | ||
150 | return "Unknown"; | ||
126 | } | 151 | } |
127 | 152 | ||
128 | if (length < 7 || | 153 | if (length < 7 || |
129 | data[3] != SFE_VENDOR_DE_COMPANYID_0 || | 154 | data[3] != SFE_VENDOR_DE_COMPANYID_0 || |
130 | data[4] != SFE_VENDOR_DE_COMPANYID_1 || | 155 | data[4] != SFE_VENDOR_DE_COMPANYID_1 || |
131 | data[5] != SFE_VENDOR_DE_COMPANYID_2) | 156 | data[5] != SFE_VENDOR_DE_COMPANYID_2) |
132 | return "Vendor"; | 157 | return "Vendor/Unknown"; |
133 | 158 | ||
134 | switch (data[6]) { | 159 | switch (data[6]) { |
135 | case SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL: return "RegisterRC"; | 160 | case SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL: |
136 | case SFE_VENDOR_OPCODE_LNB_CONTROL: return "LNBControl"; | 161 | return avc_debug & AVC_DEBUG_REGISTER_REMOTE_CONTROL ? |
137 | case SFE_VENDOR_OPCODE_TUNE_QPSK: return "TuneQPSK"; | 162 | "RegisterRC" : NULL; |
138 | case SFE_VENDOR_OPCODE_TUNE_QPSK2: return "TuneQPSK2"; | 163 | case SFE_VENDOR_OPCODE_LNB_CONTROL: |
139 | case SFE_VENDOR_OPCODE_HOST2CA: return "Host2CA"; | 164 | return avc_debug & AVC_DEBUG_LNB_CONTROL ? "LNBControl" : NULL; |
140 | case SFE_VENDOR_OPCODE_CA2HOST: return "CA2Host"; | 165 | case SFE_VENDOR_OPCODE_TUNE_QPSK: |
166 | return avc_debug & AVC_DEBUG_TUNE_QPSK ? "TuneQPSK" : NULL; | ||
167 | case SFE_VENDOR_OPCODE_TUNE_QPSK2: | ||
168 | return avc_debug & AVC_DEBUG_TUNE_QPSK2 ? "TuneQPSK2" : NULL; | ||
169 | case SFE_VENDOR_OPCODE_HOST2CA: | ||
170 | return avc_debug & AVC_DEBUG_HOST2CA ? "Host2CA" : NULL; | ||
171 | case SFE_VENDOR_OPCODE_CA2HOST: | ||
172 | return avc_debug & AVC_DEBUG_CA2HOST ? "CA2Host" : NULL; | ||
141 | } | 173 | } |
142 | return "Vendor"; | 174 | return "Vendor/Unknown"; |
143 | } | 175 | } |
144 | 176 | ||
145 | static void debug_fcp(const u8 *data, int length) | 177 | static void debug_fcp(const u8 *data, int length) |
146 | { | 178 | { |
147 | unsigned int subunit_type, subunit_id, op; | 179 | unsigned int subunit_type, subunit_id, opcode; |
148 | const char *prefix = data[0] > 7 ? "FCP <- " : "FCP -> "; | 180 | const char *op, *prefix; |
181 | |||
182 | prefix = data[0] > 7 ? "FCP <- " : "FCP -> "; | ||
183 | subunit_type = data[1] >> 3; | ||
184 | subunit_id = data[1] & 7; | ||
185 | opcode = subunit_type == 0x1e || subunit_id == 5 ? ~0 : data[2]; | ||
186 | op = debug_fcp_opcode(opcode, data, length); | ||
149 | 187 | ||
150 | if (avc_debug & AVC_DEBUG_FCP_SUBACTIONS) { | 188 | if (op) { |
151 | subunit_type = data[1] >> 3; | ||
152 | subunit_id = data[1] & 7; | ||
153 | op = subunit_type == 0x1e || subunit_id == 5 ? ~0 : data[2]; | ||
154 | printk(KERN_INFO "%ssu=%x.%x l=%d: %-8s - %s\n", | 189 | printk(KERN_INFO "%ssu=%x.%x l=%d: %-8s - %s\n", |
155 | prefix, subunit_type, subunit_id, length, | 190 | prefix, subunit_type, subunit_id, length, |
156 | debug_fcp_ctype(data[0]), | 191 | debug_fcp_ctype(data[0]), op); |
157 | debug_fcp_opcode(op, data, length)); | 192 | if (avc_debug & AVC_DEBUG_FCP_PAYLOADS) |
193 | print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_NONE, | ||
194 | 16, 1, data, length, false); | ||
158 | } | 195 | } |
196 | } | ||
159 | 197 | ||
160 | if (avc_debug & AVC_DEBUG_FCP_PAYLOADS) | 198 | static void debug_pmt(char *msg, int length) |
161 | print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_NONE, 16, 1, | 199 | { |
162 | data, length, false); | 200 | printk(KERN_INFO "APP PMT -> l=%d\n", length); |
201 | print_hex_dump(KERN_INFO, "APP PMT -> ", DUMP_PREFIX_NONE, | ||
202 | 16, 1, msg, length, false); | ||
163 | } | 203 | } |
164 | 204 | ||
165 | static int __avc_write(struct firedtv *fdtv, | 205 | static int __avc_write(struct firedtv *fdtv, |
@@ -254,6 +294,26 @@ int avc_recv(struct firedtv *fdtv, void *data, size_t length) | |||
254 | return 0; | 294 | return 0; |
255 | } | 295 | } |
256 | 296 | ||
297 | static int add_pid_filter(struct firedtv *fdtv, u8 *operand) | ||
298 | { | ||
299 | int i, n, pos = 1; | ||
300 | |||
301 | for (i = 0, n = 0; i < 16; i++) { | ||
302 | if (test_bit(i, &fdtv->channel_active)) { | ||
303 | operand[pos++] = 0x13; /* flowfunction relay */ | ||
304 | operand[pos++] = 0x80; /* dsd_sel_spec_valid_flags -> PID */ | ||
305 | operand[pos++] = (fdtv->channel_pid[i] >> 8) & 0x1f; | ||
306 | operand[pos++] = fdtv->channel_pid[i] & 0xff; | ||
307 | operand[pos++] = 0x00; /* tableID */ | ||
308 | operand[pos++] = 0x00; /* filter_length */ | ||
309 | n++; | ||
310 | } | ||
311 | } | ||
312 | operand[0] = n; | ||
313 | |||
314 | return pos; | ||
315 | } | ||
316 | |||
257 | /* | 317 | /* |
258 | * tuning command for setting the relative LNB frequency | 318 | * tuning command for setting the relative LNB frequency |
259 | * (not supported by the AVC standard) | 319 | * (not supported by the AVC standard) |
@@ -316,7 +376,8 @@ static void avc_tuner_tuneqpsk(struct firedtv *fdtv, | |||
316 | } | 376 | } |
317 | } | 377 | } |
318 | 378 | ||
319 | static void avc_tuner_dsd_dvb_c(struct dvb_frontend_parameters *params, | 379 | static void avc_tuner_dsd_dvb_c(struct firedtv *fdtv, |
380 | struct dvb_frontend_parameters *params, | ||
320 | struct avc_command_frame *c) | 381 | struct avc_command_frame *c) |
321 | { | 382 | { |
322 | c->opcode = AVC_OPCODE_DSD; | 383 | c->opcode = AVC_OPCODE_DSD; |
@@ -378,13 +439,13 @@ static void avc_tuner_dsd_dvb_c(struct dvb_frontend_parameters *params, | |||
378 | 439 | ||
379 | c->operand[20] = 0x00; | 440 | c->operand[20] = 0x00; |
380 | c->operand[21] = 0x00; | 441 | c->operand[21] = 0x00; |
381 | /* Nr_of_dsd_sel_specs = 0 -> no PIDs are transmitted */ | ||
382 | c->operand[22] = 0x00; | ||
383 | 442 | ||
384 | c->length = 28; | 443 | /* Add PIDs to filter */ |
444 | c->length = ALIGN(22 + add_pid_filter(fdtv, &c->operand[22]) + 3, 4); | ||
385 | } | 445 | } |
386 | 446 | ||
387 | static void avc_tuner_dsd_dvb_t(struct dvb_frontend_parameters *params, | 447 | static void avc_tuner_dsd_dvb_t(struct firedtv *fdtv, |
448 | struct dvb_frontend_parameters *params, | ||
388 | struct avc_command_frame *c) | 449 | struct avc_command_frame *c) |
389 | { | 450 | { |
390 | struct dvb_ofdm_parameters *ofdm = ¶ms->u.ofdm; | 451 | struct dvb_ofdm_parameters *ofdm = ¶ms->u.ofdm; |
@@ -481,10 +542,9 @@ static void avc_tuner_dsd_dvb_t(struct dvb_frontend_parameters *params, | |||
481 | 542 | ||
482 | c->operand[15] = 0x00; /* network_ID[0] */ | 543 | c->operand[15] = 0x00; /* network_ID[0] */ |
483 | c->operand[16] = 0x00; /* network_ID[1] */ | 544 | c->operand[16] = 0x00; /* network_ID[1] */ |
484 | /* Nr_of_dsd_sel_specs = 0 -> no PIDs are transmitted */ | ||
485 | c->operand[17] = 0x00; | ||
486 | 545 | ||
487 | c->length = 24; | 546 | /* Add PIDs to filter */ |
547 | c->length = ALIGN(17 + add_pid_filter(fdtv, &c->operand[17]) + 3, 4); | ||
488 | } | 548 | } |
489 | 549 | ||
490 | int avc_tuner_dsd(struct firedtv *fdtv, | 550 | int avc_tuner_dsd(struct firedtv *fdtv, |
@@ -502,8 +562,8 @@ int avc_tuner_dsd(struct firedtv *fdtv, | |||
502 | switch (fdtv->type) { | 562 | switch (fdtv->type) { |
503 | case FIREDTV_DVB_S: | 563 | case FIREDTV_DVB_S: |
504 | case FIREDTV_DVB_S2: avc_tuner_tuneqpsk(fdtv, params, c); break; | 564 | case FIREDTV_DVB_S2: avc_tuner_tuneqpsk(fdtv, params, c); break; |
505 | case FIREDTV_DVB_C: avc_tuner_dsd_dvb_c(params, c); break; | 565 | case FIREDTV_DVB_C: avc_tuner_dsd_dvb_c(fdtv, params, c); break; |
506 | case FIREDTV_DVB_T: avc_tuner_dsd_dvb_t(params, c); break; | 566 | case FIREDTV_DVB_T: avc_tuner_dsd_dvb_t(fdtv, params, c); break; |
507 | default: | 567 | default: |
508 | BUG(); | 568 | BUG(); |
509 | } | 569 | } |
@@ -963,6 +1023,9 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length) | |||
963 | int es_info_length; | 1023 | int es_info_length; |
964 | int crc32_csum; | 1024 | int crc32_csum; |
965 | 1025 | ||
1026 | if (unlikely(avc_debug & AVC_DEBUG_APPLICATION_PMT)) | ||
1027 | debug_pmt(msg, length); | ||
1028 | |||
966 | memset(c, 0, sizeof(*c)); | 1029 | memset(c, 0, sizeof(*c)); |
967 | 1030 | ||
968 | c->ctype = AVC_CTYPE_CONTROL; | 1031 | c->ctype = AVC_CTYPE_CONTROL; |
diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig index be967ac09a39..b794e860b4e2 100644 --- a/drivers/media/dvb/frontends/Kconfig +++ b/drivers/media/dvb/frontends/Kconfig | |||
@@ -81,6 +81,13 @@ config DVB_ZL10036 | |||
81 | help | 81 | help |
82 | A DVB-S tuner module. Say Y when you want to support this frontend. | 82 | A DVB-S tuner module. Say Y when you want to support this frontend. |
83 | 83 | ||
84 | config DVB_ZL10039 | ||
85 | tristate "Zarlink ZL10039 silicon tuner" | ||
86 | depends on DVB_CORE && I2C | ||
87 | default m if DVB_FE_CUSTOMISE | ||
88 | help | ||
89 | A DVB-S tuner module. Say Y when you want to support this frontend. | ||
90 | |||
84 | config DVB_S5H1420 | 91 | config DVB_S5H1420 |
85 | tristate "Samsung S5H1420 based" | 92 | tristate "Samsung S5H1420 based" |
86 | depends on DVB_CORE && I2C | 93 | depends on DVB_CORE && I2C |
diff --git a/drivers/media/dvb/frontends/Makefile b/drivers/media/dvb/frontends/Makefile index 832473c1e512..3b49d37ab5fa 100644 --- a/drivers/media/dvb/frontends/Makefile +++ b/drivers/media/dvb/frontends/Makefile | |||
@@ -31,6 +31,7 @@ obj-$(CONFIG_DVB_SP887X) += sp887x.o | |||
31 | obj-$(CONFIG_DVB_NXT6000) += nxt6000.o | 31 | obj-$(CONFIG_DVB_NXT6000) += nxt6000.o |
32 | obj-$(CONFIG_DVB_MT352) += mt352.o | 32 | obj-$(CONFIG_DVB_MT352) += mt352.o |
33 | obj-$(CONFIG_DVB_ZL10036) += zl10036.o | 33 | obj-$(CONFIG_DVB_ZL10036) += zl10036.o |
34 | obj-$(CONFIG_DVB_ZL10039) += zl10039.o | ||
34 | obj-$(CONFIG_DVB_ZL10353) += zl10353.o | 35 | obj-$(CONFIG_DVB_ZL10353) += zl10353.o |
35 | obj-$(CONFIG_DVB_CX22702) += cx22702.o | 36 | obj-$(CONFIG_DVB_CX22702) += cx22702.o |
36 | obj-$(CONFIG_DVB_DRX397XD) += drx397xD.o | 37 | obj-$(CONFIG_DVB_DRX397XD) += drx397xD.o |
diff --git a/drivers/media/dvb/frontends/cx22700.c b/drivers/media/dvb/frontends/cx22700.c index fbd838eca268..5fbc0fc37ecd 100644 --- a/drivers/media/dvb/frontends/cx22700.c +++ b/drivers/media/dvb/frontends/cx22700.c | |||
@@ -155,7 +155,7 @@ static int cx22700_set_tps (struct cx22700_state *state, struct dvb_ofdm_paramet | |||
155 | p->hierarchy_information > HIERARCHY_4) | 155 | p->hierarchy_information > HIERARCHY_4) |
156 | return -EINVAL; | 156 | return -EINVAL; |
157 | 157 | ||
158 | if (p->bandwidth < BANDWIDTH_8_MHZ && p->bandwidth > BANDWIDTH_6_MHZ) | 158 | if (p->bandwidth < BANDWIDTH_8_MHZ || p->bandwidth > BANDWIDTH_6_MHZ) |
159 | return -EINVAL; | 159 | return -EINVAL; |
160 | 160 | ||
161 | if (p->bandwidth == BANDWIDTH_7_MHZ) | 161 | if (p->bandwidth == BANDWIDTH_7_MHZ) |
diff --git a/drivers/media/dvb/frontends/cx24113.c b/drivers/media/dvb/frontends/cx24113.c index e4fd533a427c..075b2b57cf09 100644 --- a/drivers/media/dvb/frontends/cx24113.c +++ b/drivers/media/dvb/frontends/cx24113.c | |||
@@ -303,6 +303,7 @@ static void cx24113_calc_pll_nf(struct cx24113_state *state, u16 *n, s32 *f) | |||
303 | { | 303 | { |
304 | s32 N; | 304 | s32 N; |
305 | s64 F; | 305 | s64 F; |
306 | u64 dividend; | ||
306 | u8 R, r; | 307 | u8 R, r; |
307 | u8 vcodiv; | 308 | u8 vcodiv; |
308 | u8 factor; | 309 | u8 factor; |
@@ -346,7 +347,10 @@ static void cx24113_calc_pll_nf(struct cx24113_state *state, u16 *n, s32 *f) | |||
346 | F = freq_hz; | 347 | F = freq_hz; |
347 | F *= (u64) (R * vcodiv * 262144); | 348 | F *= (u64) (R * vcodiv * 262144); |
348 | dprintk("1 N: %d, F: %lld, R: %d\n", N, (long long)F, R); | 349 | dprintk("1 N: %d, F: %lld, R: %d\n", N, (long long)F, R); |
349 | do_div(F, state->config->xtal_khz*1000 * factor * 2); | 350 | /* do_div needs an u64 as first argument */ |
351 | dividend = F; | ||
352 | do_div(dividend, state->config->xtal_khz * 1000 * factor * 2); | ||
353 | F = dividend; | ||
350 | dprintk("2 N: %d, F: %lld, R: %d\n", N, (long long)F, R); | 354 | dprintk("2 N: %d, F: %lld, R: %d\n", N, (long long)F, R); |
351 | F -= (N + 32) * 262144; | 355 | F -= (N + 32) * 262144; |
352 | 356 | ||
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c index 0592f043ea64..d8f921b6fafd 100644 --- a/drivers/media/dvb/frontends/cx24123.c +++ b/drivers/media/dvb/frontends/cx24123.c | |||
@@ -458,7 +458,7 @@ static int cx24123_set_symbolrate(struct cx24123_state *state, u32 srate) | |||
458 | /* check if symbol rate is within limits */ | 458 | /* check if symbol rate is within limits */ |
459 | if ((srate > state->frontend.ops.info.symbol_rate_max) || | 459 | if ((srate > state->frontend.ops.info.symbol_rate_max) || |
460 | (srate < state->frontend.ops.info.symbol_rate_min)) | 460 | (srate < state->frontend.ops.info.symbol_rate_min)) |
461 | return -EOPNOTSUPP;; | 461 | return -EOPNOTSUPP; |
462 | 462 | ||
463 | /* choose the sampling rate high enough for the required operation, | 463 | /* choose the sampling rate high enough for the required operation, |
464 | while optimizing the power consumed by the demodulator */ | 464 | while optimizing the power consumed by the demodulator */ |
diff --git a/drivers/media/dvb/frontends/dib0070.c b/drivers/media/dvb/frontends/dib0070.c index fe895bf7b18f..da92cbe1b8ea 100644 --- a/drivers/media/dvb/frontends/dib0070.c +++ b/drivers/media/dvb/frontends/dib0070.c | |||
@@ -167,7 +167,7 @@ static int dib0070_tune_digital(struct dvb_frontend *fe, struct dvb_frontend_par | |||
167 | break; | 167 | break; |
168 | case BAND_SBAND: | 168 | case BAND_SBAND: |
169 | LO4_SET_VCO_HFDIV(lo4, 0, 0); | 169 | LO4_SET_VCO_HFDIV(lo4, 0, 0); |
170 | LO4_SET_CTRIM(lo4, 1);; | 170 | LO4_SET_CTRIM(lo4, 1); |
171 | c = 1; | 171 | c = 1; |
172 | break; | 172 | break; |
173 | case BAND_UHF: | 173 | case BAND_UHF: |
diff --git a/drivers/media/dvb/frontends/dib7000p.c b/drivers/media/dvb/frontends/dib7000p.c index 8217e5b38f47..fc96fbf03d6d 100644 --- a/drivers/media/dvb/frontends/dib7000p.c +++ b/drivers/media/dvb/frontends/dib7000p.c | |||
@@ -883,7 +883,7 @@ static void dib7000p_spur_protect(struct dib7000p_state *state, u32 rf_khz, u32 | |||
883 | 255, 255, 255, 255, 255, 255}; | 883 | 255, 255, 255, 255, 255, 255}; |
884 | 884 | ||
885 | u32 xtal = state->cfg.bw->xtal_hz / 1000; | 885 | u32 xtal = state->cfg.bw->xtal_hz / 1000; |
886 | int f_rel = ( (rf_khz + xtal/2) / xtal) * xtal - rf_khz; | 886 | int f_rel = DIV_ROUND_CLOSEST(rf_khz, xtal) * xtal - rf_khz; |
887 | int k; | 887 | int k; |
888 | int coef_re[8],coef_im[8]; | 888 | int coef_re[8],coef_im[8]; |
889 | int bw_khz = bw; | 889 | int bw_khz = bw; |
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index 9f6349964cda..6d865d6161d7 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c | |||
@@ -389,6 +389,77 @@ static struct dvb_pll_desc dvb_pll_samsung_dtos403ih102a = { | |||
389 | } | 389 | } |
390 | }; | 390 | }; |
391 | 391 | ||
392 | /* Samsung TDTC9251DH0 DVB-T NIM, as used on AirStar 2 */ | ||
393 | static struct dvb_pll_desc dvb_pll_samsung_tdtc9251dh0 = { | ||
394 | .name = "Samsung TDTC9251DH0", | ||
395 | .min = 48000000, | ||
396 | .max = 863000000, | ||
397 | .iffreq = 36166667, | ||
398 | .count = 3, | ||
399 | .entries = { | ||
400 | { 157500000, 166667, 0xcc, 0x09 }, | ||
401 | { 443000000, 166667, 0xcc, 0x0a }, | ||
402 | { 863000000, 166667, 0xcc, 0x08 }, | ||
403 | } | ||
404 | }; | ||
405 | |||
406 | /* Samsung TBDU18132 DVB-S NIM with TSA5059 PLL, used in SkyStar2 DVB-S 2.3 */ | ||
407 | static struct dvb_pll_desc dvb_pll_samsung_tbdu18132 = { | ||
408 | .name = "Samsung TBDU18132", | ||
409 | .min = 950000, | ||
410 | .max = 2150000, /* guesses */ | ||
411 | .iffreq = 0, | ||
412 | .count = 2, | ||
413 | .entries = { | ||
414 | { 1550000, 125, 0x84, 0x82 }, | ||
415 | { 4095937, 125, 0x84, 0x80 }, | ||
416 | } | ||
417 | /* TSA5059 PLL has a 17 bit divisor rather than the 15 bits supported | ||
418 | * by this driver. The two extra bits are 0x60 in the third byte. 15 | ||
419 | * bits is enough for over 4 GHz, which is enough to cover the range | ||
420 | * of this tuner. We could use the additional divisor bits by adding | ||
421 | * more entries, e.g. | ||
422 | { 0x0ffff * 125 + 125/2, 125, 0x84 | 0x20, }, | ||
423 | { 0x17fff * 125 + 125/2, 125, 0x84 | 0x40, }, | ||
424 | { 0x1ffff * 125 + 125/2, 125, 0x84 | 0x60, }, */ | ||
425 | }; | ||
426 | |||
427 | /* Samsung TBMU24112 DVB-S NIM with SL1935 zero-IF tuner */ | ||
428 | static struct dvb_pll_desc dvb_pll_samsung_tbmu24112 = { | ||
429 | .name = "Samsung TBMU24112", | ||
430 | .min = 950000, | ||
431 | .max = 2150000, /* guesses */ | ||
432 | .iffreq = 0, | ||
433 | .count = 2, | ||
434 | .entries = { | ||
435 | { 1500000, 125, 0x84, 0x18 }, | ||
436 | { 9999999, 125, 0x84, 0x08 }, | ||
437 | } | ||
438 | }; | ||
439 | |||
440 | /* Alps TDEE4 DVB-C NIM, used on Cablestar 2 */ | ||
441 | /* byte 4 : 1 * * AGD R3 R2 R1 R0 | ||
442 | * byte 5 : C1 * RE RTS BS4 BS3 BS2 BS1 | ||
443 | * AGD = 1, R3 R2 R1 R0 = 0 1 0 1 => byte 4 = 1**10101 = 0x95 | ||
444 | * Range(MHz) C1 * RE RTS BS4 BS3 BS2 BS1 Byte 5 | ||
445 | * 47 - 153 0 * 0 0 0 0 0 1 0x01 | ||
446 | * 153 - 430 0 * 0 0 0 0 1 0 0x02 | ||
447 | * 430 - 822 0 * 0 0 1 0 0 0 0x08 | ||
448 | * 822 - 862 1 * 0 0 1 0 0 0 0x88 */ | ||
449 | static struct dvb_pll_desc dvb_pll_alps_tdee4 = { | ||
450 | .name = "ALPS TDEE4", | ||
451 | .min = 47000000, | ||
452 | .max = 862000000, | ||
453 | .iffreq = 36125000, | ||
454 | .count = 4, | ||
455 | .entries = { | ||
456 | { 153000000, 62500, 0x95, 0x01 }, | ||
457 | { 430000000, 62500, 0x95, 0x02 }, | ||
458 | { 822000000, 62500, 0x95, 0x08 }, | ||
459 | { 999999999, 62500, 0x95, 0x88 }, | ||
460 | } | ||
461 | }; | ||
462 | |||
392 | /* ----------------------------------------------------------- */ | 463 | /* ----------------------------------------------------------- */ |
393 | 464 | ||
394 | static struct dvb_pll_desc *pll_list[] = { | 465 | static struct dvb_pll_desc *pll_list[] = { |
@@ -402,11 +473,15 @@ static struct dvb_pll_desc *pll_list[] = { | |||
402 | [DVB_PLL_TUA6034] = &dvb_pll_tua6034, | 473 | [DVB_PLL_TUA6034] = &dvb_pll_tua6034, |
403 | [DVB_PLL_TDA665X] = &dvb_pll_tda665x, | 474 | [DVB_PLL_TDA665X] = &dvb_pll_tda665x, |
404 | [DVB_PLL_TDED4] = &dvb_pll_tded4, | 475 | [DVB_PLL_TDED4] = &dvb_pll_tded4, |
476 | [DVB_PLL_TDEE4] = &dvb_pll_alps_tdee4, | ||
405 | [DVB_PLL_TDHU2] = &dvb_pll_tdhu2, | 477 | [DVB_PLL_TDHU2] = &dvb_pll_tdhu2, |
406 | [DVB_PLL_SAMSUNG_TBMV] = &dvb_pll_samsung_tbmv, | 478 | [DVB_PLL_SAMSUNG_TBMV] = &dvb_pll_samsung_tbmv, |
407 | [DVB_PLL_PHILIPS_SD1878_TDA8261] = &dvb_pll_philips_sd1878_tda8261, | 479 | [DVB_PLL_PHILIPS_SD1878_TDA8261] = &dvb_pll_philips_sd1878_tda8261, |
408 | [DVB_PLL_OPERA1] = &dvb_pll_opera1, | 480 | [DVB_PLL_OPERA1] = &dvb_pll_opera1, |
409 | [DVB_PLL_SAMSUNG_DTOS403IH102A] = &dvb_pll_samsung_dtos403ih102a, | 481 | [DVB_PLL_SAMSUNG_DTOS403IH102A] = &dvb_pll_samsung_dtos403ih102a, |
482 | [DVB_PLL_SAMSUNG_TDTC9251DH0] = &dvb_pll_samsung_tdtc9251dh0, | ||
483 | [DVB_PLL_SAMSUNG_TBDU18132] = &dvb_pll_samsung_tbdu18132, | ||
484 | [DVB_PLL_SAMSUNG_TBMU24112] = &dvb_pll_samsung_tbmu24112, | ||
410 | }; | 485 | }; |
411 | 486 | ||
412 | /* ----------------------------------------------------------- */ | 487 | /* ----------------------------------------------------------- */ |
diff --git a/drivers/media/dvb/frontends/dvb-pll.h b/drivers/media/dvb/frontends/dvb-pll.h index 05239f579ccf..086964344c38 100644 --- a/drivers/media/dvb/frontends/dvb-pll.h +++ b/drivers/media/dvb/frontends/dvb-pll.h | |||
@@ -23,6 +23,10 @@ | |||
23 | #define DVB_PLL_PHILIPS_SD1878_TDA8261 12 | 23 | #define DVB_PLL_PHILIPS_SD1878_TDA8261 12 |
24 | #define DVB_PLL_OPERA1 13 | 24 | #define DVB_PLL_OPERA1 13 |
25 | #define DVB_PLL_SAMSUNG_DTOS403IH102A 14 | 25 | #define DVB_PLL_SAMSUNG_DTOS403IH102A 14 |
26 | #define DVB_PLL_SAMSUNG_TDTC9251DH0 15 | ||
27 | #define DVB_PLL_SAMSUNG_TBDU18132 16 | ||
28 | #define DVB_PLL_SAMSUNG_TBMU24112 17 | ||
29 | #define DVB_PLL_TDEE4 18 | ||
26 | 30 | ||
27 | /** | 31 | /** |
28 | * Attach a dvb-pll to the supplied frontend structure. | 32 | * Attach a dvb-pll to the supplied frontend structure. |
diff --git a/drivers/media/dvb/frontends/lgs8gxx.c b/drivers/media/dvb/frontends/lgs8gxx.c index fde27645bbed..eabcadc425d5 100644 --- a/drivers/media/dvb/frontends/lgs8gxx.c +++ b/drivers/media/dvb/frontends/lgs8gxx.c | |||
@@ -1,9 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * Support for Legend Silicon DMB-TH demodulator | 2 | * Support for Legend Silicon GB20600 (a.k.a DMB-TH) demodulator |
3 | * LGS8913, LGS8GL5 | 3 | * LGS8913, LGS8GL5, LGS8G75 |
4 | * experimental support LGS8G42, LGS8G52 | 4 | * experimental support LGS8G42, LGS8G52 |
5 | * | 5 | * |
6 | * Copyright (C) 2007,2008 David T.L. Wong <davidtlwong@gmail.com> | 6 | * Copyright (C) 2007-2009 David T.L. Wong <davidtlwong@gmail.com> |
7 | * Copyright (C) 2008 Sirius International (Hong Kong) Limited | 7 | * Copyright (C) 2008 Sirius International (Hong Kong) Limited |
8 | * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5) | 8 | * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5) |
9 | * | 9 | * |
@@ -46,6 +46,42 @@ module_param(fake_signal_str, int, 0644); | |||
46 | MODULE_PARM_DESC(fake_signal_str, "fake signal strength for LGS8913." | 46 | MODULE_PARM_DESC(fake_signal_str, "fake signal strength for LGS8913." |
47 | "Signal strength calculation is slow.(default:on)."); | 47 | "Signal strength calculation is slow.(default:on)."); |
48 | 48 | ||
49 | static const u8 lgs8g75_initdat[] = { | ||
50 | 0x01, 0x30, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||
51 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||
52 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||
53 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||
54 | 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||
55 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||
56 | 0xE4, 0xF5, 0xA8, 0xF5, 0xB8, 0xF5, 0x88, 0xF5, | ||
57 | 0x89, 0xF5, 0x87, 0x75, 0xD0, 0x00, 0x11, 0x50, | ||
58 | 0x11, 0x50, 0xF4, 0xF5, 0x80, 0xF5, 0x90, 0xF5, | ||
59 | 0xA0, 0xF5, 0xB0, 0x75, 0x81, 0x30, 0x80, 0x01, | ||
60 | 0x32, 0x90, 0x80, 0x12, 0x74, 0xFF, 0xF0, 0x90, | ||
61 | 0x80, 0x13, 0x74, 0x1F, 0xF0, 0x90, 0x80, 0x23, | ||
62 | 0x74, 0x01, 0xF0, 0x90, 0x80, 0x22, 0xF0, 0x90, | ||
63 | 0x00, 0x48, 0x74, 0x00, 0xF0, 0x90, 0x80, 0x4D, | ||
64 | 0x74, 0x05, 0xF0, 0x90, 0x80, 0x09, 0xE0, 0x60, | ||
65 | 0x21, 0x12, 0x00, 0xDD, 0x14, 0x60, 0x1B, 0x12, | ||
66 | 0x00, 0xDD, 0x14, 0x60, 0x15, 0x12, 0x00, 0xDD, | ||
67 | 0x14, 0x60, 0x0F, 0x12, 0x00, 0xDD, 0x14, 0x60, | ||
68 | 0x09, 0x12, 0x00, 0xDD, 0x14, 0x60, 0x03, 0x12, | ||
69 | 0x00, 0xDD, 0x90, 0x80, 0x42, 0xE0, 0x60, 0x0B, | ||
70 | 0x14, 0x60, 0x0C, 0x14, 0x60, 0x0D, 0x14, 0x60, | ||
71 | 0x0E, 0x01, 0xB3, 0x74, 0x04, 0x01, 0xB9, 0x74, | ||
72 | 0x05, 0x01, 0xB9, 0x74, 0x07, 0x01, 0xB9, 0x74, | ||
73 | 0x0A, 0xC0, 0xE0, 0x74, 0xC8, 0x12, 0x00, 0xE2, | ||
74 | 0xD0, 0xE0, 0x14, 0x70, 0xF4, 0x90, 0x80, 0x09, | ||
75 | 0xE0, 0x70, 0xAE, 0x12, 0x00, 0xF6, 0x12, 0x00, | ||
76 | 0xFE, 0x90, 0x00, 0x48, 0xE0, 0x04, 0xF0, 0x90, | ||
77 | 0x80, 0x4E, 0xF0, 0x01, 0x73, 0x90, 0x80, 0x08, | ||
78 | 0xF0, 0x22, 0xF8, 0x7A, 0x0C, 0x79, 0xFD, 0x00, | ||
79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD9, | ||
80 | 0xF6, 0xDA, 0xF2, 0xD8, 0xEE, 0x22, 0x90, 0x80, | ||
81 | 0x65, 0xE0, 0x54, 0xFD, 0xF0, 0x22, 0x90, 0x80, | ||
82 | 0x65, 0xE0, 0x44, 0xC2, 0xF0, 0x22 | ||
83 | }; | ||
84 | |||
49 | /* LGS8GXX internal helper functions */ | 85 | /* LGS8GXX internal helper functions */ |
50 | 86 | ||
51 | static int lgs8gxx_write_reg(struct lgs8gxx_state *priv, u8 reg, u8 data) | 87 | static int lgs8gxx_write_reg(struct lgs8gxx_state *priv, u8 reg, u8 data) |
@@ -55,7 +91,7 @@ static int lgs8gxx_write_reg(struct lgs8gxx_state *priv, u8 reg, u8 data) | |||
55 | struct i2c_msg msg = { .flags = 0, .buf = buf, .len = 2 }; | 91 | struct i2c_msg msg = { .flags = 0, .buf = buf, .len = 2 }; |
56 | 92 | ||
57 | msg.addr = priv->config->demod_address; | 93 | msg.addr = priv->config->demod_address; |
58 | if (reg >= 0xC0) | 94 | if (priv->config->prod != LGS8GXX_PROD_LGS8G75 && reg >= 0xC0) |
59 | msg.addr += 0x02; | 95 | msg.addr += 0x02; |
60 | 96 | ||
61 | if (debug >= 2) | 97 | if (debug >= 2) |
@@ -84,7 +120,7 @@ static int lgs8gxx_read_reg(struct lgs8gxx_state *priv, u8 reg, u8 *p_data) | |||
84 | }; | 120 | }; |
85 | 121 | ||
86 | dev_addr = priv->config->demod_address; | 122 | dev_addr = priv->config->demod_address; |
87 | if (reg >= 0xC0) | 123 | if (priv->config->prod != LGS8GXX_PROD_LGS8G75 && reg >= 0xC0) |
88 | dev_addr += 0x02; | 124 | dev_addr += 0x02; |
89 | msg[1].addr = msg[0].addr = dev_addr; | 125 | msg[1].addr = msg[0].addr = dev_addr; |
90 | 126 | ||
@@ -112,19 +148,36 @@ static int lgs8gxx_soft_reset(struct lgs8gxx_state *priv) | |||
112 | return 0; | 148 | return 0; |
113 | } | 149 | } |
114 | 150 | ||
151 | static int wait_reg_mask(struct lgs8gxx_state *priv, u8 reg, u8 mask, | ||
152 | u8 val, u8 delay, u8 tries) | ||
153 | { | ||
154 | u8 t; | ||
155 | int i; | ||
156 | |||
157 | for (i = 0; i < tries; i++) { | ||
158 | lgs8gxx_read_reg(priv, reg, &t); | ||
159 | |||
160 | if ((t & mask) == val) | ||
161 | return 0; | ||
162 | msleep(delay); | ||
163 | } | ||
164 | |||
165 | return 1; | ||
166 | } | ||
167 | |||
115 | static int lgs8gxx_set_ad_mode(struct lgs8gxx_state *priv) | 168 | static int lgs8gxx_set_ad_mode(struct lgs8gxx_state *priv) |
116 | { | 169 | { |
117 | const struct lgs8gxx_config *config = priv->config; | 170 | const struct lgs8gxx_config *config = priv->config; |
118 | u8 if_conf; | 171 | u8 if_conf; |
119 | 172 | ||
120 | if_conf = 0x10; /* AGC output on; */ | 173 | if_conf = 0x10; /* AGC output on, RF_AGC output off; */ |
121 | 174 | ||
122 | if_conf |= | 175 | if_conf |= |
123 | ((config->ext_adc) ? 0x80 : 0x00) | | 176 | ((config->ext_adc) ? 0x80 : 0x00) | |
124 | ((config->if_neg_center) ? 0x04 : 0x00) | | 177 | ((config->if_neg_center) ? 0x04 : 0x00) | |
125 | ((config->if_freq == 0) ? 0x08 : 0x00) | /* Baseband */ | 178 | ((config->if_freq == 0) ? 0x08 : 0x00) | /* Baseband */ |
126 | ((config->ext_adc && config->adc_signed) ? 0x02 : 0x00) | | 179 | ((config->adc_signed) ? 0x02 : 0x00) | |
127 | ((config->ext_adc && config->if_neg_edge) ? 0x01 : 0x00); | 180 | ((config->if_neg_edge) ? 0x01 : 0x00); |
128 | 181 | ||
129 | if (config->ext_adc && | 182 | if (config->ext_adc && |
130 | (config->prod == LGS8GXX_PROD_LGS8G52)) { | 183 | (config->prod == LGS8GXX_PROD_LGS8G52)) { |
@@ -157,39 +210,82 @@ static int lgs8gxx_set_if_freq(struct lgs8gxx_state *priv, u32 freq /*in kHz*/) | |||
157 | } | 210 | } |
158 | dprintk("AFC_INIT_FREQ = 0x%08X\n", v32); | 211 | dprintk("AFC_INIT_FREQ = 0x%08X\n", v32); |
159 | 212 | ||
160 | lgs8gxx_write_reg(priv, 0x09, 0xFF & (v32)); | 213 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) { |
161 | lgs8gxx_write_reg(priv, 0x0A, 0xFF & (v32 >> 8)); | 214 | lgs8gxx_write_reg(priv, 0x08, 0xFF & (v32)); |
162 | lgs8gxx_write_reg(priv, 0x0B, 0xFF & (v32 >> 16)); | 215 | lgs8gxx_write_reg(priv, 0x09, 0xFF & (v32 >> 8)); |
163 | lgs8gxx_write_reg(priv, 0x0C, 0xFF & (v32 >> 24)); | 216 | lgs8gxx_write_reg(priv, 0x0A, 0xFF & (v32 >> 16)); |
217 | lgs8gxx_write_reg(priv, 0x0B, 0xFF & (v32 >> 24)); | ||
218 | } else { | ||
219 | lgs8gxx_write_reg(priv, 0x09, 0xFF & (v32)); | ||
220 | lgs8gxx_write_reg(priv, 0x0A, 0xFF & (v32 >> 8)); | ||
221 | lgs8gxx_write_reg(priv, 0x0B, 0xFF & (v32 >> 16)); | ||
222 | lgs8gxx_write_reg(priv, 0x0C, 0xFF & (v32 >> 24)); | ||
223 | } | ||
224 | |||
225 | return 0; | ||
226 | } | ||
227 | |||
228 | static int lgs8gxx_get_afc_phase(struct lgs8gxx_state *priv) | ||
229 | { | ||
230 | u64 val; | ||
231 | u32 v32 = 0; | ||
232 | u8 reg_addr, t; | ||
233 | int i; | ||
234 | |||
235 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) | ||
236 | reg_addr = 0x23; | ||
237 | else | ||
238 | reg_addr = 0x48; | ||
239 | |||
240 | for (i = 0; i < 4; i++) { | ||
241 | lgs8gxx_read_reg(priv, reg_addr, &t); | ||
242 | v32 <<= 8; | ||
243 | v32 |= t; | ||
244 | reg_addr--; | ||
245 | } | ||
164 | 246 | ||
247 | val = v32; | ||
248 | val *= priv->config->if_clk_freq; | ||
249 | val /= (u64)1 << 32; | ||
250 | dprintk("AFC = %u kHz\n", (u32)val); | ||
165 | return 0; | 251 | return 0; |
166 | } | 252 | } |
167 | 253 | ||
168 | static int lgs8gxx_set_mode_auto(struct lgs8gxx_state *priv) | 254 | static int lgs8gxx_set_mode_auto(struct lgs8gxx_state *priv) |
169 | { | 255 | { |
170 | u8 t; | 256 | u8 t; |
257 | u8 prod = priv->config->prod; | ||
171 | 258 | ||
172 | if (priv->config->prod == LGS8GXX_PROD_LGS8913) | 259 | if (prod == LGS8GXX_PROD_LGS8913) |
173 | lgs8gxx_write_reg(priv, 0xC6, 0x01); | 260 | lgs8gxx_write_reg(priv, 0xC6, 0x01); |
174 | 261 | ||
175 | lgs8gxx_read_reg(priv, 0x7E, &t); | 262 | if (prod == LGS8GXX_PROD_LGS8G75) { |
176 | lgs8gxx_write_reg(priv, 0x7E, t | 0x01); | 263 | lgs8gxx_read_reg(priv, 0x0C, &t); |
177 | 264 | t &= (~0x04); | |
178 | /* clear FEC self reset */ | 265 | lgs8gxx_write_reg(priv, 0x0C, t | 0x80); |
179 | lgs8gxx_read_reg(priv, 0xC5, &t); | 266 | lgs8gxx_write_reg(priv, 0x39, 0x00); |
180 | lgs8gxx_write_reg(priv, 0xC5, t & 0xE0); | 267 | lgs8gxx_write_reg(priv, 0x3D, 0x04); |
268 | } else if (prod == LGS8GXX_PROD_LGS8913 || | ||
269 | prod == LGS8GXX_PROD_LGS8GL5 || | ||
270 | prod == LGS8GXX_PROD_LGS8G42 || | ||
271 | prod == LGS8GXX_PROD_LGS8G52 || | ||
272 | prod == LGS8GXX_PROD_LGS8G54) { | ||
273 | lgs8gxx_read_reg(priv, 0x7E, &t); | ||
274 | lgs8gxx_write_reg(priv, 0x7E, t | 0x01); | ||
275 | |||
276 | /* clear FEC self reset */ | ||
277 | lgs8gxx_read_reg(priv, 0xC5, &t); | ||
278 | lgs8gxx_write_reg(priv, 0xC5, t & 0xE0); | ||
279 | } | ||
181 | 280 | ||
182 | if (priv->config->prod == LGS8GXX_PROD_LGS8913) { | 281 | if (prod == LGS8GXX_PROD_LGS8913) { |
183 | /* FEC auto detect */ | 282 | /* FEC auto detect */ |
184 | lgs8gxx_write_reg(priv, 0xC1, 0x03); | 283 | lgs8gxx_write_reg(priv, 0xC1, 0x03); |
185 | 284 | ||
186 | lgs8gxx_read_reg(priv, 0x7C, &t); | 285 | lgs8gxx_read_reg(priv, 0x7C, &t); |
187 | t = (t & 0x8C) | 0x03; | 286 | t = (t & 0x8C) | 0x03; |
188 | lgs8gxx_write_reg(priv, 0x7C, t); | 287 | lgs8gxx_write_reg(priv, 0x7C, t); |
189 | } | ||
190 | |||
191 | 288 | ||
192 | if (priv->config->prod == LGS8GXX_PROD_LGS8913) { | ||
193 | /* BER test mode */ | 289 | /* BER test mode */ |
194 | lgs8gxx_read_reg(priv, 0xC3, &t); | 290 | lgs8gxx_read_reg(priv, 0xC3, &t); |
195 | t = (t & 0xEF) | 0x10; | 291 | t = (t & 0xEF) | 0x10; |
@@ -207,6 +303,32 @@ static int lgs8gxx_set_mode_manual(struct lgs8gxx_state *priv) | |||
207 | int ret = 0; | 303 | int ret = 0; |
208 | u8 t; | 304 | u8 t; |
209 | 305 | ||
306 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) { | ||
307 | u8 t2; | ||
308 | lgs8gxx_read_reg(priv, 0x0C, &t); | ||
309 | t &= (~0x80); | ||
310 | lgs8gxx_write_reg(priv, 0x0C, t); | ||
311 | |||
312 | lgs8gxx_read_reg(priv, 0x0C, &t); | ||
313 | lgs8gxx_read_reg(priv, 0x19, &t2); | ||
314 | |||
315 | if (((t&0x03) == 0x01) && (t2&0x01)) { | ||
316 | lgs8gxx_write_reg(priv, 0x6E, 0x05); | ||
317 | lgs8gxx_write_reg(priv, 0x39, 0x02); | ||
318 | lgs8gxx_write_reg(priv, 0x39, 0x03); | ||
319 | lgs8gxx_write_reg(priv, 0x3D, 0x05); | ||
320 | lgs8gxx_write_reg(priv, 0x3E, 0x28); | ||
321 | lgs8gxx_write_reg(priv, 0x53, 0x80); | ||
322 | } else { | ||
323 | lgs8gxx_write_reg(priv, 0x6E, 0x3F); | ||
324 | lgs8gxx_write_reg(priv, 0x39, 0x00); | ||
325 | lgs8gxx_write_reg(priv, 0x3D, 0x04); | ||
326 | } | ||
327 | |||
328 | lgs8gxx_soft_reset(priv); | ||
329 | return 0; | ||
330 | } | ||
331 | |||
210 | /* turn off auto-detect; manual settings */ | 332 | /* turn off auto-detect; manual settings */ |
211 | lgs8gxx_write_reg(priv, 0x7E, 0); | 333 | lgs8gxx_write_reg(priv, 0x7E, 0); |
212 | if (priv->config->prod == LGS8GXX_PROD_LGS8913) | 334 | if (priv->config->prod == LGS8GXX_PROD_LGS8913) |
@@ -226,11 +348,39 @@ static int lgs8gxx_is_locked(struct lgs8gxx_state *priv, u8 *locked) | |||
226 | int ret = 0; | 348 | int ret = 0; |
227 | u8 t; | 349 | u8 t; |
228 | 350 | ||
229 | ret = lgs8gxx_read_reg(priv, 0x4B, &t); | 351 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) |
352 | ret = lgs8gxx_read_reg(priv, 0x13, &t); | ||
353 | else | ||
354 | ret = lgs8gxx_read_reg(priv, 0x4B, &t); | ||
230 | if (ret != 0) | 355 | if (ret != 0) |
231 | return ret; | 356 | return ret; |
232 | 357 | ||
233 | *locked = ((t & 0xC0) == 0xC0) ? 1 : 0; | 358 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) |
359 | *locked = ((t & 0x80) == 0x80) ? 1 : 0; | ||
360 | else | ||
361 | *locked = ((t & 0xC0) == 0xC0) ? 1 : 0; | ||
362 | return 0; | ||
363 | } | ||
364 | |||
365 | /* Wait for Code Acquisition Lock */ | ||
366 | static int lgs8gxx_wait_ca_lock(struct lgs8gxx_state *priv, u8 *locked) | ||
367 | { | ||
368 | int ret = 0; | ||
369 | u8 reg, mask, val; | ||
370 | |||
371 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) { | ||
372 | reg = 0x13; | ||
373 | mask = 0x80; | ||
374 | val = 0x80; | ||
375 | } else { | ||
376 | reg = 0x4B; | ||
377 | mask = 0xC0; | ||
378 | val = 0xC0; | ||
379 | } | ||
380 | |||
381 | ret = wait_reg_mask(priv, reg, mask, val, 50, 40); | ||
382 | *locked = (ret == 0) ? 1 : 0; | ||
383 | |||
234 | return 0; | 384 | return 0; |
235 | } | 385 | } |
236 | 386 | ||
@@ -238,21 +388,30 @@ static int lgs8gxx_is_autodetect_finished(struct lgs8gxx_state *priv, | |||
238 | u8 *finished) | 388 | u8 *finished) |
239 | { | 389 | { |
240 | int ret = 0; | 390 | int ret = 0; |
241 | u8 t; | 391 | u8 reg, mask, val; |
242 | 392 | ||
243 | ret = lgs8gxx_read_reg(priv, 0xA4, &t); | 393 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) { |
244 | if (ret != 0) | 394 | reg = 0x1f; |
245 | return ret; | 395 | mask = 0xC0; |
396 | val = 0x80; | ||
397 | } else { | ||
398 | reg = 0xA4; | ||
399 | mask = 0x03; | ||
400 | val = 0x01; | ||
401 | } | ||
246 | 402 | ||
247 | *finished = ((t & 0x3) == 0x1) ? 1 : 0; | 403 | ret = wait_reg_mask(priv, reg, mask, val, 10, 20); |
404 | *finished = (ret == 0) ? 1 : 0; | ||
248 | 405 | ||
249 | return 0; | 406 | return 0; |
250 | } | 407 | } |
251 | 408 | ||
252 | static int lgs8gxx_autolock_gi(struct lgs8gxx_state *priv, u8 gi, u8 *locked) | 409 | static int lgs8gxx_autolock_gi(struct lgs8gxx_state *priv, u8 gi, u8 cpn, |
410 | u8 *locked) | ||
253 | { | 411 | { |
254 | int err; | 412 | int err = 0; |
255 | u8 ad_fini = 0; | 413 | u8 ad_fini = 0; |
414 | u8 t1, t2; | ||
256 | 415 | ||
257 | if (gi == GI_945) | 416 | if (gi == GI_945) |
258 | dprintk("try GI 945\n"); | 417 | dprintk("try GI 945\n"); |
@@ -260,17 +419,29 @@ static int lgs8gxx_autolock_gi(struct lgs8gxx_state *priv, u8 gi, u8 *locked) | |||
260 | dprintk("try GI 595\n"); | 419 | dprintk("try GI 595\n"); |
261 | else if (gi == GI_420) | 420 | else if (gi == GI_420) |
262 | dprintk("try GI 420\n"); | 421 | dprintk("try GI 420\n"); |
263 | lgs8gxx_write_reg(priv, 0x04, gi); | 422 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) { |
423 | lgs8gxx_read_reg(priv, 0x0C, &t1); | ||
424 | lgs8gxx_read_reg(priv, 0x18, &t2); | ||
425 | t1 &= ~(GI_MASK); | ||
426 | t1 |= gi; | ||
427 | t2 &= 0xFE; | ||
428 | t2 |= cpn ? 0x01 : 0x00; | ||
429 | lgs8gxx_write_reg(priv, 0x0C, t1); | ||
430 | lgs8gxx_write_reg(priv, 0x18, t2); | ||
431 | } else { | ||
432 | lgs8gxx_write_reg(priv, 0x04, gi); | ||
433 | } | ||
264 | lgs8gxx_soft_reset(priv); | 434 | lgs8gxx_soft_reset(priv); |
265 | msleep(50); | 435 | err = lgs8gxx_wait_ca_lock(priv, locked); |
436 | if (err || !(*locked)) | ||
437 | return err; | ||
266 | err = lgs8gxx_is_autodetect_finished(priv, &ad_fini); | 438 | err = lgs8gxx_is_autodetect_finished(priv, &ad_fini); |
267 | if (err != 0) | 439 | if (err != 0) |
268 | return err; | 440 | return err; |
269 | if (ad_fini) { | 441 | if (ad_fini) { |
270 | err = lgs8gxx_is_locked(priv, locked); | 442 | dprintk("auto detect finished\n"); |
271 | if (err != 0) | 443 | } else |
272 | return err; | 444 | *locked = 0; |
273 | } | ||
274 | 445 | ||
275 | return 0; | 446 | return 0; |
276 | } | 447 | } |
@@ -285,13 +456,18 @@ static int lgs8gxx_auto_detect(struct lgs8gxx_state *priv, | |||
285 | dprintk("%s\n", __func__); | 456 | dprintk("%s\n", __func__); |
286 | 457 | ||
287 | lgs8gxx_set_mode_auto(priv); | 458 | lgs8gxx_set_mode_auto(priv); |
288 | /* Guard Interval */ | 459 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) { |
289 | lgs8gxx_write_reg(priv, 0x03, 00); | 460 | lgs8gxx_write_reg(priv, 0x67, 0xAA); |
461 | lgs8gxx_write_reg(priv, 0x6E, 0x3F); | ||
462 | } else { | ||
463 | /* Guard Interval */ | ||
464 | lgs8gxx_write_reg(priv, 0x03, 00); | ||
465 | } | ||
290 | 466 | ||
291 | for (i = 0; i < 2; i++) { | 467 | for (i = 0; i < 2; i++) { |
292 | for (j = 0; j < 2; j++) { | 468 | for (j = 0; j < 2; j++) { |
293 | tmp_gi = GI_945; | 469 | tmp_gi = GI_945; |
294 | err = lgs8gxx_autolock_gi(priv, GI_945, &locked); | 470 | err = lgs8gxx_autolock_gi(priv, GI_945, j, &locked); |
295 | if (err) | 471 | if (err) |
296 | goto out; | 472 | goto out; |
297 | if (locked) | 473 | if (locked) |
@@ -299,14 +475,14 @@ static int lgs8gxx_auto_detect(struct lgs8gxx_state *priv, | |||
299 | } | 475 | } |
300 | for (j = 0; j < 2; j++) { | 476 | for (j = 0; j < 2; j++) { |
301 | tmp_gi = GI_420; | 477 | tmp_gi = GI_420; |
302 | err = lgs8gxx_autolock_gi(priv, GI_420, &locked); | 478 | err = lgs8gxx_autolock_gi(priv, GI_420, j, &locked); |
303 | if (err) | 479 | if (err) |
304 | goto out; | 480 | goto out; |
305 | if (locked) | 481 | if (locked) |
306 | goto locked; | 482 | goto locked; |
307 | } | 483 | } |
308 | tmp_gi = GI_595; | 484 | tmp_gi = GI_595; |
309 | err = lgs8gxx_autolock_gi(priv, GI_595, &locked); | 485 | err = lgs8gxx_autolock_gi(priv, GI_595, 1, &locked); |
310 | if (err) | 486 | if (err) |
311 | goto out; | 487 | goto out; |
312 | if (locked) | 488 | if (locked) |
@@ -317,8 +493,13 @@ locked: | |||
317 | if ((err == 0) && (locked == 1)) { | 493 | if ((err == 0) && (locked == 1)) { |
318 | u8 t; | 494 | u8 t; |
319 | 495 | ||
320 | lgs8gxx_read_reg(priv, 0xA2, &t); | 496 | if (priv->config->prod != LGS8GXX_PROD_LGS8G75) { |
321 | *detected_param = t; | 497 | lgs8gxx_read_reg(priv, 0xA2, &t); |
498 | *detected_param = t; | ||
499 | } else { | ||
500 | lgs8gxx_read_reg(priv, 0x1F, &t); | ||
501 | *detected_param = t & 0x3F; | ||
502 | } | ||
322 | 503 | ||
323 | if (tmp_gi == GI_945) | 504 | if (tmp_gi == GI_945) |
324 | dprintk("GI 945 locked\n"); | 505 | dprintk("GI 945 locked\n"); |
@@ -345,18 +526,28 @@ static void lgs8gxx_auto_lock(struct lgs8gxx_state *priv) | |||
345 | 526 | ||
346 | if (err != 0) { | 527 | if (err != 0) { |
347 | dprintk("lgs8gxx_auto_detect failed\n"); | 528 | dprintk("lgs8gxx_auto_detect failed\n"); |
348 | } | 529 | } else |
530 | dprintk("detected param = 0x%02X\n", detected_param); | ||
349 | 531 | ||
350 | /* Apply detected parameters */ | 532 | /* Apply detected parameters */ |
351 | if (priv->config->prod == LGS8GXX_PROD_LGS8913) { | 533 | if (priv->config->prod == LGS8GXX_PROD_LGS8913) { |
352 | u8 inter_leave_len = detected_param & TIM_MASK ; | 534 | u8 inter_leave_len = detected_param & TIM_MASK ; |
353 | inter_leave_len = (inter_leave_len == TIM_LONG) ? 0x60 : 0x40; | 535 | /* Fix 8913 time interleaver detection bug */ |
536 | inter_leave_len = (inter_leave_len == TIM_MIDDLE) ? 0x60 : 0x40; | ||
354 | detected_param &= CF_MASK | SC_MASK | LGS_FEC_MASK; | 537 | detected_param &= CF_MASK | SC_MASK | LGS_FEC_MASK; |
355 | detected_param |= inter_leave_len; | 538 | detected_param |= inter_leave_len; |
356 | } | 539 | } |
357 | lgs8gxx_write_reg(priv, 0x7D, detected_param); | 540 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) { |
358 | if (priv->config->prod == LGS8GXX_PROD_LGS8913) | 541 | u8 t; |
359 | lgs8gxx_write_reg(priv, 0xC0, detected_param); | 542 | lgs8gxx_read_reg(priv, 0x19, &t); |
543 | t &= 0x81; | ||
544 | t |= detected_param << 1; | ||
545 | lgs8gxx_write_reg(priv, 0x19, t); | ||
546 | } else { | ||
547 | lgs8gxx_write_reg(priv, 0x7D, detected_param); | ||
548 | if (priv->config->prod == LGS8GXX_PROD_LGS8913) | ||
549 | lgs8gxx_write_reg(priv, 0xC0, detected_param); | ||
550 | } | ||
360 | /* lgs8gxx_soft_reset(priv); */ | 551 | /* lgs8gxx_soft_reset(priv); */ |
361 | 552 | ||
362 | /* Enter manual mode */ | 553 | /* Enter manual mode */ |
@@ -378,9 +569,10 @@ static int lgs8gxx_set_mpeg_mode(struct lgs8gxx_state *priv, | |||
378 | u8 serial, u8 clk_pol, u8 clk_gated) | 569 | u8 serial, u8 clk_pol, u8 clk_gated) |
379 | { | 570 | { |
380 | int ret = 0; | 571 | int ret = 0; |
381 | u8 t; | 572 | u8 t, reg_addr; |
382 | 573 | ||
383 | ret = lgs8gxx_read_reg(priv, 0xC2, &t); | 574 | reg_addr = (priv->config->prod == LGS8GXX_PROD_LGS8G75) ? 0x30 : 0xC2; |
575 | ret = lgs8gxx_read_reg(priv, reg_addr, &t); | ||
384 | if (ret != 0) | 576 | if (ret != 0) |
385 | return ret; | 577 | return ret; |
386 | 578 | ||
@@ -389,13 +581,29 @@ static int lgs8gxx_set_mpeg_mode(struct lgs8gxx_state *priv, | |||
389 | t |= clk_pol ? TS_CLK_INVERTED : TS_CLK_NORMAL; | 581 | t |= clk_pol ? TS_CLK_INVERTED : TS_CLK_NORMAL; |
390 | t |= clk_gated ? TS_CLK_GATED : TS_CLK_FREERUN; | 582 | t |= clk_gated ? TS_CLK_GATED : TS_CLK_FREERUN; |
391 | 583 | ||
392 | ret = lgs8gxx_write_reg(priv, 0xC2, t); | 584 | ret = lgs8gxx_write_reg(priv, reg_addr, t); |
393 | if (ret != 0) | 585 | if (ret != 0) |
394 | return ret; | 586 | return ret; |
395 | 587 | ||
396 | return 0; | 588 | return 0; |
397 | } | 589 | } |
398 | 590 | ||
591 | /* A/D input peak-to-peak voltage range */ | ||
592 | static int lgs8g75_set_adc_vpp(struct lgs8gxx_state *priv, | ||
593 | u8 sel) | ||
594 | { | ||
595 | u8 r26 = 0x73, r27 = 0x90; | ||
596 | |||
597 | if (priv->config->prod != LGS8GXX_PROD_LGS8G75) | ||
598 | return 0; | ||
599 | |||
600 | r26 |= (sel & 0x01) << 7; | ||
601 | r27 |= (sel & 0x02) >> 1; | ||
602 | lgs8gxx_write_reg(priv, 0x26, r26); | ||
603 | lgs8gxx_write_reg(priv, 0x27, r27); | ||
604 | |||
605 | return 0; | ||
606 | } | ||
399 | 607 | ||
400 | /* LGS8913 demod frontend functions */ | 608 | /* LGS8913 demod frontend functions */ |
401 | 609 | ||
@@ -417,6 +625,34 @@ static int lgs8913_init(struct lgs8gxx_state *priv) | |||
417 | return 0; | 625 | return 0; |
418 | } | 626 | } |
419 | 627 | ||
628 | static int lgs8g75_init_data(struct lgs8gxx_state *priv) | ||
629 | { | ||
630 | const u8 *p = lgs8g75_initdat; | ||
631 | int i; | ||
632 | |||
633 | lgs8gxx_write_reg(priv, 0xC6, 0x40); | ||
634 | |||
635 | lgs8gxx_write_reg(priv, 0x3D, 0x04); | ||
636 | lgs8gxx_write_reg(priv, 0x39, 0x00); | ||
637 | |||
638 | lgs8gxx_write_reg(priv, 0x3A, 0x00); | ||
639 | lgs8gxx_write_reg(priv, 0x38, 0x00); | ||
640 | lgs8gxx_write_reg(priv, 0x3B, 0x00); | ||
641 | lgs8gxx_write_reg(priv, 0x38, 0x00); | ||
642 | |||
643 | for (i = 0; i < sizeof(lgs8g75_initdat); i++) { | ||
644 | lgs8gxx_write_reg(priv, 0x38, 0x00); | ||
645 | lgs8gxx_write_reg(priv, 0x3A, (u8)(i&0xff)); | ||
646 | lgs8gxx_write_reg(priv, 0x3B, (u8)(i>>8)); | ||
647 | lgs8gxx_write_reg(priv, 0x3C, *p); | ||
648 | p++; | ||
649 | } | ||
650 | |||
651 | lgs8gxx_write_reg(priv, 0x38, 0x00); | ||
652 | |||
653 | return 0; | ||
654 | } | ||
655 | |||
420 | static int lgs8gxx_init(struct dvb_frontend *fe) | 656 | static int lgs8gxx_init(struct dvb_frontend *fe) |
421 | { | 657 | { |
422 | struct lgs8gxx_state *priv = | 658 | struct lgs8gxx_state *priv = |
@@ -429,6 +665,9 @@ static int lgs8gxx_init(struct dvb_frontend *fe) | |||
429 | lgs8gxx_read_reg(priv, 0, &data); | 665 | lgs8gxx_read_reg(priv, 0, &data); |
430 | dprintk("reg 0 = 0x%02X\n", data); | 666 | dprintk("reg 0 = 0x%02X\n", data); |
431 | 667 | ||
668 | if (config->prod == LGS8GXX_PROD_LGS8G75) | ||
669 | lgs8g75_set_adc_vpp(priv, config->adc_vpp); | ||
670 | |||
432 | /* Setup MPEG output format */ | 671 | /* Setup MPEG output format */ |
433 | err = lgs8gxx_set_mpeg_mode(priv, config->serial_ts, | 672 | err = lgs8gxx_set_mpeg_mode(priv, config->serial_ts, |
434 | config->ts_clk_pol, | 673 | config->ts_clk_pol, |
@@ -439,8 +678,7 @@ static int lgs8gxx_init(struct dvb_frontend *fe) | |||
439 | if (config->prod == LGS8GXX_PROD_LGS8913) | 678 | if (config->prod == LGS8GXX_PROD_LGS8913) |
440 | lgs8913_init(priv); | 679 | lgs8913_init(priv); |
441 | lgs8gxx_set_if_freq(priv, priv->config->if_freq); | 680 | lgs8gxx_set_if_freq(priv, priv->config->if_freq); |
442 | if (config->prod != LGS8GXX_PROD_LGS8913) | 681 | lgs8gxx_set_ad_mode(priv); |
443 | lgs8gxx_set_ad_mode(priv); | ||
444 | 682 | ||
445 | return 0; | 683 | return 0; |
446 | } | 684 | } |
@@ -489,9 +727,6 @@ static int lgs8gxx_set_fe(struct dvb_frontend *fe, | |||
489 | static int lgs8gxx_get_fe(struct dvb_frontend *fe, | 727 | static int lgs8gxx_get_fe(struct dvb_frontend *fe, |
490 | struct dvb_frontend_parameters *fe_params) | 728 | struct dvb_frontend_parameters *fe_params) |
491 | { | 729 | { |
492 | struct lgs8gxx_state *priv = fe->demodulator_priv; | ||
493 | u8 t; | ||
494 | |||
495 | dprintk("%s\n", __func__); | 730 | dprintk("%s\n", __func__); |
496 | 731 | ||
497 | /* TODO: get real readings from device */ | 732 | /* TODO: get real readings from device */ |
@@ -501,29 +736,10 @@ static int lgs8gxx_get_fe(struct dvb_frontend *fe, | |||
501 | /* bandwidth */ | 736 | /* bandwidth */ |
502 | fe_params->u.ofdm.bandwidth = BANDWIDTH_8_MHZ; | 737 | fe_params->u.ofdm.bandwidth = BANDWIDTH_8_MHZ; |
503 | 738 | ||
504 | |||
505 | lgs8gxx_read_reg(priv, 0x7D, &t); | ||
506 | fe_params->u.ofdm.code_rate_HP = FEC_AUTO; | 739 | fe_params->u.ofdm.code_rate_HP = FEC_AUTO; |
507 | fe_params->u.ofdm.code_rate_LP = FEC_AUTO; | 740 | fe_params->u.ofdm.code_rate_LP = FEC_AUTO; |
508 | 741 | ||
509 | /* constellation */ | 742 | fe_params->u.ofdm.constellation = QAM_AUTO; |
510 | switch (t & SC_MASK) { | ||
511 | case SC_QAM64: | ||
512 | fe_params->u.ofdm.constellation = QAM_64; | ||
513 | break; | ||
514 | case SC_QAM32: | ||
515 | fe_params->u.ofdm.constellation = QAM_32; | ||
516 | break; | ||
517 | case SC_QAM16: | ||
518 | fe_params->u.ofdm.constellation = QAM_16; | ||
519 | break; | ||
520 | case SC_QAM4: | ||
521 | case SC_QAM4NR: | ||
522 | fe_params->u.ofdm.constellation = QPSK; | ||
523 | break; | ||
524 | default: | ||
525 | fe_params->u.ofdm.constellation = QAM_64; | ||
526 | } | ||
527 | 743 | ||
528 | /* transmission mode */ | 744 | /* transmission mode */ |
529 | fe_params->u.ofdm.transmission_mode = TRANSMISSION_MODE_AUTO; | 745 | fe_params->u.ofdm.transmission_mode = TRANSMISSION_MODE_AUTO; |
@@ -552,9 +768,19 @@ static int lgs8gxx_read_status(struct dvb_frontend *fe, fe_status_t *fe_status) | |||
552 | { | 768 | { |
553 | struct lgs8gxx_state *priv = fe->demodulator_priv; | 769 | struct lgs8gxx_state *priv = fe->demodulator_priv; |
554 | s8 ret; | 770 | s8 ret; |
555 | u8 t; | 771 | u8 t, locked = 0; |
556 | 772 | ||
557 | dprintk("%s\n", __func__); | 773 | dprintk("%s\n", __func__); |
774 | *fe_status = 0; | ||
775 | |||
776 | lgs8gxx_get_afc_phase(priv); | ||
777 | lgs8gxx_is_locked(priv, &locked); | ||
778 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) { | ||
779 | if (locked) | ||
780 | *fe_status |= FE_HAS_SIGNAL | FE_HAS_CARRIER | | ||
781 | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK; | ||
782 | return 0; | ||
783 | } | ||
558 | 784 | ||
559 | ret = lgs8gxx_read_reg(priv, 0x4B, &t); | 785 | ret = lgs8gxx_read_reg(priv, 0x4B, &t); |
560 | if (ret != 0) | 786 | if (ret != 0) |
@@ -658,12 +884,33 @@ static int lgs8913_read_signal_strength(struct lgs8gxx_state *priv, u16 *signal) | |||
658 | return 0; | 884 | return 0; |
659 | } | 885 | } |
660 | 886 | ||
887 | static int lgs8g75_read_signal_strength(struct lgs8gxx_state *priv, u16 *signal) | ||
888 | { | ||
889 | u8 t; | ||
890 | s16 v = 0; | ||
891 | |||
892 | dprintk("%s\n", __func__); | ||
893 | |||
894 | lgs8gxx_read_reg(priv, 0xB1, &t); | ||
895 | v |= t; | ||
896 | v <<= 8; | ||
897 | lgs8gxx_read_reg(priv, 0xB0, &t); | ||
898 | v |= t; | ||
899 | |||
900 | *signal = v; | ||
901 | dprintk("%s: signal=0x%02X\n", __func__, *signal); | ||
902 | |||
903 | return 0; | ||
904 | } | ||
905 | |||
661 | static int lgs8gxx_read_signal_strength(struct dvb_frontend *fe, u16 *signal) | 906 | static int lgs8gxx_read_signal_strength(struct dvb_frontend *fe, u16 *signal) |
662 | { | 907 | { |
663 | struct lgs8gxx_state *priv = fe->demodulator_priv; | 908 | struct lgs8gxx_state *priv = fe->demodulator_priv; |
664 | 909 | ||
665 | if (priv->config->prod == LGS8GXX_PROD_LGS8913) | 910 | if (priv->config->prod == LGS8GXX_PROD_LGS8913) |
666 | return lgs8913_read_signal_strength(priv, signal); | 911 | return lgs8913_read_signal_strength(priv, signal); |
912 | else if (priv->config->prod == LGS8GXX_PROD_LGS8G75) | ||
913 | return lgs8g75_read_signal_strength(priv, signal); | ||
667 | else | 914 | else |
668 | return lgs8gxx_read_signal_agc(priv, signal); | 915 | return lgs8gxx_read_signal_agc(priv, signal); |
669 | } | 916 | } |
@@ -674,7 +921,10 @@ static int lgs8gxx_read_snr(struct dvb_frontend *fe, u16 *snr) | |||
674 | u8 t; | 921 | u8 t; |
675 | *snr = 0; | 922 | *snr = 0; |
676 | 923 | ||
677 | lgs8gxx_read_reg(priv, 0x95, &t); | 924 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) |
925 | lgs8gxx_read_reg(priv, 0x34, &t); | ||
926 | else | ||
927 | lgs8gxx_read_reg(priv, 0x95, &t); | ||
678 | dprintk("AVG Noise=0x%02X\n", t); | 928 | dprintk("AVG Noise=0x%02X\n", t); |
679 | *snr = 256 - t; | 929 | *snr = 256 - t; |
680 | *snr <<= 8; | 930 | *snr <<= 8; |
@@ -690,31 +940,68 @@ static int lgs8gxx_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) | |||
690 | return 0; | 940 | return 0; |
691 | } | 941 | } |
692 | 942 | ||
943 | static void packet_counter_start(struct lgs8gxx_state *priv) | ||
944 | { | ||
945 | u8 orig, t; | ||
946 | |||
947 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) { | ||
948 | lgs8gxx_read_reg(priv, 0x30, &orig); | ||
949 | orig &= 0xE7; | ||
950 | t = orig | 0x10; | ||
951 | lgs8gxx_write_reg(priv, 0x30, t); | ||
952 | t = orig | 0x18; | ||
953 | lgs8gxx_write_reg(priv, 0x30, t); | ||
954 | t = orig | 0x10; | ||
955 | lgs8gxx_write_reg(priv, 0x30, t); | ||
956 | } else { | ||
957 | lgs8gxx_write_reg(priv, 0xC6, 0x01); | ||
958 | lgs8gxx_write_reg(priv, 0xC6, 0x41); | ||
959 | lgs8gxx_write_reg(priv, 0xC6, 0x01); | ||
960 | } | ||
961 | } | ||
962 | |||
963 | static void packet_counter_stop(struct lgs8gxx_state *priv) | ||
964 | { | ||
965 | u8 t; | ||
966 | |||
967 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) { | ||
968 | lgs8gxx_read_reg(priv, 0x30, &t); | ||
969 | t &= 0xE7; | ||
970 | lgs8gxx_write_reg(priv, 0x30, t); | ||
971 | } else { | ||
972 | lgs8gxx_write_reg(priv, 0xC6, 0x81); | ||
973 | } | ||
974 | } | ||
975 | |||
693 | static int lgs8gxx_read_ber(struct dvb_frontend *fe, u32 *ber) | 976 | static int lgs8gxx_read_ber(struct dvb_frontend *fe, u32 *ber) |
694 | { | 977 | { |
695 | struct lgs8gxx_state *priv = fe->demodulator_priv; | 978 | struct lgs8gxx_state *priv = fe->demodulator_priv; |
696 | u8 r0, r1, r2, r3; | 979 | u8 reg_err, reg_total, t; |
697 | u32 total_cnt, err_cnt; | 980 | u32 total_cnt = 0, err_cnt = 0; |
981 | int i; | ||
698 | 982 | ||
699 | dprintk("%s\n", __func__); | 983 | dprintk("%s\n", __func__); |
700 | 984 | ||
701 | lgs8gxx_write_reg(priv, 0xc6, 0x01); | 985 | packet_counter_start(priv); |
702 | lgs8gxx_write_reg(priv, 0xc6, 0x41); | ||
703 | lgs8gxx_write_reg(priv, 0xc6, 0x01); | ||
704 | |||
705 | msleep(200); | 986 | msleep(200); |
987 | packet_counter_stop(priv); | ||
988 | |||
989 | if (priv->config->prod == LGS8GXX_PROD_LGS8G75) { | ||
990 | reg_total = 0x28; reg_err = 0x2C; | ||
991 | } else { | ||
992 | reg_total = 0xD0; reg_err = 0xD4; | ||
993 | } | ||
706 | 994 | ||
707 | lgs8gxx_write_reg(priv, 0xc6, 0x81); | 995 | for (i = 0; i < 4; i++) { |
708 | lgs8gxx_read_reg(priv, 0xd0, &r0); | 996 | total_cnt <<= 8; |
709 | lgs8gxx_read_reg(priv, 0xd1, &r1); | 997 | lgs8gxx_read_reg(priv, reg_total+3-i, &t); |
710 | lgs8gxx_read_reg(priv, 0xd2, &r2); | 998 | total_cnt |= t; |
711 | lgs8gxx_read_reg(priv, 0xd3, &r3); | 999 | } |
712 | total_cnt = (r3 << 24) | (r2 << 16) | (r1 << 8) | (r0); | 1000 | for (i = 0; i < 4; i++) { |
713 | lgs8gxx_read_reg(priv, 0xd4, &r0); | 1001 | err_cnt <<= 8; |
714 | lgs8gxx_read_reg(priv, 0xd5, &r1); | 1002 | lgs8gxx_read_reg(priv, reg_err+3-i, &t); |
715 | lgs8gxx_read_reg(priv, 0xd6, &r2); | 1003 | err_cnt |= t; |
716 | lgs8gxx_read_reg(priv, 0xd7, &r3); | 1004 | } |
717 | err_cnt = (r3 << 24) | (r2 << 16) | (r1 << 8) | (r0); | ||
718 | dprintk("error=%d total=%d\n", err_cnt, total_cnt); | 1005 | dprintk("error=%d total=%d\n", err_cnt, total_cnt); |
719 | 1006 | ||
720 | if (total_cnt == 0) | 1007 | if (total_cnt == 0) |
@@ -801,6 +1088,9 @@ struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config, | |||
801 | sizeof(struct dvb_frontend_ops)); | 1088 | sizeof(struct dvb_frontend_ops)); |
802 | priv->frontend.demodulator_priv = priv; | 1089 | priv->frontend.demodulator_priv = priv; |
803 | 1090 | ||
1091 | if (config->prod == LGS8GXX_PROD_LGS8G75) | ||
1092 | lgs8g75_init_data(priv); | ||
1093 | |||
804 | return &priv->frontend; | 1094 | return &priv->frontend; |
805 | 1095 | ||
806 | error_out: | 1096 | error_out: |
diff --git a/drivers/media/dvb/frontends/lgs8gxx.h b/drivers/media/dvb/frontends/lgs8gxx.h index 321d366a8307..33c3c5e162fa 100644 --- a/drivers/media/dvb/frontends/lgs8gxx.h +++ b/drivers/media/dvb/frontends/lgs8gxx.h | |||
@@ -1,9 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * Support for Legend Silicon DMB-TH demodulator | 2 | * Support for Legend Silicon GB20600 (a.k.a DMB-TH) demodulator |
3 | * LGS8913, LGS8GL5 | 3 | * LGS8913, LGS8GL5, LGS8G75 |
4 | * experimental support LGS8G42, LGS8G52 | 4 | * experimental support LGS8G42, LGS8G52 |
5 | * | 5 | * |
6 | * Copyright (C) 2007,2008 David T.L. Wong <davidtlwong@gmail.com> | 6 | * Copyright (C) 2007-2009 David T.L. Wong <davidtlwong@gmail.com> |
7 | * Copyright (C) 2008 Sirius International (Hong Kong) Limited | 7 | * Copyright (C) 2008 Sirius International (Hong Kong) Limited |
8 | * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5) | 8 | * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5) |
9 | * | 9 | * |
@@ -34,6 +34,7 @@ | |||
34 | #define LGS8GXX_PROD_LGS8G42 3 | 34 | #define LGS8GXX_PROD_LGS8G42 3 |
35 | #define LGS8GXX_PROD_LGS8G52 4 | 35 | #define LGS8GXX_PROD_LGS8G52 4 |
36 | #define LGS8GXX_PROD_LGS8G54 5 | 36 | #define LGS8GXX_PROD_LGS8G54 5 |
37 | #define LGS8GXX_PROD_LGS8G75 6 | ||
37 | 38 | ||
38 | struct lgs8gxx_config { | 39 | struct lgs8gxx_config { |
39 | 40 | ||
@@ -70,6 +71,10 @@ struct lgs8gxx_config { | |||
70 | /*IF use Negative center frequency*/ | 71 | /*IF use Negative center frequency*/ |
71 | u8 if_neg_center; | 72 | u8 if_neg_center; |
72 | 73 | ||
74 | /*8G75 internal ADC input range selection*/ | ||
75 | /*0: 0.8Vpp, 1: 1.0Vpp, 2: 1.6Vpp, 3: 2.0Vpp*/ | ||
76 | u8 adc_vpp; | ||
77 | |||
73 | /* slave address and configuration of the tuner */ | 78 | /* slave address and configuration of the tuner */ |
74 | u8 tuner_address; | 79 | u8 tuner_address; |
75 | }; | 80 | }; |
diff --git a/drivers/media/dvb/frontends/lgs8gxx_priv.h b/drivers/media/dvb/frontends/lgs8gxx_priv.h index 9776d30686dc..8ef376f1414d 100644 --- a/drivers/media/dvb/frontends/lgs8gxx_priv.h +++ b/drivers/media/dvb/frontends/lgs8gxx_priv.h | |||
@@ -1,9 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * Support for Legend Silicon DMB-TH demodulator | 2 | * Support for Legend Silicon GB20600 (a.k.a DMB-TH) demodulator |
3 | * LGS8913, LGS8GL5 | 3 | * LGS8913, LGS8GL5, LGS8G75 |
4 | * experimental support LGS8G42, LGS8G52 | 4 | * experimental support LGS8G42, LGS8G52 |
5 | * | 5 | * |
6 | * Copyright (C) 2007,2008 David T.L. Wong <davidtlwong@gmail.com> | 6 | * Copyright (C) 2007-2009 David T.L. Wong <davidtlwong@gmail.com> |
7 | * Copyright (C) 2008 Sirius International (Hong Kong) Limited | 7 | * Copyright (C) 2008 Sirius International (Hong Kong) Limited |
8 | * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5) | 8 | * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5) |
9 | * | 9 | * |
@@ -38,7 +38,7 @@ struct lgs8gxx_state { | |||
38 | #define SC_QAM64 0x10 /* 64QAM modulation */ | 38 | #define SC_QAM64 0x10 /* 64QAM modulation */ |
39 | #define SC_QAM32 0x0C /* 32QAM modulation */ | 39 | #define SC_QAM32 0x0C /* 32QAM modulation */ |
40 | #define SC_QAM16 0x08 /* 16QAM modulation */ | 40 | #define SC_QAM16 0x08 /* 16QAM modulation */ |
41 | #define SC_QAM4NR 0x04 /* 4QAM modulation */ | 41 | #define SC_QAM4NR 0x04 /* 4QAM-NR modulation */ |
42 | #define SC_QAM4 0x00 /* 4QAM modulation */ | 42 | #define SC_QAM4 0x00 /* 4QAM modulation */ |
43 | 43 | ||
44 | #define LGS_FEC_MASK 0x03 /* FEC Rate Mask */ | 44 | #define LGS_FEC_MASK 0x03 /* FEC Rate Mask */ |
@@ -47,8 +47,8 @@ struct lgs8gxx_state { | |||
47 | #define LGS_FEC_0_8 0x02 /* FEC Rate 0.8 */ | 47 | #define LGS_FEC_0_8 0x02 /* FEC Rate 0.8 */ |
48 | 48 | ||
49 | #define TIM_MASK 0x20 /* Time Interleave Length Mask */ | 49 | #define TIM_MASK 0x20 /* Time Interleave Length Mask */ |
50 | #define TIM_LONG 0x00 /* Time Interleave Length = 720 */ | 50 | #define TIM_LONG 0x20 /* Time Interleave Length = 720 */ |
51 | #define TIM_MIDDLE 0x20 /* Time Interleave Length = 240 */ | 51 | #define TIM_MIDDLE 0x00 /* Time Interleave Length = 240 */ |
52 | 52 | ||
53 | #define CF_MASK 0x80 /* Control Frame Mask */ | 53 | #define CF_MASK 0x80 /* Control Frame Mask */ |
54 | #define CF_EN 0x80 /* Control Frame On */ | 54 | #define CF_EN 0x80 /* Control Frame On */ |
diff --git a/drivers/media/dvb/frontends/mt312.c b/drivers/media/dvb/frontends/mt312.c index f69daaac78c9..472907d43460 100644 --- a/drivers/media/dvb/frontends/mt312.c +++ b/drivers/media/dvb/frontends/mt312.c | |||
@@ -85,7 +85,7 @@ static int mt312_read(struct mt312_state *state, const enum mt312_reg_addr reg, | |||
85 | int i; | 85 | int i; |
86 | dprintk("R(%d):", reg & 0x7f); | 86 | dprintk("R(%d):", reg & 0x7f); |
87 | for (i = 0; i < count; i++) | 87 | for (i = 0; i < count; i++) |
88 | printk(" %02x", buf[i]); | 88 | printk(KERN_CONT " %02x", buf[i]); |
89 | printk("\n"); | 89 | printk("\n"); |
90 | } | 90 | } |
91 | 91 | ||
@@ -103,7 +103,7 @@ static int mt312_write(struct mt312_state *state, const enum mt312_reg_addr reg, | |||
103 | int i; | 103 | int i; |
104 | dprintk("W(%d):", reg & 0x7f); | 104 | dprintk("W(%d):", reg & 0x7f); |
105 | for (i = 0; i < count; i++) | 105 | for (i = 0; i < count; i++) |
106 | printk(" %02x", src[i]); | 106 | printk(KERN_CONT " %02x", src[i]); |
107 | printk("\n"); | 107 | printk("\n"); |
108 | } | 108 | } |
109 | 109 | ||
@@ -744,7 +744,8 @@ static struct dvb_frontend_ops mt312_ops = { | |||
744 | .type = FE_QPSK, | 744 | .type = FE_QPSK, |
745 | .frequency_min = 950000, | 745 | .frequency_min = 950000, |
746 | .frequency_max = 2150000, | 746 | .frequency_max = 2150000, |
747 | .frequency_stepsize = (MT312_PLL_CLK / 1000) / 128, /* FIXME: adjust freq to real used xtal */ | 747 | /* FIXME: adjust freq to real used xtal */ |
748 | .frequency_stepsize = (MT312_PLL_CLK / 1000) / 128, | ||
748 | .symbol_rate_min = MT312_SYS_CLK / 128, /* FIXME as above */ | 749 | .symbol_rate_min = MT312_SYS_CLK / 128, /* FIXME as above */ |
749 | .symbol_rate_max = MT312_SYS_CLK / 2, | 750 | .symbol_rate_max = MT312_SYS_CLK / 2, |
750 | .caps = | 751 | .caps = |
diff --git a/drivers/media/dvb/frontends/stb6100.c b/drivers/media/dvb/frontends/stb6100.c index 1ed5a7db4c5e..60ee18a94f43 100644 --- a/drivers/media/dvb/frontends/stb6100.c +++ b/drivers/media/dvb/frontends/stb6100.c | |||
@@ -367,7 +367,9 @@ static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency) | |||
367 | /* N(I) = floor(f(VCO) / (f(XTAL) * (PSD2 ? 2 : 1))) */ | 367 | /* N(I) = floor(f(VCO) / (f(XTAL) * (PSD2 ? 2 : 1))) */ |
368 | nint = fvco / (state->reference << psd2); | 368 | nint = fvco / (state->reference << psd2); |
369 | /* N(F) = round(f(VCO) / f(XTAL) * (PSD2 ? 2 : 1) - N(I)) * 2 ^ 9 */ | 369 | /* N(F) = round(f(VCO) / f(XTAL) * (PSD2 ? 2 : 1) - N(I)) * 2 ^ 9 */ |
370 | nfrac = (((fvco - (nint * state->reference << psd2)) << (9 - psd2)) + state->reference / 2) / state->reference; | 370 | nfrac = DIV_ROUND_CLOSEST((fvco - (nint * state->reference << psd2)) |
371 | << (9 - psd2), | ||
372 | state->reference); | ||
371 | dprintk(verbose, FE_DEBUG, 1, | 373 | dprintk(verbose, FE_DEBUG, 1, |
372 | "frequency = %u, srate = %u, g = %u, odiv = %u, psd2 = %u, fxtal = %u, osm = %u, fvco = %u, N(I) = %u, N(F) = %u", | 374 | "frequency = %u, srate = %u, g = %u, odiv = %u, psd2 = %u, fxtal = %u, osm = %u, fvco = %u, N(I) = %u, N(F) = %u", |
373 | frequency, srate, (unsigned int)g, (unsigned int)odiv, | 375 | frequency, srate, (unsigned int)g, (unsigned int)odiv, |
diff --git a/drivers/media/dvb/frontends/stv0900_core.c b/drivers/media/dvb/frontends/stv0900_core.c index 1da045fbb4ef..3bde3324a032 100644 --- a/drivers/media/dvb/frontends/stv0900_core.c +++ b/drivers/media/dvb/frontends/stv0900_core.c | |||
@@ -230,8 +230,8 @@ enum fe_stv0900_error stv0900_initialize(struct stv0900_internal *i_params) | |||
230 | stv0900_write_reg(i_params, R0900_P2_DMDISTATE, 0x5c); | 230 | stv0900_write_reg(i_params, R0900_P2_DMDISTATE, 0x5c); |
231 | stv0900_write_reg(i_params, R0900_P1_TNRCFG, 0x6c); | 231 | stv0900_write_reg(i_params, R0900_P1_TNRCFG, 0x6c); |
232 | stv0900_write_reg(i_params, R0900_P2_TNRCFG, 0x6f); | 232 | stv0900_write_reg(i_params, R0900_P2_TNRCFG, 0x6f); |
233 | stv0900_write_reg(i_params, R0900_P1_I2CRPT, 0x24); | 233 | stv0900_write_reg(i_params, R0900_P1_I2CRPT, 0x20); |
234 | stv0900_write_reg(i_params, R0900_P2_I2CRPT, 0x24); | 234 | stv0900_write_reg(i_params, R0900_P2_I2CRPT, 0x20); |
235 | stv0900_write_reg(i_params, R0900_NCOARSE, 0x13); | 235 | stv0900_write_reg(i_params, R0900_NCOARSE, 0x13); |
236 | msleep(3); | 236 | msleep(3); |
237 | stv0900_write_reg(i_params, R0900_I2CCFG, 0x08); | 237 | stv0900_write_reg(i_params, R0900_I2CCFG, 0x08); |
@@ -370,8 +370,8 @@ static int stv0900_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) | |||
370 | u32 fi2c; | 370 | u32 fi2c; |
371 | 371 | ||
372 | dmd_reg(fi2c, F0900_P1_I2CT_ON, F0900_P2_I2CT_ON); | 372 | dmd_reg(fi2c, F0900_P1_I2CT_ON, F0900_P2_I2CT_ON); |
373 | if (enable) | 373 | |
374 | stv0900_write_bits(i_params, fi2c, 1); | 374 | stv0900_write_bits(i_params, fi2c, enable); |
375 | 375 | ||
376 | return 0; | 376 | return 0; |
377 | } | 377 | } |
diff --git a/drivers/media/dvb/frontends/stv0900_sw.c b/drivers/media/dvb/frontends/stv0900_sw.c index a5a31536cbcb..962fde1437ce 100644 --- a/drivers/media/dvb/frontends/stv0900_sw.c +++ b/drivers/media/dvb/frontends/stv0900_sw.c | |||
@@ -1721,7 +1721,7 @@ static enum fe_stv0900_signal_type stv0900_dvbs1_acq_workaround(struct dvb_front | |||
1721 | 1721 | ||
1722 | s32 srate, demod_timeout, | 1722 | s32 srate, demod_timeout, |
1723 | fec_timeout, freq1, freq0; | 1723 | fec_timeout, freq1, freq0; |
1724 | enum fe_stv0900_signal_type signal_type = STV0900_NODATA;; | 1724 | enum fe_stv0900_signal_type signal_type = STV0900_NODATA; |
1725 | 1725 | ||
1726 | switch (demod) { | 1726 | switch (demod) { |
1727 | case STV0900_DEMOD_1: | 1727 | case STV0900_DEMOD_1: |
diff --git a/drivers/media/dvb/frontends/stv6110.c b/drivers/media/dvb/frontends/stv6110.c index 70efac869d28..dcf1b21ea974 100644 --- a/drivers/media/dvb/frontends/stv6110.c +++ b/drivers/media/dvb/frontends/stv6110.c | |||
@@ -36,6 +36,7 @@ struct stv6110_priv { | |||
36 | struct i2c_adapter *i2c; | 36 | struct i2c_adapter *i2c; |
37 | 37 | ||
38 | u32 mclk; | 38 | u32 mclk; |
39 | u8 clk_div; | ||
39 | u8 regs[8]; | 40 | u8 regs[8]; |
40 | }; | 41 | }; |
41 | 42 | ||
@@ -100,35 +101,25 @@ static int stv6110_read_regs(struct dvb_frontend *fe, u8 regs[], | |||
100 | struct stv6110_priv *priv = fe->tuner_priv; | 101 | struct stv6110_priv *priv = fe->tuner_priv; |
101 | int rc; | 102 | int rc; |
102 | u8 reg[] = { start }; | 103 | u8 reg[] = { start }; |
103 | struct i2c_msg msg_wr = { | 104 | struct i2c_msg msg[] = { |
104 | .addr = priv->i2c_address, | 105 | { |
105 | .flags = 0, | 106 | .addr = priv->i2c_address, |
106 | .buf = reg, | 107 | .flags = 0, |
107 | .len = 1, | 108 | .buf = reg, |
109 | .len = 1, | ||
110 | }, { | ||
111 | .addr = priv->i2c_address, | ||
112 | .flags = I2C_M_RD, | ||
113 | .buf = regs, | ||
114 | .len = len, | ||
115 | }, | ||
108 | }; | 116 | }; |
109 | 117 | ||
110 | struct i2c_msg msg_rd = { | ||
111 | .addr = priv->i2c_address, | ||
112 | .flags = I2C_M_RD, | ||
113 | .buf = regs, | ||
114 | .len = len, | ||
115 | }; | ||
116 | /* write subaddr */ | ||
117 | if (fe->ops.i2c_gate_ctrl) | 118 | if (fe->ops.i2c_gate_ctrl) |
118 | fe->ops.i2c_gate_ctrl(fe, 1); | 119 | fe->ops.i2c_gate_ctrl(fe, 1); |
119 | 120 | ||
120 | rc = i2c_transfer(priv->i2c, &msg_wr, 1); | 121 | rc = i2c_transfer(priv->i2c, msg, 2); |
121 | if (rc != 1) | 122 | if (rc != 2) |
122 | dprintk("%s: i2c error\n", __func__); | ||
123 | |||
124 | if (fe->ops.i2c_gate_ctrl) | ||
125 | fe->ops.i2c_gate_ctrl(fe, 0); | ||
126 | /* read registers */ | ||
127 | if (fe->ops.i2c_gate_ctrl) | ||
128 | fe->ops.i2c_gate_ctrl(fe, 1); | ||
129 | |||
130 | rc = i2c_transfer(priv->i2c, &msg_rd, 1); | ||
131 | if (rc != 1) | ||
132 | dprintk("%s: i2c error\n", __func__); | 123 | dprintk("%s: i2c error\n", __func__); |
133 | 124 | ||
134 | if (fe->ops.i2c_gate_ctrl) | 125 | if (fe->ops.i2c_gate_ctrl) |
@@ -221,6 +212,10 @@ static int stv6110_init(struct dvb_frontend *fe) | |||
221 | priv->regs[RSTV6110_CTRL1] |= | 212 | priv->regs[RSTV6110_CTRL1] |= |
222 | ((((priv->mclk / 1000000) - 16) & 0x1f) << 3); | 213 | ((((priv->mclk / 1000000) - 16) & 0x1f) << 3); |
223 | 214 | ||
215 | /* divisor value for the output clock */ | ||
216 | priv->regs[RSTV6110_CTRL2] &= ~0xc0; | ||
217 | priv->regs[RSTV6110_CTRL2] |= (priv->clk_div << 6); | ||
218 | |||
224 | stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL1], RSTV6110_CTRL1, 8); | 219 | stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL1], RSTV6110_CTRL1, 8); |
225 | msleep(1); | 220 | msleep(1); |
226 | stv6110_set_bandwidth(fe, 72000000); | 221 | stv6110_set_bandwidth(fe, 72000000); |
@@ -418,6 +413,10 @@ struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe, | |||
418 | }; | 413 | }; |
419 | int ret; | 414 | int ret; |
420 | 415 | ||
416 | /* divisor value for the output clock */ | ||
417 | reg0[2] &= ~0xc0; | ||
418 | reg0[2] |= (config->clk_div << 6); | ||
419 | |||
421 | if (fe->ops.i2c_gate_ctrl) | 420 | if (fe->ops.i2c_gate_ctrl) |
422 | fe->ops.i2c_gate_ctrl(fe, 1); | 421 | fe->ops.i2c_gate_ctrl(fe, 1); |
423 | 422 | ||
@@ -436,6 +435,7 @@ struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe, | |||
436 | priv->i2c_address = config->i2c_address; | 435 | priv->i2c_address = config->i2c_address; |
437 | priv->i2c = i2c; | 436 | priv->i2c = i2c; |
438 | priv->mclk = config->mclk; | 437 | priv->mclk = config->mclk; |
438 | priv->clk_div = config->clk_div; | ||
439 | 439 | ||
440 | memcpy(&priv->regs, ®0[1], 8); | 440 | memcpy(&priv->regs, ®0[1], 8); |
441 | 441 | ||
diff --git a/drivers/media/dvb/frontends/stv6110.h b/drivers/media/dvb/frontends/stv6110.h index 1c0314d6aa55..9db2402410f6 100644 --- a/drivers/media/dvb/frontends/stv6110.h +++ b/drivers/media/dvb/frontends/stv6110.h | |||
@@ -41,7 +41,7 @@ | |||
41 | struct stv6110_config { | 41 | struct stv6110_config { |
42 | u8 i2c_address; | 42 | u8 i2c_address; |
43 | u32 mclk; | 43 | u32 mclk; |
44 | int iq_wiring; | 44 | u8 clk_div; /* divisor value for the output clock */ |
45 | }; | 45 | }; |
46 | 46 | ||
47 | #if defined(CONFIG_DVB_STV6110) || (defined(CONFIG_DVB_STV6110_MODULE) \ | 47 | #if defined(CONFIG_DVB_STV6110) || (defined(CONFIG_DVB_STV6110_MODULE) \ |
diff --git a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c index f5d7b3277a2f..6c1dbf9288d8 100644 --- a/drivers/media/dvb/frontends/tda10021.c +++ b/drivers/media/dvb/frontends/tda10021.c | |||
@@ -176,7 +176,7 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate | |||
176 | tmp = ((symbolrate << 4) % FIN) << 8; | 176 | tmp = ((symbolrate << 4) % FIN) << 8; |
177 | ratio = (ratio << 8) + tmp / FIN; | 177 | ratio = (ratio << 8) + tmp / FIN; |
178 | tmp = (tmp % FIN) << 8; | 178 | tmp = (tmp % FIN) << 8; |
179 | ratio = (ratio << 8) + (tmp + FIN/2) / FIN; | 179 | ratio = (ratio << 8) + DIV_ROUND_CLOSEST(tmp, FIN); |
180 | 180 | ||
181 | BDR = ratio; | 181 | BDR = ratio; |
182 | BDRI = (((XIN << 5) / symbolrate) + 1) / 2; | 182 | BDRI = (((XIN << 5) / symbolrate) + 1) / 2; |
diff --git a/drivers/media/dvb/frontends/tda8261.c b/drivers/media/dvb/frontends/tda8261.c index b6d177799104..320c3c36d8b2 100644 --- a/drivers/media/dvb/frontends/tda8261.c +++ b/drivers/media/dvb/frontends/tda8261.c | |||
@@ -136,9 +136,9 @@ static int tda8261_set_state(struct dvb_frontend *fe, | |||
136 | 136 | ||
137 | if (frequency < 1450000) | 137 | if (frequency < 1450000) |
138 | buf[3] = 0x00; | 138 | buf[3] = 0x00; |
139 | if (frequency < 2000000) | 139 | else if (frequency < 2000000) |
140 | buf[3] = 0x40; | 140 | buf[3] = 0x40; |
141 | if (frequency < 2150000) | 141 | else if (frequency < 2150000) |
142 | buf[3] = 0x80; | 142 | buf[3] = 0x80; |
143 | 143 | ||
144 | /* Set params */ | 144 | /* Set params */ |
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c index 6e78e4865515..550a07a8a997 100644 --- a/drivers/media/dvb/frontends/ves1820.c +++ b/drivers/media/dvb/frontends/ves1820.c | |||
@@ -165,7 +165,7 @@ static int ves1820_set_symbolrate(struct ves1820_state *state, u32 symbolrate) | |||
165 | tmp = ((symbolrate << 4) % fin) << 8; | 165 | tmp = ((symbolrate << 4) % fin) << 8; |
166 | ratio = (ratio << 8) + tmp / fin; | 166 | ratio = (ratio << 8) + tmp / fin; |
167 | tmp = (tmp % fin) << 8; | 167 | tmp = (tmp % fin) << 8; |
168 | ratio = (ratio << 8) + (tmp + fin / 2) / fin; | 168 | ratio = (ratio << 8) + DIV_ROUND_CLOSEST(tmp, fin); |
169 | 169 | ||
170 | BDR = ratio; | 170 | BDR = ratio; |
171 | BDRI = (((state->config->xin << 5) / symbolrate) + 1) / 2; | 171 | BDRI = (((state->config->xin << 5) / symbolrate) + 1) / 2; |
diff --git a/drivers/media/dvb/frontends/zl10036.c b/drivers/media/dvb/frontends/zl10036.c index e22a0b381dc4..4e814ff22b23 100644 --- a/drivers/media/dvb/frontends/zl10036.c +++ b/drivers/media/dvb/frontends/zl10036.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/dvb/frontend.h> | 31 | #include <linux/dvb/frontend.h> |
32 | #include <asm/types.h> | 32 | #include <linux/types.h> |
33 | 33 | ||
34 | #include "zl10036.h" | 34 | #include "zl10036.h" |
35 | 35 | ||
diff --git a/drivers/media/dvb/frontends/zl10039.c b/drivers/media/dvb/frontends/zl10039.c new file mode 100644 index 000000000000..11b29cb883e6 --- /dev/null +++ b/drivers/media/dvb/frontends/zl10039.c | |||
@@ -0,0 +1,308 @@ | |||
1 | /* | ||
2 | * Driver for Zarlink ZL10039 DVB-S tuner | ||
3 | * | ||
4 | * Copyright 2007 Jan D. Louw <jd.louw@mweb.co.za> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #include <linux/module.h> | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/string.h> | ||
25 | #include <linux/slab.h> | ||
26 | #include <linux/dvb/frontend.h> | ||
27 | |||
28 | #include "dvb_frontend.h" | ||
29 | #include "zl10039.h" | ||
30 | |||
31 | static int debug; | ||
32 | |||
33 | #define dprintk(args...) \ | ||
34 | do { \ | ||
35 | if (debug) \ | ||
36 | printk(KERN_DEBUG args); \ | ||
37 | } while (0) | ||
38 | |||
39 | enum zl10039_model_id { | ||
40 | ID_ZL10039 = 1 | ||
41 | }; | ||
42 | |||
43 | struct zl10039_state { | ||
44 | struct i2c_adapter *i2c; | ||
45 | u8 i2c_addr; | ||
46 | u8 id; | ||
47 | }; | ||
48 | |||
49 | enum zl10039_reg_addr { | ||
50 | PLL0 = 0, | ||
51 | PLL1, | ||
52 | PLL2, | ||
53 | PLL3, | ||
54 | RFFE, | ||
55 | BASE0, | ||
56 | BASE1, | ||
57 | BASE2, | ||
58 | LO0, | ||
59 | LO1, | ||
60 | LO2, | ||
61 | LO3, | ||
62 | LO4, | ||
63 | LO5, | ||
64 | LO6, | ||
65 | GENERAL | ||
66 | }; | ||
67 | |||
68 | static int zl10039_read(const struct zl10039_state *state, | ||
69 | const enum zl10039_reg_addr reg, u8 *buf, | ||
70 | const size_t count) | ||
71 | { | ||
72 | u8 regbuf[] = { reg }; | ||
73 | struct i2c_msg msg[] = { | ||
74 | {/* Write register address */ | ||
75 | .addr = state->i2c_addr, | ||
76 | .flags = 0, | ||
77 | .buf = regbuf, | ||
78 | .len = 1, | ||
79 | }, {/* Read count bytes */ | ||
80 | .addr = state->i2c_addr, | ||
81 | .flags = I2C_M_RD, | ||
82 | .buf = buf, | ||
83 | .len = count, | ||
84 | }, | ||
85 | }; | ||
86 | |||
87 | dprintk("%s\n", __func__); | ||
88 | |||
89 | if (i2c_transfer(state->i2c, msg, 2) != 2) { | ||
90 | dprintk("%s: i2c read error\n", __func__); | ||
91 | return -EREMOTEIO; | ||
92 | } | ||
93 | |||
94 | return 0; /* Success */ | ||
95 | } | ||
96 | |||
97 | static int zl10039_write(struct zl10039_state *state, | ||
98 | const enum zl10039_reg_addr reg, const u8 *src, | ||
99 | const size_t count) | ||
100 | { | ||
101 | u8 buf[count + 1]; | ||
102 | struct i2c_msg msg = { | ||
103 | .addr = state->i2c_addr, | ||
104 | .flags = 0, | ||
105 | .buf = buf, | ||
106 | .len = count + 1, | ||
107 | }; | ||
108 | |||
109 | dprintk("%s\n", __func__); | ||
110 | /* Write register address and data in one go */ | ||
111 | buf[0] = reg; | ||
112 | memcpy(&buf[1], src, count); | ||
113 | if (i2c_transfer(state->i2c, &msg, 1) != 1) { | ||
114 | dprintk("%s: i2c write error\n", __func__); | ||
115 | return -EREMOTEIO; | ||
116 | } | ||
117 | |||
118 | return 0; /* Success */ | ||
119 | } | ||
120 | |||
121 | static inline int zl10039_readreg(struct zl10039_state *state, | ||
122 | const enum zl10039_reg_addr reg, u8 *val) | ||
123 | { | ||
124 | return zl10039_read(state, reg, val, 1); | ||
125 | } | ||
126 | |||
127 | static inline int zl10039_writereg(struct zl10039_state *state, | ||
128 | const enum zl10039_reg_addr reg, | ||
129 | const u8 val) | ||
130 | { | ||
131 | return zl10039_write(state, reg, &val, 1); | ||
132 | } | ||
133 | |||
134 | static int zl10039_init(struct dvb_frontend *fe) | ||
135 | { | ||
136 | struct zl10039_state *state = fe->tuner_priv; | ||
137 | int ret; | ||
138 | |||
139 | dprintk("%s\n", __func__); | ||
140 | if (fe->ops.i2c_gate_ctrl) | ||
141 | fe->ops.i2c_gate_ctrl(fe, 1); | ||
142 | /* Reset logic */ | ||
143 | ret = zl10039_writereg(state, GENERAL, 0x40); | ||
144 | if (ret < 0) { | ||
145 | dprintk("Note: i2c write error normal when resetting the " | ||
146 | "tuner\n"); | ||
147 | } | ||
148 | /* Wake up */ | ||
149 | ret = zl10039_writereg(state, GENERAL, 0x01); | ||
150 | if (ret < 0) { | ||
151 | dprintk("Tuner power up failed\n"); | ||
152 | return ret; | ||
153 | } | ||
154 | if (fe->ops.i2c_gate_ctrl) | ||
155 | fe->ops.i2c_gate_ctrl(fe, 0); | ||
156 | |||
157 | return 0; | ||
158 | } | ||
159 | |||
160 | static int zl10039_sleep(struct dvb_frontend *fe) | ||
161 | { | ||
162 | struct zl10039_state *state = fe->tuner_priv; | ||
163 | int ret; | ||
164 | |||
165 | dprintk("%s\n", __func__); | ||
166 | if (fe->ops.i2c_gate_ctrl) | ||
167 | fe->ops.i2c_gate_ctrl(fe, 1); | ||
168 | ret = zl10039_writereg(state, GENERAL, 0x80); | ||
169 | if (ret < 0) { | ||
170 | dprintk("Tuner sleep failed\n"); | ||
171 | return ret; | ||
172 | } | ||
173 | if (fe->ops.i2c_gate_ctrl) | ||
174 | fe->ops.i2c_gate_ctrl(fe, 0); | ||
175 | |||
176 | return 0; | ||
177 | } | ||
178 | |||
179 | static int zl10039_set_params(struct dvb_frontend *fe, | ||
180 | struct dvb_frontend_parameters *params) | ||
181 | { | ||
182 | struct zl10039_state *state = fe->tuner_priv; | ||
183 | u8 buf[6]; | ||
184 | u8 bf; | ||
185 | u32 fbw; | ||
186 | u32 div; | ||
187 | int ret; | ||
188 | |||
189 | dprintk("%s\n", __func__); | ||
190 | dprintk("Set frequency = %d, symbol rate = %d\n", | ||
191 | params->frequency, params->u.qpsk.symbol_rate); | ||
192 | |||
193 | /* Assumed 10.111 MHz crystal oscillator */ | ||
194 | /* Cancelled num/den 80 to prevent overflow */ | ||
195 | div = (params->frequency * 1000) / 126387; | ||
196 | fbw = (params->u.qpsk.symbol_rate * 27) / 32000; | ||
197 | /* Cancelled num/den 10 to prevent overflow */ | ||
198 | bf = ((fbw * 5088) / 1011100) - 1; | ||
199 | |||
200 | /*PLL divider*/ | ||
201 | buf[0] = (div >> 8) & 0x7f; | ||
202 | buf[1] = (div >> 0) & 0xff; | ||
203 | /*Reference divider*/ | ||
204 | /* Select reference ratio of 80 */ | ||
205 | buf[2] = 0x1D; | ||
206 | /*PLL test modes*/ | ||
207 | buf[3] = 0x40; | ||
208 | /*RF Control register*/ | ||
209 | buf[4] = 0x6E; /* Bypass enable */ | ||
210 | /*Baseband filter cutoff */ | ||
211 | buf[5] = bf; | ||
212 | |||
213 | /* Open i2c gate */ | ||
214 | if (fe->ops.i2c_gate_ctrl) | ||
215 | fe->ops.i2c_gate_ctrl(fe, 1); | ||
216 | /* BR = 10, Enable filter adjustment */ | ||
217 | ret = zl10039_writereg(state, BASE1, 0x0A); | ||
218 | if (ret < 0) | ||
219 | goto error; | ||
220 | /* Write new config values */ | ||
221 | ret = zl10039_write(state, PLL0, buf, sizeof(buf)); | ||
222 | if (ret < 0) | ||
223 | goto error; | ||
224 | /* BR = 10, Disable filter adjustment */ | ||
225 | ret = zl10039_writereg(state, BASE1, 0x6A); | ||
226 | if (ret < 0) | ||
227 | goto error; | ||
228 | |||
229 | /* Close i2c gate */ | ||
230 | if (fe->ops.i2c_gate_ctrl) | ||
231 | fe->ops.i2c_gate_ctrl(fe, 0); | ||
232 | return 0; | ||
233 | error: | ||
234 | dprintk("Error setting tuner\n"); | ||
235 | return ret; | ||
236 | } | ||
237 | |||
238 | static int zl10039_release(struct dvb_frontend *fe) | ||
239 | { | ||
240 | struct zl10039_state *state = fe->tuner_priv; | ||
241 | |||
242 | dprintk("%s\n", __func__); | ||
243 | kfree(state); | ||
244 | fe->tuner_priv = NULL; | ||
245 | return 0; | ||
246 | } | ||
247 | |||
248 | static struct dvb_tuner_ops zl10039_ops = { | ||
249 | .release = zl10039_release, | ||
250 | .init = zl10039_init, | ||
251 | .sleep = zl10039_sleep, | ||
252 | .set_params = zl10039_set_params, | ||
253 | }; | ||
254 | |||
255 | struct dvb_frontend *zl10039_attach(struct dvb_frontend *fe, | ||
256 | u8 i2c_addr, struct i2c_adapter *i2c) | ||
257 | { | ||
258 | struct zl10039_state *state = NULL; | ||
259 | |||
260 | dprintk("%s\n", __func__); | ||
261 | state = kmalloc(sizeof(struct zl10039_state), GFP_KERNEL); | ||
262 | if (state == NULL) | ||
263 | goto error; | ||
264 | |||
265 | state->i2c = i2c; | ||
266 | state->i2c_addr = i2c_addr; | ||
267 | |||
268 | /* Open i2c gate */ | ||
269 | if (fe->ops.i2c_gate_ctrl) | ||
270 | fe->ops.i2c_gate_ctrl(fe, 1); | ||
271 | /* check if this is a valid tuner */ | ||
272 | if (zl10039_readreg(state, GENERAL, &state->id) < 0) { | ||
273 | /* Close i2c gate */ | ||
274 | if (fe->ops.i2c_gate_ctrl) | ||
275 | fe->ops.i2c_gate_ctrl(fe, 0); | ||
276 | goto error; | ||
277 | } | ||
278 | /* Close i2c gate */ | ||
279 | if (fe->ops.i2c_gate_ctrl) | ||
280 | fe->ops.i2c_gate_ctrl(fe, 0); | ||
281 | |||
282 | state->id = state->id & 0x0f; | ||
283 | switch (state->id) { | ||
284 | case ID_ZL10039: | ||
285 | strcpy(fe->ops.tuner_ops.info.name, | ||
286 | "Zarlink ZL10039 DVB-S tuner"); | ||
287 | break; | ||
288 | default: | ||
289 | dprintk("Chip ID=%x does not match a known type\n", state->id); | ||
290 | break; | ||
291 | goto error; | ||
292 | } | ||
293 | |||
294 | memcpy(&fe->ops.tuner_ops, &zl10039_ops, sizeof(struct dvb_tuner_ops)); | ||
295 | fe->tuner_priv = state; | ||
296 | dprintk("Tuner attached @ i2c address 0x%02x\n", i2c_addr); | ||
297 | return fe; | ||
298 | error: | ||
299 | kfree(state); | ||
300 | return NULL; | ||
301 | } | ||
302 | EXPORT_SYMBOL(zl10039_attach); | ||
303 | |||
304 | module_param(debug, int, 0644); | ||
305 | MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); | ||
306 | MODULE_DESCRIPTION("Zarlink ZL10039 DVB-S tuner driver"); | ||
307 | MODULE_AUTHOR("Jan D. Louw <jd.louw@mweb.co.za>"); | ||
308 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/media/dvb/frontends/zl10039.h b/drivers/media/dvb/frontends/zl10039.h new file mode 100644 index 000000000000..5eee7ea162a1 --- /dev/null +++ b/drivers/media/dvb/frontends/zl10039.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | Driver for Zarlink ZL10039 DVB-S tuner | ||
3 | |||
4 | Copyright (C) 2007 Jan D. Louw <jd.louw@mweb.co.za> | ||
5 | |||
6 | This program is free software; you can redistribute it and/or modify | ||
7 | it under the terms of the GNU General Public License as published by | ||
8 | the Free Software Foundation; either version 2 of the License, or | ||
9 | (at your option) any later version. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | |||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program; if not, write to the Free Software | ||
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef ZL10039_H | ||
23 | #define ZL10039_H | ||
24 | |||
25 | #if defined(CONFIG_DVB_ZL10039) || (defined(CONFIG_DVB_ZL10039_MODULE) \ | ||
26 | && defined(MODULE)) | ||
27 | struct dvb_frontend *zl10039_attach(struct dvb_frontend *fe, | ||
28 | u8 i2c_addr, | ||
29 | struct i2c_adapter *i2c); | ||
30 | #else | ||
31 | static inline struct dvb_frontend *zl10039_attach(struct dvb_frontend *fe, | ||
32 | u8 i2c_addr, | ||
33 | struct i2c_adapter *i2c) | ||
34 | { | ||
35 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | ||
36 | return NULL; | ||
37 | } | ||
38 | #endif /* CONFIG_DVB_ZL10039 */ | ||
39 | |||
40 | #endif /* ZL10039_H */ | ||
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c index 66f5c1fb3074..8c612719adfc 100644 --- a/drivers/media/dvb/frontends/zl10353.c +++ b/drivers/media/dvb/frontends/zl10353.c | |||
@@ -38,6 +38,8 @@ struct zl10353_state { | |||
38 | struct zl10353_config config; | 38 | struct zl10353_config config; |
39 | 39 | ||
40 | enum fe_bandwidth bandwidth; | 40 | enum fe_bandwidth bandwidth; |
41 | u32 ucblocks; | ||
42 | u32 frequency; | ||
41 | }; | 43 | }; |
42 | 44 | ||
43 | static int debug; | 45 | static int debug; |
@@ -199,6 +201,8 @@ static int zl10353_set_parameters(struct dvb_frontend *fe, | |||
199 | u16 tps = 0; | 201 | u16 tps = 0; |
200 | struct dvb_ofdm_parameters *op = ¶m->u.ofdm; | 202 | struct dvb_ofdm_parameters *op = ¶m->u.ofdm; |
201 | 203 | ||
204 | state->frequency = param->frequency; | ||
205 | |||
202 | zl10353_single_write(fe, RESET, 0x80); | 206 | zl10353_single_write(fe, RESET, 0x80); |
203 | udelay(200); | 207 | udelay(200); |
204 | zl10353_single_write(fe, 0xEA, 0x01); | 208 | zl10353_single_write(fe, 0xEA, 0x01); |
@@ -464,7 +468,7 @@ static int zl10353_get_parameters(struct dvb_frontend *fe, | |||
464 | break; | 468 | break; |
465 | } | 469 | } |
466 | 470 | ||
467 | param->frequency = 0; | 471 | param->frequency = state->frequency; |
468 | op->bandwidth = state->bandwidth; | 472 | op->bandwidth = state->bandwidth; |
469 | param->inversion = INVERSION_AUTO; | 473 | param->inversion = INVERSION_AUTO; |
470 | 474 | ||
@@ -542,9 +546,13 @@ static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr) | |||
542 | static int zl10353_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) | 546 | static int zl10353_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) |
543 | { | 547 | { |
544 | struct zl10353_state *state = fe->demodulator_priv; | 548 | struct zl10353_state *state = fe->demodulator_priv; |
549 | u32 ubl = 0; | ||
550 | |||
551 | ubl = zl10353_read_register(state, RS_UBC_1) << 8 | | ||
552 | zl10353_read_register(state, RS_UBC_0); | ||
545 | 553 | ||
546 | *ucblocks = zl10353_read_register(state, RS_UBC_1) << 8 | | 554 | state->ucblocks += ubl; |
547 | zl10353_read_register(state, RS_UBC_0); | 555 | *ucblocks = state->ucblocks; |
548 | 556 | ||
549 | return 0; | 557 | return 0; |
550 | } | 558 | } |
diff --git a/drivers/media/dvb/pluto2/pluto2.c b/drivers/media/dvb/pluto2/pluto2.c index 598eaf8acc6e..80d14a065bad 100644 --- a/drivers/media/dvb/pluto2/pluto2.c +++ b/drivers/media/dvb/pluto2/pluto2.c | |||
@@ -439,7 +439,7 @@ static inline u32 divide(u32 numerator, u32 denominator) | |||
439 | if (denominator == 0) | 439 | if (denominator == 0) |
440 | return ~0; | 440 | return ~0; |
441 | 441 | ||
442 | return (numerator + denominator / 2) / denominator; | 442 | return DIV_ROUND_CLOSEST(numerator, denominator); |
443 | } | 443 | } |
444 | 444 | ||
445 | /* LG Innotek TDTE-E001P (Infineon TUA6034) */ | 445 | /* LG Innotek TDTE-E001P (Infineon TUA6034) */ |
diff --git a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c index ce64c6214cc4..8986d967d2f4 100644 --- a/drivers/media/dvb/ttpci/av7110_v4l.c +++ b/drivers/media/dvb/ttpci/av7110_v4l.c | |||
@@ -490,7 +490,7 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input) | |||
490 | if (!av7110->analog_tuner_flags) | 490 | if (!av7110->analog_tuner_flags) |
491 | return 0; | 491 | return 0; |
492 | 492 | ||
493 | if (input < 0 || input >= 4) | 493 | if (input >= 4) |
494 | return -EINVAL; | 494 | return -EINVAL; |
495 | 495 | ||
496 | av7110->current_input = input; | 496 | av7110->current_input = input; |
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 371a71616810..b5c681372b6c 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c | |||
@@ -225,7 +225,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) | |||
225 | case 0x1012: | 225 | case 0x1012: |
226 | /* The hauppauge keymap is a superset of these remotes */ | 226 | /* The hauppauge keymap is a superset of these remotes */ |
227 | ir_input_init(input_dev, &budget_ci->ir.state, | 227 | ir_input_init(input_dev, &budget_ci->ir.state, |
228 | IR_TYPE_RC5, ir_codes_hauppauge_new); | 228 | IR_TYPE_RC5, &ir_codes_hauppauge_new_table); |
229 | 229 | ||
230 | if (rc5_device < 0) | 230 | if (rc5_device < 0) |
231 | budget_ci->ir.rc5_device = 0x1f; | 231 | budget_ci->ir.rc5_device = 0x1f; |
@@ -237,7 +237,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) | |||
237 | case 0x101a: | 237 | case 0x101a: |
238 | /* for the Technotrend 1500 bundled remote */ | 238 | /* for the Technotrend 1500 bundled remote */ |
239 | ir_input_init(input_dev, &budget_ci->ir.state, | 239 | ir_input_init(input_dev, &budget_ci->ir.state, |
240 | IR_TYPE_RC5, ir_codes_tt_1500); | 240 | IR_TYPE_RC5, &ir_codes_tt_1500_table); |
241 | 241 | ||
242 | if (rc5_device < 0) | 242 | if (rc5_device < 0) |
243 | budget_ci->ir.rc5_device = IR_DEVICE_ANY; | 243 | budget_ci->ir.rc5_device = IR_DEVICE_ANY; |
@@ -247,7 +247,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) | |||
247 | default: | 247 | default: |
248 | /* unknown remote */ | 248 | /* unknown remote */ |
249 | ir_input_init(input_dev, &budget_ci->ir.state, | 249 | ir_input_init(input_dev, &budget_ci->ir.state, |
250 | IR_TYPE_RC5, ir_codes_budget_ci_old); | 250 | IR_TYPE_RC5, &ir_codes_budget_ci_old_table); |
251 | 251 | ||
252 | if (rc5_device < 0) | 252 | if (rc5_device < 0) |
253 | budget_ci->ir.rc5_device = IR_DEVICE_ANY; | 253 | budget_ci->ir.rc5_device = IR_DEVICE_ANY; |