8
8
9
9
#include <linux/types.h>
10
10
11
+ struct cea_sad ;
12
+
11
13
/* ELD Header Block */
12
14
#define DRM_ELD_HEADER_BLOCK_SIZE 4
13
15
70
72
* drm_eld_mnl - Get ELD monitor name length in bytes.
71
73
* @eld: pointer to an eld memory structure with mnl set
72
74
*/
73
- static inline int drm_eld_mnl (const uint8_t * eld )
75
+ static inline int drm_eld_mnl (const u8 * eld )
74
76
{
75
77
return (eld [DRM_ELD_CEA_EDID_VER_MNL ] & DRM_ELD_MNL_MASK ) >> DRM_ELD_MNL_SHIFT ;
76
78
}
77
79
80
+ int drm_eld_sad_get (const u8 * eld , int sad_index , struct cea_sad * cta_sad );
81
+ int drm_eld_sad_set (u8 * eld , int sad_index , const struct cea_sad * cta_sad );
82
+
78
83
/**
79
84
* drm_eld_sad - Get ELD SAD structures.
80
85
* @eld: pointer to an eld memory structure with sad_count set
81
86
*/
82
- static inline const uint8_t * drm_eld_sad (const uint8_t * eld )
87
+ static inline const u8 * drm_eld_sad (const u8 * eld )
83
88
{
84
89
unsigned int ver , mnl ;
85
90
@@ -98,7 +103,7 @@ static inline const uint8_t *drm_eld_sad(const uint8_t *eld)
98
103
* drm_eld_sad_count - Get ELD SAD count.
99
104
* @eld: pointer to an eld memory structure with sad_count set
100
105
*/
101
- static inline int drm_eld_sad_count (const uint8_t * eld )
106
+ static inline int drm_eld_sad_count (const u8 * eld )
102
107
{
103
108
return (eld [DRM_ELD_SAD_COUNT_CONN_TYPE ] & DRM_ELD_SAD_COUNT_MASK ) >>
104
109
DRM_ELD_SAD_COUNT_SHIFT ;
@@ -111,7 +116,7 @@ static inline int drm_eld_sad_count(const uint8_t *eld)
111
116
* This is a helper for determining the payload size of the baseline block, in
112
117
* bytes, for e.g. setting the Baseline_ELD_Len field in the ELD header block.
113
118
*/
114
- static inline int drm_eld_calc_baseline_block_size (const uint8_t * eld )
119
+ static inline int drm_eld_calc_baseline_block_size (const u8 * eld )
115
120
{
116
121
return DRM_ELD_MONITOR_NAME_STRING - DRM_ELD_HEADER_BLOCK_SIZE +
117
122
drm_eld_mnl (eld ) + drm_eld_sad_count (eld ) * 3 ;
@@ -127,7 +132,7 @@ static inline int drm_eld_calc_baseline_block_size(const uint8_t *eld)
127
132
*
128
133
* The returned value is guaranteed to be a multiple of 4.
129
134
*/
130
- static inline int drm_eld_size (const uint8_t * eld )
135
+ static inline int drm_eld_size (const u8 * eld )
131
136
{
132
137
return DRM_ELD_HEADER_BLOCK_SIZE + eld [DRM_ELD_BASELINE_ELD_LEN ] * 4 ;
133
138
}
@@ -139,7 +144,7 @@ static inline int drm_eld_size(const uint8_t *eld)
139
144
* The returned value is the speakers mask. User has to use %DRM_ELD_SPEAKER
140
145
* field definitions to identify speakers.
141
146
*/
142
- static inline u8 drm_eld_get_spk_alloc (const uint8_t * eld )
147
+ static inline u8 drm_eld_get_spk_alloc (const u8 * eld )
143
148
{
144
149
return eld [DRM_ELD_SPEAKER ] & DRM_ELD_SPEAKER_MASK ;
145
150
}
@@ -151,7 +156,7 @@ static inline u8 drm_eld_get_spk_alloc(const uint8_t *eld)
151
156
* The caller need to use %DRM_ELD_CONN_TYPE_HDMI or %DRM_ELD_CONN_TYPE_DP to
152
157
* identify the display type connected.
153
158
*/
154
- static inline u8 drm_eld_get_conn_type (const uint8_t * eld )
159
+ static inline u8 drm_eld_get_conn_type (const u8 * eld )
155
160
{
156
161
return eld [DRM_ELD_SAD_COUNT_CONN_TYPE ] & DRM_ELD_CONN_TYPE_MASK ;
157
162
}
0 commit comments