History

Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: [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

Linus Torvalds committed 14 years ago

Commit e98092b2 parents 971316f fda27876 files · +74 −23Browse files

Unified · Split

6 files
  1. drivers/media/radio/wl128x/Kconfig +2 −2
  2. drivers/media/rc/imon.c +22 −4
  3. drivers/media/video/hdpvr/hdpvr-core.c +15 −3
  4. drivers/media/video/hdpvr/hdpvr-video.c +33 −13
  5. drivers/media/video/hdpvr/hdpvr.h +1 −0
  6. drivers/media/video/omap3isp/ispccdc.c +1 −1
drivers/media/radio/wl128x/Kconfig+2−2
@@ -4,8 +4,8 @@ · 3 unmodified lines
4menu "Texas Instruments WL128x FM driver (ST based)"4menu "Texas Instruments WL128x FM driver (ST based)"
5config RADIO_WL128X5config RADIO_WL128X
6 tristate "Texas Instruments WL128x FM Radio"6 tristate "Texas Instruments WL128x FM Radio"
7 depends on VIDEO_V4L2 && RFKILL7 depends on VIDEO_V4L2 && RFKILL && GPIOLIB
8 select TI_ST if NET && GPIOLIB8 select TI_ST if NET
9 help9 help
10 Choose Y here if you have this FM radio chip.10 Choose Y here if you have this FM radio chip.
11 11
drivers/media/rc/imon.c+22−4
@@ -47,7 +47,7 @@ · 46 unmodified lines
47#define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>"47#define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>"
48#define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display"48#define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display"
49#define MOD_NAME "imon"49#define MOD_NAME "imon"
50#define MOD_VERSION "0.9.3"50#define MOD_VERSION "0.9.4"
51 51
52#define DISPLAY_MINOR_BASE 14452#define DISPLAY_MINOR_BASE 144
53#define DEVICE_NAME "lcd%d"53#define DEVICE_NAME "lcd%d"
@@ -1658,9 +1658,17 @@ static void usb_rx_callback_intf0(struct urb *urb) · 1604 unmodified lines
1658 return;1658 return;
1659 1659
1660 ictx = (struct imon_context *)urb->context;1660 ictx = (struct imon_context *)urb->context;
1661 if (!ictx || !ictx->dev_present_intf0)1661 if (!ictx)
1662 return;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 switch (urb->status) {1672 switch (urb->status) {
1665 case -ENOENT: /* usbcore unlink successful! */1673 case -ENOENT: /* usbcore unlink successful! */
1666 return;1674 return;
@@ -1678,6 +1686,7 @@ static void usb_rx_callback_intf0(struct urb *urb) · 11 unmodified lines
1678 break;1686 break;
1679 }1687 }
1680 1688
1689out:
1681 usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC);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 return;1699 return;
1691 1700
1692 ictx = (struct imon_context *)urb->context;1701 ictx = (struct imon_context *)urb->context;
1693 if (!ictx || !ictx->dev_present_intf1)1702 if (!ictx)
1694 return;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 switch (urb->status) {1713 switch (urb->status) {
1697 case -ENOENT: /* usbcore unlink successful! */1714 case -ENOENT: /* usbcore unlink successful! */
1698 return;1715 return;
@@ -1710,6 +1727,7 @@ static void usb_rx_callback_intf1(struct urb *urb) · 11 unmodified lines
1710 break;1727 break;
1711 }1728 }
1712 1729
1730out:
1713 usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC);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 mutex_unlock(&ictx->lock);2260 mutex_unlock(&ictx->lock);
2243 usb_free_urb(rx_urb);2261 usb_free_urb(rx_urb);
2244rx_urb_alloc_failed:2262rx_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 return NULL;2265 return NULL;
2248}2266}
drivers/media/video/hdpvr/hdpvr-core.c+15−3
@@ -154,10 +154,20 @@ static int device_authorization(struct hdpvr_device *dev) · 153 unmodified lines
154 }154 }
155#endif155#endif
156 156
157 dev->fw_ver = dev->usbc_buf[1];
158
157 v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n",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 case HDPVR_FIRMWARE_VERSION:171 case HDPVR_FIRMWARE_VERSION:
162 dev->flags &= ~HDPVR_FLAG_AC3_CAP;172 dev->flags &= ~HDPVR_FLAG_AC3_CAP;
163 break;173 break;
@@ -169,7 +179,7 @@ static int device_authorization(struct hdpvr_device *dev) · 5 unmodified lines
169 default:179 default:
170 v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might"180 v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might"
171 " not work.\n");181 " not work.\n");
172 if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3)182 if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3)
173 dev->flags |= HDPVR_FLAG_AC3_CAP;183 dev->flags |= HDPVR_FLAG_AC3_CAP;
174 else184 else
175 dev->flags &= ~HDPVR_FLAG_AC3_CAP;185 dev->flags &= ~HDPVR_FLAG_AC3_CAP;
@@ -270,6 +280,8 @@ static const struct hdpvr_options hdpvr_default_options = { · 94 unmodified lines
270 .bitrate_mode = HDPVR_CONSTANT,280 .bitrate_mode = HDPVR_CONSTANT,
271 .gop_mode = HDPVR_SIMPLE_IDR_GOP,281 .gop_mode = HDPVR_SIMPLE_IDR_GOP,
272 .audio_codec = V4L2_MPEG_AUDIO_ENCODING_AAC,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 .brightness = 0x86,285 .brightness = 0x86,
274 .contrast = 0x80,286 .contrast = 0x80,
275 .hue = 0x80,287 .hue = 0x80,
drivers/media/video/hdpvr/hdpvr-video.c+33−13
@@ -283,12 +283,13 @@ static int hdpvr_start_streaming(struct hdpvr_device *dev) · 282 unmodified lines
283 283
284 hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00);284 hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00);
285 285
286 dev->status = STATUS_STREAMING;
287
286 INIT_WORK(&dev->worker, hdpvr_transmit_buffers);288 INIT_WORK(&dev->worker, hdpvr_transmit_buffers);
287 queue_work(dev->workqueue, &dev->worker);289 queue_work(dev->workqueue, &dev->worker);
288 290
289 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev,291 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev,
290 "streaming started\n");292 "streaming started\n");
291 dev->status = STATUS_STREAMING;
292 293
293 return 0;294 return 0;
294 }295 }
@@ -722,21 +723,39 @@ static const s32 supported_v4l2_ctrls[] = { · 427 unmodified lines
722};723};
723 724
724static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc,725static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc,
725 int ac3)726 int ac3, int fw_ver)
726{727{
727 int err;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 switch (qc->id) {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 case V4L2_CID_MPEG_AUDIO_ENCODING:759 case V4L2_CID_MPEG_AUDIO_ENCODING:
741 return v4l2_ctrl_query_fill(760 return v4l2_ctrl_query_fill(
742 qc, V4L2_MPEG_AUDIO_ENCODING_AAC,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 if (qc->id == supported_v4l2_ctrls[i])814 if (qc->id == supported_v4l2_ctrls[i])
796 return fill_queryctrl(&dev->options, qc,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 if (qc->id < supported_v4l2_ctrls[i])819 if (qc->id < supported_v4l2_ctrls[i])
800 break;820 break;
drivers/media/video/hdpvr/hdpvr.h+1−0
@@ -113,6 +113,7 @@ struct hdpvr_device { · 112 unmodified lines
113 /* usb control transfer buffer and lock */113 /* usb control transfer buffer and lock */
114 struct mutex usbc_mutex;114 struct mutex usbc_mutex;
115 u8 *usbc_buf;115 u8 *usbc_buf;
116 u8 fw_ver;
116};117};
117 118
118static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev)119static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev)
drivers/media/video/omap3isp/ispccdc.c+1−1
@@ -1407,7 +1407,7 @@ static int __ccdc_handle_stopping(struct isp_ccdc_device *ccdc, u32 event) · 1406 unmodified lines
1407static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc)1407static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc)
1408{1408{
1409 struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity);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 struct v4l2_event event;1411 struct v4l2_event event;
1412 1412
1413 memset(&event, 0, sizeof(event));1413 memset(&event, 0, sizeof(event));