diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-overo.c')
-rw-r--r-- | arch/arm/mach-omap2/board-overo.c | 72 |
1 files changed, 70 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 82b3dc557c96..b3f6e9d81807 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -37,20 +37,85 @@ | |||
37 | #include <asm/mach/flash.h> | 37 | #include <asm/mach/flash.h> |
38 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
39 | 39 | ||
40 | #include <mach/board-overo.h> | ||
41 | #include <mach/board.h> | 40 | #include <mach/board.h> |
42 | #include <mach/common.h> | 41 | #include <mach/common.h> |
43 | #include <mach/gpio.h> | 42 | #include <mach/gpio.h> |
44 | #include <mach/gpmc.h> | 43 | #include <mach/gpmc.h> |
45 | #include <mach/hardware.h> | 44 | #include <mach/hardware.h> |
46 | #include <mach/nand.h> | 45 | #include <mach/nand.h> |
46 | #include <mach/usb.h> | ||
47 | 47 | ||
48 | #include "mmc-twl4030.h" | 48 | #include "mmc-twl4030.h" |
49 | 49 | ||
50 | #define OVERO_GPIO_BT_XGATE 15 | ||
51 | #define OVERO_GPIO_W2W_NRESET 16 | ||
52 | #define OVERO_GPIO_BT_NRESET 164 | ||
53 | #define OVERO_GPIO_USBH_CPEN 168 | ||
54 | #define OVERO_GPIO_USBH_NRESET 183 | ||
55 | |||
50 | #define NAND_BLOCK_SIZE SZ_128K | 56 | #define NAND_BLOCK_SIZE SZ_128K |
51 | #define GPMC_CS0_BASE 0x60 | 57 | #define GPMC_CS0_BASE 0x60 |
52 | #define GPMC_CS_SIZE 0x30 | 58 | #define GPMC_CS_SIZE 0x30 |
53 | 59 | ||
60 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ | ||
61 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | ||
62 | |||
63 | #include <mach/mcspi.h> | ||
64 | #include <linux/spi/spi.h> | ||
65 | #include <linux/spi/ads7846.h> | ||
66 | |||
67 | static struct omap2_mcspi_device_config ads7846_mcspi_config = { | ||
68 | .turbo_mode = 0, | ||
69 | .single_channel = 1, /* 0: slave, 1: master */ | ||
70 | }; | ||
71 | |||
72 | static int ads7846_get_pendown_state(void) | ||
73 | { | ||
74 | return !gpio_get_value(OVERO_GPIO_PENDOWN); | ||
75 | } | ||
76 | |||
77 | static struct ads7846_platform_data ads7846_config = { | ||
78 | .x_max = 0x0fff, | ||
79 | .y_max = 0x0fff, | ||
80 | .x_plate_ohms = 180, | ||
81 | .pressure_max = 255, | ||
82 | .debounce_max = 10, | ||
83 | .debounce_tol = 3, | ||
84 | .debounce_rep = 1, | ||
85 | .get_pendown_state = ads7846_get_pendown_state, | ||
86 | .keep_vref_on = 1, | ||
87 | }; | ||
88 | |||
89 | static struct spi_board_info overo_spi_board_info[] __initdata = { | ||
90 | { | ||
91 | .modalias = "ads7846", | ||
92 | .bus_num = 1, | ||
93 | .chip_select = 0, | ||
94 | .max_speed_hz = 1500000, | ||
95 | .controller_data = &ads7846_mcspi_config, | ||
96 | .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN), | ||
97 | .platform_data = &ads7846_config, | ||
98 | } | ||
99 | }; | ||
100 | |||
101 | static void __init overo_ads7846_init(void) | ||
102 | { | ||
103 | if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) && | ||
104 | (gpio_direction_input(OVERO_GPIO_PENDOWN) == 0)) { | ||
105 | gpio_export(OVERO_GPIO_PENDOWN, 0); | ||
106 | } else { | ||
107 | printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n"); | ||
108 | return; | ||
109 | } | ||
110 | |||
111 | spi_register_board_info(overo_spi_board_info, | ||
112 | ARRAY_SIZE(overo_spi_board_info)); | ||
113 | } | ||
114 | |||
115 | #else | ||
116 | static inline void __init overo_ads7846_init(void) { return; } | ||
117 | #endif | ||
118 | |||
54 | static struct mtd_partition overo_nand_partitions[] = { | 119 | static struct mtd_partition overo_nand_partitions[] = { |
55 | { | 120 | { |
56 | .name = "xloader", | 121 | .name = "xloader", |
@@ -174,7 +239,7 @@ static int __init overo_i2c_init(void) | |||
174 | 239 | ||
175 | static void __init overo_init_irq(void) | 240 | static void __init overo_init_irq(void) |
176 | { | 241 | { |
177 | omap2_init_common_hw(); | 242 | omap2_init_common_hw(NULL); |
178 | omap_init_irq(); | 243 | omap_init_irq(); |
179 | omap_gpio_init(); | 244 | omap_gpio_init(); |
180 | } | 245 | } |
@@ -209,6 +274,7 @@ static struct twl4030_hsmmc_info mmc[] __initdata = { | |||
209 | .wires = 4, | 274 | .wires = 4, |
210 | .gpio_cd = -EINVAL, | 275 | .gpio_cd = -EINVAL, |
211 | .gpio_wp = -EINVAL, | 276 | .gpio_wp = -EINVAL, |
277 | .transceiver = true, | ||
212 | }, | 278 | }, |
213 | {} /* Terminator */ | 279 | {} /* Terminator */ |
214 | }; | 280 | }; |
@@ -222,6 +288,8 @@ static void __init overo_init(void) | |||
222 | omap_serial_init(); | 288 | omap_serial_init(); |
223 | twl4030_mmc_init(mmc); | 289 | twl4030_mmc_init(mmc); |
224 | overo_flash_init(); | 290 | overo_flash_init(); |
291 | usb_musb_init(); | ||
292 | overo_ads7846_init(); | ||
225 | 293 | ||
226 | if ((gpio_request(OVERO_GPIO_W2W_NRESET, | 294 | if ((gpio_request(OVERO_GPIO_W2W_NRESET, |
227 | "OVERO_GPIO_W2W_NRESET") == 0) && | 295 | "OVERO_GPIO_W2W_NRESET") == 0) && |