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