Taken from the 0.9.8-5 version of the out-of-tree wis-go7007 driver.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
select VIDEO_SAA711X if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_TW2804 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_TW9903 if MEDIA_SUBDRV_AUTOSELECT
+ select VIDEO_TW9906 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_UDA1342 if MEDIA_SUBDRV_AUTOSELECT
default N
go7007_write_addr(go, 0x1000, 0x0811);
go7007_write_addr(go, 0x1000, 0x0c11);
}
- if (go->board_id == GO7007_BOARDID_MATRIX_REV) {
+ switch (go->board_id) {
+ case GO7007_BOARDID_MATRIX_REV:
/* Set GPIO pin 0 to be an output (audio clock control) */
go7007_write_addr(go, 0x3c82, 0x0001);
go7007_write_addr(go, 0x3c80, 0x00fe);
- }
- if (go->board_id == GO7007_BOARDID_ADLINK_MPG24) {
+ break;
+ case GO7007_BOARDID_ADLINK_MPG24:
/* set GPIO5 to be an output, currently low */
go7007_write_addr(go, 0x3c82, 0x0000);
go7007_write_addr(go, 0x3c80, 0x00df);
+ break;
+ case GO7007_BOARDID_ADS_USBAV_709:
+ /* GPIO pin 0: audio clock control */
+ /* pin 2: TW9906 reset */
+ /* pin 3: capture LED */
+ go7007_write_addr(go, 0x3c82, 0x000d);
+ go7007_write_addr(go, 0x3c80, 0x00f2);
+ break;
}
return 0;
}
go->i2c_adapter_online = 1;
}
if (go->i2c_adapter_online) {
+ if (go->board_id == GO7007_BOARDID_ADS_USBAV_709) {
+ /* Reset the TW9906 */
+ go7007_write_addr(go, 0x3c82, 0x0009);
+ msleep(50);
+ go7007_write_addr(go, 0x3c82, 0x000d);
+ }
for (i = 0; i < num_i2c_devs; ++i)
init_i2c_module(&go->i2c_adapter, &go->board_info->i2c_devs[i]);
#define GO7007_BOARDID_ENDURA 11
#define GO7007_BOARDID_ADLINK_MPG24 12
#define GO7007_BOARDID_SENSORAY_2250 13 /* Sensoray 2250/2251 */
+#define GO7007_BOARDID_ADS_USBAV_709 14
/* Various characteristics of each board */
#define GO7007_BOARD_HAS_AUDIO (1<<0)
},
};
+static const struct go7007_usb_board board_ads_usbav_709 = {
+ .flags = GO7007_USB_EZUSB,
+ .main_info = {
+ .flags = GO7007_BOARD_HAS_AUDIO |
+ GO7007_BOARD_USE_ONBOARD_I2C,
+ .audio_flags = GO7007_AUDIO_I2S_MODE_1 |
+ GO7007_AUDIO_I2S_MASTER |
+ GO7007_AUDIO_WORD_16,
+ .audio_rate = 48000,
+ .audio_bclk_div = 8,
+ .audio_main_div = 2,
+ .hpi_buffer_cap = 7,
+ .sensor_flags = GO7007_SENSOR_656 |
+ GO7007_SENSOR_TV |
+ GO7007_SENSOR_VBI,
+ .num_i2c_devs = 1,
+ .i2c_devs = {
+ {
+ .type = "tw9906",
+ .is_video = 1,
+ .addr = 0x44,
+ },
+ },
+ .num_inputs = 2,
+ .inputs = {
+ {
+ .video_input = 0,
+ .name = "Composite",
+ },
+ {
+ .video_input = 10,
+ .name = "S-Video",
+ },
+ },
+ },
+};
+
static const struct usb_device_id go7007_usb_id_table[] = {
{
.match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION |
.bcdDevice_hi = 0x1,
.driver_info = (kernel_ulong_t)GO7007_BOARDID_SENSORAY_2250,
},
+ {
+ .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION,
+ .idVendor = 0x06e1, /* Vendor ID of ADS Technologies */
+ .idProduct = 0x0709, /* Product ID of DVD Xpress DX2 */
+ .bcdDevice_lo = 0x204,
+ .bcdDevice_hi = 0x204,
+ .driver_info = (kernel_ulong_t)GO7007_BOARDID_ADS_USBAV_709,
+ },
{ } /* Terminating entry */
};
name = "Sensoray 2250/2251";
board = &board_sensoray_2250;
break;
+ case GO7007_BOARDID_ADS_USBAV_709:
+ name = "ADS Tech DVD Xpress DX2";
+ board = &board_ads_usbav_709;
+ break;
default:
printk(KERN_ERR "go7007-usb: unknown board ID %d!\n",
(unsigned int)id->driver_info);
v4l2_ctrl_grab(go->mpeg_video_gop_closure, true);
v4l2_ctrl_grab(go->mpeg_video_bitrate, true);
v4l2_ctrl_grab(go->mpeg_video_aspect_ratio, true);
+ /* Turn on Capture LED */
+ if (go->board_id == GO7007_BOARDID_ADS_USBAV_709)
+ go7007_write_addr(go, 0x3c82, 0x0005);
return ret;
}
v4l2_ctrl_grab(go->mpeg_video_gop_closure, false);
v4l2_ctrl_grab(go->mpeg_video_bitrate, false);
v4l2_ctrl_grab(go->mpeg_video_aspect_ratio, false);
+ /* Turn on Capture LED */
+ if (go->board_id == GO7007_BOARDID_ADS_USBAV_709)
+ go7007_write_addr(go, 0x3c82, 0x000d);
return 0;
}