Lines Matching refs:lcd

49 	struct lcd_usb_data *lcd = &lcd_instance;  in open_lcd()  local
51 if (lcd->isopen || !lcd->present) { in open_lcd()
54 lcd->isopen = 1; in open_lcd()
56 init_waitqueue_head(&lcd->wait_q); in open_lcd()
65 struct lcd_usb_data *lcd = &lcd_instance; in close_lcd() local
67 lcd->isopen = 0; in close_lcd()
77 struct lcd_usb_data *lcd = &lcd_instance; in ioctl_lcd() local
82 if (lcd == NULL || in ioctl_lcd()
83 lcd->present == 0 || in ioctl_lcd()
84 lcd->lcd_dev == NULL) in ioctl_lcd()
89 i = (lcd->lcd_dev)->descriptor.bcdDevice; in ioctl_lcd()
112 struct lcd_usb_data *lcd = &lcd_instance; in write_lcd() local
122 if (lcd == NULL || in write_lcd()
123 lcd->present == 0 || in write_lcd()
124 lcd->lcd_dev == NULL) in write_lcd()
129 char *obuf = lcd->obuf; in write_lcd()
133 if (copy_from_user(lcd->obuf, buffer, copy_size)) in write_lcd()
137 if (!lcd->lcd_dev) in write_lcd()
143 result = usb_bulk_msg(lcd->lcd_dev, in write_lcd()
144 usb_sndbulkpipe(lcd->lcd_dev, 1), in write_lcd()
154 interruptible_sleep_on_timeout(&lcd-> wait_q, NAK_TIMEOUT); in write_lcd()
177 struct lcd_usb_data *lcd = &lcd_instance; in read_lcd() local
183 char *ibuf = lcd->ibuf; in read_lcd()
186 if (lcd == NULL || in read_lcd()
187 lcd->present == 0 || in read_lcd()
188 lcd->lcd_dev == NULL) in read_lcd()
197 if (!lcd->lcd_dev) in read_lcd()
201 result = usb_bulk_msg(lcd->lcd_dev, in read_lcd()
202 usb_rcvbulkpipe(lcd->lcd_dev, 0), in read_lcd()
216 interruptible_sleep_on_timeout(&lcd->wait_q, in read_lcd()
240 struct lcd_usb_data *lcd = &lcd_instance; in probe_lcd() local
248 if (lcd->present == 1) { in probe_lcd()
259 lcd->present = 1; in probe_lcd()
260 lcd->lcd_dev = dev; in probe_lcd()
262 if (!(lcd->obuf = (char *) kmalloc(OBUF_SIZE, GFP_KERNEL))) { in probe_lcd()
266 dbg("probe_lcd: obuf address:%p", lcd->obuf); in probe_lcd()
268 if (!(lcd->ibuf = (char *) kmalloc(IBUF_SIZE, GFP_KERNEL))) { in probe_lcd()
270 kfree(lcd->obuf); in probe_lcd()
273 dbg("probe_lcd: ibuf address:%p", lcd->ibuf); in probe_lcd()
275 return lcd; in probe_lcd()
280 struct lcd_usb_data *lcd = (struct lcd_usb_data *) ptr; in disconnect_lcd() local
282 if (lcd->isopen) { in disconnect_lcd()
283 lcd->isopen = 0; in disconnect_lcd()
285 lcd->lcd_dev = NULL; in disconnect_lcd()
288 kfree(lcd->ibuf); in disconnect_lcd()
289 kfree(lcd->obuf); in disconnect_lcd()
293 lcd->present = 0; in disconnect_lcd()
336 struct lcd_usb_data *lcd = &lcd_instance; in usb_lcd_cleanup() local
338 lcd->present = 0; in usb_lcd_cleanup()