summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiran Gunda <kgunda@codeaurora.org>2021-08-17 09:28:22 +0530
committerKiran Gunda <kgunda@codeaurora.org>2021-09-09 15:55:43 +0530
commit0e53eed15ab18553324a86339c81708ece464eb3 (patch)
tree391007ec35c10c48bcf43049706fb085847448a9
parent5c9ee54f8f9302f71f07470660e0bf297ed9dcb1 (diff)
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 <kgunda@codeaurora.org>
-rw-r--r--gen_headers_arm.bp1
-rw-r--r--gen_headers_arm64.bp1
-rw-r--r--include/uapi/linux/slatecom_interface.h93
3 files changed, 95 insertions, 0 deletions
diff --git a/gen_headers_arm.bp b/gen_headers_arm.bp
index 86419e560f20..9cded5bbba09 100644
--- a/gen_headers_arm.bp
+++ b/gen_headers_arm.bp
@@ -533,6 +533,7 @@ gen_headers_out_arm = [
"linux/shm.h",
"linux/signal.h",
"linux/signalfd.h",
+ "linux/slatecom_interface.h",
"linux/smcinvoke.h",
"linux/smiapp.h",
"linux/snmp.h",
diff --git a/gen_headers_arm64.bp b/gen_headers_arm64.bp
index 05d8ffa9bf59..655b8336c720 100644
--- a/gen_headers_arm64.bp
+++ b/gen_headers_arm64.bp
@@ -531,6 +531,7 @@ gen_headers_out_arm64 = [
"linux/shm.h",
"linux/signal.h",
"linux/signalfd.h",
+ "linux/slatecom_interface.h",
"linux/smcinvoke.h",
"linux/smiapp.h",
"linux/snmp.h",
diff --git a/include/uapi/linux/slatecom_interface.h b/include/uapi/linux/slatecom_interface.h
new file mode 100644
index 000000000000..1caed8c42bf6
--- /dev/null
+++ b/include/uapi/linux/slatecom_interface.h
@@ -0,0 +1,93 @@
+/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
+/*
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
+ */
+#ifndef LINUX_SLATECOM_INTERFACE_H
+#define LINUX_SLATECOM_INTERFACE_H
+
+#include <linux/types.h>
+
+#define SLATECOM_REG_READ 0
+#define SLATECOM_AHB_READ 1
+#define SLATECOM_AHB_WRITE 2
+#define SLATECOM_SET_SPI_FREE 3
+#define SLATECOM_SET_SPI_BUSY 4
+#define SLATECOM_REG_WRITE 5
+#define SLATECOM_SOFT_RESET 6
+#define SLATECOM_MODEM_DOWN2_SLATE 7
+#define SLATECOM_TWM_EXIT 8
+#define SLATECOM_SLATE_APP_RUNNING 9
+#define SLATECOM_ADSP_DOWN2_SLATE 10
+#define SLATECOM_SLATE_WEAR_LOAD 11
+#define SLATECOM_SLATE_WEAR_UNLOAD 12
+#define EXCHANGE_CODE 'V'
+
+struct slate_ui_data {
+ __u64 __user write;
+ __u64 __user result;
+ __u32 slate_address;
+ __u32 cmd;
+ __u32 num_of_words;
+ __u8 __user *buffer;
+};
+
+enum slate_event_type {
+ SLATE_BEFORE_POWER_DOWN = 1,
+ SLATE_AFTER_POWER_DOWN,
+ SLATE_BEFORE_POWER_UP,
+ SLATE_AFTER_POWER_UP,
+ MODEM_BEFORE_POWER_DOWN,
+ MODEM_AFTER_POWER_UP,
+ ADSP_BEFORE_POWER_DOWN,
+ ADSP_AFTER_POWER_UP,
+ TWM_SLATE_AFTER_POWER_UP,
+ SLATE_DSP_ERROR,
+ SLATE_DSP_READY,
+ SLATE_BT_ERROR,
+ SLATE_BT_READY,
+};
+
+#define SLATE_AFTER_POWER_UP SLATE_AFTER_POWER_UP
+
+#define REG_READ \
+ _IOWR(EXCHANGE_CODE, SLATECOM_REG_READ, \
+ struct slate_ui_data)
+#define AHB_READ \
+ _IOWR(EXCHANGE_CODE, SLATECOM_AHB_READ, \
+ struct slate_ui_data)
+#define AHB_WRITE \
+ _IOW(EXCHANGE_CODE, SLATECOM_AHB_WRITE, \
+ struct slate_ui_data)
+#define SET_SPI_FREE \
+ _IOR(EXCHANGE_CODE, SLATECOM_SET_SPI_FREE, \
+ struct slate_ui_data)
+#define SET_SPI_BUSY \
+ _IOR(EXCHANGE_CODE, SLATECOM_SET_SPI_BUSY, \
+ struct slate_ui_data)
+#define REG_WRITE \
+ _IOWR(EXCHANGE_CODE, SLATECOM_REG_WRITE, \
+ struct slate_ui_data)
+#define SLATE_SOFT_RESET \
+ _IOWR(EXCHANGE_CODE, SLATECOM_SOFT_RESET, \
+ struct slate_ui_data)
+#define SLATE_TWM_EXIT \
+ _IOWR(EXCHANGE_CODE, SLATECOM_TWM_EXIT, \
+ struct slate_ui_data)
+#define SLATE_APP_RUNNING \
+ _IOWR(EXCHANGE_CODE, SLATECOM_SLATE_APP_RUNNING, \
+ struct slate_ui_data)
+#define SLATE_MODEM_DOWN2_SLATE_DONE \
+ _IOWR(EXCHANGE_CODE, SLATECOM_MODEM_DOWN2_SLATE, \
+ struct slate_ui_data)
+#define SLATE_WEAR_LOAD \
+ _IOWR(EXCHANGE_CODE, SLATECOM_SLATE_WEAR_LOAD, \
+ struct slate_ui_data)
+#define SLATE_WEAR_UNLOAD \
+ _IOWR(EXCHANGE_CODE, SLATECOM_SLATE_WEAR_UNLOAD, \
+ struct slate_ui_data)
+#define SLATE_ADSP_DOWN2_SLATE_DONE \
+ _IOWR(EXCHANGE_CODE, SLATECOM_ADSP_DOWN2_SLATE, \
+ struct slate_ui_data)
+
+#endif /* LINUX_SLATECOM_INTERFACE_H */
+