Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
"A series of bug fix patches for v3.15-rc1. Most are just driver
fixes. There are some changes at remote controller core level, fixing
some definitions on a new API added for Kernel v3.15.

It also adds the missing include at include/uapi/linux/v4l2-common.h,
to allow its compilation on userspace, as pointed by you"

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (24 commits)
[media] gpsca: remove the risk of a division by zero
[media] stk1160: warrant a NUL terminated string
[media] v4l: ti-vpe: retain v4l2_buffer flags for captured buffers
[media] v4l: ti-vpe: Set correct field parameter for output and capture buffers
[media] v4l: ti-vpe: zero out reserved fields in try_fmt
[media] v4l: ti-vpe: Fix initial configuration queue data
[media] v4l: ti-vpe: Use correct bus_info name for the device in querycap
[media] v4l: ti-vpe: report correct capabilities in querycap
[media] v4l: ti-vpe: Allow usage of smaller images
[media] v4l: ti-vpe: Use video_device_release_empty
[media] v4l: ti-vpe: Make sure in job_ready that we have the needed number of dst_bufs
[media] lgdt3305: include sleep functionality in lgdt3304_ops
[media] drx-j: use customise option correctly
[media] m88rs2000: fix sparse static warnings
[media] r820t: fix size and init values
[media] rc-core: remove generic scancode filter
[media] rc-core: split dev->s_filter
[media] rc-core: do not change 32bit NEC scancode format for now
[media] rtl28xxu: remove duplicate ID 0458:707f Genius TVGo DVB-T03
[media] xc2028: add missing break to switch
...

+200 -126
+1 -1
drivers/media/dvb-frontends/drx39xyj/Kconfig
··· 1 1 config DVB_DRX39XYJ 2 2 tristate "Micronas DRX-J demodulator" 3 3 depends on DVB_CORE && I2C 4 - default m if DVB_FE_CUSTOMISE 4 + default m if !MEDIA_SUBDRV_AUTOSELECT 5 5 help 6 6 An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want 7 7 to support this frontend.
+1
drivers/media/dvb-frontends/lgdt3305.c
··· 1176 1176 }, 1177 1177 .i2c_gate_ctrl = lgdt3305_i2c_gate_ctrl, 1178 1178 .init = lgdt3305_init, 1179 + .sleep = lgdt3305_sleep, 1179 1180 .set_frontend = lgdt3304_set_parameters, 1180 1181 .get_frontend = lgdt3305_get_frontend, 1181 1182 .get_tune_settings = lgdt3305_get_tune_settings,
+4 -4
drivers/media/dvb-frontends/m88rs2000.c
··· 297 297 u8 val; 298 298 }; 299 299 300 - struct inittab m88rs2000_setup[] = { 300 + static struct inittab m88rs2000_setup[] = { 301 301 {DEMOD_WRITE, 0x9a, 0x30}, 302 302 {DEMOD_WRITE, 0x00, 0x01}, 303 303 {WRITE_DELAY, 0x19, 0x00}, ··· 315 315 {0xff, 0xaa, 0xff} 316 316 }; 317 317 318 - struct inittab m88rs2000_shutdown[] = { 318 + static struct inittab m88rs2000_shutdown[] = { 319 319 {DEMOD_WRITE, 0x9a, 0x30}, 320 320 {DEMOD_WRITE, 0xb0, 0x00}, 321 321 {DEMOD_WRITE, 0xf1, 0x89}, ··· 325 325 {0xff, 0xaa, 0xff} 326 326 }; 327 327 328 - struct inittab fe_reset[] = { 328 + static struct inittab fe_reset[] = { 329 329 {DEMOD_WRITE, 0x00, 0x01}, 330 330 {DEMOD_WRITE, 0x20, 0x81}, 331 331 {DEMOD_WRITE, 0x21, 0x80}, ··· 363 363 {0xff, 0xaa, 0xff} 364 364 }; 365 365 366 - struct inittab fe_trigger[] = { 366 + static struct inittab fe_trigger[] = { 367 367 {DEMOD_WRITE, 0x97, 0x04}, 368 368 {DEMOD_WRITE, 0x99, 0x77}, 369 369 {DEMOD_WRITE, 0x9b, 0x64},
+32 -13
drivers/media/platform/ti-vpe/vpe.c
··· 49 49 #define VPE_MODULE_NAME "vpe" 50 50 51 51 /* minimum and maximum frame sizes */ 52 - #define MIN_W 128 53 - #define MIN_H 128 52 + #define MIN_W 32 53 + #define MIN_H 32 54 54 #define MAX_W 1920 55 55 #define MAX_H 1080 56 56 ··· 887 887 if (v4l2_m2m_num_src_bufs_ready(ctx->m2m_ctx) < needed) 888 888 return 0; 889 889 890 + if (v4l2_m2m_num_dst_bufs_ready(ctx->m2m_ctx) < needed) 891 + return 0; 892 + 890 893 return 1; 891 894 } 892 895 ··· 1280 1277 s_buf = &s_vb->v4l2_buf; 1281 1278 d_buf = &d_vb->v4l2_buf; 1282 1279 1280 + d_buf->flags = s_buf->flags; 1281 + 1283 1282 d_buf->timestamp = s_buf->timestamp; 1284 - d_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 1285 - d_buf->flags |= s_buf->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK; 1286 - if (s_buf->flags & V4L2_BUF_FLAG_TIMECODE) { 1287 - d_buf->flags |= V4L2_BUF_FLAG_TIMECODE; 1283 + if (s_buf->flags & V4L2_BUF_FLAG_TIMECODE) 1288 1284 d_buf->timecode = s_buf->timecode; 1289 - } 1285 + 1290 1286 d_buf->sequence = ctx->sequence; 1291 - d_buf->field = ctx->field; 1292 1287 1293 1288 d_q_data = &ctx->q_data[Q_DATA_DST]; 1294 1289 if (d_q_data->flags & Q_DATA_INTERLACED) { 1290 + d_buf->field = ctx->field; 1295 1291 if (ctx->field == V4L2_FIELD_BOTTOM) { 1296 1292 ctx->sequence++; 1297 1293 ctx->field = V4L2_FIELD_TOP; ··· 1299 1297 ctx->field = V4L2_FIELD_BOTTOM; 1300 1298 } 1301 1299 } else { 1300 + d_buf->field = V4L2_FIELD_NONE; 1302 1301 ctx->sequence++; 1303 1302 } 1304 1303 ··· 1338 1335 { 1339 1336 strncpy(cap->driver, VPE_MODULE_NAME, sizeof(cap->driver) - 1); 1340 1337 strncpy(cap->card, VPE_MODULE_NAME, sizeof(cap->card) - 1); 1341 - strlcpy(cap->bus_info, VPE_MODULE_NAME, sizeof(cap->bus_info)); 1342 - cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING; 1338 + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 1339 + VPE_MODULE_NAME); 1340 + cap->device_caps = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING; 1343 1341 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; 1344 1342 return 0; 1345 1343 } ··· 1480 1476 } 1481 1477 } 1482 1478 1479 + memset(pix->reserved, 0, sizeof(pix->reserved)); 1483 1480 for (i = 0; i < pix->num_planes; i++) { 1484 1481 plane_fmt = &pix->plane_fmt[i]; 1485 1482 depth = fmt->vpdma_fmt[i]->depth; ··· 1492 1487 1493 1488 plane_fmt->sizeimage = 1494 1489 (pix->height * pix->width * depth) >> 3; 1490 + 1491 + memset(plane_fmt->reserved, 0, sizeof(plane_fmt->reserved)); 1495 1492 } 1496 1493 1497 1494 return 0; ··· 1724 1717 q_data = get_q_data(ctx, vb->vb2_queue->type); 1725 1718 num_planes = q_data->fmt->coplanar ? 2 : 1; 1726 1719 1720 + if (vb->vb2_queue->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { 1721 + if (!(q_data->flags & Q_DATA_INTERLACED)) { 1722 + vb->v4l2_buf.field = V4L2_FIELD_NONE; 1723 + } else { 1724 + if (vb->v4l2_buf.field != V4L2_FIELD_TOP && 1725 + vb->v4l2_buf.field != V4L2_FIELD_BOTTOM) 1726 + return -EINVAL; 1727 + } 1728 + } 1729 + 1727 1730 for (i = 0; i < num_planes; i++) { 1728 1731 if (vb2_plane_size(vb, i) < q_data->sizeimage[i]) { 1729 1732 vpe_err(ctx->dev, ··· 1883 1866 s_q_data->fmt = &vpe_formats[2]; 1884 1867 s_q_data->width = 1920; 1885 1868 s_q_data->height = 1080; 1886 - s_q_data->sizeimage[VPE_LUMA] = (s_q_data->width * s_q_data->height * 1869 + s_q_data->bytesperline[VPE_LUMA] = (s_q_data->width * 1887 1870 s_q_data->fmt->vpdma_fmt[VPE_LUMA]->depth) >> 3; 1888 - s_q_data->colorspace = V4L2_COLORSPACE_SMPTE170M; 1871 + s_q_data->sizeimage[VPE_LUMA] = (s_q_data->bytesperline[VPE_LUMA] * 1872 + s_q_data->height); 1873 + s_q_data->colorspace = V4L2_COLORSPACE_REC709; 1889 1874 s_q_data->field = V4L2_FIELD_NONE; 1890 1875 s_q_data->c_rect.left = 0; 1891 1876 s_q_data->c_rect.top = 0; ··· 2021 2002 .fops = &vpe_fops, 2022 2003 .ioctl_ops = &vpe_ioctl_ops, 2023 2004 .minor = -1, 2024 - .release = video_device_release, 2005 + .release = video_device_release_empty, 2025 2006 .vfl_dir = VFL_DIR_M2M, 2026 2007 }; 2027 2008
+14 -1
drivers/media/rc/img-ir/img-ir-hw.c
··· 504 504 return ret; 505 505 } 506 506 507 + static int img_ir_set_normal_filter(struct rc_dev *dev, 508 + struct rc_scancode_filter *sc_filter) 509 + { 510 + return img_ir_set_filter(dev, RC_FILTER_NORMAL, sc_filter); 511 + } 512 + 513 + static int img_ir_set_wakeup_filter(struct rc_dev *dev, 514 + struct rc_scancode_filter *sc_filter) 515 + { 516 + return img_ir_set_filter(dev, RC_FILTER_WAKEUP, sc_filter); 517 + } 518 + 507 519 /** 508 520 * img_ir_set_decoder() - Set the current decoder. 509 521 * @priv: IR private data. ··· 998 986 rdev->map_name = RC_MAP_EMPTY; 999 987 rc_set_allowed_protocols(rdev, img_ir_allowed_protos(priv)); 1000 988 rdev->input_name = "IMG Infrared Decoder"; 1001 - rdev->s_filter = img_ir_set_filter; 989 + rdev->s_filter = img_ir_set_normal_filter; 990 + rdev->s_wakeup_filter = img_ir_set_wakeup_filter; 1002 991 1003 992 /* Register hardware decoder */ 1004 993 error = rc_register_device(rdev);
+15 -12
drivers/media/rc/img-ir/img-ir-nec.c
··· 5 5 */ 6 6 7 7 #include "img-ir-hw.h" 8 + #include <linux/bitrev.h> 8 9 9 10 /* Convert NEC data to a scancode */ 10 11 static int img_ir_nec_scancode(int len, u64 raw, int *scancode, u64 protocols) ··· 23 22 data_inv = (raw >> 24) & 0xff; 24 23 if ((data_inv ^ data) != 0xff) { 25 24 /* 32-bit NEC (used by Apple and TiVo remotes) */ 26 - /* scan encoding: aaAAddDD */ 27 - *scancode = addr_inv << 24 | 28 - addr << 16 | 29 - data_inv << 8 | 30 - data; 25 + /* scan encoding: as transmitted, MSBit = first received bit */ 26 + *scancode = bitrev8(addr) << 24 | 27 + bitrev8(addr_inv) << 16 | 28 + bitrev8(data) << 8 | 29 + bitrev8(data_inv); 31 30 } else if ((addr_inv ^ addr) != 0xff) { 32 31 /* Extended NEC */ 33 32 /* scan encoding: AAaaDD */ ··· 55 54 56 55 if ((in->data | in->mask) & 0xff000000) { 57 56 /* 32-bit NEC (used by Apple and TiVo remotes) */ 58 - /* scan encoding: aaAAddDD */ 59 - addr_inv = (in->data >> 24) & 0xff; 60 - addr_inv_m = (in->mask >> 24) & 0xff; 61 - addr = (in->data >> 16) & 0xff; 62 - addr_m = (in->mask >> 16) & 0xff; 63 - data_inv = (in->data >> 8) & 0xff; 64 - data_inv_m = (in->mask >> 8) & 0xff; 57 + /* scan encoding: as transmitted, MSBit = first received bit */ 58 + addr = bitrev8(in->data >> 24); 59 + addr_m = bitrev8(in->mask >> 24); 60 + addr_inv = bitrev8(in->data >> 16); 61 + addr_inv_m = bitrev8(in->mask >> 16); 62 + data = bitrev8(in->data >> 8); 63 + data_m = bitrev8(in->mask >> 8); 64 + data_inv = bitrev8(in->data >> 0); 65 + data_inv_m = bitrev8(in->mask >> 0); 65 66 } else if ((in->data | in->mask) & 0x00ff0000) { 66 67 /* Extended NEC */ 67 68 /* scan encoding AAaaDD */
+1 -4
drivers/media/rc/ir-nec-decoder.c
··· 172 172 if (send_32bits) { 173 173 /* NEC transport, but modified protocol, used by at 174 174 * least Apple and TiVo remotes */ 175 - scancode = not_address << 24 | 176 - address << 16 | 177 - not_command << 8 | 178 - command; 175 + scancode = data->bits; 179 176 IR_dprintk(1, "NEC (modified) scancode 0x%08x\n", scancode); 180 177 } else if ((address ^ not_address) != 0xff) { 181 178 /* Extended NEC */
+43 -43
drivers/media/rc/keymaps/rc-tivo.c
··· 15 15 * Initial mapping is for the TiVo remote included in the Nero LiquidTV bundle, 16 16 * which also ships with a TiVo-branded IR transceiver, supported by the mceusb 17 17 * driver. Note that the remote uses an NEC-ish protocol, but instead of having 18 - * a command/not_command pair, it has a vendor ID of 0x3085, but some keys, the 18 + * a command/not_command pair, it has a vendor ID of 0xa10c, but some keys, the 19 19 * NEC extended checksums do pass, so the table presently has the intended 20 20 * values and the checksum-passed versions for those keys. 21 21 */ 22 22 static struct rc_map_table tivo[] = { 23 - { 0x3085f009, KEY_MEDIA }, /* TiVo Button */ 24 - { 0x3085e010, KEY_POWER2 }, /* TV Power */ 25 - { 0x3085e011, KEY_TV }, /* Live TV/Swap */ 26 - { 0x3085c034, KEY_VIDEO_NEXT }, /* TV Input */ 27 - { 0x3085e013, KEY_INFO }, 28 - { 0x3085a05f, KEY_CYCLEWINDOWS }, /* Window */ 23 + { 0xa10c900f, KEY_MEDIA }, /* TiVo Button */ 24 + { 0xa10c0807, KEY_POWER2 }, /* TV Power */ 25 + { 0xa10c8807, KEY_TV }, /* Live TV/Swap */ 26 + { 0xa10c2c03, KEY_VIDEO_NEXT }, /* TV Input */ 27 + { 0xa10cc807, KEY_INFO }, 28 + { 0xa10cfa05, KEY_CYCLEWINDOWS }, /* Window */ 29 29 { 0x0085305f, KEY_CYCLEWINDOWS }, 30 - { 0x3085c036, KEY_EPG }, /* Guide */ 30 + { 0xa10c6c03, KEY_EPG }, /* Guide */ 31 31 32 - { 0x3085e014, KEY_UP }, 33 - { 0x3085e016, KEY_DOWN }, 34 - { 0x3085e017, KEY_LEFT }, 35 - { 0x3085e015, KEY_RIGHT }, 32 + { 0xa10c2807, KEY_UP }, 33 + { 0xa10c6807, KEY_DOWN }, 34 + { 0xa10ce807, KEY_LEFT }, 35 + { 0xa10ca807, KEY_RIGHT }, 36 36 37 - { 0x3085e018, KEY_SCROLLDOWN }, /* Red Thumbs Down */ 38 - { 0x3085e019, KEY_SELECT }, 39 - { 0x3085e01a, KEY_SCROLLUP }, /* Green Thumbs Up */ 37 + { 0xa10c1807, KEY_SCROLLDOWN }, /* Red Thumbs Down */ 38 + { 0xa10c9807, KEY_SELECT }, 39 + { 0xa10c5807, KEY_SCROLLUP }, /* Green Thumbs Up */ 40 40 41 - { 0x3085e01c, KEY_VOLUMEUP }, 42 - { 0x3085e01d, KEY_VOLUMEDOWN }, 43 - { 0x3085e01b, KEY_MUTE }, 44 - { 0x3085d020, KEY_RECORD }, 45 - { 0x3085e01e, KEY_CHANNELUP }, 46 - { 0x3085e01f, KEY_CHANNELDOWN }, 41 + { 0xa10c3807, KEY_VOLUMEUP }, 42 + { 0xa10cb807, KEY_VOLUMEDOWN }, 43 + { 0xa10cd807, KEY_MUTE }, 44 + { 0xa10c040b, KEY_RECORD }, 45 + { 0xa10c7807, KEY_CHANNELUP }, 46 + { 0xa10cf807, KEY_CHANNELDOWN }, 47 47 { 0x0085301f, KEY_CHANNELDOWN }, 48 48 49 - { 0x3085d021, KEY_PLAY }, 50 - { 0x3085d023, KEY_PAUSE }, 51 - { 0x3085d025, KEY_SLOW }, 52 - { 0x3085d022, KEY_REWIND }, 53 - { 0x3085d024, KEY_FASTFORWARD }, 54 - { 0x3085d026, KEY_PREVIOUS }, 55 - { 0x3085d027, KEY_NEXT }, /* ->| */ 49 + { 0xa10c840b, KEY_PLAY }, 50 + { 0xa10cc40b, KEY_PAUSE }, 51 + { 0xa10ca40b, KEY_SLOW }, 52 + { 0xa10c440b, KEY_REWIND }, 53 + { 0xa10c240b, KEY_FASTFORWARD }, 54 + { 0xa10c640b, KEY_PREVIOUS }, 55 + { 0xa10ce40b, KEY_NEXT }, /* ->| */ 56 56 57 - { 0x3085b044, KEY_ZOOM }, /* Aspect */ 58 - { 0x3085b048, KEY_STOP }, 59 - { 0x3085b04a, KEY_DVD }, /* DVD Menu */ 57 + { 0xa10c220d, KEY_ZOOM }, /* Aspect */ 58 + { 0xa10c120d, KEY_STOP }, 59 + { 0xa10c520d, KEY_DVD }, /* DVD Menu */ 60 60 61 - { 0x3085d028, KEY_NUMERIC_1 }, 62 - { 0x3085d029, KEY_NUMERIC_2 }, 63 - { 0x3085d02a, KEY_NUMERIC_3 }, 64 - { 0x3085d02b, KEY_NUMERIC_4 }, 65 - { 0x3085d02c, KEY_NUMERIC_5 }, 66 - { 0x3085d02d, KEY_NUMERIC_6 }, 67 - { 0x3085d02e, KEY_NUMERIC_7 }, 68 - { 0x3085d02f, KEY_NUMERIC_8 }, 61 + { 0xa10c140b, KEY_NUMERIC_1 }, 62 + { 0xa10c940b, KEY_NUMERIC_2 }, 63 + { 0xa10c540b, KEY_NUMERIC_3 }, 64 + { 0xa10cd40b, KEY_NUMERIC_4 }, 65 + { 0xa10c340b, KEY_NUMERIC_5 }, 66 + { 0xa10cb40b, KEY_NUMERIC_6 }, 67 + { 0xa10c740b, KEY_NUMERIC_7 }, 68 + { 0xa10cf40b, KEY_NUMERIC_8 }, 69 69 { 0x0085302f, KEY_NUMERIC_8 }, 70 - { 0x3085c030, KEY_NUMERIC_9 }, 71 - { 0x3085c031, KEY_NUMERIC_0 }, 72 - { 0x3085c033, KEY_ENTER }, 73 - { 0x3085c032, KEY_CLEAR }, 70 + { 0xa10c0c03, KEY_NUMERIC_9 }, 71 + { 0xa10c8c03, KEY_NUMERIC_0 }, 72 + { 0xa10ccc03, KEY_ENTER }, 73 + { 0xa10c4c03, KEY_CLEAR }, 74 74 }; 75 75 76 76 static struct rc_map_list tivo_map = {
+63 -35
drivers/media/rc/rc-main.c
··· 633 633 static void ir_do_keydown(struct rc_dev *dev, int scancode, 634 634 u32 keycode, u8 toggle) 635 635 { 636 - struct rc_scancode_filter *filter; 637 - bool new_event = !dev->keypressed || 638 - dev->last_scancode != scancode || 639 - dev->last_toggle != toggle; 636 + bool new_event = (!dev->keypressed || 637 + dev->last_scancode != scancode || 638 + dev->last_toggle != toggle); 640 639 641 640 if (new_event && dev->keypressed) 642 641 ir_do_keyup(dev, false); 643 - 644 - /* Generic scancode filtering */ 645 - filter = &dev->scancode_filters[RC_FILTER_NORMAL]; 646 - if (filter->mask && ((scancode ^ filter->data) & filter->mask)) 647 - return; 648 642 649 643 input_event(dev->input_dev, EV_MSC, MSC_SCAN, scancode); 650 644 ··· 917 923 int rc, i, count = 0; 918 924 ssize_t ret; 919 925 int (*change_protocol)(struct rc_dev *dev, u64 *rc_type); 926 + int (*set_filter)(struct rc_dev *dev, struct rc_scancode_filter *filter); 920 927 struct rc_scancode_filter local_filter, *filter; 921 928 922 929 /* Device is being removed */ ··· 1002 1007 * Fall back to clearing the filter. 1003 1008 */ 1004 1009 filter = &dev->scancode_filters[fattr->type]; 1005 - if (old_type != type && filter->mask) { 1010 + set_filter = (fattr->type == RC_FILTER_NORMAL) 1011 + ? dev->s_filter : dev->s_wakeup_filter; 1012 + 1013 + if (set_filter && old_type != type && filter->mask) { 1006 1014 local_filter = *filter; 1007 1015 if (!type) { 1008 1016 /* no protocol => clear filter */ 1009 1017 ret = -1; 1010 - } else if (!dev->s_filter) { 1011 - /* generic filtering => accept any filter */ 1012 - ret = 0; 1013 1018 } else { 1014 1019 /* hardware filtering => try setting, otherwise clear */ 1015 - ret = dev->s_filter(dev, fattr->type, &local_filter); 1020 + ret = set_filter(dev, &local_filter); 1016 1021 } 1017 1022 if (ret < 0) { 1018 1023 /* clear the filter */ 1019 1024 local_filter.data = 0; 1020 1025 local_filter.mask = 0; 1021 - if (dev->s_filter) 1022 - dev->s_filter(dev, fattr->type, &local_filter); 1026 + set_filter(dev, &local_filter); 1023 1027 } 1024 1028 1025 1029 /* commit the new filter */ ··· 1062 1068 return -EINVAL; 1063 1069 1064 1070 mutex_lock(&dev->lock); 1065 - if (fattr->mask) 1071 + if ((fattr->type == RC_FILTER_NORMAL && !dev->s_filter) || 1072 + (fattr->type == RC_FILTER_WAKEUP && !dev->s_wakeup_filter)) 1073 + val = 0; 1074 + else if (fattr->mask) 1066 1075 val = dev->scancode_filters[fattr->type].mask; 1067 1076 else 1068 1077 val = dev->scancode_filters[fattr->type].data; ··· 1103 1106 struct rc_scancode_filter local_filter, *filter; 1104 1107 int ret; 1105 1108 unsigned long val; 1109 + int (*set_filter)(struct rc_dev *dev, struct rc_scancode_filter *filter); 1106 1110 1107 1111 /* Device is being removed */ 1108 1112 if (!dev) ··· 1113 1115 if (ret < 0) 1114 1116 return ret; 1115 1117 1116 - /* Scancode filter not supported (but still accept 0) */ 1117 - if (!dev->s_filter && fattr->type != RC_FILTER_NORMAL) 1118 - return val ? -EINVAL : count; 1118 + /* Can the scancode filter be set? */ 1119 + set_filter = (fattr->type == RC_FILTER_NORMAL) ? dev->s_filter : 1120 + dev->s_wakeup_filter; 1121 + if (!set_filter) 1122 + return -EINVAL; 1119 1123 1120 1124 mutex_lock(&dev->lock); 1121 1125 ··· 1128 1128 local_filter.mask = val; 1129 1129 else 1130 1130 local_filter.data = val; 1131 + 1131 1132 if (!dev->enabled_protocols[fattr->type] && local_filter.mask) { 1132 1133 /* refuse to set a filter unless a protocol is enabled */ 1133 1134 ret = -EINVAL; 1134 1135 goto unlock; 1135 1136 } 1136 - if (dev->s_filter) { 1137 - ret = dev->s_filter(dev, fattr->type, &local_filter); 1138 - if (ret < 0) 1139 - goto unlock; 1140 - } 1137 + 1138 + ret = set_filter(dev, &local_filter); 1139 + if (ret < 0) 1140 + goto unlock; 1141 1141 1142 1142 /* Success, commit the new filter */ 1143 1143 *filter = local_filter; ··· 1189 1189 static RC_FILTER_ATTR(wakeup_filter_mask, S_IRUGO|S_IWUSR, 1190 1190 show_filter, store_filter, RC_FILTER_WAKEUP, true); 1191 1191 1192 - static struct attribute *rc_dev_attrs[] = { 1192 + static struct attribute *rc_dev_protocol_attrs[] = { 1193 1193 &dev_attr_protocols.attr.attr, 1194 + NULL, 1195 + }; 1196 + 1197 + static struct attribute_group rc_dev_protocol_attr_grp = { 1198 + .attrs = rc_dev_protocol_attrs, 1199 + }; 1200 + 1201 + static struct attribute *rc_dev_wakeup_protocol_attrs[] = { 1194 1202 &dev_attr_wakeup_protocols.attr.attr, 1203 + NULL, 1204 + }; 1205 + 1206 + static struct attribute_group rc_dev_wakeup_protocol_attr_grp = { 1207 + .attrs = rc_dev_wakeup_protocol_attrs, 1208 + }; 1209 + 1210 + static struct attribute *rc_dev_filter_attrs[] = { 1195 1211 &dev_attr_filter.attr.attr, 1196 1212 &dev_attr_filter_mask.attr.attr, 1213 + NULL, 1214 + }; 1215 + 1216 + static struct attribute_group rc_dev_filter_attr_grp = { 1217 + .attrs = rc_dev_filter_attrs, 1218 + }; 1219 + 1220 + static struct attribute *rc_dev_wakeup_filter_attrs[] = { 1197 1221 &dev_attr_wakeup_filter.attr.attr, 1198 1222 &dev_attr_wakeup_filter_mask.attr.attr, 1199 1223 NULL, 1200 1224 }; 1201 1225 1202 - static struct attribute_group rc_dev_attr_grp = { 1203 - .attrs = rc_dev_attrs, 1204 - }; 1205 - 1206 - static const struct attribute_group *rc_dev_attr_groups[] = { 1207 - &rc_dev_attr_grp, 1208 - NULL 1226 + static struct attribute_group rc_dev_wakeup_filter_attr_grp = { 1227 + .attrs = rc_dev_wakeup_filter_attrs, 1209 1228 }; 1210 1229 1211 1230 static struct device_type rc_dev_type = { 1212 - .groups = rc_dev_attr_groups, 1213 1231 .release = rc_dev_release, 1214 1232 .uevent = rc_dev_uevent, 1215 1233 }; ··· 1284 1266 static bool raw_init = false; /* raw decoders loaded? */ 1285 1267 struct rc_map *rc_map; 1286 1268 const char *path; 1287 - int rc, devno; 1269 + int rc, devno, attr = 0; 1288 1270 1289 1271 if (!dev || !dev->map_name) 1290 1272 return -EINVAL; ··· 1311 1293 if (devno >= IRRCV_NUM_DEVICES) 1312 1294 return -ENOMEM; 1313 1295 } while (test_and_set_bit(devno, ir_core_dev_number)); 1296 + 1297 + dev->dev.groups = dev->sysfs_groups; 1298 + dev->sysfs_groups[attr++] = &rc_dev_protocol_attr_grp; 1299 + if (dev->s_filter) 1300 + dev->sysfs_groups[attr++] = &rc_dev_filter_attr_grp; 1301 + if (dev->s_wakeup_filter) 1302 + dev->sysfs_groups[attr++] = &rc_dev_wakeup_filter_attr_grp; 1303 + if (dev->change_wakeup_protocol) 1304 + dev->sysfs_groups[attr++] = &rc_dev_wakeup_protocol_attr_grp; 1305 + dev->sysfs_groups[attr++] = NULL; 1314 1306 1315 1307 /* 1316 1308 * Take the lock here, as the device sysfs node will appear
+2 -1
drivers/media/tuners/r820t.c
··· 1468 1468 static int r820t_multi_read(struct r820t_priv *priv) 1469 1469 { 1470 1470 int rc, i; 1471 - u8 data[2], min = 0, max = 255, sum = 0; 1471 + u16 sum = 0; 1472 + u8 data[2], min = 255, max = 0; 1472 1473 1473 1474 usleep_range(5000, 6000); 1474 1475
+1
drivers/media/tuners/tuner-xc2028.c
··· 1107 1107 offset += 200000; 1108 1108 } 1109 1109 #endif 1110 + break; 1110 1111 default: 1111 1112 tuner_err("Unsupported tuner type %d.\n", new_type); 1112 1113 break;
-2
drivers/media/usb/dvb-usb-v2/rtl28xxu.c
··· 1503 1503 /* RTL2832P devices: */ 1504 1504 { DVB_USB_DEVICE(USB_VID_HANFTEK, 0x0131, 1505 1505 &rtl2832u_props, "Astrometa DVB-T2", NULL) }, 1506 - { DVB_USB_DEVICE(USB_VID_KYE, 0x707f, 1507 - &rtl2832u_props, "Genius TVGo DVB-T03", NULL) }, 1508 1506 { } 1509 1507 }; 1510 1508 MODULE_DEVICE_TABLE(usb, rtl28xxu_id_table);
+3 -1
drivers/media/usb/gspca/jpeg.h
··· 154 154 { 155 155 int i, sc; 156 156 157 - if (quality < 50) 157 + if (quality <= 0) 158 + sc = 5000; 159 + else if (quality < 50) 158 160 sc = 5000 / quality; 159 161 else 160 162 sc = 200 - quality * 2;
+1 -1
drivers/media/usb/stk1160/stk1160-ac97.c
··· 108 108 "stk1160-mixer"); 109 109 snprintf(card->longname, sizeof(card->longname), 110 110 "stk1160 ac97 codec mixer control"); 111 - strncpy(card->driver, dev->dev->driver->name, sizeof(card->driver)); 111 + strlcpy(card->driver, dev->dev->driver->name, sizeof(card->driver)); 112 112 113 113 rc = snd_ac97_bus(card, 0, &stk1160_ac97_ops, NULL, &ac97_bus); 114 114 if (rc)
+1 -1
drivers/staging/media/msi3101/msi001.c
··· 201 201 dev_dbg(&s->spi->dev, "%s: bandwidth selected=%d\n", 202 202 __func__, bandwidth_lut[i].freq); 203 203 204 - f_vco = (f_rf + f_if + f_if1) * lo_div; 204 + f_vco = (u64) (f_rf + f_if + f_if1) * lo_div; 205 205 tmp64 = f_vco; 206 206 m = do_div(tmp64, F_REF * R_REF); 207 207 n = (unsigned int) tmp64;
+10 -5
drivers/staging/media/msi3101/sdr-msi3101.c
··· 913 913 914 914 /* set tuner, subdev, filters according to sampling rate */ 915 915 bandwidth_auto = v4l2_ctrl_find(&s->hdl, V4L2_CID_RF_TUNER_BANDWIDTH_AUTO); 916 - bandwidth = v4l2_ctrl_find(&s->hdl, V4L2_CID_RF_TUNER_BANDWIDTH); 917 916 if (v4l2_ctrl_g_ctrl(bandwidth_auto)) { 918 917 bandwidth = v4l2_ctrl_find(&s->hdl, V4L2_CID_RF_TUNER_BANDWIDTH); 919 918 v4l2_ctrl_s_ctrl(bandwidth, s->f_adc); ··· 1077 1078 static int msi3101_stop_streaming(struct vb2_queue *vq) 1078 1079 { 1079 1080 struct msi3101_state *s = vb2_get_drv_priv(vq); 1081 + int ret; 1080 1082 dev_dbg(&s->udev->dev, "%s:\n", __func__); 1081 1083 1082 1084 if (mutex_lock_interruptible(&s->v4l2_lock)) ··· 1090 1090 1091 1091 /* according to tests, at least 700us delay is required */ 1092 1092 msleep(20); 1093 - msi3101_ctrl_msg(s, CMD_STOP_STREAMING, 0); 1093 + ret = msi3101_ctrl_msg(s, CMD_STOP_STREAMING, 0); 1094 + if (ret) 1095 + goto err_sleep_tuner; 1094 1096 1095 1097 /* sleep USB IF / ADC */ 1096 - msi3101_ctrl_msg(s, CMD_WREG, 0x01000003); 1098 + ret = msi3101_ctrl_msg(s, CMD_WREG, 0x01000003); 1099 + if (ret) 1100 + goto err_sleep_tuner; 1097 1101 1102 + err_sleep_tuner: 1098 1103 /* sleep tuner */ 1099 - v4l2_subdev_call(s->v4l2_subdev, core, s_power, 0); 1104 + ret = v4l2_subdev_call(s->v4l2_subdev, core, s_power, 0); 1100 1105 1101 1106 mutex_unlock(&s->v4l2_lock); 1102 1107 1103 - return 0; 1108 + return ret; 1104 1109 } 1105 1110 1106 1111 static struct vb2_ops msi3101_vb2_ops = {
+6 -2
include/media/rc-core.h
··· 60 60 /** 61 61 * struct rc_dev - represents a remote control device 62 62 * @dev: driver model's view of this device 63 + * @sysfs_groups: sysfs attribute groups 63 64 * @input_name: name of the input child device 64 65 * @input_phys: physical path to the input child device 65 66 * @input_id: id of the input child device (struct input_id) ··· 113 112 * device doesn't interrupt host until it sees IR pulses 114 113 * @s_learning_mode: enable wide band receiver used for learning 115 114 * @s_carrier_report: enable carrier reports 116 - * @s_filter: set the scancode filter of a given type 115 + * @s_filter: set the scancode filter 116 + * @s_wakeup_filter: set the wakeup scancode filter 117 117 */ 118 118 struct rc_dev { 119 119 struct device dev; 120 + const struct attribute_group *sysfs_groups[5]; 120 121 const char *input_name; 121 122 const char *input_phys; 122 123 struct input_id input_id; ··· 162 159 int (*s_learning_mode)(struct rc_dev *dev, int enable); 163 160 int (*s_carrier_report) (struct rc_dev *dev, int enable); 164 161 int (*s_filter)(struct rc_dev *dev, 165 - enum rc_filter_type type, 166 162 struct rc_scancode_filter *filter); 163 + int (*s_wakeup_filter)(struct rc_dev *dev, 164 + struct rc_scancode_filter *filter); 167 165 }; 168 166 169 167 #define to_rc_dev(d) container_of(d, struct rc_dev, dev)
+2
include/uapi/linux/v4l2-common.h
··· 29 29 #ifndef __V4L2_COMMON__ 30 30 #define __V4L2_COMMON__ 31 31 32 + #include <linux/types.h> 33 + 32 34 /* 33 35 * 34 36 * Selection interface definitions