|
| 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