Exemplo n.º 1
0
static void ct82c710_close(struct serio *serio)
{
    if (ct82c170_wait())
        printk(KERN_WARNING "ct82c710.c: Device busy in close()\n");

    outb_p(inb_p(CT82C710_STATUS) & ~(CT82C710_ENABLE | CT82C710_INTS_ON), CT82C710_STATUS);

    if (ct82c170_wait())
        printk(KERN_WARNING "ct82c710.c: Device busy in close()\n");

    free_irq(CT82C710_IRQ, NULL);
}
Exemplo n.º 2
0
static void ct82c710_close(struct serio *serio)
{
	if (ct82c170_wait())
;

	outb_p(inb_p(CT82C710_STATUS) & ~(CT82C710_ENABLE | CT82C710_INTS_ON), CT82C710_STATUS);

	if (ct82c170_wait())
;

	free_irq(CT82C710_IRQ, NULL);
}
Exemplo n.º 3
0
static int ct82c710_open(struct serio *serio)
{
    unsigned char status;

    if (request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL))
        return -1;

    status = inb_p(CT82C710_STATUS);

    status |= (CT82C710_ENABLE | CT82C710_RESET);
    outb_p(status, CT82C710_STATUS);

    status &= ~(CT82C710_RESET);
    outb_p(status, CT82C710_STATUS);

    status |= CT82C710_INTS_ON;
    outb_p(status, CT82C710_STATUS);

    while (ct82c170_wait()) {
        printk(KERN_ERR "ct82c710: Device busy in open()\n");
        status &= ~(CT82C710_ENABLE | CT82C710_INTS_ON);
        outb_p(status, CT82C710_STATUS);
        free_irq(CT82C710_IRQ, NULL);
        return -1;
    }

    return 0;
}
Exemplo n.º 4
0
static int ct82c710_open(struct serio *serio)
{
	unsigned char status;
	int err;

	err = request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL);
	if (err)
		return err;

	status = inb_p(CT82C710_STATUS);

	status |= (CT82C710_ENABLE | CT82C710_RESET);
	outb_p(status, CT82C710_STATUS);

	status &= ~(CT82C710_RESET);
	outb_p(status, CT82C710_STATUS);

	status |= CT82C710_INTS_ON;
	outb_p(status, CT82C710_STATUS);	/* Enable interrupts */

	while (ct82c170_wait()) {
;
		status &= ~(CT82C710_ENABLE | CT82C710_INTS_ON);
		outb_p(status, CT82C710_STATUS);
		free_irq(CT82C710_IRQ, NULL);
		return -EBUSY;
	}

	return 0;
}
Exemplo n.º 5
0
static void ct82c710_close(struct serio *serio)
{
	if (ct82c170_wait())
#ifdef CONFIG_DEBUG_PRINTK
		printk(KERN_WARNING "ct82c710.c: Device busy in close()\n");
#else
		;
#endif

	outb_p(inb_p(CT82C710_STATUS) & ~(CT82C710_ENABLE | CT82C710_INTS_ON), CT82C710_STATUS);

	if (ct82c170_wait())
#ifdef CONFIG_DEBUG_PRINTK
		printk(KERN_WARNING "ct82c710.c: Device busy in close()\n");
#else
		;
#endif

	free_irq(CT82C710_IRQ, NULL);
}
Exemplo n.º 6
0
static int ct82c710_write(struct serio *port, unsigned char c)
{
    if (ct82c170_wait()) return -1;
    outb_p(c, CT82C710_DATA);
    return 0;
}