commit 1b0af7c203296a5f8da01f7b689e5e8d3e2c8770
Author: sachin <sachins@hobbyist.co.nz>
Date:   Fri Oct 14 08:46:47 2016 +1300

    Add support for ili9488 LCD display

diff --git a/drivers/staging/fbtft/Kconfig b/drivers/staging/fbtft/Kconfig
index 883ff5b..f1c41ec 100644
--- a/drivers/staging/fbtft/Kconfig
+++ b/drivers/staging/fbtft/Kconfig
@@ -87,6 +87,12 @@ config FB_TFT_ILI9486
 	help
 	  Generic Framebuffer support for ILI9486
 
+config FB_TFT_ILI9488
+	tristate "FB driver for the ILI9488 LCD Controller"
+	depends on FB_TFT
+	help
+	  Generic Framebuffer support for ILI9488
+
 config FB_TFT_PCD8544
 	tristate "FB driver for the PCD8544 LCD Controller"
 	depends on FB_TFT
diff --git a/drivers/staging/fbtft/Makefile b/drivers/staging/fbtft/Makefile
index 4f9071d..61b420c 100644
--- a/drivers/staging/fbtft/Makefile
+++ b/drivers/staging/fbtft/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_FB_TFT_ILI9340)     += fb_ili9340.o
 obj-$(CONFIG_FB_TFT_ILI9341)     += fb_ili9341.o
 obj-$(CONFIG_FB_TFT_ILI9481)     += fb_ili9481.o
 obj-$(CONFIG_FB_TFT_ILI9486)     += fb_ili9486.o
+obj-$(CONFIG_FB_TFT_ILI9488)     += fb_ili9488.o
 obj-$(CONFIG_FB_TFT_PCD8544)     += fb_pcd8544.o
 obj-$(CONFIG_FB_TFT_RA8875)      += fb_ra8875.o
 obj-$(CONFIG_FB_TFT_S6D02A1)     += fb_s6d02a1.o
diff --git a/drivers/staging/fbtft/fb_ili9488.c b/drivers/staging/fbtft/fb_ili9488.c
new file mode 100644
index 0000000..6ae9495
--- /dev/null
+++ b/drivers/staging/fbtft/fb_ili9488.c
@@ -0,0 +1,175 @@
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/gpio.h>
+#include <linux/spi/spi.h>
+#include <linux/delay.h>
+#include "fbtft.h"
+#if defined(CONFIG_ARCH_BCM2709) || defined (CONFIG_ARCH_BCM2708)
+#include <mach/platform.h>
+#endif
+
+#define BYPASS_GPIOLIB /* Speed up gpio access by directly writing to io address */
+
+#define DRVNAME		"fb_ili9488"
+#define WIDTH	    320
+#define HEIGHT	    480
+
+
+
+#ifdef BYPASS_GPIOLIB
+#define GPIOSET(no, ishigh)           \
+do {                                  \
+	if (ishigh)                   \
+		set |= (1 << (no));   \
+	else                          \
+		reset |= (1 << (no)); \
+} while (0)
+#endif
+
+static int init_display_ili9488(struct fbtft_par *par)
+{
+
+	fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__);
+
+	par->fbtftops.reset(par);
+
+	if (par->gpio.cs != -1)
+		gpio_set_value(par->gpio.cs, 0);  /* Activate chip */
+
+	/* Interface Mode Control */
+	write_reg(par, 0xe9, 0x20);
+
+	/* Sleep OUT  */
+	write_reg(par, 0x11);
+
+	mdelay(100);
+
+	/* Pixel Format */
+	write_reg(par, 0x36, 0x48);
+
+	/* 16 bit pixels  */
+	write_reg(par, 0x3a, 0x05);
+
+	/* Display mode */
+	write_reg(par, 0x13);
+
+	/* Gamma control  */
+	write_reg(par, 0xc0, 0x08, 0x01);
+
+	/* CABC control 2 */
+	write_reg(par, 0xc8, 0xb0);
+
+
+	/* DISPON - Display On */
+	write_reg(par, 0x29);
+
+	return 0;
+}
+
+/*
+ * Option to use direct gpio access to speed up display refresh
+ */
+static int fbtft_ili9488_write_gpio8_wr(struct fbtft_par *par, void *buf, size_t len)
+{
+	u8 data;
+	static u8 prev_data = 0xff;
+#ifdef BYPASS_GPIOLIB
+	unsigned int set = 0;
+	unsigned int reset = 0;
+#else
+	int i;
+#endif
+
+	fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len,
+		"%s(len=%d): ", __func__, len);
+#ifdef BYPASS_GPIOLIB
+	while (len--) {
+		data = *(u8 *) buf;
+
+		if (data != prev_data)
+		{
+			/* Set data */
+			GPIOSET(par->gpio.db[0], (data&0x01));
+			GPIOSET(par->gpio.db[1], (data&0x02));
+			GPIOSET(par->gpio.db[2], (data&0x04));
+			GPIOSET(par->gpio.db[3], (data&0x08));
+			GPIOSET(par->gpio.db[4], (data&0x10));
+			GPIOSET(par->gpio.db[5], (data&0x20));
+			GPIOSET(par->gpio.db[6], (data&0x40));
+			GPIOSET(par->gpio.db[7], (data&0x80));
+			writel(set, __io_address(GPIO_BASE+0x1C));
+			writel(reset, __io_address(GPIO_BASE+0x28));
+		}
+
+		/* Pulse /WR low */
+		writel((1<<par->gpio.wr),  __io_address(GPIO_BASE+0x28));
+		writel(0,  __io_address(GPIO_BASE+0x28)); /* used as a delay */
+		writel((1<<par->gpio.wr),  __io_address(GPIO_BASE+0x1C));
+
+		set = 0;
+		reset = 0;
+		prev_data = data;
+		buf++;
+
+	}
+#else
+	while (len--) {
+		data = *(u8 *) buf;
+
+		/* Start writing by pulling down /WR */
+		gpio_set_value(par->gpio.wr, 0);
+
+		/* Set data */
+#ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO
+		if (data == prev_data) {
+			gpio_set_value(par->gpio.wr, 0); /* used as delay */
+		} else {
+			for (i = 0; i < 8; i++) {
+				if ((data & 1) != (prev_data & 1))
+					gpio_set_value(par->gpio.db[i],
+								data & 1);
+				data >>= 1;
+				prev_data >>= 1;
+			}
+		}
+#else
+		for (i = 0; i < 8; i++) {
+			gpio_set_value(par->gpio.db[i], data & 1);
+			data >>= 1;
+		}
+#endif
+
+		/* Pullup /WR */
+		gpio_set_value(par->gpio.wr, 1);
+
+#ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO
+		prev_data = *(u8 *) buf;
+#endif
+		buf++;
+	}
+#endif
+
+	return 0;
+}
+
+static struct fbtft_display display = {
+	.regwidth = 8,
+	.width = WIDTH,
+	.height = HEIGHT,
+	/*.init_sequence = default_init_sequence,*/
+	.fbtftops = {
+		.init_display = init_display_ili9488,
+		.write = fbtft_ili9488_write_gpio8_wr,
+	},
+};
+
+FBTFT_REGISTER_DRIVER(DRVNAME, "mcufriend,ili9488", &display);
+
+MODULE_ALIAS("platform:" DRVNAME);
+MODULE_ALIAS("platform:ili9488");
+
+MODULE_DESCRIPTION("ILI9488 TFT Driver");
+MODULE_AUTHOR("Sachin Surendran");
+MODULE_LICENSE("GPL");
+
diff --git a/drivers/staging/fbtft/fbtft_device.c b/drivers/staging/fbtft/fbtft_device.c
index 071f79b..e74e812 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -640,6 +640,35 @@ static struct fbtft_device_display displays[] = {
 			}
 		}
 	}, {
+		.name = "mcufriend_ili9488",
+		.pdev = &(struct platform_device) {
+			.name = "fb_ili9488",
+			.id = 0,
+			.dev = {
+			.release = fbtft_device_pdev_release,
+			.platform_data = &(struct fbtft_platform_data) {
+				.display = {
+					.buswidth = 8,
+				},
+				.gpios = (const struct fbtft_gpio []) {
+					{ "reset", 7 },
+					{ "dc", 18 },
+					{ "wr", 17 },
+					{ "cs", 4 },
+					{ "db00", 22 },
+					{ "db01", 23 },
+					{ "db02", 24 },
+					{ "db03", 10 },
+					{ "db04", 25 },
+					{ "db05", 9 },
+					{ "db06", 11 },
+					{ "db07", 8 },
+					{},
+				},
+			},
+			}
+		}
+	}, {
 		.name = "itdb24",
 		.pdev = &(struct platform_device) {
 			.name = "fb_s6d1121",
