Skip to content

Commit

Permalink
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/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
  ...
  • Loading branch information
Linus Torvalds committed Apr 12, 2014
2 parents 07f5fef + 32654fb commit 9309444
Showing 18 changed files with 200 additions and 126 deletions.
2 changes: 1 addition & 1 deletion drivers/media/dvb-frontends/drx39xyj/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config DVB_DRX39XYJ
tristate "Micronas DRX-J demodulator"
depends on DVB_CORE && I2C
default m if DVB_FE_CUSTOMISE
default m if !MEDIA_SUBDRV_AUTOSELECT
help
An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want
to support this frontend.
1 change: 1 addition & 0 deletions drivers/media/dvb-frontends/lgdt3305.c
Original file line number Diff line number Diff line change
@@ -1176,6 +1176,7 @@ static struct dvb_frontend_ops lgdt3304_ops = {
},
.i2c_gate_ctrl = lgdt3305_i2c_gate_ctrl,
.init = lgdt3305_init,
.sleep = lgdt3305_sleep,
.set_frontend = lgdt3304_set_parameters,
.get_frontend = lgdt3305_get_frontend,
.get_tune_settings = lgdt3305_get_tune_settings,
8 changes: 4 additions & 4 deletions drivers/media/dvb-frontends/m88rs2000.c
Original file line number Diff line number Diff line change
@@ -297,7 +297,7 @@ struct inittab {
u8 val;
};

struct inittab m88rs2000_setup[] = {
static struct inittab m88rs2000_setup[] = {
{DEMOD_WRITE, 0x9a, 0x30},
{DEMOD_WRITE, 0x00, 0x01},
{WRITE_DELAY, 0x19, 0x00},
@@ -315,7 +315,7 @@ struct inittab m88rs2000_setup[] = {
{0xff, 0xaa, 0xff}
};

struct inittab m88rs2000_shutdown[] = {
static struct inittab m88rs2000_shutdown[] = {
{DEMOD_WRITE, 0x9a, 0x30},
{DEMOD_WRITE, 0xb0, 0x00},
{DEMOD_WRITE, 0xf1, 0x89},
@@ -325,7 +325,7 @@ struct inittab m88rs2000_shutdown[] = {
{0xff, 0xaa, 0xff}
};

struct inittab fe_reset[] = {
static struct inittab fe_reset[] = {
{DEMOD_WRITE, 0x00, 0x01},
{DEMOD_WRITE, 0x20, 0x81},
{DEMOD_WRITE, 0x21, 0x80},
@@ -363,7 +363,7 @@ struct inittab fe_reset[] = {
{0xff, 0xaa, 0xff}
};

struct inittab fe_trigger[] = {
static struct inittab fe_trigger[] = {
{DEMOD_WRITE, 0x97, 0x04},
{DEMOD_WRITE, 0x99, 0x77},
{DEMOD_WRITE, 0x9b, 0x64},
45 changes: 32 additions & 13 deletions drivers/media/platform/ti-vpe/vpe.c
Original file line number Diff line number Diff line change
@@ -49,8 +49,8 @@
#define VPE_MODULE_NAME "vpe"

/* minimum and maximum frame sizes */
#define MIN_W 128
#define MIN_H 128
#define MIN_W 32
#define MIN_H 32
#define MAX_W 1920
#define MAX_H 1080

@@ -887,6 +887,9 @@ static int job_ready(void *priv)
if (v4l2_m2m_num_src_bufs_ready(ctx->m2m_ctx) < needed)
return 0;

if (v4l2_m2m_num_dst_bufs_ready(ctx->m2m_ctx) < needed)
return 0;

return 1;
}

@@ -1277,18 +1280,17 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data)
s_buf = &s_vb->v4l2_buf;
d_buf = &d_vb->v4l2_buf;

d_buf->flags = s_buf->flags;

d_buf->timestamp = s_buf->timestamp;
d_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
d_buf->flags |= s_buf->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
if (s_buf->flags & V4L2_BUF_FLAG_TIMECODE) {
d_buf->flags |= V4L2_BUF_FLAG_TIMECODE;
if (s_buf->flags & V4L2_BUF_FLAG_TIMECODE)
d_buf->timecode = s_buf->timecode;
}

d_buf->sequence = ctx->sequence;
d_buf->field = ctx->field;

d_q_data = &ctx->q_data[Q_DATA_DST];
if (d_q_data->flags & Q_DATA_INTERLACED) {
d_buf->field = ctx->field;
if (ctx->field == V4L2_FIELD_BOTTOM) {
ctx->sequence++;
ctx->field = V4L2_FIELD_TOP;
@@ -1297,6 +1299,7 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data)
ctx->field = V4L2_FIELD_BOTTOM;
}
} else {
d_buf->field = V4L2_FIELD_NONE;
ctx->sequence++;
}

@@ -1335,8 +1338,9 @@ static int vpe_querycap(struct file *file, void *priv,
{
strncpy(cap->driver, VPE_MODULE_NAME, sizeof(cap->driver) - 1);
strncpy(cap->card, VPE_MODULE_NAME, sizeof(cap->card) - 1);
strlcpy(cap->bus_info, VPE_MODULE_NAME, sizeof(cap->bus_info));
cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
VPE_MODULE_NAME);
cap->device_caps = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING;
cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
}
@@ -1476,6 +1480,7 @@ static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f,
}
}

memset(pix->reserved, 0, sizeof(pix->reserved));
for (i = 0; i < pix->num_planes; i++) {
plane_fmt = &pix->plane_fmt[i];
depth = fmt->vpdma_fmt[i]->depth;
@@ -1487,6 +1492,8 @@ static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f,

plane_fmt->sizeimage =
(pix->height * pix->width * depth) >> 3;

memset(plane_fmt->reserved, 0, sizeof(plane_fmt->reserved));
}

return 0;
@@ -1717,6 +1724,16 @@ static int vpe_buf_prepare(struct vb2_buffer *vb)
q_data = get_q_data(ctx, vb->vb2_queue->type);
num_planes = q_data->fmt->coplanar ? 2 : 1;

if (vb->vb2_queue->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
if (!(q_data->flags & Q_DATA_INTERLACED)) {
vb->v4l2_buf.field = V4L2_FIELD_NONE;
} else {
if (vb->v4l2_buf.field != V4L2_FIELD_TOP &&
vb->v4l2_buf.field != V4L2_FIELD_BOTTOM)
return -EINVAL;
}
}

for (i = 0; i < num_planes; i++) {
if (vb2_plane_size(vb, i) < q_data->sizeimage[i]) {
vpe_err(ctx->dev,
@@ -1866,9 +1883,11 @@ static int vpe_open(struct file *file)
s_q_data->fmt = &vpe_formats[2];
s_q_data->width = 1920;
s_q_data->height = 1080;
s_q_data->sizeimage[VPE_LUMA] = (s_q_data->width * s_q_data->height *
s_q_data->bytesperline[VPE_LUMA] = (s_q_data->width *
s_q_data->fmt->vpdma_fmt[VPE_LUMA]->depth) >> 3;
s_q_data->colorspace = V4L2_COLORSPACE_SMPTE170M;
s_q_data->sizeimage[VPE_LUMA] = (s_q_data->bytesperline[VPE_LUMA] *
s_q_data->height);
s_q_data->colorspace = V4L2_COLORSPACE_REC709;
s_q_data->field = V4L2_FIELD_NONE;
s_q_data->c_rect.left = 0;
s_q_data->c_rect.top = 0;
@@ -2002,7 +2021,7 @@ static struct video_device vpe_videodev = {
.fops = &vpe_fops,
.ioctl_ops = &vpe_ioctl_ops,
.minor = -1,
.release = video_device_release,
.release = video_device_release_empty,
.vfl_dir = VFL_DIR_M2M,
};

15 changes: 14 additions & 1 deletion drivers/media/rc/img-ir/img-ir-hw.c
Original file line number Diff line number Diff line change
@@ -504,6 +504,18 @@ static int img_ir_set_filter(struct rc_dev *dev, enum rc_filter_type type,
return ret;
}

static int img_ir_set_normal_filter(struct rc_dev *dev,
struct rc_scancode_filter *sc_filter)
{
return img_ir_set_filter(dev, RC_FILTER_NORMAL, sc_filter);
}

static int img_ir_set_wakeup_filter(struct rc_dev *dev,
struct rc_scancode_filter *sc_filter)
{
return img_ir_set_filter(dev, RC_FILTER_WAKEUP, sc_filter);
}

/**
* img_ir_set_decoder() - Set the current decoder.
* @priv: IR private data.
@@ -986,7 +998,8 @@ int img_ir_probe_hw(struct img_ir_priv *priv)
rdev->map_name = RC_MAP_EMPTY;
rc_set_allowed_protocols(rdev, img_ir_allowed_protos(priv));
rdev->input_name = "IMG Infrared Decoder";
rdev->s_filter = img_ir_set_filter;
rdev->s_filter = img_ir_set_normal_filter;
rdev->s_wakeup_filter = img_ir_set_wakeup_filter;

/* Register hardware decoder */
error = rc_register_device(rdev);
27 changes: 15 additions & 12 deletions drivers/media/rc/img-ir/img-ir-nec.c
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
*/

#include "img-ir-hw.h"
#include <linux/bitrev.h>

/* Convert NEC data to a scancode */
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)
data_inv = (raw >> 24) & 0xff;
if ((data_inv ^ data) != 0xff) {
/* 32-bit NEC (used by Apple and TiVo remotes) */
/* scan encoding: aaAAddDD */
*scancode = addr_inv << 24 |
addr << 16 |
data_inv << 8 |
data;
/* scan encoding: as transmitted, MSBit = first received bit */
*scancode = bitrev8(addr) << 24 |
bitrev8(addr_inv) << 16 |
bitrev8(data) << 8 |
bitrev8(data_inv);
} else if ((addr_inv ^ addr) != 0xff) {
/* Extended NEC */
/* scan encoding: AAaaDD */
@@ -54,13 +55,15 @@ static int img_ir_nec_filter(const struct rc_scancode_filter *in,

if ((in->data | in->mask) & 0xff000000) {
/* 32-bit NEC (used by Apple and TiVo remotes) */
/* scan encoding: aaAAddDD */
addr_inv = (in->data >> 24) & 0xff;
addr_inv_m = (in->mask >> 24) & 0xff;
addr = (in->data >> 16) & 0xff;
addr_m = (in->mask >> 16) & 0xff;
data_inv = (in->data >> 8) & 0xff;
data_inv_m = (in->mask >> 8) & 0xff;
/* scan encoding: as transmitted, MSBit = first received bit */
addr = bitrev8(in->data >> 24);
addr_m = bitrev8(in->mask >> 24);
addr_inv = bitrev8(in->data >> 16);
addr_inv_m = bitrev8(in->mask >> 16);
data = bitrev8(in->data >> 8);
data_m = bitrev8(in->mask >> 8);
data_inv = bitrev8(in->data >> 0);
data_inv_m = bitrev8(in->mask >> 0);
} else if ((in->data | in->mask) & 0x00ff0000) {
/* Extended NEC */
/* scan encoding AAaaDD */
5 changes: 1 addition & 4 deletions drivers/media/rc/ir-nec-decoder.c
Original file line number Diff line number Diff line change
@@ -172,10 +172,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
if (send_32bits) {
/* NEC transport, but modified protocol, used by at
* least Apple and TiVo remotes */
scancode = not_address << 24 |
address << 16 |
not_command << 8 |
command;
scancode = data->bits;
IR_dprintk(1, "NEC (modified) scancode 0x%08x\n", scancode);
} else if ((address ^ not_address) != 0xff) {
/* Extended NEC */
86 changes: 43 additions & 43 deletions drivers/media/rc/keymaps/rc-tivo.c
Original file line number Diff line number Diff line change
@@ -15,62 +15,62 @@
* Initial mapping is for the TiVo remote included in the Nero LiquidTV bundle,
* which also ships with a TiVo-branded IR transceiver, supported by the mceusb
* driver. Note that the remote uses an NEC-ish protocol, but instead of having
* a command/not_command pair, it has a vendor ID of 0x3085, but some keys, the
* a command/not_command pair, it has a vendor ID of 0xa10c, but some keys, the
* NEC extended checksums do pass, so the table presently has the intended
* values and the checksum-passed versions for those keys.
*/
static struct rc_map_table tivo[] = {
{ 0x3085f009, KEY_MEDIA }, /* TiVo Button */
{ 0x3085e010, KEY_POWER2 }, /* TV Power */
{ 0x3085e011, KEY_TV }, /* Live TV/Swap */
{ 0x3085c034, KEY_VIDEO_NEXT }, /* TV Input */
{ 0x3085e013, KEY_INFO },
{ 0x3085a05f, KEY_CYCLEWINDOWS }, /* Window */
{ 0xa10c900f, KEY_MEDIA }, /* TiVo Button */
{ 0xa10c0807, KEY_POWER2 }, /* TV Power */
{ 0xa10c8807, KEY_TV }, /* Live TV/Swap */
{ 0xa10c2c03, KEY_VIDEO_NEXT }, /* TV Input */
{ 0xa10cc807, KEY_INFO },
{ 0xa10cfa05, KEY_CYCLEWINDOWS }, /* Window */
{ 0x0085305f, KEY_CYCLEWINDOWS },
{ 0x3085c036, KEY_EPG }, /* Guide */
{ 0xa10c6c03, KEY_EPG }, /* Guide */

{ 0x3085e014, KEY_UP },
{ 0x3085e016, KEY_DOWN },
{ 0x3085e017, KEY_LEFT },
{ 0x3085e015, KEY_RIGHT },
{ 0xa10c2807, KEY_UP },
{ 0xa10c6807, KEY_DOWN },
{ 0xa10ce807, KEY_LEFT },
{ 0xa10ca807, KEY_RIGHT },

{ 0x3085e018, KEY_SCROLLDOWN }, /* Red Thumbs Down */
{ 0x3085e019, KEY_SELECT },
{ 0x3085e01a, KEY_SCROLLUP }, /* Green Thumbs Up */
{ 0xa10c1807, KEY_SCROLLDOWN }, /* Red Thumbs Down */
{ 0xa10c9807, KEY_SELECT },
{ 0xa10c5807, KEY_SCROLLUP }, /* Green Thumbs Up */

{ 0x3085e01c, KEY_VOLUMEUP },
{ 0x3085e01d, KEY_VOLUMEDOWN },
{ 0x3085e01b, KEY_MUTE },
{ 0x3085d020, KEY_RECORD },
{ 0x3085e01e, KEY_CHANNELUP },
{ 0x3085e01f, KEY_CHANNELDOWN },
{ 0xa10c3807, KEY_VOLUMEUP },
{ 0xa10cb807, KEY_VOLUMEDOWN },
{ 0xa10cd807, KEY_MUTE },
{ 0xa10c040b, KEY_RECORD },
{ 0xa10c7807, KEY_CHANNELUP },
{ 0xa10cf807, KEY_CHANNELDOWN },
{ 0x0085301f, KEY_CHANNELDOWN },

{ 0x3085d021, KEY_PLAY },
{ 0x3085d023, KEY_PAUSE },
{ 0x3085d025, KEY_SLOW },
{ 0x3085d022, KEY_REWIND },
{ 0x3085d024, KEY_FASTFORWARD },
{ 0x3085d026, KEY_PREVIOUS },
{ 0x3085d027, KEY_NEXT }, /* ->| */
{ 0xa10c840b, KEY_PLAY },
{ 0xa10cc40b, KEY_PAUSE },
{ 0xa10ca40b, KEY_SLOW },
{ 0xa10c440b, KEY_REWIND },
{ 0xa10c240b, KEY_FASTFORWARD },
{ 0xa10c640b, KEY_PREVIOUS },
{ 0xa10ce40b, KEY_NEXT }, /* ->| */

{ 0x3085b044, KEY_ZOOM }, /* Aspect */
{ 0x3085b048, KEY_STOP },
{ 0x3085b04a, KEY_DVD }, /* DVD Menu */
{ 0xa10c220d, KEY_ZOOM }, /* Aspect */
{ 0xa10c120d, KEY_STOP },
{ 0xa10c520d, KEY_DVD }, /* DVD Menu */

{ 0x3085d028, KEY_NUMERIC_1 },
{ 0x3085d029, KEY_NUMERIC_2 },
{ 0x3085d02a, KEY_NUMERIC_3 },
{ 0x3085d02b, KEY_NUMERIC_4 },
{ 0x3085d02c, KEY_NUMERIC_5 },
{ 0x3085d02d, KEY_NUMERIC_6 },
{ 0x3085d02e, KEY_NUMERIC_7 },
{ 0x3085d02f, KEY_NUMERIC_8 },
{ 0xa10c140b, KEY_NUMERIC_1 },
{ 0xa10c940b, KEY_NUMERIC_2 },
{ 0xa10c540b, KEY_NUMERIC_3 },
{ 0xa10cd40b, KEY_NUMERIC_4 },
{ 0xa10c340b, KEY_NUMERIC_5 },
{ 0xa10cb40b, KEY_NUMERIC_6 },
{ 0xa10c740b, KEY_NUMERIC_7 },
{ 0xa10cf40b, KEY_NUMERIC_8 },
{ 0x0085302f, KEY_NUMERIC_8 },
{ 0x3085c030, KEY_NUMERIC_9 },
{ 0x3085c031, KEY_NUMERIC_0 },
{ 0x3085c033, KEY_ENTER },
{ 0x3085c032, KEY_CLEAR },
{ 0xa10c0c03, KEY_NUMERIC_9 },
{ 0xa10c8c03, KEY_NUMERIC_0 },
{ 0xa10ccc03, KEY_ENTER },
{ 0xa10c4c03, KEY_CLEAR },
};

static struct rc_map_list tivo_map = {
Loading

0 comments on commit 9309444

Please sign in to comment.