diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-12-18 18:41:35 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-12-18 18:41:35 -0500 |
| commit | 76b8ebdc4c7a8299e6365428a36cc0fb1c2a4103 (patch) | |
| tree | 6fc60cd12be0b8f7c3ecd45d9e88cd7263915fa2 /drivers | |
| parent | fc315e3e5c9418df6ce5cee97fd4adcce9dcf24e (diff) | |
| parent | aa0850e1d56623845b46350ffd971afa9241886d (diff) | |
Merge tag 'media/v4.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab.
* tag 'media/v4.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
[media] airspy: increase USB control message buffer size
[media] hackrf: move RF gain ctrl enable behind module parameter
[media] hackrf: fix possible null ptr on debug printing
[media] Revert "[media] ivtv: avoid going past input/audio array"
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/media/pci/ivtv/ivtv-driver.c | 4 | ||||
| -rw-r--r-- | drivers/media/usb/airspy/airspy.c | 2 | ||||
| -rw-r--r-- | drivers/media/usb/hackrf/hackrf.c | 13 |
3 files changed, 15 insertions, 4 deletions
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c index 8616fa8193bc..c2e60b4f292d 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.c +++ b/drivers/media/pci/ivtv/ivtv-driver.c | |||
| @@ -805,11 +805,11 @@ static void ivtv_init_struct2(struct ivtv *itv) | |||
| 805 | { | 805 | { |
| 806 | int i; | 806 | int i; |
| 807 | 807 | ||
| 808 | for (i = 0; i < IVTV_CARD_MAX_VIDEO_INPUTS - 1; i++) | 808 | for (i = 0; i < IVTV_CARD_MAX_VIDEO_INPUTS; i++) |
| 809 | if (itv->card->video_inputs[i].video_type == 0) | 809 | if (itv->card->video_inputs[i].video_type == 0) |
| 810 | break; | 810 | break; |
| 811 | itv->nof_inputs = i; | 811 | itv->nof_inputs = i; |
| 812 | for (i = 0; i < IVTV_CARD_MAX_AUDIO_INPUTS - 1; i++) | 812 | for (i = 0; i < IVTV_CARD_MAX_AUDIO_INPUTS; i++) |
| 813 | if (itv->card->audio_inputs[i].audio_type == 0) | 813 | if (itv->card->audio_inputs[i].audio_type == 0) |
| 814 | break; | 814 | break; |
| 815 | itv->nof_audio_inputs = i; | 815 | itv->nof_audio_inputs = i; |
diff --git a/drivers/media/usb/airspy/airspy.c b/drivers/media/usb/airspy/airspy.c index fcbb49757614..565a59310747 100644 --- a/drivers/media/usb/airspy/airspy.c +++ b/drivers/media/usb/airspy/airspy.c | |||
| @@ -134,7 +134,7 @@ struct airspy { | |||
| 134 | int urbs_submitted; | 134 | int urbs_submitted; |
| 135 | 135 | ||
| 136 | /* USB control message buffer */ | 136 | /* USB control message buffer */ |
| 137 | #define BUF_SIZE 24 | 137 | #define BUF_SIZE 128 |
| 138 | u8 buf[BUF_SIZE]; | 138 | u8 buf[BUF_SIZE]; |
| 139 | 139 | ||
| 140 | /* Current configuration */ | 140 | /* Current configuration */ |
diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c index e05bfec90f46..0fe5cb2c260c 100644 --- a/drivers/media/usb/hackrf/hackrf.c +++ b/drivers/media/usb/hackrf/hackrf.c | |||
| @@ -24,6 +24,15 @@ | |||
| 24 | #include <media/videobuf2-v4l2.h> | 24 | #include <media/videobuf2-v4l2.h> |
| 25 | #include <media/videobuf2-vmalloc.h> | 25 | #include <media/videobuf2-vmalloc.h> |
| 26 | 26 | ||
| 27 | /* | ||
| 28 | * Used Avago MGA-81563 RF amplifier could be destroyed pretty easily with too | ||
| 29 | * strong signal or transmitting to bad antenna. | ||
| 30 | * Set RF gain control to 'grabbed' state by default for sure. | ||
| 31 | */ | ||
| 32 | static bool hackrf_enable_rf_gain_ctrl; | ||
| 33 | module_param_named(enable_rf_gain_ctrl, hackrf_enable_rf_gain_ctrl, bool, 0644); | ||
| 34 | MODULE_PARM_DESC(enable_rf_gain_ctrl, "enable RX/TX RF amplifier control (warn: could damage amplifier)"); | ||
| 35 | |||
| 27 | /* HackRF USB API commands (from HackRF Library) */ | 36 | /* HackRF USB API commands (from HackRF Library) */ |
| 28 | enum { | 37 | enum { |
| 29 | CMD_SET_TRANSCEIVER_MODE = 0x01, | 38 | CMD_SET_TRANSCEIVER_MODE = 0x01, |
| @@ -1451,6 +1460,7 @@ static int hackrf_probe(struct usb_interface *intf, | |||
| 1451 | dev_err(dev->dev, "Could not initialize controls\n"); | 1460 | dev_err(dev->dev, "Could not initialize controls\n"); |
| 1452 | goto err_v4l2_ctrl_handler_free_rx; | 1461 | goto err_v4l2_ctrl_handler_free_rx; |
| 1453 | } | 1462 | } |
| 1463 | v4l2_ctrl_grab(dev->rx_rf_gain, !hackrf_enable_rf_gain_ctrl); | ||
| 1454 | v4l2_ctrl_handler_setup(&dev->rx_ctrl_handler); | 1464 | v4l2_ctrl_handler_setup(&dev->rx_ctrl_handler); |
| 1455 | 1465 | ||
| 1456 | /* Register controls for transmitter */ | 1466 | /* Register controls for transmitter */ |
| @@ -1471,6 +1481,7 @@ static int hackrf_probe(struct usb_interface *intf, | |||
| 1471 | dev_err(dev->dev, "Could not initialize controls\n"); | 1481 | dev_err(dev->dev, "Could not initialize controls\n"); |
| 1472 | goto err_v4l2_ctrl_handler_free_tx; | 1482 | goto err_v4l2_ctrl_handler_free_tx; |
| 1473 | } | 1483 | } |
| 1484 | v4l2_ctrl_grab(dev->tx_rf_gain, !hackrf_enable_rf_gain_ctrl); | ||
| 1474 | v4l2_ctrl_handler_setup(&dev->tx_ctrl_handler); | 1485 | v4l2_ctrl_handler_setup(&dev->tx_ctrl_handler); |
| 1475 | 1486 | ||
| 1476 | /* Register the v4l2_device structure */ | 1487 | /* Register the v4l2_device structure */ |
| @@ -1530,7 +1541,7 @@ err_v4l2_ctrl_handler_free_rx: | |||
| 1530 | err_kfree: | 1541 | err_kfree: |
| 1531 | kfree(dev); | 1542 | kfree(dev); |
| 1532 | err: | 1543 | err: |
| 1533 | dev_dbg(dev->dev, "failed=%d\n", ret); | 1544 | dev_dbg(&intf->dev, "failed=%d\n", ret); |
| 1534 | return ret; | 1545 | return ret; |
| 1535 | } | 1546 | } |
| 1536 | 1547 | ||
