* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: [media] hdpvr: update picture controls to support firmware versions > 0.15 [media] wl128x: fix build errors when GPIOLIB is not enabled [media] hdpvr: fix race conditon during start of streaming [media] omap3isp: Fix crash caused by subdevs now having a pointer to devnodes [media] imon: don't wedge hardware after early callbacks
Unified · Split
| @@ -4,8 +4,8 @@ · 3 unmodified lines | ||
| 4 | 4 | menu "Texas Instruments WL128x FM driver (ST based)" |
| 5 | 5 | config RADIO_WL128X |
| 6 | 6 | tristate "Texas Instruments WL128x FM Radio" |
| 7 | − depends on VIDEO_V4L2 && RFKILL | |
| 8 | − select TI_ST if NET && GPIOLIB | |
| 7 | + depends on VIDEO_V4L2 && RFKILL && GPIOLIB | |
| 8 | + select TI_ST if NET | |
| 9 | 9 | help |
| 10 | 10 | Choose Y here if you have this FM radio chip. |
| 11 | 11 | |
| @@ -47,7 +47,7 @@ · 46 unmodified lines | ||
| 47 | 47 | #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" |
| 48 | 48 | #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display" |
| 49 | 49 | #define MOD_NAME "imon" |
| 50 | −#define MOD_VERSION "0.9.3" | |
| 50 | +#define MOD_VERSION "0.9.4" | |
| 51 | 51 | |
| 52 | 52 | #define DISPLAY_MINOR_BASE 144 |
| 53 | 53 | #define DEVICE_NAME "lcd%d" |
| @@ -1658,9 +1658,17 @@ static void usb_rx_callback_intf0(struct urb *urb) · 1604 unmodified lines | ||
| 1658 | 1658 | return; |
| 1659 | 1659 | |
| 1660 | 1660 | ictx = (struct imon_context *)urb->context; |
| 1661 | − if (!ictx || !ictx->dev_present_intf0) | |
| 1661 | + if (!ictx) | |
| 1662 | 1662 | return; |
| 1663 | 1663 | |
| 1664 | + /* | |
| 1665 | + * if we get a callback before we're done configuring the hardware, we | |
| 1666 | + * can't yet process the data, as there's nowhere to send it, but we | |
| 1667 | + * still need to submit a new rx URB to avoid wedging the hardware | |
| 1668 | + */ | |
| 1669 | + if (!ictx->dev_present_intf0) | |
| 1670 | + goto out; | |
| 1671 | + | |
| 1664 | 1672 | switch (urb->status) { |
| 1665 | 1673 | case -ENOENT: /* usbcore unlink successful! */ |
| 1666 | 1674 | return; |
| @@ -1678,6 +1686,7 @@ static void usb_rx_callback_intf0(struct urb *urb) · 11 unmodified lines | ||
| 1678 | 1686 | break; |
| 1679 | 1687 | } |
| 1680 | 1688 | |
| 1689 | +out: | |
| 1681 | 1690 | usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC); |
| 1682 | 1691 | } |
| 1683 | 1692 | |
| @@ -1690,9 +1699,17 @@ static void usb_rx_callback_intf1(struct urb *urb) · 6 unmodified lines | ||
| 1690 | 1699 | return; |
| 1691 | 1700 | |
| 1692 | 1701 | ictx = (struct imon_context *)urb->context; |
| 1693 | − if (!ictx || !ictx->dev_present_intf1) | |
| 1702 | + if (!ictx) | |
| 1694 | 1703 | return; |
| 1695 | 1704 | |
| 1705 | + /* | |
| 1706 | + * if we get a callback before we're done configuring the hardware, we | |
| 1707 | + * can't yet process the data, as there's nowhere to send it, but we | |
| 1708 | + * still need to submit a new rx URB to avoid wedging the hardware | |
| 1709 | + */ | |
| 1710 | + if (!ictx->dev_present_intf1) | |
| 1711 | + goto out; | |
| 1712 | + | |
| 1696 | 1713 | switch (urb->status) { |
| 1697 | 1714 | case -ENOENT: /* usbcore unlink successful! */ |
| 1698 | 1715 | return; |
| @@ -1710,6 +1727,7 @@ static void usb_rx_callback_intf1(struct urb *urb) · 11 unmodified lines | ||
| 1710 | 1727 | break; |
| 1711 | 1728 | } |
| 1712 | 1729 | |
| 1730 | +out: | |
| 1713 | 1731 | usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC); |
| 1714 | 1732 | } |
| 1715 | 1733 | |
| @@ -2242,7 +2260,7 @@ find_endpoint_failed: · 526 unmodified lines | ||
| 2242 | 2260 | mutex_unlock(&ictx->lock); |
| 2243 | 2261 | usb_free_urb(rx_urb); |
| 2244 | 2262 | rx_urb_alloc_failed: |
| 2245 | − dev_err(ictx->dev, "unable to initialize intf0, err %d\n", ret); | |
| 2263 | + dev_err(ictx->dev, "unable to initialize intf1, err %d\n", ret); | |
| 2246 | 2264 | |
| 2247 | 2265 | return NULL; |
| 2248 | 2266 | } |
| @@ -154,10 +154,20 @@ static int device_authorization(struct hdpvr_device *dev) · 153 unmodified lines | ||
| 154 | 154 | } |
| 155 | 155 | #endif |
| 156 | 156 | |
| 157 | + dev->fw_ver = dev->usbc_buf[1]; | |
| 158 | + | |
| 157 | 159 | v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n", |
| 158 | − dev->usbc_buf[1], &dev->usbc_buf[2]); | |
| 160 | + dev->fw_ver, &dev->usbc_buf[2]); | |
| 161 | + | |
| 162 | + if (dev->fw_ver > 0x15) { | |
| 163 | + dev->options.brightness = 0x80; | |
| 164 | + dev->options.contrast = 0x40; | |
| 165 | + dev->options.hue = 0xf; | |
| 166 | + dev->options.saturation = 0x40; | |
| 167 | + dev->options.sharpness = 0x80; | |
| 168 | + } | |
| 159 | 169 | |
| 160 | − switch (dev->usbc_buf[1]) { | |
| 170 | + switch (dev->fw_ver) { | |
| 161 | 171 | case HDPVR_FIRMWARE_VERSION: |
| 162 | 172 | dev->flags &= ~HDPVR_FLAG_AC3_CAP; |
| 163 | 173 | break; |
| @@ -169,7 +179,7 @@ static int device_authorization(struct hdpvr_device *dev) · 5 unmodified lines | ||
| 169 | 179 | default: |
| 170 | 180 | v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might" |
| 171 | 181 | " not work.\n"); |
| 172 | − if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3) | |
| 182 | + if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3) | |
| 173 | 183 | dev->flags |= HDPVR_FLAG_AC3_CAP; |
| 174 | 184 | else |
| 175 | 185 | dev->flags &= ~HDPVR_FLAG_AC3_CAP; |
| @@ -270,6 +280,8 @@ static const struct hdpvr_options hdpvr_default_options = { · 94 unmodified lines | ||
| 270 | 280 | .bitrate_mode = HDPVR_CONSTANT, |
| 271 | 281 | .gop_mode = HDPVR_SIMPLE_IDR_GOP, |
| 272 | 282 | .audio_codec = V4L2_MPEG_AUDIO_ENCODING_AAC, |
| 283 | + /* original picture controls for firmware version <= 0x15 */ | |
| 284 | + /* updated in device_authorization() for newer firmware */ | |
| 273 | 285 | .brightness = 0x86, |
| 274 | 286 | .contrast = 0x80, |
| 275 | 287 | .hue = 0x80, |
| @@ -283,12 +283,13 @@ static int hdpvr_start_streaming(struct hdpvr_device *dev) · 282 unmodified lines | ||
| 283 | 283 | |
| 284 | 284 | hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00); |
| 285 | 285 | |
| 286 | + dev->status = STATUS_STREAMING; | |
| 287 | + | |
| 286 | 288 | INIT_WORK(&dev->worker, hdpvr_transmit_buffers); |
| 287 | 289 | queue_work(dev->workqueue, &dev->worker); |
| 288 | 290 | |
| 289 | 291 | v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev, |
| 290 | 292 | "streaming started\n"); |
| 291 | − dev->status = STATUS_STREAMING; | |
| 292 | 293 | |
| 293 | 294 | return 0; |
| 294 | 295 | } |
| @@ -722,21 +723,39 @@ static const s32 supported_v4l2_ctrls[] = { · 427 unmodified lines | ||
| 722 | 723 | }; |
| 723 | 724 | |
| 724 | 725 | static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc, |
| 725 | − int ac3) | |
| 726 | + int ac3, int fw_ver) | |
| 726 | 727 | { |
| 727 | 728 | int err; |
| 728 | 729 | |
| 730 | + if (fw_ver > 0x15) { | |
| 731 | + switch (qc->id) { | |
| 732 | + case V4L2_CID_BRIGHTNESS: | |
| 733 | + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | |
| 734 | + case V4L2_CID_CONTRAST: | |
| 735 | + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40); | |
| 736 | + case V4L2_CID_SATURATION: | |
| 737 | + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40); | |
| 738 | + case V4L2_CID_HUE: | |
| 739 | + return v4l2_ctrl_query_fill(qc, 0x0, 0x1e, 1, 0xf); | |
| 740 | + case V4L2_CID_SHARPNESS: | |
| 741 | + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | |
| 742 | + } | |
| 743 | + } else { | |
| 744 | + switch (qc->id) { | |
| 745 | + case V4L2_CID_BRIGHTNESS: | |
| 746 | + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86); | |
| 747 | + case V4L2_CID_CONTRAST: | |
| 748 | + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | |
| 749 | + case V4L2_CID_SATURATION: | |
| 750 | + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | |
| 751 | + case V4L2_CID_HUE: | |
| 752 | + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | |
| 753 | + case V4L2_CID_SHARPNESS: | |
| 754 | + return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | |
| 755 | + } | |
| 756 | + } | |
| 757 | + | |
| 729 | 758 | switch (qc->id) { |
| 730 | − case V4L2_CID_BRIGHTNESS: | |
| 731 | − return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86); | |
| 732 | − case V4L2_CID_CONTRAST: | |
| 733 | − return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | |
| 734 | − case V4L2_CID_SATURATION: | |
| 735 | − return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | |
| 736 | − case V4L2_CID_HUE: | |
| 737 | − return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | |
| 738 | − case V4L2_CID_SHARPNESS: | |
| 739 | − return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80); | |
| 740 | 759 | case V4L2_CID_MPEG_AUDIO_ENCODING: |
| 741 | 760 | return v4l2_ctrl_query_fill( |
| 742 | 761 | qc, V4L2_MPEG_AUDIO_ENCODING_AAC, |
| @@ -794,7 +813,8 @@ static int vidioc_queryctrl(struct file *file, void *private_data, · 51 unmodified lines | ||
| 794 | 813 | |
| 795 | 814 | if (qc->id == supported_v4l2_ctrls[i]) |
| 796 | 815 | return fill_queryctrl(&dev->options, qc, |
| 797 | − dev->flags & HDPVR_FLAG_AC3_CAP); | |
| 816 | + dev->flags & HDPVR_FLAG_AC3_CAP, | |
| 817 | + dev->fw_ver); | |
| 798 | 818 | |
| 799 | 819 | if (qc->id < supported_v4l2_ctrls[i]) |
| 800 | 820 | break; |
| @@ -113,6 +113,7 @@ struct hdpvr_device { · 112 unmodified lines | ||
| 113 | 113 | /* usb control transfer buffer and lock */ |
| 114 | 114 | struct mutex usbc_mutex; |
| 115 | 115 | u8 *usbc_buf; |
| 116 | + u8 fw_ver; | |
| 116 | 117 | }; |
| 117 | 118 | |
| 118 | 119 | static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev) |
| @@ -1407,7 +1407,7 @@ static int __ccdc_handle_stopping(struct isp_ccdc_device *ccdc, u32 event) · 1406 unmodified lines | ||
| 1407 | 1407 | static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc) |
| 1408 | 1408 | { |
| 1409 | 1409 | struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); |
| 1410 | − struct video_device *vdev = &ccdc->subdev.devnode; | |
| 1410 | + struct video_device *vdev = ccdc->subdev.devnode; | |
| 1411 | 1411 | struct v4l2_event event; |
| 1412 | 1412 | |
| 1413 | 1413 | memset(&event, 0, sizeof(event)); |