-
Notifications
You must be signed in to change notification settings - Fork 7
/
hw768.h
178 lines (122 loc) · 4.67 KB
/
hw768.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
169
170
171
172
173
174
175
176
177
178
// SPDX-License-Identifier: GPL-2.0+
// Copyright (c) 2023, SiliconMotion Inc.
#ifndef LYNX_HW768_H__
#define LYNX_HW768_H__
#include "hw_com.h"
#ifdef USE_EP952
#include "ddk768/ep952api.h"
#endif
unsigned char HDMI_connector_detect(void);
void ddk768_setDisplayPlaneDisableOnly(
disp_control_t dispControl /* Channel 0 or Channel 1) */
);
void hw768_enable_lvds(int channels);
void ddk768_set_mmio(volatile unsigned char * addr,unsigned short devId,char revId);
unsigned long ddk768_getFrameBufSize(void);
long ddk768_initChip(void);
void ddk768_deInit(void);
void ddk768_swPanelPowerSequence(disp_control_t dispControl, disp_state_t dispState, unsigned long vSyncDelay);
long ddk768_edidHeaderReadMonitorEx(
unsigned char sclGpio,
unsigned char sdaGpio
);
long ddk768_edidHeaderReadMonitorExHwI2C(
unsigned char i2cNumber
);
long ddk768_detectCRTMonitor(disp_control_t dispControl, unsigned char redValue,
unsigned char greenValue, unsigned char blueValue);
long ddk768_edidReadMonitor(
unsigned char *pEDIDBuffer,
unsigned long bufferSize,
unsigned char edidExtNo,
unsigned char i2cNumber
);
long ddk768_edidReadMonitorEx(
unsigned char *pEDIDBuffer,
unsigned long bufferSize,
unsigned char edidExtNo,
unsigned char sclGpio,
unsigned char sdaGpio
);
int hw768_get_hdmi_edid(unsigned char *pEDIDBuffer);
long ddk768_edidReadMonitorExHwI2C(
unsigned char *pEDIDBuffer,
unsigned long bufferSize,
unsigned char edidExtNo,
unsigned char i2cNumber
);
/*
* Disable double pixel clock.
* This is a teporary function, used to patch for the random fuzzy font problem.
*/
void DisableDoublePixel(disp_control_t dispControl);
void EnableDoublePixel(disp_control_t dispControl);
void hw768_SetPixelClockFormat(disp_control_t dispControl,unsigned int is_half);
/*
* This function initializes the cursor attributes.
*/
void ddk768_initCursor(
disp_control_t dispControl, /* Display control (CHANNEL0_CTRL or CHANNEL1_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 ddk768_setCursorPosition(
disp_control_t dispControl, /* Display control (CHANNEL0_CTRL or CHANNEL1_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) */
);
void hw768_set_base(int display,int pitch,int base_addr);
/*
* This function enables/disables the cursor.
*/
void ddk768_enableCursor(
disp_control_t dispControl, /* Display control (CHANNEL0_CTRL or CHANNEL1_CTRL) */
unsigned long enable
);
void hw768_HDMI_Enable_Output(void);
void hw768_HDMI_Disable_Output(void);
long ddk768_setMode(
logicalMode_t *pLogicalMode
);
long setSingleViewOn(disp_control_t dispOutput);
long initDisplay(void);
void setDisplayDPMS(
disp_control_t dispControl, /* Channel 0 or Channel 1) */
DISP_DPMS_t state /* DPMS state */
);
void hw768_init_hdmi(void);
int hw768_set_hdmi_mode(logicalMode_t *pLogicalMode, struct drm_display_mode mode, bool isHDMI);
void ddk768_setDisplayEnable(disp_control_t dispControl, /* Channel 0 or Channel 1) */
disp_state_t dispState /* ON or OFF */);
int hw768_check_iis_interrupt(void);
int hw768_check_vsync_interrupt(int path);
void hw768_clear_vsync_interrupt(int path);
long hw768_setMode(logicalMode_t *pLogicalMode, struct drm_display_mode mode);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
int hw768_en_dis_interrupt(int status, int pipe);
#else
int hw768_en_dis_interrupt(int status);
#endif
int hdmi_detect(void);
int hdmi_hotplug_detect(void);
void HDMI_Audio_Mute (void);
void HDMI_Audio_Unmute (void);
void ddk768_disable_IntMask(void);
void hw768_suspend(struct smi_768_register * pSave);
void hw768_resume(struct smi_768_register * pSave);
void hw768_setgamma(disp_control_t dispCtrl, unsigned long enable,unsigned long lvds_ch);
void hw768_load_lut(disp_control_t dispCtrl, int size, u8 lut_r[], u8 lut_g[], u8 lut_b[]);
long hw768_AdaptI2CCleanBus(
struct drm_connector *connector
);
long hw768_AdaptI2CInit(struct smi_connector *smi_connector);
#endif