Lines Matching refs:go

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()
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()
649 if (go7007_write_interrupt(go, 0x0001, 0x0001) < 0) 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()
661 if (go7007_write_interrupt(go, 0x0001, 0x0001) < 0) 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()
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()
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()
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()
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
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()
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()
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
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()
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
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()
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()
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()
849 dev_err(go->dev, "error submitting audio urb %d: %d\n", i, r); 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()
873 if (go->audio_enabled) 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()
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()
924 kfree(go->hpi_context); in go7007_usb_release()
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()
958 if (go->status == STATUS_SHUTDOWN) 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()
1043 struct go7007 *go; in go7007_usb_probe() local
1114 go = go7007_alloc(&board->main_info, &intf->dev); in go7007_usb_probe()
1115 if (go == NULL) in go7007_usb_probe()
1120 kfree(go); 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()
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()
1152 go7007_usb_readinterrupt_complete, go); 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()
1161 if (go7007_boot_encoder(go, go->board_info->flags & in go7007_usb_probe()
1167 memcpy(&go->i2c_adapter, &go7007_usb_adap_templ, 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()
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()
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()
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()
1216 go7007_update_board(go); in go7007_usb_probe()
1220 num_i2c_devs = go->board_info->num_i2c_devs; 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()
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()
1247 strscpy(go->name, "Plextor PX-TV402U-NA", in go7007_usb_probe()
1248 sizeof(go->name)); 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()
1267 …dev_err(go->dev, "*** WARNING *** This device must be connected to a USB 2.0 port! Attempting to … in go7007_usb_probe()
1291 go7007_usb_read_video_pipe_complete, go); in go7007_usb_probe()
1310 go7007_usb_read_audio_pipe_complete, go); 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()
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()