From 84a9d921f79d9aee2d650c4f18acea2111ad7e2d Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 25 Jun 2006 15:07:17 +0200 Subject: Fix VIDIOC_S_FREQUENCY: set correct tuner type. From: Hans Verkuil Signed-off-by: Hans Verkuil --- test/v4l2-ctl.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/v4l2-ctl.cpp b/test/v4l2-ctl.cpp index deb7f3fb9..a9604e650 100644 --- a/test/v4l2-ctl.cpp +++ b/test/v4l2-ctl.cpp @@ -36,7 +36,6 @@ #include #include -#define __user #include #include @@ -903,7 +902,7 @@ int main(int argc, char **argv) fac = (tuner.capability & V4L2_TUNER_CAP_LOW) ? 16000 : 16; } vf.tuner = 0; - vf.type = (enum v4l2_tuner_type)0; + vf.type = tuner.type; vf.frequency = __u32(freq * fac); if (doioctl(fd, VIDIOC_S_FREQUENCY, &vf, "VIDIOC_S_FREQUENCY") == 0) -- cgit v1.2.3 From a1cf4a48bee5bcd7550da4e256a449ff88ec38b6 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 25 Jun 2006 15:24:54 +0200 Subject: Print TV standards in human-readable form From: Hans Verkuil Signed-off-by: Hans Verkuil --- test/v4l2-ctl.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/test/v4l2-ctl.cpp b/test/v4l2-ctl.cpp index a9604e650..9604dcc96 100644 --- a/test/v4l2-ctl.cpp +++ b/test/v4l2-ctl.cpp @@ -640,6 +640,24 @@ static void parse_next_subopt(char **subs, char **value) } } +static void print_std(const char *prefix, const char *stds[], unsigned long long std) +{ + int first = 1; + + printf("\t%s-", prefix); + while (*stds) { + if (std & 1) { + if (!first) + printf("/"); + first = 0; + printf("%s", *stds); + } + stds++; + std >>= 1; + } + printf("\n"); +} + int main(int argc, char **argv) { char *value, *subs; @@ -1130,8 +1148,39 @@ int main(int argc, char **argv) } if (options[OptGetStandard]) { - if (doioctl(fd, VIDIOC_G_STD, &std, "VIDIOC_G_STD") == 0) + if (doioctl(fd, VIDIOC_G_STD, &std, "VIDIOC_G_STD") == 0) { + static const char *pal[] = { + "B", "B1", "G", "H", "I", "D", "D1", "K", + "M", "N", "Nc", "60", + NULL + }; + static const char *ntsc[] = { + "M", "M-JP", "443", "M-KR", + NULL + }; + static const char *secam[] = { + "B", "D", "G", "H", "K", "K1", "L", "Lc", + NULL + }; + static const char *atsc[] = { + "ATSC-8-VSB", "ATSC-16-VSB", + NULL + }; + printf("Video standard = 0x%08llx\n", (unsigned long long)std); + if (std & 0xfff) { + print_std("PAL", pal, std); + } + if (std & 0xf000) { + print_std("NTSC", ntsc, std >> 12); + } + if (std & 0xff0000) { + print_std("SECAM", secam, std >> 16); + } + if (std & 0xf000000) { + print_std("ATSC/HDTV", atsc, std >> 24); + } + } } if (options[OptListCtrlsMenus]) { -- cgit v1.2.3 From c6c53a44609a0a0026b09a783a7dcb6c16e397ba Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 25 Jun 2006 16:02:02 +0200 Subject: Remove duplicate 'tda9887' in info messages. From: Hans Verkuil Remove the duplicate '(tda9887)' in these messages: tda9887 8-0043 (tda9887): tda988[5/6/7] found @ 0x43 (tuner) The same string is already printed as the prefix in this line. Signed-off-by: Hans Verkuil --- linux/drivers/media/video/tda9887.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/drivers/media/video/tda9887.c b/linux/drivers/media/video/tda9887.c index ba9488594..c0f95a5d6 100644 --- a/linux/drivers/media/video/tda9887.c +++ b/linux/drivers/media/video/tda9887.c @@ -26,11 +26,11 @@ */ #define tda9887_info(fmt, arg...) do {\ - printk(KERN_INFO "%s %d-%04x (tda9887): " fmt, t->i2c.name, \ + printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.name, \ i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) #define tda9887_dbg(fmt, arg...) do {\ if (tuner_debug) \ - printk(KERN_INFO "%s %d-%04x (tda9887): " fmt, t->i2c.name, \ + printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.name, \ i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) -- cgit v1.2.3 From 88ffa13fe0812fd9e8154bd42e201442e6c50e03 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 25 Jun 2006 16:18:54 +0200 Subject: IVTV VBI format description too long. From: Hans Verkuil Format description was cut off. It's been shortened. Signed-off-by: Hans Verkuil --- linux/drivers/media/video/v4l2-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/drivers/media/video/v4l2-common.c b/linux/drivers/media/video/v4l2-common.c index 40fea5a05..96c778596 100644 --- a/linux/drivers/media/video/v4l2-common.c +++ b/linux/drivers/media/video/v4l2-common.c @@ -1134,7 +1134,7 @@ const char **v4l2_ctrl_get_menu(u32 id) }; static const char *mpeg_stream_vbi_fmt[] = { "No VBI", - "VBI in private packets, IVTV format", + "Private packet, IVTV format", NULL }; -- cgit v1.2.3 From 7c81635879ac74ea0d6e936a377795314671fff8 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 25 Jun 2006 20:33:12 +0200 Subject: Remove obsoleted tuner_debug option. From: Hans Verkuil Signed-off-by: Hans Verkuil --- linux/drivers/media/video/tuner-core.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c index 5718aef03..f63df8ce6 100644 --- a/linux/drivers/media/video/tuner-core.c +++ b/linux/drivers/media/video/tuner-core.c @@ -47,7 +47,6 @@ static unsigned int no_autodetect = 0; static unsigned int show_i2c = 0; /* insmod options used at runtime => read/write */ -static unsigned int tuner_debug_old = 0; int tuner_debug = 0; static unsigned int tv_range[2] = { 44, 958 }; @@ -66,15 +65,12 @@ MODULE_PARM(tv_range,"2i"); MODULE_PARM(radio_range,"2i"); MODULE_PARM(no_autodetect, "i"); MODULE_PARM(tuner_debug, "i"); -MODULE_PARM(tuner_debug_old, "i"); MODULE_PARM(addr, "i"); MODULE_PARM(show_i2c, "i"); #else module_param(addr, int, 0444); module_param(no_autodetect, int, 0444); module_param(show_i2c, int, 0444); -/* Note: tuner_debug is deprecated and will be removed in 2.6.17 */ -module_param_named(tuner_debug,tuner_debug_old, int, 0444); module_param_named(debug,tuner_debug, int, 0644); module_param_string(pal, pal, sizeof(pal), 0644); module_param_string(secam, secam, sizeof(secam), 0644); @@ -489,11 +485,6 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, t->audmode = V4L2_TUNER_MODE_STEREO; t->mode_mask = T_UNINITIALIZED; t->tuner_status = tuner_status; - if (tuner_debug_old) { - tuner_debug = tuner_debug_old; - printk(KERN_ERR "tuner: tuner_debug is deprecated and will be removed in 2.6.17.\n"); - printk(KERN_ERR "tuner: use the debug option instead.\n"); - } if (show_i2c) { unsigned char buffer[16]; -- cgit v1.2.3 From 494ddd8861370561652cc9371b774a5a5d3bed90 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 25 Jun 2006 20:37:29 +0200 Subject: tda9887 default TOP value is 0x10 From: Hans Verkuil For most tuners the default TOP value is 0x10, regardless of TV norm. So revert earlier change that sets the TOP value to 0x14 for PAL/SECAM. This is incorrect. Signed-off-by: Hans Verkuil --- linux/drivers/media/video/tda9887.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/linux/drivers/media/video/tda9887.c b/linux/drivers/media/video/tda9887.c index c0f95a5d6..efff424db 100644 --- a/linux/drivers/media/video/tda9887.c +++ b/linux/drivers/media/video/tda9887.c @@ -88,8 +88,7 @@ struct tvnorm { #define cAudioGain6 0x80 // bit c7 #define cTopMask 0x1f // bit c0:4 -#define cTopPalSecamDefault 0x14 // bit c0:4 -#define cTopNtscRadioDefault 0x10 // bit c0:4 +#define cTopDefault 0x10 // bit c0:4 //// third reg (e) #define cAudioIF_4_5 0x00 // bit e0:1 @@ -127,7 +126,7 @@ static struct tvnorm tvnorms[] = { cQSS ), .c = ( cDeemphasisON | cDeemphasis50 | - cTopPalSecamDefault), + cTopDefault), .e = ( cGating_36 | cAudioIF_5_5 | cVideoIF_38_90 ), @@ -138,7 +137,7 @@ static struct tvnorm tvnorms[] = { cQSS ), .c = ( cDeemphasisON | cDeemphasis50 | - cTopPalSecamDefault), + cTopDefault), .e = ( cGating_36 | cAudioIF_6_0 | cVideoIF_38_90 ), @@ -149,7 +148,7 @@ static struct tvnorm tvnorms[] = { cQSS ), .c = ( cDeemphasisON | cDeemphasis50 | - cTopPalSecamDefault), + cTopDefault), .e = ( cGating_36 | cAudioIF_6_5 | cVideoIF_38_90 ), @@ -160,7 +159,7 @@ static struct tvnorm tvnorms[] = { cQSS ), .c = ( cDeemphasisON | cDeemphasis75 | - cTopNtscRadioDefault), + cTopDefault), .e = ( cGating_36 | cAudioIF_4_5 | cVideoIF_45_75 ), @@ -169,7 +168,7 @@ static struct tvnorm tvnorms[] = { .name = "SECAM-BGH", .b = ( cPositiveAmTV | cQSS ), - .c = ( cTopPalSecamDefault), + .c = ( cTopDefault), .e = ( cGating_36 | cAudioIF_5_5 | cVideoIF_38_90 ), @@ -178,7 +177,7 @@ static struct tvnorm tvnorms[] = { .name = "SECAM-L", .b = ( cPositiveAmTV | cQSS ), - .c = ( cTopPalSecamDefault), + .c = ( cTopDefault), .e = ( cGating_36 | cAudioIF_6_5 | cVideoIF_38_90 ), @@ -188,7 +187,7 @@ static struct tvnorm tvnorms[] = { .b = ( cOutputPort2Inactive | cPositiveAmTV | cQSS ), - .c = ( cTopPalSecamDefault), + .c = ( cTopDefault), .e = ( cGating_36 | cAudioIF_6_5 | cVideoIF_33_90 ), @@ -199,7 +198,7 @@ static struct tvnorm tvnorms[] = { cQSS ), .c = ( cDeemphasisON | cDeemphasis50 | - cTopPalSecamDefault), + cTopDefault), .e = ( cGating_36 | cAudioIF_6_5 | cVideoIF_38_90 ), @@ -210,7 +209,7 @@ static struct tvnorm tvnorms[] = { cQSS ), .c = ( cDeemphasisON | cDeemphasis75 | - cTopNtscRadioDefault), + cTopDefault), .e = ( cGating_36 | cAudioIF_4_5 | cVideoIF_45_75 ), @@ -221,7 +220,7 @@ static struct tvnorm tvnorms[] = { cQSS ), .c = ( cDeemphasisON | cDeemphasis50 | - cTopNtscRadioDefault), + cTopDefault), .e = ( cGating_36 | cAudioIF_4_5 | cVideoIF_58_75 ), @@ -234,7 +233,7 @@ static struct tvnorm radio_stereo = { cQSS ), .c = ( cDeemphasisOFF | cAudioGain6 | - cTopNtscRadioDefault), + cTopDefault), .e = ( cTunerGainLow | cAudioIF_5_5 | cRadioIF_38_90 ), @@ -246,7 +245,7 @@ static struct tvnorm radio_mono = { cQSS ), .c = ( cDeemphasisON | cDeemphasis75 | - cTopNtscRadioDefault), + cTopDefault), .e = ( cTunerGainLow | cAudioIF_5_5 | cRadioIF_38_90 ), -- cgit v1.2.3 From 348845609182f6fa1772961bb84b60ee134ddf6b Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 26 Jun 2006 07:55:27 +0200 Subject: Clear v4l2_tuner struct, fixes VIDIOC_S_FREQUENCY. From: Hans Verkuil Struct v4l2_tuner was left uninitialized in v4l2-ctl, which caused VIDIOC_S_FREQUENCY to fail. Signed-off-by: Hans Verkuil --- test/v4l2-ctl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/v4l2-ctl.cpp b/test/v4l2-ctl.cpp index 9604dcc96..6e044e563 100644 --- a/test/v4l2-ctl.cpp +++ b/test/v4l2-ctl.cpp @@ -599,6 +599,7 @@ static int doioctl(int fd, int request, void *parm, const char *name) if (!option_verbose) return ioctl(fd, request, parm); retVal = ioctl(fd, request, parm); + printf("%s: ", name); if (retVal < 0) printf("failed: %s\n", strerror(errno)); else @@ -673,7 +674,7 @@ int main(int argc, char **argv) /* command args */ char ch, *device = strdup("/dev/video0"); /* -d device */ struct v4l2_format vfmt; /* set_format/get_format */ - struct v4l2_tuner tuner; /* set_tuner/get_tuner */ + struct v4l2_tuner tuner = { 0 };/* set_tuner/get_tuner */ struct v4l2_capability vcap; /* list_cap */ struct v4l2_input vin; /* list_inputs */ struct v4l2_output vout; /* list_outputs */ -- cgit v1.2.3 From 78b6dfe3d0f7e5d17ce931cf67307a174188a794 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 26 Jun 2006 14:31:18 +0200 Subject: Fix 64-bit compile warnings. From: Hans Verkuil Signed-off-by: Hans Verkuil --- linux/drivers/media/video/cx2341x.c | 2 +- linux/drivers/media/video/saa7134/saa6752hs.c | 4 ++-- linux/include/media/cx2341x.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux/drivers/media/video/cx2341x.c b/linux/drivers/media/video/cx2341x.c index ae37d0513..7bb1fb4ee 100644 --- a/linux/drivers/media/video/cx2341x.c +++ b/linux/drivers/media/video/cx2341x.c @@ -605,7 +605,7 @@ static void cx2341x_calc_audio_properties(struct cx2341x_mpeg_params *params) } int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, - struct v4l2_ext_controls *ctrls, int cmd) + struct v4l2_ext_controls *ctrls, unsigned int cmd) { int err = 0; int i; diff --git a/linux/drivers/media/video/saa7134/saa6752hs.c b/linux/drivers/media/video/saa7134/saa6752hs.c index 0422e10e6..f89e6d070 100644 --- a/linux/drivers/media/video/saa7134/saa6752hs.c +++ b/linux/drivers/media/video/saa7134/saa6752hs.c @@ -443,10 +443,10 @@ static void saa6752hs_old_set_params(struct i2c_client* client, } static int handle_ctrl(struct saa6752hs_mpeg_params *params, - struct v4l2_ext_control *ctrl, int cmd) + struct v4l2_ext_control *ctrl, unsigned int cmd) { int old = 0, new; - int set = cmd == VIDIOC_S_EXT_CTRLS; + int set = (cmd == VIDIOC_S_EXT_CTRLS); new = ctrl->value; switch (ctrl->id) { diff --git a/linux/include/media/cx2341x.h b/linux/include/media/cx2341x.h index 074c4008a..e1cbf7974 100644 --- a/linux/include/media/cx2341x.h +++ b/linux/include/media/cx2341x.h @@ -89,7 +89,7 @@ int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, struct v4l2_queryctrl *qctrl); const char **cx2341x_ctrl_get_menu(u32 id); int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, - struct v4l2_ext_controls *ctrls, int cmd); + struct v4l2_ext_controls *ctrls, unsigned int cmd); void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); void cx2341x_log_status(struct cx2341x_mpeg_params *p, int cardid); -- cgit v1.2.3