Commit f739babf authored by Peter Osterlund's avatar Peter Osterlund Committed by Vojtech Pavlik

input: fix some minor errors found in the input-programming.txt file

parent 19450cd4
...@@ -146,7 +146,7 @@ static int __init button_init(void) ...@@ -146,7 +146,7 @@ static int __init button_init(void)
Note the button_used variable - we have to track how many times the open Note the button_used variable - we have to track how many times the open
function was called to know when exactly our device stops being used. function was called to know when exactly our device stops being used.
The open() callback should return a 0 in case of succes or any nonzero value The open() callback should return a 0 in case of success or any nonzero value
in case of failure. The close() callback (which is void) must always succeed. in case of failure. The close() callback (which is void) must always succeed.
1.3 Basic event types 1.3 Basic event types
...@@ -178,7 +178,7 @@ set the corresponding bits and call the ...@@ -178,7 +178,7 @@ set the corresponding bits and call the
function. Events are generated only for nonzero value. function. Events are generated only for nonzero value.
However EV_ABS requires a little special care. Before calling However EV_ABS requires a little special care. Before calling
input_register_devices, you have to fill additional fields in the input_dev input_register_device, you have to fill additional fields in the input_dev
struct for each absolute axis your device has. If our button device had also struct for each absolute axis your device has. If our button device had also
the ABS_X axis: the ABS_X axis:
...@@ -207,11 +207,11 @@ one device. You'll need it in the open and close callbacks. ...@@ -207,11 +207,11 @@ one device. You'll need it in the open and close callbacks.
1.5 NBITS(), LONG(), BIT() 1.5 NBITS(), LONG(), BIT()
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
These three macros frin input.h help some bitfield computations: These three macros from input.h help some bitfield computations:
NBITS(x) - returns the length of a bitfield array in longs for x bits NBITS(x) - returns the length of a bitfield array in longs for x bits
LONG(x) - returns the index in the array in longs for bit x LONG(x) - returns the index in the array in longs for bit x
BIT(x) - returns the indes in a long for bit x BIT(x) - returns the index in a long for bit x
1.6 The number, id* and name fields 1.6 The number, id* and name fields
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -221,7 +221,7 @@ is registered. It has no use except for identifying the device to the user ...@@ -221,7 +221,7 @@ is registered. It has no use except for identifying the device to the user
in system messages. in system messages.
The dev->name should be set before registering the input device by the input The dev->name should be set before registering the input device by the input
device driver. It's a string like 'Generic button device' containing an device driver. It's a string like 'Generic button device' containing a
user friendly name of the device. user friendly name of the device.
The id* fields contain the bus ID (PCI, USB, ...), vendor ID and device ID The id* fields contain the bus ID (PCI, USB, ...), vendor ID and device ID
...@@ -237,7 +237,7 @@ The id and name fields can be passed to userland via the evdev interface. ...@@ -237,7 +237,7 @@ The id and name fields can be passed to userland via the evdev interface.
1.7 The keycode, keycodemax, keycodesize fields 1.7 The keycode, keycodemax, keycodesize fields
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These two fields will be used for any inpur devices that report their data These two fields will be used for any input devices that report their data
as scancodes. If not all scancodes can be known by autodetection, they may as scancodes. If not all scancodes can be known by autodetection, they may
need to be set by userland utilities. The keycode array then is an array need to be set by userland utilities. The keycode array then is an array
used to map from scancodes to input system keycodes. The keycode max will used to map from scancodes to input system keycodes. The keycode max will
...@@ -258,7 +258,7 @@ handled by the input system. ...@@ -258,7 +258,7 @@ handled by the input system.
The other event types up to now are: The other event types up to now are:
EV_LED - used for the keyboad LEDs. EV_LED - used for the keyboard LEDs.
EV_SND - used for keyboard beeps. EV_SND - used for keyboard beeps.
They are very similar to for example key events, but they go in the other They are very similar to for example key events, but they go in the other
...@@ -270,7 +270,7 @@ driver can handle these events, it has to set the respective bits in evbit, ...@@ -270,7 +270,7 @@ driver can handle these events, it has to set the respective bits in evbit,
int button_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); int button_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
{ {
if (type == EV_SND && code == EV_BELL) { if (type == EV_SND && code == SND_BELL) {
outb(value, BUTTON_BELL); outb(value, BUTTON_BELL);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment