Skip to content

Commit 007ad83

Browse files
zyziiMauro Carvalho Chehab
authored andcommitted
V4L/DVB: tlg2300: remove the country code for analog tv and radio
video : use the V4L2_STD macros to select the proper audio setting. radio : add preemphasis ctr. test it by the command: v4l2-ctl -d /dev/radio0 --set-ctrl=pre_emphasis_settings=1 [mchehab@redhat.com: folded documentation patch] Signed-off-by: Huang Shijie <shijie8@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
1 parent 5b3f03f commit 007ad83

File tree

5 files changed

+135
-269
lines changed

5 files changed

+135
-269
lines changed

Documentation/video4linux/README.tlg2300

Lines changed: 7 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -37,195 +37,11 @@ TESTED APPLICATIONS:
3737

3838
---------------------------------------------------------------------------
3939
KNOWN PROBLEMS:
40+
about preemphasis:
41+
You can set the preemphasis for radio by the following command:
42+
#v4l2-ctl -d /dev/radio0 --set-ctrl=pre_emphasis_settings=1
43+
44+
"pre_emphasis_settings=1" means that you select the 50us. If you want
45+
to select the 75us, please use "pre_emphasis_settings=2"
46+
4047

41-
country code
42-
- The firmware of the chip needs the country code to determine
43-
the stardards of video and audio when it runs for analog TV or radio.
44-
The DVB-T does not need the country code.
45-
46-
So you must set the country-code correctly. The V4L2 does not have
47-
the interface,the driver has to provide a parameter `country_code'.
48-
49-
You could set the coutry code in two ways, take USA as example
50-
(The USA's country code is 1):
51-
52-
[1] add the following line in /etc/modprobe.conf before you insert the
53-
card into USB hub's port :
54-
poseidon country_code=1
55-
56-
[2] You can also modify the parameter at runtime (before you run the
57-
application such as VLC)
58-
#echo 1 > /sys/module/poseidon/parameter/country_code
59-
60-
The known country codes show below:
61-
country code : country
62-
93 "Afghanistan"
63-
355 "Albania"
64-
213 "Algeria"
65-
684 "American Samoa"
66-
376 "Andorra"
67-
244 "Angola"
68-
54 "Argentina"
69-
374 "Armenia"
70-
61 "Australia"
71-
43 "Austria"
72-
994 "Azerbaijan"
73-
973 "Bahrain"
74-
880 "Bangladesh"
75-
375 "Belarus"
76-
32 "Belgium"
77-
501 "Belize"
78-
229 "Benin"
79-
591 "Bolivia"
80-
387 "Bosnia and Herzegovina"
81-
267 "Botswana"
82-
55 "Brazil"
83-
673 "Brunei Darussalam"
84-
359 "Bulgalia"
85-
226 "Burkina Faso"
86-
257 "Burundi"
87-
237 "Cameroon"
88-
1 "Canada"
89-
236 "Central African Republic"
90-
235 "Chad"
91-
56 "Chile"
92-
86 "China"
93-
57 "Colombia"
94-
242 "Congo"
95-
243 "Congo, Dem. Rep. of "
96-
506 "Costa Rica"
97-
385 "Croatia"
98-
53 "Cuba or Guantanamo Bay"
99-
357 "Cyprus"
100-
420 "Czech Republic"
101-
45 "Denmark"
102-
246 "Diego Garcia"
103-
253 "Djibouti"
104-
593 "Ecuador"
105-
20 "Egypt"
106-
503 "El Salvador"
107-
240 "Equatorial Guinea"
108-
372 "Estonia"
109-
251 "Ethiopia"
110-
358 "Finland"
111-
33 "France"
112-
594 "French Guiana"
113-
689 "French Polynesia"
114-
241 "Gabonese Republic"
115-
220 "Gambia"
116-
995 "Georgia"
117-
49 "Germany"
118-
233 "Ghana"
119-
350 "Gibraltar"
120-
30 "Greece"
121-
299 "Greenland"
122-
671 "Guam"
123-
502 "Guatemala"
124-
592 "Guyana"
125-
509 "Haiti"
126-
504 "Honduras"
127-
852 "Hong Kong SAR, China"
128-
36 "Hungary"
129-
354 "Iceland"
130-
91 "India"
131-
98 "Iran"
132-
964 "Iraq"
133-
353 "Ireland"
134-
972 "Israel"
135-
39 "Italy or Vatican City"
136-
225 "Ivory Coast"
137-
81 "Japan"
138-
962 "Jordan"
139-
7 "Kazakhstan or Kyrgyzstan"
140-
254 "Kenya"
141-
686 "Kiribati"
142-
965 "Kuwait"
143-
856 "Laos"
144-
371 "Latvia"
145-
961 "Lebanon"
146-
266 "Lesotho"
147-
231 "Liberia"
148-
218 "Libya"
149-
41 "Liechtenstein or Switzerland"
150-
370 "Lithuania"
151-
352 "Luxembourg"
152-
853 "Macau SAR, China"
153-
261 "Madagascar"
154-
60 "Malaysia"
155-
960 "Maldives"
156-
223 "Mali Republic"
157-
356 "Malta"
158-
692 "Marshall Islands"
159-
596 "Martinique"
160-
222 "Mauritania"
161-
230 "Mauritus"
162-
52 "Mexico"
163-
691 "Micronesia"
164-
373 "Moldova"
165-
377 "Monaco"
166-
976 "Mongolia"
167-
212 "Morocco"
168-
258 "Mozambique"
169-
95 "Myanmar"
170-
264 "Namibia"
171-
674 "Nauru"
172-
31 "Netherlands"
173-
687 "New Caledonia"
174-
64 "New Zealand"
175-
505 "Nicaragua"
176-
227 "Niger"
177-
234 "Nigeria"
178-
850 "North Korea"
179-
47 "Norway"
180-
968 "Oman"
181-
92 "Pakistan"
182-
680 "Palau"
183-
507 "Panama"
184-
675 "Papua New Guinea"
185-
595 "Paraguay"
186-
51 "Peru"
187-
63 "Philippines"
188-
48 "Poland"
189-
351 "Portugal"
190-
974 "Qatar"
191-
262 "Reunion Island"
192-
40 "Romania"
193-
7 "Russia"
194-
378 "San Marino"
195-
239 "Sao Tome and Principe"
196-
966 "Saudi Arabia"
197-
221 "Senegal"
198-
248 "Seychelles Republic"
199-
232 "Sierra Leone"
200-
65 "Singapore"
201-
421 "Slovak Republic"
202-
386 "Slovenia"
203-
27 "South Africa"
204-
82 "South Korea "
205-
34 "Spain"
206-
94 "Sri Lanka"
207-
508 "St. Pierre and Miquelon"
208-
249 "Sudan"
209-
597 "Suriname"
210-
268 "Swaziland"
211-
46 "Sweden"
212-
963 "Syria"
213-
886 "Taiwan Region"
214-
255 "Tanzania"
215-
66 "Thailand"
216-
228 "Togolese Republic"
217-
216 "Tunisia"
218-
90 "Turkey"
219-
993 "Turkmenistan"
220-
256 "Uganda"
221-
380 "Ukraine"
222-
971 "United Arab Emirates"
223-
44 "United Kingdom"
224-
1 "United States of America"
225-
598 "Uruguay"
226-
58 "Venezuela"
227-
84 "Vietnam"
228-
967 "Yemen"
229-
260 "Zambia"
230-
255 "Zanzibar"
231-
263 "Zimbabwe"

drivers/media/video/tlg2300/pd-common.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ struct radio_data {
118118
__u32 fm_freq;
119119
int users;
120120
unsigned int is_radio_streaming;
121+
int pre_emphasis;
121122
struct video_device *fm_dev;
122123
};
123124

@@ -185,7 +186,6 @@ struct poseidon {
185186
struct pd_dvb_adapter dvb_data; /* DVB */
186187

187188
u32 state;
188-
int country_code;
189189
struct file *file_for_stream; /* the active stream*/
190190

191191
#ifdef CONFIG_PM
@@ -240,7 +240,6 @@ struct video_device *vdev_init(struct poseidon *, struct video_device *);
240240
int send_set_req(struct poseidon*, u8, s32, s32*);
241241
int send_get_req(struct poseidon*, u8, s32, void*, s32*, s32);
242242
s32 set_tuner_mode(struct poseidon*, unsigned char);
243-
enum tlg__analog_audio_standard get_audio_std(s32, s32);
244243

245244
/* bulk urb alloc/free */
246245
int alloc_bulk_urbs_generic(struct urb **urb_array, int num,
@@ -252,7 +251,6 @@ void free_all_urb_generic(struct urb **urb_array, int num);
252251
/* misc */
253252
void poseidon_delete(struct kref *kref);
254253
void destroy_video_device(struct video_device **v_dev);
255-
extern int country_code;
256254
extern int debug_mode;
257255
void set_debug_mode(struct video_device *vfd, int debug_mode);
258256

drivers/media/video/tlg2300/pd-main.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -189,41 +189,6 @@ int set_tuner_mode(struct poseidon *pd, unsigned char mode)
189189
return 0;
190190
}
191191

192-
enum tlg__analog_audio_standard get_audio_std(s32 mode, s32 country_code)
193-
{
194-
s32 nicam[] = {27, 32, 33, 34, 36, 44, 45, 46, 47, 48, 64,
195-
65, 86, 351, 352, 353, 354, 358, 372, 852, 972};
196-
s32 btsc[] = {1, 52, 54, 55, 886};
197-
s32 eiaj[] = {81};
198-
s32 i;
199-
200-
if (mode == TLG_MODE_FM_RADIO) {
201-
if (country_code == 1)
202-
return TLG_TUNE_ASTD_FM_US;
203-
else
204-
return TLG_TUNE_ASTD_FM_EUR;
205-
} else if (mode == TLG_MODE_ANALOG_TV_UNCOMP) {
206-
for (i = 0; i < sizeof(nicam) / sizeof(s32); i++) {
207-
if (country_code == nicam[i])
208-
return TLG_TUNE_ASTD_NICAM;
209-
}
210-
211-
for (i = 0; i < sizeof(btsc) / sizeof(s32); i++) {
212-
if (country_code == btsc[i])
213-
return TLG_TUNE_ASTD_BTSC;
214-
}
215-
216-
for (i = 0; i < sizeof(eiaj) / sizeof(s32); i++) {
217-
if (country_code == eiaj[i])
218-
return TLG_TUNE_ASTD_EIAJ;
219-
}
220-
221-
return TLG_TUNE_ASTD_A2;
222-
} else {
223-
return TLG_TUNE_ASTD_NONE;
224-
}
225-
}
226-
227192
void poseidon_delete(struct kref *kref)
228193
{
229194
struct poseidon *pd = container_of(kref, struct poseidon, kref);
@@ -462,7 +427,6 @@ static int poseidon_probe(struct usb_interface *interface,
462427
struct device *dev = &interface->dev;
463428

464429
logpm(pd);
465-
pd->country_code = 86;
466430
mutex_init(&pd->lock);
467431

468432
/* register v4l2 device */

0 commit comments

Comments
 (0)