Skip to contentSkip to conversation

remove the country code for analog tv and radio

PATCH New Huang Shijie 1 participant 2 messages Feb 11, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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

---
 drivers/media/video/tlg2300/pd-common.h |    4 +-
 drivers/media/video/tlg2300/pd-main.c   |   36 ----------
 drivers/media/video/tlg2300/pd-radio.c  |  107 +++++++++++++++++++++++++------
 drivers/media/video/tlg2300/pd-video.c  |   59 +++++++++++------
 4 files changed, 128 insertions(+), 78 deletions(-)
drivers/media/video/tlg2300/pd-common.h +1 -3
index 619fd00..ae9cb6c 100644
@@ -118,6 +118,7 @@ struct radio_data {
 	__u32		fm_freq;
 	int		users;
 	unsigned int	is_radio_streaming;
+	int		pre_emphasis;
 	struct video_device *fm_dev;
 };
 
@@ -185,7 +186,6 @@ struct poseidon {
 	struct pd_dvb_adapter	dvb_data;	/* DVB	 */
 
 	u32			state;
-	int			country_code;
 	struct file		*file_for_stream; /* the active stream*/
 
 #ifdef CONFIG_PM
@@ -240,7 +240,6 @@ struct video_device *vdev_init(struct poseidon *, struct video_device *);
 int send_set_req(struct poseidon*, u8, s32, s32*);
 int send_get_req(struct poseidon*, u8, s32, void*, s32*, s32);
 s32 set_tuner_mode(struct poseidon*, unsigned char);
-enum tlg__analog_audio_standard get_audio_std(s32, s32);
 
 /* bulk urb alloc/free */
 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);
 /* misc */
 void poseidon_delete(struct kref *kref);
 void destroy_video_device(struct video_device **v_dev);
-extern int country_code;
 extern int debug_mode;
 void set_debug_mode(struct video_device *vfd, int debug_mode);
 
drivers/media/video/tlg2300/pd-main.c +0 -36
index 6df9380..fdcc500 100644
@@ -189,41 +189,6 @@ int set_tuner_mode(struct poseidon *pd, unsigned char mode)
 	return 0;
 }
 
-enum tlg__analog_audio_standard get_audio_std(s32 mode, s32 country_code)
-{
-	s32 nicam[] = {27, 32, 33, 34, 36, 44, 45, 46, 47, 48, 64,
-			65, 86, 351, 352, 353, 354, 358, 372, 852, 972};
-	s32 btsc[] = {1, 52, 54, 55, 886};
-	s32 eiaj[] = {81};
-	s32 i;
-
-	if (mode == TLG_MODE_FM_RADIO) {
-		if (country_code == 1)
-			return TLG_TUNE_ASTD_FM_US;
-		else
-			return TLG_TUNE_ASTD_FM_EUR;
-	} else if (mode == TLG_MODE_ANALOG_TV_UNCOMP) {
-		for (i = 0; i < sizeof(nicam) / sizeof(s32); i++) {
-			if (country_code == nicam[i])
-				return TLG_TUNE_ASTD_NICAM;
-		}
-
-		for (i = 0; i < sizeof(btsc) / sizeof(s32); i++) {
-			if (country_code == btsc[i])
-				return TLG_TUNE_ASTD_BTSC;
-		}
-
-		for (i = 0; i < sizeof(eiaj) / sizeof(s32); i++) {
-			if (country_code == eiaj[i])
-				return TLG_TUNE_ASTD_EIAJ;
-		}
-
-		return TLG_TUNE_ASTD_A2;
-	} else {
-		return TLG_TUNE_ASTD_NONE;
-	}
-}
-
 void poseidon_delete(struct kref *kref)
 {
 	struct poseidon *pd = container_of(kref, struct poseidon, kref);
@@ -462,7 +427,6 @@ static int poseidon_probe(struct usb_interface *interface,
 		struct device *dev = &interface->dev;
 
 		logpm(pd);
-		pd->country_code = 86;
 		mutex_init(&pd->lock);
 
 		/* register v4l2 device */
drivers/media/video/tlg2300/pd-radio.c +88 -19

161 lines not on this page · raw message

drivers/media/video/tlg2300/pd-video.c +39 -20

107 lines not on this page · raw message

Signature · 1 line
1.6.5.2
#1 lore raw

PATCH 2/2 modify the document

remove the the country code section.

---
 Documentation/video4linux/README.tlg2300 |  198 +----------------------------
 1 files changed, 7 insertions(+), 191 deletions(-)
Documentation/video4linux/README.tlg2300 +7 -191
index 82417db..416ccb9 100644
@@ -37,195 +37,11 @@ TESTED APPLICATIONS:
 
 ---------------------------------------------------------------------------
 KNOWN PROBLEMS:
+about preemphasis:
+	You can set the preemphasis for radio by the following command:
+	#v4l2-ctl -d /dev/radio0 --set-ctrl=pre_emphasis_settings=1
+
+	"pre_emphasis_settings=1" means that you select the 50us. If you want
+	to select the 75us, please use "pre_emphasis_settings=2"
+
 
-country code
-	- The firmware of the chip needs the country code to determine
-	the stardards of video and audio when it runs for analog TV or radio.
-	The DVB-T does not need the country code.
-
-	So you must set the country-code correctly. The V4L2 does not have
-	the interface,the driver has to provide a parameter `country_code'.
-
-	You could set the coutry code in two ways, take USA as example
-	(The USA's country code is 1):
-
-	[1] add the following line in /etc/modprobe.conf before you insert the
-	    card into USB hub's port :
-		poseidon country_code=1
-
-	[2] You can also modify the parameter at runtime (before you run the
-	    application such as VLC)
-		#echo 1 > /sys/module/poseidon/parameter/country_code
-
-	The known country codes show below:
-	country code :  country
-	93 		"Afghanistan"
-	355	 	"Albania"
-	213	 	"Algeria"
-	684	 	"American Samoa"
-	376	 	"Andorra"
-	244	 	"Angola"
-	54 		"Argentina"
-	374	 	"Armenia"
-	61 		"Australia"
-	43 		"Austria"
-	994	 	"Azerbaijan"
-	973	 	"Bahrain"
-	880	 	"Bangladesh"
-	375	 	"Belarus"
-	32 		"Belgium"
-	501	 	"Belize"
-	229	 	"Benin"
-	591	 	"Bolivia"
-	387	 	"Bosnia and Herzegovina"
-	267	 	"Botswana"
-	55 		"Brazil"
-	673	 	"Brunei Darussalam"
-	359	 	"Bulgalia"
-	226	 	"Burkina Faso"
-	257	 	"Burundi"
-	237	 	"Cameroon"
-	1		"Canada"
-	236	 	"Central African Republic"
-	235	 	"Chad"
-	56 		"Chile"
-	86 		"China"
-	57 		"Colombia"
-	242	 	"Congo"
-	243	 	"Congo, Dem. Rep. of "
-	506	 	"Costa Rica"
-	385	 	"Croatia"
-	53 		"Cuba or Guantanamo Bay"
-	357	 	"Cyprus"
-	420	 	"Czech Republic"
-	45 		"Denmark"
-	246	 	"Diego Garcia"
-	253	 	"Djibouti"
-	593	 	"Ecuador"
-	20 		"Egypt"
-	503	 	"El Salvador"
-	240	 	"Equatorial Guinea"
-	372	 	"Estonia"
-	251	 	"Ethiopia"
-	358	 	"Finland"
-	33 		"France"
-	594	 	"French Guiana"
-	689	 	"French Polynesia"
-	241	 	"Gabonese Republic"
-	220	 	"Gambia"
-	995	 	"Georgia"
-	49 		"Germany"
-	233	 	"Ghana"
-	350	 	"Gibraltar"
-	30 		"Greece"
-	299	 	"Greenland"
-	671	 	"Guam"
-	502		"Guatemala"
-	592	 	"Guyana"
-	509	 	"Haiti"
-	504	 	"Honduras"
-	852	 	"Hong Kong SAR, China"
-	36 		"Hungary"
-	354	 	"Iceland"
-	91 		"India"
-	98 		"Iran"
-	964	 	"Iraq"
-	353	 	"Ireland"
-	972	 	"Israel"
-	39 		"Italy or Vatican City"
-	225	 	"Ivory Coast"
-	81 		"Japan"
-	962	 	"Jordan"
-	7		"Kazakhstan or Kyrgyzstan"
-	254	 	"Kenya"
-	686	 	"Kiribati"
-	965	 	"Kuwait"
-	856	 	"Laos"
-	371	 	"Latvia"
-	961	 	"Lebanon"
-	266	 	"Lesotho"
-	231	 	"Liberia"
-	218	 	"Libya"
-	41 		"Liechtenstein or Switzerland"
-	370	 	"Lithuania"
-	352	 	"Luxembourg"
-	853	 	"Macau SAR, China"
-	261	 	"Madagascar"
-	60 		"Malaysia"
-	960	 	"Maldives"
-	223	 	"Mali Republic"
-	356	 	"Malta"
-	692	 	"Marshall Islands"
-	596	 	"Martinique"
-	222	 	"Mauritania"
-	230	 	"Mauritus"
-	52 		"Mexico"
-	691	 	"Micronesia"
-	373	 	"Moldova"
-	377	 	"Monaco"
-	976	 	"Mongolia"
-	212	 	"Morocco"
-	258	 	"Mozambique"
-	95 		"Myanmar"
-	264	 	"Namibia"
-	674	 	"Nauru"
-	31 		"Netherlands"
-	687	 	"New Caledonia"
-	64 		"New Zealand"
-	505	 	"Nicaragua"
-	227	 	"Niger"
-	234	 	"Nigeria"
-	850	 	"North Korea"
-	47 		"Norway"
-	968	 	"Oman"
-	92 		"Pakistan"
-	680	 	"Palau"
-	507	 	"Panama"
-	675	 	"Papua New Guinea"
-	595	 	"Paraguay"
-	51 		"Peru"
-	63 		"Philippines"
-	48 		"Poland"
-	351	 	"Portugal"
-	974	 	"Qatar"
-	262	 	"Reunion Island"
-	40 		"Romania"
-	7		"Russia"
-	378	 	"San Marino"
-	239	 	"Sao Tome and Principe"
-	966	 	"Saudi Arabia"
-	221	 	"Senegal"
-	248	 	"Seychelles Republic"
-	232	 	"Sierra Leone"
-	65 		"Singapore"
-	421	 	"Slovak Republic"
-	386	 	"Slovenia"
-	27 		"South Africa"
-	82 		"South Korea "
-	34 		"Spain"
-	94 		"Sri Lanka"
-	508	 	"St. Pierre and Miquelon"
-	249	 	"Sudan"
-	597	 	"Suriname"
-	268	 	"Swaziland"
-	46 		"Sweden"
-	963	 	"Syria"
-	886	 	"Taiwan Region"
-	255	 	"Tanzania"
-	66 		"Thailand"
-	228	 	"Togolese Republic"
-	216	 	"Tunisia"
-	90 		"Turkey"
-	993	 	"Turkmenistan"
-	256	 	"Uganda"
-	380	 	"Ukraine"
-	971	 	"United Arab Emirates"
-	44 		"United Kingdom"
-	1		"United States of America"
-	598	 	"Uruguay"
-	58 		"Venezuela"
-	84 		"Vietnam"
-	967	 	"Yemen"
-	260	 	"Zambia"
-	255	 	"Zanzibar"
-	263	 	"Zimbabwe"
Signature · 1 line
1.6.5.2