public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "Kathy Frazier" <kfrazier@daetwyler-rd.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: Talking to parallel port in 2.6 kernel without using parport
Date: Mon, 14 Apr 2008 13:39:37 +0100	[thread overview]
Message-ID: <20080414133937.7080d30d@core> (raw)
In-Reply-To: <009501c89e28$3d7530f0$b85f92d0$@com>

> ***** 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


  reply	other threads:[~2008-04-14 12:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-14 12:08 Talking to parallel port in 2.6 kernel without using parport Kathy Frazier
2008-04-14 12:39 ` Alan Cox [this message]
2008-04-22 18:34   ` Kathy Frazier
2008-04-25 17:12     ` Alan Cox
2008-04-25 18:18       ` Miguel Ojeda
2008-04-28 18:06         ` Kathy Frazier
2008-04-28 19:35           ` Miguel Ojeda
2008-04-28 17:59       ` Kathy Frazier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080414133937.7080d30d@core \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=kfrazier@daetwyler-rd.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox