Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: fbtft: Use standard MIPI DCS command defines for ili9481

This patch makes use of the standard MIPI Display Command Set to remove
some of the magic constants found in source code.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Priit Laes and committed by
Greg Kroah-Hartman
89823edc 467786c1

+17 -13
+17 -13
drivers/staging/fbtft/fb_ili9481.c
··· 19 19 #include <linux/kernel.h> 20 20 #include <linux/init.h> 21 21 #include <linux/delay.h> 22 + #include <video/mipi_display.h> 22 23 23 24 #include "fbtft.h" 24 25 ··· 30 29 static int default_init_sequence[] = { 31 30 32 31 /* SLP_OUT - Sleep out */ 33 - -1, 0x11, 32 + -1, MIPI_DCS_EXIT_SLEEP_MODE, 34 33 -2, 50, 35 34 /* Power setting */ 36 35 -1, 0xD0, 0x07, 0x42, 0x18, ··· 43 42 /* Frame rate & inv. */ 44 43 -1, 0xC5, 0x03, 45 44 /* Pixel format */ 46 - -1, 0x3A, 0x55, 45 + -1, MIPI_DCS_SET_PIXEL_FORMAT, 0x55, 47 46 /* Gamma */ 48 47 -1, 0xC8, 0x00, 0x32, 0x36, 0x45, 0x06, 0x16, 49 48 0x37, 0x75, 0x77, 0x54, 0x0C, 0x00, 50 49 /* DISP_ON */ 51 - -1, 0x29, 50 + -1, MIPI_DCS_SET_DISPLAY_ON, 52 51 -3 53 52 }; 54 53 55 54 static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) 56 55 { 57 - /* column address */ 58 - write_reg(par, 0x2a, xs >> 8, xs & 0xff, xe >> 8, xe & 0xff); 56 + write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS, 57 + xs >> 8, xs & 0xff, xe >> 8, xe & 0xff); 59 58 60 - /* Row address */ 61 - write_reg(par, 0x2b, ys >> 8, ys & 0xff, ye >> 8, ye & 0xff); 59 + write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS, 60 + ys >> 8, ys & 0xff, ye >> 8, ye & 0xff); 62 61 63 - /* memory write */ 64 - write_reg(par, 0x2c); 62 + write_reg(par, MIPI_DCS_WRITE_MEMORY_START); 65 63 } 66 64 67 65 #define HFLIP 0x01 ··· 70 70 { 71 71 switch (par->info->var.rotate) { 72 72 case 270: 73 - write_reg(par, 0x36, ROWxCOL | HFLIP | VFLIP | (par->bgr << 3)); 73 + write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, 74 + ROWxCOL | HFLIP | VFLIP | (par->bgr << 3)); 74 75 break; 75 76 case 180: 76 - write_reg(par, 0x36, VFLIP | (par->bgr << 3)); 77 + write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, 78 + VFLIP | (par->bgr << 3)); 77 79 break; 78 80 case 90: 79 - write_reg(par, 0x36, ROWxCOL | (par->bgr << 3)); 81 + write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, 82 + ROWxCOL | (par->bgr << 3)); 80 83 break; 81 84 default: 82 - write_reg(par, 0x36, HFLIP | (par->bgr << 3)); 85 + write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, 86 + HFLIP | (par->bgr << 3)); 83 87 break; 84 88 } 85 89