aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sec_dock_keyboard.h
blob: fb9fd7c2e72db9bb65c0de1ca3f43056d2cf8242 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
 *  Copyright (C) 2012, Samsung Electronics Co. Ltd. All Rights Reserved.
 *
 * Author:
 *	Heetae Ahn <heetae82.ahn@samsung.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; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 */

#include <linux/earlysuspend.h>
#include <linux/serio.h>

#ifndef _SEC_DOCK_KEYBOARD_H_
#define _SEC_DOCK_KEYBOARD_H_

#define KBD_DRV_NAME "sec_keyboard"

#define KEYBOARD_SIZE	128
#define US_KEYBOARD 0xEB
#define UK_KEYBOARD 0xEC

#define KBD_MIN	0x4
#define KBD_MAX	0x7F

#define MAX_BUF 255

/* for the remap key */
enum REMAPKEY_STATE {
	REMAPKEY_RELEASED = 0,
	REMAPKEY_PRESSED,
};

enum KEY_LAYOUT {
	UNKNOWN_KEYLAYOUT = 0,
	US_KEYLAYOUT,
	UK_KEYLAYOUT,
};

struct dock_keyboard_data {
	struct input_dev *input_dev;
	struct serio *serio;
	struct device *kbd_dev;
	struct work_struct work_msg;
	struct delayed_work dwork_off;
	struct early_suspend early_suspend;
	struct timer_list key_timer;
	bool led_on;
	int dock_irq_gpio;
	unsigned int kl;
	bool handshaking;
	int release_cnt;
	bool remap_state;
	unsigned char remap_keycode;
	int buf_front;
	int buf_rear;
	unsigned char key_buf[MAX_BUF];
	bool dockconnected;
	bool keyboard_enable;
	void (*power)(bool on);
};

struct dock_keyboard_platform_data {
	int dock_irq_gpio;
	void (*power)(bool on);
	void (*register_cb)(struct input_dev *, void *);
};

struct key_table {
	int keycode;
	bool pressed;
};

struct sec_dock_keyboard_driver {
	struct platform_driver plat_drv;
	struct serio_driver serio_drv;
	struct dock_keyboard_data *private_data;
};

#endif /*_SEC_DOCK_KEYBOARD_H_ */