Back to home page

LXR

 
 

    


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