diff options
Diffstat (limited to 'drivers/staging/fbtft')
-rw-r--r-- | drivers/staging/fbtft/fb_agm1264k-fl.c | 68 | ||||
-rw-r--r-- | drivers/staging/fbtft/fb_ili9325.c | 19 | ||||
-rw-r--r-- | drivers/staging/fbtft/fb_ili9481.c | 2 | ||||
-rw-r--r-- | drivers/staging/fbtft/fb_ili9486.c | 2 | ||||
-rw-r--r-- | drivers/staging/fbtft/fb_s6d02a1.c | 2 | ||||
-rw-r--r-- | drivers/staging/fbtft/fb_st7735r.c | 2 | ||||
-rw-r--r-- | drivers/staging/fbtft/fbtft-core.c | 33 | ||||
-rw-r--r-- | drivers/staging/fbtft/fbtft.h | 4 | ||||
-rw-r--r-- | drivers/staging/fbtft/fbtft_device.c | 12 | ||||
-rw-r--r-- | drivers/staging/fbtft/flexfb.c | 373 |
10 files changed, 389 insertions, 128 deletions
diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c index 7561385761e9..a6e3af74a904 100644 --- a/drivers/staging/fbtft/fb_agm1264k-fl.c +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c @@ -264,6 +264,39 @@ construct_line_bitmap(struct fbtft_par *par, u8 *dest, signed short *src, } } +static void iterate_diffusion_matrix(u32 xres, u32 yres, int x, + int y, signed short *convert_buf, + signed short pixel, signed short error) +{ + u16 i, j; + + /* diffusion matrix row */ + for (i = 0; i < DIFFUSING_MATRIX_WIDTH; ++i) + /* diffusion matrix column */ + for (j = 0; j < DIFFUSING_MATRIX_HEIGHT; ++j) { + signed short *write_pos; + signed char coeff; + + /* skip pixels out of zone */ + if (x + i < 0 || x + i >= xres || y + j >= yres) + continue; + write_pos = &convert_buf[(y + j) * xres + x + i]; + coeff = diffusing_matrix[i][j]; + if (-1 == coeff) + /* pixel itself */ + *write_pos = pixel; + else { + signed short p = *write_pos + error * coeff; + + if (p > WHITE) + p = WHITE; + if (p < BLACK) + p = BLACK; + *write_pos = p; + } + } +} + static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) { u16 *vmem16 = (u16 *)par->info->screen_buffer; @@ -303,7 +336,6 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) signed short error_b = pixel - BLACK; signed short error_w = pixel - WHITE; signed short error; - u16 i, j; /* what color close? */ if (abs(error_b) >= abs(error_w)) { @@ -318,36 +350,10 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) error /= 8; - /* diffusion matrix row */ - for (i = 0; i < DIFFUSING_MATRIX_WIDTH; ++i) - /* diffusion matrix column */ - for (j = 0; j < DIFFUSING_MATRIX_HEIGHT; ++j) { - signed short *write_pos; - signed char coeff; - - /* skip pixels out of zone */ - if (x + i < 0 || - x + i >= par->info->var.xres - || y + j >= par->info->var.yres) - continue; - write_pos = &convert_buf[ - (y + j) * par->info->var.xres + - x + i]; - coeff = diffusing_matrix[i][j]; - if (coeff == -1) - /* pixel itself */ - *write_pos = pixel; - else { - signed short p = *write_pos + - error * coeff; - - if (p > WHITE) - p = WHITE; - if (p < BLACK) - p = BLACK; - *write_pos = p; - } - } + iterate_diffusion_matrix(par->info->var.xres, + par->info->var.yres, + x, y, convert_buf, + pixel, error); } /* 1 string = 2 pages */ diff --git a/drivers/staging/fbtft/fb_ili9325.c b/drivers/staging/fbtft/fb_ili9325.c index c31e2e051d4a..19e33bab9cac 100644 --- a/drivers/staging/fbtft/fb_ili9325.c +++ b/drivers/staging/fbtft/fb_ili9325.c @@ -33,26 +33,23 @@ "04 16 2 7 6 3 2 1 7 7" static unsigned int bt = 6; /* VGL=Vci*4 , VGH=Vci*4 */ -module_param(bt, uint, 0); +module_param(bt, uint, 0000); MODULE_PARM_DESC(bt, "Sets the factor used in the step-up circuits"); static unsigned int vc = 0x03; /* Vci1=Vci*0.80 */ -module_param(vc, uint, 0); -MODULE_PARM_DESC(vc, -"Sets the ratio factor of Vci to generate the reference voltages Vci1"); +module_param(vc, uint, 0000); +MODULE_PARM_DESC(vc, "Sets the ratio factor of Vci to generate the reference voltages Vci1"); static unsigned int vrh = 0x0d; /* VREG1OUT=Vci*1.85 */ -module_param(vrh, uint, 0); -MODULE_PARM_DESC(vrh, -"Set the amplifying rate (1.6 ~ 1.9) of Vci applied to output the VREG1OUT"); +module_param(vrh, uint, 0000); +MODULE_PARM_DESC(vrh, "Set the amplifying rate (1.6 ~ 1.9) of Vci applied to output the VREG1OUT"); static unsigned int vdv = 0x12; /* VCOMH amplitude=VREG1OUT*0.98 */ -module_param(vdv, uint, 0); -MODULE_PARM_DESC(vdv, -"Select the factor of VREG1OUT to set the amplitude of Vcom"); +module_param(vdv, uint, 0000); +MODULE_PARM_DESC(vdv, "Select the factor of VREG1OUT to set the amplitude of Vcom"); static unsigned int vcm = 0x0a; /* VCOMH=VREG1OUT*0.735 */ -module_param(vcm, uint, 0); +module_param(vcm, uint, 0000); MODULE_PARM_DESC(vcm, "Set the internal VcomH voltage"); /* diff --git a/drivers/staging/fbtft/fb_ili9481.c b/drivers/staging/fbtft/fb_ili9481.c index 242adb3859bd..4e75f5abe2f9 100644 --- a/drivers/staging/fbtft/fb_ili9481.c +++ b/drivers/staging/fbtft/fb_ili9481.c @@ -27,7 +27,7 @@ #define WIDTH 320 #define HEIGHT 480 -static int default_init_sequence[] = { +static s16 default_init_sequence[] = { /* SLP_OUT - Sleep out */ -1, MIPI_DCS_EXIT_SLEEP_MODE, -2, 50, diff --git a/drivers/staging/fbtft/fb_ili9486.c b/drivers/staging/fbtft/fb_ili9486.c index fa38d8885f0b..f4b314265f9e 100644 --- a/drivers/staging/fbtft/fb_ili9486.c +++ b/drivers/staging/fbtft/fb_ili9486.c @@ -26,7 +26,7 @@ #define HEIGHT 480 /* this init sequence matches PiScreen */ -static int default_init_sequence[] = { +static s16 default_init_sequence[] = { /* Interface Mode Control */ -1, 0xb0, 0x0, -1, MIPI_DCS_EXIT_SLEEP_MODE, diff --git a/drivers/staging/fbtft/fb_s6d02a1.c b/drivers/staging/fbtft/fb_s6d02a1.c index 774b0ff69e6d..eb712aa0d692 100644 --- a/drivers/staging/fbtft/fb_s6d02a1.c +++ b/drivers/staging/fbtft/fb_s6d02a1.c @@ -24,7 +24,7 @@ #define DRVNAME "fb_s6d02a1" -static int default_init_sequence[] = { +static s16 default_init_sequence[] = { -1, 0xf0, 0x5a, 0x5a, diff --git a/drivers/staging/fbtft/fb_st7735r.c b/drivers/staging/fbtft/fb_st7735r.c index 6670f2bb62ec..710b74bbba97 100644 --- a/drivers/staging/fbtft/fb_st7735r.c +++ b/drivers/staging/fbtft/fb_st7735r.c @@ -25,7 +25,7 @@ #define DEFAULT_GAMMA "0F 1A 0F 18 2F 28 20 22 1F 1B 23 37 00 07 02 10\n" \ "0F 1B 0F 17 33 2C 29 2E 30 30 39 3F 00 07 03 10" -static int default_init_sequence[] = { +static s16 default_init_sequence[] = { -1, MIPI_DCS_SOFT_RESET, -2, 150, /* delay */ diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 587f68aa466c..bbe89c9c4fb9 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -253,7 +253,8 @@ static int fbtft_backlight_update_status(struct backlight_device *bd) "%s: polarity=%d, power=%d, fb_blank=%d\n", __func__, polarity, bd->props.power, bd->props.fb_blank); - if ((bd->props.power == FB_BLANK_UNBLANK) && (bd->props.fb_blank == FB_BLANK_UNBLANK)) + if ((bd->props.power == FB_BLANK_UNBLANK) && + (bd->props.fb_blank == FB_BLANK_UNBLANK)) gpio_set_value(par->gpio.led[0], polarity); else gpio_set_value(par->gpio.led[0], !polarity); @@ -299,7 +300,8 @@ void fbtft_register_backlight(struct fbtft_par *par) bl_props.state |= BL_CORE_DRIVER1; bd = backlight_device_register(dev_driver_string(par->info->device), - par->info->device, par, &fbtft_bl_ops, &bl_props); + par->info->device, par, + &fbtft_bl_ops, &bl_props); if (IS_ERR(bd)) { dev_err(par->info->device, "cannot register backlight device (%ld)\n", @@ -350,9 +352,11 @@ static void fbtft_update_display(struct fbtft_par *par, unsigned int start_line, bool timeit = false; int ret = 0; - if (unlikely(par->debug & (DEBUG_TIME_FIRST_UPDATE | DEBUG_TIME_EACH_UPDATE))) { + if (unlikely(par->debug & (DEBUG_TIME_FIRST_UPDATE | + DEBUG_TIME_EACH_UPDATE))) { if ((par->debug & DEBUG_TIME_EACH_UPDATE) || - ((par->debug & DEBUG_TIME_FIRST_UPDATE) && !par->first_update_done)) { + ((par->debug & DEBUG_TIME_FIRST_UPDATE) && + !par->first_update_done)) { ts_start = ktime_get(); timeit = true; } @@ -361,15 +365,17 @@ static void fbtft_update_display(struct fbtft_par *par, unsigned int start_line, /* Sanity checks */ if (start_line > end_line) { dev_warn(par->info->device, - "%s: start_line=%u is larger than end_line=%u. Shouldn't happen, will do full display update\n", - __func__, start_line, end_line); + "%s: start_line=%u is larger than end_line=%u. Shouldn't happen, will do full display update\n", + __func__, start_line, end_line); start_line = 0; end_line = par->info->var.yres - 1; } - if (start_line > par->info->var.yres - 1 || end_line > par->info->var.yres - 1) { + if (start_line > par->info->var.yres - 1 || + end_line > par->info->var.yres - 1) { dev_warn(par->info->device, "%s: start_line=%u or end_line=%u is larger than max=%d. Shouldn't happen, will do full display update\n", - __func__, start_line, end_line, par->info->var.yres - 1); + __func__, start_line, + end_line, par->info->var.yres - 1); start_line = 0; end_line = par->info->var.yres - 1; } @@ -660,12 +666,13 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, unsigned int bpp = display->bpp; unsigned int fps = display->fps; int vmem_size, i; - int *init_sequence = display->init_sequence; + s16 *init_sequence = display->init_sequence; char *gamma = display->gamma; unsigned long *gamma_curves = NULL; /* sanity check */ - if (display->gamma_num * display->gamma_len > FBTFT_GAMMA_MAX_VALUES_TOTAL) { + if (display->gamma_num * display->gamma_len > + FBTFT_GAMMA_MAX_VALUES_TOTAL) { dev_err(dev, "FBTFT_GAMMA_MAX_VALUES_TOTAL=%d is exceeded\n", FBTFT_GAMMA_MAX_VALUES_TOTAL); return NULL; @@ -832,11 +839,13 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, #ifdef CONFIG_HAS_DMA if (dma) { dev->coherent_dma_mask = ~0; - txbuf = dmam_alloc_coherent(dev, txbuflen, &par->txbuf.dma, GFP_DMA); + txbuf = dmam_alloc_coherent(dev, txbuflen, + &par->txbuf.dma, GFP_DMA); } else #endif { - txbuf = devm_kzalloc(par->info->device, txbuflen, GFP_KERNEL); + txbuf = devm_kzalloc(par->info->device, + txbuflen, GFP_KERNEL); } if (!txbuf) goto alloc_fail; diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h index 89c4b5b76ce6..aacdde92cc2e 100644 --- a/drivers/staging/fbtft/fbtft.h +++ b/drivers/staging/fbtft/fbtft.h @@ -124,7 +124,7 @@ struct fbtft_display { unsigned int bpp; unsigned int fps; int txbuflen; - int *init_sequence; + s16 *init_sequence; char *gamma; int gamma_num; int gamma_len; @@ -229,7 +229,7 @@ struct fbtft_par { int led[16]; int aux[16]; } gpio; - int *init_sequence; + s16 *init_sequence; struct { struct mutex lock; unsigned long *curves; diff --git a/drivers/staging/fbtft/fbtft_device.c b/drivers/staging/fbtft/fbtft_device.c index e9211831b6a1..de46f8d988d2 100644 --- a/drivers/staging/fbtft/fbtft_device.c +++ b/drivers/staging/fbtft/fbtft_device.c @@ -96,9 +96,9 @@ static unsigned int buswidth = 8; module_param(buswidth, uint, 0); MODULE_PARM_DESC(buswidth, "Display bus width, used with the custom argument"); -static int init[FBTFT_MAX_INIT_SEQUENCE]; +static s16 init[FBTFT_MAX_INIT_SEQUENCE]; static int init_num; -module_param_array(init, int, &init_num, 0); +module_param_array(init, short, &init_num, 0); MODULE_PARM_DESC(init, "Init sequence, used with the custom argument"); static unsigned long debug; @@ -131,7 +131,7 @@ static void adafruit18_green_tab_set_addr_win(struct fbtft_par *par, "D0 00 14 15 13 2C 42 43 4E 09 16 14 18 21\n" \ "D0 00 14 15 13 0B 43 55 53 0C 17 14 23 20" -static int cberry28_init_sequence[] = { +static s16 cberry28_init_sequence[] = { /* turn off sleep mode */ -1, MIPI_DCS_EXIT_SLEEP_MODE, -2, 120, @@ -180,7 +180,7 @@ static int cberry28_init_sequence[] = { -3, }; -static int hy28b_init_sequence[] = { +static s16 hy28b_init_sequence[] = { -1, 0x00e7, 0x0010, -1, 0x0000, 0x0001, -1, 0x0001, 0x0100, -1, 0x0002, 0x0700, -1, 0x0003, 0x1030, -1, 0x0004, 0x0000, @@ -211,7 +211,7 @@ static int hy28b_init_sequence[] = { "04 1F 4 7 7 0 7 7 6 0\n" \ "0F 00 1 7 4 0 0 0 6 7" -static int pitft_init_sequence[] = { +static s16 pitft_init_sequence[] = { -1, MIPI_DCS_SOFT_RESET, -2, 5, -1, MIPI_DCS_SET_DISPLAY_OFF, @@ -242,7 +242,7 @@ static int pitft_init_sequence[] = { -3 }; -static int waveshare32b_init_sequence[] = { +static s16 waveshare32b_init_sequence[] = { -1, 0xCB, 0x39, 0x2C, 0x00, 0x34, 0x02, -1, 0xCF, 0x00, 0xC1, 0x30, -1, 0xE8, 0x85, 0x00, 0x78, diff --git a/drivers/staging/fbtft/flexfb.c b/drivers/staging/fbtft/flexfb.c index ce0d254148e4..ded10718712b 100644 --- a/drivers/staging/fbtft/flexfb.c +++ b/drivers/staging/fbtft/flexfb.c @@ -38,9 +38,9 @@ static unsigned int height; module_param(height, uint, 0); MODULE_PARM_DESC(height, "Display height"); -static int init[512]; +static s16 init[512]; static int init_num; -module_param_array(init, int, &init_num, 0); +module_param_array(init, short, &init_num, 0); MODULE_PARM_DESC(init, "Init sequence"); static unsigned int setaddrwin; @@ -63,68 +63,316 @@ static bool latched; module_param(latched, bool, 0); MODULE_PARM_DESC(latched, "Use with latched 16-bit databus"); -static int *initp; +static s16 *initp; static int initp_num; /* default init sequences */ -static int st7735r_init[] = { --1, 0x01, -2, 150, -1, 0x11, -2, 500, -1, 0xB1, 0x01, 0x2C, 0x2D, -1, 0xB2, 0x01, 0x2C, 0x2D, -1, 0xB3, 0x01, 0x2C, 0x2D, 0x01, 0x2C, 0x2D, --1, 0xB4, 0x07, -1, 0xC0, 0xA2, 0x02, 0x84, -1, 0xC1, 0xC5, -1, 0xC2, 0x0A, 0x00, -1, 0xC3, 0x8A, 0x2A, -1, 0xC4, 0x8A, 0xEE, -1, 0xC5, 0x0E, --1, 0x20, -1, 0x36, 0xC0, -1, 0x3A, 0x05, -1, 0xE0, 0x0f, 0x1a, 0x0f, 0x18, 0x2f, 0x28, 0x20, 0x22, 0x1f, 0x1b, 0x23, 0x37, 0x00, 0x07, 0x02, 0x10, --1, 0xE1, 0x0f, 0x1b, 0x0f, 0x17, 0x33, 0x2c, 0x29, 0x2e, 0x30, 0x30, 0x39, 0x3f, 0x00, 0x07, 0x03, 0x10, -1, 0x29, -2, 100, -1, 0x13, -2, 10, -3 }; - -static int ssd1289_init[] = { --1, 0x00, 0x0001, -1, 0x03, 0xA8A4, -1, 0x0C, 0x0000, -1, 0x0D, 0x080C, -1, 0x0E, 0x2B00, -1, 0x1E, 0x00B7, -1, 0x01, 0x2B3F, -1, 0x02, 0x0600, --1, 0x10, 0x0000, -1, 0x11, 0x6070, -1, 0x05, 0x0000, -1, 0x06, 0x0000, -1, 0x16, 0xEF1C, -1, 0x17, 0x0003, -1, 0x07, 0x0233, -1, 0x0B, 0x0000, --1, 0x0F, 0x0000, -1, 0x41, 0x0000, -1, 0x42, 0x0000, -1, 0x48, 0x0000, -1, 0x49, 0x013F, -1, 0x4A, 0x0000, -1, 0x4B, 0x0000, -1, 0x44, 0xEF00, --1, 0x45, 0x0000, -1, 0x46, 0x013F, -1, 0x30, 0x0707, -1, 0x31, 0x0204, -1, 0x32, 0x0204, -1, 0x33, 0x0502, -1, 0x34, 0x0507, -1, 0x35, 0x0204, --1, 0x36, 0x0204, -1, 0x37, 0x0502, -1, 0x3A, 0x0302, -1, 0x3B, 0x0302, -1, 0x23, 0x0000, -1, 0x24, 0x0000, -1, 0x25, 0x8000, -1, 0x4f, 0x0000, --1, 0x4e, 0x0000, -1, 0x22, -3 }; - -static int hx8340bn_init[] = { --1, 0xC1, 0xFF, 0x83, 0x40, -1, 0x11, -2, 150, -1, 0xCA, 0x70, 0x00, 0xD9, -1, 0xB0, 0x01, 0x11, --1, 0xC9, 0x90, 0x49, 0x10, 0x28, 0x28, 0x10, 0x00, 0x06, -2, 20, -1, 0xC2, 0x60, 0x71, 0x01, 0x0E, 0x05, 0x02, 0x09, 0x31, 0x0A, --1, 0xC3, 0x67, 0x30, 0x61, 0x17, 0x48, 0x07, 0x05, 0x33, -2, 10, -1, 0xB5, 0x35, 0x20, 0x45, -1, 0xB4, 0x33, 0x25, 0x4C, -2, 10, --1, 0x3A, 0x05, -1, 0x29, -2, 10, -3 }; - -static int ili9225_init[] = { --1, 0x0001, 0x011C, -1, 0x0002, 0x0100, -1, 0x0003, 0x1030, -1, 0x0008, 0x0808, -1, 0x000C, 0x0000, -1, 0x000F, 0x0A01, -1, 0x0020, 0x0000, --1, 0x0021, 0x0000, -2, 50, -1, 0x0010, 0x0A00, -1, 0x0011, 0x1038, -2, 50, -1, 0x0012, 0x1121, -1, 0x0013, 0x004E, -1, 0x0014, 0x676F, --1, 0x0030, 0x0000, -1, 0x0031, 0x00DB, -1, 0x0032, 0x0000, -1, 0x0033, 0x0000, -1, 0x0034, 0x00DB, -1, 0x0035, 0x0000, -1, 0x0036, 0x00AF, --1, 0x0037, 0x0000, -1, 0x0038, 0x00DB, -1, 0x0039, 0x0000, -1, 0x0050, 0x0000, -1, 0x0051, 0x060A, -1, 0x0052, 0x0D0A, -1, 0x0053, 0x0303, --1, 0x0054, 0x0A0D, -1, 0x0055, 0x0A06, -1, 0x0056, 0x0000, -1, 0x0057, 0x0303, -1, 0x0058, 0x0000, -1, 0x0059, 0x0000, -2, 50, --1, 0x0007, 0x1017, -2, 50, -3 }; - -static int ili9320_init[] = { --1, 0x00E5, 0x8000, -1, 0x0000, 0x0001, -1, 0x0001, 0x0100, -1, 0x0002, 0x0700, -1, 0x0003, 0x1030, -1, 0x0004, 0x0000, -1, 0x0008, 0x0202, --1, 0x0009, 0x0000, -1, 0x000A, 0x0000, -1, 0x000C, 0x0000, -1, 0x000D, 0x0000, -1, 0x000F, 0x0000, -1, 0x0010, 0x0000, -1, 0x0011, 0x0007, --1, 0x0012, 0x0000, -1, 0x0013, 0x0000, -2, 200, -1, 0x0010, 0x17B0, -1, 0x0011, 0x0031, -2, 50, -1, 0x0012, 0x0138, -2, 50, -1, 0x0013, 0x1800, --1, 0x0029, 0x0008, -2, 50, -1, 0x0020, 0x0000, -1, 0x0021, 0x0000, -1, 0x0030, 0x0000, -1, 0x0031, 0x0505, -1, 0x0032, 0x0004, --1, 0x0035, 0x0006, -1, 0x0036, 0x0707, -1, 0x0037, 0x0105, -1, 0x0038, 0x0002, -1, 0x0039, 0x0707, -1, 0x003C, 0x0704, -1, 0x003D, 0x0807, --1, 0x0050, 0x0000, -1, 0x0051, 0x00EF, -1, 0x0052, 0x0000, -1, 0x0053, 0x013F, -1, 0x0060, 0x2700, -1, 0x0061, 0x0001, -1, 0x006A, 0x0000, --1, 0x0080, 0x0000, -1, 0x0081, 0x0000, -1, 0x0082, 0x0000, -1, 0x0083, 0x0000, -1, 0x0084, 0x0000, -1, 0x0085, 0x0000, -1, 0x0090, 0x0010, --1, 0x0092, 0x0000, -1, 0x0093, 0x0003, -1, 0x0095, 0x0110, -1, 0x0097, 0x0000, -1, 0x0098, 0x0000, -1, 0x0007, 0x0173, -3 }; - -static int ili9325_init[] = { --1, 0x00E3, 0x3008, -1, 0x00E7, 0x0012, -1, 0x00EF, 0x1231, -1, 0x0001, 0x0100, -1, 0x0002, 0x0700, -1, 0x0003, 0x1030, -1, 0x0004, 0x0000, --1, 0x0008, 0x0207, -1, 0x0009, 0x0000, -1, 0x000A, 0x0000, -1, 0x000C, 0x0000, -1, 0x000D, 0x0000, -1, 0x000F, 0x0000, -1, 0x0010, 0x0000, --1, 0x0011, 0x0007, -1, 0x0012, 0x0000, -1, 0x0013, 0x0000, -2, 200, -1, 0x0010, 0x1690, -1, 0x0011, 0x0223, -2, 50, -1, 0x0012, 0x000D, -2, 50, --1, 0x0013, 0x1200, -1, 0x0029, 0x000A, -1, 0x002B, 0x000C, -2, 50, -1, 0x0020, 0x0000, -1, 0x0021, 0x0000, -1, 0x0030, 0x0000, --1, 0x0031, 0x0506, -1, 0x0032, 0x0104, -1, 0x0035, 0x0207, -1, 0x0036, 0x000F, -1, 0x0037, 0x0306, -1, 0x0038, 0x0102, -1, 0x0039, 0x0707, --1, 0x003C, 0x0702, -1, 0x003D, 0x1604, -1, 0x0050, 0x0000, -1, 0x0051, 0x00EF, -1, 0x0052, 0x0000, -1, 0x0053, 0x013F, -1, 0x0060, 0xA700, --1, 0x0061, 0x0001, -1, 0x006A, 0x0000, -1, 0x0080, 0x0000, -1, 0x0081, 0x0000, -1, 0x0082, 0x0000, -1, 0x0083, 0x0000, -1, 0x0084, 0x0000, --1, 0x0085, 0x0000, -1, 0x0090, 0x0010, -1, 0x0092, 0x0600, -1, 0x0007, 0x0133, -3 }; - -static int ili9341_init[] = { --1, 0x28, -2, 20, -1, 0xCF, 0x00, 0x83, 0x30, -1, 0xED, 0x64, 0x03, 0x12, 0x81, -1, 0xE8, 0x85, 0x01, 0x79, --1, 0xCB, 0x39, 0x2c, 0x00, 0x34, 0x02, -1, 0xF7, 0x20, -1, 0xEA, 0x00, 0x00, -1, 0xC0, 0x26, -1, 0xC1, 0x11, --1, 0xC5, 0x35, 0x3E, -1, 0xC7, 0xBE, -1, 0xB1, 0x00, 0x1B, -1, 0xB6, 0x0a, 0x82, 0x27, 0x00, -1, 0xB7, 0x07, --1, 0x3A, 0x55, -1, 0x36, 0x48, -1, 0x11, -2, 120, -1, 0x29, -2, 20, -3 }; - -static int ssd1351_init[] = { -1, 0xfd, 0x12, -1, 0xfd, 0xb1, -1, 0xae, -1, 0xb3, 0xf1, -1, 0xca, 0x7f, -1, 0xa0, 0x74, - -1, 0x15, 0x00, 0x7f, -1, 0x75, 0x00, 0x7f, -1, 0xa1, 0x00, -1, 0xa2, 0x00, -1, 0xb5, 0x00, - -1, 0xab, 0x01, -1, 0xb1, 0x32, -1, 0xb4, 0xa0, 0xb5, 0x55, -1, 0xbb, 0x17, -1, 0xbe, 0x05, - -1, 0xc1, 0xc8, 0x80, 0xc8, -1, 0xc7, 0x0f, -1, 0xb6, 0x01, -1, 0xa6, -1, 0xaf, -3 }; +static s16 st7735r_init[] = { + -1, 0x01, + -2, 150, + -1, 0x11, + -2, 500, + -1, 0xB1, 0x01, 0x2C, 0x2D, + -1, 0xB2, 0x01, 0x2C, 0x2D, + -1, 0xB3, 0x01, 0x2C, 0x2D, 0x01, 0x2C, 0x2D, + -1, 0xB4, 0x07, + -1, 0xC0, 0xA2, 0x02, 0x84, + -1, 0xC1, 0xC5, + -1, 0xC2, 0x0A, 0x00, + -1, 0xC3, 0x8A, 0x2A, + -1, 0xC4, 0x8A, 0xEE, + -1, 0xC5, 0x0E, + -1, 0x20, + -1, 0x36, 0xC0, + -1, 0x3A, 0x05, + -1, 0xE0, 0x0f, 0x1a, 0x0f, 0x18, 0x2f, 0x28, 0x20, 0x22, + 0x1f, 0x1b, 0x23, 0x37, 0x00, 0x07, 0x02, 0x10, + -1, 0xE1, 0x0f, 0x1b, 0x0f, 0x17, 0x33, 0x2c, 0x29, 0x2e, + 0x30, 0x30, 0x39, 0x3f, 0x00, 0x07, 0x03, 0x10, + -1, 0x29, + -2, 100, + -1, 0x13, + -2, 10, + -3 +}; + +static s16 ssd1289_init[] = { + -1, 0x00, 0x0001, + -1, 0x03, 0xA8A4, + -1, 0x0C, 0x0000, + -1, 0x0D, 0x080C, + -1, 0x0E, 0x2B00, + -1, 0x1E, 0x00B7, + -1, 0x01, 0x2B3F, + -1, 0x02, 0x0600, + -1, 0x10, 0x0000, + -1, 0x11, 0x6070, + -1, 0x05, 0x0000, + -1, 0x06, 0x0000, + -1, 0x16, 0xEF1C, + -1, 0x17, 0x0003, + -1, 0x07, 0x0233, + -1, 0x0B, 0x0000, + -1, 0x0F, 0x0000, + -1, 0x41, 0x0000, + -1, 0x42, 0x0000, + -1, 0x48, 0x0000, + -1, 0x49, 0x013F, + -1, 0x4A, 0x0000, + -1, 0x4B, 0x0000, + -1, 0x44, 0xEF00, + -1, 0x45, 0x0000, + -1, 0x46, 0x013F, + -1, 0x30, 0x0707, + -1, 0x31, 0x0204, + -1, 0x32, 0x0204, + -1, 0x33, 0x0502, + -1, 0x34, 0x0507, + -1, 0x35, 0x0204, + -1, 0x36, 0x0204, + -1, 0x37, 0x0502, + -1, 0x3A, 0x0302, + -1, 0x3B, 0x0302, + -1, 0x23, 0x0000, + -1, 0x24, 0x0000, + -1, 0x25, 0x8000, + -1, 0x4f, 0x0000, + -1, 0x4e, 0x0000, + -1, 0x22, + -3 +}; + +static s16 hx8340bn_init[] = { + -1, 0xC1, 0xFF, 0x83, 0x40, + -1, 0x11, + -2, 150, + -1, 0xCA, 0x70, 0x00, 0xD9, + -1, 0xB0, 0x01, 0x11, + -1, 0xC9, 0x90, 0x49, 0x10, 0x28, 0x28, 0x10, 0x00, 0x06, + -2, 20, + -1, 0xC2, 0x60, 0x71, 0x01, 0x0E, 0x05, 0x02, 0x09, 0x31, 0x0A, + -1, 0xC3, 0x67, 0x30, 0x61, 0x17, 0x48, 0x07, 0x05, 0x33, + -2, 10, + -1, 0xB5, 0x35, 0x20, 0x45, + -1, 0xB4, 0x33, 0x25, 0x4C, + -2, 10, + -1, 0x3A, 0x05, + -1, 0x29, + -2, 10, + -3 +}; + +static s16 ili9225_init[] = { + -1, 0x0001, 0x011C, + -1, 0x0002, 0x0100, + -1, 0x0003, 0x1030, + -1, 0x0008, 0x0808, + -1, 0x000C, 0x0000, + -1, 0x000F, 0x0A01, + -1, 0x0020, 0x0000, + -1, 0x0021, 0x0000, + -2, 50, + -1, 0x0010, 0x0A00, + -1, 0x0011, 0x1038, + -2, 50, + -1, 0x0012, 0x1121, + -1, 0x0013, 0x004E, + -1, 0x0014, 0x676F, + -1, 0x0030, 0x0000, + -1, 0x0031, 0x00DB, + -1, 0x0032, 0x0000, + -1, 0x0033, 0x0000, + -1, 0x0034, 0x00DB, + -1, 0x0035, 0x0000, + -1, 0x0036, 0x00AF, + -1, 0x0037, 0x0000, + -1, 0x0038, 0x00DB, + -1, 0x0039, 0x0000, + -1, 0x0050, 0x0000, + -1, 0x0051, 0x060A, + -1, 0x0052, 0x0D0A, + -1, 0x0053, 0x0303, + -1, 0x0054, 0x0A0D, + -1, 0x0055, 0x0A06, + -1, 0x0056, 0x0000, + -1, 0x0057, 0x0303, + -1, 0x0058, 0x0000, + -1, 0x0059, 0x0000, + -2, 50, + -1, 0x0007, 0x1017, + -2, 50, + -3 +}; + +static s16 ili9320_init[] = { + -1, 0x00E5, 0x8000, + -1, 0x0000, 0x0001, + -1, 0x0001, 0x0100, + -1, 0x0002, 0x0700, + -1, 0x0003, 0x1030, + -1, 0x0004, 0x0000, + -1, 0x0008, 0x0202, + -1, 0x0009, 0x0000, + -1, 0x000A, 0x0000, + -1, 0x000C, 0x0000, + -1, 0x000D, 0x0000, + -1, 0x000F, 0x0000, + -1, 0x0010, 0x0000, + -1, 0x0011, 0x0007, + -1, 0x0012, 0x0000, + -1, 0x0013, 0x0000, + -2, 200, + -1, 0x0010, 0x17B0, + -1, 0x0011, 0x0031, + -2, 50, + -1, 0x0012, 0x0138, + -2, 50, + -1, 0x0013, 0x1800, + -1, 0x0029, 0x0008, + -2, 50, + -1, 0x0020, 0x0000, + -1, 0x0021, 0x0000, + -1, 0x0030, 0x0000, + -1, 0x0031, 0x0505, + -1, 0x0032, 0x0004, + -1, 0x0035, 0x0006, + -1, 0x0036, 0x0707, + -1, 0x0037, 0x0105, + -1, 0x0038, 0x0002, + -1, 0x0039, 0x0707, + -1, 0x003C, 0x0704, + -1, 0x003D, 0x0807, + -1, 0x0050, 0x0000, + -1, 0x0051, 0x00EF, + -1, 0x0052, 0x0000, + -1, 0x0053, 0x013F, + -1, 0x0060, 0x2700, + -1, 0x0061, 0x0001, + -1, 0x006A, 0x0000, + -1, 0x0080, 0x0000, + -1, 0x0081, 0x0000, + -1, 0x0082, 0x0000, + -1, 0x0083, 0x0000, + -1, 0x0084, 0x0000, + -1, 0x0085, 0x0000, + -1, 0x0090, 0x0010, + -1, 0x0092, 0x0000, + -1, 0x0093, 0x0003, + -1, 0x0095, 0x0110, + -1, 0x0097, 0x0000, + -1, 0x0098, 0x0000, + -1, 0x0007, 0x0173, + -3 +}; + +static s16 ili9325_init[] = { + -1, 0x00E3, 0x3008, + -1, 0x00E7, 0x0012, + -1, 0x00EF, 0x1231, + -1, 0x0001, 0x0100, + -1, 0x0002, 0x0700, + -1, 0x0003, 0x1030, + -1, 0x0004, 0x0000, + -1, 0x0008, 0x0207, + -1, 0x0009, 0x0000, + -1, 0x000A, 0x0000, + -1, 0x000C, 0x0000, + -1, 0x000D, 0x0000, + -1, 0x000F, 0x0000, + -1, 0x0010, 0x0000, + -1, 0x0011, 0x0007, + -1, 0x0012, 0x0000, + -1, 0x0013, 0x0000, + -2, 200, + -1, 0x0010, 0x1690, + -1, 0x0011, 0x0223, + -2, 50, + -1, 0x0012, 0x000D, + -2, 50, + -1, 0x0013, 0x1200, + -1, 0x0029, 0x000A, + -1, 0x002B, 0x000C, + -2, 50, + -1, 0x0020, 0x0000, + -1, 0x0021, 0x0000, + -1, 0x0030, 0x0000, + -1, 0x0031, 0x0506, + -1, 0x0032, 0x0104, + -1, 0x0035, 0x0207, + -1, 0x0036, 0x000F, + -1, 0x0037, 0x0306, + -1, 0x0038, 0x0102, + -1, 0x0039, 0x0707, + -1, 0x003C, 0x0702, + -1, 0x003D, 0x1604, + -1, 0x0050, 0x0000, + -1, 0x0051, 0x00EF, + -1, 0x0052, 0x0000, + -1, 0x0053, 0x013F, + -1, 0x0060, 0xA700, + -1, 0x0061, 0x0001, + -1, 0x006A, 0x0000, + -1, 0x0080, 0x0000, + -1, 0x0081, 0x0000, + -1, 0x0082, 0x0000, + -1, 0x0083, 0x0000, + -1, 0x0084, 0x0000, + -1, 0x0085, 0x0000, + -1, 0x0090, 0x0010, + -1, 0x0092, 0x0600, + -1, 0x0007, 0x0133, + -3 +}; + +static s16 ili9341_init[] = { + -1, 0x28, + -2, 20, + -1, 0xCF, 0x00, 0x83, 0x30, + -1, 0xED, 0x64, 0x03, 0x12, 0x81, + -1, 0xE8, 0x85, 0x01, 0x79, + -1, 0xCB, 0x39, 0x2c, 0x00, 0x34, 0x02, + -1, 0xF7, 0x20, + -1, 0xEA, 0x00, 0x00, + -1, 0xC0, 0x26, + -1, 0xC1, 0x11, + -1, 0xC5, 0x35, 0x3E, + -1, 0xC7, 0xBE, + -1, 0xB1, 0x00, 0x1B, + -1, 0xB6, 0x0a, 0x82, 0x27, 0x00, + -1, 0xB7, 0x07, + -1, 0x3A, 0x55, + -1, 0x36, 0x48, + -1, 0x11, + -2, 120, + -1, 0x29, + -2, 20, + -3 +}; + +static s16 ssd1351_init[] = { + -1, 0xfd, 0x12, + -1, 0xfd, 0xb1, + -1, 0xae, + -1, 0xb3, 0xf1, + -1, 0xca, 0x7f, + -1, 0xa0, 0x74, + -1, 0x15, 0x00, 0x7f, + -1, 0x75, 0x00, 0x7f, + -1, 0xa1, 0x00, + -1, 0xa2, 0x00, + -1, 0xb5, 0x00, + -1, 0xab, 0x01, + -1, 0xb1, 0x32, + -1, 0xb4, 0xa0, 0xb5, 0x55, + -1, 0xbb, 0x17, + -1, 0xbe, 0x05, + -1, 0xc1, 0xc8, 0x80, 0xc8, + -1, 0xc7, 0x0f, + -1, 0xb6, 0x01, + -1, 0xa6, + -1, 0xaf, + -3 +}; /** * struct flexfb_lcd_controller - Describes the LCD controller properties @@ -142,7 +390,7 @@ struct flexfb_lcd_controller { unsigned int height; unsigned int setaddrwin; unsigned int regwidth; - int *init_seq; + s16 *init_seq; int init_seq_sz; }; @@ -582,6 +830,7 @@ static const struct platform_device_id flexfb_platform_ids[] = { { "flexpfb", 0 }, { }, }; +MODULE_DEVICE_TABLE(platform, flexfb_platform_ids); static struct platform_driver flexfb_platform_driver = { .driver = { |