---
name: "sparse_keymap_setup"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/sparse_keymap_setup"
---

# sparse\_keymap\_setup(9)

set up sparse keymap for an input device

## NAME

sparse\_keymap\_setup - set up sparse keymap for an input device

## SYNOPSIS

**int sparse\_keymap\_setup(struct input\_dev \*** *dev***, const struct key\_entry \*** *keymap***, int (\****setup***) (struct input\_dev \*, struct key\_entry \*));**

## ARGUMENTS

*dev*

Input device

*keymap*

Keymap in form of array of key\_entry structures ending with **KE\_END** type entry

*setup*

Function that can be used to adjust keymap entries depending on device's deeds, may be **NULL**

## DESCRIPTION

The function calculates size and allocates copy of the original keymap after which sets up input device event bits appropriately. Before destroying input device allocated keymap should be freed with a call to **sparse\_keymap\_free**.

## COPYRIGHT
