diff options
author | merge <null@invalid> | 2009-01-22 13:55:32 +0000 |
---|---|---|
committer | Andy Green <agreen@octopus.localdomain> | 2009-01-22 13:55:32 +0000 |
commit | aa6f5ffbdba45aa8e19e5048648fc6c7b25376d3 (patch) | |
tree | fbb786d0ac6f8a774fd834e9ce951197e60fbffa /drivers/staging/go7007/go7007-usb.c | |
parent | f2d78193eae5dccd3d588d2c8ea0866efc368332 (diff) |
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141
pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040
stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch
mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage:
From: Andy Green <andy@openmoko.com>
fix-stray-endmenu.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/staging/go7007/go7007-usb.c')
-rw-r--r-- | drivers/staging/go7007/go7007-usb.c | 95 |
1 files changed, 73 insertions, 22 deletions
diff --git a/drivers/staging/go7007/go7007-usb.c b/drivers/staging/go7007/go7007-usb.c index 3f5ee3424e7..83eec920c7d 100644 --- a/drivers/staging/go7007/go7007-usb.c +++ b/drivers/staging/go7007/go7007-usb.c @@ -225,7 +225,7 @@ static struct go7007_usb_board board_px_tv402u = { .inputs = { { .video_input = 1, - .audio_input = TVAUDIO_INPUT_EXTERN, + .audio_input = TVAUDIO_INPUT_EXTERN, .name = "Composite", }, { @@ -398,6 +398,41 @@ static struct go7007_usb_board board_adlink_mpg24 = { }, }; +static struct go7007_usb_board board_sensoray_2250 = { + .flags = GO7007_USB_EZUSB | GO7007_USB_EZUSB_I2C, + .main_info = { + .firmware = "go7007tv.bin", + .audio_flags = GO7007_AUDIO_I2S_MODE_1 | + GO7007_AUDIO_I2S_MASTER | + GO7007_AUDIO_WORD_16, + .flags = GO7007_BOARD_HAS_AUDIO, + .audio_rate = 48000, + .audio_bclk_div = 8, + .audio_main_div = 2, + .hpi_buffer_cap = 7, + .sensor_flags = GO7007_SENSOR_656 | + GO7007_SENSOR_TV, + .num_i2c_devs = 1, + .i2c_devs = { + { + .id = I2C_DRIVERID_S2250, + .addr = 0x34, + }, + }, + .num_inputs = 2, + .inputs = { + { + .video_input = 0, + .name = "Composite", + }, + { + .video_input = 1, + .name = "S-Video", + }, + }, + }, +}; + static struct usb_device_id go7007_usb_id_table[] = { { .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION | @@ -491,6 +526,14 @@ static struct usb_device_id go7007_usb_id_table[] = { .bcdDevice_hi = 0x1, .driver_info = (kernel_ulong_t)GO7007_BOARDID_LIFEVIEW_LR192, }, + { + .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, + .idVendor = 0x1943, /* Vendor ID Sensoray */ + .idProduct = 0x2250, /* Product ID of 2250/2251 */ + .bcdDevice_lo = 0x1, + .bcdDevice_hi = 0x1, + .driver_info = (kernel_ulong_t)GO7007_BOARDID_SENSORAY_2250, + }, { } /* Terminating entry */ }; @@ -637,9 +680,10 @@ static void go7007_usb_readinterrupt_complete(struct urb *urb) { struct go7007 *go = (struct go7007 *)urb->context; u16 *regs = (u16 *)urb->transfer_buffer; + int status = urb->status; - if (urb->status != 0) { - if (urb->status != -ESHUTDOWN && + if (status) { + if (status != -ESHUTDOWN && go->status != STATUS_SHUTDOWN) { printk(KERN_ERR "go7007-usb: error in read interrupt: %d\n", @@ -680,15 +724,14 @@ static int go7007_usb_read_interrupt(struct go7007 *go) static void go7007_usb_read_video_pipe_complete(struct urb *urb) { struct go7007 *go = (struct go7007 *)urb->context; - int r; + int r, status = urb-> status; if (!go->streaming) { wake_up_interruptible(&go->frame_waitq); return; } - if (urb->status != 0) { - printk(KERN_ERR "go7007-usb: error in video pipe: %d\n", - urb->status); + if (status) { + printk(KERN_ERR "go7007-usb: error in video pipe: %d\n", status); return; } if (urb->actual_length != urb->transfer_buffer_length) { @@ -704,13 +747,12 @@ static void go7007_usb_read_video_pipe_complete(struct urb *urb) static void go7007_usb_read_audio_pipe_complete(struct urb *urb) { struct go7007 *go = (struct go7007 *)urb->context; - int r; + int r, status = urb->status; if (!go->streaming) return; - if (urb->status != 0) { - printk(KERN_ERR "go7007-usb: error in audio pipe: %d\n", - urb->status); + if (status) { + printk(KERN_ERR "go7007-usb: error in audio pipe: %d\n", status); return; } if (urb->actual_length != urb->transfer_buffer_length) { @@ -751,7 +793,7 @@ static int go7007_usb_stream_start(struct go7007 *go) return 0; audio_submit_failed: - for (i = 0; i < 8; ++i) + for (i = 0; i < 7; ++i) usb_kill_urb(usb->audio_urbs[i]); video_submit_failed: for (i = 0; i < 8; ++i) @@ -965,16 +1007,20 @@ static int go7007_usb_probe(struct usb_interface *intf, name = "Lifeview TV Walker Ultra"; board = &board_lifeview_lr192; break; + case GO7007_BOARDID_SENSORAY_2250: + printk(KERN_INFO "Sensoray 2250 found\n"); + name = "Sensoray 2250/2251\n"; + board = &board_sensoray_2250; + break; default: printk(KERN_ERR "go7007-usb: unknown board ID %d!\n", (unsigned int)id->driver_info); return 0; } - usb = kmalloc(sizeof(struct go7007_usb), GFP_KERNEL); + usb = kzalloc(sizeof(struct go7007_usb), GFP_KERNEL); if (usb == NULL) return -ENOMEM; - memset(usb, 0, sizeof(struct go7007_usb)); /* Allocate the URB and buffer for receiving incoming interrupts */ usb->intr_urb = usb_alloc_urb(0, GFP_KERNEL); @@ -1179,6 +1225,7 @@ static void go7007_usb_disconnect(struct usb_interface *intf) { struct go7007 *go = usb_get_intfdata(intf); struct go7007_usb *usb = go->hpi_context; + struct urb *vurb, *aurb; int i; go->status = STATUS_SHUTDOWN; @@ -1186,15 +1233,19 @@ static void go7007_usb_disconnect(struct usb_interface *intf) /* Free USB-related structs */ for (i = 0; i < 8; ++i) { - if (usb->video_urbs[i] != NULL) { - if (usb->video_urbs[i]->transfer_buffer != NULL) - kfree(usb->video_urbs[i]->transfer_buffer); - usb_free_urb(usb->video_urbs[i]); + vurb = usb->video_urbs[i]; + if (vurb) { + usb_kill_urb(vurb); + if (vurb->transfer_buffer) + kfree(vurb->transfer_buffer); + usb_free_urb(vurb); } - if (usb->audio_urbs[i] != NULL) { - if (usb->audio_urbs[i]->transfer_buffer != NULL) - kfree(usb->audio_urbs[i]->transfer_buffer); - usb_free_urb(usb->audio_urbs[i]); + aurb = usb->audio_urbs[i]; + if (aurb) { + usb_kill_urb(aurb); + if (aurb->transfer_buffer) + kfree(aurb->transfer_buffer); + usb_free_urb(aurb); } } kfree(usb->intr_urb->transfer_buffer); |