Skip to content

Commit 62d7a29

Browse files
committed
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (31 commits) Revert "[media] af9015: limit I2C access to keep FW happy" [media] s5p-fimc: Fix camera input configuration in subdev operations [media] m5mols: Fix logic in sanity check [media] ati_remote: switch to single-byte scancodes [media] V4L: mt9m111: fix uninitialised mutex [media] V4L: omap1_camera: fix missing <linux/module.h> include [media] V4L: mt9t112: use after free in mt9t112_probe() [media] V4L: soc-camera: fix compiler warnings on 64-bit platforms [media] s5p_mfc_enc: fix s/H264/H263/ typo [media] omap_vout: Fix compile error in 3.1 [media] au0828: add missing models 72101, 72201 & 72261 to the model matrix [media] au0828: add missing USB ID 2040:7213 [media] au0828: add missing USB ID 2040:7260 [media] [trivial] omap24xxcam-dma: Fix logical test [media] omap_vout: fix crash if no driver for a display [media] media: video: s5p-tv: fix build break [media] omap3isp: fix compilation of ispvideo.c [media] m5mols: Fix set_fmt to return proper pixel format code [media] s5p-fimc: Use correct fourcc for RGB565 colour format [media] s5p-fimc: Fail driver probing when sensor configuration is wrong ...
2 parents 3d3c8f9 + 4b5d8da commit 62d7a29

28 files changed

Lines changed: 353 additions & 303 deletions

‎MAINTAINERS‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4281,7 +4281,9 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
42814281
S: Maintained
42824282
F: Documentation/dvb/
42834283
F: Documentation/video4linux/
4284+
F: Documentation/DocBook/media/
42844285
F: drivers/media/
4286+
F: drivers/staging/media/
42854287
F: include/media/
42864288
F: include/linux/dvb/
42874289
F: include/linux/videodev*.h

‎drivers/media/common/tuners/mxl5007t.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,10 @@ static int mxl5007t_write_regs(struct mxl5007t_state *state,
488488

489489
static int mxl5007t_read_reg(struct mxl5007t_state *state, u8 reg, u8 *val)
490490
{
491+
u8 buf[2] = { 0xfb, reg };
491492
struct i2c_msg msg[] = {
492493
{ .addr = state->i2c_props.addr, .flags = 0,
493-
.buf = &reg, .len = 1 },
494+
.buf = buf, .len = 2 },
494495
{ .addr = state->i2c_props.addr, .flags = I2C_M_RD,
495496
.buf = val, .len = 1 },
496497
};

‎drivers/media/common/tuners/tda18218.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int tda18218_set_params(struct dvb_frontend *fe,
141141
switch (params->u.ofdm.bandwidth) {
142142
case BANDWIDTH_6_MHZ:
143143
LP_Fc = 0;
144-
LO_Frac = params->frequency + 4000000;
144+
LO_Frac = params->frequency + 3000000;
145145
break;
146146
case BANDWIDTH_7_MHZ:
147147
LP_Fc = 1;

‎drivers/media/rc/ati_remote.c‎

Lines changed: 51 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ struct ati_remote {
189189
dma_addr_t inbuf_dma;
190190
dma_addr_t outbuf_dma;
191191

192-
unsigned char old_data[2]; /* Detect duplicate events */
192+
unsigned char old_data; /* Detect duplicate events */
193193
unsigned long old_jiffies;
194194
unsigned long acc_jiffies; /* handle acceleration */
195195
unsigned long first_jiffies;
@@ -221,35 +221,35 @@ struct ati_remote {
221221
/* Translation table from hardware messages to input events. */
222222
static const struct {
223223
short kind;
224-
unsigned char data1, data2;
224+
unsigned char data;
225225
int type;
226226
unsigned int code;
227227
int value;
228228
} ati_remote_tbl[] = {
229229
/* Directional control pad axes */
230-
{KIND_ACCEL, 0x35, 0x70, EV_REL, REL_X, -1}, /* left */
231-
{KIND_ACCEL, 0x36, 0x71, EV_REL, REL_X, 1}, /* right */
232-
{KIND_ACCEL, 0x37, 0x72, EV_REL, REL_Y, -1}, /* up */
233-
{KIND_ACCEL, 0x38, 0x73, EV_REL, REL_Y, 1}, /* down */
230+
{KIND_ACCEL, 0x70, EV_REL, REL_X, -1}, /* left */
231+
{KIND_ACCEL, 0x71, EV_REL, REL_X, 1}, /* right */
232+
{KIND_ACCEL, 0x72, EV_REL, REL_Y, -1}, /* up */
233+
{KIND_ACCEL, 0x73, EV_REL, REL_Y, 1}, /* down */
234234
/* Directional control pad diagonals */
235-
{KIND_LU, 0x39, 0x74, EV_REL, 0, 0}, /* left up */
236-
{KIND_RU, 0x3a, 0x75, EV_REL, 0, 0}, /* right up */
237-
{KIND_LD, 0x3c, 0x77, EV_REL, 0, 0}, /* left down */
238-
{KIND_RD, 0x3b, 0x76, EV_REL, 0, 0}, /* right down */
235+
{KIND_LU, 0x74, EV_REL, 0, 0}, /* left up */
236+
{KIND_RU, 0x75, EV_REL, 0, 0}, /* right up */
237+
{KIND_LD, 0x77, EV_REL, 0, 0}, /* left down */
238+
{KIND_RD, 0x76, EV_REL, 0, 0}, /* right down */
239239

240240
/* "Mouse button" buttons */
241-
{KIND_LITERAL, 0x3d, 0x78, EV_KEY, BTN_LEFT, 1}, /* left btn down */
242-
{KIND_LITERAL, 0x3e, 0x79, EV_KEY, BTN_LEFT, 0}, /* left btn up */
243-
{KIND_LITERAL, 0x41, 0x7c, EV_KEY, BTN_RIGHT, 1},/* right btn down */
244-
{KIND_LITERAL, 0x42, 0x7d, EV_KEY, BTN_RIGHT, 0},/* right btn up */
241+
{KIND_LITERAL, 0x78, EV_KEY, BTN_LEFT, 1}, /* left btn down */
242+
{KIND_LITERAL, 0x79, EV_KEY, BTN_LEFT, 0}, /* left btn up */
243+
{KIND_LITERAL, 0x7c, EV_KEY, BTN_RIGHT, 1},/* right btn down */
244+
{KIND_LITERAL, 0x7d, EV_KEY, BTN_RIGHT, 0},/* right btn up */
245245

246246
/* Artificial "doubleclick" events are generated by the hardware.
247247
* They are mapped to the "side" and "extra" mouse buttons here. */
248-
{KIND_FILTERED, 0x3f, 0x7a, EV_KEY, BTN_SIDE, 1}, /* left dblclick */
249-
{KIND_FILTERED, 0x43, 0x7e, EV_KEY, BTN_EXTRA, 1},/* right dblclick */
248+
{KIND_FILTERED, 0x7a, EV_KEY, BTN_SIDE, 1}, /* left dblclick */
249+
{KIND_FILTERED, 0x7e, EV_KEY, BTN_EXTRA, 1},/* right dblclick */
250250

251251
/* Non-mouse events are handled by rc-core */
252-
{KIND_END, 0x00, 0x00, EV_MAX + 1, 0, 0}
252+
{KIND_END, 0x00, EV_MAX + 1, 0, 0}
253253
};
254254

255255
/* Local function prototypes */
@@ -396,25 +396,6 @@ static int ati_remote_sendpacket(struct ati_remote *ati_remote, u16 cmd, unsigne
396396
return retval;
397397
}
398398

399-
/*
400-
* ati_remote_event_lookup
401-
*/
402-
static int ati_remote_event_lookup(int rem, unsigned char d1, unsigned char d2)
403-
{
404-
int i;
405-
406-
for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++) {
407-
/*
408-
* Decide if the table entry matches the remote input.
409-
*/
410-
if (ati_remote_tbl[i].data1 == d1 &&
411-
ati_remote_tbl[i].data2 == d2)
412-
return i;
413-
414-
}
415-
return -1;
416-
}
417-
418399
/*
419400
* ati_remote_compute_accel
420401
*
@@ -463,7 +444,15 @@ static void ati_remote_input_report(struct urb *urb)
463444
int index = -1;
464445
int acc;
465446
int remote_num;
466-
unsigned char scancode[2];
447+
unsigned char scancode;
448+
int i;
449+
450+
/*
451+
* data[0] = 0x14
452+
* data[1] = data[2] + data[3] + 0xd5 (a checksum byte)
453+
* data[2] = the key code (with toggle bit in MSB with some models)
454+
* data[3] = channel << 4 (the low 4 bits must be zero)
455+
*/
467456

468457
/* Deal with strange looking inputs */
469458
if ( (urb->actual_length != 4) || (data[0] != 0x14) ||
@@ -472,6 +461,13 @@ static void ati_remote_input_report(struct urb *urb)
472461
return;
473462
}
474463

464+
if (data[1] != ((data[2] + data[3] + 0xd5) & 0xff)) {
465+
dbginfo(&ati_remote->interface->dev,
466+
"wrong checksum in input: %02x %02x %02x %02x\n",
467+
data[0], data[1], data[2], data[3]);
468+
return;
469+
}
470+
475471
/* Mask unwanted remote channels. */
476472
/* note: remote_num is 0-based, channel 1 on remote == 0 here */
477473
remote_num = (data[3] >> 4) & 0x0f;
@@ -482,31 +478,30 @@ static void ati_remote_input_report(struct urb *urb)
482478
return;
483479
}
484480

485-
scancode[0] = (((data[1] - ((remote_num + 1) << 4)) & 0xf0) | (data[1] & 0x0f));
486-
487481
/*
488-
* Some devices (e.g. SnapStream Firefly) use 8080 as toggle code,
489-
* so we have to clear them. The first bit is a bit tricky as the
490-
* "non-toggled" state depends on remote_num, so we xor it with the
491-
* second bit which is only used for toggle.
482+
* MSB is a toggle code, though only used by some devices
483+
* (e.g. SnapStream Firefly)
492484
*/
493-
scancode[0] ^= (data[2] & 0x80);
494-
495-
scancode[1] = data[2] & ~0x80;
485+
scancode = data[2] & 0x7f;
496486

497-
/* Look up event code index in mouse translation table. */
498-
index = ati_remote_event_lookup(remote_num, scancode[0], scancode[1]);
487+
/* Look up event code index in the mouse translation table. */
488+
for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++) {
489+
if (scancode == ati_remote_tbl[i].data) {
490+
index = i;
491+
break;
492+
}
493+
}
499494

500495
if (index >= 0) {
501496
dbginfo(&ati_remote->interface->dev,
502-
"channel 0x%02x; mouse data %02x,%02x; index %d; keycode %d\n",
503-
remote_num, data[1], data[2], index, ati_remote_tbl[index].code);
497+
"channel 0x%02x; mouse data %02x; index %d; keycode %d\n",
498+
remote_num, data[2], index, ati_remote_tbl[index].code);
504499
if (!dev)
505500
return; /* no mouse device */
506501
} else
507502
dbginfo(&ati_remote->interface->dev,
508-
"channel 0x%02x; key data %02x,%02x, scancode %02x,%02x\n",
509-
remote_num, data[1], data[2], scancode[0], scancode[1]);
503+
"channel 0x%02x; key data %02x, scancode %02x\n",
504+
remote_num, data[2], scancode);
510505

511506

512507
if (index >= 0 && ati_remote_tbl[index].kind == KIND_LITERAL) {
@@ -523,8 +518,7 @@ static void ati_remote_input_report(struct urb *urb)
523518
unsigned long now = jiffies;
524519

525520
/* Filter duplicate events which happen "too close" together. */
526-
if (ati_remote->old_data[0] == data[1] &&
527-
ati_remote->old_data[1] == data[2] &&
521+
if (ati_remote->old_data == data[2] &&
528522
time_before(now, ati_remote->old_jiffies +
529523
msecs_to_jiffies(repeat_filter))) {
530524
ati_remote->repeat_count++;
@@ -533,8 +527,7 @@ static void ati_remote_input_report(struct urb *urb)
533527
ati_remote->first_jiffies = now;
534528
}
535529

536-
ati_remote->old_data[0] = data[1];
537-
ati_remote->old_data[1] = data[2];
530+
ati_remote->old_data = data[2];
538531
ati_remote->old_jiffies = now;
539532

540533
/* Ensure we skip at least the 4 first duplicate events (generated
@@ -549,14 +542,13 @@ static void ati_remote_input_report(struct urb *urb)
549542

550543
if (index < 0) {
551544
/* Not a mouse event, hand it to rc-core. */
552-
u32 rc_code = (scancode[0] << 8) | scancode[1];
553545

554546
/*
555547
* We don't use the rc-core repeat handling yet as
556548
* it would cause ghost repeats which would be a
557549
* regression for this driver.
558550
*/
559-
rc_keydown_notimeout(ati_remote->rdev, rc_code,
551+
rc_keydown_notimeout(ati_remote->rdev, scancode,
560552
data[2]);
561553
rc_keyup(ati_remote->rdev);
562554
return;
@@ -607,8 +599,7 @@ static void ati_remote_input_report(struct urb *urb)
607599
input_sync(dev);
608600

609601
ati_remote->old_jiffies = jiffies;
610-
ati_remote->old_data[0] = data[1];
611-
ati_remote->old_data[1] = data[2];
602+
ati_remote->old_data = data[2];
612603
}
613604
}
614605

‎drivers/media/rc/keymaps/rc-ati-x10.c‎

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -27,55 +27,55 @@
2727
#include <media/rc-map.h>
2828

2929
static struct rc_map_table ati_x10[] = {
30-
{ 0xd20d, KEY_1 },
31-
{ 0xd30e, KEY_2 },
32-
{ 0xd40f, KEY_3 },
33-
{ 0xd510, KEY_4 },
34-
{ 0xd611, KEY_5 },
35-
{ 0xd712, KEY_6 },
36-
{ 0xd813, KEY_7 },
37-
{ 0xd914, KEY_8 },
38-
{ 0xda15, KEY_9 },
39-
{ 0xdc17, KEY_0 },
40-
{ 0xc500, KEY_A },
41-
{ 0xc601, KEY_B },
42-
{ 0xde19, KEY_C },
43-
{ 0xe01b, KEY_D },
44-
{ 0xe621, KEY_E },
45-
{ 0xe823, KEY_F },
30+
{ 0x0d, KEY_1 },
31+
{ 0x0e, KEY_2 },
32+
{ 0x0f, KEY_3 },
33+
{ 0x10, KEY_4 },
34+
{ 0x11, KEY_5 },
35+
{ 0x12, KEY_6 },
36+
{ 0x13, KEY_7 },
37+
{ 0x14, KEY_8 },
38+
{ 0x15, KEY_9 },
39+
{ 0x17, KEY_0 },
40+
{ 0x00, KEY_A },
41+
{ 0x01, KEY_B },
42+
{ 0x19, KEY_C },
43+
{ 0x1b, KEY_D },
44+
{ 0x21, KEY_E },
45+
{ 0x23, KEY_F },
4646

47-
{ 0xdd18, KEY_KPENTER }, /* "check" */
48-
{ 0xdb16, KEY_MENU }, /* "menu" */
49-
{ 0xc702, KEY_POWER }, /* Power */
50-
{ 0xc803, KEY_TV }, /* TV */
51-
{ 0xc904, KEY_DVD }, /* DVD */
52-
{ 0xca05, KEY_WWW }, /* WEB */
53-
{ 0xcb06, KEY_BOOKMARKS }, /* "book" */
54-
{ 0xcc07, KEY_EDIT }, /* "hand" */
55-
{ 0xe11c, KEY_COFFEE }, /* "timer" */
56-
{ 0xe520, KEY_FRONT }, /* "max" */
57-
{ 0xe21d, KEY_LEFT }, /* left */
58-
{ 0xe41f, KEY_RIGHT }, /* right */
59-
{ 0xe722, KEY_DOWN }, /* down */
60-
{ 0xdf1a, KEY_UP }, /* up */
61-
{ 0xe31e, KEY_OK }, /* "OK" */
62-
{ 0xce09, KEY_VOLUMEDOWN }, /* VOL + */
63-
{ 0xcd08, KEY_VOLUMEUP }, /* VOL - */
64-
{ 0xcf0a, KEY_MUTE }, /* MUTE */
65-
{ 0xd00b, KEY_CHANNELUP }, /* CH + */
66-
{ 0xd10c, KEY_CHANNELDOWN },/* CH - */
67-
{ 0xec27, KEY_RECORD }, /* ( o) red */
68-
{ 0xea25, KEY_PLAY }, /* ( >) */
69-
{ 0xe924, KEY_REWIND }, /* (<<) */
70-
{ 0xeb26, KEY_FORWARD }, /* (>>) */
71-
{ 0xed28, KEY_STOP }, /* ([]) */
72-
{ 0xee29, KEY_PAUSE }, /* ('') */
73-
{ 0xf02b, KEY_PREVIOUS }, /* (<-) */
74-
{ 0xef2a, KEY_NEXT }, /* (>+) */
75-
{ 0xf22d, KEY_INFO }, /* PLAYING */
76-
{ 0xf32e, KEY_HOME }, /* TOP */
77-
{ 0xf42f, KEY_END }, /* END */
78-
{ 0xf530, KEY_SELECT }, /* SELECT */
47+
{ 0x18, KEY_KPENTER }, /* "check" */
48+
{ 0x16, KEY_MENU }, /* "menu" */
49+
{ 0x02, KEY_POWER }, /* Power */
50+
{ 0x03, KEY_TV }, /* TV */
51+
{ 0x04, KEY_DVD }, /* DVD */
52+
{ 0x05, KEY_WWW }, /* WEB */
53+
{ 0x06, KEY_BOOKMARKS }, /* "book" */
54+
{ 0x07, KEY_EDIT }, /* "hand" */
55+
{ 0x1c, KEY_COFFEE }, /* "timer" */
56+
{ 0x20, KEY_FRONT }, /* "max" */
57+
{ 0x1d, KEY_LEFT }, /* left */
58+
{ 0x1f, KEY_RIGHT }, /* right */
59+
{ 0x22, KEY_DOWN }, /* down */
60+
{ 0x1a, KEY_UP }, /* up */
61+
{ 0x1e, KEY_OK }, /* "OK" */
62+
{ 0x09, KEY_VOLUMEDOWN }, /* VOL + */
63+
{ 0x08, KEY_VOLUMEUP }, /* VOL - */
64+
{ 0x0a, KEY_MUTE }, /* MUTE */
65+
{ 0x0b, KEY_CHANNELUP }, /* CH + */
66+
{ 0x0c, KEY_CHANNELDOWN },/* CH - */
67+
{ 0x27, KEY_RECORD }, /* ( o) red */
68+
{ 0x25, KEY_PLAY }, /* ( >) */
69+
{ 0x24, KEY_REWIND }, /* (<<) */
70+
{ 0x26, KEY_FORWARD }, /* (>>) */
71+
{ 0x28, KEY_STOP }, /* ([]) */
72+
{ 0x29, KEY_PAUSE }, /* ('') */
73+
{ 0x2b, KEY_PREVIOUS }, /* (<-) */
74+
{ 0x2a, KEY_NEXT }, /* (>+) */
75+
{ 0x2d, KEY_INFO }, /* PLAYING */
76+
{ 0x2e, KEY_HOME }, /* TOP */
77+
{ 0x2f, KEY_END }, /* END */
78+
{ 0x30, KEY_SELECT }, /* SELECT */
7979
};
8080

8181
static struct rc_map_list ati_x10_map = {

0 commit comments

Comments
 (0)