hualing chen | 7362e86 | 2021-09-08 10:08:34 +0800 | [diff] [blame] | 1 | /* |
Zhiqiang Han | a67a825 | 2023-02-25 18:23:48 +0800 | [diff] [blame] | 2 | * Copyright (c) 2014 Amlogic, Inc. All rights reserved. |
| 3 | * |
| 4 | * This source code is subject to the terms and conditions defined in the |
| 5 | * file 'LICENSE' which is part of this source code package. |
| 6 | * |
| 7 | * Description: */ |
hualing chen | 7362e86 | 2021-09-08 10:08:34 +0800 | [diff] [blame] | 8 | |
| 9 | #ifndef _AMCI_H |
| 10 | #define _AMCI_H |
| 11 | |
| 12 | /* #include <asm/types.h> */ |
| 13 | #include <linux/types.h> |
| 14 | |
| 15 | |
| 16 | enum AM_CI_IO_MODE { |
hualing chen | 002e5b9 | 2022-02-23 17:51:21 +0800 | [diff] [blame] | 17 | AM_CI_IOR = 0, |
| 18 | AM_CI_IOW, |
| 19 | AM_CI_MEMR, |
| 20 | AM_CI_MEMW |
hualing chen | 7362e86 | 2021-09-08 10:08:34 +0800 | [diff] [blame] | 21 | }; |
| 22 | |
| 23 | struct ci_rw_param { |
hualing chen | 002e5b9 | 2022-02-23 17:51:21 +0800 | [diff] [blame] | 24 | enum AM_CI_IO_MODE mode; |
| 25 | int addr; |
| 26 | u_int8_t value; |
hualing chen | 7362e86 | 2021-09-08 10:08:34 +0800 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | |
| 30 | #define AMCI_IOC_MAGIC 'D' |
| 31 | |
| 32 | #define AMCI_IOC_RESET _IO(AMCI_IOC_MAGIC, 0x00) |
| 33 | #define AMCI_IOC_IO _IOWR(AMCI_IOC_MAGIC, 0x01, struct ci_rw_param) |
| 34 | #define AMCI_IOC_GET_DETECT _IOWR(AMCI_IOC_MAGIC, 0x02, int) |
| 35 | #define AMCI_IOC_SET_POWER _IOW(AMCI_IOC_MAGIC, 0x03, int) |
| 36 | |
| 37 | |
Zhiqiang Han | a67a825 | 2023-02-25 18:23:48 +0800 | [diff] [blame] | 38 | #endif |