hualing chen | 7362e86 | 2021-09-08 10:08:34 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ |
| 2 | /* |
| 3 | * Copyright (c) 2019 Amlogic, Inc. All rights reserved. |
| 4 | */ |
| 5 | |
| 6 | #ifndef _AMCI_H |
| 7 | #define _AMCI_H |
| 8 | |
| 9 | /* #include <asm/types.h> */ |
| 10 | #include <linux/types.h> |
| 11 | |
| 12 | |
| 13 | enum AM_CI_IO_MODE { |
hualing chen | 002e5b9 | 2022-02-23 17:51:21 +0800 | [diff] [blame^] | 14 | AM_CI_IOR = 0, |
| 15 | AM_CI_IOW, |
| 16 | AM_CI_MEMR, |
| 17 | AM_CI_MEMW |
hualing chen | 7362e86 | 2021-09-08 10:08:34 +0800 | [diff] [blame] | 18 | }; |
| 19 | |
| 20 | struct ci_rw_param { |
hualing chen | 002e5b9 | 2022-02-23 17:51:21 +0800 | [diff] [blame^] | 21 | enum AM_CI_IO_MODE mode; |
| 22 | int addr; |
| 23 | u_int8_t value; |
hualing chen | 7362e86 | 2021-09-08 10:08:34 +0800 | [diff] [blame] | 24 | }; |
| 25 | |
| 26 | |
| 27 | #define AMCI_IOC_MAGIC 'D' |
| 28 | |
| 29 | #define AMCI_IOC_RESET _IO(AMCI_IOC_MAGIC, 0x00) |
| 30 | #define AMCI_IOC_IO _IOWR(AMCI_IOC_MAGIC, 0x01, struct ci_rw_param) |
| 31 | #define AMCI_IOC_GET_DETECT _IOWR(AMCI_IOC_MAGIC, 0x02, int) |
| 32 | #define AMCI_IOC_SET_POWER _IOW(AMCI_IOC_MAGIC, 0x03, int) |
| 33 | |
| 34 | |
| 35 | #endif |