Lines Matching +full:on +full:- +full:the +full:- +full:go
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2005-2006 Micronas USA Inc.
22 #include "go7007-priv.h"
29 /* #define GO7007_I2C_DEBUG */ /* for debugging the EZ-USB I2C adapter */
36 * Pipes on EZ-USB interface:
37 * 0 snd - Control
38 * 0 rcv - Control
39 * 2 snd - Download firmware (control)
40 * 4 rcv - Read Interrupt (interrupt)
41 * 6 rcv - Read Video (bulk)
42 * 8 rcv - Read Audio (bulk)
97 .name = "S-Video",
134 .name = "S-Video",
181 .name = "S-Video",
225 .type = "sony-btf-mpx",
244 .name = "S-Video",
327 .name = "S-Video",
448 .name = "S-Video",
500 .name = "S-Video",
540 .bcdDevice_lo = 0x205, /* Revision number of XMen-II */
560 .bcdDevice_lo = 0x209, /* Revision number of XMen-III */
620 /********************* Driver for EZ-USB HPI interface *********************/
622 static int go7007_usb_vendor_request(struct go7007 *go, int request, in go7007_usb_vendor_request() argument
625 struct go7007_usb *usb = go->hpi_context; in go7007_usb_vendor_request()
629 return usb_control_msg(usb->usbdev, in go7007_usb_vendor_request()
630 usb_rcvctrlpipe(usb->usbdev, 0), request, in go7007_usb_vendor_request()
634 return usb_control_msg(usb->usbdev, in go7007_usb_vendor_request()
635 usb_sndctrlpipe(usb->usbdev, 0), request, in go7007_usb_vendor_request()
641 static int go7007_usb_interface_reset(struct go7007 *go) in go7007_usb_interface_reset() argument
643 struct go7007_usb *usb = go->hpi_context; in go7007_usb_interface_reset()
646 if (go->status == STATUS_SHUTDOWN) in go7007_usb_interface_reset()
647 return -1; in go7007_usb_interface_reset()
649 if (go7007_write_interrupt(go, 0x0001, 0x0001) < 0) in go7007_usb_interface_reset()
650 return -1; in go7007_usb_interface_reset()
653 if (usb->board->flags & GO7007_USB_EZUSB) { in go7007_usb_interface_reset()
654 /* Reset buffer in EZ-USB */ in go7007_usb_interface_reset()
655 pr_debug("resetting EZ-USB buffers\n"); in go7007_usb_interface_reset()
656 if (go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0 || in go7007_usb_interface_reset()
657 go7007_usb_vendor_request(go, 0x10, 0, 0, NULL, 0, 0) < 0) in go7007_usb_interface_reset()
658 return -1; in go7007_usb_interface_reset()
661 if (go7007_write_interrupt(go, 0x0001, 0x0001) < 0) in go7007_usb_interface_reset()
662 return -1; in go7007_usb_interface_reset()
667 if (go7007_read_interrupt(go, &intr_val, &intr_data) < 0 || in go7007_usb_interface_reset()
669 dev_err(go->dev, "unable to reset the USB interface\n"); in go7007_usb_interface_reset()
670 return -1; in go7007_usb_interface_reset()
675 static int go7007_usb_ezusb_write_interrupt(struct go7007 *go, in go7007_usb_ezusb_write_interrupt() argument
678 struct go7007_usb *usb = go->hpi_context; in go7007_usb_ezusb_write_interrupt()
686 r = usb_control_msg(usb->usbdev, in go7007_usb_ezusb_write_interrupt()
687 usb_rcvctrlpipe(usb->usbdev, 0), 0x14, in go7007_usb_ezusb_write_interrupt()
689 0, HPI_STATUS_ADDR, go->usb_buf, in go7007_usb_ezusb_write_interrupt()
693 status_reg = le16_to_cpu(*((__le16 *)go->usb_buf)); in go7007_usb_ezusb_write_interrupt()
701 dev_err(go->dev, "device is hung, status reg = 0x%04x\n", status_reg); in go7007_usb_ezusb_write_interrupt()
702 return -1; in go7007_usb_ezusb_write_interrupt()
704 r = usb_control_msg(usb->usbdev, usb_sndctrlpipe(usb->usbdev, 0), 0x12, in go7007_usb_ezusb_write_interrupt()
709 r = usb_control_msg(usb->usbdev, usb_sndctrlpipe(usb->usbdev, 0), in go7007_usb_ezusb_write_interrupt()
717 dev_err(go->dev, "error in WriteInterrupt: %d\n", r); in go7007_usb_ezusb_write_interrupt()
721 static int go7007_usb_onboard_write_interrupt(struct go7007 *go, in go7007_usb_onboard_write_interrupt() argument
724 struct go7007_usb *usb = go->hpi_context; in go7007_usb_onboard_write_interrupt()
730 go->usb_buf[0] = data & 0xff; in go7007_usb_onboard_write_interrupt()
731 go->usb_buf[1] = data >> 8; in go7007_usb_onboard_write_interrupt()
732 go->usb_buf[2] = addr & 0xff; in go7007_usb_onboard_write_interrupt()
733 go->usb_buf[3] = addr >> 8; in go7007_usb_onboard_write_interrupt()
734 go->usb_buf[4] = go->usb_buf[5] = go->usb_buf[6] = go->usb_buf[7] = 0; in go7007_usb_onboard_write_interrupt()
735 r = usb_control_msg(usb->usbdev, usb_sndctrlpipe(usb->usbdev, 2), 0x00, in go7007_usb_onboard_write_interrupt()
737 0xf0f0, go->usb_buf, 8, timeout); in go7007_usb_onboard_write_interrupt()
739 dev_err(go->dev, "error in WriteInterrupt: %d\n", r); in go7007_usb_onboard_write_interrupt()
747 struct go7007 *go = (struct go7007 *)urb->context; in go7007_usb_readinterrupt_complete() local
748 __le16 *regs = (__le16 *)urb->transfer_buffer; in go7007_usb_readinterrupt_complete()
749 int status = urb->status; in go7007_usb_readinterrupt_complete()
752 if (status != -ESHUTDOWN && in go7007_usb_readinterrupt_complete()
753 go->status != STATUS_SHUTDOWN) { in go7007_usb_readinterrupt_complete()
754 dev_err(go->dev, "error in read interrupt: %d\n", urb->status); in go7007_usb_readinterrupt_complete()
756 wake_up(&go->interrupt_waitq); in go7007_usb_readinterrupt_complete()
759 } else if (urb->actual_length != urb->transfer_buffer_length) { in go7007_usb_readinterrupt_complete()
760 dev_err(go->dev, "short read in interrupt pipe!\n"); in go7007_usb_readinterrupt_complete()
762 go->interrupt_available = 1; in go7007_usb_readinterrupt_complete()
763 go->interrupt_data = __le16_to_cpu(regs[0]); in go7007_usb_readinterrupt_complete()
764 go->interrupt_value = __le16_to_cpu(regs[1]); in go7007_usb_readinterrupt_complete()
766 go->interrupt_value, go->interrupt_data); in go7007_usb_readinterrupt_complete()
769 wake_up(&go->interrupt_waitq); in go7007_usb_readinterrupt_complete()
772 static int go7007_usb_read_interrupt(struct go7007 *go) in go7007_usb_read_interrupt() argument
774 struct go7007_usb *usb = go->hpi_context; in go7007_usb_read_interrupt()
777 r = usb_submit_urb(usb->intr_urb, GFP_KERNEL); in go7007_usb_read_interrupt()
779 dev_err(go->dev, "unable to submit interrupt urb: %d\n", r); in go7007_usb_read_interrupt()
787 struct go7007 *go = (struct go7007 *)urb->context; in go7007_usb_read_video_pipe_complete() local
788 int r, status = urb->status; in go7007_usb_read_video_pipe_complete()
790 if (!vb2_is_streaming(&go->vidq)) { in go7007_usb_read_video_pipe_complete()
791 wake_up_interruptible(&go->frame_waitq); in go7007_usb_read_video_pipe_complete()
795 dev_err(go->dev, "error in video pipe: %d\n", status); in go7007_usb_read_video_pipe_complete()
798 if (urb->actual_length != urb->transfer_buffer_length) { in go7007_usb_read_video_pipe_complete()
799 dev_err(go->dev, "short read in video pipe!\n"); in go7007_usb_read_video_pipe_complete()
802 go7007_parse_video_stream(go, urb->transfer_buffer, urb->actual_length); in go7007_usb_read_video_pipe_complete()
805 dev_err(go->dev, "error in video pipe: %d\n", r); in go7007_usb_read_video_pipe_complete()
810 struct go7007 *go = (struct go7007 *)urb->context; in go7007_usb_read_audio_pipe_complete() local
811 int r, status = urb->status; in go7007_usb_read_audio_pipe_complete()
813 if (!vb2_is_streaming(&go->vidq)) in go7007_usb_read_audio_pipe_complete()
816 dev_err(go->dev, "error in audio pipe: %d\n", in go7007_usb_read_audio_pipe_complete()
820 if (urb->actual_length != urb->transfer_buffer_length) { in go7007_usb_read_audio_pipe_complete()
821 dev_err(go->dev, "short read in audio pipe!\n"); in go7007_usb_read_audio_pipe_complete()
824 if (go->audio_deliver != NULL) in go7007_usb_read_audio_pipe_complete()
825 go->audio_deliver(go, urb->transfer_buffer, urb->actual_length); in go7007_usb_read_audio_pipe_complete()
828 dev_err(go->dev, "error in audio pipe: %d\n", r); in go7007_usb_read_audio_pipe_complete()
831 static int go7007_usb_stream_start(struct go7007 *go) in go7007_usb_stream_start() argument
833 struct go7007_usb *usb = go->hpi_context; in go7007_usb_stream_start()
837 r = usb_submit_urb(usb->video_urbs[i], GFP_KERNEL); in go7007_usb_stream_start()
839 dev_err(go->dev, "error submitting video urb %d: %d\n", i, r); in go7007_usb_stream_start()
843 if (!go->audio_enabled) in go7007_usb_stream_start()
847 r = usb_submit_urb(usb->audio_urbs[i], GFP_KERNEL); in go7007_usb_stream_start()
849 dev_err(go->dev, "error submitting audio urb %d: %d\n", i, r); in go7007_usb_stream_start()
857 usb_kill_urb(usb->audio_urbs[i]); in go7007_usb_stream_start()
860 usb_kill_urb(usb->video_urbs[i]); in go7007_usb_stream_start()
861 return -1; in go7007_usb_stream_start()
864 static int go7007_usb_stream_stop(struct go7007 *go) in go7007_usb_stream_stop() argument
866 struct go7007_usb *usb = go->hpi_context; in go7007_usb_stream_stop()
869 if (go->status == STATUS_SHUTDOWN) in go7007_usb_stream_stop()
872 usb_kill_urb(usb->video_urbs[i]); in go7007_usb_stream_stop()
873 if (go->audio_enabled) in go7007_usb_stream_stop()
875 usb_kill_urb(usb->audio_urbs[i]); in go7007_usb_stream_stop()
879 static int go7007_usb_send_firmware(struct go7007 *go, u8 *data, int len) in go7007_usb_send_firmware() argument
881 struct go7007_usb *usb = go->hpi_context; in go7007_usb_send_firmware()
887 if (usb->board->flags & GO7007_USB_EZUSB) in go7007_usb_send_firmware()
888 pipe = usb_sndbulkpipe(usb->usbdev, 2); in go7007_usb_send_firmware()
890 pipe = usb_sndbulkpipe(usb->usbdev, 3); in go7007_usb_send_firmware()
892 return usb_bulk_msg(usb->usbdev, pipe, data, len, in go7007_usb_send_firmware()
896 static void go7007_usb_release(struct go7007 *go) in go7007_usb_release() argument
898 struct go7007_usb *usb = go->hpi_context; in go7007_usb_release()
902 if (usb->intr_urb) { in go7007_usb_release()
903 usb_kill_urb(usb->intr_urb); in go7007_usb_release()
904 kfree(usb->intr_urb->transfer_buffer); in go7007_usb_release()
905 usb_free_urb(usb->intr_urb); in go7007_usb_release()
908 /* Free USB-related structs */ in go7007_usb_release()
910 vurb = usb->video_urbs[i]; in go7007_usb_release()
913 kfree(vurb->transfer_buffer); in go7007_usb_release()
916 aurb = usb->audio_urbs[i]; in go7007_usb_release()
919 kfree(aurb->transfer_buffer); in go7007_usb_release()
924 kfree(go->hpi_context); in go7007_usb_release()
947 /********************* Driver for EZ-USB I2C adapter *********************/
952 struct go7007 *go = i2c_get_adapdata(adapter); in go7007_usb_i2c_master_xfer() local
953 struct go7007_usb *usb = go->hpi_context; in go7007_usb_i2c_master_xfer()
954 u8 *buf = go->usb_buf; in go7007_usb_i2c_master_xfer()
956 int ret = -EIO; in go7007_usb_i2c_master_xfer()
958 if (go->status == STATUS_SHUTDOWN) in go7007_usb_i2c_master_xfer()
959 return -ENODEV; in go7007_usb_i2c_master_xfer()
961 mutex_lock(&usb->i2c_lock); in go7007_usb_i2c_master_xfer()
964 /* The hardware command is "write some bytes then read some in go7007_usb_i2c_master_xfer()
971 pr_debug("i2c write/read %d/%d bytes on %02x\n", in go7007_usb_i2c_master_xfer()
982 pr_debug("i2c read %d bytes on %02x\n", in go7007_usb_i2c_master_xfer()
992 pr_debug("i2c write %d bytes on %02x\n", in go7007_usb_i2c_master_xfer()
1002 if (go7007_usb_vendor_request(go, 0x24, 0, 0, in go7007_usb_i2c_master_xfer()
1007 if (go7007_usb_vendor_request(go, 0x25, 0, 0, buf, in go7007_usb_i2c_master_xfer()
1016 mutex_unlock(&usb->i2c_lock); in go7007_usb_i2c_master_xfer()
1022 /* No errors are reported by the hardware, so we don't bother in go7007_usb_functionality()
1034 .name = "WIS GO7007SB EZ-USB",
1043 struct go7007 *go; in go7007_usb_probe() local
1054 switch (id->driver_info) { in go7007_usb_probe()
1084 name = "Plextor PX-M402U"; in go7007_usb_probe()
1088 name = "Plextor PX-TV402U (unknown tuner)"; in go7007_usb_probe()
1092 dev_err(&intf->dev, "The Lifeview TV Walker Ultra is not supported. Sorry!\n"); in go7007_usb_probe()
1093 return -ENODEV; in go7007_usb_probe()
1100 dev_info(&intf->dev, "Sensoray 2250 found\n"); in go7007_usb_probe()
1109 dev_err(&intf->dev, "unknown board ID %d!\n", in go7007_usb_probe()
1110 (unsigned int)id->driver_info); in go7007_usb_probe()
1111 return -ENODEV; in go7007_usb_probe()
1114 go = go7007_alloc(&board->main_info, &intf->dev); in go7007_usb_probe()
1115 if (go == NULL) in go7007_usb_probe()
1116 return -ENOMEM; in go7007_usb_probe()
1120 kfree(go); in go7007_usb_probe()
1121 return -ENOMEM; in go7007_usb_probe()
1124 usb->board = board; in go7007_usb_probe()
1125 usb->usbdev = usbdev; in go7007_usb_probe()
1126 usb_make_path(usbdev, go->bus_info, sizeof(go->bus_info)); in go7007_usb_probe()
1127 go->board_id = id->driver_info; in go7007_usb_probe()
1128 strscpy(go->name, name, sizeof(go->name)); in go7007_usb_probe()
1129 if (board->flags & GO7007_USB_EZUSB) in go7007_usb_probe()
1130 go->hpi_ops = &go7007_usb_ezusb_hpi_ops; in go7007_usb_probe()
1132 go->hpi_ops = &go7007_usb_onboard_hpi_ops; in go7007_usb_probe()
1133 go->hpi_context = usb; in go7007_usb_probe()
1135 ep = usb->usbdev->ep_in[4]; in go7007_usb_probe()
1139 /* Allocate the URB and buffer for receiving incoming interrupts */ in go7007_usb_probe()
1140 usb->intr_urb = usb_alloc_urb(0, GFP_KERNEL); in go7007_usb_probe()
1141 if (usb->intr_urb == NULL) in go7007_usb_probe()
1143 usb->intr_urb->transfer_buffer = kmalloc_array(2, sizeof(u16), in go7007_usb_probe()
1145 if (usb->intr_urb->transfer_buffer == NULL) in go7007_usb_probe()
1148 if (usb_endpoint_type(&ep->desc) == USB_ENDPOINT_XFER_BULK) in go7007_usb_probe()
1149 usb_fill_bulk_urb(usb->intr_urb, usb->usbdev, in go7007_usb_probe()
1150 usb_rcvbulkpipe(usb->usbdev, 4), in go7007_usb_probe()
1151 usb->intr_urb->transfer_buffer, 2*sizeof(u16), in go7007_usb_probe()
1152 go7007_usb_readinterrupt_complete, go); in go7007_usb_probe()
1154 usb_fill_int_urb(usb->intr_urb, usb->usbdev, in go7007_usb_probe()
1155 usb_rcvintpipe(usb->usbdev, 4), in go7007_usb_probe()
1156 usb->intr_urb->transfer_buffer, 2*sizeof(u16), in go7007_usb_probe()
1157 go7007_usb_readinterrupt_complete, go, 8); in go7007_usb_probe()
1158 usb_set_intfdata(intf, &go->v4l2_dev); in go7007_usb_probe()
1160 /* Boot the GO7007 */ in go7007_usb_probe()
1161 if (go7007_boot_encoder(go, go->board_info->flags & in go7007_usb_probe()
1165 /* Register the EZ-USB I2C adapter, if we're using it */ in go7007_usb_probe()
1166 if (board->flags & GO7007_USB_EZUSB_I2C) { in go7007_usb_probe()
1167 memcpy(&go->i2c_adapter, &go7007_usb_adap_templ, in go7007_usb_probe()
1169 mutex_init(&usb->i2c_lock); in go7007_usb_probe()
1170 go->i2c_adapter.dev.parent = go->dev; in go7007_usb_probe()
1171 i2c_set_adapdata(&go->i2c_adapter, go); in go7007_usb_probe()
1172 if (i2c_add_adapter(&go->i2c_adapter) < 0) { in go7007_usb_probe()
1173 dev_err(go->dev, "error: i2c_add_adapter failed\n"); in go7007_usb_probe()
1176 go->i2c_adapter_online = 1; in go7007_usb_probe()
1179 /* Pelco and Adlink reused the XMen and XMen-III vendor and product in go7007_usb_probe()
1181 * by probing the sensor, but there is no way to probe the sensors on in go7007_usb_probe()
1182 * the Pelco and Adlink designs so we default to the Adlink. If it in go7007_usb_probe()
1183 * is actually a Pelco, the user must set the assume_endura module in go7007_usb_probe()
1185 if ((go->board_id == GO7007_BOARDID_XMEN || in go7007_usb_probe()
1186 go->board_id == GO7007_BOARDID_XMEN_III) && in go7007_usb_probe()
1187 go->i2c_adapter_online) { in go7007_usb_probe()
1191 i2c_smbus_xfer(&go->i2c_adapter, 0x21, I2C_CLIENT_SCCB, in go7007_usb_probe()
1195 go->board_id = GO7007_BOARDID_ENDURA; in go7007_usb_probe()
1196 usb->board = board = &board_endura; in go7007_usb_probe()
1197 go->board_info = &board->main_info; in go7007_usb_probe()
1198 strscpy(go->name, "Pelco Endura", in go7007_usb_probe()
1199 sizeof(go->name)); in go7007_usb_probe()
1204 if (go7007_read_addr(go, 0x3c81, &channel)) in go7007_usb_probe()
1208 go->board_id = GO7007_BOARDID_ADLINK_MPG24; in go7007_usb_probe()
1209 usb->board = board = &board_adlink_mpg24; in go7007_usb_probe()
1210 go->board_info = &board->main_info; in go7007_usb_probe()
1211 go->channel_number = channel; in go7007_usb_probe()
1212 snprintf(go->name, sizeof(go->name), in go7007_usb_probe()
1213 "Adlink PCI-MPG24, channel #%d", in go7007_usb_probe()
1216 go7007_update_board(go); in go7007_usb_probe()
1220 num_i2c_devs = go->board_info->num_i2c_devs; in go7007_usb_probe()
1222 /* Probe the tuner model on the TV402U */ in go7007_usb_probe()
1223 if (go->board_id == GO7007_BOARDID_PX_TV402U) { in go7007_usb_probe()
1225 if (go7007_usb_vendor_request(go, 0x41, 0, 0, go->usb_buf, 3, in go7007_usb_probe()
1227 dev_err(go->dev, "GPIO read failed!\n"); in go7007_usb_probe()
1230 switch (go->usb_buf[0] >> 6) { in go7007_usb_probe()
1232 go->tuner_type = TUNER_SONY_BTF_PG472Z; in go7007_usb_probe()
1233 go->std = V4L2_STD_PAL; in go7007_usb_probe()
1234 strscpy(go->name, "Plextor PX-TV402U-EU", in go7007_usb_probe()
1235 sizeof(go->name)); in go7007_usb_probe()
1238 go->tuner_type = TUNER_SONY_BTF_PK467Z; in go7007_usb_probe()
1239 go->std = V4L2_STD_NTSC_M_JP; in go7007_usb_probe()
1240 num_i2c_devs -= 2; in go7007_usb_probe()
1241 strscpy(go->name, "Plextor PX-TV402U-JP", in go7007_usb_probe()
1242 sizeof(go->name)); in go7007_usb_probe()
1245 go->tuner_type = TUNER_SONY_BTF_PB463Z; in go7007_usb_probe()
1246 num_i2c_devs -= 2; in go7007_usb_probe()
1247 strscpy(go->name, "Plextor PX-TV402U-NA", in go7007_usb_probe()
1248 sizeof(go->name)); in go7007_usb_probe()
1255 * to the EZ-USB GPIO output pins */ in go7007_usb_probe()
1256 if (go7007_usb_vendor_request(go, 0x40, 0x7f02, 0, in go7007_usb_probe()
1258 dev_err(go->dev, "GPIO write failed!\n"); in go7007_usb_probe()
1263 /* Print a nasty message if the user attempts to use a USB2.0 device in in go7007_usb_probe()
1264 * a USB1.1 port. There will be silent corruption of the stream. */ in go7007_usb_probe()
1265 if ((board->flags & GO7007_USB_EZUSB) && in go7007_usb_probe()
1266 usbdev->speed != USB_SPEED_HIGH) in go7007_usb_probe()
1267 …dev_err(go->dev, "*** WARNING *** This device must be connected to a USB 2.0 port! Attempting to … in go7007_usb_probe()
1269 /* Allocate the URBs and buffers for receiving the video stream */ in go7007_usb_probe()
1270 if (board->flags & GO7007_USB_EZUSB) { in go7007_usb_probe()
1271 if (!usb->usbdev->ep_in[6]) in go7007_usb_probe()
1274 video_pipe = usb_rcvbulkpipe(usb->usbdev, 6); in go7007_usb_probe()
1276 if (!usb->usbdev->ep_in[1]) in go7007_usb_probe()
1279 video_pipe = usb_rcvbulkpipe(usb->usbdev, 1); in go7007_usb_probe()
1282 usb->video_urbs[i] = usb_alloc_urb(0, GFP_KERNEL); in go7007_usb_probe()
1283 if (usb->video_urbs[i] == NULL) in go7007_usb_probe()
1285 usb->video_urbs[i]->transfer_buffer = in go7007_usb_probe()
1287 if (usb->video_urbs[i]->transfer_buffer == NULL) in go7007_usb_probe()
1289 usb_fill_bulk_urb(usb->video_urbs[i], usb->usbdev, video_pipe, in go7007_usb_probe()
1290 usb->video_urbs[i]->transfer_buffer, v_urb_len, in go7007_usb_probe()
1291 go7007_usb_read_video_pipe_complete, go); in go7007_usb_probe()
1294 /* Allocate the URBs and buffers for receiving the audio stream */ in go7007_usb_probe()
1295 if ((board->flags & GO7007_USB_EZUSB) && in go7007_usb_probe()
1296 (board->main_info.flags & GO7007_BOARD_HAS_AUDIO)) { in go7007_usb_probe()
1297 if (!usb->usbdev->ep_in[8]) in go7007_usb_probe()
1300 usb->audio_urbs[i] = usb_alloc_urb(0, GFP_KERNEL); in go7007_usb_probe()
1301 if (usb->audio_urbs[i] == NULL) in go7007_usb_probe()
1303 usb->audio_urbs[i]->transfer_buffer = kmalloc(4096, in go7007_usb_probe()
1305 if (usb->audio_urbs[i]->transfer_buffer == NULL) in go7007_usb_probe()
1307 usb_fill_bulk_urb(usb->audio_urbs[i], usb->usbdev, in go7007_usb_probe()
1308 usb_rcvbulkpipe(usb->usbdev, 8), in go7007_usb_probe()
1309 usb->audio_urbs[i]->transfer_buffer, 4096, in go7007_usb_probe()
1310 go7007_usb_read_audio_pipe_complete, go); in go7007_usb_probe()
1314 /* Do any final GO7007 initialization, then register the in go7007_usb_probe()
1316 if (go7007_register_encoder(go, num_i2c_devs) < 0) in go7007_usb_probe()
1319 go->status = STATUS_ONLINE; in go7007_usb_probe()
1323 go7007_usb_release(go); in go7007_usb_probe()
1324 kfree(go); in go7007_usb_probe()
1325 return -ENOMEM; in go7007_usb_probe()
1330 struct go7007 *go = to_go7007(usb_get_intfdata(intf)); in go7007_usb_disconnect() local
1332 mutex_lock(&go->queue_lock); in go7007_usb_disconnect()
1333 mutex_lock(&go->serialize_lock); in go7007_usb_disconnect()
1335 if (go->audio_enabled) in go7007_usb_disconnect()
1336 go7007_snd_remove(go); in go7007_usb_disconnect()
1338 go->status = STATUS_SHUTDOWN; in go7007_usb_disconnect()
1339 v4l2_device_disconnect(&go->v4l2_dev); in go7007_usb_disconnect()
1340 video_unregister_device(&go->vdev); in go7007_usb_disconnect()
1341 mutex_unlock(&go->serialize_lock); in go7007_usb_disconnect()
1342 mutex_unlock(&go->queue_lock); in go7007_usb_disconnect()
1344 v4l2_device_put(&go->v4l2_dev); in go7007_usb_disconnect()