Lines Matching refs:udl
32 struct udl_device *udl = to_udl(dev); in udl_parse_vendor_descriptor() local
75 udl->sku_pixel_limit = max_area; in udl_parse_vendor_descriptor()
99 static int udl_select_std_channel(struct udl_device *udl) in udl_select_std_channel() argument
112 ret = usb_control_msg(udl->udev, in udl_select_std_channel()
113 usb_sndctrlpipe(udl->udev, 0), in udl_select_std_channel()
133 struct udl_device *udl = unode->dev; in udl_urb_completion() local
146 urb->transfer_buffer_length = udl->urbs.size; /* reset to actual */ in udl_urb_completion()
148 spin_lock_irqsave(&udl->urbs.lock, flags); in udl_urb_completion()
149 list_add_tail(&unode->entry, &udl->urbs.list); in udl_urb_completion()
150 udl->urbs.available++; in udl_urb_completion()
151 spin_unlock_irqrestore(&udl->urbs.lock, flags); in udl_urb_completion()
162 up(&udl->urbs.limit_sem); in udl_urb_completion()
167 struct udl_device *udl = to_udl(dev); in udl_free_urb_list() local
168 int count = udl->urbs.count; in udl_free_urb_list()
177 down(&udl->urbs.limit_sem); in udl_free_urb_list()
179 spin_lock_irq(&udl->urbs.lock); in udl_free_urb_list()
181 node = udl->urbs.list.next; /* have reserved one with sem */ in udl_free_urb_list()
184 spin_unlock_irq(&udl->urbs.lock); in udl_free_urb_list()
190 usb_free_coherent(urb->dev, udl->urbs.size, in udl_free_urb_list()
195 udl->urbs.count = 0; in udl_free_urb_list()
200 struct udl_device *udl = to_udl(dev); in udl_alloc_urb_list() local
206 spin_lock_init(&udl->urbs.lock); in udl_alloc_urb_list()
209 udl->urbs.size = size; in udl_alloc_urb_list()
210 INIT_LIST_HEAD(&udl->urbs.list); in udl_alloc_urb_list()
212 sema_init(&udl->urbs.limit_sem, 0); in udl_alloc_urb_list()
213 udl->urbs.count = 0; in udl_alloc_urb_list()
214 udl->urbs.available = 0; in udl_alloc_urb_list()
216 while (udl->urbs.count * size < wanted_size) { in udl_alloc_urb_list()
220 unode->dev = udl; in udl_alloc_urb_list()
232 buf = usb_alloc_coherent(udl->udev, size, GFP_KERNEL, in udl_alloc_urb_list()
246 usb_fill_bulk_urb(urb, udl->udev, usb_sndbulkpipe(udl->udev, 1), in udl_alloc_urb_list()
250 list_add_tail(&unode->entry, &udl->urbs.list); in udl_alloc_urb_list()
252 up(&udl->urbs.limit_sem); in udl_alloc_urb_list()
253 udl->urbs.count++; in udl_alloc_urb_list()
254 udl->urbs.available++; in udl_alloc_urb_list()
257 DRM_DEBUG("allocated %d %d byte urbs\n", udl->urbs.count, (int) size); in udl_alloc_urb_list()
259 return udl->urbs.count; in udl_alloc_urb_list()
264 struct udl_device *udl = to_udl(dev); in udl_get_urb() local
271 ret = down_timeout(&udl->urbs.limit_sem, GET_URB_TIMEOUT); in udl_get_urb()
274 ret, udl->urbs.available); in udl_get_urb()
278 spin_lock_irq(&udl->urbs.lock); in udl_get_urb()
280 BUG_ON(list_empty(&udl->urbs.list)); /* reserved one with limit_sem */ in udl_get_urb()
281 entry = udl->urbs.list.next; in udl_get_urb()
283 udl->urbs.available--; in udl_get_urb()
285 spin_unlock_irq(&udl->urbs.lock); in udl_get_urb()
296 struct udl_device *udl = to_udl(dev); in udl_submit_urb() local
299 BUG_ON(len > udl->urbs.size); in udl_submit_urb()
310 int udl_init(struct udl_device *udl) in udl_init() argument
312 struct drm_device *dev = &udl->drm; in udl_init()
317 mutex_init(&udl->gem_lock); in udl_init()
319 if (!udl_parse_vendor_descriptor(dev, udl->udev)) { in udl_init()
325 if (udl_select_std_channel(udl)) in udl_init()
343 if (udl->urbs.count) in udl_init()