-
Notifications
You must be signed in to change notification settings - Fork 7
/
hw750.h
168 lines (135 loc) · 4.75 KB
/
hw750.h
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// SPDX-License-Identifier: GPL-2.0+
// Copyright (c) 2023, SiliconMotion Inc.
#ifndef LYNX_HW750_H__
#define LYNX_HW750_H__
#include "hw_com.h"
#ifdef USE_EP952
#include "ddk768/ep952api.h"
#endif
void ddk750_set_mmio(volatile unsigned char * addr,unsigned short devId,char revId);
unsigned long ddk750_getFrameBufSize(void);
long ddk750_initChip(void);
void ddk750_deInit(void);
long ddk750_detectCRTMonitor(unsigned char redValue, unsigned char greenValue,
unsigned char blueValue);
long ddk750_edidHeaderReadMonitorExHwI2C(void);
long ddk750_edidHeaderReadMonitorEx(
unsigned char sclGpio,
unsigned char sdaGpio
);
/*
* edidReadMonitor
* This function reads the EDID structure from the attached monitor
*
* Input:
* displayPath - Display device which EDID to be read from.
* pEDIDBuffer - Buffer that contains the EDID structure of the monitor
* bufferSize - The EDID Buffer size index (usually 128-bytes)
* edidExtNo - Extension Index of the EDID Structure to be read
*
* Output:
* 0 - Success
* -1 - Fail
*/
long ddk750_edidReadMonitor(
disp_path_t displayPath,
unsigned char *pEDIDBuffer,
unsigned long bufferSize,
unsigned char edidExtNo
);
/*
* edidReadMonitor
* This function reads the EDID structure from the attached monitor
*
* Input:
* displayPath - Display device which EDID to be read from.
* pEDIDBuffer - Buffer that contains the EDID structure of the monitor
* bufferSize - The EDID Buffer size index (usually 128-bytes)
* edidExtNo - Extension Index of the EDID Structure to be read
* sclGpio - GPIO pin used as the I2C Clock (SCL)
* sdaGpio - GPIO pin used as the I2C Data (SDA)
*
* Output:
* 0 - Success
* -1 - Fail
*/
long ddk750_edidReadMonitorEx(
disp_path_t displayPath,
unsigned char *pEDIDBuffer,
unsigned long bufferSize,
unsigned char edidExtNo,
unsigned char sclGpio,
unsigned char sdaGpio
);
long ddk750_edidReadMonitorEx_HW(
disp_path_t displayPath,
unsigned char *pEDIDBuffer,
unsigned long bufferSize,
unsigned char edidExtNo
);
/*
* This function initializes the cursor attributes.
*/
void ddk750_initCursor(
disp_control_t dispControl, /* Display control (PRIMARY_CTRL or SECONDARY_CTRL) */
unsigned long base, /* Base Address */
unsigned long color1, /* Cursor color 1 in RGB 5:6:5 format */
unsigned long color2, /* Cursor color 2 in RGB 5:6:5 format */
unsigned long color3 /* Cursor color 3 in RGB 5:6:5 format */
);
/*
* This function sets the cursor position.
*/
void ddk750_setCursorPosition(
disp_control_t dispControl, /* Display control (PRIMARY_CTRL or SECONDARY_CTRL) */
unsigned long dx, /* X Coordinate of the cursor */
unsigned long dy, /* Y Coordinate of the cursor */
unsigned char topOutside, /* Top Boundary Select: either partially outside (= 1)
or within the screen top boundary (= 0) */
unsigned char leftOutside /* Left Boundary Select: either partially outside (= 1)
or within the screen left boundary (= 0) */
);
/*
* This function enables/disables the cursor.
*/
void ddk750_enableCursor(
disp_control_t dispControl, /* Display control (PRIMARY_CTRL or SECONDARY_CTRL) */
unsigned long enable
);
void hw750_set_base(int display,int pitch,int base_addr);
long setMode(
logicalMode_t *pLogicalMode
);
void setDisplayControl(disp_control_t dispControl, disp_state_t dispState);
void setPath(
disp_path_t dispPath,
disp_control_t dispControl,
disp_state_t dispState
);
void swPanelPowerSequence(disp_state_t dispState, unsigned long vsync_delay);
void setDAC(disp_state_t state);
void setDPMS(DPMS_t state);
void hw750_set_dpms(int display,int state);
void hw750_suspend(struct smi_750_register * pSave);
void hw750_resume(struct smi_750_register * pSave);
int hw750_check_vsync_interrupt(int path);
void hw750_clear_vsync_interrupt(int path);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
int hw750_en_dis_interrupt(int status, int pipe);
#else
int hw750_en_dis_interrupt(int status);
#endif
void ddk750_disable_IntMask(void);
int sii9022xInitChip(void);
int sii9022xSetMode(int);
unsigned char sii9022xIsConnected(void);
int ddk750_GetDDC_9022Access(void);
int ddk750_Release9022DDC(void);
void ddk750_DoEdidRead(void);
void hw750_setgamma(disp_control_t dispCtrl, unsigned long enable);
void hw750_load_lut(disp_control_t dispCtrl, int size, u8 lut_r[], u8 lut_g[], u8 lut_b[]);
long hw750_AdaptI2CInit(struct smi_connector *smi_connector);
long hw750_AdaptI2CCleanBus(
struct drm_connector *connector
);
#endif