Lines Matching +full:total +full:- +full:timeout

1 // SPDX-License-Identifier: GPL-2.0-only
2 /* -*- linux-c -*-
3 * dtlk.c - DoubleTalk PC driver for Linux
8 * 2000-03-18 Jim Van Zandt: Fix polling.
20 The DoubleTalk PC contains four voice synthesizers: text-to-speech
40 This driver was written for use with the text-to-speech
57 #include <linux/errno.h> /* for -EBUSY */
133 /* printk("DoubleTalk PC - dtlk_read()\n"); */ in dtlk_read()
136 return -EINVAL; in dtlk_read()
143 return -EFAULT; in dtlk_read()
148 if (file->f_flags & O_NONBLOCK) in dtlk_read()
155 return -EAGAIN; in dtlk_read()
170 return -EFAULT; in dtlk_write()
181 return -EINVAL; in dtlk_write()
197 /* the RDY bit goes zero 2-3 usec in dtlk_write()
199 180-190 usec later. Here, we wait in dtlk_write()
213 if (file->f_flags & O_NONBLOCK) in dtlk_write()
220 printk("dtlk: write timeout. " in dtlk_write()
224 return -EBUSY; in dtlk_write()
228 return -EAGAIN; in dtlk_write()
240 printk("<%ld>", jiffies-j); in dtlk_poll()
284 return -EINVAL; in dtlk_ioctl()
292 return -EINVAL; in dtlk_ioctl()
304 return -EBUSY; in dtlk_open()
308 return -ENXIO; in dtlk_open()
339 printk(KERN_ERR "DoubleTalk PC - cannot register device\n"); in dtlk_init()
370 /* ------------------------------------------------------------------------ */
396 return -EBUSY; in dtlk_dev_probe()
400 printk("DoubleTalk PC - Port %03x = %04x\n", in dtlk_dev_probe()
413 printk("DoubleTalk PC at %03x-%03x, " in dtlk_dev_probe()
416 DTLK_IO_EXTENT - 1, in dtlk_dev_probe()
417 sp->rom_version, sp->serial_number); in dtlk_dev_probe()
496 printk(KERN_INFO "DoubleTalk PC - not found\n"); in dtlk_dev_probe()
497 return -ENODEV; in dtlk_dev_probe()
503 printk(KERN_INFO"\nDoubleTalk PC - MINOR: %d, OPCODE: %d, ERROR: %d\n",
514 int total, i; in dtlk_interrogate() local
518 for (total = 0, i = 0; i < 50; i++) { in dtlk_interrogate()
519 buf[total] = dtlk_read_tts(); in dtlk_interrogate()
520 if (total > 2 && buf[total] == 0x7f) in dtlk_interrogate()
522 if (total < sizeof(struct dtlk_settings)) in dtlk_interrogate()
523 total++; in dtlk_interrogate()
539 if (i < sizeof(status.rom_version) - 1) in dtlk_interrogate()
577 printk(KERN_ERR "dtlk_read_tts() timeout\n"); in dtlk_read_tts()
589 printk(KERN_ERR "dtlk_read_tts() timeout\n"); in dtlk_read_tts()
601 /* no need to test -- this is only called when the port is readable */ in dtlk_read_lpc()
607 /* acknowledging a read takes 3-4 in dtlk_read_lpc()
611 while (inb_p(dtlk_port_lpc) != 0x7f && --retries > 0); in dtlk_read_lpc()
613 printk(KERN_ERR "dtlk_read_lpc() timeout\n"); in dtlk_read_lpc()
623 /* printk("dtlk_write_bytes(\"%-*s\", %d)\n", n, buf, n); */ in dtlk_write_bytes()
625 while (n-- > 0) in dtlk_write_bytes()
646 printk(KERN_ERR "dtlk_write_tts() timeout\n"); in dtlk_write_tts()
649 /* the RDY bit goes zero 2-3 usec after writing, and goes in dtlk_write_tts()
650 1 again 180-190 usec later. Here, we wait up to 10 in dtlk_write_tts()