.. | .. |
---|
471 | 471 | { |
---|
472 | 472 | int i; |
---|
473 | 473 | |
---|
474 | | - struct em28xx_reg_seq hauppauge_hvr930c_init[] = { |
---|
| 474 | + static const struct em28xx_reg_seq hauppauge_hvr930c_init[] = { |
---|
475 | 475 | {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0x65}, |
---|
476 | 476 | {EM2874_R80_GPIO_P0_CTRL, 0xfb, 0xff, 0x32}, |
---|
477 | 477 | {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0xb8}, |
---|
478 | 478 | { -1, -1, -1, -1}, |
---|
479 | 479 | }; |
---|
480 | | - struct em28xx_reg_seq hauppauge_hvr930c_end[] = { |
---|
| 480 | + static const struct em28xx_reg_seq hauppauge_hvr930c_end[] = { |
---|
481 | 481 | {EM2874_R80_GPIO_P0_CTRL, 0xef, 0xff, 0x01}, |
---|
482 | 482 | {EM2874_R80_GPIO_P0_CTRL, 0xaf, 0xff, 0x65}, |
---|
483 | 483 | {EM2874_R80_GPIO_P0_CTRL, 0xef, 0xff, 0x76}, |
---|
.. | .. |
---|
493 | 493 | { -1, -1, -1, -1}, |
---|
494 | 494 | }; |
---|
495 | 495 | |
---|
496 | | - struct { |
---|
| 496 | + static const struct { |
---|
497 | 497 | unsigned char r[4]; |
---|
498 | 498 | int len; |
---|
499 | 499 | } regs[] = { |
---|
.. | .. |
---|
537 | 537 | static void terratec_h5_init(struct em28xx *dev) |
---|
538 | 538 | { |
---|
539 | 539 | int i; |
---|
540 | | - struct em28xx_reg_seq terratec_h5_init[] = { |
---|
| 540 | + static const struct em28xx_reg_seq terratec_h5_init[] = { |
---|
541 | 541 | {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, |
---|
542 | 542 | {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 100}, |
---|
543 | 543 | {EM2874_R80_GPIO_P0_CTRL, 0xf2, 0xff, 50}, |
---|
544 | 544 | {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 100}, |
---|
545 | 545 | { -1, -1, -1, -1}, |
---|
546 | 546 | }; |
---|
547 | | - struct em28xx_reg_seq terratec_h5_end[] = { |
---|
| 547 | + static const struct em28xx_reg_seq terratec_h5_end[] = { |
---|
548 | 548 | {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100}, |
---|
549 | 549 | {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 50}, |
---|
550 | 550 | {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100}, |
---|
551 | 551 | { -1, -1, -1, -1}, |
---|
552 | 552 | }; |
---|
553 | | - struct { |
---|
| 553 | + static const struct { |
---|
554 | 554 | unsigned char r[4]; |
---|
555 | 555 | int len; |
---|
556 | 556 | } regs[] = { |
---|
.. | .. |
---|
594 | 594 | * 0xe6: unknown (does not affect DVB-T). |
---|
595 | 595 | * 0xb6: unknown (does not affect DVB-T). |
---|
596 | 596 | */ |
---|
597 | | - struct em28xx_reg_seq terratec_htc_stick_init[] = { |
---|
| 597 | + static const struct em28xx_reg_seq terratec_htc_stick_init[] = { |
---|
598 | 598 | {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, |
---|
599 | 599 | {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 100}, |
---|
600 | 600 | {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 50}, |
---|
601 | 601 | {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 100}, |
---|
602 | 602 | { -1, -1, -1, -1}, |
---|
603 | 603 | }; |
---|
604 | | - struct em28xx_reg_seq terratec_htc_stick_end[] = { |
---|
| 604 | + static const struct em28xx_reg_seq terratec_htc_stick_end[] = { |
---|
605 | 605 | {EM2874_R80_GPIO_P0_CTRL, 0xb6, 0xff, 100}, |
---|
606 | 606 | {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 50}, |
---|
607 | 607 | { -1, -1, -1, -1}, |
---|
.. | .. |
---|
611 | 611 | * Init the analog decoder (not yet supported), but |
---|
612 | 612 | * it's probably still a good idea. |
---|
613 | 613 | */ |
---|
614 | | - struct { |
---|
| 614 | + static const struct { |
---|
615 | 615 | unsigned char r[4]; |
---|
616 | 616 | int len; |
---|
617 | 617 | } regs[] = { |
---|
.. | .. |
---|
642 | 642 | { |
---|
643 | 643 | int i; |
---|
644 | 644 | |
---|
645 | | - struct em28xx_reg_seq terratec_htc_usb_xs_init[] = { |
---|
| 645 | + static const struct em28xx_reg_seq terratec_htc_usb_xs_init[] = { |
---|
646 | 646 | {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, |
---|
647 | 647 | {EM2874_R80_GPIO_P0_CTRL, 0xb2, 0xff, 100}, |
---|
648 | 648 | {EM2874_R80_GPIO_P0_CTRL, 0xb2, 0xff, 50}, |
---|
649 | 649 | {EM2874_R80_GPIO_P0_CTRL, 0xb6, 0xff, 100}, |
---|
650 | 650 | { -1, -1, -1, -1}, |
---|
651 | 651 | }; |
---|
652 | | - struct em28xx_reg_seq terratec_htc_usb_xs_end[] = { |
---|
| 652 | + static const struct em28xx_reg_seq terratec_htc_usb_xs_end[] = { |
---|
653 | 653 | {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 100}, |
---|
654 | 654 | {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 50}, |
---|
655 | 655 | {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100}, |
---|
.. | .. |
---|
660 | 660 | * Init the analog decoder (not yet supported), but |
---|
661 | 661 | * it's probably still a good idea. |
---|
662 | 662 | */ |
---|
663 | | - struct { |
---|
| 663 | + static const struct { |
---|
664 | 664 | unsigned char r[4]; |
---|
665 | 665 | int len; |
---|
666 | 666 | } regs[] = { |
---|
.. | .. |
---|
704 | 704 | * digital demodulator and tuner are routed via AVF4910B. |
---|
705 | 705 | */ |
---|
706 | 706 | int i; |
---|
707 | | - struct { |
---|
| 707 | + static const struct { |
---|
708 | 708 | unsigned char r[4]; |
---|
709 | 709 | int len; |
---|
710 | 710 | } regs[] = { |
---|
.. | .. |
---|
800 | 800 | static void px_bcud_init(struct em28xx *dev) |
---|
801 | 801 | { |
---|
802 | 802 | int i; |
---|
803 | | - struct { |
---|
| 803 | + static const struct { |
---|
804 | 804 | unsigned char r[4]; |
---|
805 | 805 | int len; |
---|
806 | 806 | } regs1[] = { |
---|
.. | .. |
---|
818 | 818 | {{ 0x85, 0x7a }, 2}, |
---|
819 | 819 | {{ 0x87, 0x04 }, 2}, |
---|
820 | 820 | }; |
---|
821 | | - static struct em28xx_reg_seq gpio[] = { |
---|
| 821 | + static const struct em28xx_reg_seq gpio[] = { |
---|
822 | 822 | {EM28XX_R06_I2C_CLK, 0x40, 0xff, 300}, |
---|
823 | 823 | {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 60}, |
---|
824 | 824 | {EM28XX_R15_RGAIN, 0x20, 0xff, 0}, |
---|
.. | .. |
---|
1193 | 1193 | /* attach tuner */ |
---|
1194 | 1194 | ts2020_config.fe = dvb->fe[0]; |
---|
1195 | 1195 | |
---|
| 1196 | + dvb->i2c_client_tuner = dvb_module_probe("ts2020", "ts2022", |
---|
| 1197 | + i2c_adapter, |
---|
| 1198 | + 0x60, &ts2020_config); |
---|
| 1199 | + if (!dvb->i2c_client_tuner) { |
---|
| 1200 | + dvb_module_release(dvb->i2c_client_demod); |
---|
| 1201 | + return -ENODEV; |
---|
| 1202 | + } |
---|
| 1203 | + |
---|
| 1204 | + /* delegate signal strength measurement to tuner */ |
---|
| 1205 | + dvb->fe[0]->ops.read_signal_strength = |
---|
| 1206 | + dvb->fe[0]->ops.tuner_ops.get_rf_strength; |
---|
| 1207 | + |
---|
| 1208 | + /* attach SEC */ |
---|
| 1209 | + a8293_pdata.dvb_frontend = dvb->fe[0]; |
---|
| 1210 | + dvb->i2c_client_sec = dvb_module_probe("a8293", NULL, |
---|
| 1211 | + &dev->i2c_adap[dev->def_i2c_bus], |
---|
| 1212 | + 0x08, &a8293_pdata); |
---|
| 1213 | + if (!dvb->i2c_client_sec) { |
---|
| 1214 | + dvb_module_release(dvb->i2c_client_tuner); |
---|
| 1215 | + dvb_module_release(dvb->i2c_client_demod); |
---|
| 1216 | + return -ENODEV; |
---|
| 1217 | + } |
---|
| 1218 | + |
---|
| 1219 | + return 0; |
---|
| 1220 | +} |
---|
| 1221 | + |
---|
| 1222 | +static int em28178_dvb_init_pctv_461e_v2(struct em28xx *dev) |
---|
| 1223 | +{ |
---|
| 1224 | + struct em28xx_dvb *dvb = dev->dvb; |
---|
| 1225 | + struct i2c_adapter *i2c_adapter; |
---|
| 1226 | + struct m88ds3103_platform_data m88ds3103_pdata = {}; |
---|
| 1227 | + struct ts2020_config ts2020_config = {}; |
---|
| 1228 | + struct a8293_platform_data a8293_pdata = {}; |
---|
| 1229 | + |
---|
| 1230 | + /* attach demod */ |
---|
| 1231 | + m88ds3103_pdata.clk = 27000000; |
---|
| 1232 | + m88ds3103_pdata.i2c_wr_max = 33; |
---|
| 1233 | + m88ds3103_pdata.ts_mode = M88DS3103_TS_PARALLEL; |
---|
| 1234 | + m88ds3103_pdata.ts_clk = 16000; |
---|
| 1235 | + m88ds3103_pdata.ts_clk_pol = 0; |
---|
| 1236 | + m88ds3103_pdata.agc = 0x99; |
---|
| 1237 | + m88ds3103_pdata.agc_inv = 0; |
---|
| 1238 | + m88ds3103_pdata.spec_inv = 0; |
---|
| 1239 | + dvb->i2c_client_demod = dvb_module_probe("m88ds3103", "m88ds3103b", |
---|
| 1240 | + &dev->i2c_adap[dev->def_i2c_bus], |
---|
| 1241 | + 0x6a, &m88ds3103_pdata); |
---|
| 1242 | + |
---|
| 1243 | + if (!dvb->i2c_client_demod) |
---|
| 1244 | + return -ENODEV; |
---|
| 1245 | + |
---|
| 1246 | + dvb->fe[0] = m88ds3103_pdata.get_dvb_frontend(dvb->i2c_client_demod); |
---|
| 1247 | + i2c_adapter = m88ds3103_pdata.get_i2c_adapter(dvb->i2c_client_demod); |
---|
| 1248 | + |
---|
| 1249 | + /* attach tuner */ |
---|
| 1250 | + ts2020_config.fe = dvb->fe[0]; |
---|
1196 | 1251 | dvb->i2c_client_tuner = dvb_module_probe("ts2020", "ts2022", |
---|
1197 | 1252 | i2c_adapter, |
---|
1198 | 1253 | 0x60, &ts2020_config); |
---|
.. | .. |
---|
1860 | 1915 | if (result) |
---|
1861 | 1916 | goto out_free; |
---|
1862 | 1917 | break; |
---|
| 1918 | + case EM28178_BOARD_PCTV_461E_V2: |
---|
| 1919 | + result = em28178_dvb_init_pctv_461e_v2(dev); |
---|
| 1920 | + if (result) |
---|
| 1921 | + goto out_free; |
---|
| 1922 | + break; |
---|
1863 | 1923 | case EM28178_BOARD_PCTV_292E: |
---|
1864 | 1924 | result = em28178_dvb_init_pctv_292e(dev); |
---|
1865 | 1925 | if (result) |
---|