Skip to content

Commit

Permalink
beaglebone: hack in support for the WIP st7735fb driver
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Porter <mporter@ti.com>
  • Loading branch information
Matt Porter committed Nov 21, 2011
1 parent 950b257 commit 8252703
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions arch/arm/mach-omap2/board-am335xevm.c
Expand Up @@ -49,6 +49,7 @@

/* LCD controller is similar to DA850 */
#include <video/da8xx-fb.h>
#include <video/st7735fb.h>

#include "board-flash.h"
#include "mux.h"
Expand Down Expand Up @@ -916,6 +917,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);
Expand Down Expand Up @@ -1090,6 +1108,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)
{
Expand Down Expand Up @@ -1230,6 +1256,8 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = {
{usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
/* HACK ALERT */
{bone_spi1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{NULL, 0, 0},
};

Expand Down

1 comment on commit 8252703

@ohporter
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enables the st7735fb for the AdaFruit TFT 1.8" LCD (http://www.adafruit.com/products/358) on a BeagleBone.

On BeagleBone P9 connector attached the following pins to these LCD pins:

P9 Gnd - LCD Gnd
P9 Vcc 3.3V - LCD Vcc
P9 GPIO_3_19 - LCD RESET
P9 GPIO_3_32 - LCD D/C
P9 SPI1_CS0 - LCD TFT_CS
P9 SPI1_D1 - LCD MOSI
P9 SPI1_SCLK - LCD SCK
P9 Vcc 3.3V - LCD BL

By pin number (LCD number is left to right with GND being pin 1), this is:

P9 LCD
1 1
3 2
27 3
25 4
NC 5
28 6
30 7
31 8
NC 9
3 10

Please sign in to comment.