Commit 6dcfd1f5d42e1b5f33d45f55186b961270420f00
Committed by
Greg Kroah-Hartman
1 parent
8bc4154c9a
rtl28xxu: add [1b80:d3af] Sveon STV27
commit 74a86272f05c3dae40f2d7b17ff09a0608cf3304 upstream. Added support for Sveon STV27 device (rtl2832u + FC0013 tuner) Signed-off-by: Alessandro Miceli <angelofsky1980@gmail.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 2 changed files with 3 additions and 0 deletions Inline Diff
drivers/media/dvb-core/dvb-usb-ids.h
1 | /* dvb-usb-ids.h is part of the DVB USB library. | 1 | /* dvb-usb-ids.h is part of the DVB USB library. |
2 | * | 2 | * |
3 | * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) see | 3 | * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) see |
4 | * dvb-usb-init.c for copyright information. | 4 | * dvb-usb-init.c for copyright information. |
5 | * | 5 | * |
6 | * a header file containing define's for the USB device supported by the | 6 | * a header file containing define's for the USB device supported by the |
7 | * various drivers. | 7 | * various drivers. |
8 | */ | 8 | */ |
9 | #ifndef _DVB_USB_IDS_H_ | 9 | #ifndef _DVB_USB_IDS_H_ |
10 | #define _DVB_USB_IDS_H_ | 10 | #define _DVB_USB_IDS_H_ |
11 | 11 | ||
12 | /* Vendor IDs */ | 12 | /* Vendor IDs */ |
13 | #define USB_VID_ADSTECH 0x06e1 | 13 | #define USB_VID_ADSTECH 0x06e1 |
14 | #define USB_VID_AFATECH 0x15a4 | 14 | #define USB_VID_AFATECH 0x15a4 |
15 | #define USB_VID_ALCOR_MICRO 0x058f | 15 | #define USB_VID_ALCOR_MICRO 0x058f |
16 | #define USB_VID_ALINK 0x05e3 | 16 | #define USB_VID_ALINK 0x05e3 |
17 | #define USB_VID_AMT 0x1c73 | 17 | #define USB_VID_AMT 0x1c73 |
18 | #define USB_VID_ANCHOR 0x0547 | 18 | #define USB_VID_ANCHOR 0x0547 |
19 | #define USB_VID_ANSONIC 0x10b9 | 19 | #define USB_VID_ANSONIC 0x10b9 |
20 | #define USB_VID_ANUBIS_ELECTRONIC 0x10fd | 20 | #define USB_VID_ANUBIS_ELECTRONIC 0x10fd |
21 | #define USB_VID_ASUS 0x0b05 | 21 | #define USB_VID_ASUS 0x0b05 |
22 | #define USB_VID_AVERMEDIA 0x07ca | 22 | #define USB_VID_AVERMEDIA 0x07ca |
23 | #define USB_VID_COMPRO 0x185b | 23 | #define USB_VID_COMPRO 0x185b |
24 | #define USB_VID_COMPRO_UNK 0x145f | 24 | #define USB_VID_COMPRO_UNK 0x145f |
25 | #define USB_VID_CONEXANT 0x0572 | 25 | #define USB_VID_CONEXANT 0x0572 |
26 | #define USB_VID_CYPRESS 0x04b4 | 26 | #define USB_VID_CYPRESS 0x04b4 |
27 | #define USB_VID_DEXATEK 0x1d19 | 27 | #define USB_VID_DEXATEK 0x1d19 |
28 | #define USB_VID_DIBCOM 0x10b8 | 28 | #define USB_VID_DIBCOM 0x10b8 |
29 | #define USB_VID_DPOSH 0x1498 | 29 | #define USB_VID_DPOSH 0x1498 |
30 | #define USB_VID_DVICO 0x0fe9 | 30 | #define USB_VID_DVICO 0x0fe9 |
31 | #define USB_VID_E3C 0x18b4 | 31 | #define USB_VID_E3C 0x18b4 |
32 | #define USB_VID_ELGATO 0x0fd9 | 32 | #define USB_VID_ELGATO 0x0fd9 |
33 | #define USB_VID_EMPIA 0xeb1a | 33 | #define USB_VID_EMPIA 0xeb1a |
34 | #define USB_VID_GENPIX 0x09c0 | 34 | #define USB_VID_GENPIX 0x09c0 |
35 | #define USB_VID_GRANDTEC 0x5032 | 35 | #define USB_VID_GRANDTEC 0x5032 |
36 | #define USB_VID_GTEK 0x1f4d | 36 | #define USB_VID_GTEK 0x1f4d |
37 | #define USB_VID_HANFTEK 0x15f4 | 37 | #define USB_VID_HANFTEK 0x15f4 |
38 | #define USB_VID_HAUPPAUGE 0x2040 | 38 | #define USB_VID_HAUPPAUGE 0x2040 |
39 | #define USB_VID_HYPER_PALTEK 0x1025 | 39 | #define USB_VID_HYPER_PALTEK 0x1025 |
40 | #define USB_VID_INTEL 0x8086 | 40 | #define USB_VID_INTEL 0x8086 |
41 | #define USB_VID_ITETECH 0x048d | 41 | #define USB_VID_ITETECH 0x048d |
42 | #define USB_VID_KWORLD 0xeb2a | 42 | #define USB_VID_KWORLD 0xeb2a |
43 | #define USB_VID_KWORLD_2 0x1b80 | 43 | #define USB_VID_KWORLD_2 0x1b80 |
44 | #define USB_VID_KYE 0x0458 | 44 | #define USB_VID_KYE 0x0458 |
45 | #define USB_VID_LEADTEK 0x0413 | 45 | #define USB_VID_LEADTEK 0x0413 |
46 | #define USB_VID_LITEON 0x04ca | 46 | #define USB_VID_LITEON 0x04ca |
47 | #define USB_VID_MEDION 0x1660 | 47 | #define USB_VID_MEDION 0x1660 |
48 | #define USB_VID_MIGLIA 0x18f3 | 48 | #define USB_VID_MIGLIA 0x18f3 |
49 | #define USB_VID_MSI 0x0db0 | 49 | #define USB_VID_MSI 0x0db0 |
50 | #define USB_VID_MSI_2 0x1462 | 50 | #define USB_VID_MSI_2 0x1462 |
51 | #define USB_VID_OPERA1 0x695c | 51 | #define USB_VID_OPERA1 0x695c |
52 | #define USB_VID_PINNACLE 0x2304 | 52 | #define USB_VID_PINNACLE 0x2304 |
53 | #define USB_VID_PCTV 0x2013 | 53 | #define USB_VID_PCTV 0x2013 |
54 | #define USB_VID_PIXELVIEW 0x1554 | 54 | #define USB_VID_PIXELVIEW 0x1554 |
55 | #define USB_VID_REALTEK 0x0bda | 55 | #define USB_VID_REALTEK 0x0bda |
56 | #define USB_VID_TECHNOTREND 0x0b48 | 56 | #define USB_VID_TECHNOTREND 0x0b48 |
57 | #define USB_VID_TERRATEC 0x0ccd | 57 | #define USB_VID_TERRATEC 0x0ccd |
58 | #define USB_VID_TELESTAR 0x10b9 | 58 | #define USB_VID_TELESTAR 0x10b9 |
59 | #define USB_VID_VISIONPLUS 0x13d3 | 59 | #define USB_VID_VISIONPLUS 0x13d3 |
60 | #define USB_VID_SONY 0x1415 | 60 | #define USB_VID_SONY 0x1415 |
61 | #define USB_VID_TWINHAN 0x1822 | 61 | #define USB_VID_TWINHAN 0x1822 |
62 | #define USB_VID_ULTIMA_ELECTRONIC 0x05d8 | 62 | #define USB_VID_ULTIMA_ELECTRONIC 0x05d8 |
63 | #define USB_VID_UNIWILL 0x1584 | 63 | #define USB_VID_UNIWILL 0x1584 |
64 | #define USB_VID_WIDEVIEW 0x14aa | 64 | #define USB_VID_WIDEVIEW 0x14aa |
65 | #define USB_VID_GIGABYTE 0x1044 | 65 | #define USB_VID_GIGABYTE 0x1044 |
66 | #define USB_VID_YUAN 0x1164 | 66 | #define USB_VID_YUAN 0x1164 |
67 | #define USB_VID_XTENSIONS 0x1ae7 | 67 | #define USB_VID_XTENSIONS 0x1ae7 |
68 | #define USB_VID_HUMAX_COEX 0x10b9 | 68 | #define USB_VID_HUMAX_COEX 0x10b9 |
69 | #define USB_VID_774 0x7a69 | 69 | #define USB_VID_774 0x7a69 |
70 | #define USB_VID_EVOLUTEPC 0x1e59 | 70 | #define USB_VID_EVOLUTEPC 0x1e59 |
71 | #define USB_VID_AZUREWAVE 0x13d3 | 71 | #define USB_VID_AZUREWAVE 0x13d3 |
72 | #define USB_VID_TECHNISAT 0x14f7 | 72 | #define USB_VID_TECHNISAT 0x14f7 |
73 | 73 | ||
74 | /* Product IDs */ | 74 | /* Product IDs */ |
75 | #define USB_PID_ADSTECH_USB2_COLD 0xa333 | 75 | #define USB_PID_ADSTECH_USB2_COLD 0xa333 |
76 | #define USB_PID_ADSTECH_USB2_WARM 0xa334 | 76 | #define USB_PID_ADSTECH_USB2_WARM 0xa334 |
77 | #define USB_PID_AFATECH_AF9005 0x9020 | 77 | #define USB_PID_AFATECH_AF9005 0x9020 |
78 | #define USB_PID_AFATECH_AF9015_9015 0x9015 | 78 | #define USB_PID_AFATECH_AF9015_9015 0x9015 |
79 | #define USB_PID_AFATECH_AF9015_9016 0x9016 | 79 | #define USB_PID_AFATECH_AF9015_9016 0x9016 |
80 | #define USB_PID_AFATECH_AF9035_1000 0x1000 | 80 | #define USB_PID_AFATECH_AF9035_1000 0x1000 |
81 | #define USB_PID_AFATECH_AF9035_1001 0x1001 | 81 | #define USB_PID_AFATECH_AF9035_1001 0x1001 |
82 | #define USB_PID_AFATECH_AF9035_1002 0x1002 | 82 | #define USB_PID_AFATECH_AF9035_1002 0x1002 |
83 | #define USB_PID_AFATECH_AF9035_1003 0x1003 | 83 | #define USB_PID_AFATECH_AF9035_1003 0x1003 |
84 | #define USB_PID_AFATECH_AF9035_9035 0x9035 | 84 | #define USB_PID_AFATECH_AF9035_9035 0x9035 |
85 | #define USB_PID_TREKSTOR_DVBT 0x901b | 85 | #define USB_PID_TREKSTOR_DVBT 0x901b |
86 | #define USB_PID_TREKSTOR_TERRES_2_0 0xC803 | 86 | #define USB_PID_TREKSTOR_TERRES_2_0 0xC803 |
87 | #define USB_VID_ALINK_DTU 0xf170 | 87 | #define USB_VID_ALINK_DTU 0xf170 |
88 | #define USB_PID_ANSONIC_DVBT_USB 0x6000 | 88 | #define USB_PID_ANSONIC_DVBT_USB 0x6000 |
89 | #define USB_PID_ANYSEE 0x861f | 89 | #define USB_PID_ANYSEE 0x861f |
90 | #define USB_PID_AZUREWAVE_AD_TU700 0x3237 | 90 | #define USB_PID_AZUREWAVE_AD_TU700 0x3237 |
91 | #define USB_PID_AZUREWAVE_6007 0x0ccd | 91 | #define USB_PID_AZUREWAVE_6007 0x0ccd |
92 | #define USB_PID_AVERMEDIA_DVBT_USB_COLD 0x0001 | 92 | #define USB_PID_AVERMEDIA_DVBT_USB_COLD 0x0001 |
93 | #define USB_PID_AVERMEDIA_DVBT_USB_WARM 0x0002 | 93 | #define USB_PID_AVERMEDIA_DVBT_USB_WARM 0x0002 |
94 | #define USB_PID_AVERMEDIA_DVBT_USB2_COLD 0xa800 | 94 | #define USB_PID_AVERMEDIA_DVBT_USB2_COLD 0xa800 |
95 | #define USB_PID_AVERMEDIA_DVBT_USB2_WARM 0xa801 | 95 | #define USB_PID_AVERMEDIA_DVBT_USB2_WARM 0xa801 |
96 | #define USB_PID_COMPRO_DVBU2000_COLD 0xd000 | 96 | #define USB_PID_COMPRO_DVBU2000_COLD 0xd000 |
97 | #define USB_PID_COMPRO_DVBU2000_WARM 0xd001 | 97 | #define USB_PID_COMPRO_DVBU2000_WARM 0xd001 |
98 | #define USB_PID_COMPRO_DVBU2000_UNK_COLD 0x010c | 98 | #define USB_PID_COMPRO_DVBU2000_UNK_COLD 0x010c |
99 | #define USB_PID_COMPRO_DVBU2000_UNK_WARM 0x010d | 99 | #define USB_PID_COMPRO_DVBU2000_UNK_WARM 0x010d |
100 | #define USB_PID_COMPRO_VIDEOMATE_U500 0x1e78 | 100 | #define USB_PID_COMPRO_VIDEOMATE_U500 0x1e78 |
101 | #define USB_PID_COMPRO_VIDEOMATE_U500_PC 0x1e80 | 101 | #define USB_PID_COMPRO_VIDEOMATE_U500_PC 0x1e80 |
102 | #define USB_PID_CONCEPTRONIC_CTVDIGRCU 0xe397 | 102 | #define USB_PID_CONCEPTRONIC_CTVDIGRCU 0xe397 |
103 | #define USB_PID_CONEXANT_D680_DMB 0x86d6 | 103 | #define USB_PID_CONEXANT_D680_DMB 0x86d6 |
104 | #define USB_PID_CREATIX_CTX1921 0x1921 | 104 | #define USB_PID_CREATIX_CTX1921 0x1921 |
105 | #define USB_PID_DELOCK_USB2_DVBT 0xb803 | 105 | #define USB_PID_DELOCK_USB2_DVBT 0xb803 |
106 | #define USB_PID_DIBCOM_HOOK_DEFAULT 0x0064 | 106 | #define USB_PID_DIBCOM_HOOK_DEFAULT 0x0064 |
107 | #define USB_PID_DIBCOM_HOOK_DEFAULT_REENUM 0x0065 | 107 | #define USB_PID_DIBCOM_HOOK_DEFAULT_REENUM 0x0065 |
108 | #define USB_PID_DIBCOM_MOD3000_COLD 0x0bb8 | 108 | #define USB_PID_DIBCOM_MOD3000_COLD 0x0bb8 |
109 | #define USB_PID_DIBCOM_MOD3000_WARM 0x0bb9 | 109 | #define USB_PID_DIBCOM_MOD3000_WARM 0x0bb9 |
110 | #define USB_PID_DIBCOM_MOD3001_COLD 0x0bc6 | 110 | #define USB_PID_DIBCOM_MOD3001_COLD 0x0bc6 |
111 | #define USB_PID_DIBCOM_MOD3001_WARM 0x0bc7 | 111 | #define USB_PID_DIBCOM_MOD3001_WARM 0x0bc7 |
112 | #define USB_PID_DIBCOM_STK7700P 0x1e14 | 112 | #define USB_PID_DIBCOM_STK7700P 0x1e14 |
113 | #define USB_PID_DIBCOM_STK7700P_PC 0x1e78 | 113 | #define USB_PID_DIBCOM_STK7700P_PC 0x1e78 |
114 | #define USB_PID_DIBCOM_STK7700D 0x1ef0 | 114 | #define USB_PID_DIBCOM_STK7700D 0x1ef0 |
115 | #define USB_PID_DIBCOM_STK7700_U7000 0x7001 | 115 | #define USB_PID_DIBCOM_STK7700_U7000 0x7001 |
116 | #define USB_PID_DIBCOM_STK7070P 0x1ebc | 116 | #define USB_PID_DIBCOM_STK7070P 0x1ebc |
117 | #define USB_PID_DIBCOM_STK7070PD 0x1ebe | 117 | #define USB_PID_DIBCOM_STK7070PD 0x1ebe |
118 | #define USB_PID_DIBCOM_STK807XP 0x1f90 | 118 | #define USB_PID_DIBCOM_STK807XP 0x1f90 |
119 | #define USB_PID_DIBCOM_STK807XPVR 0x1f98 | 119 | #define USB_PID_DIBCOM_STK807XPVR 0x1f98 |
120 | #define USB_PID_DIBCOM_STK8096GP 0x1fa0 | 120 | #define USB_PID_DIBCOM_STK8096GP 0x1fa0 |
121 | #define USB_PID_DIBCOM_NIM8096MD 0x1fa8 | 121 | #define USB_PID_DIBCOM_NIM8096MD 0x1fa8 |
122 | #define USB_PID_DIBCOM_TFE8096P 0x1f9C | 122 | #define USB_PID_DIBCOM_TFE8096P 0x1f9C |
123 | #define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131 | 123 | #define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131 |
124 | #define USB_PID_DIBCOM_STK7770P 0x1e80 | 124 | #define USB_PID_DIBCOM_STK7770P 0x1e80 |
125 | #define USB_PID_DIBCOM_NIM7090 0x1bb2 | 125 | #define USB_PID_DIBCOM_NIM7090 0x1bb2 |
126 | #define USB_PID_DIBCOM_TFE7090PVR 0x1bb4 | 126 | #define USB_PID_DIBCOM_TFE7090PVR 0x1bb4 |
127 | #define USB_PID_DIBCOM_TFE7790P 0x1e6e | 127 | #define USB_PID_DIBCOM_TFE7790P 0x1e6e |
128 | #define USB_PID_DIBCOM_NIM9090M 0x2383 | 128 | #define USB_PID_DIBCOM_NIM9090M 0x2383 |
129 | #define USB_PID_DIBCOM_NIM9090MD 0x2384 | 129 | #define USB_PID_DIBCOM_NIM9090MD 0x2384 |
130 | #define USB_PID_DPOSH_M9206_COLD 0x9206 | 130 | #define USB_PID_DPOSH_M9206_COLD 0x9206 |
131 | #define USB_PID_DPOSH_M9206_WARM 0xa090 | 131 | #define USB_PID_DPOSH_M9206_WARM 0xa090 |
132 | #define USB_PID_E3C_EC168 0x1689 | 132 | #define USB_PID_E3C_EC168 0x1689 |
133 | #define USB_PID_E3C_EC168_2 0xfffa | 133 | #define USB_PID_E3C_EC168_2 0xfffa |
134 | #define USB_PID_E3C_EC168_3 0xfffb | 134 | #define USB_PID_E3C_EC168_3 0xfffb |
135 | #define USB_PID_E3C_EC168_4 0x1001 | 135 | #define USB_PID_E3C_EC168_4 0x1001 |
136 | #define USB_PID_E3C_EC168_5 0x1002 | 136 | #define USB_PID_E3C_EC168_5 0x1002 |
137 | #define USB_PID_FREECOM_DVBT 0x0160 | 137 | #define USB_PID_FREECOM_DVBT 0x0160 |
138 | #define USB_PID_FREECOM_DVBT_2 0x0161 | 138 | #define USB_PID_FREECOM_DVBT_2 0x0161 |
139 | #define USB_PID_UNIWILL_STK7700P 0x6003 | 139 | #define USB_PID_UNIWILL_STK7700P 0x6003 |
140 | #define USB_PID_GENIUS_TVGO_DVB_T03 0x4012 | 140 | #define USB_PID_GENIUS_TVGO_DVB_T03 0x4012 |
141 | #define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0 | 141 | #define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0 |
142 | #define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 | 142 | #define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 |
143 | #define USB_PID_INTEL_CE9500 0x9500 | 143 | #define USB_PID_INTEL_CE9500 0x9500 |
144 | #define USB_PID_ITETECH_IT9135 0x9135 | 144 | #define USB_PID_ITETECH_IT9135 0x9135 |
145 | #define USB_PID_ITETECH_IT9135_9005 0x9005 | 145 | #define USB_PID_ITETECH_IT9135_9005 0x9005 |
146 | #define USB_PID_ITETECH_IT9135_9006 0x9006 | 146 | #define USB_PID_ITETECH_IT9135_9006 0x9006 |
147 | #define USB_PID_KWORLD_399U 0xe399 | 147 | #define USB_PID_KWORLD_399U 0xe399 |
148 | #define USB_PID_KWORLD_399U_2 0xe400 | 148 | #define USB_PID_KWORLD_399U_2 0xe400 |
149 | #define USB_PID_KWORLD_395U 0xe396 | 149 | #define USB_PID_KWORLD_395U 0xe396 |
150 | #define USB_PID_KWORLD_395U_2 0xe39b | 150 | #define USB_PID_KWORLD_395U_2 0xe39b |
151 | #define USB_PID_KWORLD_395U_3 0xe395 | 151 | #define USB_PID_KWORLD_395U_3 0xe395 |
152 | #define USB_PID_KWORLD_395U_4 0xe39a | 152 | #define USB_PID_KWORLD_395U_4 0xe39a |
153 | #define USB_PID_KWORLD_MC810 0xc810 | 153 | #define USB_PID_KWORLD_MC810 0xc810 |
154 | #define USB_PID_KWORLD_PC160_2T 0xc160 | 154 | #define USB_PID_KWORLD_PC160_2T 0xc160 |
155 | #define USB_PID_KWORLD_PC160_T 0xc161 | 155 | #define USB_PID_KWORLD_PC160_T 0xc161 |
156 | #define USB_PID_KWORLD_UB383_T 0xe383 | 156 | #define USB_PID_KWORLD_UB383_T 0xe383 |
157 | #define USB_PID_KWORLD_UB499_2T_T09 0xe409 | 157 | #define USB_PID_KWORLD_UB499_2T_T09 0xe409 |
158 | #define USB_PID_KWORLD_VSTREAM_COLD 0x17de | 158 | #define USB_PID_KWORLD_VSTREAM_COLD 0x17de |
159 | #define USB_PID_KWORLD_VSTREAM_WARM 0x17df | 159 | #define USB_PID_KWORLD_VSTREAM_WARM 0x17df |
160 | #define USB_PID_TERRATEC_CINERGY_T_USB_XE 0x0055 | 160 | #define USB_PID_TERRATEC_CINERGY_T_USB_XE 0x0055 |
161 | #define USB_PID_TERRATEC_CINERGY_T_USB_XE_REV2 0x0069 | 161 | #define USB_PID_TERRATEC_CINERGY_T_USB_XE_REV2 0x0069 |
162 | #define USB_PID_TERRATEC_CINERGY_T_STICK 0x0093 | 162 | #define USB_PID_TERRATEC_CINERGY_T_STICK 0x0093 |
163 | #define USB_PID_TERRATEC_CINERGY_T_STICK_RC 0x0097 | 163 | #define USB_PID_TERRATEC_CINERGY_T_STICK_RC 0x0097 |
164 | #define USB_PID_TERRATEC_CINERGY_T_STICK_DUAL_RC 0x0099 | 164 | #define USB_PID_TERRATEC_CINERGY_T_STICK_DUAL_RC 0x0099 |
165 | #define USB_PID_TERRATEC_CINERGY_T_STICK_BLACK_REV1 0x00a9 | 165 | #define USB_PID_TERRATEC_CINERGY_T_STICK_BLACK_REV1 0x00a9 |
166 | #define USB_PID_TWINHAN_VP7041_COLD 0x3201 | 166 | #define USB_PID_TWINHAN_VP7041_COLD 0x3201 |
167 | #define USB_PID_TWINHAN_VP7041_WARM 0x3202 | 167 | #define USB_PID_TWINHAN_VP7041_WARM 0x3202 |
168 | #define USB_PID_TWINHAN_VP7020_COLD 0x3203 | 168 | #define USB_PID_TWINHAN_VP7020_COLD 0x3203 |
169 | #define USB_PID_TWINHAN_VP7020_WARM 0x3204 | 169 | #define USB_PID_TWINHAN_VP7020_WARM 0x3204 |
170 | #define USB_PID_TWINHAN_VP7045_COLD 0x3205 | 170 | #define USB_PID_TWINHAN_VP7045_COLD 0x3205 |
171 | #define USB_PID_TWINHAN_VP7045_WARM 0x3206 | 171 | #define USB_PID_TWINHAN_VP7045_WARM 0x3206 |
172 | #define USB_PID_TWINHAN_VP7021_COLD 0x3207 | 172 | #define USB_PID_TWINHAN_VP7021_COLD 0x3207 |
173 | #define USB_PID_TWINHAN_VP7021_WARM 0x3208 | 173 | #define USB_PID_TWINHAN_VP7021_WARM 0x3208 |
174 | #define USB_PID_TWINHAN_VP7049 0x3219 | 174 | #define USB_PID_TWINHAN_VP7049 0x3219 |
175 | #define USB_PID_TINYTWIN 0x3226 | 175 | #define USB_PID_TINYTWIN 0x3226 |
176 | #define USB_PID_TINYTWIN_2 0xe402 | 176 | #define USB_PID_TINYTWIN_2 0xe402 |
177 | #define USB_PID_TINYTWIN_3 0x9016 | 177 | #define USB_PID_TINYTWIN_3 0x9016 |
178 | #define USB_PID_DNTV_TINYUSB2_COLD 0x3223 | 178 | #define USB_PID_DNTV_TINYUSB2_COLD 0x3223 |
179 | #define USB_PID_DNTV_TINYUSB2_WARM 0x3224 | 179 | #define USB_PID_DNTV_TINYUSB2_WARM 0x3224 |
180 | #define USB_PID_ULTIMA_TVBOX_COLD 0x8105 | 180 | #define USB_PID_ULTIMA_TVBOX_COLD 0x8105 |
181 | #define USB_PID_ULTIMA_TVBOX_WARM 0x8106 | 181 | #define USB_PID_ULTIMA_TVBOX_WARM 0x8106 |
182 | #define USB_PID_ULTIMA_TVBOX_AN2235_COLD 0x8107 | 182 | #define USB_PID_ULTIMA_TVBOX_AN2235_COLD 0x8107 |
183 | #define USB_PID_ULTIMA_TVBOX_AN2235_WARM 0x8108 | 183 | #define USB_PID_ULTIMA_TVBOX_AN2235_WARM 0x8108 |
184 | #define USB_PID_ULTIMA_TVBOX_ANCHOR_COLD 0x2235 | 184 | #define USB_PID_ULTIMA_TVBOX_ANCHOR_COLD 0x2235 |
185 | #define USB_PID_ULTIMA_TVBOX_USB2_COLD 0x8109 | 185 | #define USB_PID_ULTIMA_TVBOX_USB2_COLD 0x8109 |
186 | #define USB_PID_ULTIMA_TVBOX_USB2_WARM 0x810a | 186 | #define USB_PID_ULTIMA_TVBOX_USB2_WARM 0x810a |
187 | #define USB_PID_ARTEC_T14_COLD 0x810b | 187 | #define USB_PID_ARTEC_T14_COLD 0x810b |
188 | #define USB_PID_ARTEC_T14_WARM 0x810c | 188 | #define USB_PID_ARTEC_T14_WARM 0x810c |
189 | #define USB_PID_ARTEC_T14BR 0x810f | 189 | #define USB_PID_ARTEC_T14BR 0x810f |
190 | #define USB_PID_ULTIMA_TVBOX_USB2_FX_COLD 0x8613 | 190 | #define USB_PID_ULTIMA_TVBOX_USB2_FX_COLD 0x8613 |
191 | #define USB_PID_ULTIMA_TVBOX_USB2_FX_WARM 0x1002 | 191 | #define USB_PID_ULTIMA_TVBOX_USB2_FX_WARM 0x1002 |
192 | #define USB_PID_UNK_HYPER_PALTEK_COLD 0x005e | 192 | #define USB_PID_UNK_HYPER_PALTEK_COLD 0x005e |
193 | #define USB_PID_UNK_HYPER_PALTEK_WARM 0x005f | 193 | #define USB_PID_UNK_HYPER_PALTEK_WARM 0x005f |
194 | #define USB_PID_HANFTEK_UMT_010_COLD 0x0001 | 194 | #define USB_PID_HANFTEK_UMT_010_COLD 0x0001 |
195 | #define USB_PID_HANFTEK_UMT_010_WARM 0x0015 | 195 | #define USB_PID_HANFTEK_UMT_010_WARM 0x0015 |
196 | #define USB_PID_DTT200U_COLD 0x0201 | 196 | #define USB_PID_DTT200U_COLD 0x0201 |
197 | #define USB_PID_DTT200U_WARM 0x0301 | 197 | #define USB_PID_DTT200U_WARM 0x0301 |
198 | #define USB_PID_WT220U_ZAP250_COLD 0x0220 | 198 | #define USB_PID_WT220U_ZAP250_COLD 0x0220 |
199 | #define USB_PID_WT220U_COLD 0x0222 | 199 | #define USB_PID_WT220U_COLD 0x0222 |
200 | #define USB_PID_WT220U_WARM 0x0221 | 200 | #define USB_PID_WT220U_WARM 0x0221 |
201 | #define USB_PID_WT220U_FC_COLD 0x0225 | 201 | #define USB_PID_WT220U_FC_COLD 0x0225 |
202 | #define USB_PID_WT220U_FC_WARM 0x0226 | 202 | #define USB_PID_WT220U_FC_WARM 0x0226 |
203 | #define USB_PID_WT220U_ZL0353_COLD 0x022a | 203 | #define USB_PID_WT220U_ZL0353_COLD 0x022a |
204 | #define USB_PID_WT220U_ZL0353_WARM 0x022b | 204 | #define USB_PID_WT220U_ZL0353_WARM 0x022b |
205 | #define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 | 205 | #define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 |
206 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 | 206 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 |
207 | #define USB_PID_HAUPPAUGE_NOVA_T_500 0x9941 | 207 | #define USB_PID_HAUPPAUGE_NOVA_T_500 0x9941 |
208 | #define USB_PID_HAUPPAUGE_NOVA_T_500_2 0x9950 | 208 | #define USB_PID_HAUPPAUGE_NOVA_T_500_2 0x9950 |
209 | #define USB_PID_HAUPPAUGE_NOVA_T_500_3 0x8400 | 209 | #define USB_PID_HAUPPAUGE_NOVA_T_500_3 0x8400 |
210 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK 0x7050 | 210 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK 0x7050 |
211 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK_2 0x7060 | 211 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK_2 0x7060 |
212 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK_3 0x7070 | 212 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK_3 0x7070 |
213 | #define USB_PID_HAUPPAUGE_MYTV_T 0x7080 | 213 | #define USB_PID_HAUPPAUGE_MYTV_T 0x7080 |
214 | #define USB_PID_HAUPPAUGE_NOVA_TD_STICK 0x9580 | 214 | #define USB_PID_HAUPPAUGE_NOVA_TD_STICK 0x9580 |
215 | #define USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009 0x5200 | 215 | #define USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009 0x5200 |
216 | #define USB_PID_HAUPPAUGE_TIGER_ATSC 0xb200 | 216 | #define USB_PID_HAUPPAUGE_TIGER_ATSC 0xb200 |
217 | #define USB_PID_HAUPPAUGE_TIGER_ATSC_B210 0xb210 | 217 | #define USB_PID_HAUPPAUGE_TIGER_ATSC_B210 0xb210 |
218 | #define USB_PID_AVERMEDIA_EXPRESS 0xb568 | 218 | #define USB_PID_AVERMEDIA_EXPRESS 0xb568 |
219 | #define USB_PID_AVERMEDIA_VOLAR 0xa807 | 219 | #define USB_PID_AVERMEDIA_VOLAR 0xa807 |
220 | #define USB_PID_AVERMEDIA_VOLAR_2 0xb808 | 220 | #define USB_PID_AVERMEDIA_VOLAR_2 0xb808 |
221 | #define USB_PID_AVERMEDIA_VOLAR_A868R 0xa868 | 221 | #define USB_PID_AVERMEDIA_VOLAR_A868R 0xa868 |
222 | #define USB_PID_AVERMEDIA_MCE_USB_M038 0x1228 | 222 | #define USB_PID_AVERMEDIA_MCE_USB_M038 0x1228 |
223 | #define USB_PID_AVERMEDIA_HYBRID_ULTRA_USB_M039R 0x0039 | 223 | #define USB_PID_AVERMEDIA_HYBRID_ULTRA_USB_M039R 0x0039 |
224 | #define USB_PID_AVERMEDIA_HYBRID_ULTRA_USB_M039R_ATSC 0x1039 | 224 | #define USB_PID_AVERMEDIA_HYBRID_ULTRA_USB_M039R_ATSC 0x1039 |
225 | #define USB_PID_AVERMEDIA_HYBRID_ULTRA_USB_M039R_DVBT 0x2039 | 225 | #define USB_PID_AVERMEDIA_HYBRID_ULTRA_USB_M039R_DVBT 0x2039 |
226 | #define USB_PID_AVERMEDIA_VOLAR_X 0xa815 | 226 | #define USB_PID_AVERMEDIA_VOLAR_X 0xa815 |
227 | #define USB_PID_AVERMEDIA_VOLAR_X_2 0x8150 | 227 | #define USB_PID_AVERMEDIA_VOLAR_X_2 0x8150 |
228 | #define USB_PID_AVERMEDIA_A309 0xa309 | 228 | #define USB_PID_AVERMEDIA_A309 0xa309 |
229 | #define USB_PID_AVERMEDIA_A310 0xa310 | 229 | #define USB_PID_AVERMEDIA_A310 0xa310 |
230 | #define USB_PID_AVERMEDIA_A850 0x850a | 230 | #define USB_PID_AVERMEDIA_A850 0x850a |
231 | #define USB_PID_AVERMEDIA_A850T 0x850b | 231 | #define USB_PID_AVERMEDIA_A850T 0x850b |
232 | #define USB_PID_AVERMEDIA_A805 0xa805 | 232 | #define USB_PID_AVERMEDIA_A805 0xa805 |
233 | #define USB_PID_AVERMEDIA_A815M 0x815a | 233 | #define USB_PID_AVERMEDIA_A815M 0x815a |
234 | #define USB_PID_AVERMEDIA_A835 0xa835 | 234 | #define USB_PID_AVERMEDIA_A835 0xa835 |
235 | #define USB_PID_AVERMEDIA_B835 0xb835 | 235 | #define USB_PID_AVERMEDIA_B835 0xb835 |
236 | #define USB_PID_AVERMEDIA_A835B_1835 0x1835 | 236 | #define USB_PID_AVERMEDIA_A835B_1835 0x1835 |
237 | #define USB_PID_AVERMEDIA_A835B_2835 0x2835 | 237 | #define USB_PID_AVERMEDIA_A835B_2835 0x2835 |
238 | #define USB_PID_AVERMEDIA_A835B_3835 0x3835 | 238 | #define USB_PID_AVERMEDIA_A835B_3835 0x3835 |
239 | #define USB_PID_AVERMEDIA_A835B_4835 0x4835 | 239 | #define USB_PID_AVERMEDIA_A835B_4835 0x4835 |
240 | #define USB_PID_AVERMEDIA_1867 0x1867 | 240 | #define USB_PID_AVERMEDIA_1867 0x1867 |
241 | #define USB_PID_AVERMEDIA_A867 0xa867 | 241 | #define USB_PID_AVERMEDIA_A867 0xa867 |
242 | #define USB_PID_AVERMEDIA_H335 0x0335 | 242 | #define USB_PID_AVERMEDIA_H335 0x0335 |
243 | #define USB_PID_AVERMEDIA_TWINSTAR 0x0825 | 243 | #define USB_PID_AVERMEDIA_TWINSTAR 0x0825 |
244 | #define USB_PID_TECHNOTREND_CONNECT_S2400 0x3006 | 244 | #define USB_PID_TECHNOTREND_CONNECT_S2400 0x3006 |
245 | #define USB_PID_TECHNOTREND_CONNECT_S2400_8KEEPROM 0x3009 | 245 | #define USB_PID_TECHNOTREND_CONNECT_S2400_8KEEPROM 0x3009 |
246 | #define USB_PID_TECHNOTREND_CONNECT_CT3650 0x300d | 246 | #define USB_PID_TECHNOTREND_CONNECT_CT3650 0x300d |
247 | #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a | 247 | #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a |
248 | #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2 0x0081 | 248 | #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2 0x0081 |
249 | #define USB_PID_TERRATEC_CINERGY_HT_USB_XE 0x0058 | 249 | #define USB_PID_TERRATEC_CINERGY_HT_USB_XE 0x0058 |
250 | #define USB_PID_TERRATEC_CINERGY_HT_EXPRESS 0x0060 | 250 | #define USB_PID_TERRATEC_CINERGY_HT_EXPRESS 0x0060 |
251 | #define USB_PID_TERRATEC_CINERGY_T_EXPRESS 0x0062 | 251 | #define USB_PID_TERRATEC_CINERGY_T_EXPRESS 0x0062 |
252 | #define USB_PID_TERRATEC_CINERGY_T_XXS 0x0078 | 252 | #define USB_PID_TERRATEC_CINERGY_T_XXS 0x0078 |
253 | #define USB_PID_TERRATEC_CINERGY_T_XXS_2 0x00ab | 253 | #define USB_PID_TERRATEC_CINERGY_T_XXS_2 0x00ab |
254 | #define USB_PID_TERRATEC_H7 0x10b4 | 254 | #define USB_PID_TERRATEC_H7 0x10b4 |
255 | #define USB_PID_TERRATEC_H7_2 0x10a3 | 255 | #define USB_PID_TERRATEC_H7_2 0x10a3 |
256 | #define USB_PID_TERRATEC_T3 0x10a0 | 256 | #define USB_PID_TERRATEC_T3 0x10a0 |
257 | #define USB_PID_TERRATEC_T5 0x10a1 | 257 | #define USB_PID_TERRATEC_T5 0x10a1 |
258 | #define USB_PID_NOXON_DAB_STICK 0x00b3 | 258 | #define USB_PID_NOXON_DAB_STICK 0x00b3 |
259 | #define USB_PID_NOXON_DAB_STICK_REV2 0x00e0 | 259 | #define USB_PID_NOXON_DAB_STICK_REV2 0x00e0 |
260 | #define USB_PID_NOXON_DAB_STICK_REV3 0x00b4 | 260 | #define USB_PID_NOXON_DAB_STICK_REV3 0x00b4 |
261 | #define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e | 261 | #define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e |
262 | #define USB_PID_PINNACLE_PCTV2000E 0x022c | 262 | #define USB_PID_PINNACLE_PCTV2000E 0x022c |
263 | #define USB_PID_PINNACLE_PCTV_DVB_T_FLASH 0x0228 | 263 | #define USB_PID_PINNACLE_PCTV_DVB_T_FLASH 0x0228 |
264 | #define USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T 0x0229 | 264 | #define USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T 0x0229 |
265 | #define USB_PID_PINNACLE_PCTV71E 0x022b | 265 | #define USB_PID_PINNACLE_PCTV71E 0x022b |
266 | #define USB_PID_PINNACLE_PCTV72E 0x0236 | 266 | #define USB_PID_PINNACLE_PCTV72E 0x0236 |
267 | #define USB_PID_PINNACLE_PCTV73E 0x0237 | 267 | #define USB_PID_PINNACLE_PCTV73E 0x0237 |
268 | #define USB_PID_PINNACLE_PCTV310E 0x3211 | 268 | #define USB_PID_PINNACLE_PCTV310E 0x3211 |
269 | #define USB_PID_PINNACLE_PCTV801E 0x023a | 269 | #define USB_PID_PINNACLE_PCTV801E 0x023a |
270 | #define USB_PID_PINNACLE_PCTV801E_SE 0x023b | 270 | #define USB_PID_PINNACLE_PCTV801E_SE 0x023b |
271 | #define USB_PID_PINNACLE_PCTV340E 0x023d | 271 | #define USB_PID_PINNACLE_PCTV340E 0x023d |
272 | #define USB_PID_PINNACLE_PCTV340E_SE 0x023e | 272 | #define USB_PID_PINNACLE_PCTV340E_SE 0x023e |
273 | #define USB_PID_PINNACLE_PCTV73A 0x0243 | 273 | #define USB_PID_PINNACLE_PCTV73A 0x0243 |
274 | #define USB_PID_PINNACLE_PCTV73ESE 0x0245 | 274 | #define USB_PID_PINNACLE_PCTV73ESE 0x0245 |
275 | #define USB_PID_PINNACLE_PCTV74E 0x0246 | 275 | #define USB_PID_PINNACLE_PCTV74E 0x0246 |
276 | #define USB_PID_PINNACLE_PCTV282E 0x0248 | 276 | #define USB_PID_PINNACLE_PCTV282E 0x0248 |
277 | #define USB_PID_PIXELVIEW_SBTVD 0x5010 | 277 | #define USB_PID_PIXELVIEW_SBTVD 0x5010 |
278 | #define USB_PID_PCTV_200E 0x020e | 278 | #define USB_PID_PCTV_200E 0x020e |
279 | #define USB_PID_PCTV_400E 0x020f | 279 | #define USB_PID_PCTV_400E 0x020f |
280 | #define USB_PID_PCTV_450E 0x0222 | 280 | #define USB_PID_PCTV_450E 0x0222 |
281 | #define USB_PID_PCTV_452E 0x021f | 281 | #define USB_PID_PCTV_452E 0x021f |
282 | #define USB_PID_REALTEK_RTL2831U 0x2831 | 282 | #define USB_PID_REALTEK_RTL2831U 0x2831 |
283 | #define USB_PID_REALTEK_RTL2832U 0x2832 | 283 | #define USB_PID_REALTEK_RTL2832U 0x2832 |
284 | #define USB_PID_TECHNOTREND_CONNECT_S2_3600 0x3007 | 284 | #define USB_PID_TECHNOTREND_CONNECT_S2_3600 0x3007 |
285 | #define USB_PID_TECHNOTREND_CONNECT_S2_3650_CI 0x300a | 285 | #define USB_PID_TECHNOTREND_CONNECT_S2_3650_CI 0x300a |
286 | #define USB_PID_NEBULA_DIGITV 0x0201 | 286 | #define USB_PID_NEBULA_DIGITV 0x0201 |
287 | #define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820 | 287 | #define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820 |
288 | #define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500 | 288 | #define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500 |
289 | #define USB_PID_DVICO_BLUEBIRD_LG064F_WARM 0xd501 | 289 | #define USB_PID_DVICO_BLUEBIRD_LG064F_WARM 0xd501 |
290 | #define USB_PID_DVICO_BLUEBIRD_LGZ201_COLD 0xdb00 | 290 | #define USB_PID_DVICO_BLUEBIRD_LGZ201_COLD 0xdb00 |
291 | #define USB_PID_DVICO_BLUEBIRD_LGZ201_WARM 0xdb01 | 291 | #define USB_PID_DVICO_BLUEBIRD_LGZ201_WARM 0xdb01 |
292 | #define USB_PID_DVICO_BLUEBIRD_TH7579_COLD 0xdb10 | 292 | #define USB_PID_DVICO_BLUEBIRD_TH7579_COLD 0xdb10 |
293 | #define USB_PID_DVICO_BLUEBIRD_TH7579_WARM 0xdb11 | 293 | #define USB_PID_DVICO_BLUEBIRD_TH7579_WARM 0xdb11 |
294 | #define USB_PID_DVICO_BLUEBIRD_DUAL_1_COLD 0xdb50 | 294 | #define USB_PID_DVICO_BLUEBIRD_DUAL_1_COLD 0xdb50 |
295 | #define USB_PID_DVICO_BLUEBIRD_DUAL_1_WARM 0xdb51 | 295 | #define USB_PID_DVICO_BLUEBIRD_DUAL_1_WARM 0xdb51 |
296 | #define USB_PID_DVICO_BLUEBIRD_DUAL_2_COLD 0xdb58 | 296 | #define USB_PID_DVICO_BLUEBIRD_DUAL_2_COLD 0xdb58 |
297 | #define USB_PID_DVICO_BLUEBIRD_DUAL_2_WARM 0xdb59 | 297 | #define USB_PID_DVICO_BLUEBIRD_DUAL_2_WARM 0xdb59 |
298 | #define USB_PID_DVICO_BLUEBIRD_DUAL_4 0xdb78 | 298 | #define USB_PID_DVICO_BLUEBIRD_DUAL_4 0xdb78 |
299 | #define USB_PID_DVICO_BLUEBIRD_DUAL_4_REV_2 0xdb98 | 299 | #define USB_PID_DVICO_BLUEBIRD_DUAL_4_REV_2 0xdb98 |
300 | #define USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2 0xdb70 | 300 | #define USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2 0xdb70 |
301 | #define USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2_NFW_WARM 0xdb71 | 301 | #define USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2_NFW_WARM 0xdb71 |
302 | #define USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_COLD 0xdb54 | 302 | #define USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_COLD 0xdb54 |
303 | #define USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_WARM 0xdb55 | 303 | #define USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_WARM 0xdb55 |
304 | #define USB_PID_MEDION_MD95700 0x0932 | 304 | #define USB_PID_MEDION_MD95700 0x0932 |
305 | #define USB_PID_MSI_MEGASKY580 0x5580 | 305 | #define USB_PID_MSI_MEGASKY580 0x5580 |
306 | #define USB_PID_MSI_MEGASKY580_55801 0x5581 | 306 | #define USB_PID_MSI_MEGASKY580_55801 0x5581 |
307 | #define USB_PID_KYE_DVB_T_COLD 0x701e | 307 | #define USB_PID_KYE_DVB_T_COLD 0x701e |
308 | #define USB_PID_KYE_DVB_T_WARM 0x701f | 308 | #define USB_PID_KYE_DVB_T_WARM 0x701f |
309 | #define USB_PID_LITEON_DVB_T_COLD 0xf000 | 309 | #define USB_PID_LITEON_DVB_T_COLD 0xf000 |
310 | #define USB_PID_LITEON_DVB_T_WARM 0xf001 | 310 | #define USB_PID_LITEON_DVB_T_WARM 0xf001 |
311 | #define USB_PID_DIGIVOX_MINI_SL_COLD 0xe360 | 311 | #define USB_PID_DIGIVOX_MINI_SL_COLD 0xe360 |
312 | #define USB_PID_DIGIVOX_MINI_SL_WARM 0xe361 | 312 | #define USB_PID_DIGIVOX_MINI_SL_WARM 0xe361 |
313 | #define USB_PID_GRANDTEC_DVBT_USB2_COLD 0x0bc6 | 313 | #define USB_PID_GRANDTEC_DVBT_USB2_COLD 0x0bc6 |
314 | #define USB_PID_GRANDTEC_DVBT_USB2_WARM 0x0bc7 | 314 | #define USB_PID_GRANDTEC_DVBT_USB2_WARM 0x0bc7 |
315 | #define USB_PID_WINFAST_DTV2000DS 0x6a04 | 315 | #define USB_PID_WINFAST_DTV2000DS 0x6a04 |
316 | #define USB_PID_WINFAST_DTV_DONGLE_COLD 0x6025 | 316 | #define USB_PID_WINFAST_DTV_DONGLE_COLD 0x6025 |
317 | #define USB_PID_WINFAST_DTV_DONGLE_WARM 0x6026 | 317 | #define USB_PID_WINFAST_DTV_DONGLE_WARM 0x6026 |
318 | #define USB_PID_WINFAST_DTV_DONGLE_STK7700P 0x6f00 | 318 | #define USB_PID_WINFAST_DTV_DONGLE_STK7700P 0x6f00 |
319 | #define USB_PID_WINFAST_DTV_DONGLE_H 0x60f6 | 319 | #define USB_PID_WINFAST_DTV_DONGLE_H 0x60f6 |
320 | #define USB_PID_WINFAST_DTV_DONGLE_STK7700P_2 0x6f01 | 320 | #define USB_PID_WINFAST_DTV_DONGLE_STK7700P_2 0x6f01 |
321 | #define USB_PID_WINFAST_DTV_DONGLE_GOLD 0x6029 | 321 | #define USB_PID_WINFAST_DTV_DONGLE_GOLD 0x6029 |
322 | #define USB_PID_WINFAST_DTV_DONGLE_MINID 0x6f0f | 322 | #define USB_PID_WINFAST_DTV_DONGLE_MINID 0x6f0f |
323 | #define USB_PID_GENPIX_8PSK_REV_1_COLD 0x0200 | 323 | #define USB_PID_GENPIX_8PSK_REV_1_COLD 0x0200 |
324 | #define USB_PID_GENPIX_8PSK_REV_1_WARM 0x0201 | 324 | #define USB_PID_GENPIX_8PSK_REV_1_WARM 0x0201 |
325 | #define USB_PID_GENPIX_8PSK_REV_2 0x0202 | 325 | #define USB_PID_GENPIX_8PSK_REV_2 0x0202 |
326 | #define USB_PID_GENPIX_SKYWALKER_1 0x0203 | 326 | #define USB_PID_GENPIX_SKYWALKER_1 0x0203 |
327 | #define USB_PID_GENPIX_SKYWALKER_CW3K 0x0204 | 327 | #define USB_PID_GENPIX_SKYWALKER_CW3K 0x0204 |
328 | #define USB_PID_GENPIX_SKYWALKER_2 0x0206 | 328 | #define USB_PID_GENPIX_SKYWALKER_2 0x0206 |
329 | #define USB_PID_SIGMATEK_DVB_110 0x6610 | 329 | #define USB_PID_SIGMATEK_DVB_110 0x6610 |
330 | #define USB_PID_MSI_DIGI_VOX_MINI_II 0x1513 | 330 | #define USB_PID_MSI_DIGI_VOX_MINI_II 0x1513 |
331 | #define USB_PID_MSI_DIGIVOX_DUO 0x8801 | 331 | #define USB_PID_MSI_DIGIVOX_DUO 0x8801 |
332 | #define USB_PID_OPERA1_COLD 0x2830 | 332 | #define USB_PID_OPERA1_COLD 0x2830 |
333 | #define USB_PID_OPERA1_WARM 0x3829 | 333 | #define USB_PID_OPERA1_WARM 0x3829 |
334 | #define USB_PID_LIFEVIEW_TV_WALKER_TWIN_COLD 0x0514 | 334 | #define USB_PID_LIFEVIEW_TV_WALKER_TWIN_COLD 0x0514 |
335 | #define USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM 0x0513 | 335 | #define USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM 0x0513 |
336 | #define USB_PID_GIGABYTE_U7000 0x7001 | 336 | #define USB_PID_GIGABYTE_U7000 0x7001 |
337 | #define USB_PID_GIGABYTE_U8000 0x7002 | 337 | #define USB_PID_GIGABYTE_U8000 0x7002 |
338 | #define USB_PID_ASUS_U3000 0x171f | 338 | #define USB_PID_ASUS_U3000 0x171f |
339 | #define USB_PID_ASUS_U3000H 0x1736 | 339 | #define USB_PID_ASUS_U3000H 0x1736 |
340 | #define USB_PID_ASUS_U3100 0x173f | 340 | #define USB_PID_ASUS_U3100 0x173f |
341 | #define USB_PID_ASUS_U3100MINI_PLUS 0x1779 | 341 | #define USB_PID_ASUS_U3100MINI_PLUS 0x1779 |
342 | #define USB_PID_YUAN_EC372S 0x1edc | 342 | #define USB_PID_YUAN_EC372S 0x1edc |
343 | #define USB_PID_YUAN_STK7700PH 0x1f08 | 343 | #define USB_PID_YUAN_STK7700PH 0x1f08 |
344 | #define USB_PID_YUAN_PD378S 0x2edc | 344 | #define USB_PID_YUAN_PD378S 0x2edc |
345 | #define USB_PID_YUAN_MC770 0x0871 | 345 | #define USB_PID_YUAN_MC770 0x0871 |
346 | #define USB_PID_YUAN_STK7700D 0x1efc | 346 | #define USB_PID_YUAN_STK7700D 0x1efc |
347 | #define USB_PID_YUAN_STK7700D_2 0x1e8c | 347 | #define USB_PID_YUAN_STK7700D_2 0x1e8c |
348 | #define USB_PID_DW2102 0x2102 | 348 | #define USB_PID_DW2102 0x2102 |
349 | #define USB_PID_XTENSIONS_XD_380 0x0381 | 349 | #define USB_PID_XTENSIONS_XD_380 0x0381 |
350 | #define USB_PID_TELESTAR_STARSTICK_2 0x8000 | 350 | #define USB_PID_TELESTAR_STARSTICK_2 0x8000 |
351 | #define USB_PID_MSI_DIGI_VOX_MINI_III 0x8807 | 351 | #define USB_PID_MSI_DIGI_VOX_MINI_III 0x8807 |
352 | #define USB_PID_SONY_PLAYTV 0x0003 | 352 | #define USB_PID_SONY_PLAYTV 0x0003 |
353 | #define USB_PID_MYGICA_D689 0xd811 | 353 | #define USB_PID_MYGICA_D689 0xd811 |
354 | #define USB_PID_ELGATO_EYETV_DIVERSITY 0x0011 | 354 | #define USB_PID_ELGATO_EYETV_DIVERSITY 0x0011 |
355 | #define USB_PID_ELGATO_EYETV_DTT 0x0021 | 355 | #define USB_PID_ELGATO_EYETV_DTT 0x0021 |
356 | #define USB_PID_ELGATO_EYETV_DTT_2 0x003f | 356 | #define USB_PID_ELGATO_EYETV_DTT_2 0x003f |
357 | #define USB_PID_ELGATO_EYETV_DTT_Dlx 0x0020 | 357 | #define USB_PID_ELGATO_EYETV_DTT_Dlx 0x0020 |
358 | #define USB_PID_ELGATO_EYETV_SAT 0x002a | 358 | #define USB_PID_ELGATO_EYETV_SAT 0x002a |
359 | #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD 0x5000 | 359 | #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD 0x5000 |
360 | #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_WARM 0x5001 | 360 | #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_WARM 0x5001 |
361 | #define USB_PID_FRIIO_WHITE 0x0001 | 361 | #define USB_PID_FRIIO_WHITE 0x0001 |
362 | #define USB_PID_TVWAY_PLUS 0x0002 | 362 | #define USB_PID_TVWAY_PLUS 0x0002 |
363 | #define USB_PID_SVEON_STV20 0xe39d | 363 | #define USB_PID_SVEON_STV20 0xe39d |
364 | #define USB_PID_SVEON_STV20_RTL2832U 0xd39d | 364 | #define USB_PID_SVEON_STV20_RTL2832U 0xd39d |
365 | #define USB_PID_SVEON_STV22 0xe401 | 365 | #define USB_PID_SVEON_STV22 0xe401 |
366 | #define USB_PID_SVEON_STV22_IT9137 0xe411 | 366 | #define USB_PID_SVEON_STV22_IT9137 0xe411 |
367 | #define USB_PID_AZUREWAVE_AZ6027 0x3275 | 367 | #define USB_PID_AZUREWAVE_AZ6027 0x3275 |
368 | #define USB_PID_TERRATEC_DVBS2CI_V1 0x10a4 | 368 | #define USB_PID_TERRATEC_DVBS2CI_V1 0x10a4 |
369 | #define USB_PID_TERRATEC_DVBS2CI_V2 0x10ac | 369 | #define USB_PID_TERRATEC_DVBS2CI_V2 0x10ac |
370 | #define USB_PID_TECHNISAT_USB2_HDCI_V1 0x0001 | 370 | #define USB_PID_TECHNISAT_USB2_HDCI_V1 0x0001 |
371 | #define USB_PID_TECHNISAT_USB2_HDCI_V2 0x0002 | 371 | #define USB_PID_TECHNISAT_USB2_HDCI_V2 0x0002 |
372 | #define USB_PID_TECHNISAT_USB2_CABLESTAR_HDCI 0x0003 | 372 | #define USB_PID_TECHNISAT_USB2_CABLESTAR_HDCI 0x0003 |
373 | #define USB_PID_TECHNISAT_AIRSTAR_TELESTICK_2 0x0004 | 373 | #define USB_PID_TECHNISAT_AIRSTAR_TELESTICK_2 0x0004 |
374 | #define USB_PID_TECHNISAT_USB2_DVB_S2 0x0500 | 374 | #define USB_PID_TECHNISAT_USB2_DVB_S2 0x0500 |
375 | #define USB_PID_CPYTO_REDI_PC50A 0xa803 | 375 | #define USB_PID_CPYTO_REDI_PC50A 0xa803 |
376 | #define USB_PID_CTVDIGDUAL_V2 0xe410 | 376 | #define USB_PID_CTVDIGDUAL_V2 0xe410 |
377 | #define USB_PID_PCTV_2002E 0x025c | 377 | #define USB_PID_PCTV_2002E 0x025c |
378 | #define USB_PID_PCTV_2002E_SE 0x025d | 378 | #define USB_PID_PCTV_2002E_SE 0x025d |
379 | #define USB_PID_SVEON_STV27 0xd3af | ||
379 | #endif | 380 | #endif |
380 | 381 |
drivers/media/usb/dvb-usb-v2/rtl28xxu.c
1 | /* | 1 | /* |
2 | * Realtek RTL28xxU DVB USB driver | 2 | * Realtek RTL28xxU DVB USB driver |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Antti Palosaari <crope@iki.fi> | 4 | * Copyright (C) 2009 Antti Palosaari <crope@iki.fi> |
5 | * Copyright (C) 2011 Antti Palosaari <crope@iki.fi> | 5 | * Copyright (C) 2011 Antti Palosaari <crope@iki.fi> |
6 | * Copyright (C) 2012 Thomas Mair <thomas.mair86@googlemail.com> | 6 | * Copyright (C) 2012 Thomas Mair <thomas.mair86@googlemail.com> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or | 10 | * the Free Software Foundation; either version 2 of the License, or |
11 | * (at your option) any later version. | 11 | * (at your option) any later version. |
12 | * | 12 | * |
13 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | * | 17 | * |
18 | * You should have received a copy of the GNU General Public License along | 18 | * You should have received a copy of the GNU General Public License along |
19 | * with this program; if not, write to the Free Software Foundation, Inc., | 19 | * with this program; if not, write to the Free Software Foundation, Inc., |
20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include "rtl28xxu.h" | 23 | #include "rtl28xxu.h" |
24 | 24 | ||
25 | #include "rtl2830.h" | 25 | #include "rtl2830.h" |
26 | #include "rtl2832.h" | 26 | #include "rtl2832.h" |
27 | 27 | ||
28 | #include "qt1010.h" | 28 | #include "qt1010.h" |
29 | #include "mt2060.h" | 29 | #include "mt2060.h" |
30 | #include "mxl5005s.h" | 30 | #include "mxl5005s.h" |
31 | #include "fc0012.h" | 31 | #include "fc0012.h" |
32 | #include "fc0013.h" | 32 | #include "fc0013.h" |
33 | #include "e4000.h" | 33 | #include "e4000.h" |
34 | #include "fc2580.h" | 34 | #include "fc2580.h" |
35 | #include "tua9001.h" | 35 | #include "tua9001.h" |
36 | #include "r820t.h" | 36 | #include "r820t.h" |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * RTL2832_SDR module is in staging. That logic is added in order to avoid any | 39 | * RTL2832_SDR module is in staging. That logic is added in order to avoid any |
40 | * hard dependency to drivers/staging/ directory as we want compile mainline | 40 | * hard dependency to drivers/staging/ directory as we want compile mainline |
41 | * driver even whole staging directory is missing. | 41 | * driver even whole staging directory is missing. |
42 | */ | 42 | */ |
43 | #include <media/v4l2-subdev.h> | 43 | #include <media/v4l2-subdev.h> |
44 | 44 | ||
45 | #if IS_ENABLED(CONFIG_DVB_RTL2832_SDR) | 45 | #if IS_ENABLED(CONFIG_DVB_RTL2832_SDR) |
46 | struct dvb_frontend *rtl2832_sdr_attach(struct dvb_frontend *fe, | 46 | struct dvb_frontend *rtl2832_sdr_attach(struct dvb_frontend *fe, |
47 | struct i2c_adapter *i2c, const struct rtl2832_config *cfg, | 47 | struct i2c_adapter *i2c, const struct rtl2832_config *cfg, |
48 | struct v4l2_subdev *sd); | 48 | struct v4l2_subdev *sd); |
49 | #else | 49 | #else |
50 | static inline struct dvb_frontend *rtl2832_sdr_attach(struct dvb_frontend *fe, | 50 | static inline struct dvb_frontend *rtl2832_sdr_attach(struct dvb_frontend *fe, |
51 | struct i2c_adapter *i2c, const struct rtl2832_config *cfg, | 51 | struct i2c_adapter *i2c, const struct rtl2832_config *cfg, |
52 | struct v4l2_subdev *sd) | 52 | struct v4l2_subdev *sd) |
53 | { | 53 | { |
54 | return NULL; | 54 | return NULL; |
55 | } | 55 | } |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | #ifdef CONFIG_MEDIA_ATTACH | 58 | #ifdef CONFIG_MEDIA_ATTACH |
59 | #define dvb_attach_sdr(FUNCTION, ARGS...) ({ \ | 59 | #define dvb_attach_sdr(FUNCTION, ARGS...) ({ \ |
60 | void *__r = NULL; \ | 60 | void *__r = NULL; \ |
61 | typeof(&FUNCTION) __a = symbol_request(FUNCTION); \ | 61 | typeof(&FUNCTION) __a = symbol_request(FUNCTION); \ |
62 | if (__a) { \ | 62 | if (__a) { \ |
63 | __r = (void *) __a(ARGS); \ | 63 | __r = (void *) __a(ARGS); \ |
64 | if (__r == NULL) \ | 64 | if (__r == NULL) \ |
65 | symbol_put(FUNCTION); \ | 65 | symbol_put(FUNCTION); \ |
66 | } \ | 66 | } \ |
67 | __r; \ | 67 | __r; \ |
68 | }) | 68 | }) |
69 | 69 | ||
70 | #else | 70 | #else |
71 | #define dvb_attach_sdr(FUNCTION, ARGS...) ({ \ | 71 | #define dvb_attach_sdr(FUNCTION, ARGS...) ({ \ |
72 | FUNCTION(ARGS); \ | 72 | FUNCTION(ARGS); \ |
73 | }) | 73 | }) |
74 | 74 | ||
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | static int rtl28xxu_disable_rc; | 77 | static int rtl28xxu_disable_rc; |
78 | module_param_named(disable_rc, rtl28xxu_disable_rc, int, 0644); | 78 | module_param_named(disable_rc, rtl28xxu_disable_rc, int, 0644); |
79 | MODULE_PARM_DESC(disable_rc, "disable RTL2832U remote controller"); | 79 | MODULE_PARM_DESC(disable_rc, "disable RTL2832U remote controller"); |
80 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 80 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
81 | 81 | ||
82 | static int rtl28xxu_ctrl_msg(struct dvb_usb_device *d, struct rtl28xxu_req *req) | 82 | static int rtl28xxu_ctrl_msg(struct dvb_usb_device *d, struct rtl28xxu_req *req) |
83 | { | 83 | { |
84 | int ret; | 84 | int ret; |
85 | unsigned int pipe; | 85 | unsigned int pipe; |
86 | u8 requesttype; | 86 | u8 requesttype; |
87 | u8 *buf; | 87 | u8 *buf; |
88 | 88 | ||
89 | buf = kmalloc(req->size, GFP_KERNEL); | 89 | buf = kmalloc(req->size, GFP_KERNEL); |
90 | if (!buf) { | 90 | if (!buf) { |
91 | ret = -ENOMEM; | 91 | ret = -ENOMEM; |
92 | goto err; | 92 | goto err; |
93 | } | 93 | } |
94 | 94 | ||
95 | if (req->index & CMD_WR_FLAG) { | 95 | if (req->index & CMD_WR_FLAG) { |
96 | /* write */ | 96 | /* write */ |
97 | memcpy(buf, req->data, req->size); | 97 | memcpy(buf, req->data, req->size); |
98 | requesttype = (USB_TYPE_VENDOR | USB_DIR_OUT); | 98 | requesttype = (USB_TYPE_VENDOR | USB_DIR_OUT); |
99 | pipe = usb_sndctrlpipe(d->udev, 0); | 99 | pipe = usb_sndctrlpipe(d->udev, 0); |
100 | } else { | 100 | } else { |
101 | /* read */ | 101 | /* read */ |
102 | requesttype = (USB_TYPE_VENDOR | USB_DIR_IN); | 102 | requesttype = (USB_TYPE_VENDOR | USB_DIR_IN); |
103 | pipe = usb_rcvctrlpipe(d->udev, 0); | 103 | pipe = usb_rcvctrlpipe(d->udev, 0); |
104 | } | 104 | } |
105 | 105 | ||
106 | ret = usb_control_msg(d->udev, pipe, 0, requesttype, req->value, | 106 | ret = usb_control_msg(d->udev, pipe, 0, requesttype, req->value, |
107 | req->index, buf, req->size, 1000); | 107 | req->index, buf, req->size, 1000); |
108 | 108 | ||
109 | dvb_usb_dbg_usb_control_msg(d->udev, 0, requesttype, req->value, | 109 | dvb_usb_dbg_usb_control_msg(d->udev, 0, requesttype, req->value, |
110 | req->index, buf, req->size); | 110 | req->index, buf, req->size); |
111 | 111 | ||
112 | if (ret > 0) | 112 | if (ret > 0) |
113 | ret = 0; | 113 | ret = 0; |
114 | 114 | ||
115 | /* read request, copy returned data to return buf */ | 115 | /* read request, copy returned data to return buf */ |
116 | if (!ret && requesttype == (USB_TYPE_VENDOR | USB_DIR_IN)) | 116 | if (!ret && requesttype == (USB_TYPE_VENDOR | USB_DIR_IN)) |
117 | memcpy(req->data, buf, req->size); | 117 | memcpy(req->data, buf, req->size); |
118 | 118 | ||
119 | kfree(buf); | 119 | kfree(buf); |
120 | 120 | ||
121 | if (ret) | 121 | if (ret) |
122 | goto err; | 122 | goto err; |
123 | 123 | ||
124 | return ret; | 124 | return ret; |
125 | err: | 125 | err: |
126 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 126 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
127 | return ret; | 127 | return ret; |
128 | } | 128 | } |
129 | 129 | ||
130 | static int rtl28xx_wr_regs(struct dvb_usb_device *d, u16 reg, u8 *val, int len) | 130 | static int rtl28xx_wr_regs(struct dvb_usb_device *d, u16 reg, u8 *val, int len) |
131 | { | 131 | { |
132 | struct rtl28xxu_req req; | 132 | struct rtl28xxu_req req; |
133 | 133 | ||
134 | if (reg < 0x3000) | 134 | if (reg < 0x3000) |
135 | req.index = CMD_USB_WR; | 135 | req.index = CMD_USB_WR; |
136 | else if (reg < 0x4000) | 136 | else if (reg < 0x4000) |
137 | req.index = CMD_SYS_WR; | 137 | req.index = CMD_SYS_WR; |
138 | else | 138 | else |
139 | req.index = CMD_IR_WR; | 139 | req.index = CMD_IR_WR; |
140 | 140 | ||
141 | req.value = reg; | 141 | req.value = reg; |
142 | req.size = len; | 142 | req.size = len; |
143 | req.data = val; | 143 | req.data = val; |
144 | 144 | ||
145 | return rtl28xxu_ctrl_msg(d, &req); | 145 | return rtl28xxu_ctrl_msg(d, &req); |
146 | } | 146 | } |
147 | 147 | ||
148 | static int rtl2831_rd_regs(struct dvb_usb_device *d, u16 reg, u8 *val, int len) | 148 | static int rtl2831_rd_regs(struct dvb_usb_device *d, u16 reg, u8 *val, int len) |
149 | { | 149 | { |
150 | struct rtl28xxu_req req; | 150 | struct rtl28xxu_req req; |
151 | 151 | ||
152 | if (reg < 0x3000) | 152 | if (reg < 0x3000) |
153 | req.index = CMD_USB_RD; | 153 | req.index = CMD_USB_RD; |
154 | else if (reg < 0x4000) | 154 | else if (reg < 0x4000) |
155 | req.index = CMD_SYS_RD; | 155 | req.index = CMD_SYS_RD; |
156 | else | 156 | else |
157 | req.index = CMD_IR_RD; | 157 | req.index = CMD_IR_RD; |
158 | 158 | ||
159 | req.value = reg; | 159 | req.value = reg; |
160 | req.size = len; | 160 | req.size = len; |
161 | req.data = val; | 161 | req.data = val; |
162 | 162 | ||
163 | return rtl28xxu_ctrl_msg(d, &req); | 163 | return rtl28xxu_ctrl_msg(d, &req); |
164 | } | 164 | } |
165 | 165 | ||
166 | static int rtl28xx_wr_reg(struct dvb_usb_device *d, u16 reg, u8 val) | 166 | static int rtl28xx_wr_reg(struct dvb_usb_device *d, u16 reg, u8 val) |
167 | { | 167 | { |
168 | return rtl28xx_wr_regs(d, reg, &val, 1); | 168 | return rtl28xx_wr_regs(d, reg, &val, 1); |
169 | } | 169 | } |
170 | 170 | ||
171 | static int rtl28xx_rd_reg(struct dvb_usb_device *d, u16 reg, u8 *val) | 171 | static int rtl28xx_rd_reg(struct dvb_usb_device *d, u16 reg, u8 *val) |
172 | { | 172 | { |
173 | return rtl2831_rd_regs(d, reg, val, 1); | 173 | return rtl2831_rd_regs(d, reg, val, 1); |
174 | } | 174 | } |
175 | 175 | ||
176 | static int rtl28xx_wr_reg_mask(struct dvb_usb_device *d, u16 reg, u8 val, | 176 | static int rtl28xx_wr_reg_mask(struct dvb_usb_device *d, u16 reg, u8 val, |
177 | u8 mask) | 177 | u8 mask) |
178 | { | 178 | { |
179 | int ret; | 179 | int ret; |
180 | u8 tmp; | 180 | u8 tmp; |
181 | 181 | ||
182 | /* no need for read if whole reg is written */ | 182 | /* no need for read if whole reg is written */ |
183 | if (mask != 0xff) { | 183 | if (mask != 0xff) { |
184 | ret = rtl28xx_rd_reg(d, reg, &tmp); | 184 | ret = rtl28xx_rd_reg(d, reg, &tmp); |
185 | if (ret) | 185 | if (ret) |
186 | return ret; | 186 | return ret; |
187 | 187 | ||
188 | val &= mask; | 188 | val &= mask; |
189 | tmp &= ~mask; | 189 | tmp &= ~mask; |
190 | val |= tmp; | 190 | val |= tmp; |
191 | } | 191 | } |
192 | 192 | ||
193 | return rtl28xx_wr_reg(d, reg, val); | 193 | return rtl28xx_wr_reg(d, reg, val); |
194 | } | 194 | } |
195 | 195 | ||
196 | /* I2C */ | 196 | /* I2C */ |
197 | static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], | 197 | static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], |
198 | int num) | 198 | int num) |
199 | { | 199 | { |
200 | int ret; | 200 | int ret; |
201 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 201 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
202 | struct rtl28xxu_priv *priv = d->priv; | 202 | struct rtl28xxu_priv *priv = d->priv; |
203 | struct rtl28xxu_req req; | 203 | struct rtl28xxu_req req; |
204 | 204 | ||
205 | /* | 205 | /* |
206 | * It is not known which are real I2C bus xfer limits, but testing | 206 | * It is not known which are real I2C bus xfer limits, but testing |
207 | * with RTL2831U + MT2060 gives max RD 24 and max WR 22 bytes. | 207 | * with RTL2831U + MT2060 gives max RD 24 and max WR 22 bytes. |
208 | * TODO: find out RTL2832U lens | 208 | * TODO: find out RTL2832U lens |
209 | */ | 209 | */ |
210 | 210 | ||
211 | /* | 211 | /* |
212 | * I2C adapter logic looks rather complicated due to fact it handles | 212 | * I2C adapter logic looks rather complicated due to fact it handles |
213 | * three different access methods. Those methods are; | 213 | * three different access methods. Those methods are; |
214 | * 1) integrated demod access | 214 | * 1) integrated demod access |
215 | * 2) old I2C access | 215 | * 2) old I2C access |
216 | * 3) new I2C access | 216 | * 3) new I2C access |
217 | * | 217 | * |
218 | * Used method is selected in order 1, 2, 3. Method 3 can handle all | 218 | * Used method is selected in order 1, 2, 3. Method 3 can handle all |
219 | * requests but there is two reasons why not use it always; | 219 | * requests but there is two reasons why not use it always; |
220 | * 1) It is most expensive, usually two USB messages are needed | 220 | * 1) It is most expensive, usually two USB messages are needed |
221 | * 2) At least RTL2831U does not support it | 221 | * 2) At least RTL2831U does not support it |
222 | * | 222 | * |
223 | * Method 3 is needed in case of I2C write+read (typical register read) | 223 | * Method 3 is needed in case of I2C write+read (typical register read) |
224 | * where write is more than one byte. | 224 | * where write is more than one byte. |
225 | */ | 225 | */ |
226 | 226 | ||
227 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) | 227 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) |
228 | return -EAGAIN; | 228 | return -EAGAIN; |
229 | 229 | ||
230 | if (num == 2 && !(msg[0].flags & I2C_M_RD) && | 230 | if (num == 2 && !(msg[0].flags & I2C_M_RD) && |
231 | (msg[1].flags & I2C_M_RD)) { | 231 | (msg[1].flags & I2C_M_RD)) { |
232 | if (msg[0].len > 24 || msg[1].len > 24) { | 232 | if (msg[0].len > 24 || msg[1].len > 24) { |
233 | /* TODO: check msg[0].len max */ | 233 | /* TODO: check msg[0].len max */ |
234 | ret = -EOPNOTSUPP; | 234 | ret = -EOPNOTSUPP; |
235 | goto err_mutex_unlock; | 235 | goto err_mutex_unlock; |
236 | } else if (msg[0].addr == 0x10) { | 236 | } else if (msg[0].addr == 0x10) { |
237 | /* method 1 - integrated demod */ | 237 | /* method 1 - integrated demod */ |
238 | req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1); | 238 | req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1); |
239 | req.index = CMD_DEMOD_RD | priv->page; | 239 | req.index = CMD_DEMOD_RD | priv->page; |
240 | req.size = msg[1].len; | 240 | req.size = msg[1].len; |
241 | req.data = &msg[1].buf[0]; | 241 | req.data = &msg[1].buf[0]; |
242 | ret = rtl28xxu_ctrl_msg(d, &req); | 242 | ret = rtl28xxu_ctrl_msg(d, &req); |
243 | } else if (msg[0].len < 2) { | 243 | } else if (msg[0].len < 2) { |
244 | /* method 2 - old I2C */ | 244 | /* method 2 - old I2C */ |
245 | req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1); | 245 | req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1); |
246 | req.index = CMD_I2C_RD; | 246 | req.index = CMD_I2C_RD; |
247 | req.size = msg[1].len; | 247 | req.size = msg[1].len; |
248 | req.data = &msg[1].buf[0]; | 248 | req.data = &msg[1].buf[0]; |
249 | ret = rtl28xxu_ctrl_msg(d, &req); | 249 | ret = rtl28xxu_ctrl_msg(d, &req); |
250 | } else { | 250 | } else { |
251 | /* method 3 - new I2C */ | 251 | /* method 3 - new I2C */ |
252 | req.value = (msg[0].addr << 1); | 252 | req.value = (msg[0].addr << 1); |
253 | req.index = CMD_I2C_DA_WR; | 253 | req.index = CMD_I2C_DA_WR; |
254 | req.size = msg[0].len; | 254 | req.size = msg[0].len; |
255 | req.data = msg[0].buf; | 255 | req.data = msg[0].buf; |
256 | ret = rtl28xxu_ctrl_msg(d, &req); | 256 | ret = rtl28xxu_ctrl_msg(d, &req); |
257 | if (ret) | 257 | if (ret) |
258 | goto err_mutex_unlock; | 258 | goto err_mutex_unlock; |
259 | 259 | ||
260 | req.value = (msg[0].addr << 1); | 260 | req.value = (msg[0].addr << 1); |
261 | req.index = CMD_I2C_DA_RD; | 261 | req.index = CMD_I2C_DA_RD; |
262 | req.size = msg[1].len; | 262 | req.size = msg[1].len; |
263 | req.data = msg[1].buf; | 263 | req.data = msg[1].buf; |
264 | ret = rtl28xxu_ctrl_msg(d, &req); | 264 | ret = rtl28xxu_ctrl_msg(d, &req); |
265 | } | 265 | } |
266 | } else if (num == 1 && !(msg[0].flags & I2C_M_RD)) { | 266 | } else if (num == 1 && !(msg[0].flags & I2C_M_RD)) { |
267 | if (msg[0].len > 22) { | 267 | if (msg[0].len > 22) { |
268 | /* TODO: check msg[0].len max */ | 268 | /* TODO: check msg[0].len max */ |
269 | ret = -EOPNOTSUPP; | 269 | ret = -EOPNOTSUPP; |
270 | goto err_mutex_unlock; | 270 | goto err_mutex_unlock; |
271 | } else if (msg[0].addr == 0x10) { | 271 | } else if (msg[0].addr == 0x10) { |
272 | /* method 1 - integrated demod */ | 272 | /* method 1 - integrated demod */ |
273 | if (msg[0].buf[0] == 0x00) { | 273 | if (msg[0].buf[0] == 0x00) { |
274 | /* save demod page for later demod access */ | 274 | /* save demod page for later demod access */ |
275 | priv->page = msg[0].buf[1]; | 275 | priv->page = msg[0].buf[1]; |
276 | ret = 0; | 276 | ret = 0; |
277 | } else { | 277 | } else { |
278 | req.value = (msg[0].buf[0] << 8) | | 278 | req.value = (msg[0].buf[0] << 8) | |
279 | (msg[0].addr << 1); | 279 | (msg[0].addr << 1); |
280 | req.index = CMD_DEMOD_WR | priv->page; | 280 | req.index = CMD_DEMOD_WR | priv->page; |
281 | req.size = msg[0].len-1; | 281 | req.size = msg[0].len-1; |
282 | req.data = &msg[0].buf[1]; | 282 | req.data = &msg[0].buf[1]; |
283 | ret = rtl28xxu_ctrl_msg(d, &req); | 283 | ret = rtl28xxu_ctrl_msg(d, &req); |
284 | } | 284 | } |
285 | } else if (msg[0].len < 23) { | 285 | } else if (msg[0].len < 23) { |
286 | /* method 2 - old I2C */ | 286 | /* method 2 - old I2C */ |
287 | req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1); | 287 | req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1); |
288 | req.index = CMD_I2C_WR; | 288 | req.index = CMD_I2C_WR; |
289 | req.size = msg[0].len-1; | 289 | req.size = msg[0].len-1; |
290 | req.data = &msg[0].buf[1]; | 290 | req.data = &msg[0].buf[1]; |
291 | ret = rtl28xxu_ctrl_msg(d, &req); | 291 | ret = rtl28xxu_ctrl_msg(d, &req); |
292 | } else { | 292 | } else { |
293 | /* method 3 - new I2C */ | 293 | /* method 3 - new I2C */ |
294 | req.value = (msg[0].addr << 1); | 294 | req.value = (msg[0].addr << 1); |
295 | req.index = CMD_I2C_DA_WR; | 295 | req.index = CMD_I2C_DA_WR; |
296 | req.size = msg[0].len; | 296 | req.size = msg[0].len; |
297 | req.data = msg[0].buf; | 297 | req.data = msg[0].buf; |
298 | ret = rtl28xxu_ctrl_msg(d, &req); | 298 | ret = rtl28xxu_ctrl_msg(d, &req); |
299 | } | 299 | } |
300 | } else { | 300 | } else { |
301 | ret = -EINVAL; | 301 | ret = -EINVAL; |
302 | } | 302 | } |
303 | 303 | ||
304 | err_mutex_unlock: | 304 | err_mutex_unlock: |
305 | mutex_unlock(&d->i2c_mutex); | 305 | mutex_unlock(&d->i2c_mutex); |
306 | 306 | ||
307 | return ret ? ret : num; | 307 | return ret ? ret : num; |
308 | } | 308 | } |
309 | 309 | ||
310 | static u32 rtl28xxu_i2c_func(struct i2c_adapter *adapter) | 310 | static u32 rtl28xxu_i2c_func(struct i2c_adapter *adapter) |
311 | { | 311 | { |
312 | return I2C_FUNC_I2C; | 312 | return I2C_FUNC_I2C; |
313 | } | 313 | } |
314 | 314 | ||
315 | static struct i2c_algorithm rtl28xxu_i2c_algo = { | 315 | static struct i2c_algorithm rtl28xxu_i2c_algo = { |
316 | .master_xfer = rtl28xxu_i2c_xfer, | 316 | .master_xfer = rtl28xxu_i2c_xfer, |
317 | .functionality = rtl28xxu_i2c_func, | 317 | .functionality = rtl28xxu_i2c_func, |
318 | }; | 318 | }; |
319 | 319 | ||
320 | static int rtl2831u_read_config(struct dvb_usb_device *d) | 320 | static int rtl2831u_read_config(struct dvb_usb_device *d) |
321 | { | 321 | { |
322 | struct rtl28xxu_priv *priv = d_to_priv(d); | 322 | struct rtl28xxu_priv *priv = d_to_priv(d); |
323 | int ret; | 323 | int ret; |
324 | u8 buf[1]; | 324 | u8 buf[1]; |
325 | /* open RTL2831U/RTL2830 I2C gate */ | 325 | /* open RTL2831U/RTL2830 I2C gate */ |
326 | struct rtl28xxu_req req_gate_open = {0x0120, 0x0011, 0x0001, "\x08"}; | 326 | struct rtl28xxu_req req_gate_open = {0x0120, 0x0011, 0x0001, "\x08"}; |
327 | /* tuner probes */ | 327 | /* tuner probes */ |
328 | struct rtl28xxu_req req_mt2060 = {0x00c0, CMD_I2C_RD, 1, buf}; | 328 | struct rtl28xxu_req req_mt2060 = {0x00c0, CMD_I2C_RD, 1, buf}; |
329 | struct rtl28xxu_req req_qt1010 = {0x0fc4, CMD_I2C_RD, 1, buf}; | 329 | struct rtl28xxu_req req_qt1010 = {0x0fc4, CMD_I2C_RD, 1, buf}; |
330 | 330 | ||
331 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 331 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
332 | 332 | ||
333 | /* | 333 | /* |
334 | * RTL2831U GPIOs | 334 | * RTL2831U GPIOs |
335 | * ========================================================= | 335 | * ========================================================= |
336 | * GPIO0 | tuner#0 | 0 off | 1 on | MXL5005S (?) | 336 | * GPIO0 | tuner#0 | 0 off | 1 on | MXL5005S (?) |
337 | * GPIO2 | LED | 0 off | 1 on | | 337 | * GPIO2 | LED | 0 off | 1 on | |
338 | * GPIO4 | tuner#1 | 0 on | 1 off | MT2060 | 338 | * GPIO4 | tuner#1 | 0 on | 1 off | MT2060 |
339 | */ | 339 | */ |
340 | 340 | ||
341 | /* GPIO direction */ | 341 | /* GPIO direction */ |
342 | ret = rtl28xx_wr_reg(d, SYS_GPIO_DIR, 0x0a); | 342 | ret = rtl28xx_wr_reg(d, SYS_GPIO_DIR, 0x0a); |
343 | if (ret) | 343 | if (ret) |
344 | goto err; | 344 | goto err; |
345 | 345 | ||
346 | /* enable as output GPIO0, GPIO2, GPIO4 */ | 346 | /* enable as output GPIO0, GPIO2, GPIO4 */ |
347 | ret = rtl28xx_wr_reg(d, SYS_GPIO_OUT_EN, 0x15); | 347 | ret = rtl28xx_wr_reg(d, SYS_GPIO_OUT_EN, 0x15); |
348 | if (ret) | 348 | if (ret) |
349 | goto err; | 349 | goto err; |
350 | 350 | ||
351 | /* | 351 | /* |
352 | * Probe used tuner. We need to know used tuner before demod attach | 352 | * Probe used tuner. We need to know used tuner before demod attach |
353 | * since there is some demod params needed to set according to tuner. | 353 | * since there is some demod params needed to set according to tuner. |
354 | */ | 354 | */ |
355 | 355 | ||
356 | /* demod needs some time to wake up */ | 356 | /* demod needs some time to wake up */ |
357 | msleep(20); | 357 | msleep(20); |
358 | 358 | ||
359 | priv->tuner_name = "NONE"; | 359 | priv->tuner_name = "NONE"; |
360 | 360 | ||
361 | /* open demod I2C gate */ | 361 | /* open demod I2C gate */ |
362 | ret = rtl28xxu_ctrl_msg(d, &req_gate_open); | 362 | ret = rtl28xxu_ctrl_msg(d, &req_gate_open); |
363 | if (ret) | 363 | if (ret) |
364 | goto err; | 364 | goto err; |
365 | 365 | ||
366 | /* check QT1010 ID(?) register; reg=0f val=2c */ | 366 | /* check QT1010 ID(?) register; reg=0f val=2c */ |
367 | ret = rtl28xxu_ctrl_msg(d, &req_qt1010); | 367 | ret = rtl28xxu_ctrl_msg(d, &req_qt1010); |
368 | if (ret == 0 && buf[0] == 0x2c) { | 368 | if (ret == 0 && buf[0] == 0x2c) { |
369 | priv->tuner = TUNER_RTL2830_QT1010; | 369 | priv->tuner = TUNER_RTL2830_QT1010; |
370 | priv->tuner_name = "QT1010"; | 370 | priv->tuner_name = "QT1010"; |
371 | goto found; | 371 | goto found; |
372 | } | 372 | } |
373 | 373 | ||
374 | /* open demod I2C gate */ | 374 | /* open demod I2C gate */ |
375 | ret = rtl28xxu_ctrl_msg(d, &req_gate_open); | 375 | ret = rtl28xxu_ctrl_msg(d, &req_gate_open); |
376 | if (ret) | 376 | if (ret) |
377 | goto err; | 377 | goto err; |
378 | 378 | ||
379 | /* check MT2060 ID register; reg=00 val=63 */ | 379 | /* check MT2060 ID register; reg=00 val=63 */ |
380 | ret = rtl28xxu_ctrl_msg(d, &req_mt2060); | 380 | ret = rtl28xxu_ctrl_msg(d, &req_mt2060); |
381 | if (ret == 0 && buf[0] == 0x63) { | 381 | if (ret == 0 && buf[0] == 0x63) { |
382 | priv->tuner = TUNER_RTL2830_MT2060; | 382 | priv->tuner = TUNER_RTL2830_MT2060; |
383 | priv->tuner_name = "MT2060"; | 383 | priv->tuner_name = "MT2060"; |
384 | goto found; | 384 | goto found; |
385 | } | 385 | } |
386 | 386 | ||
387 | /* assume MXL5005S */ | 387 | /* assume MXL5005S */ |
388 | priv->tuner = TUNER_RTL2830_MXL5005S; | 388 | priv->tuner = TUNER_RTL2830_MXL5005S; |
389 | priv->tuner_name = "MXL5005S"; | 389 | priv->tuner_name = "MXL5005S"; |
390 | goto found; | 390 | goto found; |
391 | 391 | ||
392 | found: | 392 | found: |
393 | dev_dbg(&d->udev->dev, "%s: tuner=%s\n", __func__, priv->tuner_name); | 393 | dev_dbg(&d->udev->dev, "%s: tuner=%s\n", __func__, priv->tuner_name); |
394 | 394 | ||
395 | return 0; | 395 | return 0; |
396 | err: | 396 | err: |
397 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 397 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
398 | return ret; | 398 | return ret; |
399 | } | 399 | } |
400 | 400 | ||
401 | static int rtl2832u_read_config(struct dvb_usb_device *d) | 401 | static int rtl2832u_read_config(struct dvb_usb_device *d) |
402 | { | 402 | { |
403 | struct rtl28xxu_priv *priv = d_to_priv(d); | 403 | struct rtl28xxu_priv *priv = d_to_priv(d); |
404 | int ret; | 404 | int ret; |
405 | u8 buf[2]; | 405 | u8 buf[2]; |
406 | /* open RTL2832U/RTL2832 I2C gate */ | 406 | /* open RTL2832U/RTL2832 I2C gate */ |
407 | struct rtl28xxu_req req_gate_open = {0x0120, 0x0011, 0x0001, "\x18"}; | 407 | struct rtl28xxu_req req_gate_open = {0x0120, 0x0011, 0x0001, "\x18"}; |
408 | /* close RTL2832U/RTL2832 I2C gate */ | 408 | /* close RTL2832U/RTL2832 I2C gate */ |
409 | struct rtl28xxu_req req_gate_close = {0x0120, 0x0011, 0x0001, "\x10"}; | 409 | struct rtl28xxu_req req_gate_close = {0x0120, 0x0011, 0x0001, "\x10"}; |
410 | /* tuner probes */ | 410 | /* tuner probes */ |
411 | struct rtl28xxu_req req_fc0012 = {0x00c6, CMD_I2C_RD, 1, buf}; | 411 | struct rtl28xxu_req req_fc0012 = {0x00c6, CMD_I2C_RD, 1, buf}; |
412 | struct rtl28xxu_req req_fc0013 = {0x00c6, CMD_I2C_RD, 1, buf}; | 412 | struct rtl28xxu_req req_fc0013 = {0x00c6, CMD_I2C_RD, 1, buf}; |
413 | struct rtl28xxu_req req_mt2266 = {0x00c0, CMD_I2C_RD, 1, buf}; | 413 | struct rtl28xxu_req req_mt2266 = {0x00c0, CMD_I2C_RD, 1, buf}; |
414 | struct rtl28xxu_req req_fc2580 = {0x01ac, CMD_I2C_RD, 1, buf}; | 414 | struct rtl28xxu_req req_fc2580 = {0x01ac, CMD_I2C_RD, 1, buf}; |
415 | struct rtl28xxu_req req_mt2063 = {0x00c0, CMD_I2C_RD, 1, buf}; | 415 | struct rtl28xxu_req req_mt2063 = {0x00c0, CMD_I2C_RD, 1, buf}; |
416 | struct rtl28xxu_req req_max3543 = {0x00c0, CMD_I2C_RD, 1, buf}; | 416 | struct rtl28xxu_req req_max3543 = {0x00c0, CMD_I2C_RD, 1, buf}; |
417 | struct rtl28xxu_req req_tua9001 = {0x7ec0, CMD_I2C_RD, 2, buf}; | 417 | struct rtl28xxu_req req_tua9001 = {0x7ec0, CMD_I2C_RD, 2, buf}; |
418 | struct rtl28xxu_req req_mxl5007t = {0xd9c0, CMD_I2C_RD, 1, buf}; | 418 | struct rtl28xxu_req req_mxl5007t = {0xd9c0, CMD_I2C_RD, 1, buf}; |
419 | struct rtl28xxu_req req_e4000 = {0x02c8, CMD_I2C_RD, 1, buf}; | 419 | struct rtl28xxu_req req_e4000 = {0x02c8, CMD_I2C_RD, 1, buf}; |
420 | struct rtl28xxu_req req_tda18272 = {0x00c0, CMD_I2C_RD, 2, buf}; | 420 | struct rtl28xxu_req req_tda18272 = {0x00c0, CMD_I2C_RD, 2, buf}; |
421 | struct rtl28xxu_req req_r820t = {0x0034, CMD_I2C_RD, 1, buf}; | 421 | struct rtl28xxu_req req_r820t = {0x0034, CMD_I2C_RD, 1, buf}; |
422 | struct rtl28xxu_req req_r828d = {0x0074, CMD_I2C_RD, 1, buf}; | 422 | struct rtl28xxu_req req_r828d = {0x0074, CMD_I2C_RD, 1, buf}; |
423 | 423 | ||
424 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 424 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
425 | 425 | ||
426 | /* enable GPIO3 and GPIO6 as output */ | 426 | /* enable GPIO3 and GPIO6 as output */ |
427 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_DIR, 0x00, 0x40); | 427 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_DIR, 0x00, 0x40); |
428 | if (ret) | 428 | if (ret) |
429 | goto err; | 429 | goto err; |
430 | 430 | ||
431 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_EN, 0x48, 0x48); | 431 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_EN, 0x48, 0x48); |
432 | if (ret) | 432 | if (ret) |
433 | goto err; | 433 | goto err; |
434 | 434 | ||
435 | /* | 435 | /* |
436 | * Probe used tuner. We need to know used tuner before demod attach | 436 | * Probe used tuner. We need to know used tuner before demod attach |
437 | * since there is some demod params needed to set according to tuner. | 437 | * since there is some demod params needed to set according to tuner. |
438 | */ | 438 | */ |
439 | 439 | ||
440 | /* open demod I2C gate */ | 440 | /* open demod I2C gate */ |
441 | ret = rtl28xxu_ctrl_msg(d, &req_gate_open); | 441 | ret = rtl28xxu_ctrl_msg(d, &req_gate_open); |
442 | if (ret) | 442 | if (ret) |
443 | goto err; | 443 | goto err; |
444 | 444 | ||
445 | priv->tuner_name = "NONE"; | 445 | priv->tuner_name = "NONE"; |
446 | 446 | ||
447 | /* check FC0012 ID register; reg=00 val=a1 */ | 447 | /* check FC0012 ID register; reg=00 val=a1 */ |
448 | ret = rtl28xxu_ctrl_msg(d, &req_fc0012); | 448 | ret = rtl28xxu_ctrl_msg(d, &req_fc0012); |
449 | if (ret == 0 && buf[0] == 0xa1) { | 449 | if (ret == 0 && buf[0] == 0xa1) { |
450 | priv->tuner = TUNER_RTL2832_FC0012; | 450 | priv->tuner = TUNER_RTL2832_FC0012; |
451 | priv->tuner_name = "FC0012"; | 451 | priv->tuner_name = "FC0012"; |
452 | goto found; | 452 | goto found; |
453 | } | 453 | } |
454 | 454 | ||
455 | /* check FC0013 ID register; reg=00 val=a3 */ | 455 | /* check FC0013 ID register; reg=00 val=a3 */ |
456 | ret = rtl28xxu_ctrl_msg(d, &req_fc0013); | 456 | ret = rtl28xxu_ctrl_msg(d, &req_fc0013); |
457 | if (ret == 0 && buf[0] == 0xa3) { | 457 | if (ret == 0 && buf[0] == 0xa3) { |
458 | priv->tuner = TUNER_RTL2832_FC0013; | 458 | priv->tuner = TUNER_RTL2832_FC0013; |
459 | priv->tuner_name = "FC0013"; | 459 | priv->tuner_name = "FC0013"; |
460 | goto found; | 460 | goto found; |
461 | } | 461 | } |
462 | 462 | ||
463 | /* check MT2266 ID register; reg=00 val=85 */ | 463 | /* check MT2266 ID register; reg=00 val=85 */ |
464 | ret = rtl28xxu_ctrl_msg(d, &req_mt2266); | 464 | ret = rtl28xxu_ctrl_msg(d, &req_mt2266); |
465 | if (ret == 0 && buf[0] == 0x85) { | 465 | if (ret == 0 && buf[0] == 0x85) { |
466 | priv->tuner = TUNER_RTL2832_MT2266; | 466 | priv->tuner = TUNER_RTL2832_MT2266; |
467 | priv->tuner_name = "MT2266"; | 467 | priv->tuner_name = "MT2266"; |
468 | goto found; | 468 | goto found; |
469 | } | 469 | } |
470 | 470 | ||
471 | /* check FC2580 ID register; reg=01 val=56 */ | 471 | /* check FC2580 ID register; reg=01 val=56 */ |
472 | ret = rtl28xxu_ctrl_msg(d, &req_fc2580); | 472 | ret = rtl28xxu_ctrl_msg(d, &req_fc2580); |
473 | if (ret == 0 && buf[0] == 0x56) { | 473 | if (ret == 0 && buf[0] == 0x56) { |
474 | priv->tuner = TUNER_RTL2832_FC2580; | 474 | priv->tuner = TUNER_RTL2832_FC2580; |
475 | priv->tuner_name = "FC2580"; | 475 | priv->tuner_name = "FC2580"; |
476 | goto found; | 476 | goto found; |
477 | } | 477 | } |
478 | 478 | ||
479 | /* check MT2063 ID register; reg=00 val=9e || 9c */ | 479 | /* check MT2063 ID register; reg=00 val=9e || 9c */ |
480 | ret = rtl28xxu_ctrl_msg(d, &req_mt2063); | 480 | ret = rtl28xxu_ctrl_msg(d, &req_mt2063); |
481 | if (ret == 0 && (buf[0] == 0x9e || buf[0] == 0x9c)) { | 481 | if (ret == 0 && (buf[0] == 0x9e || buf[0] == 0x9c)) { |
482 | priv->tuner = TUNER_RTL2832_MT2063; | 482 | priv->tuner = TUNER_RTL2832_MT2063; |
483 | priv->tuner_name = "MT2063"; | 483 | priv->tuner_name = "MT2063"; |
484 | goto found; | 484 | goto found; |
485 | } | 485 | } |
486 | 486 | ||
487 | /* check MAX3543 ID register; reg=00 val=38 */ | 487 | /* check MAX3543 ID register; reg=00 val=38 */ |
488 | ret = rtl28xxu_ctrl_msg(d, &req_max3543); | 488 | ret = rtl28xxu_ctrl_msg(d, &req_max3543); |
489 | if (ret == 0 && buf[0] == 0x38) { | 489 | if (ret == 0 && buf[0] == 0x38) { |
490 | priv->tuner = TUNER_RTL2832_MAX3543; | 490 | priv->tuner = TUNER_RTL2832_MAX3543; |
491 | priv->tuner_name = "MAX3543"; | 491 | priv->tuner_name = "MAX3543"; |
492 | goto found; | 492 | goto found; |
493 | } | 493 | } |
494 | 494 | ||
495 | /* check TUA9001 ID register; reg=7e val=2328 */ | 495 | /* check TUA9001 ID register; reg=7e val=2328 */ |
496 | ret = rtl28xxu_ctrl_msg(d, &req_tua9001); | 496 | ret = rtl28xxu_ctrl_msg(d, &req_tua9001); |
497 | if (ret == 0 && buf[0] == 0x23 && buf[1] == 0x28) { | 497 | if (ret == 0 && buf[0] == 0x23 && buf[1] == 0x28) { |
498 | priv->tuner = TUNER_RTL2832_TUA9001; | 498 | priv->tuner = TUNER_RTL2832_TUA9001; |
499 | priv->tuner_name = "TUA9001"; | 499 | priv->tuner_name = "TUA9001"; |
500 | goto found; | 500 | goto found; |
501 | } | 501 | } |
502 | 502 | ||
503 | /* check MXL5007R ID register; reg=d9 val=14 */ | 503 | /* check MXL5007R ID register; reg=d9 val=14 */ |
504 | ret = rtl28xxu_ctrl_msg(d, &req_mxl5007t); | 504 | ret = rtl28xxu_ctrl_msg(d, &req_mxl5007t); |
505 | if (ret == 0 && buf[0] == 0x14) { | 505 | if (ret == 0 && buf[0] == 0x14) { |
506 | priv->tuner = TUNER_RTL2832_MXL5007T; | 506 | priv->tuner = TUNER_RTL2832_MXL5007T; |
507 | priv->tuner_name = "MXL5007T"; | 507 | priv->tuner_name = "MXL5007T"; |
508 | goto found; | 508 | goto found; |
509 | } | 509 | } |
510 | 510 | ||
511 | /* check E4000 ID register; reg=02 val=40 */ | 511 | /* check E4000 ID register; reg=02 val=40 */ |
512 | ret = rtl28xxu_ctrl_msg(d, &req_e4000); | 512 | ret = rtl28xxu_ctrl_msg(d, &req_e4000); |
513 | if (ret == 0 && buf[0] == 0x40) { | 513 | if (ret == 0 && buf[0] == 0x40) { |
514 | priv->tuner = TUNER_RTL2832_E4000; | 514 | priv->tuner = TUNER_RTL2832_E4000; |
515 | priv->tuner_name = "E4000"; | 515 | priv->tuner_name = "E4000"; |
516 | goto found; | 516 | goto found; |
517 | } | 517 | } |
518 | 518 | ||
519 | /* check TDA18272 ID register; reg=00 val=c760 */ | 519 | /* check TDA18272 ID register; reg=00 val=c760 */ |
520 | ret = rtl28xxu_ctrl_msg(d, &req_tda18272); | 520 | ret = rtl28xxu_ctrl_msg(d, &req_tda18272); |
521 | if (ret == 0 && (buf[0] == 0xc7 || buf[1] == 0x60)) { | 521 | if (ret == 0 && (buf[0] == 0xc7 || buf[1] == 0x60)) { |
522 | priv->tuner = TUNER_RTL2832_TDA18272; | 522 | priv->tuner = TUNER_RTL2832_TDA18272; |
523 | priv->tuner_name = "TDA18272"; | 523 | priv->tuner_name = "TDA18272"; |
524 | goto found; | 524 | goto found; |
525 | } | 525 | } |
526 | 526 | ||
527 | /* check R820T ID register; reg=00 val=69 */ | 527 | /* check R820T ID register; reg=00 val=69 */ |
528 | ret = rtl28xxu_ctrl_msg(d, &req_r820t); | 528 | ret = rtl28xxu_ctrl_msg(d, &req_r820t); |
529 | if (ret == 0 && buf[0] == 0x69) { | 529 | if (ret == 0 && buf[0] == 0x69) { |
530 | priv->tuner = TUNER_RTL2832_R820T; | 530 | priv->tuner = TUNER_RTL2832_R820T; |
531 | priv->tuner_name = "R820T"; | 531 | priv->tuner_name = "R820T"; |
532 | goto found; | 532 | goto found; |
533 | } | 533 | } |
534 | 534 | ||
535 | /* check R828D ID register; reg=00 val=69 */ | 535 | /* check R828D ID register; reg=00 val=69 */ |
536 | ret = rtl28xxu_ctrl_msg(d, &req_r828d); | 536 | ret = rtl28xxu_ctrl_msg(d, &req_r828d); |
537 | if (ret == 0 && buf[0] == 0x69) { | 537 | if (ret == 0 && buf[0] == 0x69) { |
538 | priv->tuner = TUNER_RTL2832_R828D; | 538 | priv->tuner = TUNER_RTL2832_R828D; |
539 | priv->tuner_name = "R828D"; | 539 | priv->tuner_name = "R828D"; |
540 | goto found; | 540 | goto found; |
541 | } | 541 | } |
542 | 542 | ||
543 | 543 | ||
544 | found: | 544 | found: |
545 | dev_dbg(&d->udev->dev, "%s: tuner=%s\n", __func__, priv->tuner_name); | 545 | dev_dbg(&d->udev->dev, "%s: tuner=%s\n", __func__, priv->tuner_name); |
546 | 546 | ||
547 | /* close demod I2C gate */ | 547 | /* close demod I2C gate */ |
548 | ret = rtl28xxu_ctrl_msg(d, &req_gate_close); | 548 | ret = rtl28xxu_ctrl_msg(d, &req_gate_close); |
549 | if (ret < 0) | 549 | if (ret < 0) |
550 | goto err; | 550 | goto err; |
551 | 551 | ||
552 | return 0; | 552 | return 0; |
553 | err: | 553 | err: |
554 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 554 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
555 | return ret; | 555 | return ret; |
556 | } | 556 | } |
557 | 557 | ||
558 | static const struct rtl2830_config rtl28xxu_rtl2830_mt2060_config = { | 558 | static const struct rtl2830_config rtl28xxu_rtl2830_mt2060_config = { |
559 | .i2c_addr = 0x10, /* 0x20 */ | 559 | .i2c_addr = 0x10, /* 0x20 */ |
560 | .xtal = 28800000, | 560 | .xtal = 28800000, |
561 | .ts_mode = 0, | 561 | .ts_mode = 0, |
562 | .spec_inv = 1, | 562 | .spec_inv = 1, |
563 | .vtop = 0x20, | 563 | .vtop = 0x20, |
564 | .krf = 0x04, | 564 | .krf = 0x04, |
565 | .agc_targ_val = 0x2d, | 565 | .agc_targ_val = 0x2d, |
566 | 566 | ||
567 | }; | 567 | }; |
568 | 568 | ||
569 | static const struct rtl2830_config rtl28xxu_rtl2830_qt1010_config = { | 569 | static const struct rtl2830_config rtl28xxu_rtl2830_qt1010_config = { |
570 | .i2c_addr = 0x10, /* 0x20 */ | 570 | .i2c_addr = 0x10, /* 0x20 */ |
571 | .xtal = 28800000, | 571 | .xtal = 28800000, |
572 | .ts_mode = 0, | 572 | .ts_mode = 0, |
573 | .spec_inv = 1, | 573 | .spec_inv = 1, |
574 | .vtop = 0x20, | 574 | .vtop = 0x20, |
575 | .krf = 0x04, | 575 | .krf = 0x04, |
576 | .agc_targ_val = 0x2d, | 576 | .agc_targ_val = 0x2d, |
577 | }; | 577 | }; |
578 | 578 | ||
579 | static const struct rtl2830_config rtl28xxu_rtl2830_mxl5005s_config = { | 579 | static const struct rtl2830_config rtl28xxu_rtl2830_mxl5005s_config = { |
580 | .i2c_addr = 0x10, /* 0x20 */ | 580 | .i2c_addr = 0x10, /* 0x20 */ |
581 | .xtal = 28800000, | 581 | .xtal = 28800000, |
582 | .ts_mode = 0, | 582 | .ts_mode = 0, |
583 | .spec_inv = 0, | 583 | .spec_inv = 0, |
584 | .vtop = 0x3f, | 584 | .vtop = 0x3f, |
585 | .krf = 0x04, | 585 | .krf = 0x04, |
586 | .agc_targ_val = 0x3e, | 586 | .agc_targ_val = 0x3e, |
587 | }; | 587 | }; |
588 | 588 | ||
589 | static int rtl2831u_frontend_attach(struct dvb_usb_adapter *adap) | 589 | static int rtl2831u_frontend_attach(struct dvb_usb_adapter *adap) |
590 | { | 590 | { |
591 | struct dvb_usb_device *d = adap_to_d(adap); | 591 | struct dvb_usb_device *d = adap_to_d(adap); |
592 | struct rtl28xxu_priv *priv = d_to_priv(d); | 592 | struct rtl28xxu_priv *priv = d_to_priv(d); |
593 | const struct rtl2830_config *rtl2830_config; | 593 | const struct rtl2830_config *rtl2830_config; |
594 | int ret; | 594 | int ret; |
595 | 595 | ||
596 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 596 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
597 | 597 | ||
598 | switch (priv->tuner) { | 598 | switch (priv->tuner) { |
599 | case TUNER_RTL2830_QT1010: | 599 | case TUNER_RTL2830_QT1010: |
600 | rtl2830_config = &rtl28xxu_rtl2830_qt1010_config; | 600 | rtl2830_config = &rtl28xxu_rtl2830_qt1010_config; |
601 | break; | 601 | break; |
602 | case TUNER_RTL2830_MT2060: | 602 | case TUNER_RTL2830_MT2060: |
603 | rtl2830_config = &rtl28xxu_rtl2830_mt2060_config; | 603 | rtl2830_config = &rtl28xxu_rtl2830_mt2060_config; |
604 | break; | 604 | break; |
605 | case TUNER_RTL2830_MXL5005S: | 605 | case TUNER_RTL2830_MXL5005S: |
606 | rtl2830_config = &rtl28xxu_rtl2830_mxl5005s_config; | 606 | rtl2830_config = &rtl28xxu_rtl2830_mxl5005s_config; |
607 | break; | 607 | break; |
608 | default: | 608 | default: |
609 | dev_err(&d->udev->dev, "%s: unknown tuner=%s\n", | 609 | dev_err(&d->udev->dev, "%s: unknown tuner=%s\n", |
610 | KBUILD_MODNAME, priv->tuner_name); | 610 | KBUILD_MODNAME, priv->tuner_name); |
611 | ret = -ENODEV; | 611 | ret = -ENODEV; |
612 | goto err; | 612 | goto err; |
613 | } | 613 | } |
614 | 614 | ||
615 | /* attach demodulator */ | 615 | /* attach demodulator */ |
616 | adap->fe[0] = dvb_attach(rtl2830_attach, rtl2830_config, &d->i2c_adap); | 616 | adap->fe[0] = dvb_attach(rtl2830_attach, rtl2830_config, &d->i2c_adap); |
617 | if (!adap->fe[0]) { | 617 | if (!adap->fe[0]) { |
618 | ret = -ENODEV; | 618 | ret = -ENODEV; |
619 | goto err; | 619 | goto err; |
620 | } | 620 | } |
621 | 621 | ||
622 | return 0; | 622 | return 0; |
623 | err: | 623 | err: |
624 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 624 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
625 | return ret; | 625 | return ret; |
626 | } | 626 | } |
627 | 627 | ||
628 | static const struct rtl2832_config rtl28xxu_rtl2832_fc0012_config = { | 628 | static const struct rtl2832_config rtl28xxu_rtl2832_fc0012_config = { |
629 | .i2c_addr = 0x10, /* 0x20 */ | 629 | .i2c_addr = 0x10, /* 0x20 */ |
630 | .xtal = 28800000, | 630 | .xtal = 28800000, |
631 | .tuner = TUNER_RTL2832_FC0012 | 631 | .tuner = TUNER_RTL2832_FC0012 |
632 | }; | 632 | }; |
633 | 633 | ||
634 | static const struct rtl2832_config rtl28xxu_rtl2832_fc0013_config = { | 634 | static const struct rtl2832_config rtl28xxu_rtl2832_fc0013_config = { |
635 | .i2c_addr = 0x10, /* 0x20 */ | 635 | .i2c_addr = 0x10, /* 0x20 */ |
636 | .xtal = 28800000, | 636 | .xtal = 28800000, |
637 | .tuner = TUNER_RTL2832_FC0013 | 637 | .tuner = TUNER_RTL2832_FC0013 |
638 | }; | 638 | }; |
639 | 639 | ||
640 | static const struct rtl2832_config rtl28xxu_rtl2832_tua9001_config = { | 640 | static const struct rtl2832_config rtl28xxu_rtl2832_tua9001_config = { |
641 | .i2c_addr = 0x10, /* 0x20 */ | 641 | .i2c_addr = 0x10, /* 0x20 */ |
642 | .xtal = 28800000, | 642 | .xtal = 28800000, |
643 | .tuner = TUNER_RTL2832_TUA9001, | 643 | .tuner = TUNER_RTL2832_TUA9001, |
644 | }; | 644 | }; |
645 | 645 | ||
646 | static const struct rtl2832_config rtl28xxu_rtl2832_e4000_config = { | 646 | static const struct rtl2832_config rtl28xxu_rtl2832_e4000_config = { |
647 | .i2c_addr = 0x10, /* 0x20 */ | 647 | .i2c_addr = 0x10, /* 0x20 */ |
648 | .xtal = 28800000, | 648 | .xtal = 28800000, |
649 | .tuner = TUNER_RTL2832_E4000, | 649 | .tuner = TUNER_RTL2832_E4000, |
650 | }; | 650 | }; |
651 | 651 | ||
652 | static const struct rtl2832_config rtl28xxu_rtl2832_r820t_config = { | 652 | static const struct rtl2832_config rtl28xxu_rtl2832_r820t_config = { |
653 | .i2c_addr = 0x10, | 653 | .i2c_addr = 0x10, |
654 | .xtal = 28800000, | 654 | .xtal = 28800000, |
655 | .tuner = TUNER_RTL2832_R820T, | 655 | .tuner = TUNER_RTL2832_R820T, |
656 | }; | 656 | }; |
657 | 657 | ||
658 | static int rtl2832u_fc0012_tuner_callback(struct dvb_usb_device *d, | 658 | static int rtl2832u_fc0012_tuner_callback(struct dvb_usb_device *d, |
659 | int cmd, int arg) | 659 | int cmd, int arg) |
660 | { | 660 | { |
661 | int ret; | 661 | int ret; |
662 | u8 val; | 662 | u8 val; |
663 | 663 | ||
664 | dev_dbg(&d->udev->dev, "%s: cmd=%d arg=%d\n", __func__, cmd, arg); | 664 | dev_dbg(&d->udev->dev, "%s: cmd=%d arg=%d\n", __func__, cmd, arg); |
665 | 665 | ||
666 | switch (cmd) { | 666 | switch (cmd) { |
667 | case FC_FE_CALLBACK_VHF_ENABLE: | 667 | case FC_FE_CALLBACK_VHF_ENABLE: |
668 | /* set output values */ | 668 | /* set output values */ |
669 | ret = rtl28xx_rd_reg(d, SYS_GPIO_OUT_VAL, &val); | 669 | ret = rtl28xx_rd_reg(d, SYS_GPIO_OUT_VAL, &val); |
670 | if (ret) | 670 | if (ret) |
671 | goto err; | 671 | goto err; |
672 | 672 | ||
673 | if (arg) | 673 | if (arg) |
674 | val &= 0xbf; /* set GPIO6 low */ | 674 | val &= 0xbf; /* set GPIO6 low */ |
675 | else | 675 | else |
676 | val |= 0x40; /* set GPIO6 high */ | 676 | val |= 0x40; /* set GPIO6 high */ |
677 | 677 | ||
678 | 678 | ||
679 | ret = rtl28xx_wr_reg(d, SYS_GPIO_OUT_VAL, val); | 679 | ret = rtl28xx_wr_reg(d, SYS_GPIO_OUT_VAL, val); |
680 | if (ret) | 680 | if (ret) |
681 | goto err; | 681 | goto err; |
682 | break; | 682 | break; |
683 | default: | 683 | default: |
684 | ret = -EINVAL; | 684 | ret = -EINVAL; |
685 | goto err; | 685 | goto err; |
686 | } | 686 | } |
687 | return 0; | 687 | return 0; |
688 | err: | 688 | err: |
689 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 689 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
690 | return ret; | 690 | return ret; |
691 | } | 691 | } |
692 | 692 | ||
693 | static int rtl2832u_tua9001_tuner_callback(struct dvb_usb_device *d, | 693 | static int rtl2832u_tua9001_tuner_callback(struct dvb_usb_device *d, |
694 | int cmd, int arg) | 694 | int cmd, int arg) |
695 | { | 695 | { |
696 | int ret; | 696 | int ret; |
697 | u8 val; | 697 | u8 val; |
698 | 698 | ||
699 | dev_dbg(&d->udev->dev, "%s: cmd=%d arg=%d\n", __func__, cmd, arg); | 699 | dev_dbg(&d->udev->dev, "%s: cmd=%d arg=%d\n", __func__, cmd, arg); |
700 | 700 | ||
701 | /* | 701 | /* |
702 | * CEN always enabled by hardware wiring | 702 | * CEN always enabled by hardware wiring |
703 | * RESETN GPIO4 | 703 | * RESETN GPIO4 |
704 | * RXEN GPIO1 | 704 | * RXEN GPIO1 |
705 | */ | 705 | */ |
706 | 706 | ||
707 | switch (cmd) { | 707 | switch (cmd) { |
708 | case TUA9001_CMD_RESETN: | 708 | case TUA9001_CMD_RESETN: |
709 | if (arg) | 709 | if (arg) |
710 | val = (1 << 4); | 710 | val = (1 << 4); |
711 | else | 711 | else |
712 | val = (0 << 4); | 712 | val = (0 << 4); |
713 | 713 | ||
714 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, val, 0x10); | 714 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, val, 0x10); |
715 | if (ret) | 715 | if (ret) |
716 | goto err; | 716 | goto err; |
717 | break; | 717 | break; |
718 | case TUA9001_CMD_RXEN: | 718 | case TUA9001_CMD_RXEN: |
719 | if (arg) | 719 | if (arg) |
720 | val = (1 << 1); | 720 | val = (1 << 1); |
721 | else | 721 | else |
722 | val = (0 << 1); | 722 | val = (0 << 1); |
723 | 723 | ||
724 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, val, 0x02); | 724 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, val, 0x02); |
725 | if (ret) | 725 | if (ret) |
726 | goto err; | 726 | goto err; |
727 | break; | 727 | break; |
728 | } | 728 | } |
729 | 729 | ||
730 | return 0; | 730 | return 0; |
731 | err: | 731 | err: |
732 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 732 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
733 | return ret; | 733 | return ret; |
734 | } | 734 | } |
735 | 735 | ||
736 | static int rtl2832u_tuner_callback(struct dvb_usb_device *d, int cmd, int arg) | 736 | static int rtl2832u_tuner_callback(struct dvb_usb_device *d, int cmd, int arg) |
737 | { | 737 | { |
738 | struct rtl28xxu_priv *priv = d->priv; | 738 | struct rtl28xxu_priv *priv = d->priv; |
739 | 739 | ||
740 | switch (priv->tuner) { | 740 | switch (priv->tuner) { |
741 | case TUNER_RTL2832_FC0012: | 741 | case TUNER_RTL2832_FC0012: |
742 | return rtl2832u_fc0012_tuner_callback(d, cmd, arg); | 742 | return rtl2832u_fc0012_tuner_callback(d, cmd, arg); |
743 | case TUNER_RTL2832_TUA9001: | 743 | case TUNER_RTL2832_TUA9001: |
744 | return rtl2832u_tua9001_tuner_callback(d, cmd, arg); | 744 | return rtl2832u_tua9001_tuner_callback(d, cmd, arg); |
745 | default: | 745 | default: |
746 | break; | 746 | break; |
747 | } | 747 | } |
748 | 748 | ||
749 | return 0; | 749 | return 0; |
750 | } | 750 | } |
751 | 751 | ||
752 | static int rtl2832u_frontend_callback(void *adapter_priv, int component, | 752 | static int rtl2832u_frontend_callback(void *adapter_priv, int component, |
753 | int cmd, int arg) | 753 | int cmd, int arg) |
754 | { | 754 | { |
755 | struct i2c_adapter *adap = adapter_priv; | 755 | struct i2c_adapter *adap = adapter_priv; |
756 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 756 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
757 | 757 | ||
758 | dev_dbg(&d->udev->dev, "%s: component=%d cmd=%d arg=%d\n", | 758 | dev_dbg(&d->udev->dev, "%s: component=%d cmd=%d arg=%d\n", |
759 | __func__, component, cmd, arg); | 759 | __func__, component, cmd, arg); |
760 | 760 | ||
761 | switch (component) { | 761 | switch (component) { |
762 | case DVB_FRONTEND_COMPONENT_TUNER: | 762 | case DVB_FRONTEND_COMPONENT_TUNER: |
763 | return rtl2832u_tuner_callback(d, cmd, arg); | 763 | return rtl2832u_tuner_callback(d, cmd, arg); |
764 | default: | 764 | default: |
765 | break; | 765 | break; |
766 | } | 766 | } |
767 | 767 | ||
768 | return 0; | 768 | return 0; |
769 | } | 769 | } |
770 | 770 | ||
771 | static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) | 771 | static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) |
772 | { | 772 | { |
773 | int ret; | 773 | int ret; |
774 | struct dvb_usb_device *d = adap_to_d(adap); | 774 | struct dvb_usb_device *d = adap_to_d(adap); |
775 | struct rtl28xxu_priv *priv = d_to_priv(d); | 775 | struct rtl28xxu_priv *priv = d_to_priv(d); |
776 | const struct rtl2832_config *rtl2832_config; | 776 | const struct rtl2832_config *rtl2832_config; |
777 | 777 | ||
778 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 778 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
779 | 779 | ||
780 | switch (priv->tuner) { | 780 | switch (priv->tuner) { |
781 | case TUNER_RTL2832_FC0012: | 781 | case TUNER_RTL2832_FC0012: |
782 | rtl2832_config = &rtl28xxu_rtl2832_fc0012_config; | 782 | rtl2832_config = &rtl28xxu_rtl2832_fc0012_config; |
783 | break; | 783 | break; |
784 | case TUNER_RTL2832_FC0013: | 784 | case TUNER_RTL2832_FC0013: |
785 | rtl2832_config = &rtl28xxu_rtl2832_fc0013_config; | 785 | rtl2832_config = &rtl28xxu_rtl2832_fc0013_config; |
786 | break; | 786 | break; |
787 | case TUNER_RTL2832_FC2580: | 787 | case TUNER_RTL2832_FC2580: |
788 | /* FIXME: do not abuse fc0012 settings */ | 788 | /* FIXME: do not abuse fc0012 settings */ |
789 | rtl2832_config = &rtl28xxu_rtl2832_fc0012_config; | 789 | rtl2832_config = &rtl28xxu_rtl2832_fc0012_config; |
790 | break; | 790 | break; |
791 | case TUNER_RTL2832_TUA9001: | 791 | case TUNER_RTL2832_TUA9001: |
792 | rtl2832_config = &rtl28xxu_rtl2832_tua9001_config; | 792 | rtl2832_config = &rtl28xxu_rtl2832_tua9001_config; |
793 | break; | 793 | break; |
794 | case TUNER_RTL2832_E4000: | 794 | case TUNER_RTL2832_E4000: |
795 | rtl2832_config = &rtl28xxu_rtl2832_e4000_config; | 795 | rtl2832_config = &rtl28xxu_rtl2832_e4000_config; |
796 | break; | 796 | break; |
797 | case TUNER_RTL2832_R820T: | 797 | case TUNER_RTL2832_R820T: |
798 | case TUNER_RTL2832_R828D: | 798 | case TUNER_RTL2832_R828D: |
799 | rtl2832_config = &rtl28xxu_rtl2832_r820t_config; | 799 | rtl2832_config = &rtl28xxu_rtl2832_r820t_config; |
800 | break; | 800 | break; |
801 | default: | 801 | default: |
802 | dev_err(&d->udev->dev, "%s: unknown tuner=%s\n", | 802 | dev_err(&d->udev->dev, "%s: unknown tuner=%s\n", |
803 | KBUILD_MODNAME, priv->tuner_name); | 803 | KBUILD_MODNAME, priv->tuner_name); |
804 | ret = -ENODEV; | 804 | ret = -ENODEV; |
805 | goto err; | 805 | goto err; |
806 | } | 806 | } |
807 | 807 | ||
808 | /* attach demodulator */ | 808 | /* attach demodulator */ |
809 | adap->fe[0] = dvb_attach(rtl2832_attach, rtl2832_config, &d->i2c_adap); | 809 | adap->fe[0] = dvb_attach(rtl2832_attach, rtl2832_config, &d->i2c_adap); |
810 | if (!adap->fe[0]) { | 810 | if (!adap->fe[0]) { |
811 | ret = -ENODEV; | 811 | ret = -ENODEV; |
812 | goto err; | 812 | goto err; |
813 | } | 813 | } |
814 | 814 | ||
815 | /* RTL2832 I2C repeater */ | 815 | /* RTL2832 I2C repeater */ |
816 | priv->demod_i2c_adapter = rtl2832_get_i2c_adapter(adap->fe[0]); | 816 | priv->demod_i2c_adapter = rtl2832_get_i2c_adapter(adap->fe[0]); |
817 | 817 | ||
818 | /* set fe callback */ | 818 | /* set fe callback */ |
819 | adap->fe[0]->callback = rtl2832u_frontend_callback; | 819 | adap->fe[0]->callback = rtl2832u_frontend_callback; |
820 | 820 | ||
821 | return 0; | 821 | return 0; |
822 | err: | 822 | err: |
823 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 823 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
824 | return ret; | 824 | return ret; |
825 | } | 825 | } |
826 | 826 | ||
827 | static struct qt1010_config rtl28xxu_qt1010_config = { | 827 | static struct qt1010_config rtl28xxu_qt1010_config = { |
828 | .i2c_address = 0x62, /* 0xc4 */ | 828 | .i2c_address = 0x62, /* 0xc4 */ |
829 | }; | 829 | }; |
830 | 830 | ||
831 | static struct mt2060_config rtl28xxu_mt2060_config = { | 831 | static struct mt2060_config rtl28xxu_mt2060_config = { |
832 | .i2c_address = 0x60, /* 0xc0 */ | 832 | .i2c_address = 0x60, /* 0xc0 */ |
833 | .clock_out = 0, | 833 | .clock_out = 0, |
834 | }; | 834 | }; |
835 | 835 | ||
836 | static struct mxl5005s_config rtl28xxu_mxl5005s_config = { | 836 | static struct mxl5005s_config rtl28xxu_mxl5005s_config = { |
837 | .i2c_address = 0x63, /* 0xc6 */ | 837 | .i2c_address = 0x63, /* 0xc6 */ |
838 | .if_freq = IF_FREQ_4570000HZ, | 838 | .if_freq = IF_FREQ_4570000HZ, |
839 | .xtal_freq = CRYSTAL_FREQ_16000000HZ, | 839 | .xtal_freq = CRYSTAL_FREQ_16000000HZ, |
840 | .agc_mode = MXL_SINGLE_AGC, | 840 | .agc_mode = MXL_SINGLE_AGC, |
841 | .tracking_filter = MXL_TF_C_H, | 841 | .tracking_filter = MXL_TF_C_H, |
842 | .rssi_enable = MXL_RSSI_ENABLE, | 842 | .rssi_enable = MXL_RSSI_ENABLE, |
843 | .cap_select = MXL_CAP_SEL_ENABLE, | 843 | .cap_select = MXL_CAP_SEL_ENABLE, |
844 | .div_out = MXL_DIV_OUT_4, | 844 | .div_out = MXL_DIV_OUT_4, |
845 | .clock_out = MXL_CLOCK_OUT_DISABLE, | 845 | .clock_out = MXL_CLOCK_OUT_DISABLE, |
846 | .output_load = MXL5005S_IF_OUTPUT_LOAD_200_OHM, | 846 | .output_load = MXL5005S_IF_OUTPUT_LOAD_200_OHM, |
847 | .top = MXL5005S_TOP_25P2, | 847 | .top = MXL5005S_TOP_25P2, |
848 | .mod_mode = MXL_DIGITAL_MODE, | 848 | .mod_mode = MXL_DIGITAL_MODE, |
849 | .if_mode = MXL_ZERO_IF, | 849 | .if_mode = MXL_ZERO_IF, |
850 | .AgcMasterByte = 0x00, | 850 | .AgcMasterByte = 0x00, |
851 | }; | 851 | }; |
852 | 852 | ||
853 | static int rtl2831u_tuner_attach(struct dvb_usb_adapter *adap) | 853 | static int rtl2831u_tuner_attach(struct dvb_usb_adapter *adap) |
854 | { | 854 | { |
855 | int ret; | 855 | int ret; |
856 | struct dvb_usb_device *d = adap_to_d(adap); | 856 | struct dvb_usb_device *d = adap_to_d(adap); |
857 | struct rtl28xxu_priv *priv = d_to_priv(d); | 857 | struct rtl28xxu_priv *priv = d_to_priv(d); |
858 | struct i2c_adapter *rtl2830_tuner_i2c; | 858 | struct i2c_adapter *rtl2830_tuner_i2c; |
859 | struct dvb_frontend *fe; | 859 | struct dvb_frontend *fe; |
860 | 860 | ||
861 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 861 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
862 | 862 | ||
863 | /* use rtl2830 driver I2C adapter, for more info see rtl2830 driver */ | 863 | /* use rtl2830 driver I2C adapter, for more info see rtl2830 driver */ |
864 | rtl2830_tuner_i2c = rtl2830_get_tuner_i2c_adapter(adap->fe[0]); | 864 | rtl2830_tuner_i2c = rtl2830_get_tuner_i2c_adapter(adap->fe[0]); |
865 | 865 | ||
866 | switch (priv->tuner) { | 866 | switch (priv->tuner) { |
867 | case TUNER_RTL2830_QT1010: | 867 | case TUNER_RTL2830_QT1010: |
868 | fe = dvb_attach(qt1010_attach, adap->fe[0], | 868 | fe = dvb_attach(qt1010_attach, adap->fe[0], |
869 | rtl2830_tuner_i2c, &rtl28xxu_qt1010_config); | 869 | rtl2830_tuner_i2c, &rtl28xxu_qt1010_config); |
870 | break; | 870 | break; |
871 | case TUNER_RTL2830_MT2060: | 871 | case TUNER_RTL2830_MT2060: |
872 | fe = dvb_attach(mt2060_attach, adap->fe[0], | 872 | fe = dvb_attach(mt2060_attach, adap->fe[0], |
873 | rtl2830_tuner_i2c, &rtl28xxu_mt2060_config, | 873 | rtl2830_tuner_i2c, &rtl28xxu_mt2060_config, |
874 | 1220); | 874 | 1220); |
875 | break; | 875 | break; |
876 | case TUNER_RTL2830_MXL5005S: | 876 | case TUNER_RTL2830_MXL5005S: |
877 | fe = dvb_attach(mxl5005s_attach, adap->fe[0], | 877 | fe = dvb_attach(mxl5005s_attach, adap->fe[0], |
878 | rtl2830_tuner_i2c, &rtl28xxu_mxl5005s_config); | 878 | rtl2830_tuner_i2c, &rtl28xxu_mxl5005s_config); |
879 | break; | 879 | break; |
880 | default: | 880 | default: |
881 | fe = NULL; | 881 | fe = NULL; |
882 | dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME, | 882 | dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME, |
883 | priv->tuner); | 883 | priv->tuner); |
884 | } | 884 | } |
885 | 885 | ||
886 | if (fe == NULL) { | 886 | if (fe == NULL) { |
887 | ret = -ENODEV; | 887 | ret = -ENODEV; |
888 | goto err; | 888 | goto err; |
889 | } | 889 | } |
890 | 890 | ||
891 | return 0; | 891 | return 0; |
892 | err: | 892 | err: |
893 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 893 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
894 | return ret; | 894 | return ret; |
895 | } | 895 | } |
896 | 896 | ||
897 | static const struct fc2580_config rtl2832u_fc2580_config = { | 897 | static const struct fc2580_config rtl2832u_fc2580_config = { |
898 | .i2c_addr = 0x56, | 898 | .i2c_addr = 0x56, |
899 | .clock = 16384000, | 899 | .clock = 16384000, |
900 | }; | 900 | }; |
901 | 901 | ||
902 | static struct tua9001_config rtl2832u_tua9001_config = { | 902 | static struct tua9001_config rtl2832u_tua9001_config = { |
903 | .i2c_addr = 0x60, | 903 | .i2c_addr = 0x60, |
904 | }; | 904 | }; |
905 | 905 | ||
906 | static const struct fc0012_config rtl2832u_fc0012_config = { | 906 | static const struct fc0012_config rtl2832u_fc0012_config = { |
907 | .i2c_address = 0x63, /* 0xc6 >> 1 */ | 907 | .i2c_address = 0x63, /* 0xc6 >> 1 */ |
908 | .xtal_freq = FC_XTAL_28_8_MHZ, | 908 | .xtal_freq = FC_XTAL_28_8_MHZ, |
909 | }; | 909 | }; |
910 | 910 | ||
911 | static const struct r820t_config rtl2832u_r820t_config = { | 911 | static const struct r820t_config rtl2832u_r820t_config = { |
912 | .i2c_addr = 0x1a, | 912 | .i2c_addr = 0x1a, |
913 | .xtal = 28800000, | 913 | .xtal = 28800000, |
914 | .max_i2c_msg_len = 2, | 914 | .max_i2c_msg_len = 2, |
915 | .rafael_chip = CHIP_R820T, | 915 | .rafael_chip = CHIP_R820T, |
916 | }; | 916 | }; |
917 | 917 | ||
918 | static const struct r820t_config rtl2832u_r828d_config = { | 918 | static const struct r820t_config rtl2832u_r828d_config = { |
919 | .i2c_addr = 0x3a, | 919 | .i2c_addr = 0x3a, |
920 | .xtal = 16000000, | 920 | .xtal = 16000000, |
921 | .max_i2c_msg_len = 2, | 921 | .max_i2c_msg_len = 2, |
922 | .rafael_chip = CHIP_R828D, | 922 | .rafael_chip = CHIP_R828D, |
923 | }; | 923 | }; |
924 | 924 | ||
925 | static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | 925 | static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) |
926 | { | 926 | { |
927 | int ret; | 927 | int ret; |
928 | struct dvb_usb_device *d = adap_to_d(adap); | 928 | struct dvb_usb_device *d = adap_to_d(adap); |
929 | struct rtl28xxu_priv *priv = d_to_priv(d); | 929 | struct rtl28xxu_priv *priv = d_to_priv(d); |
930 | struct dvb_frontend *fe = NULL; | 930 | struct dvb_frontend *fe = NULL; |
931 | struct i2c_board_info info; | 931 | struct i2c_board_info info; |
932 | struct i2c_client *client; | 932 | struct i2c_client *client; |
933 | 933 | ||
934 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 934 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
935 | 935 | ||
936 | memset(&info, 0, sizeof(struct i2c_board_info)); | 936 | memset(&info, 0, sizeof(struct i2c_board_info)); |
937 | 937 | ||
938 | switch (priv->tuner) { | 938 | switch (priv->tuner) { |
939 | case TUNER_RTL2832_FC0012: | 939 | case TUNER_RTL2832_FC0012: |
940 | fe = dvb_attach(fc0012_attach, adap->fe[0], | 940 | fe = dvb_attach(fc0012_attach, adap->fe[0], |
941 | &d->i2c_adap, &rtl2832u_fc0012_config); | 941 | &d->i2c_adap, &rtl2832u_fc0012_config); |
942 | 942 | ||
943 | /* since fc0012 includs reading the signal strength delegate | 943 | /* since fc0012 includs reading the signal strength delegate |
944 | * that to the tuner driver */ | 944 | * that to the tuner driver */ |
945 | adap->fe[0]->ops.read_signal_strength = | 945 | adap->fe[0]->ops.read_signal_strength = |
946 | adap->fe[0]->ops.tuner_ops.get_rf_strength; | 946 | adap->fe[0]->ops.tuner_ops.get_rf_strength; |
947 | 947 | ||
948 | /* attach SDR */ | 948 | /* attach SDR */ |
949 | dvb_attach_sdr(rtl2832_sdr_attach, adap->fe[0], &d->i2c_adap, | 949 | dvb_attach_sdr(rtl2832_sdr_attach, adap->fe[0], &d->i2c_adap, |
950 | &rtl28xxu_rtl2832_fc0012_config, NULL); | 950 | &rtl28xxu_rtl2832_fc0012_config, NULL); |
951 | break; | 951 | break; |
952 | case TUNER_RTL2832_FC0013: | 952 | case TUNER_RTL2832_FC0013: |
953 | fe = dvb_attach(fc0013_attach, adap->fe[0], | 953 | fe = dvb_attach(fc0013_attach, adap->fe[0], |
954 | &d->i2c_adap, 0xc6>>1, 0, FC_XTAL_28_8_MHZ); | 954 | &d->i2c_adap, 0xc6>>1, 0, FC_XTAL_28_8_MHZ); |
955 | 955 | ||
956 | /* fc0013 also supports signal strength reading */ | 956 | /* fc0013 also supports signal strength reading */ |
957 | adap->fe[0]->ops.read_signal_strength = | 957 | adap->fe[0]->ops.read_signal_strength = |
958 | adap->fe[0]->ops.tuner_ops.get_rf_strength; | 958 | adap->fe[0]->ops.tuner_ops.get_rf_strength; |
959 | 959 | ||
960 | /* attach SDR */ | 960 | /* attach SDR */ |
961 | dvb_attach_sdr(rtl2832_sdr_attach, adap->fe[0], &d->i2c_adap, | 961 | dvb_attach_sdr(rtl2832_sdr_attach, adap->fe[0], &d->i2c_adap, |
962 | &rtl28xxu_rtl2832_fc0013_config, NULL); | 962 | &rtl28xxu_rtl2832_fc0013_config, NULL); |
963 | break; | 963 | break; |
964 | case TUNER_RTL2832_E4000: { | 964 | case TUNER_RTL2832_E4000: { |
965 | struct v4l2_subdev *sd; | 965 | struct v4l2_subdev *sd; |
966 | struct i2c_adapter *i2c_adap_internal = | 966 | struct i2c_adapter *i2c_adap_internal = |
967 | rtl2832_get_private_i2c_adapter(adap->fe[0]); | 967 | rtl2832_get_private_i2c_adapter(adap->fe[0]); |
968 | struct e4000_config e4000_config = { | 968 | struct e4000_config e4000_config = { |
969 | .fe = adap->fe[0], | 969 | .fe = adap->fe[0], |
970 | .clock = 28800000, | 970 | .clock = 28800000, |
971 | }; | 971 | }; |
972 | 972 | ||
973 | strlcpy(info.type, "e4000", I2C_NAME_SIZE); | 973 | strlcpy(info.type, "e4000", I2C_NAME_SIZE); |
974 | info.addr = 0x64; | 974 | info.addr = 0x64; |
975 | info.platform_data = &e4000_config; | 975 | info.platform_data = &e4000_config; |
976 | 976 | ||
977 | request_module(info.type); | 977 | request_module(info.type); |
978 | client = i2c_new_device(priv->demod_i2c_adapter, &info); | 978 | client = i2c_new_device(priv->demod_i2c_adapter, &info); |
979 | if (client == NULL || client->dev.driver == NULL) | 979 | if (client == NULL || client->dev.driver == NULL) |
980 | break; | 980 | break; |
981 | 981 | ||
982 | if (!try_module_get(client->dev.driver->owner)) { | 982 | if (!try_module_get(client->dev.driver->owner)) { |
983 | i2c_unregister_device(client); | 983 | i2c_unregister_device(client); |
984 | break; | 984 | break; |
985 | } | 985 | } |
986 | 986 | ||
987 | priv->client = client; | 987 | priv->client = client; |
988 | sd = i2c_get_clientdata(client); | 988 | sd = i2c_get_clientdata(client); |
989 | i2c_set_adapdata(i2c_adap_internal, d); | 989 | i2c_set_adapdata(i2c_adap_internal, d); |
990 | 990 | ||
991 | /* attach SDR */ | 991 | /* attach SDR */ |
992 | dvb_attach_sdr(rtl2832_sdr_attach, adap->fe[0], | 992 | dvb_attach_sdr(rtl2832_sdr_attach, adap->fe[0], |
993 | i2c_adap_internal, | 993 | i2c_adap_internal, |
994 | &rtl28xxu_rtl2832_e4000_config, sd); | 994 | &rtl28xxu_rtl2832_e4000_config, sd); |
995 | } | 995 | } |
996 | break; | 996 | break; |
997 | case TUNER_RTL2832_FC2580: | 997 | case TUNER_RTL2832_FC2580: |
998 | fe = dvb_attach(fc2580_attach, adap->fe[0], &d->i2c_adap, | 998 | fe = dvb_attach(fc2580_attach, adap->fe[0], &d->i2c_adap, |
999 | &rtl2832u_fc2580_config); | 999 | &rtl2832u_fc2580_config); |
1000 | break; | 1000 | break; |
1001 | case TUNER_RTL2832_TUA9001: | 1001 | case TUNER_RTL2832_TUA9001: |
1002 | /* enable GPIO1 and GPIO4 as output */ | 1002 | /* enable GPIO1 and GPIO4 as output */ |
1003 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_DIR, 0x00, 0x12); | 1003 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_DIR, 0x00, 0x12); |
1004 | if (ret) | 1004 | if (ret) |
1005 | goto err; | 1005 | goto err; |
1006 | 1006 | ||
1007 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_EN, 0x12, 0x12); | 1007 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_EN, 0x12, 0x12); |
1008 | if (ret) | 1008 | if (ret) |
1009 | goto err; | 1009 | goto err; |
1010 | 1010 | ||
1011 | fe = dvb_attach(tua9001_attach, adap->fe[0], &d->i2c_adap, | 1011 | fe = dvb_attach(tua9001_attach, adap->fe[0], &d->i2c_adap, |
1012 | &rtl2832u_tua9001_config); | 1012 | &rtl2832u_tua9001_config); |
1013 | break; | 1013 | break; |
1014 | case TUNER_RTL2832_R820T: | 1014 | case TUNER_RTL2832_R820T: |
1015 | fe = dvb_attach(r820t_attach, adap->fe[0], &d->i2c_adap, | 1015 | fe = dvb_attach(r820t_attach, adap->fe[0], &d->i2c_adap, |
1016 | &rtl2832u_r820t_config); | 1016 | &rtl2832u_r820t_config); |
1017 | 1017 | ||
1018 | /* Use tuner to get the signal strength */ | 1018 | /* Use tuner to get the signal strength */ |
1019 | adap->fe[0]->ops.read_signal_strength = | 1019 | adap->fe[0]->ops.read_signal_strength = |
1020 | adap->fe[0]->ops.tuner_ops.get_rf_strength; | 1020 | adap->fe[0]->ops.tuner_ops.get_rf_strength; |
1021 | 1021 | ||
1022 | /* attach SDR */ | 1022 | /* attach SDR */ |
1023 | dvb_attach_sdr(rtl2832_sdr_attach, adap->fe[0], &d->i2c_adap, | 1023 | dvb_attach_sdr(rtl2832_sdr_attach, adap->fe[0], &d->i2c_adap, |
1024 | &rtl28xxu_rtl2832_r820t_config, NULL); | 1024 | &rtl28xxu_rtl2832_r820t_config, NULL); |
1025 | break; | 1025 | break; |
1026 | case TUNER_RTL2832_R828D: | 1026 | case TUNER_RTL2832_R828D: |
1027 | /* power off mn88472 demod on GPIO0 */ | 1027 | /* power off mn88472 demod on GPIO0 */ |
1028 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, 0x00, 0x01); | 1028 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, 0x00, 0x01); |
1029 | if (ret) | 1029 | if (ret) |
1030 | goto err; | 1030 | goto err; |
1031 | 1031 | ||
1032 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_DIR, 0x00, 0x01); | 1032 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_DIR, 0x00, 0x01); |
1033 | if (ret) | 1033 | if (ret) |
1034 | goto err; | 1034 | goto err; |
1035 | 1035 | ||
1036 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_EN, 0x01, 0x01); | 1036 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_EN, 0x01, 0x01); |
1037 | if (ret) | 1037 | if (ret) |
1038 | goto err; | 1038 | goto err; |
1039 | 1039 | ||
1040 | fe = dvb_attach(r820t_attach, adap->fe[0], &d->i2c_adap, | 1040 | fe = dvb_attach(r820t_attach, adap->fe[0], &d->i2c_adap, |
1041 | &rtl2832u_r828d_config); | 1041 | &rtl2832u_r828d_config); |
1042 | 1042 | ||
1043 | /* Use tuner to get the signal strength */ | 1043 | /* Use tuner to get the signal strength */ |
1044 | adap->fe[0]->ops.read_signal_strength = | 1044 | adap->fe[0]->ops.read_signal_strength = |
1045 | adap->fe[0]->ops.tuner_ops.get_rf_strength; | 1045 | adap->fe[0]->ops.tuner_ops.get_rf_strength; |
1046 | break; | 1046 | break; |
1047 | default: | 1047 | default: |
1048 | dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME, | 1048 | dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME, |
1049 | priv->tuner); | 1049 | priv->tuner); |
1050 | } | 1050 | } |
1051 | 1051 | ||
1052 | if (fe == NULL && priv->client == NULL) { | 1052 | if (fe == NULL && priv->client == NULL) { |
1053 | ret = -ENODEV; | 1053 | ret = -ENODEV; |
1054 | goto err; | 1054 | goto err; |
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | return 0; | 1057 | return 0; |
1058 | err: | 1058 | err: |
1059 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 1059 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
1060 | return ret; | 1060 | return ret; |
1061 | } | 1061 | } |
1062 | 1062 | ||
1063 | static int rtl28xxu_init(struct dvb_usb_device *d) | 1063 | static int rtl28xxu_init(struct dvb_usb_device *d) |
1064 | { | 1064 | { |
1065 | int ret; | 1065 | int ret; |
1066 | u8 val; | 1066 | u8 val; |
1067 | 1067 | ||
1068 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 1068 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
1069 | 1069 | ||
1070 | /* init USB endpoints */ | 1070 | /* init USB endpoints */ |
1071 | ret = rtl28xx_rd_reg(d, USB_SYSCTL_0, &val); | 1071 | ret = rtl28xx_rd_reg(d, USB_SYSCTL_0, &val); |
1072 | if (ret) | 1072 | if (ret) |
1073 | goto err; | 1073 | goto err; |
1074 | 1074 | ||
1075 | /* enable DMA and Full Packet Mode*/ | 1075 | /* enable DMA and Full Packet Mode*/ |
1076 | val |= 0x09; | 1076 | val |= 0x09; |
1077 | ret = rtl28xx_wr_reg(d, USB_SYSCTL_0, val); | 1077 | ret = rtl28xx_wr_reg(d, USB_SYSCTL_0, val); |
1078 | if (ret) | 1078 | if (ret) |
1079 | goto err; | 1079 | goto err; |
1080 | 1080 | ||
1081 | /* set EPA maximum packet size to 0x0200 */ | 1081 | /* set EPA maximum packet size to 0x0200 */ |
1082 | ret = rtl28xx_wr_regs(d, USB_EPA_MAXPKT, "\x00\x02\x00\x00", 4); | 1082 | ret = rtl28xx_wr_regs(d, USB_EPA_MAXPKT, "\x00\x02\x00\x00", 4); |
1083 | if (ret) | 1083 | if (ret) |
1084 | goto err; | 1084 | goto err; |
1085 | 1085 | ||
1086 | /* change EPA FIFO length */ | 1086 | /* change EPA FIFO length */ |
1087 | ret = rtl28xx_wr_regs(d, USB_EPA_FIFO_CFG, "\x14\x00\x00\x00", 4); | 1087 | ret = rtl28xx_wr_regs(d, USB_EPA_FIFO_CFG, "\x14\x00\x00\x00", 4); |
1088 | if (ret) | 1088 | if (ret) |
1089 | goto err; | 1089 | goto err; |
1090 | 1090 | ||
1091 | return ret; | 1091 | return ret; |
1092 | err: | 1092 | err: |
1093 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 1093 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
1094 | return ret; | 1094 | return ret; |
1095 | } | 1095 | } |
1096 | 1096 | ||
1097 | static void rtl28xxu_exit(struct dvb_usb_device *d) | 1097 | static void rtl28xxu_exit(struct dvb_usb_device *d) |
1098 | { | 1098 | { |
1099 | struct rtl28xxu_priv *priv = d->priv; | 1099 | struct rtl28xxu_priv *priv = d->priv; |
1100 | struct i2c_client *client = priv->client; | 1100 | struct i2c_client *client = priv->client; |
1101 | 1101 | ||
1102 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 1102 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
1103 | 1103 | ||
1104 | /* remove I2C tuner */ | 1104 | /* remove I2C tuner */ |
1105 | if (client) { | 1105 | if (client) { |
1106 | module_put(client->dev.driver->owner); | 1106 | module_put(client->dev.driver->owner); |
1107 | i2c_unregister_device(client); | 1107 | i2c_unregister_device(client); |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | return; | 1110 | return; |
1111 | } | 1111 | } |
1112 | 1112 | ||
1113 | static int rtl2831u_power_ctrl(struct dvb_usb_device *d, int onoff) | 1113 | static int rtl2831u_power_ctrl(struct dvb_usb_device *d, int onoff) |
1114 | { | 1114 | { |
1115 | int ret; | 1115 | int ret; |
1116 | u8 gpio, sys0, epa_ctl[2]; | 1116 | u8 gpio, sys0, epa_ctl[2]; |
1117 | 1117 | ||
1118 | dev_dbg(&d->udev->dev, "%s: onoff=%d\n", __func__, onoff); | 1118 | dev_dbg(&d->udev->dev, "%s: onoff=%d\n", __func__, onoff); |
1119 | 1119 | ||
1120 | /* demod adc */ | 1120 | /* demod adc */ |
1121 | ret = rtl28xx_rd_reg(d, SYS_SYS0, &sys0); | 1121 | ret = rtl28xx_rd_reg(d, SYS_SYS0, &sys0); |
1122 | if (ret) | 1122 | if (ret) |
1123 | goto err; | 1123 | goto err; |
1124 | 1124 | ||
1125 | /* tuner power, read GPIOs */ | 1125 | /* tuner power, read GPIOs */ |
1126 | ret = rtl28xx_rd_reg(d, SYS_GPIO_OUT_VAL, &gpio); | 1126 | ret = rtl28xx_rd_reg(d, SYS_GPIO_OUT_VAL, &gpio); |
1127 | if (ret) | 1127 | if (ret) |
1128 | goto err; | 1128 | goto err; |
1129 | 1129 | ||
1130 | dev_dbg(&d->udev->dev, "%s: RD SYS0=%02x GPIO_OUT_VAL=%02x\n", __func__, | 1130 | dev_dbg(&d->udev->dev, "%s: RD SYS0=%02x GPIO_OUT_VAL=%02x\n", __func__, |
1131 | sys0, gpio); | 1131 | sys0, gpio); |
1132 | 1132 | ||
1133 | if (onoff) { | 1133 | if (onoff) { |
1134 | gpio |= 0x01; /* GPIO0 = 1 */ | 1134 | gpio |= 0x01; /* GPIO0 = 1 */ |
1135 | gpio &= (~0x10); /* GPIO4 = 0 */ | 1135 | gpio &= (~0x10); /* GPIO4 = 0 */ |
1136 | gpio |= 0x04; /* GPIO2 = 1, LED on */ | 1136 | gpio |= 0x04; /* GPIO2 = 1, LED on */ |
1137 | sys0 = sys0 & 0x0f; | 1137 | sys0 = sys0 & 0x0f; |
1138 | sys0 |= 0xe0; | 1138 | sys0 |= 0xe0; |
1139 | epa_ctl[0] = 0x00; /* clear stall */ | 1139 | epa_ctl[0] = 0x00; /* clear stall */ |
1140 | epa_ctl[1] = 0x00; /* clear reset */ | 1140 | epa_ctl[1] = 0x00; /* clear reset */ |
1141 | } else { | 1141 | } else { |
1142 | gpio &= (~0x01); /* GPIO0 = 0 */ | 1142 | gpio &= (~0x01); /* GPIO0 = 0 */ |
1143 | gpio |= 0x10; /* GPIO4 = 1 */ | 1143 | gpio |= 0x10; /* GPIO4 = 1 */ |
1144 | gpio &= (~0x04); /* GPIO2 = 1, LED off */ | 1144 | gpio &= (~0x04); /* GPIO2 = 1, LED off */ |
1145 | sys0 = sys0 & (~0xc0); | 1145 | sys0 = sys0 & (~0xc0); |
1146 | epa_ctl[0] = 0x10; /* set stall */ | 1146 | epa_ctl[0] = 0x10; /* set stall */ |
1147 | epa_ctl[1] = 0x02; /* set reset */ | 1147 | epa_ctl[1] = 0x02; /* set reset */ |
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | dev_dbg(&d->udev->dev, "%s: WR SYS0=%02x GPIO_OUT_VAL=%02x\n", __func__, | 1150 | dev_dbg(&d->udev->dev, "%s: WR SYS0=%02x GPIO_OUT_VAL=%02x\n", __func__, |
1151 | sys0, gpio); | 1151 | sys0, gpio); |
1152 | 1152 | ||
1153 | /* demod adc */ | 1153 | /* demod adc */ |
1154 | ret = rtl28xx_wr_reg(d, SYS_SYS0, sys0); | 1154 | ret = rtl28xx_wr_reg(d, SYS_SYS0, sys0); |
1155 | if (ret) | 1155 | if (ret) |
1156 | goto err; | 1156 | goto err; |
1157 | 1157 | ||
1158 | /* tuner power, write GPIOs */ | 1158 | /* tuner power, write GPIOs */ |
1159 | ret = rtl28xx_wr_reg(d, SYS_GPIO_OUT_VAL, gpio); | 1159 | ret = rtl28xx_wr_reg(d, SYS_GPIO_OUT_VAL, gpio); |
1160 | if (ret) | 1160 | if (ret) |
1161 | goto err; | 1161 | goto err; |
1162 | 1162 | ||
1163 | /* streaming EP: stall & reset */ | 1163 | /* streaming EP: stall & reset */ |
1164 | ret = rtl28xx_wr_regs(d, USB_EPA_CTL, epa_ctl, 2); | 1164 | ret = rtl28xx_wr_regs(d, USB_EPA_CTL, epa_ctl, 2); |
1165 | if (ret) | 1165 | if (ret) |
1166 | goto err; | 1166 | goto err; |
1167 | 1167 | ||
1168 | if (onoff) | 1168 | if (onoff) |
1169 | usb_clear_halt(d->udev, usb_rcvbulkpipe(d->udev, 0x81)); | 1169 | usb_clear_halt(d->udev, usb_rcvbulkpipe(d->udev, 0x81)); |
1170 | 1170 | ||
1171 | return ret; | 1171 | return ret; |
1172 | err: | 1172 | err: |
1173 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 1173 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
1174 | return ret; | 1174 | return ret; |
1175 | } | 1175 | } |
1176 | 1176 | ||
1177 | static int rtl2832u_power_ctrl(struct dvb_usb_device *d, int onoff) | 1177 | static int rtl2832u_power_ctrl(struct dvb_usb_device *d, int onoff) |
1178 | { | 1178 | { |
1179 | int ret; | 1179 | int ret; |
1180 | 1180 | ||
1181 | dev_dbg(&d->udev->dev, "%s: onoff=%d\n", __func__, onoff); | 1181 | dev_dbg(&d->udev->dev, "%s: onoff=%d\n", __func__, onoff); |
1182 | 1182 | ||
1183 | if (onoff) { | 1183 | if (onoff) { |
1184 | /* GPIO3=1, GPIO4=0 */ | 1184 | /* GPIO3=1, GPIO4=0 */ |
1185 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, 0x08, 0x18); | 1185 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, 0x08, 0x18); |
1186 | if (ret) | 1186 | if (ret) |
1187 | goto err; | 1187 | goto err; |
1188 | 1188 | ||
1189 | /* suspend? */ | 1189 | /* suspend? */ |
1190 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL1, 0x00, 0x10); | 1190 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL1, 0x00, 0x10); |
1191 | if (ret) | 1191 | if (ret) |
1192 | goto err; | 1192 | goto err; |
1193 | 1193 | ||
1194 | /* enable PLL */ | 1194 | /* enable PLL */ |
1195 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL, 0x80, 0x80); | 1195 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL, 0x80, 0x80); |
1196 | if (ret) | 1196 | if (ret) |
1197 | goto err; | 1197 | goto err; |
1198 | 1198 | ||
1199 | /* disable reset */ | 1199 | /* disable reset */ |
1200 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL, 0x20, 0x20); | 1200 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL, 0x20, 0x20); |
1201 | if (ret) | 1201 | if (ret) |
1202 | goto err; | 1202 | goto err; |
1203 | 1203 | ||
1204 | mdelay(5); | 1204 | mdelay(5); |
1205 | 1205 | ||
1206 | /* enable ADC */ | 1206 | /* enable ADC */ |
1207 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL, 0x48, 0x48); | 1207 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL, 0x48, 0x48); |
1208 | if (ret) | 1208 | if (ret) |
1209 | goto err; | 1209 | goto err; |
1210 | 1210 | ||
1211 | /* streaming EP: clear stall & reset */ | 1211 | /* streaming EP: clear stall & reset */ |
1212 | ret = rtl28xx_wr_regs(d, USB_EPA_CTL, "\x00\x00", 2); | 1212 | ret = rtl28xx_wr_regs(d, USB_EPA_CTL, "\x00\x00", 2); |
1213 | if (ret) | 1213 | if (ret) |
1214 | goto err; | 1214 | goto err; |
1215 | 1215 | ||
1216 | ret = usb_clear_halt(d->udev, usb_rcvbulkpipe(d->udev, 0x81)); | 1216 | ret = usb_clear_halt(d->udev, usb_rcvbulkpipe(d->udev, 0x81)); |
1217 | if (ret) | 1217 | if (ret) |
1218 | goto err; | 1218 | goto err; |
1219 | } else { | 1219 | } else { |
1220 | /* GPIO4=1 */ | 1220 | /* GPIO4=1 */ |
1221 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, 0x10, 0x10); | 1221 | ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, 0x10, 0x10); |
1222 | if (ret) | 1222 | if (ret) |
1223 | goto err; | 1223 | goto err; |
1224 | 1224 | ||
1225 | /* disable ADC */ | 1225 | /* disable ADC */ |
1226 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL, 0x00, 0x48); | 1226 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL, 0x00, 0x48); |
1227 | if (ret) | 1227 | if (ret) |
1228 | goto err; | 1228 | goto err; |
1229 | 1229 | ||
1230 | /* disable PLL */ | 1230 | /* disable PLL */ |
1231 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL, 0x00, 0x80); | 1231 | ret = rtl28xx_wr_reg_mask(d, SYS_DEMOD_CTL, 0x00, 0x80); |
1232 | if (ret) | 1232 | if (ret) |
1233 | goto err; | 1233 | goto err; |
1234 | 1234 | ||
1235 | /* streaming EP: set stall & reset */ | 1235 | /* streaming EP: set stall & reset */ |
1236 | ret = rtl28xx_wr_regs(d, USB_EPA_CTL, "\x10\x02", 2); | 1236 | ret = rtl28xx_wr_regs(d, USB_EPA_CTL, "\x10\x02", 2); |
1237 | if (ret) | 1237 | if (ret) |
1238 | goto err; | 1238 | goto err; |
1239 | } | 1239 | } |
1240 | 1240 | ||
1241 | return ret; | 1241 | return ret; |
1242 | err: | 1242 | err: |
1243 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 1243 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
1244 | return ret; | 1244 | return ret; |
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | #if IS_ENABLED(CONFIG_RC_CORE) | 1247 | #if IS_ENABLED(CONFIG_RC_CORE) |
1248 | static int rtl2831u_rc_query(struct dvb_usb_device *d) | 1248 | static int rtl2831u_rc_query(struct dvb_usb_device *d) |
1249 | { | 1249 | { |
1250 | int ret, i; | 1250 | int ret, i; |
1251 | struct rtl28xxu_priv *priv = d->priv; | 1251 | struct rtl28xxu_priv *priv = d->priv; |
1252 | u8 buf[5]; | 1252 | u8 buf[5]; |
1253 | u32 rc_code; | 1253 | u32 rc_code; |
1254 | struct rtl28xxu_reg_val rc_nec_tab[] = { | 1254 | struct rtl28xxu_reg_val rc_nec_tab[] = { |
1255 | { 0x3033, 0x80 }, | 1255 | { 0x3033, 0x80 }, |
1256 | { 0x3020, 0x43 }, | 1256 | { 0x3020, 0x43 }, |
1257 | { 0x3021, 0x16 }, | 1257 | { 0x3021, 0x16 }, |
1258 | { 0x3022, 0x16 }, | 1258 | { 0x3022, 0x16 }, |
1259 | { 0x3023, 0x5a }, | 1259 | { 0x3023, 0x5a }, |
1260 | { 0x3024, 0x2d }, | 1260 | { 0x3024, 0x2d }, |
1261 | { 0x3025, 0x16 }, | 1261 | { 0x3025, 0x16 }, |
1262 | { 0x3026, 0x01 }, | 1262 | { 0x3026, 0x01 }, |
1263 | { 0x3028, 0xb0 }, | 1263 | { 0x3028, 0xb0 }, |
1264 | { 0x3029, 0x04 }, | 1264 | { 0x3029, 0x04 }, |
1265 | { 0x302c, 0x88 }, | 1265 | { 0x302c, 0x88 }, |
1266 | { 0x302e, 0x13 }, | 1266 | { 0x302e, 0x13 }, |
1267 | { 0x3030, 0xdf }, | 1267 | { 0x3030, 0xdf }, |
1268 | { 0x3031, 0x05 }, | 1268 | { 0x3031, 0x05 }, |
1269 | }; | 1269 | }; |
1270 | 1270 | ||
1271 | /* init remote controller */ | 1271 | /* init remote controller */ |
1272 | if (!priv->rc_active) { | 1272 | if (!priv->rc_active) { |
1273 | for (i = 0; i < ARRAY_SIZE(rc_nec_tab); i++) { | 1273 | for (i = 0; i < ARRAY_SIZE(rc_nec_tab); i++) { |
1274 | ret = rtl28xx_wr_reg(d, rc_nec_tab[i].reg, | 1274 | ret = rtl28xx_wr_reg(d, rc_nec_tab[i].reg, |
1275 | rc_nec_tab[i].val); | 1275 | rc_nec_tab[i].val); |
1276 | if (ret) | 1276 | if (ret) |
1277 | goto err; | 1277 | goto err; |
1278 | } | 1278 | } |
1279 | priv->rc_active = true; | 1279 | priv->rc_active = true; |
1280 | } | 1280 | } |
1281 | 1281 | ||
1282 | ret = rtl2831_rd_regs(d, SYS_IRRC_RP, buf, 5); | 1282 | ret = rtl2831_rd_regs(d, SYS_IRRC_RP, buf, 5); |
1283 | if (ret) | 1283 | if (ret) |
1284 | goto err; | 1284 | goto err; |
1285 | 1285 | ||
1286 | if (buf[4] & 0x01) { | 1286 | if (buf[4] & 0x01) { |
1287 | if (buf[2] == (u8) ~buf[3]) { | 1287 | if (buf[2] == (u8) ~buf[3]) { |
1288 | if (buf[0] == (u8) ~buf[1]) { | 1288 | if (buf[0] == (u8) ~buf[1]) { |
1289 | /* NEC standard (16 bit) */ | 1289 | /* NEC standard (16 bit) */ |
1290 | rc_code = buf[0] << 8 | buf[2]; | 1290 | rc_code = buf[0] << 8 | buf[2]; |
1291 | } else { | 1291 | } else { |
1292 | /* NEC extended (24 bit) */ | 1292 | /* NEC extended (24 bit) */ |
1293 | rc_code = buf[0] << 16 | | 1293 | rc_code = buf[0] << 16 | |
1294 | buf[1] << 8 | buf[2]; | 1294 | buf[1] << 8 | buf[2]; |
1295 | } | 1295 | } |
1296 | } else { | 1296 | } else { |
1297 | /* NEC full (32 bit) */ | 1297 | /* NEC full (32 bit) */ |
1298 | rc_code = buf[0] << 24 | buf[1] << 16 | | 1298 | rc_code = buf[0] << 24 | buf[1] << 16 | |
1299 | buf[2] << 8 | buf[3]; | 1299 | buf[2] << 8 | buf[3]; |
1300 | } | 1300 | } |
1301 | 1301 | ||
1302 | rc_keydown(d->rc_dev, rc_code, 0); | 1302 | rc_keydown(d->rc_dev, rc_code, 0); |
1303 | 1303 | ||
1304 | ret = rtl28xx_wr_reg(d, SYS_IRRC_SR, 1); | 1304 | ret = rtl28xx_wr_reg(d, SYS_IRRC_SR, 1); |
1305 | if (ret) | 1305 | if (ret) |
1306 | goto err; | 1306 | goto err; |
1307 | 1307 | ||
1308 | /* repeated intentionally to avoid extra keypress */ | 1308 | /* repeated intentionally to avoid extra keypress */ |
1309 | ret = rtl28xx_wr_reg(d, SYS_IRRC_SR, 1); | 1309 | ret = rtl28xx_wr_reg(d, SYS_IRRC_SR, 1); |
1310 | if (ret) | 1310 | if (ret) |
1311 | goto err; | 1311 | goto err; |
1312 | } | 1312 | } |
1313 | 1313 | ||
1314 | return ret; | 1314 | return ret; |
1315 | err: | 1315 | err: |
1316 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 1316 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
1317 | return ret; | 1317 | return ret; |
1318 | } | 1318 | } |
1319 | 1319 | ||
1320 | static int rtl2831u_get_rc_config(struct dvb_usb_device *d, | 1320 | static int rtl2831u_get_rc_config(struct dvb_usb_device *d, |
1321 | struct dvb_usb_rc *rc) | 1321 | struct dvb_usb_rc *rc) |
1322 | { | 1322 | { |
1323 | rc->map_name = RC_MAP_EMPTY; | 1323 | rc->map_name = RC_MAP_EMPTY; |
1324 | rc->allowed_protos = RC_BIT_NEC; | 1324 | rc->allowed_protos = RC_BIT_NEC; |
1325 | rc->query = rtl2831u_rc_query; | 1325 | rc->query = rtl2831u_rc_query; |
1326 | rc->interval = 400; | 1326 | rc->interval = 400; |
1327 | 1327 | ||
1328 | return 0; | 1328 | return 0; |
1329 | } | 1329 | } |
1330 | 1330 | ||
1331 | static int rtl2832u_rc_query(struct dvb_usb_device *d) | 1331 | static int rtl2832u_rc_query(struct dvb_usb_device *d) |
1332 | { | 1332 | { |
1333 | int ret, i, len; | 1333 | int ret, i, len; |
1334 | struct rtl28xxu_priv *priv = d->priv; | 1334 | struct rtl28xxu_priv *priv = d->priv; |
1335 | struct ir_raw_event ev; | 1335 | struct ir_raw_event ev; |
1336 | u8 buf[128]; | 1336 | u8 buf[128]; |
1337 | static const struct rtl28xxu_reg_val_mask refresh_tab[] = { | 1337 | static const struct rtl28xxu_reg_val_mask refresh_tab[] = { |
1338 | {IR_RX_IF, 0x03, 0xff}, | 1338 | {IR_RX_IF, 0x03, 0xff}, |
1339 | {IR_RX_BUF_CTRL, 0x80, 0xff}, | 1339 | {IR_RX_BUF_CTRL, 0x80, 0xff}, |
1340 | {IR_RX_CTRL, 0x80, 0xff}, | 1340 | {IR_RX_CTRL, 0x80, 0xff}, |
1341 | }; | 1341 | }; |
1342 | 1342 | ||
1343 | /* init remote controller */ | 1343 | /* init remote controller */ |
1344 | if (!priv->rc_active) { | 1344 | if (!priv->rc_active) { |
1345 | static const struct rtl28xxu_reg_val_mask init_tab[] = { | 1345 | static const struct rtl28xxu_reg_val_mask init_tab[] = { |
1346 | {SYS_DEMOD_CTL1, 0x00, 0x04}, | 1346 | {SYS_DEMOD_CTL1, 0x00, 0x04}, |
1347 | {SYS_DEMOD_CTL1, 0x00, 0x08}, | 1347 | {SYS_DEMOD_CTL1, 0x00, 0x08}, |
1348 | {USB_CTRL, 0x20, 0x20}, | 1348 | {USB_CTRL, 0x20, 0x20}, |
1349 | {SYS_GPIO_DIR, 0x00, 0x08}, | 1349 | {SYS_GPIO_DIR, 0x00, 0x08}, |
1350 | {SYS_GPIO_OUT_EN, 0x08, 0x08}, | 1350 | {SYS_GPIO_OUT_EN, 0x08, 0x08}, |
1351 | {SYS_GPIO_OUT_VAL, 0x08, 0x08}, | 1351 | {SYS_GPIO_OUT_VAL, 0x08, 0x08}, |
1352 | {IR_MAX_DURATION0, 0xd0, 0xff}, | 1352 | {IR_MAX_DURATION0, 0xd0, 0xff}, |
1353 | {IR_MAX_DURATION1, 0x07, 0xff}, | 1353 | {IR_MAX_DURATION1, 0x07, 0xff}, |
1354 | {IR_IDLE_LEN0, 0xc0, 0xff}, | 1354 | {IR_IDLE_LEN0, 0xc0, 0xff}, |
1355 | {IR_IDLE_LEN1, 0x00, 0xff}, | 1355 | {IR_IDLE_LEN1, 0x00, 0xff}, |
1356 | {IR_GLITCH_LEN, 0x03, 0xff}, | 1356 | {IR_GLITCH_LEN, 0x03, 0xff}, |
1357 | {IR_RX_CLK, 0x09, 0xff}, | 1357 | {IR_RX_CLK, 0x09, 0xff}, |
1358 | {IR_RX_CFG, 0x1c, 0xff}, | 1358 | {IR_RX_CFG, 0x1c, 0xff}, |
1359 | {IR_MAX_H_TOL_LEN, 0x1e, 0xff}, | 1359 | {IR_MAX_H_TOL_LEN, 0x1e, 0xff}, |
1360 | {IR_MAX_L_TOL_LEN, 0x1e, 0xff}, | 1360 | {IR_MAX_L_TOL_LEN, 0x1e, 0xff}, |
1361 | {IR_RX_CTRL, 0x80, 0xff}, | 1361 | {IR_RX_CTRL, 0x80, 0xff}, |
1362 | }; | 1362 | }; |
1363 | 1363 | ||
1364 | for (i = 0; i < ARRAY_SIZE(init_tab); i++) { | 1364 | for (i = 0; i < ARRAY_SIZE(init_tab); i++) { |
1365 | ret = rtl28xx_wr_reg_mask(d, init_tab[i].reg, | 1365 | ret = rtl28xx_wr_reg_mask(d, init_tab[i].reg, |
1366 | init_tab[i].val, init_tab[i].mask); | 1366 | init_tab[i].val, init_tab[i].mask); |
1367 | if (ret) | 1367 | if (ret) |
1368 | goto err; | 1368 | goto err; |
1369 | } | 1369 | } |
1370 | 1370 | ||
1371 | priv->rc_active = true; | 1371 | priv->rc_active = true; |
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | ret = rtl28xx_rd_reg(d, IR_RX_IF, &buf[0]); | 1374 | ret = rtl28xx_rd_reg(d, IR_RX_IF, &buf[0]); |
1375 | if (ret) | 1375 | if (ret) |
1376 | goto err; | 1376 | goto err; |
1377 | 1377 | ||
1378 | if (buf[0] != 0x83) | 1378 | if (buf[0] != 0x83) |
1379 | goto exit; | 1379 | goto exit; |
1380 | 1380 | ||
1381 | ret = rtl28xx_rd_reg(d, IR_RX_BC, &buf[0]); | 1381 | ret = rtl28xx_rd_reg(d, IR_RX_BC, &buf[0]); |
1382 | if (ret) | 1382 | if (ret) |
1383 | goto err; | 1383 | goto err; |
1384 | 1384 | ||
1385 | len = buf[0]; | 1385 | len = buf[0]; |
1386 | 1386 | ||
1387 | /* read raw code from hw */ | 1387 | /* read raw code from hw */ |
1388 | ret = rtl2831_rd_regs(d, IR_RX_BUF, buf, len); | 1388 | ret = rtl2831_rd_regs(d, IR_RX_BUF, buf, len); |
1389 | if (ret) | 1389 | if (ret) |
1390 | goto err; | 1390 | goto err; |
1391 | 1391 | ||
1392 | /* let hw receive new code */ | 1392 | /* let hw receive new code */ |
1393 | for (i = 0; i < ARRAY_SIZE(refresh_tab); i++) { | 1393 | for (i = 0; i < ARRAY_SIZE(refresh_tab); i++) { |
1394 | ret = rtl28xx_wr_reg_mask(d, refresh_tab[i].reg, | 1394 | ret = rtl28xx_wr_reg_mask(d, refresh_tab[i].reg, |
1395 | refresh_tab[i].val, refresh_tab[i].mask); | 1395 | refresh_tab[i].val, refresh_tab[i].mask); |
1396 | if (ret) | 1396 | if (ret) |
1397 | goto err; | 1397 | goto err; |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | /* pass data to Kernel IR decoder */ | 1400 | /* pass data to Kernel IR decoder */ |
1401 | init_ir_raw_event(&ev); | 1401 | init_ir_raw_event(&ev); |
1402 | 1402 | ||
1403 | for (i = 0; i < len; i++) { | 1403 | for (i = 0; i < len; i++) { |
1404 | ev.pulse = buf[i] >> 7; | 1404 | ev.pulse = buf[i] >> 7; |
1405 | ev.duration = 50800 * (buf[i] & 0x7f); | 1405 | ev.duration = 50800 * (buf[i] & 0x7f); |
1406 | ir_raw_event_store_with_filter(d->rc_dev, &ev); | 1406 | ir_raw_event_store_with_filter(d->rc_dev, &ev); |
1407 | } | 1407 | } |
1408 | 1408 | ||
1409 | /* 'flush' ir_raw_event_store_with_filter() */ | 1409 | /* 'flush' ir_raw_event_store_with_filter() */ |
1410 | ir_raw_event_set_idle(d->rc_dev, true); | 1410 | ir_raw_event_set_idle(d->rc_dev, true); |
1411 | ir_raw_event_handle(d->rc_dev); | 1411 | ir_raw_event_handle(d->rc_dev); |
1412 | exit: | 1412 | exit: |
1413 | return ret; | 1413 | return ret; |
1414 | err: | 1414 | err: |
1415 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); | 1415 | dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); |
1416 | return ret; | 1416 | return ret; |
1417 | } | 1417 | } |
1418 | 1418 | ||
1419 | static int rtl2832u_get_rc_config(struct dvb_usb_device *d, | 1419 | static int rtl2832u_get_rc_config(struct dvb_usb_device *d, |
1420 | struct dvb_usb_rc *rc) | 1420 | struct dvb_usb_rc *rc) |
1421 | { | 1421 | { |
1422 | /* disable IR interrupts in order to avoid SDR sample loss */ | 1422 | /* disable IR interrupts in order to avoid SDR sample loss */ |
1423 | if (rtl28xxu_disable_rc) | 1423 | if (rtl28xxu_disable_rc) |
1424 | return rtl28xx_wr_reg(d, IR_RX_IE, 0x00); | 1424 | return rtl28xx_wr_reg(d, IR_RX_IE, 0x00); |
1425 | 1425 | ||
1426 | /* load empty to enable rc */ | 1426 | /* load empty to enable rc */ |
1427 | if (!rc->map_name) | 1427 | if (!rc->map_name) |
1428 | rc->map_name = RC_MAP_EMPTY; | 1428 | rc->map_name = RC_MAP_EMPTY; |
1429 | rc->allowed_protos = RC_BIT_ALL; | 1429 | rc->allowed_protos = RC_BIT_ALL; |
1430 | rc->driver_type = RC_DRIVER_IR_RAW; | 1430 | rc->driver_type = RC_DRIVER_IR_RAW; |
1431 | rc->query = rtl2832u_rc_query; | 1431 | rc->query = rtl2832u_rc_query; |
1432 | rc->interval = 400; | 1432 | rc->interval = 400; |
1433 | 1433 | ||
1434 | return 0; | 1434 | return 0; |
1435 | } | 1435 | } |
1436 | #else | 1436 | #else |
1437 | #define rtl2831u_get_rc_config NULL | 1437 | #define rtl2831u_get_rc_config NULL |
1438 | #define rtl2832u_get_rc_config NULL | 1438 | #define rtl2832u_get_rc_config NULL |
1439 | #endif | 1439 | #endif |
1440 | 1440 | ||
1441 | static const struct dvb_usb_device_properties rtl2831u_props = { | 1441 | static const struct dvb_usb_device_properties rtl2831u_props = { |
1442 | .driver_name = KBUILD_MODNAME, | 1442 | .driver_name = KBUILD_MODNAME, |
1443 | .owner = THIS_MODULE, | 1443 | .owner = THIS_MODULE, |
1444 | .adapter_nr = adapter_nr, | 1444 | .adapter_nr = adapter_nr, |
1445 | .size_of_priv = sizeof(struct rtl28xxu_priv), | 1445 | .size_of_priv = sizeof(struct rtl28xxu_priv), |
1446 | 1446 | ||
1447 | .power_ctrl = rtl2831u_power_ctrl, | 1447 | .power_ctrl = rtl2831u_power_ctrl, |
1448 | .i2c_algo = &rtl28xxu_i2c_algo, | 1448 | .i2c_algo = &rtl28xxu_i2c_algo, |
1449 | .read_config = rtl2831u_read_config, | 1449 | .read_config = rtl2831u_read_config, |
1450 | .frontend_attach = rtl2831u_frontend_attach, | 1450 | .frontend_attach = rtl2831u_frontend_attach, |
1451 | .tuner_attach = rtl2831u_tuner_attach, | 1451 | .tuner_attach = rtl2831u_tuner_attach, |
1452 | .init = rtl28xxu_init, | 1452 | .init = rtl28xxu_init, |
1453 | .get_rc_config = rtl2831u_get_rc_config, | 1453 | .get_rc_config = rtl2831u_get_rc_config, |
1454 | 1454 | ||
1455 | .num_adapters = 1, | 1455 | .num_adapters = 1, |
1456 | .adapter = { | 1456 | .adapter = { |
1457 | { | 1457 | { |
1458 | .stream = DVB_USB_STREAM_BULK(0x81, 6, 8 * 512), | 1458 | .stream = DVB_USB_STREAM_BULK(0x81, 6, 8 * 512), |
1459 | }, | 1459 | }, |
1460 | }, | 1460 | }, |
1461 | }; | 1461 | }; |
1462 | 1462 | ||
1463 | static const struct dvb_usb_device_properties rtl2832u_props = { | 1463 | static const struct dvb_usb_device_properties rtl2832u_props = { |
1464 | .driver_name = KBUILD_MODNAME, | 1464 | .driver_name = KBUILD_MODNAME, |
1465 | .owner = THIS_MODULE, | 1465 | .owner = THIS_MODULE, |
1466 | .adapter_nr = adapter_nr, | 1466 | .adapter_nr = adapter_nr, |
1467 | .size_of_priv = sizeof(struct rtl28xxu_priv), | 1467 | .size_of_priv = sizeof(struct rtl28xxu_priv), |
1468 | 1468 | ||
1469 | .power_ctrl = rtl2832u_power_ctrl, | 1469 | .power_ctrl = rtl2832u_power_ctrl, |
1470 | .i2c_algo = &rtl28xxu_i2c_algo, | 1470 | .i2c_algo = &rtl28xxu_i2c_algo, |
1471 | .read_config = rtl2832u_read_config, | 1471 | .read_config = rtl2832u_read_config, |
1472 | .frontend_attach = rtl2832u_frontend_attach, | 1472 | .frontend_attach = rtl2832u_frontend_attach, |
1473 | .tuner_attach = rtl2832u_tuner_attach, | 1473 | .tuner_attach = rtl2832u_tuner_attach, |
1474 | .init = rtl28xxu_init, | 1474 | .init = rtl28xxu_init, |
1475 | .exit = rtl28xxu_exit, | 1475 | .exit = rtl28xxu_exit, |
1476 | .get_rc_config = rtl2832u_get_rc_config, | 1476 | .get_rc_config = rtl2832u_get_rc_config, |
1477 | 1477 | ||
1478 | .num_adapters = 1, | 1478 | .num_adapters = 1, |
1479 | .adapter = { | 1479 | .adapter = { |
1480 | { | 1480 | { |
1481 | .stream = DVB_USB_STREAM_BULK(0x81, 6, 8 * 512), | 1481 | .stream = DVB_USB_STREAM_BULK(0x81, 6, 8 * 512), |
1482 | }, | 1482 | }, |
1483 | }, | 1483 | }, |
1484 | }; | 1484 | }; |
1485 | 1485 | ||
1486 | static const struct usb_device_id rtl28xxu_id_table[] = { | 1486 | static const struct usb_device_id rtl28xxu_id_table[] = { |
1487 | /* RTL2831U devices: */ | 1487 | /* RTL2831U devices: */ |
1488 | { DVB_USB_DEVICE(USB_VID_REALTEK, USB_PID_REALTEK_RTL2831U, | 1488 | { DVB_USB_DEVICE(USB_VID_REALTEK, USB_PID_REALTEK_RTL2831U, |
1489 | &rtl2831u_props, "Realtek RTL2831U reference design", NULL) }, | 1489 | &rtl2831u_props, "Realtek RTL2831U reference design", NULL) }, |
1490 | { DVB_USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_FREECOM_DVBT, | 1490 | { DVB_USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_FREECOM_DVBT, |
1491 | &rtl2831u_props, "Freecom USB2.0 DVB-T", NULL) }, | 1491 | &rtl2831u_props, "Freecom USB2.0 DVB-T", NULL) }, |
1492 | { DVB_USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_FREECOM_DVBT_2, | 1492 | { DVB_USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_FREECOM_DVBT_2, |
1493 | &rtl2831u_props, "Freecom USB2.0 DVB-T", NULL) }, | 1493 | &rtl2831u_props, "Freecom USB2.0 DVB-T", NULL) }, |
1494 | 1494 | ||
1495 | /* RTL2832U devices: */ | 1495 | /* RTL2832U devices: */ |
1496 | { DVB_USB_DEVICE(USB_VID_REALTEK, 0x2832, | 1496 | { DVB_USB_DEVICE(USB_VID_REALTEK, 0x2832, |
1497 | &rtl2832u_props, "Realtek RTL2832U reference design", NULL) }, | 1497 | &rtl2832u_props, "Realtek RTL2832U reference design", NULL) }, |
1498 | { DVB_USB_DEVICE(USB_VID_REALTEK, 0x2838, | 1498 | { DVB_USB_DEVICE(USB_VID_REALTEK, 0x2838, |
1499 | &rtl2832u_props, "Realtek RTL2832U reference design", NULL) }, | 1499 | &rtl2832u_props, "Realtek RTL2832U reference design", NULL) }, |
1500 | { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_STICK_BLACK_REV1, | 1500 | { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_STICK_BLACK_REV1, |
1501 | &rtl2832u_props, "TerraTec Cinergy T Stick Black", RC_MAP_TERRATEC_SLIM) }, | 1501 | &rtl2832u_props, "TerraTec Cinergy T Stick Black", RC_MAP_TERRATEC_SLIM) }, |
1502 | { DVB_USB_DEVICE(USB_VID_GTEK, USB_PID_DELOCK_USB2_DVBT, | 1502 | { DVB_USB_DEVICE(USB_VID_GTEK, USB_PID_DELOCK_USB2_DVBT, |
1503 | &rtl2832u_props, "G-Tek Electronics Group Lifeview LV5TDLX DVB-T", NULL) }, | 1503 | &rtl2832u_props, "G-Tek Electronics Group Lifeview LV5TDLX DVB-T", NULL) }, |
1504 | { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK, | 1504 | { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK, |
1505 | &rtl2832u_props, "TerraTec NOXON DAB Stick", NULL) }, | 1505 | &rtl2832u_props, "TerraTec NOXON DAB Stick", NULL) }, |
1506 | { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK_REV2, | 1506 | { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK_REV2, |
1507 | &rtl2832u_props, "TerraTec NOXON DAB Stick (rev 2)", NULL) }, | 1507 | &rtl2832u_props, "TerraTec NOXON DAB Stick (rev 2)", NULL) }, |
1508 | { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK_REV3, | 1508 | { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK_REV3, |
1509 | &rtl2832u_props, "TerraTec NOXON DAB Stick (rev 3)", NULL) }, | 1509 | &rtl2832u_props, "TerraTec NOXON DAB Stick (rev 3)", NULL) }, |
1510 | { DVB_USB_DEVICE(USB_VID_GTEK, USB_PID_TREKSTOR_TERRES_2_0, | 1510 | { DVB_USB_DEVICE(USB_VID_GTEK, USB_PID_TREKSTOR_TERRES_2_0, |
1511 | &rtl2832u_props, "Trekstor DVB-T Stick Terres 2.0", NULL) }, | 1511 | &rtl2832u_props, "Trekstor DVB-T Stick Terres 2.0", NULL) }, |
1512 | { DVB_USB_DEVICE(USB_VID_DEXATEK, 0x1101, | 1512 | { DVB_USB_DEVICE(USB_VID_DEXATEK, 0x1101, |
1513 | &rtl2832u_props, "Dexatek DK DVB-T Dongle", NULL) }, | 1513 | &rtl2832u_props, "Dexatek DK DVB-T Dongle", NULL) }, |
1514 | { DVB_USB_DEVICE(USB_VID_LEADTEK, 0x6680, | 1514 | { DVB_USB_DEVICE(USB_VID_LEADTEK, 0x6680, |
1515 | &rtl2832u_props, "DigitalNow Quad DVB-T Receiver", NULL) }, | 1515 | &rtl2832u_props, "DigitalNow Quad DVB-T Receiver", NULL) }, |
1516 | { DVB_USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_MINID, | 1516 | { DVB_USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_MINID, |
1517 | &rtl2832u_props, "Leadtek Winfast DTV Dongle Mini D", NULL) }, | 1517 | &rtl2832u_props, "Leadtek Winfast DTV Dongle Mini D", NULL) }, |
1518 | { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00d3, | 1518 | { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00d3, |
1519 | &rtl2832u_props, "TerraTec Cinergy T Stick RC (Rev. 3)", NULL) }, | 1519 | &rtl2832u_props, "TerraTec Cinergy T Stick RC (Rev. 3)", NULL) }, |
1520 | { DVB_USB_DEVICE(USB_VID_DEXATEK, 0x1102, | 1520 | { DVB_USB_DEVICE(USB_VID_DEXATEK, 0x1102, |
1521 | &rtl2832u_props, "Dexatek DK mini DVB-T Dongle", NULL) }, | 1521 | &rtl2832u_props, "Dexatek DK mini DVB-T Dongle", NULL) }, |
1522 | { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00d7, | 1522 | { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00d7, |
1523 | &rtl2832u_props, "TerraTec Cinergy T Stick+", NULL) }, | 1523 | &rtl2832u_props, "TerraTec Cinergy T Stick+", NULL) }, |
1524 | { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd3a8, | 1524 | { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd3a8, |
1525 | &rtl2832u_props, "ASUS My Cinema-U3100Mini Plus V2", NULL) }, | 1525 | &rtl2832u_props, "ASUS My Cinema-U3100Mini Plus V2", NULL) }, |
1526 | { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd393, | 1526 | { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd393, |
1527 | &rtl2832u_props, "GIGABYTE U7300", NULL) }, | 1527 | &rtl2832u_props, "GIGABYTE U7300", NULL) }, |
1528 | { DVB_USB_DEVICE(USB_VID_DEXATEK, 0x1104, | 1528 | { DVB_USB_DEVICE(USB_VID_DEXATEK, 0x1104, |
1529 | &rtl2832u_props, "MSI DIGIVOX Micro HD", NULL) }, | 1529 | &rtl2832u_props, "MSI DIGIVOX Micro HD", NULL) }, |
1530 | { DVB_USB_DEVICE(USB_VID_COMPRO, 0x0620, | 1530 | { DVB_USB_DEVICE(USB_VID_COMPRO, 0x0620, |
1531 | &rtl2832u_props, "Compro VideoMate U620F", NULL) }, | 1531 | &rtl2832u_props, "Compro VideoMate U620F", NULL) }, |
1532 | { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd394, | 1532 | { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd394, |
1533 | &rtl2832u_props, "MaxMedia HU394-T", NULL) }, | 1533 | &rtl2832u_props, "MaxMedia HU394-T", NULL) }, |
1534 | { DVB_USB_DEVICE(USB_VID_LEADTEK, 0x6a03, | 1534 | { DVB_USB_DEVICE(USB_VID_LEADTEK, 0x6a03, |
1535 | &rtl2832u_props, "Leadtek WinFast DTV Dongle mini", NULL) }, | 1535 | &rtl2832u_props, "Leadtek WinFast DTV Dongle mini", NULL) }, |
1536 | { DVB_USB_DEVICE(USB_VID_GTEK, USB_PID_CPYTO_REDI_PC50A, | 1536 | { DVB_USB_DEVICE(USB_VID_GTEK, USB_PID_CPYTO_REDI_PC50A, |
1537 | &rtl2832u_props, "Crypto ReDi PC 50 A", NULL) }, | 1537 | &rtl2832u_props, "Crypto ReDi PC 50 A", NULL) }, |
1538 | { DVB_USB_DEVICE(USB_VID_KYE, 0x707f, | 1538 | { DVB_USB_DEVICE(USB_VID_KYE, 0x707f, |
1539 | &rtl2832u_props, "Genius TVGo DVB-T03", NULL) }, | 1539 | &rtl2832u_props, "Genius TVGo DVB-T03", NULL) }, |
1540 | { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd395, | 1540 | { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd395, |
1541 | &rtl2832u_props, "Peak DVB-T USB", NULL) }, | 1541 | &rtl2832u_props, "Peak DVB-T USB", NULL) }, |
1542 | { DVB_USB_DEVICE(USB_VID_KWORLD_2, USB_PID_SVEON_STV20_RTL2832U, | 1542 | { DVB_USB_DEVICE(USB_VID_KWORLD_2, USB_PID_SVEON_STV20_RTL2832U, |
1543 | &rtl2832u_props, "Sveon STV20", NULL) }, | 1543 | &rtl2832u_props, "Sveon STV20", NULL) }, |
1544 | { DVB_USB_DEVICE(USB_VID_KWORLD_2, USB_PID_SVEON_STV27, | ||
1545 | &rtl2832u_props, "Sveon STV27", NULL) }, | ||
1544 | 1546 | ||
1545 | /* RTL2832P devices: */ | 1547 | /* RTL2832P devices: */ |
1546 | { DVB_USB_DEVICE(USB_VID_HANFTEK, 0x0131, | 1548 | { DVB_USB_DEVICE(USB_VID_HANFTEK, 0x0131, |
1547 | &rtl2832u_props, "Astrometa DVB-T2", NULL) }, | 1549 | &rtl2832u_props, "Astrometa DVB-T2", NULL) }, |
1548 | { } | 1550 | { } |
1549 | }; | 1551 | }; |
1550 | MODULE_DEVICE_TABLE(usb, rtl28xxu_id_table); | 1552 | MODULE_DEVICE_TABLE(usb, rtl28xxu_id_table); |
1551 | 1553 | ||
1552 | static struct usb_driver rtl28xxu_usb_driver = { | 1554 | static struct usb_driver rtl28xxu_usb_driver = { |
1553 | .name = KBUILD_MODNAME, | 1555 | .name = KBUILD_MODNAME, |
1554 | .id_table = rtl28xxu_id_table, | 1556 | .id_table = rtl28xxu_id_table, |
1555 | .probe = dvb_usbv2_probe, | 1557 | .probe = dvb_usbv2_probe, |
1556 | .disconnect = dvb_usbv2_disconnect, | 1558 | .disconnect = dvb_usbv2_disconnect, |
1557 | .suspend = dvb_usbv2_suspend, | 1559 | .suspend = dvb_usbv2_suspend, |
1558 | .resume = dvb_usbv2_resume, | 1560 | .resume = dvb_usbv2_resume, |
1559 | .reset_resume = dvb_usbv2_reset_resume, | 1561 | .reset_resume = dvb_usbv2_reset_resume, |
1560 | .no_dynamic_id = 1, | 1562 | .no_dynamic_id = 1, |
1561 | .soft_unbind = 1, | 1563 | .soft_unbind = 1, |
1562 | }; | 1564 | }; |
1563 | 1565 | ||
1564 | module_usb_driver(rtl28xxu_usb_driver); | 1566 | module_usb_driver(rtl28xxu_usb_driver); |
1565 | 1567 | ||
1566 | MODULE_DESCRIPTION("Realtek RTL28xxU DVB USB driver"); | 1568 | MODULE_DESCRIPTION("Realtek RTL28xxU DVB USB driver"); |
1567 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); | 1569 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); |
1568 | MODULE_AUTHOR("Thomas Mair <thomas.mair86@googlemail.com>"); | 1570 | MODULE_AUTHOR("Thomas Mair <thomas.mair86@googlemail.com>"); |
1569 | MODULE_LICENSE("GPL"); | 1571 | MODULE_LICENSE("GPL"); |
1570 | 1572 |