aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c/tc35894xbg.h
blob: 7e3fec345a8f628a90af87546c7bdfd83b410f23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
 * tc35894xbg.h - Configuration for TC35894XBG keypad driver.
 *
 * (C) Copyright 2010 Intel Corporation
 * Author: Charlie Paul (z8cpaul@windriver.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2
 * of the License.
 */

#ifndef __LINUX_TC35894XBG_H
#define __LINUX_TC35894XBG_H

#include <linux/types.h>

/*
 * Largest keycode that the chip can send, plus one,
 * so keys can be mapped directly at the index of the
 * TC35894XBG keycode instead of subtracting one.
 */
#define TC35894XBG_KEYMAP_SIZE      (0x7f + 1)

#define SHIFT_NEEDED    (0x1000)

#define KEY_EXCLAM      (KEY_1 + SHIFT_NEEDED)  /* '!' -> shift+1 */
#define KEY_AT          (KEY_2 + SHIFT_NEEDED)  /* '@' -> shift+2 */
#define KEY_NUMBER_SIGN (KEY_3 + SHIFT_NEEDED)  /* '#' -> shift+3 */
#define KEY_DOLLAR_SIGN (KEY_4 + SHIFT_NEEDED)  /* '$' -> shift+4 */
#define KEY_NOR         (KEY_6 + SHIFT_NEEDED)  /* '^' -> shift+6 */
#define KEY_PERCENT     (KEY_5 + SHIFT_NEEDED)  /* '%' -> shift+5 */
#define KEY_AMPERSAND   (KEY_7 + SHIFT_NEEDED)  /* '&' -> shift+7 */
#define KEY_PLUS        (KEY_EQUAL + SHIFT_NEEDED) /* '+' -> shift+= */

#define KEY_BAR         (KEY_BACKSLASH + SHIFT_NEEDED)  /* '|' -> shift+\ */
#define KEY_COLON       (KEY_SEMICOLON + SHIFT_NEEDED)  /* ':' -> shift+; */
#define KEY_UNDERSCORE  (KEY_MINUS + SHIFT_NEEDED) /* '_' -> shift+- */
#define KEY_QUOTE_DBL   (KEY_APOSTROPHE + SHIFT_NEEDED) /* '"' -> shift+' */


#define TC_MAX_KEYMAPS          (2)
#define TC_DEFAULT_KEYMAP       (0)
#define TC_ALT_KEYMAP           (1)
#define TC35894XBG_MAX_FIFO     (8)


struct tc35894xbg_platform_data {

	unsigned char debounce_time;  /* Time to watch for bouncing, in ms. */
	unsigned char settle_time;    /* Idle time until sleep, in ms. */
	unsigned char col_setting;    /* Sets up ball settings in reg 0x04 */
	unsigned char rowcol_setting; /* Sets up ball settings in reg 0x05 */

	int gpio_reset; /* reset output GPIO index (-1 if not implemented) */
	int gpio_irq;   /* interrupt GPIO */
	int keymap_size;
	int size_x;
	int size_y;
	int function_key;
	int right_shift_key;

	void	(*reset_ctrl)(struct i2c_client *client, int value);

	int n_keymaps;
	unsigned short keymap[TC_MAX_KEYMAPS][TC35894XBG_KEYMAP_SIZE];

	/* Device name. */
	const char *name;
};

#endif /* __LINUX_TC35894XBG_H */