lkml.org 
[lkml]   [2008]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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



\
 
 \ /
  Last update: 2008-04-14 14:47    [W:0.077 / U:1.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site