1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>input_register_device</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="input_subsystem.html#idp1114168316" title="Input core"><link rel="prev" href="API-input-set-capability.html" title="input_set_capability"><link rel="next" href="API-input-unregister-device.html" title="input_unregister_device"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">input_register_device</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-input-set-capability.html">Prev</a> </td><th width="60%" align="center">Input core</th><td width="20%" align="right"> <a accesskey="n" href="API-input-unregister-device.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-input-register-device"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>input_register_device — 2 register device with input core 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">input_register_device </b>(</code></td><td>struct input_dev * <var class="pdparam">dev</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1114415660"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>dev</code></em></span></dt><dd><p> 4 device to be registered 5 </p></dd></dl></div></div><div class="refsect1"><a name="idp1114417260"></a><h2>Description</h2><p> 6 This function registers device with input core. The device must be 7 allocated with <code class="function">input_allocate_device</code> and all it's capabilities 8 set up before registering. 9 If function fails the device must be freed with <code class="function">input_free_device</code>. 10 Once device has been successfully registered it can be unregistered 11 with <code class="function">input_unregister_device</code>; <code class="function">input_free_device</code> should not be 12 called in this case. 13 </p><p> 14 15 Note that this function is also used to register managed input devices 16 (ones allocated with <code class="function">devm_input_allocate_device</code>). Such managed input 17 devices need not be explicitly unregistered or freed, their tear down 18 is controlled by the devres infrastructure. It is also worth noting 19 that tear down of managed input devices is internally a 2-step process: 20 registered managed input device is first unregistered, but stays in 21 memory and can still handle <code class="function">input_event</code> calls (although events will 22 not be delivered anywhere). The freeing of managed input device will 23 happen later, when devres stack is unwound to the point where device 24 allocation was made. 25</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-input-set-capability.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="input_subsystem.html#idp1114168316">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-input-unregister-device.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">input_set_capability</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">input_unregister_device</span></td></tr></table></div></body></html> 26