em28xx-dvb.c (bc0868c62bb13834b20a864f684cced1f84a2412) em28xx-dvb.c (ab4d14528fdf946dfa7177b53e64f78bf8cce03a)
1/*
2 DVB device driver for em28xx
3
4 (c) 2008-2011 Mauro Carvalho Chehab <mchehab@infradead.org>
5
6 (c) 2008 Devin Heitmueller <devin.heitmueller@gmail.com>
7 - Fixes for the driver to properly work with HVR-950
8 - Fixes for the driver to properly work with Pinnacle PCTV HD Pro Stick

--- 44 unchanged lines hidden (view full) ---

53#include "tda18212.h"
54#include "a8293.h"
55#include "qt1010.h"
56#include "mb86a20s.h"
57#include "m88ds3103.h"
58#include "ts2020.h"
59#include "si2168.h"
60#include "si2157.h"
1/*
2 DVB device driver for em28xx
3
4 (c) 2008-2011 Mauro Carvalho Chehab <mchehab@infradead.org>
5
6 (c) 2008 Devin Heitmueller <devin.heitmueller@gmail.com>
7 - Fixes for the driver to properly work with HVR-950
8 - Fixes for the driver to properly work with Pinnacle PCTV HD Pro Stick

--- 44 unchanged lines hidden (view full) ---

53#include "tda18212.h"
54#include "a8293.h"
55#include "qt1010.h"
56#include "mb86a20s.h"
57#include "m88ds3103.h"
58#include "ts2020.h"
59#include "si2168.h"
60#include "si2157.h"
61#include "tc90522.h"
62#include "qm1d1c0042.h"
61
62MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
63MODULE_LICENSE("GPL");
64MODULE_DESCRIPTION(DRIVER_DESC " - digital TV interface");
65MODULE_VERSION(EM28XX_VERSION);
66
67static unsigned int debug;
68module_param(debug, int, 0644);

--- 713 unchanged lines hidden (view full) ---

782 mt352_write(fe, rs_err_cfg, sizeof(rs_err_cfg));
783 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
784 mt352_write(fe, trl_nom_cfg, sizeof(trl_nom_cfg));
785 mt352_write(fe, tps_given_cfg, sizeof(tps_given_cfg));
786 mt352_write(fe, tuner_go, sizeof(tuner_go));
787 return 0;
788}
789
63
64MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
65MODULE_LICENSE("GPL");
66MODULE_DESCRIPTION(DRIVER_DESC " - digital TV interface");
67MODULE_VERSION(EM28XX_VERSION);
68
69static unsigned int debug;
70module_param(debug, int, 0644);

--- 713 unchanged lines hidden (view full) ---

784 mt352_write(fe, rs_err_cfg, sizeof(rs_err_cfg));
785 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
786 mt352_write(fe, trl_nom_cfg, sizeof(trl_nom_cfg));
787 mt352_write(fe, tps_given_cfg, sizeof(tps_given_cfg));
788 mt352_write(fe, tuner_go, sizeof(tuner_go));
789 return 0;
790}
791
792static void px_bcud_init(struct em28xx *dev)
793{
794 int i;
795 struct {
796 unsigned char r[4];
797 int len;
798 } regs1[] = {
799 {{ 0x0e, 0x77 }, 2},
800 {{ 0x0f, 0x77 }, 2},
801 {{ 0x03, 0x90 }, 2},
802 }, regs2[] = {
803 {{ 0x07, 0x01 }, 2},
804 {{ 0x08, 0x10 }, 2},
805 {{ 0x13, 0x00 }, 2},
806 {{ 0x17, 0x00 }, 2},
807 {{ 0x03, 0x01 }, 2},
808 {{ 0x10, 0xb1 }, 2},
809 {{ 0x11, 0x40 }, 2},
810 {{ 0x85, 0x7a }, 2},
811 {{ 0x87, 0x04 }, 2},
812 };
813 static struct em28xx_reg_seq gpio[] = {
814 {EM28XX_R06_I2C_CLK, 0x40, 0xff, 300},
815 {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 60},
816 {EM28XX_R15_RGAIN, 0x20, 0xff, 0},
817 {EM28XX_R16_GGAIN, 0x20, 0xff, 0},
818 {EM28XX_R17_BGAIN, 0x20, 0xff, 0},
819 {EM28XX_R18_ROFFSET, 0x00, 0xff, 0},
820 {EM28XX_R19_GOFFSET, 0x00, 0xff, 0},
821 {EM28XX_R1A_BOFFSET, 0x00, 0xff, 0},
822 {EM28XX_R23_UOFFSET, 0x00, 0xff, 0},
823 {EM28XX_R24_VOFFSET, 0x00, 0xff, 0},
824 {EM28XX_R26_COMPR, 0x00, 0xff, 0},
825 {0x13, 0x08, 0xff, 0},
826 {EM28XX_R12_VINENABLE, 0x27, 0xff, 0},
827 {EM28XX_R0C_USBSUSP, 0x10, 0xff, 0},
828 {EM28XX_R27_OUTFMT, 0x00, 0xff, 0},
829 {EM28XX_R10_VINMODE, 0x00, 0xff, 0},
830 {EM28XX_R11_VINCTRL, 0x11, 0xff, 0},
831 {EM2874_R50_IR_CONFIG, 0x01, 0xff, 0},
832 {EM2874_R5F_TS_ENABLE, 0x80, 0xff, 0},
833 {EM28XX_R06_I2C_CLK, 0x46, 0xff, 0},
834 };
835 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x46);
836 /* sleeping ISDB-T */
837 dev->dvb->i2c_client_demod->addr = 0x14;
838 for (i = 0; i < ARRAY_SIZE(regs1); i++)
839 i2c_master_send(dev->dvb->i2c_client_demod, regs1[i].r,
840 regs1[i].len);
841 /* sleeping ISDB-S */
842 dev->dvb->i2c_client_demod->addr = 0x15;
843 for (i = 0; i < ARRAY_SIZE(regs2); i++)
844 i2c_master_send(dev->dvb->i2c_client_demod, regs2[i].r,
845 regs2[i].len);
846 for (i = 0; i < ARRAY_SIZE(gpio); i++) {
847 em28xx_write_reg_bits(dev, gpio[i].reg, gpio[i].val,
848 gpio[i].mask);
849 if (gpio[i].sleep > 0)
850 msleep(gpio[i].sleep);
851 }
852};
853
790static struct mt352_config terratec_xs_mt352_cfg = {
791 .demod_address = (0x1e >> 1),
792 .no_tuner = 1,
793 .if2 = 45600,
794 .demod_init = em28xx_mt352_terratec_xs_init,
795};
796
797static struct tda10023_config em28xx_tda10023_config = {

--- 959 unchanged lines hidden (view full) ---

1757 i2c_unregister_device(dvb->i2c_client_demod);
1758 result = -ENODEV;
1759 goto out_free;
1760 }
1761
1762 dvb->i2c_client_tuner = client;
1763 }
1764 break;
854static struct mt352_config terratec_xs_mt352_cfg = {
855 .demod_address = (0x1e >> 1),
856 .no_tuner = 1,
857 .if2 = 45600,
858 .demod_init = em28xx_mt352_terratec_xs_init,
859};
860
861static struct tda10023_config em28xx_tda10023_config = {

--- 959 unchanged lines hidden (view full) ---

1821 i2c_unregister_device(dvb->i2c_client_demod);
1822 result = -ENODEV;
1823 goto out_free;
1824 }
1825
1826 dvb->i2c_client_tuner = client;
1827 }
1828 break;
1829
1830 case EM28178_BOARD_PLEX_PX_BCUD:
1831 {
1832 struct i2c_client *client;
1833 struct i2c_board_info info;
1834 struct tc90522_config tc90522_config;
1835 struct qm1d1c0042_config qm1d1c0042_config;
1836
1837 /* attach demod */
1838 memset(&tc90522_config, 0, sizeof(tc90522_config));
1839 memset(&info, 0, sizeof(struct i2c_board_info));
1840 strlcpy(info.type, "tc90522sat", I2C_NAME_SIZE);
1841 info.addr = 0x15;
1842 info.platform_data = &tc90522_config;
1843 request_module("tc90522");
1844 client = i2c_new_device(&dev->i2c_adap[dev->def_i2c_bus], &info);
1845 if (client == NULL || client->dev.driver == NULL) {
1846 result = -ENODEV;
1847 goto out_free;
1848 }
1849 dvb->i2c_client_demod = client;
1850 if (!try_module_get(client->dev.driver->owner)) {
1851 i2c_unregister_device(client);
1852 result = -ENODEV;
1853 goto out_free;
1854 }
1855
1856 /* attach tuner */
1857 memset(&qm1d1c0042_config, 0,
1858 sizeof(qm1d1c0042_config));
1859 qm1d1c0042_config.fe = tc90522_config.fe;
1860 qm1d1c0042_config.lpf = 1;
1861 memset(&info, 0, sizeof(struct i2c_board_info));
1862 strlcpy(info.type, "qm1d1c0042", I2C_NAME_SIZE);
1863 info.addr = 0x61;
1864 info.platform_data = &qm1d1c0042_config;
1865 request_module(info.type);
1866 client = i2c_new_device(tc90522_config.tuner_i2c,
1867 &info);
1868 if (client == NULL || client->dev.driver == NULL) {
1869 module_put(dvb->i2c_client_demod->dev.driver->owner);
1870 i2c_unregister_device(dvb->i2c_client_demod);
1871 result = -ENODEV;
1872 goto out_free;
1873 }
1874 dvb->i2c_client_tuner = client;
1875 if (!try_module_get(client->dev.driver->owner)) {
1876 i2c_unregister_device(client);
1877 module_put(dvb->i2c_client_demod->dev.driver->owner);
1878 i2c_unregister_device(dvb->i2c_client_demod);
1879 result = -ENODEV;
1880 goto out_free;
1881 }
1882 dvb->fe[0] = tc90522_config.fe;
1883 px_bcud_init(dev);
1884 }
1885 break;
1765 default:
1766 em28xx_errdev("/2: The frontend of your DVB/ATSC card"
1767 " isn't supported yet\n");
1768 break;
1769 }
1770 if (NULL == dvb->fe[0]) {
1771 em28xx_errdev("/2: frontend initialization failed\n");
1772 result = -EINVAL;

--- 177 unchanged lines hidden ---
1886 default:
1887 em28xx_errdev("/2: The frontend of your DVB/ATSC card"
1888 " isn't supported yet\n");
1889 break;
1890 }
1891 if (NULL == dvb->fe[0]) {
1892 em28xx_errdev("/2: frontend initialization failed\n");
1893 result = -EINVAL;

--- 177 unchanged lines hidden ---