'\" t .\" Title: input_register_device .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Input Subsystem .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "INPUT_REGISTER_DEVIC" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Input Subsystem" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" input_register_device \- register device with input core .SH "SYNOPSIS" .HP \w'int\ input_register_device('u .BI "int input_register_device(struct\ input_dev\ *\ " "dev" ");" .SH "ARGUMENTS" .PP \fIdev\fR .RS 4 device to be registered .RE .SH "DESCRIPTION" .PP This function registers device with input core\&. The device must be allocated with \fBinput_allocate_device\fR and all it\*(Aqs capabilities set up before registering\&. If function fails the device must be freed with \fBinput_free_device\fR\&. Once device has been successfully registered it can be unregistered with \fBinput_unregister_device\fR; \fBinput_free_device\fR should not be called in this case\&. .PP Note that this function is also used to register managed input devices (ones allocated with \fBdevm_input_allocate_device\fR)\&. Such managed input devices need not be explicitly unregistered or freed, their tear down is controlled by the devres infrastructure\&. It is also worth noting that tear down of managed input devices is internally a 2\-step process: registered managed input device is first unregistered, but stays in memory and can still handle \fBinput_event\fR calls (although events will not be delivered anywhere)\&. The freeing of managed input device will happen later, when devres stack is unwound to the point where device allocation was made\&. .SH "COPYRIGHT" .br