LCDproc development and user support list

Text archives Help

[lcdproc] Trouble using FreeBSD and HD44780 drivers

Chronological Thread 
  • From: benjamin_tse AT (TSE,BENJAMIN (A-Australia,ex1))
  • Subject: [lcdproc] Trouble using FreeBSD and HD44780 drivers
  • Date: Thu, 7 Jun 2001 10:02:05 +0900


> I was looking at the man page for ioperm, and it recommends against
> <sys/perm.h> in favor of <sys/io.h>. Also, I was wondering if perhaps
> it would better to create a "port_access" function to go with the
> port_in and port_out in port.h that would encapsulate the OS
> differences
> on getting access to a port. Then each hd44780 driver could call
> port_access for the ports it will be using and port_in/port_out to
> access those ports.
> Fewer #ifdef in each file and less duplicated code.
> Any thoughts?

Sounds like a good idea Philip.

> In attempting to implement this, I came across a couple of cases where
> the hd44780 driver accesses a port it hasn't asked for with ioperm...
> Attached is what I propose...

Not really, all the drivers should get proper permissions for ports. If you
look at hd44780.c in HD44780_init line 257, you have:

if ((ioperm (port, 1, 255)) == -1) {

HD44780_init gets called by every HD44780_init driver. It parses the HD44780
command line options, gets permission to the base parallel port address (the
line above) and then calls the relevant connection initializer (winamp, 4bit

The connection initializer then gets permission for any _extra_ ports that
that particular connection requires. We already have permission for the base
port address so the serialLpt driver and winamp drivers don't need to gain
permission to it again.

Of course I thought twice about putting the ioperm call in HD44780_init. But
as every HD44780 connection requires access to the base parallel port
address, I decided to put it here :-).


To unsubscribe from this list send a blank message to
lcdproc-unsubscribe AT

Archive powered by MHonArc 2.6.18.

Top of page