[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080414133937.7080d30d@core>
Date: Mon, 14 Apr 2008 13:39:37 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: "Kathy Frazier" <kfrazier@...twyler-rd.com>
Cc: <linux-kernel@...r.kernel.org>
Subject: Re: Talking to parallel port in 2.6 kernel without using parport
> ***** However, I am still unable to open my device. Can someone tell me
> what I am missing?
> What do I need to do to talk to the parallel port myself and NOT go through
> parport?
You should go through parport. The parport layer is there for a reason.
You drive on the road not through fields (even if shorter distances)
please show the same respect for the kernel and your users (plus it'll
make your job easier).
If you need to hog the device because it doesn't follow 1284 or other
sharing standards the parport_register_device can be called with
PARPORT_DEV_EXCL in flags, which means you want to sit on it.
So for something like a standard PC built in port (for the little time
they have left before they go away in hardware..)
struct parport *p = parport_find_base(0x378 /* etc */);
parport_register_device(p, "mywidget", NULL,
my_irq_handler, PARPORT_DEV_EXCL, &mystruct)
parport_enable_irq(p);
where mystruct is a private object that will be passed back to you in the
callbacks. If you don't use the IRQ then don't call parport_enable_irq
and my_irq_handler can also be NULL.
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists