diff options
Diffstat (limited to 'arch/arm/mach-nomadik/board-nhk8815.c')
-rw-r--r-- | arch/arm/mach-nomadik/board-nhk8815.c | 67 |
1 files changed, 55 insertions, 12 deletions
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index 2e8d3e176bc7..f4535a7dadf5 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c | |||
@@ -14,12 +14,14 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/amba/bus.h> | 16 | #include <linux/amba/bus.h> |
17 | #include <linux/amba/mmci.h> | ||
17 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
18 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
19 | #include <linux/mtd/mtd.h> | 20 | #include <linux/mtd/mtd.h> |
20 | #include <linux/mtd/nand.h> | 21 | #include <linux/mtd/nand.h> |
21 | #include <linux/mtd/onenand.h> | 22 | #include <linux/mtd/onenand.h> |
22 | #include <linux/mtd/partitions.h> | 23 | #include <linux/mtd/partitions.h> |
24 | #include <linux/i2c.h> | ||
23 | #include <linux/io.h> | 25 | #include <linux/io.h> |
24 | #include <asm/hardware/vic.h> | 26 | #include <asm/hardware/vic.h> |
25 | #include <asm/sizes.h> | 27 | #include <asm/sizes.h> |
@@ -185,16 +187,28 @@ static void __init nhk8815_onenand_init(void) | |||
185 | #endif | 187 | #endif |
186 | } | 188 | } |
187 | 189 | ||
188 | static AMBA_APB_DEVICE(uart0, "uart0", 0, NOMADIK_UART0_BASE, | 190 | static struct mmci_platform_data mmcsd_plat_data = { |
189 | { IRQ_UART0 }, NULL); | 191 | .ocr_mask = MMC_VDD_29_30, |
192 | .f_max = 48000000, | ||
193 | .gpio_wp = -1, | ||
194 | .gpio_cd = 111, | ||
195 | .cd_invert = true, | ||
196 | .capabilities = MMC_CAP_MMC_HIGHSPEED | | ||
197 | MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA, | ||
198 | }; | ||
190 | 199 | ||
191 | static AMBA_APB_DEVICE(uart1, "uart1", 0, NOMADIK_UART1_BASE, | 200 | static int __init nhk8815_mmcsd_init(void) |
192 | { IRQ_UART1 }, NULL); | 201 | { |
202 | int ret; | ||
193 | 203 | ||
194 | static struct amba_device *amba_devs[] __initdata = { | 204 | ret = gpio_request(112, "card detect bias"); |
195 | &uart0_device, | 205 | if (ret) |
196 | &uart1_device, | 206 | return ret; |
197 | }; | 207 | gpio_direction_output(112, 0); |
208 | amba_apb_device_add(NULL, "mmci", NOMADIK_SDI_BASE, SZ_4K, IRQ_SDMMC, 0, &mmcsd_plat_data, 0x10180180); | ||
209 | return 0; | ||
210 | } | ||
211 | module_init(nhk8815_mmcsd_init); | ||
198 | 212 | ||
199 | static struct resource nhk8815_eth_resources[] = { | 213 | static struct resource nhk8815_eth_resources[] = { |
200 | { | 214 | { |
@@ -253,17 +267,46 @@ static struct sys_timer nomadik_timer = { | |||
253 | .init = nomadik_timer_init, | 267 | .init = nomadik_timer_init, |
254 | }; | 268 | }; |
255 | 269 | ||
270 | static struct i2c_board_info __initdata nhk8815_i2c0_devices[] = { | ||
271 | { | ||
272 | I2C_BOARD_INFO("stw4811", 0x2d), | ||
273 | }, | ||
274 | }; | ||
275 | |||
276 | static struct i2c_board_info __initdata nhk8815_i2c1_devices[] = { | ||
277 | { | ||
278 | I2C_BOARD_INFO("camera", 0x10), | ||
279 | }, | ||
280 | { | ||
281 | I2C_BOARD_INFO("stw5095", 0x1a), | ||
282 | }, | ||
283 | { | ||
284 | I2C_BOARD_INFO("lis3lv02dl", 0x1d), | ||
285 | }, | ||
286 | }; | ||
287 | |||
288 | static struct i2c_board_info __initdata nhk8815_i2c2_devices[] = { | ||
289 | { | ||
290 | I2C_BOARD_INFO("stw4811-usb", 0x2d), | ||
291 | }, | ||
292 | }; | ||
293 | |||
256 | static void __init nhk8815_platform_init(void) | 294 | static void __init nhk8815_platform_init(void) |
257 | { | 295 | { |
258 | int i; | ||
259 | |||
260 | cpu8815_platform_init(); | 296 | cpu8815_platform_init(); |
261 | nhk8815_onenand_init(); | 297 | nhk8815_onenand_init(); |
262 | platform_add_devices(nhk8815_platform_devices, | 298 | platform_add_devices(nhk8815_platform_devices, |
263 | ARRAY_SIZE(nhk8815_platform_devices)); | 299 | ARRAY_SIZE(nhk8815_platform_devices)); |
264 | 300 | ||
265 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | 301 | amba_apb_device_add(NULL, "uart0", NOMADIK_UART0_BASE, SZ_4K, IRQ_UART0, 0, NULL, 0); |
266 | amba_device_register(amba_devs[i], &iomem_resource); | 302 | amba_apb_device_add(NULL, "uart1", NOMADIK_UART1_BASE, SZ_4K, IRQ_UART1, 0, NULL, 0); |
303 | |||
304 | i2c_register_board_info(0, nhk8815_i2c0_devices, | ||
305 | ARRAY_SIZE(nhk8815_i2c0_devices)); | ||
306 | i2c_register_board_info(1, nhk8815_i2c1_devices, | ||
307 | ARRAY_SIZE(nhk8815_i2c1_devices)); | ||
308 | i2c_register_board_info(2, nhk8815_i2c2_devices, | ||
309 | ARRAY_SIZE(nhk8815_i2c2_devices)); | ||
267 | } | 310 | } |
268 | 311 | ||
269 | MACHINE_START(NOMADIK, "NHK8815") | 312 | MACHINE_START(NOMADIK, "NHK8815") |