1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/*
* Copyright (C) 2011-2014 MediaTek Inc.
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CAMERA_SYSRAM_H
#define CAMERA_SYSRAM_H
//-----------------------------------------------------------------------------
#define SYSRAM_DEV_NAME "camera-sysram"
#define SYSRAM_MAGIC_NO 'p'
//-----------------------------------------------------------------------------
#ifdef CONFIG_COMPAT
//64 bit
#include <linux/fs.h>
#include <linux/compat.h>
#endif
typedef enum
{
SYSRAM_USER_VIDO,
SYSRAM_USER_GDMA,
SYSRAM_USER_SW_FD,
SYSRAM_USER_AMOUNT,
SYSRAM_USER_NONE
}SYSRAM_USER_ENUM;
//
typedef struct
{
unsigned int Alignment;
unsigned int Size;
SYSRAM_USER_ENUM User;
unsigned int Addr; // In/Out : address
unsigned int TimeoutMS; // In : millisecond
}SYSRAM_ALLOC_STRUCT;
//
typedef enum
{
SYSRAM_CMD_ALLOC,
SYSRAM_CMD_FREE,
SYSRAM_CMD_DUMP
}SYSRAM_CMD_ENUM;
//-----------------------------------------------------------------------------
#define SYSRAM_ALLOC _IOWR( SYSRAM_MAGIC_NO, SYSRAM_CMD_ALLOC, SYSRAM_ALLOC_STRUCT)
#define SYSRAM_FREE _IOWR( SYSRAM_MAGIC_NO, SYSRAM_CMD_FREE, SYSRAM_USER_ENUM)
#define SYSRAM_DUMP _IO( SYSRAM_MAGIC_NO, SYSRAM_CMD_DUMP)
//-----------------------------------------------------------------------------
#endif
|