From 2209c0b22bafab863c618952d3d9a076eaff5786 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 26 Aug 2009 22:32:44 +0200 Subject: v4l2-ctl: add support for enumerating frame sizes and intervals From: Hans Verkuil Priority: normal Signed-off-by: Hans Verkuil --- v4l2-apps/util/v4l2-ctl.cpp | 209 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 202 insertions(+), 7 deletions(-) diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp index 955b95be0..5b38e37b3 100644 --- a/v4l2-apps/util/v4l2-ctl.cpp +++ b/v4l2-apps/util/v4l2-ctl.cpp @@ -105,6 +105,9 @@ enum Option { OptStreamOn, OptListStandards, OptListFormats, + OptListFormatsExt, + OptListFrameSizes, + OptListFrameIntervals, OptLogStatus, OptVerbose, OptSilent, @@ -221,6 +224,9 @@ static struct option long_options[] = { {"streamon", no_argument, 0, OptStreamOn}, {"list-standards", no_argument, 0, OptListStandards}, {"list-formats", no_argument, 0, OptListFormats}, + {"list-formats-ext", no_argument, 0, OptListFormatsExt}, + {"list-framesizes", required_argument, 0, OptListFrameSizes}, + {"list-frameintervals", required_argument, 0, OptListFrameIntervals}, {"get-standard", no_argument, 0, OptGetStandard}, {"set-standard", required_argument, 0, OptSetStandard}, {"get-parm", no_argument, 0, OptGetParm}, @@ -319,6 +325,18 @@ static void usage(void) " set the audio mode of the tuner [VIDIOC_S_TUNER]\n" " Possible values: mono, stereo, lang2, lang1, bilingual\n" " --list-formats display supported video formats [VIDIOC_ENUM_FMT]\n" + " --list-formats-ext display supported video formats including frame sizes\n" + " and intervals\n" + " --list-framesizes=\n" + " list supported framesizes for pixelformat \n" + " [VIDIOC_ENUM_FRAMESIZES]\n" + " pixelformat is either the format index as reported by\n" + " --list-formats, or the fourcc value as a string\n" + " --list-frameintervals=width=,height=,pixelformat=\n" + " list supported frame intervals for pixelformat and\n" + " the given width and height [VIDIOC_ENUM_FRAMEINTERVALS]\n" + " pixelformat is either the format index as reported by\n" + " --list-formats, or the fourcc value as a string\n" " -V, --get-fmt-video\n" " query the video capture format [VIDIOC_G_FMT]\n" " -v, --set-fmt-video=width=,height=,pixelformat=\n" @@ -951,6 +969,72 @@ static void printfmt(const struct v4l2_format &vfmt) } } +static std::string frmtype2s(unsigned type) +{ + static const char *types[] = { + "Unknown", + "Discrete", + "Continuous", + "Stepwise" + }; + + if (type > 3) + type = 0; + return types[type]; +} + +static std::string fract2sec(const struct v4l2_fract &f) +{ + char buf[100]; + + sprintf(buf, "%.3f s", (1.0 * f.numerator) / f.denominator); + return buf; +} + +static std::string fract2fps(const struct v4l2_fract &f) +{ + char buf[100]; + + sprintf(buf, "%.3f fps", (1.0 * f.denominator) / f.numerator); + return buf; +} + +static void print_frmsize(const struct v4l2_frmsizeenum &frmsize, const char *prefix) +{ + printf("%s\tSize: %s ", prefix, frmtype2s(frmsize.type).c_str()); + if (frmsize.type == V4L2_FRMSIZE_TYPE_DISCRETE) { + printf("%dx%d", frmsize.discrete.width, frmsize.discrete.height); + } else if (frmsize.type == V4L2_FRMSIZE_TYPE_STEPWISE) { + printf("%dx%d - %dx%d with step %d/%d", + frmsize.stepwise.min_width, + frmsize.stepwise.min_height, + frmsize.stepwise.max_width, + frmsize.stepwise.max_height, + frmsize.stepwise.step_width, + frmsize.stepwise.step_height); + } + printf("\n"); +} + +static void print_frmival(const struct v4l2_frmivalenum &frmival, const char *prefix) +{ + printf("%s\tInterval: %s ", prefix, frmtype2s(frmival.type).c_str()); + if (frmival.type == V4L2_FRMIVAL_TYPE_DISCRETE) { + printf("%s (%s)\n", fract2sec(frmival.discrete).c_str(), + fract2fps(frmival.discrete).c_str()); + } else if (frmival.type == V4L2_FRMIVAL_TYPE_STEPWISE) { + printf("%s - %s with step %s\n", + fract2sec(frmival.stepwise.min).c_str(), + fract2sec(frmival.stepwise.max).c_str(), + fract2sec(frmival.stepwise.step).c_str()); + printf("%s\t : ", prefix); + printf("(%s - %s with step %s)\n", + fract2fps(frmival.stepwise.min).c_str(), + fract2fps(frmival.stepwise.max).c_str(), + fract2fps(frmival.stepwise.step).c_str()); + } +} + static void print_video_formats(int fd, enum v4l2_buf_type type) { struct v4l2_fmtdesc fmt; @@ -970,6 +1054,43 @@ static void print_video_formats(int fd, enum v4l2_buf_type type) } } +static void print_video_formats_ext(int fd, enum v4l2_buf_type type) +{ + struct v4l2_fmtdesc fmt; + struct v4l2_frmsizeenum frmsize; + struct v4l2_frmivalenum frmival; + + fmt.index = 0; + fmt.type = type; + while (ioctl(fd, VIDIOC_ENUM_FMT, &fmt) >= 0) { + printf("\tIndex : %d\n", fmt.index); + printf("\tType : %s\n", buftype2s(type).c_str()); + printf("\tPixel Format: '%s'", fcc2s(fmt.pixelformat).c_str()); + if (fmt.flags) + printf(" (compressed)"); + printf("\n"); + printf("\tName : %s\n", fmt.description); + frmsize.pixel_format = fmt.pixelformat; + frmsize.index = 0; + while (ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &frmsize) >= 0) { + print_frmsize(frmsize, "\t"); + if (frmsize.type == V4L2_FRMSIZE_TYPE_DISCRETE) { + frmival.index = 0; + frmival.pixel_format = fmt.pixelformat; + frmival.width = frmsize.discrete.width; + frmival.height = frmsize.discrete.height; + while (ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &frmival) >= 0) { + print_frmival(frmival, "\t\t"); + frmival.index++; + } + } + frmsize.index++; + } + printf("\n"); + fmt.index++; + } +} + static char *pts_to_string(char *str, unsigned long pts) { static char buf[256]; @@ -1441,6 +1562,17 @@ static enum v4l2_field parse_field(const char *s) return V4L2_FIELD_ANY; } +static __u32 find_pixel_format(int fd, unsigned index) +{ + struct v4l2_fmtdesc fmt; + + fmt.index = index; + fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + if (doioctl(fd, VIDIOC_ENUM_FMT, &fmt, "VIDIOC_ENUM_FMT")) + return 0; + return fmt.pixelformat; +} + int main(int argc, char **argv) { char *value, *subs; @@ -1479,6 +1611,8 @@ int main(int argc, char **argv) struct v4l2_output vout; /* list_outputs */ struct v4l2_audio vaudio; /* list audio inputs */ struct v4l2_audioout vaudout; /* audio outputs */ + struct v4l2_frmsizeenum frmsize;/* list frame sizes */ + struct v4l2_frmivalenum frmival;/* list frame intervals */ struct v4l2_rect vcrop; /* crop rect */ struct v4l2_rect vcrop_out; /* crop rect */ struct v4l2_rect vcrop_overlay; /* crop rect */ @@ -1517,6 +1651,8 @@ int main(int argc, char **argv) memset(&vout, 0, sizeof(vout)); memset(&vaudio, 0, sizeof(vaudio)); memset(&vaudout, 0, sizeof(vaudout)); + memset(&frmsize, 0, sizeof(frmsize)); + memset(&frmival, 0, sizeof(frmival)); memset(&vcrop, 0, sizeof(vcrop)); memset(&vcrop_out, 0, sizeof(vcrop_out)); memset(&vcrop_overlay, 0, sizeof(vcrop_overlay)); @@ -1710,6 +1846,41 @@ int main(int argc, char **argv) case OptOverlay: overlay = strtol(optarg, 0L, 0); break; + case OptListFrameSizes: + if (strlen(optarg) == 4) + frmsize.pixel_format = v4l2_fourcc(optarg[0], optarg[1], + optarg[2], optarg[3]); + else + frmsize.pixel_format = strtol(optarg, 0L, 0); + break; + case OptListFrameIntervals: + subs = optarg; + while (*subs != '\0') { + static const char *const subopts[] = { + "width", + "height", + "pixelformat", + NULL + }; + + switch (parse_subopt(&subs, subopts, &value)) { + case 0: + frmival.width = strtol(value, 0L, 0); + break; + case 1: + frmival.height = strtol(value, 0L, 0); + break; + case 2: + if (strlen(value) == 4) + frmival.pixel_format = + v4l2_fourcc(value[0], value[1], + value[2], value[3]); + else + frmival.pixel_format = strtol(value, 0L, 0); + break; + } + } + break; case OptSetCrop: parse_crop(optarg, set_crop, vcrop); break; @@ -2158,13 +2329,8 @@ int main(int argc, char **argv) if (set_fmts & FmtPixelFormat) { in_vfmt.fmt.pix.pixelformat = vfmt.fmt.pix.pixelformat; if (in_vfmt.fmt.pix.pixelformat < 256) { - struct v4l2_fmtdesc fmt; - - fmt.index = in_vfmt.fmt.pix.pixelformat; - fmt.type = in_vfmt.type; - if (doioctl(fd, VIDIOC_ENUM_FMT, &fmt, "VIDIOC_ENUM_FMT")) - goto set_vid_fmt_error; - in_vfmt.fmt.pix.pixelformat = fmt.pixelformat; + in_vfmt.fmt.pix.pixelformat = + find_pixel_format(fd, in_vfmt.fmt.pix.pixelformat); } } if (options[OptSetVideoFormat]) @@ -2842,6 +3008,35 @@ set_vid_fmt_error: print_video_formats(fd, V4L2_BUF_TYPE_VIDEO_OVERLAY); } + if (options[OptListFormatsExt]) { + printf("ioctl: VIDIOC_ENUM_FMT\n"); + print_video_formats_ext(fd, V4L2_BUF_TYPE_VIDEO_CAPTURE); + print_video_formats(fd, V4L2_BUF_TYPE_VIDEO_OUTPUT); + print_video_formats(fd, V4L2_BUF_TYPE_VIDEO_OVERLAY); + } + + if (options[OptListFrameSizes]) { + printf("ioctl: VIDIOC_ENUM_FRAMESIZES\n"); + if (frmsize.pixel_format < 256) + frmsize.pixel_format = find_pixel_format(fd, frmsize.pixel_format); + frmsize.index = 0; + while (ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &frmsize) >= 0) { + print_frmsize(frmsize, ""); + frmsize.index++; + } + } + + if (options[OptListFrameIntervals]) { + printf("ioctl: VIDIOC_ENUM_FRAMEINTERVALS\n"); + if (frmival.pixel_format < 256) + frmival.pixel_format = find_pixel_format(fd, frmival.pixel_format); + frmival.index = 0; + while (ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &frmival) >= 0) { + print_frmival(frmival, ""); + frmival.index++; + } + } + if (options[OptGetSlicedVbiCap]) { struct v4l2_sliced_vbi_cap cap; -- cgit v1.2.3 From 5132986080f45c38e0a8f0677c61e5f4e280ea9a Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 26 Aug 2009 22:34:01 +0200 Subject: v4l2-sysfs-path: fix compile warning. From: Hans Verkuil Priority: normal Signed-off-by: Hans Verkuil --- v4l2-apps/util/v4l2-sysfs-path.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v4l2-apps/util/v4l2-sysfs-path.c b/v4l2-apps/util/v4l2-sysfs-path.c index 2a6ab0cfc..4f0817017 100644 --- a/v4l2-apps/util/v4l2-sysfs-path.c +++ b/v4l2-apps/util/v4l2-sysfs-path.c @@ -245,13 +245,14 @@ void get_subdevs(char *path) char *s = strchr(entry->d_name, ':'); if (s) { printf("\t%s", entry->d_name); - if (!get_dev(entry->d_name, &major, &minor, extra)) + if (!get_dev(entry->d_name, &major, &minor, extra)) { if (*extra) printf(":%s (dev %d,%d)", extra, major, minor); else printf(" (dev %d,%d)", major, minor); + } printf("\n"); } } -- cgit v1.2.3 From 8b4cdbc446bbb6bcd5e0e92d49b195a6ef1c3a86 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 26 Aug 2009 22:44:46 +0200 Subject: versions.txt: av7110 no longer builds for kernels < 2.6.19. From: Hans Verkuil av7110_hw.c uses MODULE_FIRMWARE which didn't appear until 2.6.19. Priority: normal Signed-off-by: Hans Verkuil --- v4l/versions.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v4l/versions.txt b/v4l/versions.txt index 413ede9e8..d4c7bd380 100644 --- a/v4l/versions.txt +++ b/v4l/versions.txt @@ -79,6 +79,8 @@ VIDEO_USBVISION # Uses supports_autosuspend USB_MR800 USB_DSBR +# Uses MODULE_FIRMWARE +DVB_AV7110 # Uses remap_vmalloc_range() [2.6.18] -- cgit v1.2.3 From 668392480789cab466a0a979ed95f9057d005379 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 29 Aug 2009 09:06:07 -0300 Subject: ir-keymaps: standardize timeshift key From: Mauro Carvalho Chehab Each remote were using a different keycode for timeshift. Use the same keycode for all of them, using the map as defined at: http://linuxtv.org/wiki/index.php/Remote_Controllers Priority: normal Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/common/ir-keymaps.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/linux/drivers/media/common/ir-keymaps.c b/linux/drivers/media/common/ir-keymaps.c index c9f204048..24a635529 100644 --- a/linux/drivers/media/common/ir-keymaps.c +++ b/linux/drivers/media/common/ir-keymaps.c @@ -331,7 +331,7 @@ EXPORT_SYMBOL_GPL(ir_codes_pixelview); present on PV MPEG 8000GT */ IR_KEYTAB_TYPE ir_codes_pixelview_new[IR_KEYTAB_SIZE] = { - [0x3c] = KEY_PAUSE, /* Timeshift */ + [0x3c] = KEY_TIME, /* Timeshift */ [0x12] = KEY_POWER, [0x3d] = KEY_1, @@ -492,7 +492,7 @@ IR_KEYTAB_TYPE ir_codes_iodata_bctv7e[IR_KEYTAB_SIZE] = { [0x78] = KEY_9, [0x10] = KEY_L, /* Live */ - [0x08] = KEY_T, /* Time Shift */ + [0x08] = KEY_TIME, /* Time Shift */ [0x18] = KEY_PLAYPAUSE, /* Play */ @@ -595,7 +595,7 @@ IR_KEYTAB_TYPE ir_codes_msi_tvanywhere[IR_KEYTAB_SIZE] = { [0x0c] = KEY_MUTE, [0x0f] = KEY_SCREEN, /* Full Screen */ [0x10] = KEY_FN, /* Funtion */ - [0x11] = KEY_T, /* Time shift */ + [0x11] = KEY_TIME, /* Time shift */ [0x12] = KEY_POWER, [0x13] = KEY_MEDIA, /* MTS */ [0x14] = KEY_SLOW, @@ -1293,7 +1293,7 @@ IR_KEYTAB_TYPE ir_codes_manli[IR_KEYTAB_SIZE] = { [0x0f] = KEY_AUDIO, [0x1b] = KEY_VOLUMEUP, [0x1a] = KEY_CHANNELUP, - [0x0e] = KEY_SLEEP, /*XXX maybe KEY_PAUSE */ + [0x0e] = KEY_TIME, [0x1f] = KEY_VOLUMEDOWN, [0x1e] = KEY_CHANNELDOWN, @@ -1343,7 +1343,7 @@ IR_KEYTAB_TYPE ir_codes_gotview7135[IR_KEYTAB_SIZE] = { [0x2a] = KEY_F21, /* LIVE TIMESHIFT */ [0x0e] = KEY_F22, /* MIN TIMESHIFT */ - [0x1e] = KEY_F23, /* TIMESHIFT */ + [0x1e] = KEY_TIMESHIFT, /* TIMESHIFT */ [0x38] = KEY_F24, /* NORMAL TIMESHIFT */ }; EXPORT_SYMBOL_GPL(ir_codes_gotview7135); @@ -1384,8 +1384,8 @@ IR_KEYTAB_TYPE ir_codes_purpletv[IR_KEYTAB_SIZE] = { [0x46] = KEY_PLAY, [0x45] = KEY_PAUSE, /* Pause */ [0x44] = KEY_STOP, + [0x43] = KEY_TIME, /* Time Shift */ #if 0 - [0x43] = KEY_T, /* Time Shift */ [0x47] = KEY_Y, /* Time Shift OFF */ [0x4a] = KEY_O, /* TOP */ #endif @@ -1426,7 +1426,7 @@ IR_KEYTAB_TYPE ir_codes_pctv_sedna[IR_KEYTAB_SIZE] = { [0x18] = KEY_VOLUMEDOWN, [0x19] = KEY_SHUFFLE, /* Snapshot */ [0x1a] = KEY_NEXTSONG, - [0x1b] = KEY_TEXT, /* Time Shift */ + [0x1b] = KEY_TIME, /* Time Shift */ [0x1c] = KEY_RADIO, /* FM Radio */ [0x1d] = KEY_RECORD, [0x1e] = KEY_PAUSE, @@ -1595,7 +1595,7 @@ IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = { [0x22] = KEY_PREVIOUS, [0x23] = KEY_PLAYPAUSE, [0x24] = KEY_NEXT, - [0x25] = KEY_ARCHIVE, /* Time Shifting */ + [0x25] = KEY_TIME, /* Time Shifting */ [0x26] = KEY_STOP, [0x27] = KEY_RECORD, [0x28] = KEY_SAVE, /* Screenshot */ @@ -2364,7 +2364,7 @@ IR_KEYTAB_TYPE ir_codes_behold_columbus[IR_KEYTAB_SIZE] = { * Timeshift Record ChannelDown VolumeDown * * */ - [0x1B] = KEY_REWIND, + [0x1B] = KEY_TIME, [0x1D] = KEY_RECORD, [0x15] = KEY_CHANNELDOWN, [0x18] = KEY_VOLUMEDOWN, @@ -2516,7 +2516,7 @@ IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE] = { Also, it is not related to the time between keyup and keydown. */ - [0x19] = KEY_PAUSE, /* Timeshift */ + [0x19] = KEY_TIME, /* Timeshift */ [0x1a] = KEY_STOP, [0x1b] = KEY_RECORD, @@ -2687,7 +2687,7 @@ IR_KEYTAB_TYPE ir_codes_real_audio_220_32_keys[IR_KEYTAB_SIZE] = { [0x0d] = KEY_AUDIO, /* stereo */ [0x0f] = KEY_PREVIOUS, /* Prev */ - [0x1b] = KEY_PAUSE, /* Timeshift */ + [0x1b] = KEY_TIME, /* Timeshift */ [0x1a] = KEY_NEXT, /* Next */ [0x0e] = KEY_STOP, -- cgit v1.2.3 From eff582b37eade3b542a8501d3f3f920f6eaeab65 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 29 Aug 2009 09:37:00 -0300 Subject: ir-keymaps: Fix IR mappings for channel and volume +/- keys From: Mauro Carvalho Chehab Use standard definitions for channel controls, as defined at: http://linuxtv.org/wiki/index.php/Remote_Controllers While here, fix a few broken up/down/left/right mappings Priority: normal Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/common/ir-keymaps.c | 71 ++++++++++++++------------------- 1 file changed, 31 insertions(+), 40 deletions(-) diff --git a/linux/drivers/media/common/ir-keymaps.c b/linux/drivers/media/common/ir-keymaps.c index 24a635529..d1b742fc2 100644 --- a/linux/drivers/media/common/ir-keymaps.c +++ b/linux/drivers/media/common/ir-keymaps.c @@ -49,19 +49,19 @@ IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE] = { [0x08] = KEY_8, [0x09] = KEY_9, - [0x5c] = KEY_POWER, /* power */ - [0x20] = KEY_ZOOM, /* full screen */ - [0x0f] = KEY_BACKSPACE, /* recall */ - [0x1b] = KEY_ENTER, /* mute */ - [0x41] = KEY_RECORD, /* record */ - [0x43] = KEY_STOP, /* stop */ + [0x5c] = KEY_POWER, /* power */ + [0x20] = KEY_ZOOM, /* full screen */ + [0x0f] = KEY_BACKSPACE, /* recall */ + [0x1b] = KEY_ENTER, /* mute */ + [0x41] = KEY_RECORD, /* record */ + [0x43] = KEY_STOP, /* stop */ [0x16] = KEY_S, - [0x1a] = KEY_POWER2, /* off */ + [0x1a] = KEY_POWER2, /* off */ [0x2e] = KEY_RED, - [0x1f] = KEY_DOWN, /* channel - */ - [0x1c] = KEY_UP, /* channel + */ - [0x10] = KEY_LEFT, /* volume - */ - [0x1e] = KEY_RIGHT, /* volume + */ + [0x1f] = KEY_CHANNELDOWN, /* channel - */ + [0x1c] = KEY_CHANNELUP, /* channel + */ + [0x10] = KEY_VOLUMEDOWN, /* volume - */ + [0x1e] = KEY_VOLUMEUP, /* volume + */ [0x14] = KEY_F1, }; EXPORT_SYMBOL_GPL(ir_codes_proteus_2309); @@ -1270,11 +1270,11 @@ IR_KEYTAB_TYPE ir_codes_manli[IR_KEYTAB_SIZE] = { * 0x015 * * Down * * */ - [0x0b] = KEY_UP, /*XXX KEY_SCROLLUP? */ - [0x18] = KEY_LEFT, /*XXX KEY_BACK? */ + [0x0b] = KEY_UP, + [0x18] = KEY_LEFT, [0x16] = KEY_OK, /*XXX KEY_SELECT? KEY_ENTER? */ - [0x0c] = KEY_RIGHT, /*XXX KEY_FORWARD? */ - [0x15] = KEY_DOWN, /*XXX KEY_SCROLLDOWN? */ + [0x0c] = KEY_RIGHT, + [0x15] = KEY_DOWN, /* 0x11 0x0d * * TV/AV MODE * @@ -1644,8 +1644,6 @@ IR_KEYTAB_TYPE ir_codes_pinnacle_color[IR_KEYTAB_SIZE] = { [0x23] = KEY_RIGHT, [0x0d] = KEY_SELECT, - - [0x08] = KEY_BACK, [0x07] = KEY_REFRESH, @@ -1757,11 +1755,11 @@ IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE] = { [0x03] = KEY_BRIGHTNESSDOWN, [0x28] = KEY_AUDIO, - [0x3c] = KEY_UP, - [0x3f] = KEY_LEFT, + [0x3c] = KEY_CHANNELUP, + [0x3f] = KEY_VOLUMEDOWN, [0x2e] = KEY_MUTE, - [0x3b] = KEY_RIGHT, - [0x00] = KEY_DOWN, + [0x3b] = KEY_VOLUMEUP, + [0x00] = KEY_CHANNELDOWN, [0x07] = KEY_BRIGHTNESSUP, [0x2c] = KEY_TEXT, @@ -1965,17 +1963,10 @@ IR_KEYTAB_TYPE ir_codes_encore_enltv[IR_KEYTAB_SIZE] = { [0x14] = KEY_HOME, /* win start menu */ [0x15] = KEY_EXIT, /* exit */ -#if 0 [0x16] = KEY_CHANNELUP, /* UP */ [0x12] = KEY_CHANNELDOWN, /* DOWN */ [0x0c] = KEY_VOLUMEUP, /* RIGHT */ [0x17] = KEY_VOLUMEDOWN, /* LEFT */ -#else - [0x16] = KEY_UP, - [0x12] = KEY_DOWN, - [0x0c] = KEY_RIGHT, - [0x17] = KEY_LEFT, -#endif [0x18] = KEY_ENTER, /* OK */ @@ -2268,11 +2259,11 @@ IR_KEYTAB_TYPE ir_codes_behold[IR_KEYTAB_SIZE] = { * 0x015 * * Down * * */ - [0x0b] = KEY_CHANNELUP, /* XXX KEY_UP */ - [0x18] = KEY_VOLUMEDOWN, /* XXX KEY_LEFT */ + [0x0b] = KEY_CHANNELUP, + [0x18] = KEY_VOLUMEDOWN, [0x16] = KEY_OK, /* XXX KEY_ENTER */ - [0x0c] = KEY_VOLUMEUP, /* XXX KEY_RIGHT */ - [0x15] = KEY_CHANNELDOWN, /* XXX KEY_DOWN */ + [0x0c] = KEY_VOLUMEUP, + [0x15] = KEY_CHANNELDOWN, /* 0x11 0x0d * * MUTE INFO * @@ -2450,10 +2441,10 @@ IR_KEYTAB_TYPE ir_codes_powercolor_real_angel[IR_KEYTAB_SIZE] = { [0x13] = KEY_BRIGHTNESSDOWN, [0x2b] = KEY_MODE, /* stereo/mono */ [0x2c] = KEY_TEXT, /* teletext */ - [0x20] = KEY_UP, /* channel up */ - [0x21] = KEY_DOWN, /* channel down */ - [0x10] = KEY_RIGHT, /* volume up */ - [0x11] = KEY_LEFT, /* volume down */ + [0x20] = KEY_CHANNELUP, /* channel up */ + [0x21] = KEY_CHANELDOWN, /* channel down */ + [0x10] = KEY_VOLUMEUP, /* volume up */ + [0x11] = KEY_VOLUMEDOWN, /* volume down */ [0x0d] = KEY_MUTE, [0x1f] = KEY_RECORD, [0x17] = KEY_PLAY, @@ -2651,11 +2642,11 @@ IR_KEYTAB_TYPE ir_codes_encore_enltv_fm53[IR_KEYTAB_SIZE] = { [0x54] = KEY_RECORD, [0x4d] = KEY_PLAY, /* pause */ - [0x1e] = KEY_UP, /* video setting */ + [0x1e] = KEY_MENU, /* video setting */ [0x0e] = KEY_RIGHT, /* <- */ [0x1a] = KEY_LEFT, /* -> */ - [0x0a] = KEY_DOWN, /* video default */ + [0x0a] = KEY_CLEAR, /* video default */ [0x0c] = KEY_ZOOM, /* hide pannel */ [0x47] = KEY_SLEEP, /* shutdown */ }; @@ -2748,8 +2739,8 @@ IR_KEYTAB_TYPE ir_codes_dm1105_nec[IR_KEYTAB_SIZE] = { [0x18] = KEY_8, [0x19] = KEY_9, [0x10] = KEY_0, - [0x1c] = KEY_PAGEUP, /* ch+ */ - [0x0f] = KEY_PAGEDOWN, /* ch- */ + [0x1c] = KEY_CHANNELUP, /* ch+ */ + [0x0f] = KEY_CHANNELDOWN, /* ch- */ [0x1a] = KEY_VOLUMEUP, /* vol+ */ [0x0e] = KEY_VOLUMEDOWN, /* vol- */ [0x04] = KEY_RECORD, /* rec */ -- cgit v1.2.3 From 53346f9dc73de737bcab79ce76d1dc2f8bf7b625 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 29 Aug 2009 09:48:21 -0300 Subject: ir-keymaps: use KEY_CAMERA for snapshots From: Mauro Carvalho Chehab KEY_CAMERA is already used for a long time with webcam drivers to take a picture. On other media drivers, due to the lack of a snapshot button, random KEY codes were sent, being KEY_SHUFFLE the most used one, probably due to cut-and-paste from other remotes, since one of them uses the same key for snapshot and shuffle. The better is to use KEY_CAMERA on all drivers solving this issue. This follows the IR standard map as defined at: http://linuxtv.org/wiki/index.php/Remote_Controllers Priority: normal Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/common/ir-keymaps.c | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/linux/drivers/media/common/ir-keymaps.c b/linux/drivers/media/common/ir-keymaps.c index d1b742fc2..7e7a4ca29 100644 --- a/linux/drivers/media/common/ir-keymaps.c +++ b/linux/drivers/media/common/ir-keymaps.c @@ -356,7 +356,7 @@ IR_KEYTAB_TYPE ir_codes_pixelview_new[IR_KEYTAB_SIZE] = { [0x14] = KEY_VOLUMEDOWN, [0x13] = KEY_ZOOM, - [0x19] = KEY_SHUFFLE, /* SNAPSHOT */ + [0x19] = KEY_CAMERA, /* SNAPSHOT */ [0x1a] = KEY_SEARCH, /* scan */ [0x37] = KEY_REWIND, /* << */ @@ -683,7 +683,7 @@ IR_KEYTAB_TYPE ir_codes_msi_tvanywhere_plus[IR_KEYTAB_SIZE] = { [0x0f] = KEY_CLOSE, /* Minimize */ [0x19] = KEY_ZOOM, /* Zoom */ - [0x1a] = KEY_SHUFFLE, /* Snapshot */ + [0x1a] = KEY_CAMERA, /* Snapshot */ [0x0d] = KEY_LANGUAGE, /* MTS */ [0x14] = KEY_VOLUMEDOWN,/* Vol- */ @@ -1089,7 +1089,7 @@ IR_KEYTAB_TYPE ir_codes_eztv[IR_KEYTAB_SIZE] = { [0x2b] = KEY_RECORD, /* recording */ [0x2c] = KEY_STOP, /* stop */ [0x2d] = KEY_PLAY, /* play */ - [0x2e] = KEY_SHUFFLE, /* snapshot / shuffle */ + [0x2e] = KEY_CAMERA, /* snapshot / shuffle */ [0x00] = KEY_0, [0x05] = KEY_1, @@ -1140,7 +1140,7 @@ IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE] = { [0x2a] = KEY_SEARCH, /* AUTOSCAN */ [0x1a] = KEY_SLEEP, /* FREEZE */ - [0x3a] = KEY_SHUFFLE, /* SNAPSHOT */ + [0x3a] = KEY_CAMERA, /* SNAPSHOT */ [0x0a] = KEY_MUTE, /* MUTE */ [0x26] = KEY_RECORD, /* RECORD */ @@ -1301,7 +1301,7 @@ IR_KEYTAB_TYPE ir_codes_manli[IR_KEYTAB_SIZE] = { * MUTE SNAPSHOT* * */ [0x13] = KEY_MUTE, - [0x19] = KEY_RECORD, /*XXX*/ + [0x19] = KEY_CAMERA, /* 0x1d unused ? */ }; @@ -1331,8 +1331,8 @@ IR_KEYTAB_TYPE ir_codes_gotview7135[IR_KEYTAB_SIZE] = { [0x0c] = KEY_VOLUMEDOWN, [0x28] = KEY_VOLUMEUP, [0x08] = KEY_MUTE, - [0x26] = KEY_SEARCH, /*SCAN*/ - [0x3f] = KEY_SHUFFLE, /* SNAPSHOT */ + [0x26] = KEY_SEARCH, /* SCAN */ + [0x3f] = KEY_CAMERA, /* SNAPSHOT */ [0x12] = KEY_RECORD, [0x32] = KEY_STOP, [0x3c] = KEY_PLAY, @@ -1424,7 +1424,7 @@ IR_KEYTAB_TYPE ir_codes_pctv_sedna[IR_KEYTAB_SIZE] = { [0x13] = KEY_MUTE, [0x15] = KEY_CHANNELDOWN, [0x18] = KEY_VOLUMEDOWN, - [0x19] = KEY_SHUFFLE, /* Snapshot */ + [0x19] = KEY_CAMERA, /* Snapshot */ [0x1a] = KEY_NEXTSONG, [0x1b] = KEY_TIME, /* Time Shift */ [0x1c] = KEY_RADIO, /* FM Radio */ @@ -2049,7 +2049,7 @@ IR_KEYTAB_TYPE ir_codes_encore_enltv2[IR_KEYTAB_SIZE] = { [0x72] = KEY_CHANNELDOWN, [0x41] = KEY_RECORD, - [0x51] = KEY_SHUFFLE, /* Snapshot */ + [0x51] = KEY_CAMERA, /* Snapshot */ [0x75] = KEY_TIME, /* Timeshift */ [0x71] = KEY_TV2, /* PIP */ @@ -2297,7 +2297,7 @@ IR_KEYTAB_TYPE ir_codes_behold[IR_KEYTAB_SIZE] = { * FREEZE SNAPSHOT * * */ [0x58] = KEY_SLOW, - [0x5c] = KEY_SAVE, + [0x5c] = KEY_CAMERA, }; EXPORT_SYMBOL_GPL(ir_codes_behold); @@ -2337,7 +2337,7 @@ IR_KEYTAB_TYPE ir_codes_behold_columbus[IR_KEYTAB_SIZE] = { [0x04] = KEY_4, [0x05] = KEY_5, [0x06] = KEY_6, - [0x19] = KEY_BOOKMARKS, /* Snapshot key */ + [0x19] = KEY_CAMERA, /* Snapshot key */ [0x07] = KEY_7, [0x08] = KEY_8, [0x09] = KEY_9, @@ -2408,7 +2408,7 @@ IR_KEYTAB_TYPE ir_codes_genius_tvgo_a11mce[IR_KEYTAB_SIZE] = { an alternate name written */ [0x1e] = KEY_UP, /* Video Setting */ [0x0a] = KEY_DOWN, /* Video Default */ - [0x05] = KEY_LEFT, /* Snapshot */ + [0x05] = KEY_CAMERA, /* Snapshot */ [0x0c] = KEY_RIGHT, /* Hide Panel */ /* Four buttons without label */ [0x49] = KEY_RED, @@ -2453,7 +2453,7 @@ IR_KEYTAB_TYPE ir_codes_powercolor_real_angel[IR_KEYTAB_SIZE] = { [0x27] = KEY_FASTFORWARD, [0x26] = KEY_REWIND, [0x1e] = KEY_SEARCH, /* autoscan */ - [0x0e] = KEY_SHUFFLE, /* snapshot */ + [0x0e] = KEY_CAMERA, /* snapshot */ [0x2d] = KEY_SETUP, [0x0f] = KEY_SCREEN, /* full screen */ [0x14] = KEY_RADIO, /* FM radio */ @@ -2515,7 +2515,7 @@ IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE] = { [0x15] = KEY_AUDIO, /* ((*)) */ [0x0f] = KEY_ZOOM, - [0x1c] = KEY_SHUFFLE, /* snapshot */ + [0x1c] = KEY_CAMERA, /* snapshot */ [0x18] = KEY_RED, /* B */ [0x23] = KEY_GREEN, /* C */ @@ -2631,7 +2631,7 @@ IR_KEYTAB_TYPE ir_codes_encore_enltv_fm53[IR_KEYTAB_SIZE] = { [0x40] = KEY_LAST, /* recall */ [0x02] = KEY_MODE, /* TV/AV */ - [0x05] = KEY_SHUFFLE, /* SNAPSHOT */ + [0x05] = KEY_CAMERA, /* SNAPSHOT */ [0x4c] = KEY_CHANNELUP, /* UP */ [0x00] = KEY_CHANNELDOWN, /* DOWN */ @@ -2687,7 +2687,7 @@ IR_KEYTAB_TYPE ir_codes_real_audio_220_32_keys[IR_KEYTAB_SIZE] = { [0x1d] = KEY_RECORD, [0x13] = KEY_MUTE, - [0x19] = KEY_SHUFFLE, /* Snapshot */ + [0x19] = KEY_CAMERA, /* Snapshot */ }; EXPORT_SYMBOL_GPL(ir_codes_real_audio_220_32_keys); @@ -2871,7 +2871,7 @@ IR_KEYTAB_TYPE ir_codes_videomate_s350[IR_KEYTAB_SIZE] = { [0x29] = KEY_CHANNEL, /* SURF */ [0x2b] = KEY_A, [0x2c] = KEY_B, - [0x2f] = KEY_SHUFFLE, /* Snapshot */ + [0x2f] = KEY_CAMERA, /* Snapshot */ [0x23] = KEY_RADIO, [0x02] = KEY_PREVIOUSSONG, [0x06] = KEY_NEXTSONG, -- cgit v1.2.3 From 53e62967f3826e6ee00f29ee836c49cd4ca3485d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 29 Aug 2009 09:51:51 -0300 Subject: Fix compilation issues caused by typos From: Mauro Carvalho Chehab This patch should be folded with the original ones at -git. kernel-sync: Priority: normal Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/common/ir-keymaps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/drivers/media/common/ir-keymaps.c b/linux/drivers/media/common/ir-keymaps.c index 7e7a4ca29..7ab7d0586 100644 --- a/linux/drivers/media/common/ir-keymaps.c +++ b/linux/drivers/media/common/ir-keymaps.c @@ -1343,7 +1343,7 @@ IR_KEYTAB_TYPE ir_codes_gotview7135[IR_KEYTAB_SIZE] = { [0x2a] = KEY_F21, /* LIVE TIMESHIFT */ [0x0e] = KEY_F22, /* MIN TIMESHIFT */ - [0x1e] = KEY_TIMESHIFT, /* TIMESHIFT */ + [0x1e] = KEY_TIME, /* TIMESHIFT */ [0x38] = KEY_F24, /* NORMAL TIMESHIFT */ }; EXPORT_SYMBOL_GPL(ir_codes_gotview7135); @@ -2442,7 +2442,7 @@ IR_KEYTAB_TYPE ir_codes_powercolor_real_angel[IR_KEYTAB_SIZE] = { [0x2b] = KEY_MODE, /* stereo/mono */ [0x2c] = KEY_TEXT, /* teletext */ [0x20] = KEY_CHANNELUP, /* channel up */ - [0x21] = KEY_CHANELDOWN, /* channel down */ + [0x21] = KEY_CHANNELDOWN, /* channel down */ [0x10] = KEY_VOLUMEUP, /* volume up */ [0x11] = KEY_VOLUMEDOWN, /* volume down */ [0x0d] = KEY_MUTE, -- cgit v1.2.3 From 810944b9c6ecec7746372ac6ae94252d2d713531 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 26 Aug 2009 22:06:28 -0300 Subject: FM1216MK5 FM radio From: Dmitri Belimov Implement Philips FM1216MK5. 1. Implement get_stereo function. 2. Add correct data byte for FM radio mode Priority: normal Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov Signed-off-by: Douglas Schilling Landgraf Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/common/tuners/tuner-simple.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux/drivers/media/common/tuners/tuner-simple.c b/linux/drivers/media/common/tuners/tuner-simple.c index 2ac1c8edb..4bac1d0c6 100644 --- a/linux/drivers/media/common/tuners/tuner-simple.c +++ b/linux/drivers/media/common/tuners/tuner-simple.c @@ -145,6 +145,8 @@ static inline int tuner_stereo(const int type, const int status) case TUNER_LG_NTSC_TAPE: case TUNER_TCL_MF02GIP_5N: return ((status & TUNER_SIGNAL) == TUNER_STEREO_MK3); + case TUNER_PHILIPS_FM1216MK5: + return status | TUNER_STEREO; default: return status & TUNER_STEREO; } @@ -515,6 +517,10 @@ static int simple_radio_bandswitch(struct dvb_frontend *fe, u8 *buffer) case TUNER_TCL_MF02GIP_5N: buffer[3] = 0x19; break; + case TUNER_PHILIPS_FM1216MK5: + buffer[2] = 0x88; + buffer[3] = 0x09; + break; case TUNER_TNF_5335MF: buffer[3] = 0x11; break; -- cgit v1.2.3 From 640cb9f7f8d3aca8ad56e1f6a7bac42e15aa6962 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 26 Aug 2009 22:10:55 -0300 Subject: support AverMedia Studio 505 From: Vasiliy Temnikov Added support to AverMedia Studio 505 Priority: normal Signed-off-by: Vasiliy Temnikov [dougsland@redhat.com: fixed rejects and removed the change to add dk as default secam variant] [mchehab@redhat.com: fix a few CodingStyle issues] Signed-off-by: Andrew Morton Signed-off-by: Douglas Schilling Landgraf Signed-off-by: Mauro Carvalho Chehab --- linux/Documentation/video4linux/CARDLIST.saa7134 | 1 + linux/drivers/media/video/saa7134/saa7134-cards.c | 43 +++++++++++++++++++++++ linux/drivers/media/video/saa7134/saa7134-input.c | 1 + linux/drivers/media/video/saa7134/saa7134.h | 1 + 4 files changed, 46 insertions(+) diff --git a/linux/Documentation/video4linux/CARDLIST.saa7134 b/linux/Documentation/video4linux/CARDLIST.saa7134 index dc0576afe..31d9f14d6 100644 --- a/linux/Documentation/video4linux/CARDLIST.saa7134 +++ b/linux/Documentation/video4linux/CARDLIST.saa7134 @@ -168,3 +168,4 @@ 167 -> Beholder BeholdTV 609 RDS [5ace:6092] 168 -> Beholder BeholdTV 609 RDS [5ace:6093] 169 -> Compro VideoMate S350/S300 [185b:c900] +170 -> AverMedia AverTV Studio 505 [1461:a115] diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c index c401a37ea..cdb04fdbb 100644 --- a/linux/drivers/media/video/saa7134/saa7134-cards.c +++ b/linux/drivers/media/video/saa7134/saa7134-cards.c @@ -1364,6 +1364,42 @@ struct saa7134_board saa7134_boards[] = { .amux = LINE1, }, }, + [SAA7134_BOARD_AVERMEDIA_STUDIO_505] = { + /* Vasiliy Temnikov */ + .name = "AverMedia AverTV Studio 505", + .audio_clock = 0x00187de7, + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .tda9887_conf = TDA9887_PRESENT, + .inputs = { { + .name = name_tv, + .vmux = 1, + .amux = LINE2, + .tv = 1, + }, { + .name = name_comp1, + .vmux = 0, + .amux = LINE2, + }, { + .name = name_comp2, + .vmux = 3, + .amux = LINE2, + },{ + .name = name_svideo, + .vmux = 8, + .amux = LINE2, + } }, + .radio = { + .name = name_radio, + .amux = LINE2, + }, + .mute = { + .name = name_mute, + .amux = LINE1, + }, + }, [SAA7134_BOARD_UPMOST_PURPLE_TV] = { .name = "UPMOST PURPLE TV", .audio_clock = 0x00187de7, @@ -5437,6 +5473,12 @@ struct pci_device_id saa7134_pci_tbl[] = { .subdevice = 0x2115, .driver_data = SAA7134_BOARD_AVERMEDIA_STUDIO_305, },{ + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7130, + .subvendor = 0x1461, /* Avermedia Technologies Inc */ + .subdevice = 0xa115, + .driver_data = SAA7134_BOARD_AVERMEDIA_STUDIO_505, + }, { .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7130, .subvendor = 0x1461, /* Avermedia Technologies Inc */ @@ -6607,6 +6649,7 @@ int saa7134_board_init1(struct saa7134_dev *dev) case SAA7134_BOARD_KWORLD_VSTREAM_XPERT: case SAA7134_BOARD_KWORLD_XPERT: case SAA7134_BOARD_AVERMEDIA_STUDIO_305: + case SAA7134_BOARD_AVERMEDIA_STUDIO_505: case SAA7134_BOARD_AVERMEDIA_305: case SAA7134_BOARD_AVERMEDIA_STUDIO_307: case SAA7134_BOARD_AVERMEDIA_307: diff --git a/linux/drivers/media/video/saa7134/saa7134-input.c b/linux/drivers/media/video/saa7134/saa7134-input.c index 146ac816a..8dbad5dbe 100644 --- a/linux/drivers/media/video/saa7134/saa7134-input.c +++ b/linux/drivers/media/video/saa7134/saa7134-input.c @@ -486,6 +486,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) case SAA7134_BOARD_AVERMEDIA_305: case SAA7134_BOARD_AVERMEDIA_307: case SAA7134_BOARD_AVERMEDIA_STUDIO_305: + case SAA7134_BOARD_AVERMEDIA_STUDIO_505: case SAA7134_BOARD_AVERMEDIA_STUDIO_307: case SAA7134_BOARD_AVERMEDIA_STUDIO_507: case SAA7134_BOARD_AVERMEDIA_STUDIO_507UA: diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h index c0757f8a1..b59e0f18b 100644 --- a/linux/drivers/media/video/saa7134/saa7134.h +++ b/linux/drivers/media/video/saa7134/saa7134.h @@ -294,6 +294,7 @@ struct saa7134_format { #define SAA7134_BOARD_BEHOLD_609RDS_MK3 167 #define SAA7134_BOARD_BEHOLD_609RDS_MK5 168 #define SAA7134_BOARD_VIDEOMATE_S350 169 +#define SAA7134_BOARD_AVERMEDIA_STUDIO_505 170 #define SAA7134_MAXBOARDS 32 #define SAA7134_INPUT_MAX 8 -- cgit v1.2.3 From 52ef68ff244a5cd4707558c9aa803ecb9c1342dc Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 26 Aug 2009 22:13:43 -0300 Subject: Fix test of bandwidth range in cx22700_set_tps() From: Roel Kluin For the bandwidth to be less than 8 MHZ and greater than 6 MHZ is logically impossible. Priority: normal Signed-off-by: Roel Kluin Signed-off-by: Andrew Morton Signed-off-by: Douglas Schilling Landgraf Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/dvb/frontends/cx22700.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/drivers/media/dvb/frontends/cx22700.c b/linux/drivers/media/dvb/frontends/cx22700.c index fbd838eca..5fbc0fc37 100644 --- a/linux/drivers/media/dvb/frontends/cx22700.c +++ b/linux/drivers/media/dvb/frontends/cx22700.c @@ -155,7 +155,7 @@ static int cx22700_set_tps (struct cx22700_state *state, struct dvb_ofdm_paramet p->hierarchy_information > HIERARCHY_4) return -EINVAL; - if (p->bandwidth < BANDWIDTH_8_MHZ && p->bandwidth > BANDWIDTH_6_MHZ) + if (p->bandwidth < BANDWIDTH_8_MHZ || p->bandwidth > BANDWIDTH_6_MHZ) return -EINVAL; if (p->bandwidth == BANDWIDTH_7_MHZ) -- cgit v1.2.3 From 680d4a2bc897c5cc651e3faf396af2f107d4a51d Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Wed, 26 Aug 2009 21:43:16 -0400 Subject: tda18271: simplify debug printk macros From: Michael Krufky Rename dprintk to tda_dprintk to be consistent with the other tda_foo macros. Move KERN_DEBUG facility level to tda_dprintk. Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/common/tuners/tda18271-priv.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/linux/drivers/media/common/tuners/tda18271-priv.h b/linux/drivers/media/common/tuners/tda18271-priv.h index f3adbb212..14aa49498 100644 --- a/linux/drivers/media/common/tuners/tda18271-priv.h +++ b/linux/drivers/media/common/tuners/tda18271-priv.h @@ -138,17 +138,17 @@ extern int tda18271_debug; #define tda_printk(kern, fmt, arg...) \ printk(kern "%s: " fmt, __func__, ##arg) -#define dprintk(kern, lvl, fmt, arg...) do {\ +#define tda_dprintk(lvl, fmt, arg...) do {\ if (tda18271_debug & lvl) \ - tda_printk(kern, fmt, ##arg); } while (0) + tda_printk(KERN_DEBUG, fmt, ##arg); } while (0) #define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) #define tda_warn(fmt, arg...) tda_printk(KERN_WARNING, fmt, ##arg) #define tda_err(fmt, arg...) tda_printk(KERN_ERR, fmt, ##arg) -#define tda_dbg(fmt, arg...) dprintk(KERN_DEBUG, DBG_INFO, fmt, ##arg) -#define tda_map(fmt, arg...) dprintk(KERN_DEBUG, DBG_MAP, fmt, ##arg) -#define tda_reg(fmt, arg...) dprintk(KERN_DEBUG, DBG_REG, fmt, ##arg) -#define tda_cal(fmt, arg...) dprintk(KERN_DEBUG, DBG_CAL, fmt, ##arg) +#define tda_dbg(fmt, arg...) tda_dprintk(DBG_INFO, fmt, ##arg) +#define tda_map(fmt, arg...) tda_dprintk(DBG_MAP, fmt, ##arg) +#define tda_reg(fmt, arg...) tda_dprintk(DBG_REG, fmt, ##arg) +#define tda_cal(fmt, arg...) tda_dprintk(DBG_CAL, fmt, ##arg) #define tda_fail(ret) \ ({ \ -- cgit v1.2.3 From 6ba91e19a0ce791ce8777ed22fa7b7e29e5e4a80 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Wed, 26 Aug 2009 21:43:16 -0400 Subject: tda18271: remove excess whitespace from tda_foo printk macros From: Michael Krufky remove excess spacing from the tda_foo printk macros & line things up better Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/common/tuners/tda18271-priv.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/linux/drivers/media/common/tuners/tda18271-priv.h b/linux/drivers/media/common/tuners/tda18271-priv.h index 14aa49498..e6aa1f47f 100644 --- a/linux/drivers/media/common/tuners/tda18271-priv.h +++ b/linux/drivers/media/common/tuners/tda18271-priv.h @@ -142,13 +142,13 @@ extern int tda18271_debug; if (tda18271_debug & lvl) \ tda_printk(KERN_DEBUG, fmt, ##arg); } while (0) -#define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) -#define tda_warn(fmt, arg...) tda_printk(KERN_WARNING, fmt, ##arg) -#define tda_err(fmt, arg...) tda_printk(KERN_ERR, fmt, ##arg) -#define tda_dbg(fmt, arg...) tda_dprintk(DBG_INFO, fmt, ##arg) -#define tda_map(fmt, arg...) tda_dprintk(DBG_MAP, fmt, ##arg) -#define tda_reg(fmt, arg...) tda_dprintk(DBG_REG, fmt, ##arg) -#define tda_cal(fmt, arg...) tda_dprintk(DBG_CAL, fmt, ##arg) +#define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) +#define tda_warn(fmt, arg...) tda_printk(KERN_WARNING, fmt, ##arg) +#define tda_err(fmt, arg...) tda_printk(KERN_ERR, fmt, ##arg) +#define tda_dbg(fmt, arg...) tda_dprintk(DBG_INFO, fmt, ##arg) +#define tda_map(fmt, arg...) tda_dprintk(DBG_MAP, fmt, ##arg) +#define tda_reg(fmt, arg...) tda_dprintk(DBG_REG, fmt, ##arg) +#define tda_cal(fmt, arg...) tda_dprintk(DBG_CAL, fmt, ##arg) #define tda_fail(ret) \ ({ \ -- cgit v1.2.3 From 71911bc952f2394dede17c5713de0b0dfcb04fae Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Thu, 27 Aug 2009 15:58:06 -0400 Subject: tda18271: allow drivers to request RF tracking filter calibration during attach From: Michael Krufky On certain master / slave dual tuner configurations, tuning performance improves when the RF tracking filter calibration is performed sequentially. This patch allows for the bridge driver to specify this behavior in the configuration structure at attach-time. The "cal" module option will continue to override this attach-time configuration: set cal=0 to prevent RF tracking filter calibration on startup, and set cal=1 to force it. Priority: normal Signed-off-by: Michael Krufky Reviewed-by: Steven Toth --- linux/drivers/media/common/tuners/tda18271-fe.c | 20 ++++++++++++++++++-- linux/drivers/media/common/tuners/tda18271.h | 3 +++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/linux/drivers/media/common/tuners/tda18271-fe.c b/linux/drivers/media/common/tuners/tda18271-fe.c index 85e30af31..6c71b0a16 100644 --- a/linux/drivers/media/common/tuners/tda18271-fe.c +++ b/linux/drivers/media/common/tuners/tda18271-fe.c @@ -28,7 +28,7 @@ module_param_named(debug, tda18271_debug, int, 0644); MODULE_PARM_DESC(debug, "set debug level " "(info=1, map=2, reg=4, adv=8, cal=16 (or-able))"); -static int tda18271_cal_on_startup; +static int tda18271_cal_on_startup = -1; module_param_named(cal, tda18271_cal_on_startup, int, 0644); MODULE_PARM_DESC(cal, "perform RF tracking filter calibration on startup"); @@ -1193,10 +1193,25 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, case 0: goto fail; case 1: + { /* new tuner instance */ + int rf_cal_on_startup; + priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO; priv->role = (cfg) ? cfg->role : TDA18271_MASTER; priv->config = (cfg) ? cfg->config : 0; + + /* tda18271_cal_on_startup == -1 when cal + * module option is unset */ + if (tda18271_cal_on_startup == -1) { + /* honor attach-time configuration */ + rf_cal_on_startup = + ((cfg) && (cfg->rf_cal_on_startup)) ? 1 : 0; + } else { + /* module option overrides attach configuration */ + rf_cal_on_startup = tda18271_cal_on_startup; + } + priv->cal_initialized = false; mutex_init(&priv->lock); @@ -1214,11 +1229,12 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, mutex_lock(&priv->lock); tda18271_init_regs(fe); - if ((tda18271_cal_on_startup) && (priv->id == TDA18271HDC2)) + if ((rf_cal_on_startup) && (priv->id == TDA18271HDC2)) tda18271c2_rf_cal_init(fe); mutex_unlock(&priv->lock); break; + } default: /* existing tuner instance */ fe->tuner_priv = priv; diff --git a/linux/drivers/media/common/tuners/tda18271.h b/linux/drivers/media/common/tuners/tda18271.h index 53a9892a1..71bac9593 100644 --- a/linux/drivers/media/common/tuners/tda18271.h +++ b/linux/drivers/media/common/tuners/tda18271.h @@ -77,6 +77,9 @@ struct tda18271_config { /* use i2c gate provided by analog or digital demod */ enum tda18271_i2c_gate gate; + /* force rf tracking filter calibration on startup */ + unsigned int rf_cal_on_startup:1; + /* some i2c providers cant write all 39 registers at once */ unsigned int small_i2c:1; -- cgit v1.2.3