linux-ti335x-psp 3.1: add support for ST7735FB, but don't enable it in the beaglebone...
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.1 / st7735fb / 0002-beaglebone-hack-in-support-for-the-WIP-st7735fb-driv.patch
1 From dd3f24640c209d8186010dbf2bbabe11f3eb52ce Mon Sep 17 00:00:00 2001
2 From: Matt Porter <mporter@ti.com>
3 Date: Mon, 21 Nov 2011 12:56:52 -0500
4 Subject: [PATCH 2/2] beaglebone: hack in support for the WIP st7735fb driver
6 Signed-off-by: Matt Porter <mporter@ti.com>
7 ---
8  arch/arm/mach-omap2/board-am335xevm.c |   28 ++++++++++++++++++++++++++++
9  1 files changed, 28 insertions(+), 0 deletions(-)
11 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
12 index b27fb97..f049aad 100644
13 --- a/arch/arm/mach-omap2/board-am335xevm.c
14 +++ b/arch/arm/mach-omap2/board-am335xevm.c
15 @@ -51,6 +51,7 @@
16  
17  /* LCD controller is similar to DA850 */
18  #include <video/da8xx-fb.h>
19 +#include <video/st7735fb.h>
20  
21  #include "control.h"
22  #include "board-flash.h"
23 @@ -1094,6 +1095,23 @@ static struct spi_board_info am335x_spi1_slave_info[] = {
24         },
25  };
26  
27 +static const struct st7735fb_platform_data bone_st7735fb_data = {
28 +       .rst_gpio       = GPIO_TO_PIN(3, 19),
29 +       .dc_gpio        = GPIO_TO_PIN(3, 21),
30 +};
31 +
32 +static struct spi_board_info bone_spi1_slave_info[] = {
33 +       {
34 +               .modalias      = "adafruit_tft18",
35 +               .platform_data  = &bone_st7735fb_data,
36 +               .irq           = -1,
37 +               .max_speed_hz  = 8000000,
38 +               .bus_num       = 2,
39 +               .chip_select   = 0,
40 +               .mode          = SPI_MODE_3,
41 +       },
42 +};
43 +
44  static void evm_nand_init(int evm_id, int profile)
45  {
46         setup_pin_mux(nand_pin_mux);
47 @@ -1410,6 +1428,14 @@ static void spi1_init(int evm_id, int profile)
48         return;
49  }
50  
51 +/* setup bone spi1 */
52 +static void bone_spi1_init(int evm_id, int profile)
53 +{
54 +       setup_pin_mux(spi1_pin_mux);
55 +       spi_register_board_info(bone_spi1_slave_info,
56 +                       ARRAY_SIZE(bone_spi1_slave_info));
57 +       return;
58 +}
59  
60  static int beaglebone_phy_fixup(struct phy_device *phydev)
61  {
62 @@ -1567,6 +1593,8 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = {
63         {i2c2_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
64         {mmc0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
65         {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
66 +       /* HACK ALERT */
67 +       {bone_spi1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
68         {NULL, 0, 0},
69  };
70  
71 -- 
72 1.7.2.5