Skip to content

Commit 252d6c8

Browse files
I-n-o-kGerrit - the friendly Code Review server
authored and
Gerrit - the friendly Code Review server
committed
uapi: Add UAPI headers for slatecom_interface driver
Add slatecom_interface header file in gen_headers to make it accessible from userspace modules who uses Android.bp files for compilation. Change-Id: Ie298ec28983c16999d941ee8667e2dd7b5c3db22 Signed-off-by: Kiran Gunda <[email protected]>
1 parent dd304cc commit 252d6c8

File tree

3 files changed

+95
-0
lines changed

3 files changed

+95
-0
lines changed

gen_headers_arm.bp

+1
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ gen_headers_out_arm = [
529529
"linux/shm.h",
530530
"linux/signal.h",
531531
"linux/signalfd.h",
532+
"linux/slatecom_interface.h",
532533
"linux/smc.h",
533534
"linux/smc_diag.h",
534535
"linux/smcinvoke.h",

gen_headers_arm64.bp

+1
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ gen_headers_out_arm64 = [
523523
"linux/shm.h",
524524
"linux/signal.h",
525525
"linux/signalfd.h",
526+
"linux/slatecom_interface.h",
526527
"linux/smc.h",
527528
"linux/smc_diag.h",
528529
"linux/smcinvoke.h",
+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2+
/*
3+
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
4+
*/
5+
#ifndef LINUX_SLATECOM_INTERFACE_H
6+
#define LINUX_SLATECOM_INTERFACE_H
7+
8+
#include <linux/types.h>
9+
10+
#define SLATECOM_REG_READ 0
11+
#define SLATECOM_AHB_READ 1
12+
#define SLATECOM_AHB_WRITE 2
13+
#define SLATECOM_SET_SPI_FREE 3
14+
#define SLATECOM_SET_SPI_BUSY 4
15+
#define SLATECOM_REG_WRITE 5
16+
#define SLATECOM_SOFT_RESET 6
17+
#define SLATECOM_MODEM_DOWN2_SLATE 7
18+
#define SLATECOM_TWM_EXIT 8
19+
#define SLATECOM_SLATE_APP_RUNNING 9
20+
#define SLATECOM_ADSP_DOWN2_SLATE 10
21+
#define SLATECOM_SLATE_WEAR_LOAD 11
22+
#define SLATECOM_SLATE_WEAR_UNLOAD 12
23+
#define EXCHANGE_CODE 'V'
24+
25+
struct slate_ui_data {
26+
__u64 __user write;
27+
__u64 __user result;
28+
__u32 slate_address;
29+
__u32 cmd;
30+
__u32 num_of_words;
31+
__u8 __user *buffer;
32+
};
33+
34+
enum slate_event_type {
35+
SLATE_BEFORE_POWER_DOWN = 1,
36+
SLATE_AFTER_POWER_DOWN,
37+
SLATE_BEFORE_POWER_UP,
38+
SLATE_AFTER_POWER_UP,
39+
MODEM_BEFORE_POWER_DOWN,
40+
MODEM_AFTER_POWER_UP,
41+
ADSP_BEFORE_POWER_DOWN,
42+
ADSP_AFTER_POWER_UP,
43+
TWM_SLATE_AFTER_POWER_UP,
44+
SLATE_DSP_ERROR,
45+
SLATE_DSP_READY,
46+
SLATE_BT_ERROR,
47+
SLATE_BT_READY,
48+
};
49+
50+
#define SLATE_AFTER_POWER_UP SLATE_AFTER_POWER_UP
51+
52+
#define REG_READ \
53+
_IOWR(EXCHANGE_CODE, SLATECOM_REG_READ, \
54+
struct slate_ui_data)
55+
#define AHB_READ \
56+
_IOWR(EXCHANGE_CODE, SLATECOM_AHB_READ, \
57+
struct slate_ui_data)
58+
#define AHB_WRITE \
59+
_IOW(EXCHANGE_CODE, SLATECOM_AHB_WRITE, \
60+
struct slate_ui_data)
61+
#define SET_SPI_FREE \
62+
_IOR(EXCHANGE_CODE, SLATECOM_SET_SPI_FREE, \
63+
struct slate_ui_data)
64+
#define SET_SPI_BUSY \
65+
_IOR(EXCHANGE_CODE, SLATECOM_SET_SPI_BUSY, \
66+
struct slate_ui_data)
67+
#define REG_WRITE \
68+
_IOWR(EXCHANGE_CODE, SLATECOM_REG_WRITE, \
69+
struct slate_ui_data)
70+
#define SLATE_SOFT_RESET \
71+
_IOWR(EXCHANGE_CODE, SLATECOM_SOFT_RESET, \
72+
struct slate_ui_data)
73+
#define SLATE_TWM_EXIT \
74+
_IOWR(EXCHANGE_CODE, SLATECOM_TWM_EXIT, \
75+
struct slate_ui_data)
76+
#define SLATE_APP_RUNNING \
77+
_IOWR(EXCHANGE_CODE, SLATECOM_SLATE_APP_RUNNING, \
78+
struct slate_ui_data)
79+
#define SLATE_MODEM_DOWN2_SLATE_DONE \
80+
_IOWR(EXCHANGE_CODE, SLATECOM_MODEM_DOWN2_SLATE, \
81+
struct slate_ui_data)
82+
#define SLATE_WEAR_LOAD \
83+
_IOWR(EXCHANGE_CODE, SLATECOM_SLATE_WEAR_LOAD, \
84+
struct slate_ui_data)
85+
#define SLATE_WEAR_UNLOAD \
86+
_IOWR(EXCHANGE_CODE, SLATECOM_SLATE_WEAR_UNLOAD, \
87+
struct slate_ui_data)
88+
#define SLATE_ADSP_DOWN2_SLATE_DONE \
89+
_IOWR(EXCHANGE_CODE, SLATECOM_ADSP_DOWN2_SLATE, \
90+
struct slate_ui_data)
91+
92+
#endif /* LINUX_SLATECOM_INTERFACE_H */
93+

0 commit comments

Comments
 (0)