X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=arch%2Farm%2Fmach-omap2%2Fboard-2430sdp.c;h=ebd26304f755e558123f996de82c044a7f5a8c4e;hb=ea589e4a5070c6c7fdacd43d66987d53b5d45152;hp=77e77c1a028f76c6d5be85b15ed80e96b2021329;hpb=ea0c7469605c5c3878be9449ea8d956e183987e5;p=linux-2.6-omap-h63xx.git diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 77e77c1a028..ebd26304f75 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -1,5 +1,5 @@ /* - * linux/arch/arm/mach-omap/omap2/board-2430sdp.c + * linux/arch/arm/mach-omap2/board-2430sdp.c * * Copyright (C) 2006 Texas Instruments * @@ -19,10 +19,10 @@ #include #include #include -#include -#include #include #include +#include +#include #include #include @@ -31,24 +31,21 @@ #include #include -#include #include -#include -#include #include #include -#include -#include -#include #include +#include #include "prcm-regs.h" #include - #define SDP2430_FLASH_CS 0 #define SDP2430_SMC91X_CS 5 +/* TSC2046 (touchscreen) */ +#define TS_GPIO 24 + static struct mtd_partition sdp2430_partitions[] = { /* bootloader (U-Boot, etc) in first sector */ { @@ -128,6 +125,31 @@ static struct platform_device *sdp2430_devices[] __initdata = { &sdp2430_flash_device, }; +static struct tsc2046_platform_data tsc2046_config = { + .dav_gpio = TS_GPIO, + .gpio_debounce = 0xa, +}; + +static struct omap2_mcspi_device_config tsc2046_mcspi_config = { + .turbo_mode = 0, + .single_channel = 0, /* 0: slave, 1: master */ +}; + +static struct spi_board_info sdp2430_spi_board_info[] __initdata = { + [0] = { + /* + * TSC2046 operates at a max freqency of 2MHz, so + * operate slightly below at 1.5MHz + */ + .modalias = "tsc2046", + .bus_num = 1, + .chip_select = 0, + .max_speed_hz = 1500000, + .controller_data = &tsc2046_mcspi_config, + .platform_data = &tsc2046_config, + }, +}; + static inline void __init sdp2430_init_smc91x(void) { int eth_cs; @@ -201,12 +223,91 @@ static struct omap_board_config_kernel sdp2430_config[] = { {OMAP_TAG_UART, &sdp2430_uart_config}, }; +#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE) + +#define OMAP2_I2C_BASE1 0x48070000 +#define OMAP2_I2C_BASE2 0x48072000 +#define OMAP2_I2C_INT1 56 +#define OMAP2_I2C_INT2 57 + +static u32 omap2_i2c1_clkrate = 400; +static u32 omap2_i2c2_clkrate = 2600; + +static struct resource i2c_resources1[] = { + { + .start = OMAP2_I2C_BASE1, + .end = OMAP2_I2C_BASE1 + 0x3f, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP2_I2C_INT1, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct resource i2c_resources2[] = { + { + .start = OMAP2_I2C_BASE2, + .end = OMAP2_I2C_BASE2 + 0x3f, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP2_I2C_INT2, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device omap_i2c_device1 = { + .name = "i2c_omap", + .id = 1, + .num_resources = ARRAY_SIZE(i2c_resources1), + .resource = i2c_resources1, + .dev = { + .platform_data = &omap2_i2c1_clkrate, + }, +}; + +static struct platform_device omap_i2c_device2 = { + .name = "i2c_omap", + .id = 2, + .num_resources = ARRAY_SIZE(i2c_resources2), + .resource = i2c_resources2, + .dev = { + .platform_data = &omap2_i2c2_clkrate, + }, +}; + +static void omap_init_i2c(void) +{ + (void) platform_device_register(&omap_i2c_device2); + (void) platform_device_register(&omap_i2c_device1); +} + +#else + +static void omap_init_i2c(void) {} + +#endif + +static int __init omap2430_i2c_init(void) +{ + omap_init_i2c(); + return 0; +} + +extern void __init sdp2430_flash_init(void); + static void __init omap_2430sdp_init(void) { platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); omap_board_config = sdp2430_config; omap_board_config_size = ARRAY_SIZE(sdp2430_config); omap_serial_init(); + + sdp2430_flash_init(); + + spi_register_board_info(sdp2430_spi_board_info, + ARRAY_SIZE(sdp2430_spi_board_info)); } static void __init omap_2430sdp_map_io(void) @@ -214,6 +315,8 @@ static void __init omap_2430sdp_map_io(void) omap2_map_common_io(); } +arch_initcall(omap2430_i2c_init); + MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") /* Maintainer: Syed Khasim - Texas Instruments Inc */ .phys_io = 0x48000000,