Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

input: Documentation: corrections for input-programming.rst

Drop a repeated word.
Fix punctuation of "eg." to "e.g."
Fix punctuation of "ie" to "i.e."
Add hyphentation to non-zero.
Capitalize PM (for Power Management).
Capitalize ID (for Identifier).
Change "," in a run-on sentence to ";".

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
Link: https://lore.kernel.org/r/20210302223523.20130-8-rdunlap@infradead.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Randy Dunlap and committed by
Jonathan Corbet
5c184115 365c6a3e

+10 -10
+10 -10
Documentation/input/input-programming.rst
··· 120 120 121 121 call to tell those who receive the events that we've sent a complete report. 122 122 This doesn't seem important in the one button case, but is quite important 123 - for for example mouse movement, where you don't want the X and Y values 123 + for example for mouse movement, where you don't want the X and Y values 124 124 to be interpreted separately, because that'd result in a different movement. 125 125 126 126 dev->open() and dev->close() ··· 128 128 129 129 In case the driver has to repeatedly poll the device, because it doesn't 130 130 have an interrupt coming from it and the polling is too expensive to be done 131 - all the time, or if the device uses a valuable resource (eg. interrupt), it 131 + all the time, or if the device uses a valuable resource (e.g. interrupt), it 132 132 can use the open and close callback to know when it can stop polling or 133 133 release the interrupt and when it must resume polling or grab the interrupt 134 134 again. To do that, we would add this to our example driver:: ··· 161 161 to the device and that dev->close() is called when the very last user 162 162 disconnects. Calls to both callbacks are serialized. 163 163 164 - The open() callback should return a 0 in case of success or any nonzero value 164 + The open() callback should return a 0 in case of success or any non-zero value 165 165 in case of failure. The close() callback (which is void) must always succeed. 166 166 167 167 Inhibiting input devices ··· 182 182 183 183 Calling the device's close() method on inhibit (if there are users) allows the 184 184 driver to save power. Either by directly powering down the device or by 185 - releasing the runtime-pm reference it got in open() when the driver is using 186 - runtime-pm. 185 + releasing the runtime-PM reference it got in open() when the driver is using 186 + runtime-PM. 187 187 188 188 Inhibiting and uninhibiting are orthogonal to opening and closing the device by 189 189 input handlers. Userspace might want to inhibit a device in anticipation before ··· 219 219 input_report_key(struct input_dev *dev, int code, int value) 220 220 221 221 See uapi/linux/input-event-codes.h for the allowable values of code (from 0 to 222 - KEY_MAX). Value is interpreted as a truth value, ie any nonzero value means key 223 - pressed, zero value means key released. The input code generates events only 222 + KEY_MAX). Value is interpreted as a truth value, i.e. any non-zero value means 223 + key pressed, zero value means key released. The input code generates events only 224 224 in case the value is different from before. 225 225 226 226 In addition to EV_KEY, there are two more basic event types: EV_REL and ··· 231 231 events are namely for joysticks and digitizers - devices that do work in an 232 232 absolute coordinate systems. 233 233 234 - Having the device report EV_REL buttons is as simple as with EV_KEY, simply 234 + Having the device report EV_REL buttons is as simple as with EV_KEY; simply 235 235 set the corresponding bits and call the:: 236 236 237 237 input_report_rel(struct input_dev *dev, int code, int value) 238 238 239 - function. Events are generated only for nonzero value. 239 + function. Events are generated only for non-zero values. 240 240 241 241 However EV_ABS requires a little special care. Before calling 242 242 input_register_device, you have to fill additional fields in the input_dev ··· 280 280 user friendly name of the device. 281 281 282 282 The id* fields contain the bus ID (PCI, USB, ...), vendor ID and device ID 283 - of the device. The bus IDs are defined in input.h. The vendor and device ids 283 + of the device. The bus IDs are defined in input.h. The vendor and device IDs 284 284 are defined in pci_ids.h, usb_ids.h and similar include files. These fields 285 285 should be set by the input device driver before registering it. 286 286