aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/hdpvr
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-28 12:35:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-28 12:35:11 -0400
commit0851668fdd97e526b2a41f794b785c204dd3d3e0 (patch)
tree4ef7c20a8be8393006c6fe9627eb29dd30877d61 /drivers/media/video/hdpvr
parent00ebb6382b8d9c7c15b5f8ad230670d8161d38dd (diff)
parent7655e594945289b418af39f6669fea4666a7b520 (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (505 commits) [media] af9015: Fix max I2C message size when used with tda18271 [media] IR: initialize ir_raw_event in few more drivers [media] Guard a divide in v4l1 compat layer [media] imon: fix nomouse modprobe option [media] imon: remove redundant change_protocol call [media] imon: fix my egregious brown paper bag w/rdev/idev split [media] cafe_ccic: Configure ov7670 correctly [media] ov7670: allow configuration of image size, clock speed, and I/O method [media] af9015: support for DigitalNow TinyTwin v3 [1f4d:9016] [media] af9015: map DigitalNow TinyTwin v2 remote [media] DigitalNow TinyTwin remote controller [media] af9015: RC fixes and improvements videodev2.h.xml: Update to reflect the latest changes at videodev2.h [media] v4l: document new Bayer and monochrome pixel formats [media] DocBook/v4l: Add missing formats used on gspca cpia1 and sn9c2028 [media] firedtv: add parameter to fake ca_system_ids in CA_INFO [media] tm6000: fix a macro coding style issue tm6000: Remove some ugly debug code [media] Nova-S-Plus audio line input [media] [RFC,1/1] V4L2: Use new CAP bits in existing RDS capable drivers ...
Diffstat (limited to 'drivers/media/video/hdpvr')
-rw-r--r--drivers/media/video/hdpvr/hdpvr-control.c5
-rw-r--r--drivers/media/video/hdpvr/hdpvr-core.c36
-rw-r--r--drivers/media/video/hdpvr/hdpvr-i2c.c1
-rw-r--r--drivers/media/video/hdpvr/hdpvr-video.c5
-rw-r--r--drivers/media/video/hdpvr/hdpvr.h7
5 files changed, 32 insertions, 22 deletions
diff --git a/drivers/media/video/hdpvr/hdpvr-control.c b/drivers/media/video/hdpvr/hdpvr-control.c
index 5a6b78b8d25d..068df4ba3f51 100644
--- a/drivers/media/video/hdpvr/hdpvr-control.c
+++ b/drivers/media/video/hdpvr/hdpvr-control.c
@@ -29,8 +29,6 @@ int hdpvr_config_call(struct hdpvr_device *dev, uint value, u8 valbuf)
29 int ret; 29 int ret;
30 char request_type = 0x38, snd_request = 0x01; 30 char request_type = 0x38, snd_request = 0x01;
31 31
32 msleep(10);
33
34 mutex_lock(&dev->usbc_mutex); 32 mutex_lock(&dev->usbc_mutex);
35 dev->usbc_buf[0] = valbuf; 33 dev->usbc_buf[0] = valbuf;
36 ret = usb_control_msg(dev->udev, 34 ret = usb_control_msg(dev->udev,
@@ -170,8 +168,7 @@ int hdpvr_set_audio(struct hdpvr_device *dev, u8 input,
170 if (ret == 2) 168 if (ret == 2)
171 ret = 0; 169 ret = 0;
172 } else 170 } else
173 ret = hdpvr_config_call(dev, CTRL_AUDIO_INPUT_VALUE, 171 ret = hdpvr_config_call(dev, CTRL_AUDIO_INPUT_VALUE, input);
174 dev->options.audio_input+1);
175error: 172error:
176 return ret; 173 return ret;
177} 174}
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
index 0cae5b82e1a2..b70d6afc9fec 100644
--- a/drivers/media/video/hdpvr/hdpvr-core.c
+++ b/drivers/media/video/hdpvr/hdpvr-core.c
@@ -60,6 +60,7 @@ static struct usb_device_id hdpvr_table[] = {
60 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID1) }, 60 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID1) },
61 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID2) }, 61 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID2) },
62 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID3) }, 62 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID3) },
63 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID4) },
63 { } /* Terminating entry */ 64 { } /* Terminating entry */
64}; 65};
65MODULE_DEVICE_TABLE(usb, hdpvr_table); 66MODULE_DEVICE_TABLE(usb, hdpvr_table);
@@ -152,19 +153,26 @@ static int device_authorization(struct hdpvr_device *dev)
152 ret, print_buf); 153 ret, print_buf);
153 } 154 }
154#endif 155#endif
155 if (dev->usbc_buf[1] == HDPVR_FIRMWARE_VERSION) { 156
157 v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n",
158 dev->usbc_buf[1], &dev->usbc_buf[2]);
159
160 switch (dev->usbc_buf[1]) {
161 case HDPVR_FIRMWARE_VERSION:
156 dev->flags &= ~HDPVR_FLAG_AC3_CAP; 162 dev->flags &= ~HDPVR_FLAG_AC3_CAP;
157 } else if (dev->usbc_buf[1] == HDPVR_FIRMWARE_VERSION_AC3) { 163 break;
158 dev->flags |= HDPVR_FLAG_AC3_CAP; 164 case HDPVR_FIRMWARE_VERSION_AC3:
159 } else if (dev->usbc_buf[1] > HDPVR_FIRMWARE_VERSION_AC3) { 165 case HDPVR_FIRMWARE_VERSION_0X12:
160 v4l2_info(&dev->v4l2_dev, "untested firmware version 0x%x, " 166 case HDPVR_FIRMWARE_VERSION_0X15:
161 "the driver might not work\n", dev->usbc_buf[1]);
162 dev->flags |= HDPVR_FLAG_AC3_CAP; 167 dev->flags |= HDPVR_FLAG_AC3_CAP;
163 } else { 168 break;
164 v4l2_err(&dev->v4l2_dev, "unknown firmware version 0x%x\n", 169 default:
165 dev->usbc_buf[1]); 170 v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might"
166 ret = -EINVAL; 171 " not work.\n");
167 goto unlock; 172 if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3)
173 dev->flags |= HDPVR_FLAG_AC3_CAP;
174 else
175 dev->flags &= ~HDPVR_FLAG_AC3_CAP;
168 } 176 }
169 177
170 response = dev->usbc_buf+38; 178 response = dev->usbc_buf+38;
@@ -319,8 +327,12 @@ static int hdpvr_probe(struct usb_interface *interface,
319 if (default_video_input < HDPVR_VIDEO_INPUTS) 327 if (default_video_input < HDPVR_VIDEO_INPUTS)
320 dev->options.video_input = default_video_input; 328 dev->options.video_input = default_video_input;
321 329
322 if (default_audio_input < HDPVR_AUDIO_INPUTS) 330 if (default_audio_input < HDPVR_AUDIO_INPUTS) {
323 dev->options.audio_input = default_audio_input; 331 dev->options.audio_input = default_audio_input;
332 if (default_audio_input == HDPVR_SPDIF)
333 dev->options.audio_codec =
334 V4L2_MPEG_AUDIO_ENCODING_AC3;
335 }
324 336
325 dev->udev = usb_get_dev(interface_to_usbdev(interface)); 337 dev->udev = usb_get_dev(interface_to_usbdev(interface));
326 338
diff --git a/drivers/media/video/hdpvr/hdpvr-i2c.c b/drivers/media/video/hdpvr/hdpvr-i2c.c
index 463b81bef6e2..409de11096d4 100644
--- a/drivers/media/video/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/video/hdpvr/hdpvr-i2c.c
@@ -127,7 +127,6 @@ int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
127 strlcpy(i2c_adap->name, "Hauppauge HD PVR I2C", 127 strlcpy(i2c_adap->name, "Hauppauge HD PVR I2C",
128 sizeof(i2c_adap->name)); 128 sizeof(i2c_adap->name));
129 i2c_adap->algo = &hdpvr_algo; 129 i2c_adap->algo = &hdpvr_algo;
130 i2c_adap->class = I2C_CLASS_TV_ANALOG;
131 i2c_adap->owner = THIS_MODULE; 130 i2c_adap->owner = THIS_MODULE;
132 i2c_adap->dev.parent = &dev->udev->dev; 131 i2c_adap->dev.parent = &dev->udev->dev;
133 132
diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
index 4863a21b1f24..d38fe1043e47 100644
--- a/drivers/media/video/hdpvr/hdpvr-video.c
+++ b/drivers/media/video/hdpvr/hdpvr-video.c
@@ -26,7 +26,7 @@
26#include <media/v4l2-ioctl.h> 26#include <media/v4l2-ioctl.h>
27#include "hdpvr.h" 27#include "hdpvr.h"
28 28
29#define BULK_URB_TIMEOUT 1250 /* 1.25 seconds */ 29#define BULK_URB_TIMEOUT 90 /* 0.09 seconds */
30 30
31#define print_buffer_status() { \ 31#define print_buffer_status() { \
32 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev, \ 32 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev, \
@@ -157,6 +157,7 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count)
157 mem, dev->bulk_in_size, 157 mem, dev->bulk_in_size,
158 hdpvr_read_bulk_callback, buf); 158 hdpvr_read_bulk_callback, buf);
159 159
160 buf->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
160 buf->status = BUFSTAT_AVAILABLE; 161 buf->status = BUFSTAT_AVAILABLE;
161 list_add_tail(&buf->buff_list, &dev->free_buff_list); 162 list_add_tail(&buf->buff_list, &dev->free_buff_list);
162 } 163 }
@@ -337,8 +338,6 @@ static int hdpvr_stop_streaming(struct hdpvr_device *dev)
337 dev->bulk_in_endpointAddr), 338 dev->bulk_in_endpointAddr),
338 buf, dev->bulk_in_size, &actual_length, 339 buf, dev->bulk_in_size, &actual_length,
339 BULK_URB_TIMEOUT)) { 340 BULK_URB_TIMEOUT)) {
340 /* wait */
341 msleep(5);
342 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev, 341 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev,
343 "%2d: got %d bytes\n", c, actual_length); 342 "%2d: got %d bytes\n", c, actual_length);
344 } 343 }
diff --git a/drivers/media/video/hdpvr/hdpvr.h b/drivers/media/video/hdpvr/hdpvr.h
index b0f046df3cd8..5efc963f9164 100644
--- a/drivers/media/video/hdpvr/hdpvr.h
+++ b/drivers/media/video/hdpvr/hdpvr.h
@@ -30,14 +30,17 @@
30#define HD_PVR_PRODUCT_ID 0x4900 30#define HD_PVR_PRODUCT_ID 0x4900
31#define HD_PVR_PRODUCT_ID1 0x4901 31#define HD_PVR_PRODUCT_ID1 0x4901
32#define HD_PVR_PRODUCT_ID2 0x4902 32#define HD_PVR_PRODUCT_ID2 0x4902
33#define HD_PVR_PRODUCT_ID4 0x4903
33#define HD_PVR_PRODUCT_ID3 0x4982 34#define HD_PVR_PRODUCT_ID3 0x4982
34 35
35#define UNSET (-1U) 36#define UNSET (-1U)
36 37
37#define NUM_BUFFERS 64 38#define NUM_BUFFERS 64
38 39
39#define HDPVR_FIRMWARE_VERSION 0x8 40#define HDPVR_FIRMWARE_VERSION 0x08
40#define HDPVR_FIRMWARE_VERSION_AC3 0xd 41#define HDPVR_FIRMWARE_VERSION_AC3 0x0d
42#define HDPVR_FIRMWARE_VERSION_0X12 0x12
43#define HDPVR_FIRMWARE_VERSION_0X15 0x15
41 44
42/* #define HDPVR_DEBUG */ 45/* #define HDPVR_DEBUG */
43 46