sharp: variable screen resolution + flip with GS flag

This commit is contained in:
Takumi Sueda 2020-11-01 21:08:08 +09:00 committed by Suguru Saito
parent 5eacb6eac5
commit c68ffe0c75
4 changed files with 36 additions and 17 deletions

View File

@ -101,6 +101,10 @@ void mxsfb_system_setup(void)
ili9805_mac |= 1 << ILI9805_MAC_BGR_OFFSET;
}
if (config.flip_y_gs) {
ili9805_mac |= 1 << ILI9805_MAC_GS_OFFSET;
}
mxsfb_write_byte(0x36, 0); /* Memory Access Control */
mxsfb_write_byte(ili9805_mac, 1);
@ -108,15 +112,33 @@ void mxsfb_system_setup(void)
mxsfb_write_byte(0x21, 0); /* Display Inversion On */
}
for (i = 0; i < ARRAY_SIZE(regs_late); i++) {
mxsfb_write_byte(regs_late[i].payload, regs_late[i].data);
if (regs_late[i].delay)
mdelay(regs_late[i].delay);
}
mxsfb_write_byte(0x11, 0); /* Sleep Out */
mdelay(120);
mxsfb_write_byte(0x29, 0); /* Display On */
mdelay(20);
mxsfb_write_byte(0x2a, 0); /* Column Address Set */
mxsfb_write_byte(0x00, 1); /* Start Column in 2 Bytes */
mxsfb_write_byte(0x00, 1);
mxsfb_write_byte((config.width & 0xff00) >> 8, 1); /* End Column in 2 Bytes */
mxsfb_write_byte((config.width & 0x00ff) >> 0, 1);
mxsfb_write_byte(0x2b, 0); /* Page Address Set */
mxsfb_write_byte(0x00, 1); /* Start Page in 2 Bytes */
mxsfb_write_byte(0x00, 1);
mxsfb_write_byte((config.height & 0xff00) >> 8, 1); /* End Page in 2 Bytes */
mxsfb_write_byte((config.height & 0x00ff) >> 0, 1);
mxsfb_write_byte(0x2c, 0); /* Memory Write */
/* Fill black */
for (i = 0; i < 480; i++) {
for (j = 0; j < 800; j++) {
for (i = 0; i < config.height; i++) {
for (j = 0; j < config.width; j++) {
mxsfb_write_byte(0, 1);
}
}

View File

@ -4,8 +4,11 @@
#define __BRAIN_LCD_H__
typedef struct {
int width;
int height;
int flip_x;
int flip_y;
int flip_y_gs;
int transpose;
int inversion;
int bgr;
@ -83,16 +86,6 @@ const static lcd_regs_t regs_early[] = {
{ 0x00, 1, 0 },
};
const static lcd_regs_t regs_late[] = {
{ 0x11, 0, 120 }, /* Sleep Out */
{ 0x29, 0, 20 }, /* Display On */
{ 0x2a, 0, 0 }, /* Column Address Set */
{ 0x00, 1, 0 }, { 0x00, 1, 0 }, { 0x03, 1, 0 }, { 0x1f, 1, 0 },
{ 0x2b, 0, 0 }, /* Page Address Set */
{ 0x00, 1, 0 }, { 0x00, 1, 0 }, { 0x01, 1, 0 }, { 0xdf, 1, 0 },
{ 0x2c, 0, 0 }, /* Memory Write*/
};
/* clang-format on */
#endif

View File

@ -92,6 +92,8 @@ int board_mmc_init(bd_t *bis)
#ifdef CONFIG_VIDEO_MXS
static const lcd_config_t lcd_config = {
.width = 800,
.height = 480,
.flip_x = ILI9805_DISABLE,
.flip_y = ILI9805_DISABLE,
.transpose = ILI9805_ENABLE,

View File

@ -92,6 +92,8 @@ int board_mmc_init(bd_t *bis)
#ifdef CONFIG_VIDEO_MXS
static const lcd_config_t lcd_config = {
.width = 800,
.height = 480,
.flip_x = ILI9805_DISABLE,
.flip_y = ILI9805_DISABLE,
.transpose = ILI9805_ENABLE,