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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
/*
* This software program is licensed subject to the GNU General Public License
* (GPL).Version 2,June 1991, available at http://www.fsf.org/copyleft/gpl.html
* (C) Copyright 2010 Marvell International Ltd.
* All Rights Reserved
*/
#ifndef __UIO_VMETA_H
#define __UIO_VMETA_H
typedef unsigned int vmeta_instance_status;
struct _id_instance {
vmeta_instance_status status;
int height;
int width;
int frame_rate;
pid_t pid;
unsigned int pt; /* pthread_t */
};
#define MAX_VMETA_INSTANCE 32
enum _VMETA_LOCK_FLAG {
VMETA_LOCK_OFF = 0,
VMETA_LOCK_ON,
VMETA_LOCK_FORCE_INIT
};
/* This struct should be aligned with user space API */
struct _kernel_share {
int ref_count;
enum _VMETA_LOCK_FLAG lock_flag;
int active_user_id;
struct _id_instance user_id_list[MAX_VMETA_INSTANCE];
};
#ifndef __KERNEL__
/*
* Needed for userspace
*/
typedef enum _VMETA_LOCK_FLAG VMETA_LOCK_FLAG;
typedef struct _id_instance id_instance;
typedef struct _kernel_share kernel_share;
#endif
struct vmeta_lock {
unsigned long timeout;
unsigned int user_id;
};
struct vmeta_info {
uint32_t revision;
struct {
uint32_t phys;
uint32_t size;
} map[3];
};
#define VMETA_STATUS_BIT_USED 0
#define VMETA_STATUS_BIT_REGISTED 1
#define VMETA_STATUS_USED BIT(0)
#define VMETA_STATUS_REGISTERED BIT(1)
#define IOP_MAGIC ('v')
#define VMETA_CMD_POWER_ON _IO(IOP_MAGIC, 0)
#define VMETA_CMD_POWER_OFF _IO(IOP_MAGIC, 1)
#define VMETA_CMD_CLK_ON _IO(IOP_MAGIC, 2)
#define VMETA_CMD_CLK_OFF _IO(IOP_MAGIC, 3)
#define VMETA_CMD_CLK_SWITCH _IO(IOP_MAGIC, 4)
#define VMETA_CMD_LOCK _IO(IOP_MAGIC, 5)
#define VMETA_CMD_UNLOCK _IO(IOP_MAGIC, 6)
#define VMETA_CMD_PRIV_LOCK _IO(IOP_MAGIC, 7)
#define VMETA_CMD_PRIV_UNLOCK _IO(IOP_MAGIC, 8)
#define VMETA_CMD_SUSPEND_CHECK _IOR(IOP_MAGIC, 9, int)
#define VMETA_CMD_SUSPEND_READY _IO(IOP_MAGIC, 10)
#define VMETA_CMD_SUSPEND_SET _IO(IOP_MAGIC, 11)
#define VMETA_CMD_SUSPEND_UNSET _IO(IOP_MAGIC, 12)
#define VMETA_CMD_GET_USER_ID _IOR(IOP_MAGIC, 13, unsigned)
#define VMETA_CMD_FREE_USER_ID _IO(IOP_MAGIC, 14)
#define VMETA_CMD_REGISTER_USER_ID _IO(IOP_MAGIC, 15)
#define VMETA_CMD_UNREGISTER_USER_ID _IO(IOP_MAGIC, 16)
#define VMETA_CMD_LOCK_USER_ID _IOW(IOP_MAGIC, 17, struct vmeta_lock)
#define VMETA_CMD_UNLOCK_USER_ID _IO(IOP_MAGIC, 18)
#define VMETA_CMD_FORCE_INI _IO(IOP_MAGIC, 19)
#define VMETA_CMD_GET_USER_NUM _IOR(IOP_MAGIC, 20, unsigned)
#define VMETA_CMD_GET_INFO _IOR(IOP_MAGIC, 21, struct vmeta_info)
#endif /* __UIO_VMETA_H */
|