aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-pxa/cm-x300.c60
1 files changed, 57 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 07d7473344b7..ecee7e829110 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -26,6 +26,10 @@
26#include <linux/i2c.h> 26#include <linux/i2c.h>
27#include <linux/i2c/pca953x.h> 27#include <linux/i2c/pca953x.h>
28 28
29#include <linux/spi/spi.h>
30#include <linux/spi/spi_gpio.h>
31#include <linux/spi/tdo24m.h>
32
29#include <asm/mach-types.h> 33#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
31#include <asm/setup.h> 35#include <asm/setup.h>
@@ -208,17 +212,18 @@ static void __init cm_x300_init_dm9000(void)
208static inline void cm_x300_init_dm9000(void) {} 212static inline void cm_x300_init_dm9000(void) {}
209#endif 213#endif
210 214
215/* LCD */
211#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) 216#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
212static struct pxafb_mode_info cm_x300_lcd_modes[] = { 217static struct pxafb_mode_info cm_x300_lcd_modes[] = {
213 [0] = { 218 [0] = {
214 .pixclock = 38000, 219 .pixclock = 38250,
215 .bpp = 16, 220 .bpp = 16,
216 .xres = 480, 221 .xres = 480,
217 .yres = 640, 222 .yres = 640,
218 .hsync_len = 8, 223 .hsync_len = 8,
219 .vsync_len = 2, 224 .vsync_len = 2,
220 .left_margin = 8, 225 .left_margin = 8,
221 .upper_margin = 0, 226 .upper_margin = 2,
222 .right_margin = 24, 227 .right_margin = 24,
223 .lower_margin = 4, 228 .lower_margin = 4,
224 .cmap_greyscale = 0, 229 .cmap_greyscale = 0,
@@ -240,7 +245,7 @@ static struct pxafb_mode_info cm_x300_lcd_modes[] = {
240 245
241static struct pxafb_mach_info cm_x300_lcd = { 246static struct pxafb_mach_info cm_x300_lcd = {
242 .modes = cm_x300_lcd_modes, 247 .modes = cm_x300_lcd_modes,
243 .num_modes = 2, 248 .num_modes = ARRAY_SIZE(cm_x300_lcd_modes),
244 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, 249 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
245}; 250};
246 251
@@ -252,6 +257,54 @@ static void __init cm_x300_init_lcd(void)
252static inline void cm_x300_init_lcd(void) {} 257static inline void cm_x300_init_lcd(void) {}
253#endif 258#endif
254 259
260#if defined(CONFIG_SPI_GPIO) || defined(CONFIG_SPI_GPIO_MODULE)
261#define GPIO_LCD_BASE (144)
262#define GPIO_LCD_DIN (GPIO_LCD_BASE + 8) /* aux_gpio3_0 */
263#define GPIO_LCD_DOUT (GPIO_LCD_BASE + 9) /* aux_gpio3_1 */
264#define GPIO_LCD_SCL (GPIO_LCD_BASE + 10) /* aux_gpio3_2 */
265#define GPIO_LCD_CS (GPIO_LCD_BASE + 11) /* aux_gpio3_3 */
266#define LCD_SPI_BUS_NUM (1)
267
268static struct spi_gpio_platform_data cm_x300_spi_gpio_pdata = {
269 .sck = GPIO_LCD_SCL,
270 .mosi = GPIO_LCD_DIN,
271 .miso = GPIO_LCD_DOUT,
272 .num_chipselect = 1,
273};
274
275static struct platform_device cm_x300_spi_gpio = {
276 .name = "spi_gpio",
277 .id = LCD_SPI_BUS_NUM,
278 .dev = {
279 .platform_data = &cm_x300_spi_gpio_pdata,
280 },
281};
282
283static struct tdo24m_platform_data cm_x300_tdo24m_pdata = {
284 .model = TDO35S,
285};
286
287static struct spi_board_info cm_x300_spi_devices[] __initdata = {
288 {
289 .modalias = "tdo24m",
290 .max_speed_hz = 1000000,
291 .bus_num = LCD_SPI_BUS_NUM,
292 .chip_select = 0,
293 .controller_data = (void *) GPIO_LCD_CS,
294 .platform_data = &cm_x300_tdo24m_pdata,
295 },
296};
297
298static void __init cm_x300_init_spi(void)
299{
300 spi_register_board_info(cm_x300_spi_devices,
301 ARRAY_SIZE(cm_x300_spi_devices));
302 platform_device_register(&cm_x300_spi_gpio);
303}
304#else
305static inline void cm_x300_init_spi(void) {}
306#endif
307
255#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) 308#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE)
256static struct mtd_partition cm_x300_nand_partitions[] = { 309static struct mtd_partition cm_x300_nand_partitions[] = {
257 [0] = { 310 [0] = {
@@ -476,6 +529,7 @@ static void __init cm_x300_init(void)
476 cm_x300_init_nand(); 529 cm_x300_init_nand();
477 cm_x300_init_leds(); 530 cm_x300_init_leds();
478 cm_x300_init_i2c(); 531 cm_x300_init_i2c();
532 cm_x300_init_spi();
479 cm_x300_init_rtc(); 533 cm_x300_init_rtc();
480} 534}
481 535