aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-12-30 10:59:37 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-30 10:59:37 -0500
commitb4d48c942c17ce3d3a330ad91e109e522bc97378 (patch)
tree3365292f3a5a502edb51492d011fd326c930ca40 /drivers/media
parent1a5cd29631a6b75e49e6ad8a770ab9d69cda0fa2 (diff)
parent5f0a6e2d503896062f641639dacfe5055c2f593b (diff)
Merge tag 'v3.2-rc7' into staging/for_v3.3
Linux 3.2-rc7 * tag 'v3.2-rc7': (1304 commits) Linux 3.2-rc7 netfilter: xt_connbytes: handle negation correctly Btrfs: call d_instantiate after all ops are setup Btrfs: fix worker lock misuse in find_worker net: relax rcvbuf limits rps: fix insufficient bounds checking in store_rps_dev_flow_table_cnt() net: introduce DST_NOPEER dst flag mqprio: Avoid panic if no options are provided bridge: provide a mtu() method for fake_dst_ops md/bitmap: It is OK to clear bits during recovery. md: don't give up looking for spares on first failure-to-add md/raid5: ensure correct assessment of drives during degraded reshape. md/linear: fix hot-add of devices to linear arrays. sparc64: Fix MSIQ HV call ordering in pci_sun4v_msiq_build_irq(). pata_of_platform: Add missing CONFIG_OF_IRQ dependency. ipv4: using prefetch requires including prefetch.h VFS: Fix race between CPU hotplug and lglocks vfs: __read_cache_page should use gfp argument rather than GFP_KERNEL USB: Fix usb/isp1760 build on sparc net: Add a flow_cache_flush_deferred function ... Conflicts: drivers/media/common/tuners/tda18218.c drivers/media/video/omap3isp/ispccdc.c drivers/staging/media/as102/as102_drv.h
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/tuners/mxl5007t.c3
-rw-r--r--drivers/media/common/tuners/tda18218.c2
-rw-r--r--drivers/media/rc/ati_remote.c111
-rw-r--r--drivers/media/rc/keymaps/rc-ati-x10.c96
-rw-r--r--drivers/media/rc/keymaps/rc-medion-x10.c128
-rw-r--r--drivers/media/rc/keymaps/rc-snapstream-firefly.c114
-rw-r--r--drivers/media/video/au0828/au0828-cards.c7
-rw-r--r--drivers/media/video/m5mols/m5mols.h2
-rw-r--r--drivers/media/video/m5mols/m5mols_core.c22
-rw-r--r--drivers/media/video/mt9m111.c1
-rw-r--r--drivers/media/video/omap/omap_vout.c9
-rw-r--r--drivers/media/video/omap24xxcam-dma.c2
-rw-r--r--drivers/media/video/omap3isp/ispstat.c2
-rw-r--r--drivers/media/video/omap3isp/ispvideo.c1
-rw-r--r--drivers/media/video/ov6650.c2
-rw-r--r--drivers/media/video/s5p-fimc/fimc-capture.c14
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.c24
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.h2
-rw-r--r--drivers/media/video/s5p-fimc/fimc-mdevice.c43
-rw-r--r--drivers/media/video/s5p-fimc/fimc-reg.c15
-rw-r--r--drivers/media/video/s5p-mfc/s5p_mfc_enc.c2
-rw-r--r--drivers/media/video/s5p-tv/mixer_video.c1
-rw-r--r--drivers/media/video/sh_mobile_ceu_camera.c34
-rw-r--r--drivers/media/video/sh_mobile_csi2.c4
-rw-r--r--drivers/media/video/soc_camera.c3
25 files changed, 342 insertions, 302 deletions
diff --git a/drivers/media/common/tuners/mxl5007t.c b/drivers/media/common/tuners/mxl5007t.c
index 2f0e550ad935..67bccde1f816 100644
--- a/drivers/media/common/tuners/mxl5007t.c
+++ b/drivers/media/common/tuners/mxl5007t.c
@@ -492,9 +492,10 @@ static int mxl5007t_write_regs(struct mxl5007t_state *state,
492 492
493static int mxl5007t_read_reg(struct mxl5007t_state *state, u8 reg, u8 *val) 493static int mxl5007t_read_reg(struct mxl5007t_state *state, u8 reg, u8 *val)
494{ 494{
495 u8 buf[2] = { 0xfb, reg };
495 struct i2c_msg msg[] = { 496 struct i2c_msg msg[] = {
496 { .addr = state->i2c_props.addr, .flags = 0, 497 { .addr = state->i2c_props.addr, .flags = 0,
497 .buf = &reg, .len = 1 }, 498 .buf = buf, .len = 2 },
498 { .addr = state->i2c_props.addr, .flags = I2C_M_RD, 499 { .addr = state->i2c_props.addr, .flags = I2C_M_RD,
499 .buf = val, .len = 1 }, 500 .buf = val, .len = 1 },
500 }; 501 };
diff --git a/drivers/media/common/tuners/tda18218.c b/drivers/media/common/tuners/tda18218.c
index 1c865950ddf4..d099501566a1 100644
--- a/drivers/media/common/tuners/tda18218.c
+++ b/drivers/media/common/tuners/tda18218.c
@@ -141,7 +141,7 @@ static int tda18218_set_params(struct dvb_frontend *fe,
141 switch (params->u.ofdm.bandwidth) { 141 switch (params->u.ofdm.bandwidth) {
142 case BANDWIDTH_6_MHZ: 142 case BANDWIDTH_6_MHZ:
143 LP_Fc = 0; 143 LP_Fc = 0;
144 priv->if_frequency = 4000000; 144 priv->if_frequency = 3000000;
145 break; 145 break;
146 case BANDWIDTH_7_MHZ: 146 case BANDWIDTH_7_MHZ:
147 LP_Fc = 1; 147 LP_Fc = 1;
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
index 303f22ea04c0..01bb8daf4b09 100644
--- a/drivers/media/rc/ati_remote.c
+++ b/drivers/media/rc/ati_remote.c
@@ -189,7 +189,7 @@ struct ati_remote {
189 dma_addr_t inbuf_dma; 189 dma_addr_t inbuf_dma;
190 dma_addr_t outbuf_dma; 190 dma_addr_t outbuf_dma;
191 191
192 unsigned char old_data[2]; /* Detect duplicate events */ 192 unsigned char old_data; /* Detect duplicate events */
193 unsigned long old_jiffies; 193 unsigned long old_jiffies;
194 unsigned long acc_jiffies; /* handle acceleration */ 194 unsigned long acc_jiffies; /* handle acceleration */
195 unsigned long first_jiffies; 195 unsigned long first_jiffies;
@@ -221,35 +221,35 @@ struct ati_remote {
221/* Translation table from hardware messages to input events. */ 221/* Translation table from hardware messages to input events. */
222static const struct { 222static const struct {
223 short kind; 223 short kind;
224 unsigned char data1, data2; 224 unsigned char data;
225 int type; 225 int type;
226 unsigned int code; 226 unsigned int code;
227 int value; 227 int value;
228} ati_remote_tbl[] = { 228} ati_remote_tbl[] = {
229 /* Directional control pad axes */ 229 /* Directional control pad axes */
230 {KIND_ACCEL, 0x35, 0x70, EV_REL, REL_X, -1}, /* left */ 230 {KIND_ACCEL, 0x70, EV_REL, REL_X, -1}, /* left */
231 {KIND_ACCEL, 0x36, 0x71, EV_REL, REL_X, 1}, /* right */ 231 {KIND_ACCEL, 0x71, EV_REL, REL_X, 1}, /* right */
232 {KIND_ACCEL, 0x37, 0x72, EV_REL, REL_Y, -1}, /* up */ 232 {KIND_ACCEL, 0x72, EV_REL, REL_Y, -1}, /* up */
233 {KIND_ACCEL, 0x38, 0x73, EV_REL, REL_Y, 1}, /* down */ 233 {KIND_ACCEL, 0x73, EV_REL, REL_Y, 1}, /* down */
234 /* Directional control pad diagonals */ 234 /* Directional control pad diagonals */
235 {KIND_LU, 0x39, 0x74, EV_REL, 0, 0}, /* left up */ 235 {KIND_LU, 0x74, EV_REL, 0, 0}, /* left up */
236 {KIND_RU, 0x3a, 0x75, EV_REL, 0, 0}, /* right up */ 236 {KIND_RU, 0x75, EV_REL, 0, 0}, /* right up */
237 {KIND_LD, 0x3c, 0x77, EV_REL, 0, 0}, /* left down */ 237 {KIND_LD, 0x77, EV_REL, 0, 0}, /* left down */
238 {KIND_RD, 0x3b, 0x76, EV_REL, 0, 0}, /* right down */ 238 {KIND_RD, 0x76, EV_REL, 0, 0}, /* right down */
239 239
240 /* "Mouse button" buttons */ 240 /* "Mouse button" buttons */
241 {KIND_LITERAL, 0x3d, 0x78, EV_KEY, BTN_LEFT, 1}, /* left btn down */ 241 {KIND_LITERAL, 0x78, EV_KEY, BTN_LEFT, 1}, /* left btn down */
242 {KIND_LITERAL, 0x3e, 0x79, EV_KEY, BTN_LEFT, 0}, /* left btn up */ 242 {KIND_LITERAL, 0x79, EV_KEY, BTN_LEFT, 0}, /* left btn up */
243 {KIND_LITERAL, 0x41, 0x7c, EV_KEY, BTN_RIGHT, 1},/* right btn down */ 243 {KIND_LITERAL, 0x7c, EV_KEY, BTN_RIGHT, 1},/* right btn down */
244 {KIND_LITERAL, 0x42, 0x7d, EV_KEY, BTN_RIGHT, 0},/* right btn up */ 244 {KIND_LITERAL, 0x7d, EV_KEY, BTN_RIGHT, 0},/* right btn up */
245 245
246 /* Artificial "doubleclick" events are generated by the hardware. 246 /* Artificial "doubleclick" events are generated by the hardware.
247 * They are mapped to the "side" and "extra" mouse buttons here. */ 247 * They are mapped to the "side" and "extra" mouse buttons here. */
248 {KIND_FILTERED, 0x3f, 0x7a, EV_KEY, BTN_SIDE, 1}, /* left dblclick */ 248 {KIND_FILTERED, 0x7a, EV_KEY, BTN_SIDE, 1}, /* left dblclick */
249 {KIND_FILTERED, 0x43, 0x7e, EV_KEY, BTN_EXTRA, 1},/* right dblclick */ 249 {KIND_FILTERED, 0x7e, EV_KEY, BTN_EXTRA, 1},/* right dblclick */
250 250
251 /* Non-mouse events are handled by rc-core */ 251 /* 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}
253}; 253};
254 254
255/* Local function prototypes */ 255/* Local function prototypes */
@@ -397,25 +397,6 @@ static int ati_remote_sendpacket(struct ati_remote *ati_remote, u16 cmd, unsigne
397} 397}
398 398
399/* 399/*
400 * ati_remote_event_lookup
401 */
402static 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
418/*
419 * ati_remote_compute_accel 400 * ati_remote_compute_accel
420 * 401 *
421 * Implements acceleration curve for directional control pad 402 * Implements acceleration curve for directional control pad
@@ -463,7 +444,15 @@ static void ati_remote_input_report(struct urb *urb)
463 int index = -1; 444 int index = -1;
464 int acc; 445 int acc;
465 int remote_num; 446 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 */
467 456
468 /* Deal with strange looking inputs */ 457 /* Deal with strange looking inputs */
469 if ( (urb->actual_length != 4) || (data[0] != 0x14) || 458 if ( (urb->actual_length != 4) || (data[0] != 0x14) ||
@@ -472,6 +461,13 @@ static void ati_remote_input_report(struct urb *urb)
472 return; 461 return;
473 } 462 }
474 463
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
475 /* Mask unwanted remote channels. */ 471 /* Mask unwanted remote channels. */
476 /* note: remote_num is 0-based, channel 1 on remote == 0 here */ 472 /* note: remote_num is 0-based, channel 1 on remote == 0 here */
477 remote_num = (data[3] >> 4) & 0x0f; 473 remote_num = (data[3] >> 4) & 0x0f;
@@ -482,31 +478,30 @@ static void ati_remote_input_report(struct urb *urb)
482 return; 478 return;
483 } 479 }
484 480
485 scancode[0] = (((data[1] - ((remote_num + 1) << 4)) & 0xf0) | (data[1] & 0x0f));
486
487 /* 481 /*
488 * Some devices (e.g. SnapStream Firefly) use 8080 as toggle code, 482 * MSB is a toggle code, though only used by some devices
489 * so we have to clear them. The first bit is a bit tricky as the 483 * (e.g. SnapStream Firefly)
490 * "non-toggled" state depends on remote_num, so we xor it with the
491 * second bit which is only used for toggle.
492 */ 484 */
493 scancode[0] ^= (data[2] & 0x80); 485 scancode = data[2] & 0x7f;
494
495 scancode[1] = data[2] & ~0x80;
496 486
497 /* Look up event code index in mouse translation table. */ 487 /* Look up event code index in the mouse translation table. */
498 index = ati_remote_event_lookup(remote_num, scancode[0], scancode[1]); 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 }
499 494
500 if (index >= 0) { 495 if (index >= 0) {
501 dbginfo(&ati_remote->interface->dev, 496 dbginfo(&ati_remote->interface->dev,
502 "channel 0x%02x; mouse data %02x,%02x; index %d; keycode %d\n", 497 "channel 0x%02x; mouse data %02x; index %d; keycode %d\n",
503 remote_num, data[1], data[2], index, ati_remote_tbl[index].code); 498 remote_num, data[2], index, ati_remote_tbl[index].code);
504 if (!dev) 499 if (!dev)
505 return; /* no mouse device */ 500 return; /* no mouse device */
506 } else 501 } else
507 dbginfo(&ati_remote->interface->dev, 502 dbginfo(&ati_remote->interface->dev,
508 "channel 0x%02x; key data %02x,%02x, scancode %02x,%02x\n", 503 "channel 0x%02x; key data %02x, scancode %02x\n",
509 remote_num, data[1], data[2], scancode[0], scancode[1]); 504 remote_num, data[2], scancode);
510 505
511 506
512 if (index >= 0 && ati_remote_tbl[index].kind == KIND_LITERAL) { 507 if (index >= 0 && ati_remote_tbl[index].kind == KIND_LITERAL) {
@@ -523,8 +518,7 @@ static void ati_remote_input_report(struct urb *urb)
523 unsigned long now = jiffies; 518 unsigned long now = jiffies;
524 519
525 /* Filter duplicate events which happen "too close" together. */ 520 /* Filter duplicate events which happen "too close" together. */
526 if (ati_remote->old_data[0] == data[1] && 521 if (ati_remote->old_data == data[2] &&
527 ati_remote->old_data[1] == data[2] &&
528 time_before(now, ati_remote->old_jiffies + 522 time_before(now, ati_remote->old_jiffies +
529 msecs_to_jiffies(repeat_filter))) { 523 msecs_to_jiffies(repeat_filter))) {
530 ati_remote->repeat_count++; 524 ati_remote->repeat_count++;
@@ -533,8 +527,7 @@ static void ati_remote_input_report(struct urb *urb)
533 ati_remote->first_jiffies = now; 527 ati_remote->first_jiffies = now;
534 } 528 }
535 529
536 ati_remote->old_data[0] = data[1]; 530 ati_remote->old_data = data[2];
537 ati_remote->old_data[1] = data[2];
538 ati_remote->old_jiffies = now; 531 ati_remote->old_jiffies = now;
539 532
540 /* Ensure we skip at least the 4 first duplicate events (generated 533 /* Ensure we skip at least the 4 first duplicate events (generated
@@ -549,14 +542,13 @@ static void ati_remote_input_report(struct urb *urb)
549 542
550 if (index < 0) { 543 if (index < 0) {
551 /* Not a mouse event, hand it to rc-core. */ 544 /* Not a mouse event, hand it to rc-core. */
552 u32 rc_code = (scancode[0] << 8) | scancode[1];
553 545
554 /* 546 /*
555 * We don't use the rc-core repeat handling yet as 547 * We don't use the rc-core repeat handling yet as
556 * it would cause ghost repeats which would be a 548 * it would cause ghost repeats which would be a
557 * regression for this driver. 549 * regression for this driver.
558 */ 550 */
559 rc_keydown_notimeout(ati_remote->rdev, rc_code, 551 rc_keydown_notimeout(ati_remote->rdev, scancode,
560 data[2]); 552 data[2]);
561 rc_keyup(ati_remote->rdev); 553 rc_keyup(ati_remote->rdev);
562 return; 554 return;
@@ -607,8 +599,7 @@ static void ati_remote_input_report(struct urb *urb)
607 input_sync(dev); 599 input_sync(dev);
608 600
609 ati_remote->old_jiffies = jiffies; 601 ati_remote->old_jiffies = jiffies;
610 ati_remote->old_data[0] = data[1]; 602 ati_remote->old_data = data[2];
611 ati_remote->old_data[1] = data[2];
612 } 603 }
613} 604}
614 605
diff --git a/drivers/media/rc/keymaps/rc-ati-x10.c b/drivers/media/rc/keymaps/rc-ati-x10.c
index e1b8b2605c48..81506440eded 100644
--- a/drivers/media/rc/keymaps/rc-ati-x10.c
+++ b/drivers/media/rc/keymaps/rc-ati-x10.c
@@ -27,55 +27,55 @@
27#include <media/rc-map.h> 27#include <media/rc-map.h>
28 28
29static struct rc_map_table ati_x10[] = { 29static struct rc_map_table ati_x10[] = {
30 { 0xd20d, KEY_1 }, 30 { 0x0d, KEY_1 },
31 { 0xd30e, KEY_2 }, 31 { 0x0e, KEY_2 },
32 { 0xd40f, KEY_3 }, 32 { 0x0f, KEY_3 },
33 { 0xd510, KEY_4 }, 33 { 0x10, KEY_4 },
34 { 0xd611, KEY_5 }, 34 { 0x11, KEY_5 },
35 { 0xd712, KEY_6 }, 35 { 0x12, KEY_6 },
36 { 0xd813, KEY_7 }, 36 { 0x13, KEY_7 },
37 { 0xd914, KEY_8 }, 37 { 0x14, KEY_8 },
38 { 0xda15, KEY_9 }, 38 { 0x15, KEY_9 },
39 { 0xdc17, KEY_0 }, 39 { 0x17, KEY_0 },
40 { 0xc500, KEY_A }, 40 { 0x00, KEY_A },
41 { 0xc601, KEY_B }, 41 { 0x01, KEY_B },
42 { 0xde19, KEY_C }, 42 { 0x19, KEY_C },
43 { 0xe01b, KEY_D }, 43 { 0x1b, KEY_D },
44 { 0xe621, KEY_E }, 44 { 0x21, KEY_E },
45 { 0xe823, KEY_F }, 45 { 0x23, KEY_F },
46 46
47 { 0xdd18, KEY_KPENTER }, /* "check" */ 47 { 0x18, KEY_KPENTER }, /* "check" */
48 { 0xdb16, KEY_MENU }, /* "menu" */ 48 { 0x16, KEY_MENU }, /* "menu" */
49 { 0xc702, KEY_POWER }, /* Power */ 49 { 0x02, KEY_POWER }, /* Power */
50 { 0xc803, KEY_TV }, /* TV */ 50 { 0x03, KEY_TV }, /* TV */
51 { 0xc904, KEY_DVD }, /* DVD */ 51 { 0x04, KEY_DVD }, /* DVD */
52 { 0xca05, KEY_WWW }, /* WEB */ 52 { 0x05, KEY_WWW }, /* WEB */
53 { 0xcb06, KEY_BOOKMARKS }, /* "book" */ 53 { 0x06, KEY_BOOKMARKS }, /* "book" */
54 { 0xcc07, KEY_EDIT }, /* "hand" */ 54 { 0x07, KEY_EDIT }, /* "hand" */
55 { 0xe11c, KEY_COFFEE }, /* "timer" */ 55 { 0x1c, KEY_COFFEE }, /* "timer" */
56 { 0xe520, KEY_FRONT }, /* "max" */ 56 { 0x20, KEY_FRONT }, /* "max" */
57 { 0xe21d, KEY_LEFT }, /* left */ 57 { 0x1d, KEY_LEFT }, /* left */
58 { 0xe41f, KEY_RIGHT }, /* right */ 58 { 0x1f, KEY_RIGHT }, /* right */
59 { 0xe722, KEY_DOWN }, /* down */ 59 { 0x22, KEY_DOWN }, /* down */
60 { 0xdf1a, KEY_UP }, /* up */ 60 { 0x1a, KEY_UP }, /* up */
61 { 0xe31e, KEY_OK }, /* "OK" */ 61 { 0x1e, KEY_OK }, /* "OK" */
62 { 0xce09, KEY_VOLUMEDOWN }, /* VOL + */ 62 { 0x09, KEY_VOLUMEDOWN }, /* VOL + */
63 { 0xcd08, KEY_VOLUMEUP }, /* VOL - */ 63 { 0x08, KEY_VOLUMEUP }, /* VOL - */
64 { 0xcf0a, KEY_MUTE }, /* MUTE */ 64 { 0x0a, KEY_MUTE }, /* MUTE */
65 { 0xd00b, KEY_CHANNELUP }, /* CH + */ 65 { 0x0b, KEY_CHANNELUP }, /* CH + */
66 { 0xd10c, KEY_CHANNELDOWN },/* CH - */ 66 { 0x0c, KEY_CHANNELDOWN },/* CH - */
67 { 0xec27, KEY_RECORD }, /* ( o) red */ 67 { 0x27, KEY_RECORD }, /* ( o) red */
68 { 0xea25, KEY_PLAY }, /* ( >) */ 68 { 0x25, KEY_PLAY }, /* ( >) */
69 { 0xe924, KEY_REWIND }, /* (<<) */ 69 { 0x24, KEY_REWIND }, /* (<<) */
70 { 0xeb26, KEY_FORWARD }, /* (>>) */ 70 { 0x26, KEY_FORWARD }, /* (>>) */
71 { 0xed28, KEY_STOP }, /* ([]) */ 71 { 0x28, KEY_STOP }, /* ([]) */
72 { 0xee29, KEY_PAUSE }, /* ('') */ 72 { 0x29, KEY_PAUSE }, /* ('') */
73 { 0xf02b, KEY_PREVIOUS }, /* (<-) */ 73 { 0x2b, KEY_PREVIOUS }, /* (<-) */
74 { 0xef2a, KEY_NEXT }, /* (>+) */ 74 { 0x2a, KEY_NEXT }, /* (>+) */
75 { 0xf22d, KEY_INFO }, /* PLAYING */ 75 { 0x2d, KEY_INFO }, /* PLAYING */
76 { 0xf32e, KEY_HOME }, /* TOP */ 76 { 0x2e, KEY_HOME }, /* TOP */
77 { 0xf42f, KEY_END }, /* END */ 77 { 0x2f, KEY_END }, /* END */
78 { 0xf530, KEY_SELECT }, /* SELECT */ 78 { 0x30, KEY_SELECT }, /* SELECT */
79}; 79};
80 80
81static struct rc_map_list ati_x10_map = { 81static struct rc_map_list ati_x10_map = {
diff --git a/drivers/media/rc/keymaps/rc-medion-x10.c b/drivers/media/rc/keymaps/rc-medion-x10.c
index 09e2cc01d110..479cdb897810 100644
--- a/drivers/media/rc/keymaps/rc-medion-x10.c
+++ b/drivers/media/rc/keymaps/rc-medion-x10.c
@@ -25,70 +25,70 @@
25#include <media/rc-map.h> 25#include <media/rc-map.h>
26 26
27static struct rc_map_table medion_x10[] = { 27static struct rc_map_table medion_x10[] = {
28 { 0xf12c, KEY_TV }, /* TV */ 28 { 0x2c, KEY_TV }, /* TV */
29 { 0xf22d, KEY_VCR }, /* VCR */ 29 { 0x2d, KEY_VCR }, /* VCR */
30 { 0xc904, KEY_DVD }, /* DVD */ 30 { 0x04, KEY_DVD }, /* DVD */
31 { 0xcb06, KEY_AUDIO }, /* MUSIC */ 31 { 0x06, KEY_AUDIO }, /* MUSIC */
32 32
33 { 0xf32e, KEY_RADIO }, /* RADIO */ 33 { 0x2e, KEY_RADIO }, /* RADIO */
34 { 0xca05, KEY_DIRECTORY }, /* PHOTO */ 34 { 0x05, KEY_DIRECTORY }, /* PHOTO */
35 { 0xf42f, KEY_INFO }, /* TV-PREVIEW */ 35 { 0x2f, KEY_INFO }, /* TV-PREVIEW */
36 { 0xf530, KEY_LIST }, /* CHANNEL-LST */ 36 { 0x30, KEY_LIST }, /* CHANNEL-LST */
37 37
38 { 0xe01b, KEY_SETUP }, /* SETUP */ 38 { 0x1b, KEY_SETUP }, /* SETUP */
39 { 0xf631, KEY_VIDEO }, /* VIDEO DESKTOP */ 39 { 0x31, KEY_VIDEO }, /* VIDEO DESKTOP */
40 40
41 { 0xcd08, KEY_VOLUMEDOWN }, /* VOL - */ 41 { 0x08, KEY_VOLUMEDOWN }, /* VOL - */
42 { 0xce09, KEY_VOLUMEUP }, /* VOL + */ 42 { 0x09, KEY_VOLUMEUP }, /* VOL + */
43 { 0xd00b, KEY_CHANNELUP }, /* CHAN + */ 43 { 0x0b, KEY_CHANNELUP }, /* CHAN + */
44 { 0xd10c, KEY_CHANNELDOWN }, /* CHAN - */ 44 { 0x0c, KEY_CHANNELDOWN }, /* CHAN - */
45 { 0xc500, KEY_MUTE }, /* MUTE */ 45 { 0x00, KEY_MUTE }, /* MUTE */
46 46
47 { 0xf732, KEY_RED }, /* red */ 47 { 0x32, KEY_RED }, /* red */
48 { 0xf833, KEY_GREEN }, /* green */ 48 { 0x33, KEY_GREEN }, /* green */
49 { 0xf934, KEY_YELLOW }, /* yellow */ 49 { 0x34, KEY_YELLOW }, /* yellow */
50 { 0xfa35, KEY_BLUE }, /* blue */ 50 { 0x35, KEY_BLUE }, /* blue */
51 { 0xdb16, KEY_TEXT }, /* TXT */ 51 { 0x16, KEY_TEXT }, /* TXT */
52 52
53 { 0xd20d, KEY_1 }, 53 { 0x0d, KEY_1 },
54 { 0xd30e, KEY_2 }, 54 { 0x0e, KEY_2 },
55 { 0xd40f, KEY_3 }, 55 { 0x0f, KEY_3 },
56 { 0xd510, KEY_4 }, 56 { 0x10, KEY_4 },
57 { 0xd611, KEY_5 }, 57 { 0x11, KEY_5 },
58 { 0xd712, KEY_6 }, 58 { 0x12, KEY_6 },
59 { 0xd813, KEY_7 }, 59 { 0x13, KEY_7 },
60 { 0xd914, KEY_8 }, 60 { 0x14, KEY_8 },
61 { 0xda15, KEY_9 }, 61 { 0x15, KEY_9 },
62 { 0xdc17, KEY_0 }, 62 { 0x17, KEY_0 },
63 { 0xe11c, KEY_SEARCH }, /* TV/RAD, CH SRC */ 63 { 0x1c, KEY_SEARCH }, /* TV/RAD, CH SRC */
64 { 0xe520, KEY_DELETE }, /* DELETE */ 64 { 0x20, KEY_DELETE }, /* DELETE */
65 65
66 { 0xfb36, KEY_KEYBOARD }, /* RENAME */ 66 { 0x36, KEY_KEYBOARD }, /* RENAME */
67 { 0xdd18, KEY_SCREEN }, /* SNAPSHOT */ 67 { 0x18, KEY_SCREEN }, /* SNAPSHOT */
68 68
69 { 0xdf1a, KEY_UP }, /* up */ 69 { 0x1a, KEY_UP }, /* up */
70 { 0xe722, KEY_DOWN }, /* down */ 70 { 0x22, KEY_DOWN }, /* down */
71 { 0xe21d, KEY_LEFT }, /* left */ 71 { 0x1d, KEY_LEFT }, /* left */
72 { 0xe41f, KEY_RIGHT }, /* right */ 72 { 0x1f, KEY_RIGHT }, /* right */
73 { 0xe31e, KEY_OK }, /* OK */ 73 { 0x1e, KEY_OK }, /* OK */
74 74
75 { 0xfc37, KEY_SELECT }, /* ACQUIRE IMAGE */ 75 { 0x37, KEY_SELECT }, /* ACQUIRE IMAGE */
76 { 0xfd38, KEY_EDIT }, /* EDIT IMAGE */ 76 { 0x38, KEY_EDIT }, /* EDIT IMAGE */
77 77
78 { 0xe924, KEY_REWIND }, /* rewind (<<) */ 78 { 0x24, KEY_REWIND }, /* rewind (<<) */
79 { 0xea25, KEY_PLAY }, /* play ( >) */ 79 { 0x25, KEY_PLAY }, /* play ( >) */
80 { 0xeb26, KEY_FORWARD }, /* forward (>>) */ 80 { 0x26, KEY_FORWARD }, /* forward (>>) */
81 { 0xec27, KEY_RECORD }, /* record ( o) */ 81 { 0x27, KEY_RECORD }, /* record ( o) */
82 { 0xed28, KEY_STOP }, /* stop ([]) */ 82 { 0x28, KEY_STOP }, /* stop ([]) */
83 { 0xee29, KEY_PAUSE }, /* pause ('') */ 83 { 0x29, KEY_PAUSE }, /* pause ('') */
84 84
85 { 0xe621, KEY_PREVIOUS }, /* prev */ 85 { 0x21, KEY_PREVIOUS }, /* prev */
86 { 0xfe39, KEY_SWITCHVIDEOMODE }, /* F SCR */ 86 { 0x39, KEY_SWITCHVIDEOMODE }, /* F SCR */
87 { 0xe823, KEY_NEXT }, /* next */ 87 { 0x23, KEY_NEXT }, /* next */
88 { 0xde19, KEY_MENU }, /* MENU */ 88 { 0x19, KEY_MENU }, /* MENU */
89 { 0xff3a, KEY_LANGUAGE }, /* AUDIO */ 89 { 0x3a, KEY_LANGUAGE }, /* AUDIO */
90 90
91 { 0xc702, KEY_POWER }, /* POWER */ 91 { 0x02, KEY_POWER }, /* POWER */
92}; 92};
93 93
94static struct rc_map_list medion_x10_map = { 94static struct rc_map_list medion_x10_map = {
diff --git a/drivers/media/rc/keymaps/rc-snapstream-firefly.c b/drivers/media/rc/keymaps/rc-snapstream-firefly.c
index ef146520931c..c7f33ec719b4 100644
--- a/drivers/media/rc/keymaps/rc-snapstream-firefly.c
+++ b/drivers/media/rc/keymaps/rc-snapstream-firefly.c
@@ -22,63 +22,63 @@
22#include <media/rc-map.h> 22#include <media/rc-map.h>
23 23
24static struct rc_map_table snapstream_firefly[] = { 24static struct rc_map_table snapstream_firefly[] = {
25 { 0xf12c, KEY_ZOOM }, /* Maximize */ 25 { 0x2c, KEY_ZOOM }, /* Maximize */
26 { 0xc702, KEY_CLOSE }, 26 { 0x02, KEY_CLOSE },
27 27
28 { 0xd20d, KEY_1 }, 28 { 0x0d, KEY_1 },
29 { 0xd30e, KEY_2 }, 29 { 0x0e, KEY_2 },
30 { 0xd40f, KEY_3 }, 30 { 0x0f, KEY_3 },
31 { 0xd510, KEY_4 }, 31 { 0x10, KEY_4 },
32 { 0xd611, KEY_5 }, 32 { 0x11, KEY_5 },
33 { 0xd712, KEY_6 }, 33 { 0x12, KEY_6 },
34 { 0xd813, KEY_7 }, 34 { 0x13, KEY_7 },
35 { 0xd914, KEY_8 }, 35 { 0x14, KEY_8 },
36 { 0xda15, KEY_9 }, 36 { 0x15, KEY_9 },
37 { 0xdc17, KEY_0 }, 37 { 0x17, KEY_0 },
38 { 0xdb16, KEY_BACK }, 38 { 0x16, KEY_BACK },
39 { 0xdd18, KEY_KPENTER }, /* ent */ 39 { 0x18, KEY_KPENTER }, /* ent */
40 40
41 { 0xce09, KEY_VOLUMEUP }, 41 { 0x09, KEY_VOLUMEUP },
42 { 0xcd08, KEY_VOLUMEDOWN }, 42 { 0x08, KEY_VOLUMEDOWN },
43 { 0xcf0a, KEY_MUTE }, 43 { 0x0a, KEY_MUTE },
44 { 0xd00b, KEY_CHANNELUP }, 44 { 0x0b, KEY_CHANNELUP },
45 { 0xd10c, KEY_CHANNELDOWN }, 45 { 0x0c, KEY_CHANNELDOWN },
46 { 0xc500, KEY_VENDOR }, /* firefly */ 46 { 0x00, KEY_VENDOR }, /* firefly */
47 47
48 { 0xf32e, KEY_INFO }, 48 { 0x2e, KEY_INFO },
49 { 0xf42f, KEY_OPTION }, 49 { 0x2f, KEY_OPTION },
50 50
51 { 0xe21d, KEY_LEFT }, 51 { 0x1d, KEY_LEFT },
52 { 0xe41f, KEY_RIGHT }, 52 { 0x1f, KEY_RIGHT },
53 { 0xe722, KEY_DOWN }, 53 { 0x22, KEY_DOWN },
54 { 0xdf1a, KEY_UP }, 54 { 0x1a, KEY_UP },
55 { 0xe31e, KEY_OK }, 55 { 0x1e, KEY_OK },
56 56
57 { 0xe11c, KEY_MENU }, 57 { 0x1c, KEY_MENU },
58 { 0xe520, KEY_EXIT }, 58 { 0x20, KEY_EXIT },
59 59
60 { 0xec27, KEY_RECORD }, 60 { 0x27, KEY_RECORD },
61 { 0xea25, KEY_PLAY }, 61 { 0x25, KEY_PLAY },
62 { 0xed28, KEY_STOP }, 62 { 0x28, KEY_STOP },
63 { 0xe924, KEY_REWIND }, 63 { 0x24, KEY_REWIND },
64 { 0xeb26, KEY_FORWARD }, 64 { 0x26, KEY_FORWARD },
65 { 0xee29, KEY_PAUSE }, 65 { 0x29, KEY_PAUSE },
66 { 0xf02b, KEY_PREVIOUS }, 66 { 0x2b, KEY_PREVIOUS },
67 { 0xef2a, KEY_NEXT }, 67 { 0x2a, KEY_NEXT },
68 68
69 { 0xcb06, KEY_AUDIO }, /* Music */ 69 { 0x06, KEY_AUDIO }, /* Music */
70 { 0xca05, KEY_IMAGES }, /* Photos */ 70 { 0x05, KEY_IMAGES }, /* Photos */
71 { 0xc904, KEY_DVD }, 71 { 0x04, KEY_DVD },
72 { 0xc803, KEY_TV }, 72 { 0x03, KEY_TV },
73 { 0xcc07, KEY_VIDEO }, 73 { 0x07, KEY_VIDEO },
74 74
75 { 0xc601, KEY_HELP }, 75 { 0x01, KEY_HELP },
76 { 0xf22d, KEY_MODE }, /* Mouse */ 76 { 0x2d, KEY_MODE }, /* Mouse */
77 77
78 { 0xde19, KEY_A }, 78 { 0x19, KEY_A },
79 { 0xe01b, KEY_B }, 79 { 0x1b, KEY_B },
80 { 0xe621, KEY_C }, 80 { 0x21, KEY_C },
81 { 0xe823, KEY_D }, 81 { 0x23, KEY_D },
82}; 82};
83 83
84static struct rc_map_list snapstream_firefly_map = { 84static struct rc_map_list snapstream_firefly_map = {
diff --git a/drivers/media/video/au0828/au0828-cards.c b/drivers/media/video/au0828/au0828-cards.c
index 39fc923fc46b..1c6015a04f96 100644
--- a/drivers/media/video/au0828/au0828-cards.c
+++ b/drivers/media/video/au0828/au0828-cards.c
@@ -162,11 +162,14 @@ static void hauppauge_eeprom(struct au0828_dev *dev, u8 *eeprom_data)
162 switch (tv.model) { 162 switch (tv.model) {
163 case 72000: /* WinTV-HVR950q (Retail, IR, ATSC/QAM */ 163 case 72000: /* WinTV-HVR950q (Retail, IR, ATSC/QAM */
164 case 72001: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */ 164 case 72001: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */
165 case 72101: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */
166 case 72201: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
165 case 72211: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */ 167 case 72211: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
166 case 72221: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */ 168 case 72221: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
167 case 72231: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */ 169 case 72231: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
168 case 72241: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */ 170 case 72241: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */
169 case 72251: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */ 171 case 72251: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */
172 case 72261: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
170 case 72301: /* WinTV-HVR850 (Retail, IR, ATSC and analog video */ 173 case 72301: /* WinTV-HVR850 (Retail, IR, ATSC and analog video */
171 case 72500: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM */ 174 case 72500: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM */
172 break; 175 break;
@@ -324,6 +327,10 @@ struct usb_device_id au0828_usb_id_table[] = {
324 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL }, 327 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
325 { USB_DEVICE(0x2040, 0x8200), 328 { USB_DEVICE(0x2040, 0x8200),
326 .driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY }, 329 .driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY },
330 { USB_DEVICE(0x2040, 0x7260),
331 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q },
332 { USB_DEVICE(0x2040, 0x7213),
333 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q },
327 { }, 334 { },
328}; 335};
329 336
diff --git a/drivers/media/video/m5mols/m5mols.h b/drivers/media/video/m5mols/m5mols.h
index 89d09a8914f8..82c8817bd32d 100644
--- a/drivers/media/video/m5mols/m5mols.h
+++ b/drivers/media/video/m5mols/m5mols.h
@@ -162,7 +162,6 @@ struct m5mols_version {
162 * @pad: media pad 162 * @pad: media pad
163 * @ffmt: current fmt according to resolution type 163 * @ffmt: current fmt according to resolution type
164 * @res_type: current resolution type 164 * @res_type: current resolution type
165 * @code: current code
166 * @irq_waitq: waitqueue for the capture 165 * @irq_waitq: waitqueue for the capture
167 * @work_irq: workqueue for the IRQ 166 * @work_irq: workqueue for the IRQ
168 * @flags: state variable for the interrupt handler 167 * @flags: state variable for the interrupt handler
@@ -192,7 +191,6 @@ struct m5mols_info {
192 struct media_pad pad; 191 struct media_pad pad;
193 struct v4l2_mbus_framefmt ffmt[M5MOLS_RESTYPE_MAX]; 192 struct v4l2_mbus_framefmt ffmt[M5MOLS_RESTYPE_MAX];
194 int res_type; 193 int res_type;
195 enum v4l2_mbus_pixelcode code;
196 wait_queue_head_t irq_waitq; 194 wait_queue_head_t irq_waitq;
197 struct work_struct work_irq; 195 struct work_struct work_irq;
198 unsigned long flags; 196 unsigned long flags;
diff --git a/drivers/media/video/m5mols/m5mols_core.c b/drivers/media/video/m5mols/m5mols_core.c
index 05ab3700647e..e0f09e531800 100644
--- a/drivers/media/video/m5mols/m5mols_core.c
+++ b/drivers/media/video/m5mols/m5mols_core.c
@@ -334,7 +334,7 @@ int m5mols_mode(struct m5mols_info *info, u8 mode)
334 int ret = -EINVAL; 334 int ret = -EINVAL;
335 u8 reg; 335 u8 reg;
336 336
337 if (mode < REG_PARAMETER && mode > REG_CAPTURE) 337 if (mode < REG_PARAMETER || mode > REG_CAPTURE)
338 return ret; 338 return ret;
339 339
340 ret = m5mols_read_u8(sd, SYSTEM_SYSMODE, &reg); 340 ret = m5mols_read_u8(sd, SYSTEM_SYSMODE, &reg);
@@ -511,9 +511,6 @@ static int m5mols_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
511 struct m5mols_info *info = to_m5mols(sd); 511 struct m5mols_info *info = to_m5mols(sd);
512 struct v4l2_mbus_framefmt *format; 512 struct v4l2_mbus_framefmt *format;
513 513
514 if (fmt->pad != 0)
515 return -EINVAL;
516
517 format = __find_format(info, fh, fmt->which, info->res_type); 514 format = __find_format(info, fh, fmt->which, info->res_type);
518 if (!format) 515 if (!format)
519 return -EINVAL; 516 return -EINVAL;
@@ -532,9 +529,6 @@ static int m5mols_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
532 u32 resolution = 0; 529 u32 resolution = 0;
533 int ret; 530 int ret;
534 531
535 if (fmt->pad != 0)
536 return -EINVAL;
537
538 ret = __find_resolution(sd, format, &type, &resolution); 532 ret = __find_resolution(sd, format, &type, &resolution);
539 if (ret < 0) 533 if (ret < 0)
540 return ret; 534 return ret;
@@ -543,13 +537,14 @@ static int m5mols_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
543 if (!sfmt) 537 if (!sfmt)
544 return 0; 538 return 0;
545 539
546 *sfmt = m5mols_default_ffmt[type]; 540
547 sfmt->width = format->width; 541 format->code = m5mols_default_ffmt[type].code;
548 sfmt->height = format->height; 542 format->colorspace = V4L2_COLORSPACE_JPEG;
543 format->field = V4L2_FIELD_NONE;
549 544
550 if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { 545 if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
546 *sfmt = *format;
551 info->resolution = resolution; 547 info->resolution = resolution;
552 info->code = format->code;
553 info->res_type = type; 548 info->res_type = type;
554 } 549 }
555 550
@@ -626,13 +621,14 @@ static int m5mols_start_monitor(struct m5mols_info *info)
626static int m5mols_s_stream(struct v4l2_subdev *sd, int enable) 621static int m5mols_s_stream(struct v4l2_subdev *sd, int enable)
627{ 622{
628 struct m5mols_info *info = to_m5mols(sd); 623 struct m5mols_info *info = to_m5mols(sd);
624 u32 code = info->ffmt[info->res_type].code;
629 625
630 if (enable) { 626 if (enable) {
631 int ret = -EINVAL; 627 int ret = -EINVAL;
632 628
633 if (is_code(info->code, M5MOLS_RESTYPE_MONITOR)) 629 if (is_code(code, M5MOLS_RESTYPE_MONITOR))
634 ret = m5mols_start_monitor(info); 630 ret = m5mols_start_monitor(info);
635 if (is_code(info->code, M5MOLS_RESTYPE_CAPTURE)) 631 if (is_code(code, M5MOLS_RESTYPE_CAPTURE))
636 ret = m5mols_start_capture(info); 632 ret = m5mols_start_capture(info);
637 633
638 return ret; 634 return ret;
diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c
index 258adfd99e67..95ca6c74f5df 100644
--- a/drivers/media/video/mt9m111.c
+++ b/drivers/media/video/mt9m111.c
@@ -954,6 +954,7 @@ static int mt9m111_probe(struct i2c_client *client,
954 mt9m111->rect.height = MT9M111_MAX_HEIGHT; 954 mt9m111->rect.height = MT9M111_MAX_HEIGHT;
955 mt9m111->fmt = &mt9m111_colour_fmts[0]; 955 mt9m111->fmt = &mt9m111_colour_fmts[0];
956 mt9m111->lastpage = -1; 956 mt9m111->lastpage = -1;
957 mutex_init(&mt9m111->power_lock);
957 958
958 ret = mt9m111_video_probe(client); 959 ret = mt9m111_video_probe(client);
959 if (ret) { 960 if (ret) {
diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
index def647242bb3..00d6d192b88c 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -38,6 +38,7 @@
38#include <linux/irq.h> 38#include <linux/irq.h>
39#include <linux/videodev2.h> 39#include <linux/videodev2.h>
40#include <linux/dma-mapping.h> 40#include <linux/dma-mapping.h>
41#include <linux/slab.h>
41 42
42#include <media/videobuf-dma-contig.h> 43#include <media/videobuf-dma-contig.h>
43#include <media/v4l2-device.h> 44#include <media/v4l2-device.h>
@@ -2174,6 +2175,14 @@ static int __init omap_vout_probe(struct platform_device *pdev)
2174 vid_dev->num_displays = 0; 2175 vid_dev->num_displays = 0;
2175 for_each_dss_dev(dssdev) { 2176 for_each_dss_dev(dssdev) {
2176 omap_dss_get_device(dssdev); 2177 omap_dss_get_device(dssdev);
2178
2179 if (!dssdev->driver) {
2180 dev_warn(&pdev->dev, "no driver for display: %s\n",
2181 dssdev->name);
2182 omap_dss_put_device(dssdev);
2183 continue;
2184 }
2185
2177 vid_dev->displays[vid_dev->num_displays++] = dssdev; 2186 vid_dev->displays[vid_dev->num_displays++] = dssdev;
2178 } 2187 }
2179 2188
diff --git a/drivers/media/video/omap24xxcam-dma.c b/drivers/media/video/omap24xxcam-dma.c
index 1d54b86c936b..3ea38a8def8e 100644
--- a/drivers/media/video/omap24xxcam-dma.c
+++ b/drivers/media/video/omap24xxcam-dma.c
@@ -506,7 +506,7 @@ int omap24xxcam_sgdma_queue(struct omap24xxcam_sgdma *sgdma,
506 unsigned long flags; 506 unsigned long flags;
507 struct sgdma_state *sg_state; 507 struct sgdma_state *sg_state;
508 508
509 if ((sglen < 0) || ((sglen > 0) & !sglist)) 509 if ((sglen < 0) || ((sglen > 0) && !sglist))
510 return -EINVAL; 510 return -EINVAL;
511 511
512 spin_lock_irqsave(&sgdma->lock, flags); 512 spin_lock_irqsave(&sgdma->lock, flags);
diff --git a/drivers/media/video/omap3isp/ispstat.c b/drivers/media/video/omap3isp/ispstat.c
index 68d539456c55..bc0b2c7349b9 100644
--- a/drivers/media/video/omap3isp/ispstat.c
+++ b/drivers/media/video/omap3isp/ispstat.c
@@ -496,7 +496,7 @@ static int isp_stat_bufs_alloc(struct ispstat *stat, u32 size)
496 496
497static void isp_stat_queue_event(struct ispstat *stat, int err) 497static void isp_stat_queue_event(struct ispstat *stat, int err)
498{ 498{
499 struct video_device *vdev = &stat->subdev.devnode; 499 struct video_device *vdev = stat->subdev.devnode;
500 struct v4l2_event event; 500 struct v4l2_event event;
501 struct omap3isp_stat_event_status *status = (void *)event.u.data; 501 struct omap3isp_stat_event_status *status = (void *)event.u.data;
502 502
diff --git a/drivers/media/video/omap3isp/ispvideo.c b/drivers/media/video/omap3isp/ispvideo.c
index ffb9f00b391c..615dae58942b 100644
--- a/drivers/media/video/omap3isp/ispvideo.c
+++ b/drivers/media/video/omap3isp/ispvideo.c
@@ -26,6 +26,7 @@
26#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/mm.h> 28#include <linux/mm.h>
29#include <linux/module.h>
29#include <linux/pagemap.h> 30#include <linux/pagemap.h>
30#include <linux/scatterlist.h> 31#include <linux/scatterlist.h>
31#include <linux/sched.h> 32#include <linux/sched.h>
diff --git a/drivers/media/video/ov6650.c b/drivers/media/video/ov6650.c
index 9f2d26b1d4cb..6806345ec2f0 100644
--- a/drivers/media/video/ov6650.c
+++ b/drivers/media/video/ov6650.c
@@ -540,7 +540,7 @@ static u8 to_clkrc(struct v4l2_fract *timeperframe,
540static int ov6650_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) 540static int ov6650_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf)
541{ 541{
542 struct i2c_client *client = v4l2_get_subdevdata(sd); 542 struct i2c_client *client = v4l2_get_subdevdata(sd);
543 struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id; 543 struct soc_camera_device *icd = v4l2_get_subdev_hostdata(sd);
544 struct soc_camera_sense *sense = icd->sense; 544 struct soc_camera_sense *sense = icd->sense;
545 struct ov6650 *priv = to_ov6650(client); 545 struct ov6650 *priv = to_ov6650(client);
546 bool half_scale = !is_unscaled_ok(mf->width, mf->height, &priv->rect); 546 bool half_scale = !is_unscaled_ok(mf->width, mf->height, &priv->rect);
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c
index c8d91b0cd9bd..2cc3b9166724 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -98,6 +98,10 @@ static int fimc_capture_state_cleanup(struct fimc_dev *fimc, bool suspend)
98 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); 98 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
99 } 99 }
100 set_bit(ST_CAPT_SUSPENDED, &fimc->state); 100 set_bit(ST_CAPT_SUSPENDED, &fimc->state);
101
102 fimc_hw_reset(fimc);
103 cap->buf_index = 0;
104
101 spin_unlock_irqrestore(&fimc->slock, flags); 105 spin_unlock_irqrestore(&fimc->slock, flags);
102 106
103 if (streaming) 107 if (streaming)
@@ -137,7 +141,7 @@ int fimc_capture_config_update(struct fimc_ctx *ctx)
137 struct fimc_dev *fimc = ctx->fimc_dev; 141 struct fimc_dev *fimc = ctx->fimc_dev;
138 int ret; 142 int ret;
139 143
140 if (test_bit(ST_CAPT_APPLY_CFG, &fimc->state)) 144 if (!test_bit(ST_CAPT_APPLY_CFG, &fimc->state))
141 return 0; 145 return 0;
142 146
143 spin_lock(&ctx->slock); 147 spin_lock(&ctx->slock);
@@ -150,7 +154,7 @@ int fimc_capture_config_update(struct fimc_ctx *ctx)
150 fimc_hw_set_rotation(ctx); 154 fimc_hw_set_rotation(ctx);
151 fimc_prepare_dma_offset(ctx, &ctx->d_frame); 155 fimc_prepare_dma_offset(ctx, &ctx->d_frame);
152 fimc_hw_set_out_dma(ctx); 156 fimc_hw_set_out_dma(ctx);
153 set_bit(ST_CAPT_APPLY_CFG, &fimc->state); 157 clear_bit(ST_CAPT_APPLY_CFG, &fimc->state);
154 } 158 }
155 spin_unlock(&ctx->slock); 159 spin_unlock(&ctx->slock);
156 return ret; 160 return ret;
@@ -164,7 +168,6 @@ static int start_streaming(struct vb2_queue *q, unsigned int count)
164 int min_bufs; 168 int min_bufs;
165 int ret; 169 int ret;
166 170
167 fimc_hw_reset(fimc);
168 vid_cap->frame_count = 0; 171 vid_cap->frame_count = 0;
169 172
170 ret = fimc_init_capture(fimc); 173 ret = fimc_init_capture(fimc);
@@ -523,7 +526,7 @@ static struct fimc_fmt *fimc_capture_try_format(struct fimc_ctx *ctx,
523 max_w = rotation ? pl->out_rot_en_w : pl->out_rot_dis_w; 526 max_w = rotation ? pl->out_rot_en_w : pl->out_rot_dis_w;
524 min_w = ctx->state & FIMC_DST_CROP ? dst->width : var->min_out_pixsize; 527 min_w = ctx->state & FIMC_DST_CROP ? dst->width : var->min_out_pixsize;
525 min_h = ctx->state & FIMC_DST_CROP ? dst->height : var->min_out_pixsize; 528 min_h = ctx->state & FIMC_DST_CROP ? dst->height : var->min_out_pixsize;
526 if (fimc->id == 1 && var->pix_hoff) 529 if (var->min_vsize_align == 1 && !rotation)
527 align_h = fimc_fmt_is_rgb(ffmt->color) ? 0 : 1; 530 align_h = fimc_fmt_is_rgb(ffmt->color) ? 0 : 1;
528 531
529 depth = fimc_get_format_depth(ffmt); 532 depth = fimc_get_format_depth(ffmt);
@@ -1239,6 +1242,7 @@ static int fimc_subdev_set_fmt(struct v4l2_subdev *sd,
1239 1242
1240 mutex_lock(&fimc->lock); 1243 mutex_lock(&fimc->lock);
1241 set_frame_bounds(ff, mf->width, mf->height); 1244 set_frame_bounds(ff, mf->width, mf->height);
1245 fimc->vid_cap.mf = *mf;
1242 ff->fmt = ffmt; 1246 ff->fmt = ffmt;
1243 1247
1244 /* Reset the crop rectangle if required. */ 1248 /* Reset the crop rectangle if required. */
@@ -1375,7 +1379,7 @@ static void fimc_destroy_capture_subdev(struct fimc_dev *fimc)
1375 media_entity_cleanup(&sd->entity); 1379 media_entity_cleanup(&sd->entity);
1376 v4l2_device_unregister_subdev(sd); 1380 v4l2_device_unregister_subdev(sd);
1377 kfree(sd); 1381 kfree(sd);
1378 sd = NULL; 1382 fimc->vid_cap.subdev = NULL;
1379} 1383}
1380 1384
1381/* Set default format at the sensor and host interface */ 1385/* Set default format at the sensor and host interface */
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c
index 19ca6db38b2f..07c6254faee3 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.c
+++ b/drivers/media/video/s5p-fimc/fimc-core.c
@@ -37,7 +37,7 @@ static char *fimc_clocks[MAX_FIMC_CLOCKS] = {
37static struct fimc_fmt fimc_formats[] = { 37static struct fimc_fmt fimc_formats[] = {
38 { 38 {
39 .name = "RGB565", 39 .name = "RGB565",
40 .fourcc = V4L2_PIX_FMT_RGB565X, 40 .fourcc = V4L2_PIX_FMT_RGB565,
41 .depth = { 16 }, 41 .depth = { 16 },
42 .color = S5P_FIMC_RGB565, 42 .color = S5P_FIMC_RGB565,
43 .memplanes = 1, 43 .memplanes = 1,
@@ -1038,12 +1038,11 @@ static int fimc_try_fmt_mplane(struct fimc_ctx *ctx, struct v4l2_format *f)
1038 mod_x = 6; /* 64 x 32 pixels tile */ 1038 mod_x = 6; /* 64 x 32 pixels tile */
1039 mod_y = 5; 1039 mod_y = 5;
1040 } else { 1040 } else {
1041 if (fimc->id == 1 && variant->pix_hoff) 1041 if (variant->min_vsize_align == 1)
1042 mod_y = fimc_fmt_is_rgb(fmt->color) ? 0 : 1; 1042 mod_y = fimc_fmt_is_rgb(fmt->color) ? 0 : 1;
1043 else 1043 else
1044 mod_y = mod_x; 1044 mod_y = ffs(variant->min_vsize_align) - 1;
1045 } 1045 }
1046 dbg("mod_x: %d, mod_y: %d, max_w: %d", mod_x, mod_y, max_w);
1047 1046
1048 v4l_bound_align_image(&pix->width, 16, max_w, mod_x, 1047 v4l_bound_align_image(&pix->width, 16, max_w, mod_x,
1049 &pix->height, 8, variant->pix_limit->scaler_dis_w, mod_y, 0); 1048 &pix->height, 8, variant->pix_limit->scaler_dis_w, mod_y, 0);
@@ -1226,10 +1225,10 @@ static int fimc_m2m_try_crop(struct fimc_ctx *ctx, struct v4l2_crop *cr)
1226 fimc->variant->min_inp_pixsize : fimc->variant->min_out_pixsize; 1225 fimc->variant->min_inp_pixsize : fimc->variant->min_out_pixsize;
1227 1226
1228 /* Get pixel alignment constraints. */ 1227 /* Get pixel alignment constraints. */
1229 if (fimc->id == 1 && fimc->variant->pix_hoff) 1228 if (fimc->variant->min_vsize_align == 1)
1230 halign = fimc_fmt_is_rgb(f->fmt->color) ? 0 : 1; 1229 halign = fimc_fmt_is_rgb(f->fmt->color) ? 0 : 1;
1231 else 1230 else
1232 halign = ffs(min_size) - 1; 1231 halign = ffs(fimc->variant->min_vsize_align) - 1;
1233 1232
1234 for (i = 0; i < f->fmt->colplanes; i++) 1233 for (i = 0; i < f->fmt->colplanes; i++)
1235 depth += f->fmt->depth[i]; 1234 depth += f->fmt->depth[i];
@@ -1615,7 +1614,6 @@ static int fimc_probe(struct platform_device *pdev)
1615 pdata = pdev->dev.platform_data; 1614 pdata = pdev->dev.platform_data;
1616 fimc->pdata = pdata; 1615 fimc->pdata = pdata;
1617 1616
1618 set_bit(ST_LPM, &fimc->state);
1619 1617
1620 init_waitqueue_head(&fimc->irq_queue); 1618 init_waitqueue_head(&fimc->irq_queue);
1621 spin_lock_init(&fimc->slock); 1619 spin_lock_init(&fimc->slock);
@@ -1707,8 +1705,6 @@ static int fimc_runtime_resume(struct device *dev)
1707 /* Enable clocks and perform basic initalization */ 1705 /* Enable clocks and perform basic initalization */
1708 clk_enable(fimc->clock[CLK_GATE]); 1706 clk_enable(fimc->clock[CLK_GATE]);
1709 fimc_hw_reset(fimc); 1707 fimc_hw_reset(fimc);
1710 if (fimc->variant->out_buf_count > 4)
1711 fimc_hw_set_dma_seq(fimc, 0xF);
1712 1708
1713 /* Resume the capture or mem-to-mem device */ 1709 /* Resume the capture or mem-to-mem device */
1714 if (fimc_capture_busy(fimc)) 1710 if (fimc_capture_busy(fimc))
@@ -1750,8 +1746,6 @@ static int fimc_resume(struct device *dev)
1750 return 0; 1746 return 0;
1751 } 1747 }
1752 fimc_hw_reset(fimc); 1748 fimc_hw_reset(fimc);
1753 if (fimc->variant->out_buf_count > 4)
1754 fimc_hw_set_dma_seq(fimc, 0xF);
1755 spin_unlock_irqrestore(&fimc->slock, flags); 1749 spin_unlock_irqrestore(&fimc->slock, flags);
1756 1750
1757 if (fimc_capture_busy(fimc)) 1751 if (fimc_capture_busy(fimc))
@@ -1780,7 +1774,6 @@ static int __devexit fimc_remove(struct platform_device *pdev)
1780 struct fimc_dev *fimc = platform_get_drvdata(pdev); 1774 struct fimc_dev *fimc = platform_get_drvdata(pdev);
1781 1775
1782 pm_runtime_disable(&pdev->dev); 1776 pm_runtime_disable(&pdev->dev);
1783 fimc_runtime_suspend(&pdev->dev);
1784 pm_runtime_set_suspended(&pdev->dev); 1777 pm_runtime_set_suspended(&pdev->dev);
1785 1778
1786 vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx); 1779 vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx);
@@ -1840,6 +1833,7 @@ static struct samsung_fimc_variant fimc0_variant_s5p = {
1840 .min_inp_pixsize = 16, 1833 .min_inp_pixsize = 16,
1841 .min_out_pixsize = 16, 1834 .min_out_pixsize = 16,
1842 .hor_offs_align = 8, 1835 .hor_offs_align = 8,
1836 .min_vsize_align = 16,
1843 .out_buf_count = 4, 1837 .out_buf_count = 4,
1844 .pix_limit = &s5p_pix_limit[0], 1838 .pix_limit = &s5p_pix_limit[0],
1845}; 1839};
@@ -1849,6 +1843,7 @@ static struct samsung_fimc_variant fimc2_variant_s5p = {
1849 .min_inp_pixsize = 16, 1843 .min_inp_pixsize = 16,
1850 .min_out_pixsize = 16, 1844 .min_out_pixsize = 16,
1851 .hor_offs_align = 8, 1845 .hor_offs_align = 8,
1846 .min_vsize_align = 16,
1852 .out_buf_count = 4, 1847 .out_buf_count = 4,
1853 .pix_limit = &s5p_pix_limit[1], 1848 .pix_limit = &s5p_pix_limit[1],
1854}; 1849};
@@ -1861,6 +1856,7 @@ static struct samsung_fimc_variant fimc0_variant_s5pv210 = {
1861 .min_inp_pixsize = 16, 1856 .min_inp_pixsize = 16,
1862 .min_out_pixsize = 16, 1857 .min_out_pixsize = 16,
1863 .hor_offs_align = 8, 1858 .hor_offs_align = 8,
1859 .min_vsize_align = 16,
1864 .out_buf_count = 4, 1860 .out_buf_count = 4,
1865 .pix_limit = &s5p_pix_limit[1], 1861 .pix_limit = &s5p_pix_limit[1],
1866}; 1862};
@@ -1874,6 +1870,7 @@ static struct samsung_fimc_variant fimc1_variant_s5pv210 = {
1874 .min_inp_pixsize = 16, 1870 .min_inp_pixsize = 16,
1875 .min_out_pixsize = 16, 1871 .min_out_pixsize = 16,
1876 .hor_offs_align = 1, 1872 .hor_offs_align = 1,
1873 .min_vsize_align = 1,
1877 .out_buf_count = 4, 1874 .out_buf_count = 4,
1878 .pix_limit = &s5p_pix_limit[2], 1875 .pix_limit = &s5p_pix_limit[2],
1879}; 1876};
@@ -1884,6 +1881,7 @@ static struct samsung_fimc_variant fimc2_variant_s5pv210 = {
1884 .min_inp_pixsize = 16, 1881 .min_inp_pixsize = 16,
1885 .min_out_pixsize = 16, 1882 .min_out_pixsize = 16,
1886 .hor_offs_align = 8, 1883 .hor_offs_align = 8,
1884 .min_vsize_align = 16,
1887 .out_buf_count = 4, 1885 .out_buf_count = 4,
1888 .pix_limit = &s5p_pix_limit[2], 1886 .pix_limit = &s5p_pix_limit[2],
1889}; 1887};
@@ -1898,6 +1896,7 @@ static struct samsung_fimc_variant fimc0_variant_exynos4 = {
1898 .min_inp_pixsize = 16, 1896 .min_inp_pixsize = 16,
1899 .min_out_pixsize = 16, 1897 .min_out_pixsize = 16,
1900 .hor_offs_align = 2, 1898 .hor_offs_align = 2,
1899 .min_vsize_align = 1,
1901 .out_buf_count = 32, 1900 .out_buf_count = 32,
1902 .pix_limit = &s5p_pix_limit[1], 1901 .pix_limit = &s5p_pix_limit[1],
1903}; 1902};
@@ -1910,6 +1909,7 @@ static struct samsung_fimc_variant fimc3_variant_exynos4 = {
1910 .min_inp_pixsize = 16, 1909 .min_inp_pixsize = 16,
1911 .min_out_pixsize = 16, 1910 .min_out_pixsize = 16,
1912 .hor_offs_align = 2, 1911 .hor_offs_align = 2,
1912 .min_vsize_align = 1,
1913 .out_buf_count = 32, 1913 .out_buf_count = 32,
1914 .pix_limit = &s5p_pix_limit[3], 1914 .pix_limit = &s5p_pix_limit[3],
1915}; 1915};
diff --git a/drivers/media/video/s5p-fimc/fimc-core.h b/drivers/media/video/s5p-fimc/fimc-core.h
index a6936dad5b10..c7f01c47b20f 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.h
+++ b/drivers/media/video/s5p-fimc/fimc-core.h
@@ -377,6 +377,7 @@ struct fimc_pix_limit {
377 * @min_inp_pixsize: minimum input pixel size 377 * @min_inp_pixsize: minimum input pixel size
378 * @min_out_pixsize: minimum output pixel size 378 * @min_out_pixsize: minimum output pixel size
379 * @hor_offs_align: horizontal pixel offset aligment 379 * @hor_offs_align: horizontal pixel offset aligment
380 * @min_vsize_align: minimum vertical pixel size alignment
380 * @out_buf_count: the number of buffers in output DMA sequence 381 * @out_buf_count: the number of buffers in output DMA sequence
381 */ 382 */
382struct samsung_fimc_variant { 383struct samsung_fimc_variant {
@@ -390,6 +391,7 @@ struct samsung_fimc_variant {
390 u16 min_inp_pixsize; 391 u16 min_inp_pixsize;
391 u16 min_out_pixsize; 392 u16 min_out_pixsize;
392 u16 hor_offs_align; 393 u16 hor_offs_align;
394 u16 min_vsize_align;
393 u16 out_buf_count; 395 u16 out_buf_count;
394}; 396};
395 397
diff --git a/drivers/media/video/s5p-fimc/fimc-mdevice.c b/drivers/media/video/s5p-fimc/fimc-mdevice.c
index cc337b1de913..615c862f0360 100644
--- a/drivers/media/video/s5p-fimc/fimc-mdevice.c
+++ b/drivers/media/video/s5p-fimc/fimc-mdevice.c
@@ -220,6 +220,7 @@ static struct v4l2_subdev *fimc_md_register_sensor(struct fimc_md *fmd,
220 sd = v4l2_i2c_new_subdev_board(&fmd->v4l2_dev, adapter, 220 sd = v4l2_i2c_new_subdev_board(&fmd->v4l2_dev, adapter,
221 s_info->pdata->board_info, NULL); 221 s_info->pdata->board_info, NULL);
222 if (IS_ERR_OR_NULL(sd)) { 222 if (IS_ERR_OR_NULL(sd)) {
223 i2c_put_adapter(adapter);
223 v4l2_err(&fmd->v4l2_dev, "Failed to acquire subdev\n"); 224 v4l2_err(&fmd->v4l2_dev, "Failed to acquire subdev\n");
224 return NULL; 225 return NULL;
225 } 226 }
@@ -234,12 +235,15 @@ static struct v4l2_subdev *fimc_md_register_sensor(struct fimc_md *fmd,
234static void fimc_md_unregister_sensor(struct v4l2_subdev *sd) 235static void fimc_md_unregister_sensor(struct v4l2_subdev *sd)
235{ 236{
236 struct i2c_client *client = v4l2_get_subdevdata(sd); 237 struct i2c_client *client = v4l2_get_subdevdata(sd);
238 struct i2c_adapter *adapter;
237 239
238 if (!client) 240 if (!client)
239 return; 241 return;
240 v4l2_device_unregister_subdev(sd); 242 v4l2_device_unregister_subdev(sd);
243 adapter = client->adapter;
241 i2c_unregister_device(client); 244 i2c_unregister_device(client);
242 i2c_put_adapter(client->adapter); 245 if (adapter)
246 i2c_put_adapter(adapter);
243} 247}
244 248
245static int fimc_md_register_sensor_entities(struct fimc_md *fmd) 249static int fimc_md_register_sensor_entities(struct fimc_md *fmd)
@@ -381,20 +385,28 @@ static void fimc_md_unregister_entities(struct fimc_md *fmd)
381 385
382static int fimc_md_register_video_nodes(struct fimc_md *fmd) 386static int fimc_md_register_video_nodes(struct fimc_md *fmd)
383{ 387{
388 struct video_device *vdev;
384 int i, ret = 0; 389 int i, ret = 0;
385 390
386 for (i = 0; i < FIMC_MAX_DEVS && !ret; i++) { 391 for (i = 0; i < FIMC_MAX_DEVS && !ret; i++) {
387 if (!fmd->fimc[i]) 392 if (!fmd->fimc[i])
388 continue; 393 continue;
389 394
390 if (fmd->fimc[i]->m2m.vfd) 395 vdev = fmd->fimc[i]->m2m.vfd;
391 ret = video_register_device(fmd->fimc[i]->m2m.vfd, 396 if (vdev) {
392 VFL_TYPE_GRABBER, -1); 397 ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
393 if (ret) 398 if (ret)
394 break; 399 break;
395 if (fmd->fimc[i]->vid_cap.vfd) 400 v4l2_info(&fmd->v4l2_dev, "Registered %s as /dev/%s\n",
396 ret = video_register_device(fmd->fimc[i]->vid_cap.vfd, 401 vdev->name, video_device_node_name(vdev));
397 VFL_TYPE_GRABBER, -1); 402 }
403
404 vdev = fmd->fimc[i]->vid_cap.vfd;
405 if (vdev == NULL)
406 continue;
407 ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
408 v4l2_info(&fmd->v4l2_dev, "Registered %s as /dev/%s\n",
409 vdev->name, video_device_node_name(vdev));
398 } 410 }
399 411
400 return ret; 412 return ret;
@@ -502,7 +514,7 @@ static int fimc_md_create_links(struct fimc_md *fmd)
502 if (WARN(csis == NULL, 514 if (WARN(csis == NULL,
503 "MIPI-CSI interface specified " 515 "MIPI-CSI interface specified "
504 "but s5p-csis module is not loaded!\n")) 516 "but s5p-csis module is not loaded!\n"))
505 continue; 517 return -EINVAL;
506 518
507 ret = media_entity_create_link(&sensor->entity, 0, 519 ret = media_entity_create_link(&sensor->entity, 0,
508 &csis->entity, CSIS_PAD_SINK, 520 &csis->entity, CSIS_PAD_SINK,
@@ -742,9 +754,6 @@ static int __devinit fimc_md_probe(struct platform_device *pdev)
742 struct fimc_md *fmd; 754 struct fimc_md *fmd;
743 int ret; 755 int ret;
744 756
745 if (WARN(!pdev->dev.platform_data, "Platform data not specified!\n"))
746 return -EINVAL;
747
748 fmd = kzalloc(sizeof(struct fimc_md), GFP_KERNEL); 757 fmd = kzalloc(sizeof(struct fimc_md), GFP_KERNEL);
749 if (!fmd) 758 if (!fmd)
750 return -ENOMEM; 759 return -ENOMEM;
@@ -782,9 +791,11 @@ static int __devinit fimc_md_probe(struct platform_device *pdev)
782 if (ret) 791 if (ret)
783 goto err3; 792 goto err3;
784 793
785 ret = fimc_md_register_sensor_entities(fmd); 794 if (pdev->dev.platform_data) {
786 if (ret) 795 ret = fimc_md_register_sensor_entities(fmd);
787 goto err3; 796 if (ret)
797 goto err3;
798 }
788 ret = fimc_md_create_links(fmd); 799 ret = fimc_md_create_links(fmd);
789 if (ret) 800 if (ret)
790 goto err3; 801 goto err3;
diff --git a/drivers/media/video/s5p-fimc/fimc-reg.c b/drivers/media/video/s5p-fimc/fimc-reg.c
index 20e664e34163..44f5c2d1920b 100644
--- a/drivers/media/video/s5p-fimc/fimc-reg.c
+++ b/drivers/media/video/s5p-fimc/fimc-reg.c
@@ -35,6 +35,9 @@ void fimc_hw_reset(struct fimc_dev *dev)
35 cfg = readl(dev->regs + S5P_CIGCTRL); 35 cfg = readl(dev->regs + S5P_CIGCTRL);
36 cfg &= ~S5P_CIGCTRL_SWRST; 36 cfg &= ~S5P_CIGCTRL_SWRST;
37 writel(cfg, dev->regs + S5P_CIGCTRL); 37 writel(cfg, dev->regs + S5P_CIGCTRL);
38
39 if (dev->variant->out_buf_count > 4)
40 fimc_hw_set_dma_seq(dev, 0xF);
38} 41}
39 42
40static u32 fimc_hw_get_in_flip(struct fimc_ctx *ctx) 43static u32 fimc_hw_get_in_flip(struct fimc_ctx *ctx)
@@ -251,7 +254,14 @@ static void fimc_hw_set_scaler(struct fimc_ctx *ctx)
251 struct fimc_scaler *sc = &ctx->scaler; 254 struct fimc_scaler *sc = &ctx->scaler;
252 struct fimc_frame *src_frame = &ctx->s_frame; 255 struct fimc_frame *src_frame = &ctx->s_frame;
253 struct fimc_frame *dst_frame = &ctx->d_frame; 256 struct fimc_frame *dst_frame = &ctx->d_frame;
254 u32 cfg = 0; 257
258 u32 cfg = readl(dev->regs + S5P_CISCCTRL);
259
260 cfg &= ~(S5P_CISCCTRL_CSCR2Y_WIDE | S5P_CISCCTRL_CSCY2R_WIDE |
261 S5P_CISCCTRL_SCALEUP_H | S5P_CISCCTRL_SCALEUP_V |
262 S5P_CISCCTRL_SCALERBYPASS | S5P_CISCCTRL_ONE2ONE |
263 S5P_CISCCTRL_INRGB_FMT_MASK | S5P_CISCCTRL_OUTRGB_FMT_MASK |
264 S5P_CISCCTRL_INTERLACE | S5P_CISCCTRL_RGB_EXT);
255 265
256 if (!(ctx->flags & FIMC_COLOR_RANGE_NARROW)) 266 if (!(ctx->flags & FIMC_COLOR_RANGE_NARROW))
257 cfg |= (S5P_CISCCTRL_CSCR2Y_WIDE | S5P_CISCCTRL_CSCY2R_WIDE); 267 cfg |= (S5P_CISCCTRL_CSCR2Y_WIDE | S5P_CISCCTRL_CSCY2R_WIDE);
@@ -308,9 +318,9 @@ void fimc_hw_set_mainscaler(struct fimc_ctx *ctx)
308 fimc_hw_set_scaler(ctx); 318 fimc_hw_set_scaler(ctx);
309 319
310 cfg = readl(dev->regs + S5P_CISCCTRL); 320 cfg = readl(dev->regs + S5P_CISCCTRL);
321 cfg &= ~(S5P_CISCCTRL_MHRATIO_MASK | S5P_CISCCTRL_MVRATIO_MASK);
311 322
312 if (variant->has_mainscaler_ext) { 323 if (variant->has_mainscaler_ext) {
313 cfg &= ~(S5P_CISCCTRL_MHRATIO_MASK | S5P_CISCCTRL_MVRATIO_MASK);
314 cfg |= S5P_CISCCTRL_MHRATIO_EXT(sc->main_hratio); 324 cfg |= S5P_CISCCTRL_MHRATIO_EXT(sc->main_hratio);
315 cfg |= S5P_CISCCTRL_MVRATIO_EXT(sc->main_vratio); 325 cfg |= S5P_CISCCTRL_MVRATIO_EXT(sc->main_vratio);
316 writel(cfg, dev->regs + S5P_CISCCTRL); 326 writel(cfg, dev->regs + S5P_CISCCTRL);
@@ -323,7 +333,6 @@ void fimc_hw_set_mainscaler(struct fimc_ctx *ctx)
323 cfg |= S5P_CIEXTEN_MVRATIO_EXT(sc->main_vratio); 333 cfg |= S5P_CIEXTEN_MVRATIO_EXT(sc->main_vratio);
324 writel(cfg, dev->regs + S5P_CIEXTEN); 334 writel(cfg, dev->regs + S5P_CIEXTEN);
325 } else { 335 } else {
326 cfg &= ~(S5P_CISCCTRL_MHRATIO_MASK | S5P_CISCCTRL_MVRATIO_MASK);
327 cfg |= S5P_CISCCTRL_MHRATIO(sc->main_hratio); 336 cfg |= S5P_CISCCTRL_MHRATIO(sc->main_hratio);
328 cfg |= S5P_CISCCTRL_MVRATIO(sc->main_vratio); 337 cfg |= S5P_CISCCTRL_MVRATIO(sc->main_vratio);
329 writel(cfg, dev->regs + S5P_CISCCTRL); 338 writel(cfg, dev->regs + S5P_CISCCTRL);
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c
index 1e8cdb77d4b8..dff9dc798795 100644
--- a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c
@@ -61,7 +61,7 @@ static struct s5p_mfc_fmt formats[] = {
61 .num_planes = 1, 61 .num_planes = 1,
62 }, 62 },
63 { 63 {
64 .name = "H264 Encoded Stream", 64 .name = "H263 Encoded Stream",
65 .fourcc = V4L2_PIX_FMT_H263, 65 .fourcc = V4L2_PIX_FMT_H263,
66 .codec_mode = S5P_FIMV_CODEC_H263_ENC, 66 .codec_mode = S5P_FIMV_CODEC_H263_ENC,
67 .type = MFC_FMT_ENC, 67 .type = MFC_FMT_ENC,
diff --git a/drivers/media/video/s5p-tv/mixer_video.c b/drivers/media/video/s5p-tv/mixer_video.c
index e16d3a4bc1dc..b47d0c06ecf5 100644
--- a/drivers/media/video/s5p-tv/mixer_video.c
+++ b/drivers/media/video/s5p-tv/mixer_video.c
@@ -16,6 +16,7 @@
16#include <media/v4l2-ioctl.h> 16#include <media/v4l2-ioctl.h>
17#include <linux/videodev2.h> 17#include <linux/videodev2.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/module.h>
19#include <linux/version.h> 20#include <linux/version.h>
20#include <linux/timer.h> 21#include <linux/timer.h>
21#include <media/videobuf2-dma-contig.h> 22#include <media/videobuf2-dma-contig.h>
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index f390682629cf..c51decfcae19 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -566,8 +566,10 @@ static int sh_mobile_ceu_add_device(struct soc_camera_device *icd)
566 ret = sh_mobile_ceu_soft_reset(pcdev); 566 ret = sh_mobile_ceu_soft_reset(pcdev);
567 567
568 csi2_sd = find_csi2(pcdev); 568 csi2_sd = find_csi2(pcdev);
569 if (csi2_sd) 569 if (csi2_sd) {
570 csi2_sd->grp_id = (long)icd; 570 csi2_sd->grp_id = soc_camera_grp_id(icd);
571 v4l2_set_subdev_hostdata(csi2_sd, icd);
572 }
571 573
572 ret = v4l2_subdev_call(csi2_sd, core, s_power, 1); 574 ret = v4l2_subdev_call(csi2_sd, core, s_power, 1);
573 if (ret < 0 && ret != -ENOIOCTLCMD && ret != -ENODEV) { 575 if (ret < 0 && ret != -ENOIOCTLCMD && ret != -ENODEV) {
@@ -768,7 +770,7 @@ static struct v4l2_subdev *find_bus_subdev(struct sh_mobile_ceu_dev *pcdev,
768{ 770{
769 if (pcdev->csi2_pdev) { 771 if (pcdev->csi2_pdev) {
770 struct v4l2_subdev *csi2_sd = find_csi2(pcdev); 772 struct v4l2_subdev *csi2_sd = find_csi2(pcdev);
771 if (csi2_sd && csi2_sd->grp_id == (u32)icd) 773 if (csi2_sd && csi2_sd->grp_id == soc_camera_grp_id(icd))
772 return csi2_sd; 774 return csi2_sd;
773 } 775 }
774 776
@@ -1089,8 +1091,9 @@ static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, unsigned int
1089 /* Try 2560x1920, 1280x960, 640x480, 320x240 */ 1091 /* Try 2560x1920, 1280x960, 640x480, 320x240 */
1090 mf.width = 2560 >> shift; 1092 mf.width = 2560 >> shift;
1091 mf.height = 1920 >> shift; 1093 mf.height = 1920 >> shift;
1092 ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, 1094 ret = v4l2_device_call_until_err(sd->v4l2_dev,
1093 s_mbus_fmt, &mf); 1095 soc_camera_grp_id(icd), video,
1096 s_mbus_fmt, &mf);
1094 if (ret < 0) 1097 if (ret < 0)
1095 return ret; 1098 return ret;
1096 shift++; 1099 shift++;
@@ -1389,7 +1392,8 @@ static int client_s_fmt(struct soc_camera_device *icd,
1389 bool ceu_1to1; 1392 bool ceu_1to1;
1390 int ret; 1393 int ret;
1391 1394
1392 ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, 1395 ret = v4l2_device_call_until_err(sd->v4l2_dev,
1396 soc_camera_grp_id(icd), video,
1393 s_mbus_fmt, mf); 1397 s_mbus_fmt, mf);
1394 if (ret < 0) 1398 if (ret < 0)
1395 return ret; 1399 return ret;
@@ -1426,8 +1430,9 @@ static int client_s_fmt(struct soc_camera_device *icd,
1426 tmp_h = min(2 * tmp_h, max_height); 1430 tmp_h = min(2 * tmp_h, max_height);
1427 mf->width = tmp_w; 1431 mf->width = tmp_w;
1428 mf->height = tmp_h; 1432 mf->height = tmp_h;
1429 ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, 1433 ret = v4l2_device_call_until_err(sd->v4l2_dev,
1430 s_mbus_fmt, mf); 1434 soc_camera_grp_id(icd), video,
1435 s_mbus_fmt, mf);
1431 dev_geo(dev, "Camera scaled to %ux%u\n", 1436 dev_geo(dev, "Camera scaled to %ux%u\n",
1432 mf->width, mf->height); 1437 mf->width, mf->height);
1433 if (ret < 0) { 1438 if (ret < 0) {
@@ -1580,8 +1585,9 @@ static int sh_mobile_ceu_set_crop(struct soc_camera_device *icd,
1580 } 1585 }
1581 1586
1582 if (interm_width < icd->user_width || interm_height < icd->user_height) { 1587 if (interm_width < icd->user_width || interm_height < icd->user_height) {
1583 ret = v4l2_device_call_until_err(sd->v4l2_dev, (int)icd, video, 1588 ret = v4l2_device_call_until_err(sd->v4l2_dev,
1584 s_mbus_fmt, &mf); 1589 soc_camera_grp_id(icd), video,
1590 s_mbus_fmt, &mf);
1585 if (ret < 0) 1591 if (ret < 0)
1586 return ret; 1592 return ret;
1587 1593
@@ -1867,7 +1873,8 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,
1867 mf.code = xlate->code; 1873 mf.code = xlate->code;
1868 mf.colorspace = pix->colorspace; 1874 mf.colorspace = pix->colorspace;
1869 1875
1870 ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, try_mbus_fmt, &mf); 1876 ret = v4l2_device_call_until_err(sd->v4l2_dev, soc_camera_grp_id(icd),
1877 video, try_mbus_fmt, &mf);
1871 if (ret < 0) 1878 if (ret < 0)
1872 return ret; 1879 return ret;
1873 1880
@@ -1891,8 +1898,9 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,
1891 */ 1898 */
1892 mf.width = 2560; 1899 mf.width = 2560;
1893 mf.height = 1920; 1900 mf.height = 1920;
1894 ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, 1901 ret = v4l2_device_call_until_err(sd->v4l2_dev,
1895 try_mbus_fmt, &mf); 1902 soc_camera_grp_id(icd), video,
1903 try_mbus_fmt, &mf);
1896 if (ret < 0) { 1904 if (ret < 0) {
1897 /* Shouldn't actually happen... */ 1905 /* Shouldn't actually happen... */
1898 dev_err(icd->parent, 1906 dev_err(icd->parent,
diff --git a/drivers/media/video/sh_mobile_csi2.c b/drivers/media/video/sh_mobile_csi2.c
index ea4f0473ed3b..8a652b53ff7e 100644
--- a/drivers/media/video/sh_mobile_csi2.c
+++ b/drivers/media/video/sh_mobile_csi2.c
@@ -143,7 +143,7 @@ static int sh_csi2_s_mbus_config(struct v4l2_subdev *sd,
143 const struct v4l2_mbus_config *cfg) 143 const struct v4l2_mbus_config *cfg)
144{ 144{
145 struct sh_csi2 *priv = container_of(sd, struct sh_csi2, subdev); 145 struct sh_csi2 *priv = container_of(sd, struct sh_csi2, subdev);
146 struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id; 146 struct soc_camera_device *icd = v4l2_get_subdev_hostdata(sd);
147 struct v4l2_subdev *client_sd = soc_camera_to_subdev(icd); 147 struct v4l2_subdev *client_sd = soc_camera_to_subdev(icd);
148 struct v4l2_mbus_config client_cfg = {.type = V4L2_MBUS_CSI2, 148 struct v4l2_mbus_config client_cfg = {.type = V4L2_MBUS_CSI2,
149 .flags = priv->mipi_flags}; 149 .flags = priv->mipi_flags};
@@ -202,7 +202,7 @@ static void sh_csi2_hwinit(struct sh_csi2 *priv)
202static int sh_csi2_client_connect(struct sh_csi2 *priv) 202static int sh_csi2_client_connect(struct sh_csi2 *priv)
203{ 203{
204 struct sh_csi2_pdata *pdata = priv->pdev->dev.platform_data; 204 struct sh_csi2_pdata *pdata = priv->pdev->dev.platform_data;
205 struct soc_camera_device *icd = (struct soc_camera_device *)priv->subdev.grp_id; 205 struct soc_camera_device *icd = v4l2_get_subdev_hostdata(&priv->subdev);
206 struct v4l2_subdev *client_sd = soc_camera_to_subdev(icd); 206 struct v4l2_subdev *client_sd = soc_camera_to_subdev(icd);
207 struct device *dev = v4l2_get_subdevdata(&priv->subdev); 207 struct device *dev = v4l2_get_subdevdata(&priv->subdev);
208 struct v4l2_mbus_config cfg; 208 struct v4l2_mbus_config cfg;
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index b72580c38957..62e4312515cb 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -1103,7 +1103,8 @@ static int soc_camera_probe(struct soc_camera_device *icd)
1103 } 1103 }
1104 1104
1105 sd = soc_camera_to_subdev(icd); 1105 sd = soc_camera_to_subdev(icd);
1106 sd->grp_id = (long)icd; 1106 sd->grp_id = soc_camera_grp_id(icd);
1107 v4l2_set_subdev_hostdata(sd, icd);
1107 1108
1108 if (v4l2_ctrl_add_handler(&icd->ctrl_handler, sd->ctrl_handler)) 1109 if (v4l2_ctrl_add_handler(&icd->ctrl_handler, sd->ctrl_handler))
1109 goto ectrl; 1110 goto ectrl;