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
44 menu "Texas Instruments WL128x FM driver (ST based)"
55 config RADIO_WL128X
66 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
99 help
1010 Choose Y here if you have this FM radio chip.
1111
drivers/media/rc/imon.c+22−4
@@ -47,7 +47,7 @@ · 46 unmodified lines
4747 #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>"
4848 #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display"
4949 #define MOD_NAME "imon"
50−#define MOD_VERSION "0.9.3"
50+#define MOD_VERSION "0.9.4"
5151
5252 #define DISPLAY_MINOR_BASE 144
5353 #define DEVICE_NAME "lcd%d"
@@ -1658,9 +1658,17 @@ static void usb_rx_callback_intf0(struct urb *urb) · 1604 unmodified lines
16581658 return;
16591659
16601660 ictx = (struct imon_context *)urb->context;
1661− if (!ictx || !ictx->dev_present_intf0)
1661+ if (!ictx)
16621662 return;
16631663
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+
16641672 switch (urb->status) {
16651673 case -ENOENT: /* usbcore unlink successful! */
16661674 return;
@@ -1678,6 +1686,7 @@ static void usb_rx_callback_intf0(struct urb *urb) · 11 unmodified lines
16781686 break;
16791687 }
16801688
1689+out:
16811690 usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC);
16821691 }
16831692
@@ -1690,9 +1699,17 @@ static void usb_rx_callback_intf1(struct urb *urb) · 6 unmodified lines
16901699 return;
16911700
16921701 ictx = (struct imon_context *)urb->context;
1693− if (!ictx || !ictx->dev_present_intf1)
1702+ if (!ictx)
16941703 return;
16951704
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+
16961713 switch (urb->status) {
16971714 case -ENOENT: /* usbcore unlink successful! */
16981715 return;
@@ -1710,6 +1727,7 @@ static void usb_rx_callback_intf1(struct urb *urb) · 11 unmodified lines
17101727 break;
17111728 }
17121729
1730+out:
17131731 usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC);
17141732 }
17151733
@@ -2242,7 +2260,7 @@ find_endpoint_failed: · 526 unmodified lines
22422260 mutex_unlock(&ictx->lock);
22432261 usb_free_urb(rx_urb);
22442262 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);
22462264
22472265 return NULL;
22482266 }
drivers/media/video/hdpvr/hdpvr-core.c+15−3
@@ -154,10 +154,20 @@ static int device_authorization(struct hdpvr_device *dev) · 153 unmodified lines
154154 }
155155 #endif
156156
157+ dev->fw_ver = dev->usbc_buf[1];
158+
157159 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+ }
159169
160− switch (dev->usbc_buf[1]) {
170+ switch (dev->fw_ver) {
161171 case HDPVR_FIRMWARE_VERSION:
162172 dev->flags &= ~HDPVR_FLAG_AC3_CAP;
163173 break;
@@ -169,7 +179,7 @@ static int device_authorization(struct hdpvr_device *dev) · 5 unmodified lines
169179 default:
170180 v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might"
171181 " not work.\n");
172− if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3)
182+ if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3)
173183 dev->flags |= HDPVR_FLAG_AC3_CAP;
174184 else
175185 dev->flags &= ~HDPVR_FLAG_AC3_CAP;
@@ -270,6 +280,8 @@ static const struct hdpvr_options hdpvr_default_options = { · 94 unmodified lines
270280 .bitrate_mode = HDPVR_CONSTANT,
271281 .gop_mode = HDPVR_SIMPLE_IDR_GOP,
272282 .audio_codec = V4L2_MPEG_AUDIO_ENCODING_AAC,
283+ /* original picture controls for firmware version <= 0x15 */
284+ /* updated in device_authorization() for newer firmware */
273285 .brightness = 0x86,
274286 .contrast = 0x80,
275287 .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
283283
284284 hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00);
285285
286+ dev->status = STATUS_STREAMING;
287+
286288 INIT_WORK(&dev->worker, hdpvr_transmit_buffers);
287289 queue_work(dev->workqueue, &dev->worker);
288290
289291 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev,
290292 "streaming started\n");
291− dev->status = STATUS_STREAMING;
292293
293294 return 0;
294295 }
@@ -722,21 +723,39 @@ static const s32 supported_v4l2_ctrls[] = { · 427 unmodified lines
722723 };
723724
724725 static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc,
725− int ac3)
726+ int ac3, int fw_ver)
726727 {
727728 int err;
728729
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+
729758 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);
740759 case V4L2_CID_MPEG_AUDIO_ENCODING:
741760 return v4l2_ctrl_query_fill(
742761 qc, V4L2_MPEG_AUDIO_ENCODING_AAC,
@@ -794,7 +813,8 @@ static int vidioc_queryctrl(struct file *file, void *private_data, · 51 unmodified lines
794813
795814 if (qc->id == supported_v4l2_ctrls[i])
796815 return fill_queryctrl(&dev->options, qc,
797− dev->flags & HDPVR_FLAG_AC3_CAP);
816+ dev->flags & HDPVR_FLAG_AC3_CAP,
817+ dev->fw_ver);
798818
799819 if (qc->id < supported_v4l2_ctrls[i])
800820 break;
drivers/media/video/hdpvr/hdpvr.h+1−0
@@ -113,6 +113,7 @@ struct hdpvr_device { · 112 unmodified lines
113113 /* usb control transfer buffer and lock */
114114 struct mutex usbc_mutex;
115115 u8 *usbc_buf;
116+ u8 fw_ver;
116117 };
117118
118119 static 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
14071407 static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc)
14081408 {
14091409 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;
14111411 struct v4l2_event event;
14121412
14131413 memset(&event, 0, sizeof(event));