Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FBDEV] add INVERSION mode for known displays #73

Merged
merged 4 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions drivers/video/fbdev/gc9306fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
#define MIYOO_FB0_PUT_OSD _IOWR(0x100, 0, unsigned long)
#define MIYOO_FB0_SET_MODE _IOWR(0x101, 0, unsigned long)

static bool invert=false;
module_param(invert,bool,0660);

struct myfb_par {
struct device *dev;
struct platform_device *pdev;
Expand Down Expand Up @@ -274,6 +277,11 @@ static void init_lcd(void)
lcdc_wr_dat(0x00);
lcdc_wr_dat(0x00);
lcdc_wr_dat(0xef); // 0x013F = 319
if (invert) {
lcdc_wr_cmd(0x21); // Display Inversion On (for colors)
} else {
lcdc_wr_cmd(0x20); // Display Inversion Off (for colors)
}
// lcdc_wr_cmd(0x2c);
//--------end display window --------------//
//------------gamma setting------------------//
Expand Down
10 changes: 9 additions & 1 deletion drivers/video/fbdev/r61520fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,9 @@ if(debug){
gpio_wr_cmd(0x13);

if (invert) {
gpio_wr_cmd(0x21); // invert colors
gpio_wr_cmd(0x21); // enter_invert_mode for colors
} else {
gpio_wr_cmd(0x20); // exit_invert_mode for colors
}

gpio_wr_cmd(0x35);
Expand Down Expand Up @@ -782,6 +784,12 @@ if(debug){
gpio_wr_cmd(0xc3);
gpio_wr_dat(0x13); // or 0x0b?

if (invert) {
gpio_wr_cmd(0x21); // Display Inversion On (INVON for colors)
} else {
gpio_wr_cmd(0x20); // Display Inversion Off (INVOFF for colors)
}

gpio_wr_cmd(0xc4);
gpio_wr_dat(0x20);

Expand Down
9 changes: 9 additions & 0 deletions drivers/video/fbdev/st7789sfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ module_param(lowcurrent,bool,0660);
static int tefix = 0; //DEFAULT_TEFIX
module_param(tefix,int,0660);

static bool invert=false;
module_param(invert,bool,0660);

struct myfb_app{
uint32_t yoffset;
uint32_t vsync_count;
Expand Down Expand Up @@ -390,6 +393,12 @@ static void init_lcd(void)
// lcdc_wr_cmd(0xc4);
// lcdc_wr_dat(0x20);
//
if (invert) {
lcdc_wr_cmd(0x21); // Display Inversion On (INVON for colors)
} else {
lcdc_wr_cmd(0x20); // Display Inversion Off (INVOFF for colors)
}

lcdc_wr_cmd(0xc6);
if (tefix == 3)
lcdc_wr_dat(0x03); // 0x04, 0x1f
Expand Down