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
89
90
91
92
93
|
/* tc300k.h -- Linux driver for coreriver chip as touchkey
*
* Copyright (C) 2013 Samsung Electronics Co.Ltd
* Author: Junkyeong Kim <jk0430.kim@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, 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.
*
*/
#ifndef __LINUX_TC300K_H
#define __LINUX_TC300K_H
#ifdef CONFIG_SEC_DEBUG_TSP_LOG
#define SEC_DEBUG_TK_LOG
#endif
#define TC300K_NAME "sec_touchkey_driver"
#ifdef SEC_DEBUG_TK_LOG
#include <linux/sec_debug.h>
#endif
#ifdef SEC_DEBUG_TK_LOG
#define tk_debug_dbg(mode, dev, fmt, ...) \
({ \
if (mode) { \
dev_dbg(dev, fmt, ## __VA_ARGS__); \
sec_debug_tsp_log(fmt, ## __VA_ARGS__); \
} \
else \
dev_dbg(dev, fmt, ## __VA_ARGS__); \
})
#define tk_debug_info(mode, dev, fmt, ...) \
({ \
if (mode) { \
dev_info(dev, fmt, ## __VA_ARGS__); \
sec_debug_tsp_log(fmt, ## __VA_ARGS__); \
} \
else \
dev_info(dev, fmt, ## __VA_ARGS__); \
})
#define tk_debug_err(mode, dev, fmt, ...) \
({ \
if (mode) { \
dev_err(dev, fmt, ## __VA_ARGS__); \
sec_debug_tsp_log(fmt, ## __VA_ARGS__); \
} \
else \
dev_err(dev, fmt, ## __VA_ARGS__); \
})
#else
#define tk_debug_dbg(mode, dev, fmt, ...) dev_dbg(dev, fmt, ## __VA_ARGS__)
#define tk_debug_info(mode, dev, fmt, ...) dev_info(dev, fmt, ## __VA_ARGS__)
#define tk_debug_err(mode, dev, fmt, ...) dev_err(dev, fmt, ## __VA_ARGS__)
#endif
struct tc300k_platform_data {
int gpio_int;
int gpio_sda;
int gpio_scl;
int gpio_sub_det;
int i2c_gpio;
int (*power) (bool on);
int (*power_isp) (bool on);
int (*keyled) (bool on);
u32 irq_gpio_flags;
u32 sda_gpio_flags;
u32 scl_gpio_flags;
const char *regulator_ic;
const char *regulator_led;
bool boot_on_ldo;
int *keycode;
int key_num;
const char *fw_name;
u32 sensing_ch_num;
u32 use_bitmap;
u32 tsk_ic_num;
bool touchkey_led;
};
#endif /* __LINUX_TC300K_H */
|