This commit is contained in:
刘可亮
2024-06-04 19:00:30 +08:00
parent 990c72f5be
commit 0a13af6a1d
1668 changed files with 342810 additions and 37726 deletions

View File

@@ -10,6 +10,7 @@
/**
* LVDS options
*/
#include <aic_hal_lvds.h>
/* lvds sync mode enable */
#define AIC_LVDS_SYNC_MODE_EN 1
@@ -20,22 +21,23 @@
/**
* lvds channel output order
*
* works on both link0 and link1 (if exists)
*
* default D3 CK D2 D1 D0
* 4 3 2 1 0
*/
#define AIC_LVDS_LINES 0x43210
#define AIC_LVDS_LINK0_LANES LVDS_LANES(LVDS_D3, LVDS_CK, LVDS_D2, LVDS_D1, LVDS_D0)
#define AIC_LVDS_LINK1_LANES LVDS_LANES(LVDS_D3, LVDS_CK, LVDS_D2, LVDS_D1, LVDS_D0)
/**
* lvds channel polarities, works on both link0 and link1 (if exists)
* lvds channel polarities
*/
#define AIC_LVDS_POL 0x0
#define AIC_LVDS_LINK0_POL 0x0
#define AIC_LVDS_LINK1_POL 0x0
/**
* lvds channel phy config, works on both link0 and link1 (if exists)
* lvds channel phy config
*/
#define AIC_LVDS_PHY 0xFA
#define AIC_LVDS_LINK0_PHY 0xFA
#define AIC_LVDS_LINK1_PHY 0xFA
/**
* MIPI-DSI options
@@ -70,6 +72,9 @@
* Display Engine options
*/
/* display flags, config hsync/vsync polarities */
#define AIC_DISPLAY_FLAGS (DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW)
/**
* Display Engine Mode
*
@@ -141,6 +146,50 @@
#define AIC_PANEL_RESET_GPIO "PE.6"
#endif
struct disp_pinmux {
unsigned char func;
unsigned char bias;
unsigned char drive;
char *name;
};
#define AIC_PQ_TOOL_SET_DISP_PINMUX_FOPS(disp_pin) \
static void aic_set_disp_pinmux_for_pq_tool(void)\
{\
uint32_t i = 0;\
long pin = 0;\
unsigned int g;\
unsigned int p;\
\
for (i = 0; i < ARRAY_SIZE(disp_pin); i++) {\
pin = hal_gpio_name2pin(disp_pin[i].name);\
if (pin < 0)\
continue;\
g = GPIO_GROUP(pin);\
p = GPIO_GROUP_PIN(pin);\
hal_gpio_set_func(g, p, disp_pin[i].func);\
hal_gpio_set_bias_pull(g, p, disp_pin[i].bias);\
hal_gpio_set_drive_strength(g, p, disp_pin[i].drive);\
}\
}
#define AIC_PQ_SET_DSIP_PINMUX \
aic_set_disp_pinmux_for_pq_tool()
#define AIC_PQ_TOOL_PINMUX_CONFIG(name) \
static struct disp_pinmux name[] = { \
{3, PIN_PULL_DIS, 3, "PD.8"},\
{3, PIN_PULL_DIS, 3, "PD.9"},\
{3, PIN_PULL_DIS, 3, "PD.10"},\
{3, PIN_PULL_DIS, 3, "PD.11"},\
{3, PIN_PULL_DIS, 3, "PD.12"},\
{3, PIN_PULL_DIS, 3, "PD.13"},\
{3, PIN_PULL_DIS, 3, "PD.14"},\
{3, PIN_PULL_DIS, 3, "PD.15"},\
{3, PIN_PULL_DIS, 3, "PD.16"},\
{3, PIN_PULL_DIS, 3, "PD.17"},\
}
#define PANEL_DSI_SIMEP_SEND_SEQ \
panel_dsi_dcs_send_seq(panel, 0x00); \