diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-21 15:43:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-21 15:43:23 -0400 |
commit | 8898159650093e9eee8829e30a9139b4273a0ac4 (patch) | |
tree | 46c5d9660416d790951153ffd8ca1446a53e96dd /drivers | |
parent | 9f24ff6f4236f117729bdb2fe8b0c202ce86098f (diff) | |
parent | e631f578048e2afd8bfede2e9dc86aa4592def3a (diff) |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab:
- Fixes a regression at DVB core when switching from DVB-S2 to DVB-S on
Kaffeine (Fedora 16 Bugzilla #812895);
- Fixes a mutex unlock at an error condition at drx-k;
- Fix winbond-cir set mode;
- mt9m032: Fix a compilation breakage with some random Kconfig;
- mt9m032: fix two dead locks;
- xc5000: don't require an special firmware (that won't be provided by
the vendor) just because the xtal frequency is different;
- V4L DocBook: fix some typos at multi-plane formats description.
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
[media] xc5000: support 32MHz & 31.875MHz xtal using the 41.024.5 firmware
[media] V4L: mt9m032: fix compilation breakage
[media] V4L: DocBook: Fix typos in the multi-plane formats description
[media] V4L: mt9m032: fix two dead-locks
[media] rc-core: set mode for winbond-cir
[media] drxk: Does not unlock mutex if sanity check failed in scu_command()
[media] dvb_frontend: Fix a regression when switching back to DVB-S
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/common/tuners/xc5000.c | 39 | ||||
-rw-r--r-- | drivers/media/common/tuners/xc5000.h | 1 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.c | 25 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/drxk_hard.c | 6 | ||||
-rw-r--r-- | drivers/media/rc/winbond-cir.c | 1 | ||||
-rw-r--r-- | drivers/media/video/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/video/mt9m032.c | 5 |
7 files changed, 69 insertions, 10 deletions
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c index 7f98984e4fad..eab2ea424200 100644 --- a/drivers/media/common/tuners/xc5000.c +++ b/drivers/media/common/tuners/xc5000.c | |||
@@ -54,6 +54,7 @@ struct xc5000_priv { | |||
54 | struct list_head hybrid_tuner_instance_list; | 54 | struct list_head hybrid_tuner_instance_list; |
55 | 55 | ||
56 | u32 if_khz; | 56 | u32 if_khz; |
57 | u32 xtal_khz; | ||
57 | u32 freq_hz; | 58 | u32 freq_hz; |
58 | u32 bandwidth; | 59 | u32 bandwidth; |
59 | u8 video_standard; | 60 | u8 video_standard; |
@@ -214,9 +215,9 @@ static const struct xc5000_fw_cfg xc5000a_1_6_114 = { | |||
214 | .size = 12401, | 215 | .size = 12401, |
215 | }; | 216 | }; |
216 | 217 | ||
217 | static const struct xc5000_fw_cfg xc5000c_41_024_5_31875 = { | 218 | static const struct xc5000_fw_cfg xc5000c_41_024_5 = { |
218 | .name = "dvb-fe-xc5000c-41.024.5-31875.fw", | 219 | .name = "dvb-fe-xc5000c-41.024.5.fw", |
219 | .size = 16503, | 220 | .size = 16497, |
220 | }; | 221 | }; |
221 | 222 | ||
222 | static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id) | 223 | static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id) |
@@ -226,7 +227,7 @@ static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id) | |||
226 | case XC5000A: | 227 | case XC5000A: |
227 | return &xc5000a_1_6_114; | 228 | return &xc5000a_1_6_114; |
228 | case XC5000C: | 229 | case XC5000C: |
229 | return &xc5000c_41_024_5_31875; | 230 | return &xc5000c_41_024_5; |
230 | } | 231 | } |
231 | } | 232 | } |
232 | 233 | ||
@@ -572,6 +573,31 @@ static int xc_tune_channel(struct xc5000_priv *priv, u32 freq_hz, int mode) | |||
572 | return found; | 573 | return found; |
573 | } | 574 | } |
574 | 575 | ||
576 | static int xc_set_xtal(struct dvb_frontend *fe) | ||
577 | { | ||
578 | struct xc5000_priv *priv = fe->tuner_priv; | ||
579 | int ret = XC_RESULT_SUCCESS; | ||
580 | |||
581 | switch (priv->chip_id) { | ||
582 | default: | ||
583 | case XC5000A: | ||
584 | /* 32.000 MHz xtal is default */ | ||
585 | break; | ||
586 | case XC5000C: | ||
587 | switch (priv->xtal_khz) { | ||
588 | default: | ||
589 | case 32000: | ||
590 | /* 32.000 MHz xtal is default */ | ||
591 | break; | ||
592 | case 31875: | ||
593 | /* 31.875 MHz xtal configuration */ | ||
594 | ret = xc_write_reg(priv, 0x000f, 0x8081); | ||
595 | break; | ||
596 | } | ||
597 | break; | ||
598 | } | ||
599 | return ret; | ||
600 | } | ||
575 | 601 | ||
576 | static int xc5000_fwupload(struct dvb_frontend *fe) | 602 | static int xc5000_fwupload(struct dvb_frontend *fe) |
577 | { | 603 | { |
@@ -603,6 +629,8 @@ static int xc5000_fwupload(struct dvb_frontend *fe) | |||
603 | } else { | 629 | } else { |
604 | printk(KERN_INFO "xc5000: firmware uploading...\n"); | 630 | printk(KERN_INFO "xc5000: firmware uploading...\n"); |
605 | ret = xc_load_i2c_sequence(fe, fw->data); | 631 | ret = xc_load_i2c_sequence(fe, fw->data); |
632 | if (XC_RESULT_SUCCESS == ret) | ||
633 | ret = xc_set_xtal(fe); | ||
606 | printk(KERN_INFO "xc5000: firmware upload complete...\n"); | 634 | printk(KERN_INFO "xc5000: firmware upload complete...\n"); |
607 | } | 635 | } |
608 | 636 | ||
@@ -1164,6 +1192,9 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe, | |||
1164 | priv->if_khz = cfg->if_khz; | 1192 | priv->if_khz = cfg->if_khz; |
1165 | } | 1193 | } |
1166 | 1194 | ||
1195 | if (priv->xtal_khz == 0) | ||
1196 | priv->xtal_khz = cfg->xtal_khz; | ||
1197 | |||
1167 | if (priv->radio_input == 0) | 1198 | if (priv->radio_input == 0) |
1168 | priv->radio_input = cfg->radio_input; | 1199 | priv->radio_input = cfg->radio_input; |
1169 | 1200 | ||
diff --git a/drivers/media/common/tuners/xc5000.h b/drivers/media/common/tuners/xc5000.h index 3396f8e02b40..39a73bf01406 100644 --- a/drivers/media/common/tuners/xc5000.h +++ b/drivers/media/common/tuners/xc5000.h | |||
@@ -34,6 +34,7 @@ struct xc5000_config { | |||
34 | u8 i2c_address; | 34 | u8 i2c_address; |
35 | u32 if_khz; | 35 | u32 if_khz; |
36 | u8 radio_input; | 36 | u8 radio_input; |
37 | u32 xtal_khz; | ||
37 | 38 | ||
38 | int chip_id; | 39 | int chip_id; |
39 | }; | 40 | }; |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 39696c6a4ed7..0f64d7182657 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -1446,6 +1446,28 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system) | |||
1446 | __func__); | 1446 | __func__); |
1447 | return -EINVAL; | 1447 | return -EINVAL; |
1448 | } | 1448 | } |
1449 | /* | ||
1450 | * Get a delivery system that is compatible with DVBv3 | ||
1451 | * NOTE: in order for this to work with softwares like Kaffeine that | ||
1452 | * uses a DVBv5 call for DVB-S2 and a DVBv3 call to go back to | ||
1453 | * DVB-S, drivers that support both should put the SYS_DVBS entry | ||
1454 | * before the SYS_DVBS2, otherwise it won't switch back to DVB-S. | ||
1455 | * The real fix is that userspace applications should not use DVBv3 | ||
1456 | * and not trust on calling FE_SET_FRONTEND to switch the delivery | ||
1457 | * system. | ||
1458 | */ | ||
1459 | ncaps = 0; | ||
1460 | while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) { | ||
1461 | if (fe->ops.delsys[ncaps] == desired_system) { | ||
1462 | delsys = desired_system; | ||
1463 | break; | ||
1464 | } | ||
1465 | ncaps++; | ||
1466 | } | ||
1467 | if (delsys == SYS_UNDEFINED) { | ||
1468 | dprintk("%s() Couldn't find a delivery system that matches %d\n", | ||
1469 | __func__, desired_system); | ||
1470 | } | ||
1449 | } else { | 1471 | } else { |
1450 | /* | 1472 | /* |
1451 | * This is a DVBv5 call. So, it likely knows the supported | 1473 | * This is a DVBv5 call. So, it likely knows the supported |
@@ -1494,9 +1516,10 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system) | |||
1494 | __func__); | 1516 | __func__); |
1495 | return -EINVAL; | 1517 | return -EINVAL; |
1496 | } | 1518 | } |
1497 | c->delivery_system = delsys; | ||
1498 | } | 1519 | } |
1499 | 1520 | ||
1521 | c->delivery_system = delsys; | ||
1522 | |||
1500 | /* | 1523 | /* |
1501 | * The DVBv3 or DVBv5 call is requesting a different system. So, | 1524 | * The DVBv3 or DVBv5 call is requesting a different system. So, |
1502 | * emulation is needed. | 1525 | * emulation is needed. |
diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index 36d11756492f..a414b1f2b6a5 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c | |||
@@ -1520,8 +1520,10 @@ static int scu_command(struct drxk_state *state, | |||
1520 | dprintk(1, "\n"); | 1520 | dprintk(1, "\n"); |
1521 | 1521 | ||
1522 | if ((cmd == 0) || ((parameterLen > 0) && (parameter == NULL)) || | 1522 | if ((cmd == 0) || ((parameterLen > 0) && (parameter == NULL)) || |
1523 | ((resultLen > 0) && (result == NULL))) | 1523 | ((resultLen > 0) && (result == NULL))) { |
1524 | goto error; | 1524 | printk(KERN_ERR "drxk: Error %d on %s\n", status, __func__); |
1525 | return status; | ||
1526 | } | ||
1525 | 1527 | ||
1526 | mutex_lock(&state->mutex); | 1528 | mutex_lock(&state->mutex); |
1527 | 1529 | ||
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index b09c5fae489b..af526586fa26 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c | |||
@@ -1046,6 +1046,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
1046 | goto exit_unregister_led; | 1046 | goto exit_unregister_led; |
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | data->dev->driver_type = RC_DRIVER_IR_RAW; | ||
1049 | data->dev->driver_name = WBCIR_NAME; | 1050 | data->dev->driver_name = WBCIR_NAME; |
1050 | data->dev->input_name = WBCIR_NAME; | 1051 | data->dev->input_name = WBCIR_NAME; |
1051 | data->dev->input_phys = "wbcir/cir0"; | 1052 | data->dev->input_phys = "wbcir/cir0"; |
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index f2479c5c0eb2..ce1e7ba940f6 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
@@ -492,7 +492,7 @@ config VIDEO_VS6624 | |||
492 | 492 | ||
493 | config VIDEO_MT9M032 | 493 | config VIDEO_MT9M032 |
494 | tristate "MT9M032 camera sensor support" | 494 | tristate "MT9M032 camera sensor support" |
495 | depends on I2C && VIDEO_V4L2 | 495 | depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API |
496 | select VIDEO_APTINA_PLL | 496 | select VIDEO_APTINA_PLL |
497 | ---help--- | 497 | ---help--- |
498 | This driver supports MT9M032 camera sensors from Aptina, monochrome | 498 | This driver supports MT9M032 camera sensors from Aptina, monochrome |
diff --git a/drivers/media/video/mt9m032.c b/drivers/media/video/mt9m032.c index 7636672c3548..645973c5feb0 100644 --- a/drivers/media/video/mt9m032.c +++ b/drivers/media/video/mt9m032.c | |||
@@ -392,10 +392,11 @@ static int mt9m032_set_pad_format(struct v4l2_subdev *subdev, | |||
392 | } | 392 | } |
393 | 393 | ||
394 | /* Scaling is not supported, the format is thus fixed. */ | 394 | /* Scaling is not supported, the format is thus fixed. */ |
395 | ret = mt9m032_get_pad_format(subdev, fh, fmt); | 395 | fmt->format = *__mt9m032_get_pad_format(sensor, fh, fmt->which); |
396 | ret = 0; | ||
396 | 397 | ||
397 | done: | 398 | done: |
398 | mutex_lock(&sensor->lock); | 399 | mutex_unlock(&sensor->lock); |
399 | return ret; | 400 | return ret; |
400 | } | 401 | } |
401 | 402 | ||