linux-old/Documentation/parport.txt
<<
>>
Prefs
   1The `parport' code provides parallel-port support under Linux.  This
   2includes the ability to share one port between multiple device
   3drivers.
   4
   5You can pass parameters to the parport code to override its automatic
   6detection of your hardware.  This is particularly useful if you want
   7to use IRQs, since in general these can't be autoprobed successfully.
   8By default IRQs are not used even if they _can_ be probed.  This is
   9because there are a lot of people using the same IRQ for their
  10parallel port and a sound card or network card.
  11
  12The parport code is split into two parts: generic (which deals with
  13port-sharing) and architecture-dependent (which deals with actually
  14using the port).
  15
  16
  17Parport as modules
  18==================
  19
  20If you load the parport code as a module, say
  21
  22        # insmod parport.o
  23
  24to load the generic parport code.  You then must load the
  25architecture-dependent code with (for example):
  26
  27        # insmod parport_pc.o io=0x3bc,0x378,0x278 irq=none,7,auto
  28
  29to tell the parport code that you want three PC-style ports, one at
  300x3bc with no IRQ, one at 0x378 using IRQ 7, and one at 0x278 with an
  31auto-detected IRQ.  Currently, PC-style (parport_pc) and Sun Ultra/AX
  32(parport_ax) hardware is supported; more is in the works.
  33
  34
  35KMod
  36----
  37
  38If you use kmod, you will find it useful to edit /etc/conf.modules.
  39Here is an example of the lines that need to be added:
  40
  41        alias parport_lowlevel parport_pc
  42        options parport_pc io=0x378,0x278 irq=7,auto
  43
  44KMod will then automatically load parport_pc (with the options
  45"io=0x378,0x278 irq=7,auto") whenever a parallel port device driver
  46(such as lp) is loaded.
  47
  48
  49Parport probe [optional]
  50-------------
  51
  52Once the architecture-dependent part of the parport code is loaded
  53into the kernel, you can insert the parport_probe module with:
  54
  55        # insmod parport_probe.o
  56
  57This will perform an IEEE1284 probe of any attached devices and log a
  58message similar to:
  59
  60        parport0: Printer, BJC-210 (Canon)
  61
  62(If you are using kmod and have configured parport_probe as a module,
  63this will just happen.)
  64
  65The probe information is available in /proc/parport/?/autoprobe.
  66
  67
  68Parport linked into the kernel statically
  69=========================================
  70
  71If you compile the parport code into the kernel, then you can use
  72kernel boot parameters to get the same effect.  Add something like the
  73following to your LILO command line:
  74
  75        parport=0x3bc parport=0x378,7 parport=0x278,auto
  76
  77You can have many `parport=...' statements, one for each port you want
  78to add.  Adding `parport=0' to the kernel command-line will disable
  79parport support entirely.  Adding `parport=auto' to the kernel
  80command-line will make parport use any IRQ lines or DMA channels that
  81it auto-detects.
  82
  83
  84Files in /proc
  85==============
  86
  87If you have configured the /proc filesystem into your kernel, you will
  88see a new directory entry: /proc/parport.  In there will be a
  89directory entry for each parallel port for which parport is
  90configured.  In each of those directories are four files describing
  91that parallel port.  For example:
  92
  93File:                           Contents:
  94
  95/proc/parport/0/devices         A list of the device drivers using
  96                                that port.  A "+" will appear by the
  97                                name of the device currently using the
  98                                port (it might not appear against any).
  99
 100/proc/parport/0/hardware        Parallel port's base address, IRQ line
 101                                and DMA channel.
 102
 103/proc/parport/0/irq             The IRQ that parport is using for that
 104                                port.  This is in a separate file to
 105                                allow you to alter it by writing a new
 106                                value in (IRQ number or "none").
 107
 108/proc/parport/0/autoprobe       Any IEEE-1284 device ID information
 109                                that has been acquired.
 110
 111
 112Device drivers
 113==============
 114
 115Once the parport code is initialised, you can attach device drivers to
 116specific ports.  Normally this happens automatically; if the lp driver
 117is loaded it will create one lp device for each port found.  You can
 118override this, though, by using parameters either when you load the lp
 119driver:
 120
 121        # insmod lp.o parport=0,2
 122
 123or on the LILO command line:
 124
 125        lp=parport0 lp=parport2
 126
 127Both the above examples would inform lp that you want /dev/lp0 to be
 128the first parallel port, and /dev/lp1 to be the _third_ parallel port,
 129with no lp device associated with the second port (parport1).  Note
 130that this is different to the way older kernels worked; there used to
 131be a static association between the I/O port address and the device
 132name, so /dev/lp0 was always the port at 0x3bc.  This is no longer the
 133case - if you only have one port, it will default to being /dev/lp0,
 134regardless of base address.
 135
 136Also:
 137
 138 * If you selected the IEEE-1284 autoprobe at compile time, you can say
 139   `lp=auto' on the kernel command line, and lp will create devices
 140   only for those ports that seem to have printers attached.
 141
 142 * If you give PLIP the `timid' parameter, either with `plip=timid' on
 143   the command line, or with `insmod plip timid=1' when using modules,
 144   it will avoid any ports that seem to be in use by other devices.
 145
 146 * IRQ autoprobing works only for a few port types at the moment.
 147
 148--
 149Philip.Blundell@pobox.com
 150tim@cyberelk.demon.co.uk
 151
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.