alpsreg.h revision 1.1.2.2 1 1.1.2.2 skrll /* $NetBSD: alpsreg.h,v 1.1.2.2 2017/08/28 17:52:26 skrll Exp $ */
2 1.1.2.2 skrll
3 1.1.2.2 skrll /*-
4 1.1.2.2 skrll * Copyright (c) 2017 Ryo ONODERA <ryo (at) tetera.org>
5 1.1.2.2 skrll * Copyright (c) 2008 Jared D. McNeill <jmcneill (at) invisible.ca>
6 1.1.2.2 skrll * All rights reserved.
7 1.1.2.2 skrll *
8 1.1.2.2 skrll * Redistribution and use in source and binary forms, with or without
9 1.1.2.2 skrll * modification, are permitted provided that the following conditions
10 1.1.2.2 skrll * are met:
11 1.1.2.2 skrll * 1. Redistributions of source code must retain the above copyright
12 1.1.2.2 skrll * notice, this list of conditions and the following disclaimer.
13 1.1.2.2 skrll * 2. Redistributions in binary form must reproduce the above copyright
14 1.1.2.2 skrll * notice, this list of conditions and the following disclaimer in the
15 1.1.2.2 skrll * documentation and/or other materials provided with the distribution.
16 1.1.2.2 skrll *
17 1.1.2.2 skrll * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 1.1.2.2 skrll * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 1.1.2.2 skrll * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 1.1.2.2 skrll * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 1.1.2.2 skrll * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 1.1.2.2 skrll * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 1.1.2.2 skrll * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 1.1.2.2 skrll * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 1.1.2.2 skrll * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 1.1.2.2 skrll * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 1.1.2.2 skrll * POSSIBILITY OF SUCH DAMAGE.
28 1.1.2.2 skrll */
29 1.1.2.2 skrll
30 1.1.2.2 skrll #ifndef _DEV_PCKBCPORT_ALPSREG_H
31 1.1.2.2 skrll #define _DEV_PCKBCPORT_ALPSREG_H
32 1.1.2.2 skrll
33 1.1.2.2 skrll #include <dev/pckbport/pmsreg.h>
34 1.1.2.2 skrll
35 1.1.2.2 skrll #define ALPS_PROTO_V2 (2)
36 1.1.2.2 skrll #define ALPS_PROTO_V7 (7)
37 1.1.2.2 skrll
38 1.1.2.2 skrll struct alps_nibble_command_data {
39 1.1.2.2 skrll uint8_t command;
40 1.1.2.2 skrll uint8_t data;
41 1.1.2.2 skrll int sendparam;
42 1.1.2.2 skrll int recieve;
43 1.1.2.2 skrll };
44 1.1.2.2 skrll
45 1.1.2.2 skrll struct alps_nibble_command_data alps_v7_nibble_command_data_arr[] = {
46 1.1.2.2 skrll { PMS_SET_REMOTE_MODE, 0, 0, 0 }, /* 0 F0 */
47 1.1.2.2 skrll { PMS_SET_DEFAULTS, 0, 0, 0 }, /* 1 F6 */
48 1.1.2.2 skrll { PMS_SET_SCALE21, 0, 0, 0 }, /* 2 E7 */
49 1.1.2.2 skrll { PMS_SET_SAMPLE, 0x0a, 1, 0 }, /* 3 F3 */
50 1.1.2.2 skrll { PMS_SET_SAMPLE, 0x14, 1, 0 }, /* 4 F3 */
51 1.1.2.2 skrll { PMS_SET_SAMPLE, 0x28, 1, 0 }, /* 5 F3 */
52 1.1.2.2 skrll { PMS_SET_SAMPLE, 0x3c, 1, 0 }, /* 6 F3 */
53 1.1.2.2 skrll { PMS_SET_SAMPLE, 0x50, 1, 0 }, /* 7 F3 */
54 1.1.2.2 skrll { PMS_SET_SAMPLE, 0x64, 1, 0 }, /* 8 F3 */
55 1.1.2.2 skrll { PMS_SET_SAMPLE, 0xc8, 1, 0 }, /* 9 F3 */
56 1.1.2.2 skrll { PMS_SEND_DEV_ID, 0, 0, 1 }, /* a F2 */
57 1.1.2.2 skrll { PMS_SET_RES, 0x00, 1, 0 }, /* b E8 */
58 1.1.2.2 skrll { PMS_SET_RES, 0x01, 1, 0 }, /* c E8 */
59 1.1.2.2 skrll { PMS_SET_RES, 0x02, 1, 0 }, /* d E8 */
60 1.1.2.2 skrll { PMS_SET_RES, 0x03, 1, 0 }, /* e E8 */
61 1.1.2.2 skrll { PMS_SET_SCALE11, 0, 0, 0 }, /* f E6 */
62 1.1.2.2 skrll };
63 1.1.2.2 skrll
64 1.1.2.2 skrll #define ALPS_V7_PACKETID_UNKNOWN 0
65 1.1.2.2 skrll #define ALPS_V7_PACKETID_TWOFINGER 1
66 1.1.2.2 skrll #define ALPS_V7_PACKETID_MULTIFINGER 2
67 1.1.2.2 skrll #define ALPS_V7_PACKETID_NEWPACKET 3
68 1.1.2.2 skrll #define ALPS_V7_PACKETID_IDLE 4
69 1.1.2.2 skrll
70 1.1.2.2 skrll #endif /* !_DEV_PCKBCPORT_ALPSREG_H */
71