aboutsummaryrefslogtreecommitdiff
path: root/include/linux/input/bu21150.h
blob: 9abc986c2899ca14234b5fb3917f3fee5c048183 (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
/*
 * Japan Display Inc. BU21150 touch screen driver.
 *
 * Copyright (C) 2013-2015 Japan Display Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2, and only version 2, as published by the
 * Free Software Foundation.
 *
 * 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA  02110-1301, USA.
 *
 */
#ifndef _BU21150_H_
#define _BU21150_H_

/* return value */
#define BU21150_UNBLOCK     (5)
#define BU21150_TIMEOUT     (6)

/* ioctl(IOCTL_CMD_RESET) */
#define BU21150_RESET_LOW   (0)
#define BU21150_RESET_HIGH  (1)

/* ioctl(IOCTL_CMD_SET_TIMEOUT) */
#define BU21150_TIMEOUT_DISABLE (0)
#define BU21150_TIMEOUT_ENABLE  (1)

/* struct */
struct bu21150_ioctl_get_frame_data {
	char __user *buf;
	unsigned int size;
	char __user *tv; /* struct timeval* */
	unsigned int keep_block_flag; /* for suspend */
};

struct bu21150_ioctl_spi_data {
	unsigned long addr;
	char __user *buf;
	unsigned int count;
};

struct bu21150_ioctl_timeout_data {
	unsigned int timeout_enb;
	unsigned int report_interval_us;
};

/* commands */
#define BU21150_IO_TYPE  (0xB8)
#define BU21150_IOCTL_CMD_GET_FRAME       _IOWR(BU21150_IO_TYPE, 0x01, \
		struct bu21150_ioctl_get_frame_data)
#define BU21150_IOCTL_CMD_RESET           _IO(BU21150_IO_TYPE, 0x02)
#define BU21150_IOCTL_CMD_SPI_READ        _IOW(BU21150_IO_TYPE, 0x03, \
		struct bu21150_ioctl_spi_data)
#define BU21150_IOCTL_CMD_SPI_WRITE       _IOR(BU21150_IO_TYPE, 0x04, \
		struct bu21150_ioctl_spi_data)
#define BU21150_IOCTL_CMD_UNBLOCK         _IO(BU21150_IO_TYPE, 0x05)
#define BU21150_IOCTL_CMD_SUSPEND         _IO(BU21150_IO_TYPE, 0x06)
#define BU21150_IOCTL_CMD_RESUME          _IO(BU21150_IO_TYPE, 0x07)
#define BU21150_IOCTL_CMD_UNBLOCK_RELEASE _IO(BU21150_IO_TYPE, 0x08)
#define BU21150_IOCTL_CMD_SET_TIMEOUT     _IO(BU21150_IO_TYPE, 0x09)
#define BU21150_IOCTL_CMD_SET_SCAN_MODE   _IO(BU21150_IO_TYPE, 0x0A)

#endif /* _BU21150_H_ */