Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com>
0004  */
0005 #ifndef __KEYPAD_OMAP_H
0006 #define __KEYPAD_OMAP_H
0007 
0008 #ifndef CONFIG_ARCH_OMAP1
0009 #warning Please update the board to use matrix-keypad driver
0010 #define omap_readw(reg)     0
0011 #define omap_writew(val, reg)   do {} while (0)
0012 #endif
0013 #include <linux/input/matrix_keypad.h>
0014 
0015 struct omap_kp_platform_data {
0016     int rows;
0017     int cols;
0018     const struct matrix_keymap_data *keymap_data;
0019     bool rep;
0020     unsigned long delay;
0021     bool dbounce;
0022     /* specific to OMAP242x*/
0023     unsigned int *row_gpios;
0024     unsigned int *col_gpios;
0025 };
0026 
0027 /* Group (0..3) -- when multiple keys are pressed, only the
0028  * keys pressed in the same group are considered as pressed. This is
0029  * in order to workaround certain crappy HW designs that produce ghost
0030  * keypresses. Two free bits, not used by neither row/col nor keynum,
0031  * must be available for use as group bits. The below GROUP_SHIFT
0032  * macro definition is based on some prior knowledge of the
0033  * matrix_keypad defined KEY() macro internals.
0034  */
0035 #define GROUP_SHIFT 14
0036 #define GROUP_0     (0 << GROUP_SHIFT)
0037 #define GROUP_1     (1 << GROUP_SHIFT)
0038 #define GROUP_2     (2 << GROUP_SHIFT)
0039 #define GROUP_3     (3 << GROUP_SHIFT)
0040 #define GROUP_MASK  GROUP_3
0041 #if KEY_MAX & GROUP_MASK
0042 #error Group bits in conflict with keynum bits
0043 #endif
0044 
0045 
0046 #endif
0047