aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/zc3xx.c31
-rw-r--r--drivers/media/video/hdpvr/hdpvr-core.c24
-rw-r--r--drivers/media/video/hdpvr/hdpvr-i2c.c30
-rw-r--r--drivers/media/video/hdpvr/hdpvr.h3
-rw-r--r--drivers/media/video/ir-kbd-i2c.c13
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-core.c1
-rw-r--r--drivers/media/video/saa7115.c2
7 files changed, 81 insertions, 23 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index 865216e9362c..47236a58bf33 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -5793,7 +5793,7 @@ static void usb_exchange(struct gspca_dev *gspca_dev,
5793 break; 5793 break;
5794 default: 5794 default:
5795/* case 0xdd: * delay */ 5795/* case 0xdd: * delay */
5796 msleep(action->val / 64 + 10); 5796 msleep(action->idx);
5797 break; 5797 break;
5798 } 5798 }
5799 action++; 5799 action++;
@@ -5830,7 +5830,7 @@ static void setmatrix(struct gspca_dev *gspca_dev)
5830 [SENSOR_GC0305] = gc0305_matrix, 5830 [SENSOR_GC0305] = gc0305_matrix,
5831 [SENSOR_HDCS2020b] = NULL, 5831 [SENSOR_HDCS2020b] = NULL,
5832 [SENSOR_HV7131B] = NULL, 5832 [SENSOR_HV7131B] = NULL,
5833 [SENSOR_HV7131R] = NULL, 5833 [SENSOR_HV7131R] = po2030_matrix,
5834 [SENSOR_ICM105A] = po2030_matrix, 5834 [SENSOR_ICM105A] = po2030_matrix,
5835 [SENSOR_MC501CB] = NULL, 5835 [SENSOR_MC501CB] = NULL,
5836 [SENSOR_MT9V111_1] = gc0305_matrix, 5836 [SENSOR_MT9V111_1] = gc0305_matrix,
@@ -5936,6 +5936,7 @@ static void setquality(struct gspca_dev *gspca_dev)
5936 case SENSOR_ADCM2700: 5936 case SENSOR_ADCM2700:
5937 case SENSOR_GC0305: 5937 case SENSOR_GC0305:
5938 case SENSOR_HV7131B: 5938 case SENSOR_HV7131B:
5939 case SENSOR_HV7131R:
5939 case SENSOR_OV7620: 5940 case SENSOR_OV7620:
5940 case SENSOR_PAS202B: 5941 case SENSOR_PAS202B:
5941 case SENSOR_PO2030: 5942 case SENSOR_PO2030:
@@ -6108,11 +6109,13 @@ static void send_unknown(struct gspca_dev *gspca_dev, int sensor)
6108 reg_w(gspca_dev, 0x02, 0x003b); 6109 reg_w(gspca_dev, 0x02, 0x003b);
6109 reg_w(gspca_dev, 0x00, 0x0038); 6110 reg_w(gspca_dev, 0x00, 0x0038);
6110 break; 6111 break;
6112 case SENSOR_HV7131R:
6111 case SENSOR_PAS202B: 6113 case SENSOR_PAS202B:
6112 reg_w(gspca_dev, 0x03, 0x003b); 6114 reg_w(gspca_dev, 0x03, 0x003b);
6113 reg_w(gspca_dev, 0x0c, 0x003a); 6115 reg_w(gspca_dev, 0x0c, 0x003a);
6114 reg_w(gspca_dev, 0x0b, 0x0039); 6116 reg_w(gspca_dev, 0x0b, 0x0039);
6115 reg_w(gspca_dev, 0x0b, 0x0038); 6117 if (sensor == SENSOR_PAS202B)
6118 reg_w(gspca_dev, 0x0b, 0x0038);
6116 break; 6119 break;
6117 } 6120 }
6118} 6121}
@@ -6704,10 +6707,13 @@ static int sd_start(struct gspca_dev *gspca_dev)
6704 reg_w(gspca_dev, 0x02, 0x003b); 6707 reg_w(gspca_dev, 0x02, 0x003b);
6705 reg_w(gspca_dev, 0x00, 0x0038); 6708 reg_w(gspca_dev, 0x00, 0x0038);
6706 break; 6709 break;
6710 case SENSOR_HV7131R:
6707 case SENSOR_PAS202B: 6711 case SENSOR_PAS202B:
6708 reg_w(gspca_dev, 0x03, 0x003b); 6712 reg_w(gspca_dev, 0x03, 0x003b);
6709 reg_w(gspca_dev, 0x0c, 0x003a); 6713 reg_w(gspca_dev, 0x0c, 0x003a);
6710 reg_w(gspca_dev, 0x0b, 0x0039); 6714 reg_w(gspca_dev, 0x0b, 0x0039);
6715 if (sd->sensor == SENSOR_HV7131R)
6716 reg_w(gspca_dev, 0x50, ZC3XX_R11D_GLOBALGAIN);
6711 break; 6717 break;
6712 } 6718 }
6713 6719
@@ -6720,6 +6726,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
6720 break; 6726 break;
6721 case SENSOR_PAS202B: 6727 case SENSOR_PAS202B:
6722 case SENSOR_GC0305: 6728 case SENSOR_GC0305:
6729 case SENSOR_HV7131R:
6723 case SENSOR_TAS5130C: 6730 case SENSOR_TAS5130C:
6724 reg_r(gspca_dev, 0x0008); 6731 reg_r(gspca_dev, 0x0008);
6725 /* fall thru */ 6732 /* fall thru */
@@ -6760,6 +6767,12 @@ static int sd_start(struct gspca_dev *gspca_dev)
6760 /* ms-win + */ 6767 /* ms-win + */
6761 reg_w(gspca_dev, 0x40, 0x0117); 6768 reg_w(gspca_dev, 0x40, 0x0117);
6762 break; 6769 break;
6770 case SENSOR_HV7131R:
6771 i2c_write(gspca_dev, 0x25, 0x04, 0x00); /* exposure */
6772 i2c_write(gspca_dev, 0x26, 0x93, 0x00);
6773 i2c_write(gspca_dev, 0x27, 0xe0, 0x00);
6774 reg_w(gspca_dev, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN);
6775 break;
6763 case SENSOR_GC0305: 6776 case SENSOR_GC0305:
6764 case SENSOR_TAS5130C: 6777 case SENSOR_TAS5130C:
6765 reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */ 6778 reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */
@@ -6808,9 +6821,17 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
6808{ 6821{
6809 struct sd *sd = (struct sd *) gspca_dev; 6822 struct sd *sd = (struct sd *) gspca_dev;
6810 6823
6811 if (data[0] == 0xff && data[1] == 0xd8) { /* start of frame */ 6824 /* check the JPEG end of frame */
6825 if (len >= 3
6826 && data[len - 3] == 0xff && data[len - 2] == 0xd9) {
6827/*fixme: what does the last byte mean?*/
6812 gspca_frame_add(gspca_dev, LAST_PACKET, 6828 gspca_frame_add(gspca_dev, LAST_PACKET,
6813 NULL, 0); 6829 data, len - 1);
6830 return;
6831 }
6832
6833 /* check the JPEG start of a frame */
6834 if (data[0] == 0xff && data[1] == 0xd8) {
6814 /* put the JPEG header in the new frame */ 6835 /* put the JPEG header in the new frame */
6815 gspca_frame_add(gspca_dev, FIRST_PACKET, 6836 gspca_frame_add(gspca_dev, FIRST_PACKET,
6816 sd->jpeg_hdr, JPEG_HDR_SZ); 6837 sd->jpeg_hdr, JPEG_HDR_SZ);
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
index a6572e5ae369..a27d93b503a5 100644
--- a/drivers/media/video/hdpvr/hdpvr-core.c
+++ b/drivers/media/video/hdpvr/hdpvr-core.c
@@ -283,6 +283,7 @@ static int hdpvr_probe(struct usb_interface *interface,
283 struct hdpvr_device *dev; 283 struct hdpvr_device *dev;
284 struct usb_host_interface *iface_desc; 284 struct usb_host_interface *iface_desc;
285 struct usb_endpoint_descriptor *endpoint; 285 struct usb_endpoint_descriptor *endpoint;
286 struct i2c_client *client;
286 size_t buffer_size; 287 size_t buffer_size;
287 int i; 288 int i;
288 int retval = -ENOMEM; 289 int retval = -ENOMEM;
@@ -381,13 +382,21 @@ static int hdpvr_probe(struct usb_interface *interface,
381#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 382#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
382 retval = hdpvr_register_i2c_adapter(dev); 383 retval = hdpvr_register_i2c_adapter(dev);
383 if (retval < 0) { 384 if (retval < 0) {
384 v4l2_err(&dev->v4l2_dev, "registering i2c adapter failed\n"); 385 v4l2_err(&dev->v4l2_dev, "i2c adapter register failed\n");
385 goto error; 386 goto error;
386 } 387 }
387 388
388 retval = hdpvr_register_i2c_ir(dev); 389 client = hdpvr_register_ir_rx_i2c(dev);
389 if (retval < 0) 390 if (!client) {
390 v4l2_err(&dev->v4l2_dev, "registering i2c IR devices failed\n"); 391 v4l2_err(&dev->v4l2_dev, "i2c IR RX device register failed\n");
392 goto reg_fail;
393 }
394
395 client = hdpvr_register_ir_tx_i2c(dev);
396 if (!client) {
397 v4l2_err(&dev->v4l2_dev, "i2c IR TX device register failed\n");
398 goto reg_fail;
399 }
391#endif 400#endif
392 401
393 /* let the user know what node this device is now attached to */ 402 /* let the user know what node this device is now attached to */
@@ -395,6 +404,10 @@ static int hdpvr_probe(struct usb_interface *interface,
395 video_device_node_name(dev->video_dev)); 404 video_device_node_name(dev->video_dev));
396 return 0; 405 return 0;
397 406
407reg_fail:
408#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
409 i2c_del_adapter(&dev->i2c_adapter);
410#endif
398error: 411error:
399 if (dev) { 412 if (dev) {
400 /* Destroy single thread */ 413 /* Destroy single thread */
@@ -424,6 +437,9 @@ static void hdpvr_disconnect(struct usb_interface *interface)
424 mutex_lock(&dev->io_mutex); 437 mutex_lock(&dev->io_mutex);
425 hdpvr_cancel_queue(dev); 438 hdpvr_cancel_queue(dev);
426 mutex_unlock(&dev->io_mutex); 439 mutex_unlock(&dev->io_mutex);
440#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
441 i2c_del_adapter(&dev->i2c_adapter);
442#endif
427 video_unregister_device(dev->video_dev); 443 video_unregister_device(dev->video_dev);
428 atomic_dec(&dev_nr); 444 atomic_dec(&dev_nr);
429} 445}
diff --git a/drivers/media/video/hdpvr/hdpvr-i2c.c b/drivers/media/video/hdpvr/hdpvr-i2c.c
index 89b71faeaac2..e53fa55d56a1 100644
--- a/drivers/media/video/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/video/hdpvr/hdpvr-i2c.c
@@ -31,26 +31,34 @@
31#define Z8F0811_IR_RX_I2C_ADDR 0x71 31#define Z8F0811_IR_RX_I2C_ADDR 0x71
32 32
33 33
34static struct i2c_board_info hdpvr_i2c_board_info = { 34struct i2c_client *hdpvr_register_ir_tx_i2c(struct hdpvr_device *dev)
35 I2C_BOARD_INFO("ir_tx_z8f0811_hdpvr", Z8F0811_IR_TX_I2C_ADDR), 35{
36 I2C_BOARD_INFO("ir_rx_z8f0811_hdpvr", Z8F0811_IR_RX_I2C_ADDR), 36 struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data;
37}; 37 struct i2c_board_info hdpvr_ir_tx_i2c_board_info = {
38 I2C_BOARD_INFO("ir_tx_z8f0811_hdpvr", Z8F0811_IR_TX_I2C_ADDR),
39 };
40
41 init_data->name = "HD-PVR";
42 hdpvr_ir_tx_i2c_board_info.platform_data = init_data;
38 43
39int hdpvr_register_i2c_ir(struct hdpvr_device *dev) 44 return i2c_new_device(&dev->i2c_adapter, &hdpvr_ir_tx_i2c_board_info);
45}
46
47struct i2c_client *hdpvr_register_ir_rx_i2c(struct hdpvr_device *dev)
40{ 48{
41 struct i2c_client *c;
42 struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data; 49 struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data;
50 struct i2c_board_info hdpvr_ir_rx_i2c_board_info = {
51 I2C_BOARD_INFO("ir_rx_z8f0811_hdpvr", Z8F0811_IR_RX_I2C_ADDR),
52 };
43 53
44 /* Our default information for ir-kbd-i2c.c to use */ 54 /* Our default information for ir-kbd-i2c.c to use */
45 init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW; 55 init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;
46 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 56 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
47 init_data->type = RC_TYPE_RC5; 57 init_data->type = RC_TYPE_RC5;
48 init_data->name = "HD PVR"; 58 init_data->name = "HD-PVR";
49 hdpvr_i2c_board_info.platform_data = init_data; 59 hdpvr_ir_rx_i2c_board_info.platform_data = init_data;
50
51 c = i2c_new_device(&dev->i2c_adapter, &hdpvr_i2c_board_info);
52 60
53 return (c == NULL) ? -ENODEV : 0; 61 return i2c_new_device(&dev->i2c_adapter, &hdpvr_ir_rx_i2c_board_info);
54} 62}
55 63
56static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus, 64static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus,
diff --git a/drivers/media/video/hdpvr/hdpvr.h b/drivers/media/video/hdpvr/hdpvr.h
index ee74e3be9a6a..072f23c570f3 100644
--- a/drivers/media/video/hdpvr/hdpvr.h
+++ b/drivers/media/video/hdpvr/hdpvr.h
@@ -313,7 +313,8 @@ int hdpvr_cancel_queue(struct hdpvr_device *dev);
313/* i2c adapter registration */ 313/* i2c adapter registration */
314int hdpvr_register_i2c_adapter(struct hdpvr_device *dev); 314int hdpvr_register_i2c_adapter(struct hdpvr_device *dev);
315 315
316int hdpvr_register_i2c_ir(struct hdpvr_device *dev); 316struct i2c_client *hdpvr_register_ir_rx_i2c(struct hdpvr_device *dev);
317struct i2c_client *hdpvr_register_ir_tx_i2c(struct hdpvr_device *dev);
317 318
318/*========================================================================*/ 319/*========================================================================*/
319/* buffer management */ 320/* buffer management */
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index d2b20ad383a3..a221ad68b330 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -128,6 +128,19 @@ static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
128 128
129static int get_key_haup_xvr(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) 129static int get_key_haup_xvr(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
130{ 130{
131 int ret;
132 unsigned char buf[1] = { 0 };
133
134 /*
135 * This is the same apparent "are you ready?" poll command observed
136 * watching Windows driver traffic and implemented in lirc_zilog. With
137 * this added, we get far saner remote behavior with z8 chips on usb
138 * connected devices, even with the default polling interval of 100ms.
139 */
140 ret = i2c_master_send(ir->c, buf, 1);
141 if (ret != 1)
142 return (ret < 0) ? ret : -EINVAL;
143
131 return get_key_haup_common (ir, ir_key, ir_raw, 6, 3); 144 return get_key_haup_common (ir, ir_key, ir_raw, 6, 3);
132} 145}
133 146
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
index ccc884948f34..451ecd485f97 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
@@ -597,7 +597,6 @@ static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw)
597 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 597 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
598 init_data->type = RC_TYPE_RC5; 598 init_data->type = RC_TYPE_RC5;
599 init_data->name = hdw->hdw_desc->description; 599 init_data->name = hdw->hdw_desc->description;
600 init_data->polling_interval = 260; /* ms From lirc_zilog */
601 /* IR Receiver */ 600 /* IR Receiver */
602 info.addr = 0x71; 601 info.addr = 0x71;
603 info.platform_data = init_data; 602 info.platform_data = init_data;
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index f35459d1f42f..0db90922ee93 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -1565,7 +1565,7 @@ static int saa711x_probe(struct i2c_client *client,
1565 chip_id = name[5]; 1565 chip_id = name[5];
1566 1566
1567 /* Check whether this chip is part of the saa711x series */ 1567 /* Check whether this chip is part of the saa711x series */
1568 if (memcmp(name, "1f711", 5)) { 1568 if (memcmp(name + 1, "f711", 4)) {
1569 v4l_dbg(1, debug, client, "chip found @ 0x%x (ID %s) does not match a known saa711x chip.\n", 1569 v4l_dbg(1, debug, client, "chip found @ 0x%x (ID %s) does not match a known saa711x chip.\n",
1570 client->addr << 1, name); 1570 client->addr << 1, name);
1571 return -ENODEV; 1571 return -ENODEV;