2019-06-04 08:11:33 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2006-04-02 16:46:27 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com>
|
|
|
|
*/
|
2013-12-28 01:13:45 +00:00
|
|
|
#ifndef __KEYPAD_OMAP_H
|
|
|
|
#define __KEYPAD_OMAP_H
|
2006-04-02 16:46:27 +00:00
|
|
|
|
2010-12-20 21:09:22 +00:00
|
|
|
#ifndef CONFIG_ARCH_OMAP1
|
|
|
|
#warning Please update the board to use matrix-keypad driver
|
2012-02-24 18:34:36 +00:00
|
|
|
#define omap_readw(reg) 0
|
|
|
|
#define omap_writew(val, reg) do {} while (0)
|
2010-12-20 21:09:22 +00:00
|
|
|
#endif
|
|
|
|
#include <linux/input/matrix_keypad.h>
|
2009-09-24 23:23:16 +00:00
|
|
|
|
2006-04-02 16:46:27 +00:00
|
|
|
struct omap_kp_platform_data {
|
|
|
|
int rows;
|
|
|
|
int cols;
|
2010-12-20 21:09:22 +00:00
|
|
|
const struct matrix_keymap_data *keymap_data;
|
|
|
|
bool rep;
|
2006-09-29 08:59:19 +00:00
|
|
|
unsigned long delay;
|
2010-12-20 21:09:22 +00:00
|
|
|
bool dbounce;
|
2006-04-02 16:46:27 +00:00
|
|
|
/* specific to OMAP242x*/
|
|
|
|
unsigned int *row_gpios;
|
|
|
|
unsigned int *col_gpios;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Group (0..3) -- when multiple keys are pressed, only the
|
|
|
|
* keys pressed in the same group are considered as pressed. This is
|
|
|
|
* in order to workaround certain crappy HW designs that produce ghost
|
2010-12-20 21:09:22 +00:00
|
|
|
* keypresses. Two free bits, not used by neither row/col nor keynum,
|
|
|
|
* must be available for use as group bits. The below GROUP_SHIFT
|
|
|
|
* macro definition is based on some prior knowledge of the
|
|
|
|
* matrix_keypad defined KEY() macro internals.
|
|
|
|
*/
|
|
|
|
#define GROUP_SHIFT 14
|
|
|
|
#define GROUP_0 (0 << GROUP_SHIFT)
|
|
|
|
#define GROUP_1 (1 << GROUP_SHIFT)
|
|
|
|
#define GROUP_2 (2 << GROUP_SHIFT)
|
|
|
|
#define GROUP_3 (3 << GROUP_SHIFT)
|
2006-04-02 16:46:27 +00:00
|
|
|
#define GROUP_MASK GROUP_3
|
2010-12-20 21:09:22 +00:00
|
|
|
#if KEY_MAX & GROUP_MASK
|
|
|
|
#error Group bits in conflict with keynum bits
|
|
|
|
#endif
|
2006-04-02 16:46:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|