Evgeniy Borisov | 960b9a3 | 2018-09-07 14:57:23 +0300 | [diff] [blame] | 1 | /* Copyright (c) 2018, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef __ADSP_SHMEM_DEVICE_H_ |
| 14 | #define __ADSP_SHMEM_DEVICE_H_ |
| 15 | |
| 16 | #define ADSP_VFE 0 |
| 17 | #define ADSP_CSID 0 |
| 18 | #define ADSP_CCI 0 |
| 19 | |
| 20 | enum camera_status_state { |
| 21 | CAMERA_STATUS_STOP = 1234, |
| 22 | CAMERA_STATUS_INIT, |
| 23 | CAMERA_STATUS_START, |
| 24 | CAMERA_STATUS_END, |
| 25 | }; |
| 26 | |
| 27 | struct adsp_camera_header { |
| 28 | unsigned short debug; |
| 29 | unsigned short status; |
| 30 | uint32_t frame_idx; |
| 31 | char sensor_name[32]; |
| 32 | unsigned short width; |
| 33 | unsigned short height; |
| 34 | unsigned short stride; |
| 35 | unsigned short format; |
| 36 | uint32_t frame_size; |
| 37 | unsigned short data_type; |
| 38 | uint32_t header_size; |
| 39 | char printf_buf; /* last */ |
| 40 | }; |
| 41 | |
| 42 | int adsp_shmem_get_state(void); |
| 43 | void adsp_shmem_set_state(enum camera_status_state state); |
| 44 | const char *adsp_shmem_get_sensor_name(void); |
| 45 | int adsp_shmem_is_initialized(void); |
| 46 | |
| 47 | /* true if ADSP is initialized AND in state INIT or START */ |
| 48 | int adsp_shmem_is_working(void); |
| 49 | |
| 50 | #endif /* __ADSP_SHMEM_DEVICE_H_ */ |