Lines Matching +full:display +full:- +full:width +full:- +full:chars

1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
3 * sisusb - usb kernel driver for SiS315(E) based USB2VGA dongles
57 /* Forward declarations / clean-up routines */
66 kfree(sisusb->obuf[i]); in sisusb_free_buffers()
67 sisusb->obuf[i] = NULL; in sisusb_free_buffers()
69 kfree(sisusb->ibuf); in sisusb_free_buffers()
70 sisusb->ibuf = NULL; in sisusb_free_buffers()
78 usb_free_urb(sisusb->sisurbout[i]); in sisusb_free_urbs()
79 sisusb->sisurbout[i] = NULL; in sisusb_free_urbs()
81 usb_free_urb(sisusb->sisurbin); in sisusb_free_urbs()
82 sisusb->sisurbin = NULL; in sisusb_free_urbs()
87 /* 1. out-bulks */
89 /* out-urb management */
96 for (i = 0; i < sisusb->numobufs; i++) { in sisusb_all_free()
98 if (sisusb->urbstatus[i] & SU_URB_BUSY) in sisusb_all_free()
114 for (i = 0; i < sisusb->numobufs; i++) { in sisusb_kill_all_busy()
116 if (sisusb->urbstatus[i] & SU_URB_BUSY) in sisusb_kill_all_busy()
117 usb_kill_urb(sisusb->sisurbout[i]); in sisusb_kill_all_busy()
127 wait_event_timeout(sisusb->wait_q, (i = sisusb_all_free(sisusb)), in sisusb_wait_all_out_complete()
137 for (i = 0; i < sisusb->numobufs; i++) { in sisusb_outurb_available()
139 if ((sisusb->urbstatus[i] & (SU_URB_BUSY|SU_URB_ALLOC)) == 0) in sisusb_outurb_available()
144 return -1; in sisusb_outurb_available()
151 wait_event_timeout(sisusb->wait_q, in sisusb_get_free_outbuf()
164 sisusb->urbstatus[i] |= SU_URB_ALLOC; in sisusb_alloc_outbuf()
171 if ((index >= 0) && (index < sisusb->numobufs)) in sisusb_free_outbuf()
172 sisusb->urbstatus[index] &= ~SU_URB_ALLOC; in sisusb_free_outbuf()
179 struct sisusb_urb_context *context = urb->context; in sisusb_bulk_completeout()
185 sisusb = context->sisusb; in sisusb_bulk_completeout()
187 if (!sisusb || !sisusb->sisusb_dev || !sisusb->present) in sisusb_bulk_completeout()
191 if (context->actual_length) in sisusb_bulk_completeout()
192 *(context->actual_length) += urb->actual_length; in sisusb_bulk_completeout()
195 sisusb->urbstatus[context->urbindex] &= ~SU_URB_BUSY; in sisusb_bulk_completeout()
196 wake_up(&sisusb->wait_q); in sisusb_bulk_completeout()
203 struct urb *urb = sisusb->sisurbout[index]; in sisusb_bulkout_msg()
207 urb->transfer_flags = 0; in sisusb_bulkout_msg()
209 usb_fill_bulk_urb(urb, sisusb->sisusb_dev, pipe, data, len, in sisusb_bulkout_msg()
211 &sisusb->urbout_context[index]); in sisusb_bulkout_msg()
213 urb->transfer_flags |= tflags; in sisusb_bulkout_msg()
214 urb->actual_length = 0; in sisusb_bulkout_msg()
217 sisusb->urbout_context[index].actual_length = (timeout) ? in sisusb_bulkout_msg()
221 sisusb->urbstatus[index] |= SU_URB_BUSY; in sisusb_bulkout_msg()
228 wait_event_timeout(sisusb->wait_q, in sisusb_bulkout_msg()
229 (!(sisusb->urbstatus[index] & SU_URB_BUSY)), in sisusb_bulkout_msg()
231 if (sisusb->urbstatus[index] & SU_URB_BUSY) { in sisusb_bulkout_msg()
234 retval = -ETIMEDOUT; in sisusb_bulkout_msg()
237 retval = urb->status; in sisusb_bulkout_msg()
238 byteswritten = urb->actual_length; in sisusb_bulkout_msg()
248 /* 2. in-bulks */
254 struct sisusb_usb_data *sisusb = urb->context; in sisusb_bulk_completein()
256 if (!sisusb || !sisusb->sisusb_dev || !sisusb->present) in sisusb_bulk_completein()
259 sisusb->completein = 1; in sisusb_bulk_completein()
260 wake_up(&sisusb->wait_q); in sisusb_bulk_completein()
267 struct urb *urb = sisusb->sisurbin; in sisusb_bulkin_msg()
270 urb->transfer_flags = 0; in sisusb_bulkin_msg()
272 usb_fill_bulk_urb(urb, sisusb->sisusb_dev, pipe, data, len, in sisusb_bulkin_msg()
275 urb->transfer_flags |= tflags; in sisusb_bulkin_msg()
276 urb->actual_length = 0; in sisusb_bulkin_msg()
278 sisusb->completein = 0; in sisusb_bulkin_msg()
281 wait_event_timeout(sisusb->wait_q, sisusb->completein, timeout); in sisusb_bulkin_msg()
282 if (!sisusb->completein) { in sisusb_bulkin_msg()
285 retval = -ETIMEDOUT; in sisusb_bulkin_msg()
288 retval = urb->status; in sisusb_bulkin_msg()
289 readbytes = urb->actual_length; in sisusb_bulkin_msg()
305 * to copy from (non-DMA) kernel memory, give "kernbuffer". If
307 * buffer "sisusb->obuf[index]" is set up with the data to send.
329 if (!sisusb || !sisusb->present || !sisusb->sisusb_dev) in sisusb_send_bulk_msg()
330 return -ENODEV; in sisusb_send_bulk_msg()
341 index = -1; in sisusb_send_bulk_msg()
342 else if (len > sisusb->obufsize) in sisusb_send_bulk_msg()
345 pipe = usb_sndbulkpipe(sisusb->sisusb_dev, ep); in sisusb_send_bulk_msg()
348 passsize = thispass = (sisusb->obufsize < count) ? in sisusb_send_bulk_msg()
349 sisusb->obufsize : count; in sisusb_send_bulk_msg()
355 return -EIO; in sisusb_send_bulk_msg()
357 buffer = sisusb->obuf[index]; in sisusb_send_bulk_msg()
362 return -EFAULT; in sisusb_send_bulk_msg()
376 if (!sisusb->sisusb_dev) in sisusb_send_bulk_msg()
377 return -ENODEV; in sisusb_send_bulk_msg()
383 if (result == -ETIMEDOUT) { in sisusb_send_bulk_msg()
386 if (!retry--) in sisusb_send_bulk_msg()
387 return -ETIME; in sisusb_send_bulk_msg()
394 thispass -= transferred_len; in sisusb_send_bulk_msg()
405 count -= passsize; in sisusb_send_bulk_msg()
409 index = -1; in sisusb_send_bulk_msg()
424 return ((*bytes_written) == len) ? 0 : -EIO; in sisusb_send_bulk_msg()
448 if (!sisusb || !sisusb->present || !sisusb->sisusb_dev) in sisusb_recv_bulk_msg()
449 return -ENODEV; in sisusb_recv_bulk_msg()
451 pipe = usb_rcvbulkpipe(sisusb->sisusb_dev, ep); in sisusb_recv_bulk_msg()
452 buffer = sisusb->ibuf; in sisusb_recv_bulk_msg()
453 bufsize = sisusb->ibufsize; in sisusb_recv_bulk_msg()
459 return -EIO; in sisusb_recv_bulk_msg()
464 if (!sisusb->sisusb_dev) in sisusb_recv_bulk_msg()
465 return -ENODEV; in sisusb_recv_bulk_msg()
475 else if (result == -ETIMEDOUT) { in sisusb_recv_bulk_msg()
477 if (!retry--) in sisusb_recv_bulk_msg()
478 return -ETIME; in sisusb_recv_bulk_msg()
483 return -EIO; in sisusb_recv_bulk_msg()
489 count -= thispass; in sisusb_recv_bulk_msg()
494 return -EFAULT; in sisusb_recv_bulk_msg()
509 return ((*bytes_read) == len) ? 0 : -EIO; in sisusb_recv_bulk_msg()
520 packet->data = 0; in sisusb_send_packet()
537 * return value and write it to packet->data in sisusb_send_packet()
542 packet->data = le32_to_cpu(tmp); in sisusb_send_packet()
556 packet->data = 0; in sisusb_send_bridge_packet()
573 * return value and write it to packet->data in sisusb_send_bridge_packet()
578 packet->data = le32_to_cpu(tmp); in sisusb_send_bridge_packet()
591 * - the write routines expect "data" in machine endianness format.
593 * - the read routines can expect read data in machine-endianess.
731 * buffer as chars, therefore lsb/msb has to be corrected if using the
732 * byte/word/long/etc routines for speed-up
737 * that the data already is in the transfer buffer "sisusb->obuf[index]".
756 kernbuffer = sisusb->obuf[index]; in sisusb_write_mem_bulk()
767 return -EFAULT; in sisusb_write_mem_bulk()
782 return -EFAULT; in sisusb_write_mem_bulk()
797 return -EFAULT; in sisusb_write_mem_bulk()
829 return -EFAULT; in sisusb_write_mem_bulk()
879 (sisusb->obufsize-1)); in sisusb_write_mem_bulk()
894 if (sisusb->flagb0 != 0x16) { in sisusb_write_mem_bulk()
900 sisusb->flagb0 = 0x16; in sisusb_write_mem_bulk()
923 (sisusb->obufsize-1)); in sisusb_write_mem_bulk()
929 dev_err(&sisusb->sisusb_dev->dev, in sisusb_write_mem_bulk()
934 dev_err(&sisusb->sisusb_dev->dev, in sisusb_write_mem_bulk()
938 length -= (*bytes_written); in sisusb_write_mem_bulk()
946 return ret ? -EIO : 0; in sisusb_write_mem_bulk()
949 /* Remember: Read data in packet is in machine-endianess! So for
1114 return -EFAULT; in sisusb_read_mem_bulk()
1127 return -EFAULT; in sisusb_read_mem_bulk()
1151 return -EFAULT; in sisusb_read_mem_bulk()
1167 return -EFAULT; in sisusb_read_mem_bulk()
1175 length -= 4; in sisusb_read_mem_bulk()
1256 sisusb_copy_memory(sisusb, srcbuffer, sisusb->vrambase, 7); in sisusb_testreadwrite()
1259 dev_dbg(&sisusb->sisusb_dev->dev, in sisusb_testreadwrite()
1261 sisusb_read_memory(sisusb, destbuffer, sisusb->vrambase, i); in sisusb_testreadwrite()
1263 dev_dbg(&sisusb->sisusb_dev->dev, in sisusb_testreadwrite()
1305 if (address < sisusb->vrambase) in sisusb_clear_vram()
1308 if (address >= sisusb->vrambase + sisusb->vramsize) in sisusb_clear_vram()
1311 if (address + length > sisusb->vrambase + sisusb->vramsize) in sisusb_clear_vram()
1312 length = sisusb->vrambase + sisusb->vramsize - address; in sisusb_clear_vram()
1320 return -EBUSY; in sisusb_clear_vram()
1322 memset(sisusb->obuf[i], 0, sisusb->obufsize); in sisusb_clear_vram()
1325 * data will simply be re-used (like a ring-buffer). in sisusb_clear_vram()
1543 tmp |= ((rankno - 1) << 2); in sisusb_set_rank()
1564 ret |= WRITEL(sisusb->vrambase + j, j); in sisusb_check_rbc()
1569 ret |= READL(sisusb->vrambase + j, &tmp); in sisusb_check_rbc()
1588 for (i = rankno; i >= 1; i--) { in sisusb_check_ranks()
1634 for (j = 2; j > 0; j--) { in sisusb_get_sdram_size()
1661 address = sisusb->vrambase; /* Clear video ram */ in sisusb_setup_screen()
1664 length = sisusb->vramsize; in sisusb_setup_screen()
1672 address = sisusb->vrambase + (i * bpp); in sisusb_setup_screen()
1675 address += (modex * (modey-1) * bpp); in sisusb_setup_screen()
1680 address = sisusb->vrambase + ((i * modex) * bpp); in sisusb_setup_screen()
1683 address += ((modex - 1) * bpp); in sisusb_setup_screen()
1804 SETIREGAND(SISSR, 0x01, 0xdf); /* enable display */ in sisusb_set_default_mode()
1854 while (retry--) { in sisusb_init_gfxcore()
1980 dev_err(&sisusb->sisusb_dev->dev, in sisusb_init_gfxcore()
1986 dev_err(&sisusb->sisusb_dev->dev, in sisusb_init_gfxcore()
2033 sisusb->vramsize = (1 << ((tmp8 & 0xf0) >> 4)) * 1024 * 1024; in sisusb_get_ramconfig()
2046 sisusb->vramsize <<= 1; in sisusb_get_ramconfig()
2051 sisusb->vramsize += sisusb->vramsize/2; in sisusb_get_ramconfig()
2056 sisusb->vramsize <<= 1; in sisusb_get_ramconfig()
2061 dev_info(&sisusb->sisusb_dev->dev, in sisusb_get_ramconfig()
2062 "%dMB %s %cDR S%cRAM, bus width %d\n", in sisusb_get_ramconfig()
2063 sisusb->vramsize >> 20, ramtypetext1, in sisusb_get_ramconfig()
2150 if (sisusb->devinit == 1) { in sisusb_init_gfxdevice()
2175 if ((sisusb->devinit == 0) || (test != 3)) { in sisusb_init_gfxdevice()
2180 sisusb->devinit = 1; in sisusb_init_gfxdevice()
2184 if (sisusb->devinit) { in sisusb_init_gfxdevice()
2187 sisusb->gfxinit = 1; in sisusb_init_gfxdevice()
2207 return -ENODEV; in sisusb_open()
2211 return -ENODEV; in sisusb_open()
2213 mutex_lock(&sisusb->lock); in sisusb_open()
2215 if (!sisusb->present || !sisusb->ready) { in sisusb_open()
2216 mutex_unlock(&sisusb->lock); in sisusb_open()
2217 return -ENODEV; in sisusb_open()
2220 if (sisusb->isopen) { in sisusb_open()
2221 mutex_unlock(&sisusb->lock); in sisusb_open()
2222 return -EBUSY; in sisusb_open()
2225 if (!sisusb->devinit) { in sisusb_open()
2226 if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH || in sisusb_open()
2227 sisusb->sisusb_dev->speed >= USB_SPEED_SUPER) { in sisusb_open()
2229 mutex_unlock(&sisusb->lock); in sisusb_open()
2230 dev_err(&sisusb->sisusb_dev->dev, in sisusb_open()
2232 return -EIO; in sisusb_open()
2235 mutex_unlock(&sisusb->lock); in sisusb_open()
2236 dev_err(&sisusb->sisusb_dev->dev, in sisusb_open()
2238 return -EIO; in sisusb_open()
2243 kref_get(&sisusb->kref); in sisusb_open()
2245 sisusb->isopen = 1; in sisusb_open()
2247 file->private_data = sisusb; in sisusb_open()
2249 mutex_unlock(&sisusb->lock); in sisusb_open()
2261 usb_put_dev(sisusb->sisusb_dev); in sisusb_delete()
2263 sisusb->sisusb_dev = NULL; in sisusb_delete()
2273 sisusb = file->private_data; in sisusb_release()
2275 return -ENODEV; in sisusb_release()
2277 mutex_lock(&sisusb->lock); in sisusb_release()
2279 if (sisusb->present) { in sisusb_release()
2285 sisusb->isopen = 0; in sisusb_release()
2286 file->private_data = NULL; in sisusb_release()
2288 mutex_unlock(&sisusb->lock); in sisusb_release()
2291 kref_put(&sisusb->kref, sisusb_delete); in sisusb_release()
2306 sisusb = file->private_data; in sisusb_read()
2308 return -ENODEV; in sisusb_read()
2310 mutex_lock(&sisusb->lock); in sisusb_read()
2313 if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { in sisusb_read()
2314 mutex_unlock(&sisusb->lock); in sisusb_read()
2315 return -ENODEV; in sisusb_read()
2321 address = (*ppos) - SISUSB_PCI_PSEUDO_IOPORTBASE + in sisusb_read()
2327 * in machine-endianness. in sisusb_read()
2333 errno = -EIO; in sisusb_read()
2335 errno = -EFAULT; in sisusb_read()
2344 errno = -EIO; in sisusb_read()
2346 errno = -EFAULT; in sisusb_read()
2355 errno = -EIO; in sisusb_read()
2357 errno = -EFAULT; in sisusb_read()
2364 errno = -EIO; in sisusb_read()
2369 SISUSB_PCI_PSEUDO_MEMBASE + sisusb->vramsize) { in sisusb_read()
2371 address = (*ppos) - SISUSB_PCI_PSEUDO_MEMBASE + in sisusb_read()
2375 * Remember: Data delivered is never endian-corrected in sisusb_read()
2387 address = (*ppos) - SISUSB_PCI_PSEUDO_MMIOBASE + in sisusb_read()
2391 * Remember: Data delivered is never endian-corrected in sisusb_read()
2403 mutex_unlock(&sisusb->lock); in sisusb_read()
2404 return -EINVAL; in sisusb_read()
2407 address = (*ppos) - SISUSB_PCI_PSEUDO_PCIBASE; in sisusb_read()
2413 errno = -EIO; in sisusb_read()
2415 errno = -EFAULT; in sisusb_read()
2421 errno = -EBADFD; in sisusb_read()
2427 mutex_unlock(&sisusb->lock); in sisusb_read()
2442 sisusb = file->private_data; in sisusb_write()
2444 return -ENODEV; in sisusb_write()
2446 mutex_lock(&sisusb->lock); in sisusb_write()
2449 if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { in sisusb_write()
2450 mutex_unlock(&sisusb->lock); in sisusb_write()
2451 return -ENODEV; in sisusb_write()
2457 address = (*ppos) - SISUSB_PCI_PSEUDO_IOPORTBASE + in sisusb_write()
2463 * in machine-endianness. in sisusb_write()
2468 errno = -EFAULT; in sisusb_write()
2471 errno = -EIO; in sisusb_write()
2479 errno = -EFAULT; in sisusb_write()
2482 errno = -EIO; in sisusb_write()
2490 errno = -EFAULT; in sisusb_write()
2493 errno = -EIO; in sisusb_write()
2500 errno = -EIO; in sisusb_write()
2505 sisusb->vramsize) { in sisusb_write()
2507 address = (*ppos) - SISUSB_PCI_PSEUDO_MEMBASE + in sisusb_write()
2511 * Buffer is copied 1:1, therefore, on big-endian in sisusb_write()
2526 address = (*ppos) - SISUSB_PCI_PSEUDO_MMIOBASE + in sisusb_write()
2530 * Buffer is copied 1:1, therefore, on big-endian in sisusb_write()
2545 mutex_unlock(&sisusb->lock); in sisusb_write()
2546 return -EINVAL; in sisusb_write()
2549 address = (*ppos) - SISUSB_PCI_PSEUDO_PCIBASE; in sisusb_write()
2555 errno = -EFAULT; in sisusb_write()
2557 errno = -EIO; in sisusb_write()
2565 errno = -EBADFD; in sisusb_write()
2571 mutex_unlock(&sisusb->lock); in sisusb_write()
2581 sisusb = file->private_data; in sisusb_lseek()
2583 return -ENODEV; in sisusb_lseek()
2585 mutex_lock(&sisusb->lock); in sisusb_lseek()
2588 if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { in sisusb_lseek()
2589 mutex_unlock(&sisusb->lock); in sisusb_lseek()
2590 return -ENODEV; in sisusb_lseek()
2595 mutex_unlock(&sisusb->lock); in sisusb_lseek()
2608 if (!sisusb->devinit) in sisusb_handle_command()
2609 return -ENODEV; in sisusb_handle_command()
2611 port = y->data3 - in sisusb_handle_command()
2615 switch (y->operation) { in sisusb_handle_command()
2617 retval = sisusb_getidxreg(sisusb, port, y->data0, &y->data1); in sisusb_handle_command()
2620 retval = -EFAULT; in sisusb_handle_command()
2625 retval = sisusb_setidxreg(sisusb, port, y->data0, y->data1); in sisusb_handle_command()
2629 retval = sisusb_setidxregor(sisusb, port, y->data0, y->data1); in sisusb_handle_command()
2633 retval = sisusb_setidxregand(sisusb, port, y->data0, y->data1); in sisusb_handle_command()
2637 retval = sisusb_setidxregandor(sisusb, port, y->data0, in sisusb_handle_command()
2638 y->data1, y->data2); in sisusb_handle_command()
2642 retval = sisusb_setidxregmask(sisusb, port, y->data0, in sisusb_handle_command()
2643 y->data1, y->data2); in sisusb_handle_command()
2648 if (!sisusb->gfxinit) in sisusb_handle_command()
2649 return -ENODEV; in sisusb_handle_command()
2651 length = (y->data0 << 16) | (y->data1 << 8) | y->data2; in sisusb_handle_command()
2652 address = y->data3 - SISUSB_PCI_PSEUDO_MEMBASE + in sisusb_handle_command()
2662 retval = -EINVAL; in sisusb_handle_command()
2666 retval = -EIO; in sisusb_handle_command()
2679 sisusb = file->private_data; in sisusb_ioctl()
2681 return -ENODEV; in sisusb_ioctl()
2683 mutex_lock(&sisusb->lock); in sisusb_ioctl()
2686 if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { in sisusb_ioctl()
2687 retval = -ENODEV; in sisusb_ioctl()
2695 retval = -EFAULT; in sisusb_ioctl()
2705 x.sisusb_gfxinit = sisusb->gfxinit; in sisusb_ioctl()
2710 x.sisusb_vramsize = sisusb->vramsize; in sisusb_ioctl()
2711 x.sisusb_minor = sisusb->minor; in sisusb_ioctl()
2717 retval = -EFAULT; in sisusb_ioctl()
2724 retval = -EFAULT; in sisusb_ioctl()
2731 retval = -ENOTTY; in sisusb_ioctl()
2736 mutex_unlock(&sisusb->lock); in sisusb_ioctl()
2751 return -ENOIOCTLCMD; in sisusb_compat_ioctl()
2792 dev_err(&intf->dev, "Invalid USB2VGA device\n"); in sisusb_probe()
2793 return -EINVAL; in sisusb_probe()
2796 dev_info(&dev->dev, "USB2VGA dongle found at address %d\n", in sisusb_probe()
2797 dev->devnum); in sisusb_probe()
2802 return -ENOMEM; in sisusb_probe()
2804 kref_init(&sisusb->kref); in sisusb_probe()
2806 mutex_init(&(sisusb->lock)); in sisusb_probe()
2808 sisusb->sisusb_dev = dev; in sisusb_probe()
2809 sisusb->vrambase = SISUSB_PCI_MEMBASE; in sisusb_probe()
2810 sisusb->mmiobase = SISUSB_PCI_MMIOBASE; in sisusb_probe()
2811 sisusb->mmiosize = SISUSB_PCI_MMIOSIZE; in sisusb_probe()
2812 sisusb->ioportbase = SISUSB_PCI_IOPORTBASE; in sisusb_probe()
2818 dev_err(&sisusb->sisusb_dev->dev, in sisusb_probe()
2820 dev->devnum); in sisusb_probe()
2821 retval = -ENODEV; in sisusb_probe()
2825 sisusb->minor = intf->minor; in sisusb_probe()
2828 sisusb->ibufsize = SISUSB_IBUF_SIZE; in sisusb_probe()
2829 sisusb->ibuf = kmalloc(SISUSB_IBUF_SIZE, GFP_KERNEL); in sisusb_probe()
2830 if (!sisusb->ibuf) { in sisusb_probe()
2831 retval = -ENOMEM; in sisusb_probe()
2835 sisusb->numobufs = 0; in sisusb_probe()
2836 sisusb->obufsize = SISUSB_OBUF_SIZE; in sisusb_probe()
2838 sisusb->obuf[i] = kmalloc(SISUSB_OBUF_SIZE, GFP_KERNEL); in sisusb_probe()
2839 if (!sisusb->obuf[i]) { in sisusb_probe()
2841 retval = -ENOMEM; in sisusb_probe()
2846 sisusb->numobufs++; in sisusb_probe()
2850 sisusb->sisurbin = usb_alloc_urb(0, GFP_KERNEL); in sisusb_probe()
2851 if (!sisusb->sisurbin) { in sisusb_probe()
2852 retval = -ENOMEM; in sisusb_probe()
2855 sisusb->completein = 1; in sisusb_probe()
2857 for (i = 0; i < sisusb->numobufs; i++) { in sisusb_probe()
2858 sisusb->sisurbout[i] = usb_alloc_urb(0, GFP_KERNEL); in sisusb_probe()
2859 if (!sisusb->sisurbout[i]) { in sisusb_probe()
2860 retval = -ENOMEM; in sisusb_probe()
2863 sisusb->urbout_context[i].sisusb = (void *)sisusb; in sisusb_probe()
2864 sisusb->urbout_context[i].urbindex = i; in sisusb_probe()
2865 sisusb->urbstatus[i] = 0; in sisusb_probe()
2868 dev_info(&sisusb->sisusb_dev->dev, "Allocated %d output buffers\n", in sisusb_probe()
2869 sisusb->numobufs); in sisusb_probe()
2873 init_waitqueue_head(&sisusb->wait_q); in sisusb_probe()
2877 usb_get_dev(sisusb->sisusb_dev); in sisusb_probe()
2879 sisusb->present = 1; in sisusb_probe()
2881 if (dev->speed == USB_SPEED_HIGH || dev->speed >= USB_SPEED_SUPER) { in sisusb_probe()
2884 dev_err(&sisusb->sisusb_dev->dev, in sisusb_probe()
2888 dev_info(&sisusb->sisusb_dev->dev, in sisusb_probe()
2891 sisusb->ready = 1; in sisusb_probe()
2894 dev_dbg(&sisusb->sisusb_dev->dev, "*** RWTEST ***\n"); in sisusb_probe()
2896 dev_dbg(&sisusb->sisusb_dev->dev, "*** RWTEST END ***\n"); in sisusb_probe()
2923 mutex_lock(&sisusb->lock); in sisusb_disconnect()
2931 sisusb->present = 0; in sisusb_disconnect()
2932 sisusb->ready = 0; in sisusb_disconnect()
2934 mutex_unlock(&sisusb->lock); in sisusb_disconnect()
2937 kref_put(&sisusb->kref, sisusb_delete); in sisusb_disconnect()
2967 MODULE_DESCRIPTION("sisusbvga - Driver for Net2280/SiS315-based USB2VGA dongles");