6b13f685e
김민수
BSP 최초 추가
|
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
|
#ifndef __ASM_ARCH_MXC_PMIC_STATUS_H__
#define __ASM_ARCH_MXC_PMIC_STATUS_H__
#include <asm-generic/errno-base.h>
#ifdef __KERNEL__
#include <asm/uaccess.h> /* copy_{from,to}_user() */
#endif
typedef enum {
PMIC_SUCCESS = 0,
PMIC_ERROR = -1,
PMIC_PARAMETER_ERROR = -2,
PMIC_NOT_SUPPORTED = -3,
PMIC_SYSTEM_ERROR_EINTR = -EINTR,
PMIC_MALLOC_ERROR = -5,
PMIC_UNSUBSCRIBE_ERROR = -6,
PMIC_EVENT_NOT_SUBSCRIBED = -7,
PMIC_EVENT_CALL_BACK = -8,
PMIC_CLIENT_NBOVERFLOW = -9,
} PMIC_STATUS;
#define BITFMASK(field) (((1U << (field ## _WID)) - 1) << (field ## _LSH))
#define BITFVAL(field, val) ((val) << (field ## _LSH))
#define BITFEXT(var, bit) ((var & BITFMASK(bit)) >> (bit ## _LSH))
#define CHECK_ERROR(a) \
do { \
int ret = (a); \
if (ret != PMIC_SUCCESS) \
return ret; \
} while (0)
#define CHECK_ERROR_KFREE(func, freeptrs) \
do { \
int ret = (func); \
if (ret != PMIC_SUCCESS) { \
freeptrs; \
return ret; \
} \
} while (0);
#endif /* __ASM_ARCH_MXC_PMIC_STATUS_H__ */
|