1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>sparse_keymap_setup</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="ch08s05.html" title="Sparse keymap support"><link rel="prev" href="API-sparse-keymap-entry-from-keycode.html" title="sparse_keymap_entry_from_keycode"><link rel="next" href="API-sparse-keymap-free.html" title="sparse_keymap_free"></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">sparse_keymap_setup</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-sparse-keymap-entry-from-keycode.html">Prev</a> </td><th width="60%" align="center">Sparse keymap support</th><td width="20%" align="right"> <a accesskey="n" href="API-sparse-keymap-free.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-sparse-keymap-setup"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sparse_keymap_setup — 2 set up sparse keymap for an input device 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">sparse_keymap_setup </b>(</code></td><td>struct input_dev * <var class="pdparam">dev</var>, </td></tr><tr><td> </td><td>const struct key_entry * <var class="pdparam">keymap</var>, </td></tr><tr><td> </td><td>int (*<var class="pdparam">setup</var>) 4 <code>(</code>struct input_dev *, struct key_entry *<code>)</code><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1114768748"></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> 5 Input device 6 </p></dd><dt><span class="term"><em class="parameter"><code>keymap</code></em></span></dt><dd><p> 7 Keymap in form of array of <span class="structname">key_entry</span> structures ending 8 with <code class="constant">KE_END</code> type entry 9 </p></dd><dt><span class="term"><em class="parameter"><code>setup</code></em></span></dt><dd><p> 10 Function that can be used to adjust keymap entries 11 depending on device's deeds, may be <code class="constant">NULL</code> 12 </p></dd></dl></div></div><div class="refsect1"><a name="idp1114773140"></a><h2>Description</h2><p> 13 The function calculates size and allocates copy of the original 14 keymap after which sets up input device event bits appropriately. 15 Before destroying input device allocated keymap should be freed 16 with a call to <code class="function">sparse_keymap_free</code>. 17</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-sparse-keymap-entry-from-keycode.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch08s05.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-sparse-keymap-free.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">sparse_keymap_entry_from_keycode</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">sparse_keymap_free</span></td></tr></table></div></body></html> 18