Am 15.12.2012 um 23:05 schrieb Iain Hibbert <plunky%ogmig.net@localhost>:
> On Sat, 15 Dec 2012, Marc Balmer wrote:
>
>> The attached small driver adds support for the cash drawer port found on
>> the PROTECH PS3100 point of sale terminal by providing a gpio(4) device
>> with two pins. Pin 0 controls the drawer kickout, pin 1 is used to read
>> the sense pin, i.e. whether the drawer is currently open or not (as
>> reported by the till hardware).
>>
>> Note that there is no way to detect it the hardware is present or not,
>> so this driver should only be used for custom kernel configurations.
>
> - should some variant of that be mentioned in the manpage and match
> function?
Indeed. I added a CAVEATS section to the man page.
>
> - there is a mis-spelling "pules" in a comment (=pulse)
Thanks.
>
> - why in arch/i386/isa rather than dev/isa?
I moved it to dev/isa.
>
>> A similar device driver for the IBM SurePos series (now Toshiba Global
>> Commerce Solutions) will follow.
>
> I wonder, since there is no way to detect this device, and the driver
> seems to be entirely a wrapper for the inb/outb functions, is there not a
> way to access the inb/outb from userland directly (with an ioctl or sysctl
> maybe) and then control of such things as this could be done directly with
> a simple-script and not require a custom kernel?
That could probably be possible. But the driver is not only a wrapper to
inb(), outb() (which I replaced by proper bus_space_read/write calls, btw), but
provides a GPIO device so that teh hardware can be accessed from userland.
gpio(4) seems a logical choice for such devices.