summaryrefslogtreecommitdiff
path: root/drivers/staging/fbtft/fbtft-core.c
diff options
context:
space:
mode:
authorPriit Laes <plaes@plaes.org>2015-12-20 20:36:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 19:39:27 -0800
commita79cb3901ee3e0236a54c461e5a0a9703db28a14 (patch)
treeae9b23c7d36794025f006126398b73536a326c4d /drivers/staging/fbtft/fbtft-core.c
parent79f5da7d33a0b3b874601edd0ff58affbc76421a (diff)
staging: fbtft: Use standard MIPI DCS command defines for fbtft driver
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/fbtft-core.c')
-rw-r--r--drivers/staging/fbtft/fbtft-core.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index 6824d5ff2d8c..3bcbabf26dbe 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -35,6 +35,7 @@
#include <linux/dma-mapping.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
+#include <video/mipi_display.h>
#include "fbtft.h"
#include "internal.h"
@@ -319,16 +320,13 @@ EXPORT_SYMBOL(fbtft_unregister_backlight);
static void fbtft_set_addr_win(struct fbtft_par *par, int xs, int ys, int xe,
int ye)
{
- /* Column address set */
- write_reg(par, 0x2A,
- (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF);
+ write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
+ (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF);
- /* Row address set */
- write_reg(par, 0x2B,
- (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF);
+ write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
+ (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF);
- /* Memory write */
- write_reg(par, 0x2C);
+ write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
}
static void fbtft_reset(struct fbtft_par *par)