From dd3f24640c209d8186010dbf2bbabe11f3eb52ce Mon Sep 17 00:00:00 2001
From: Matt Porter <mporter@ti.com>
Date: Mon, 21 Nov 2011 12:56:52 -0500
Subject: [PATCH 2/2] beaglebone: hack in support for the WIP st7735fb driver

Signed-off-by: Matt Porter <mporter@ti.com>
---
 arch/arm/mach-omap2/board-am335xevm.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
index b27fb97..f049aad 100644
--- a/arch/arm/mach-omap2/board-am335xevm.c
+++ b/arch/arm/mach-omap2/board-am335xevm.c
@@ -51,6 +51,7 @@
 
 /* LCD controller is similar to DA850 */
 #include <video/da8xx-fb.h>
+#include <video/st7735fb.h>
 
 #include "control.h"
 #include "board-flash.h"
@@ -1094,6 +1095,23 @@ static struct spi_board_info am335x_spi1_slave_info[] = {
 	},
 };
 
+static const struct st7735fb_platform_data bone_st7735fb_data = {
+	.rst_gpio	= GPIO_TO_PIN(3, 19),
+	.dc_gpio	= GPIO_TO_PIN(3, 21),
+};
+
+static struct spi_board_info bone_spi1_slave_info[] = {
+	{
+		.modalias      = "adafruit_tft18",
+		.platform_data	= &bone_st7735fb_data,
+		.irq           = -1,
+		.max_speed_hz  = 8000000,
+		.bus_num       = 2,
+		.chip_select   = 0,
+		.mode          = SPI_MODE_3,
+	},
+};
+
 static void evm_nand_init(int evm_id, int profile)
 {
 	setup_pin_mux(nand_pin_mux);
@@ -1410,6 +1428,14 @@ static void spi1_init(int evm_id, int profile)
 	return;
 }
 
+/* setup bone spi1 */
+static void bone_spi1_init(int evm_id, int profile)
+{
+	setup_pin_mux(spi1_pin_mux);
+	spi_register_board_info(bone_spi1_slave_info,
+			ARRAY_SIZE(bone_spi1_slave_info));
+	return;
+}
 
 static int beaglebone_phy_fixup(struct phy_device *phydev)
 {
@@ -1567,6 +1593,8 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = {
 	{i2c2_init,	DEV_ON_BASEBOARD, PROFILE_NONE},
 	{mmc0_init,	DEV_ON_BASEBOARD, PROFILE_NONE},
 	{boneleds_init,	DEV_ON_BASEBOARD, PROFILE_ALL},
+	/* HACK ALERT */
+	{bone_spi1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
 	{NULL, 0, 0},
 };
 
-- 
1.7.2.5

