diff options
author | Priit Laes <plaes@plaes.org> | 2015-12-20 21:35:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-08 06:39:27 +0300 |
commit | fbf461d176c5ee0e4889dc826a79a245f32426f7 (patch) | |
tree | 563a107b7919d20f0f4bc8e40e011d18098b6881 /drivers/staging/fbtft | |
parent | fd59f106f431e1a9ffc77ec0bbe7032249998699 (diff) | |
download | linux-fbf461d176c5ee0e4889dc826a79a245f32426f7.tar.xz |
staging: fbtft: Use standard MIPI DCS command defines for hx8353d
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>
Diffstat (limited to 'drivers/staging/fbtft')
-rw-r--r-- | drivers/staging/fbtft/fb_hx8353d.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/staging/fbtft/fb_hx8353d.c b/drivers/staging/fbtft/fb_hx8353d.c index 8552411695fa..064ae61a86b2 100644 --- a/drivers/staging/fbtft/fb_hx8353d.c +++ b/drivers/staging/fbtft/fb_hx8353d.c @@ -19,6 +19,7 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/delay.h> +#include <video/mipi_display.h> #include "fbtft.h" @@ -47,17 +48,17 @@ static int init_display(struct fbtft_par *par) write_reg(par, 0x3A, 0x05); /* MEM ACCESS */ - write_reg(par, 0x36, 0xC0); + write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, 0xC0); /* SLPOUT - Sleep out & booster on */ - write_reg(par, 0x11); + write_reg(par, MIPI_DCS_EXIT_SLEEP_MODE); mdelay(150); /* DISPON - Display On */ - write_reg(par, 0x29); + write_reg(par, MIPI_DCS_SET_DISPLAY_ON); /* RGBSET */ - write_reg(par, 0x2D, + write_reg(par, MIPI_DCS_WRITE_LUT, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -95,16 +96,20 @@ static int set_var(struct fbtft_par *par) rgb-bgr order color filter panel: 0=rgb, 1=bgr */ switch (par->info->var.rotate) { case 0: - write_reg(par, 0x36, mx | my | (par->bgr << 3)); + write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, + mx | my | (par->bgr << 3)); break; case 270: - write_reg(par, 0x36, my | mv | (par->bgr << 3)); + write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, + my | mv | (par->bgr << 3)); break; case 180: - write_reg(par, 0x36, par->bgr << 3); + write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, + par->bgr << 3); break; case 90: - write_reg(par, 0x36, mx | mv | (par->bgr << 3)); + write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, + mx | mv | (par->bgr << 3)); break; } |