| OLD | NEW |
| 1 /* | 1 /* |
| 2 * arch/arm/mach-tegra/board-harmony.c | 2 * arch/arm/mach-tegra/board-harmony.c |
| 3 * | 3 * |
| 4 * Copyright (C) 2010 Google, Inc. | 4 * Copyright (C) 2010 Google, Inc. |
| 5 * | 5 * |
| 6 * This software is licensed under the terms of the GNU General Public | 6 * This software is licensed under the terms of the GNU General Public |
| 7 * License version 2, as published by the Free Software Foundation, and | 7 * License version 2, as published by the Free Software Foundation, and |
| 8 * may be copied, distributed, and modified under those terms. | 8 * may be copied, distributed, and modified under those terms. |
| 9 * | 9 * |
| 10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include <linux/mtd/mtd.h> | 22 #include <linux/mtd/mtd.h> |
| 23 #include <linux/mtd/partitions.h> | 23 #include <linux/mtd/partitions.h> |
| 24 #include <linux/dma-mapping.h> | 24 #include <linux/dma-mapping.h> |
| 25 #include <linux/pda_power.h> | 25 #include <linux/pda_power.h> |
| 26 #include <linux/i2c.h> | 26 #include <linux/i2c.h> |
| 27 #include <linux/i2c-tegra.h> | 27 #include <linux/i2c-tegra.h> |
| 28 #include <linux/io.h> | 28 #include <linux/io.h> |
| 29 #include <linux/delay.h> | 29 #include <linux/delay.h> |
| 30 #include <linux/tegra_usb.h> | 30 #include <linux/tegra_usb.h> |
| 31 | 31 |
| 32 #include <sound/wm8903.h> |
| 33 |
| 32 #include <asm/mach-types.h> | 34 #include <asm/mach-types.h> |
| 33 #include <asm/mach/arch.h> | 35 #include <asm/mach/arch.h> |
| 34 #include <asm/mach/time.h> | 36 #include <asm/mach/time.h> |
| 35 #include <asm/setup.h> | 37 #include <asm/setup.h> |
| 36 | 38 |
| 39 #include <mach/harmony_audio.h> |
| 37 #include <mach/iomap.h> | 40 #include <mach/iomap.h> |
| 38 #include <mach/irqs.h> | 41 #include <mach/irqs.h> |
| 39 #include <mach/nand.h> | 42 #include <mach/nand.h> |
| 40 #include <mach/clk.h> | 43 #include <mach/clk.h> |
| 44 #include <mach/gpio.h> |
| 41 #include <mach/usb_phy.h> | 45 #include <mach/usb_phy.h> |
| 42 #include <mach/suspend.h> | 46 #include <mach/suspend.h> |
| 43 | 47 |
| 44 #include "clock.h" | 48 #include "clock.h" |
| 45 #include "board.h" | 49 #include "board.h" |
| 46 #include "board-harmony.h" | 50 #include "board-harmony.h" |
| 47 #include "devices.h" | 51 #include "devices.h" |
| 52 #include "gpio-names.h" |
| 48 | 53 |
| 49 /* NVidia bootloader tags */ | 54 /* NVidia bootloader tags */ |
| 50 #define ATAG_NVIDIA 0x41000801 | 55 #define ATAG_NVIDIA 0x41000801 |
| 51 | 56 |
| 52 #define ATAG_NVIDIA_RM 0x1 | 57 #define ATAG_NVIDIA_RM 0x1 |
| 53 #define ATAG_NVIDIA_DISPLAY 0x2 | 58 #define ATAG_NVIDIA_DISPLAY 0x2 |
| 54 #define ATAG_NVIDIA_FRAMEBUFFER 0x3 | 59 #define ATAG_NVIDIA_FRAMEBUFFER 0x3 |
| 55 #define ATAG_NVIDIA_CHIPSHMOO 0x4 | 60 #define ATAG_NVIDIA_CHIPSHMOO 0x4 |
| 56 #define ATAG_NVIDIA_CHIPSHMOOPHYS 0x5 | 61 #define ATAG_NVIDIA_CHIPSHMOOPHYS 0x5 |
| 57 #define ATAG_NVIDIA_PRESERVED_MEM_0 0x10000 | 62 #define ATAG_NVIDIA_PRESERVED_MEM_0 0x10000 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 .bus_clk_rate = { 400000, 0 }, | 218 .bus_clk_rate = { 400000, 0 }, |
| 214 }; | 219 }; |
| 215 | 220 |
| 216 static struct tegra_i2c_platform_data harmony_dvc_platform_data = { | 221 static struct tegra_i2c_platform_data harmony_dvc_platform_data = { |
| 217 .adapter_nr = 4, | 222 .adapter_nr = 4, |
| 218 .bus_count = 1, | 223 .bus_count = 1, |
| 219 .bus_clk_rate = { 400000, 0 }, | 224 .bus_clk_rate = { 400000, 0 }, |
| 220 .is_dvc = true, | 225 .is_dvc = true, |
| 221 }; | 226 }; |
| 222 | 227 |
| 228 static struct wm8903_platform_data wm8903_pdata = { |
| 229 .irq_active_low = 0, |
| 230 .micdet_cfg = 0, |
| 231 .micdet_delay = 100, |
| 232 .gpio_base = GPIO_WM8903(0), |
| 233 .gpio_cfg = { |
| 234 WM8903_GPIO_NO_CONFIG, |
| 235 WM8903_GPIO_NO_CONFIG, |
| 236 0, |
| 237 WM8903_GPIO_NO_CONFIG, |
| 238 WM8903_GPIO_NO_CONFIG, |
| 239 }, |
| 240 }; |
| 241 |
| 223 static struct i2c_board_info __initdata harmony_i2c_bus1_board_info[] = { | 242 static struct i2c_board_info __initdata harmony_i2c_bus1_board_info[] = { |
| 224 { | 243 { |
| 225 I2C_BOARD_INFO("wm8903", 0x1a), | 244 I2C_BOARD_INFO("wm8903", 0x1a), |
| 245 .platform_data = &wm8903_pdata, |
| 246 .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PX3), |
| 226 }, | 247 }, |
| 227 }; | 248 }; |
| 228 | 249 |
| 229 static void harmony_i2c_init(void) | 250 static void harmony_i2c_init(void) |
| 230 { | 251 { |
| 231 tegra_i2c_device1.dev.platform_data = &harmony_i2c1_platform_data; | 252 tegra_i2c_device1.dev.platform_data = &harmony_i2c1_platform_data; |
| 232 tegra_i2c_device2.dev.platform_data = &harmony_i2c2_platform_data; | 253 tegra_i2c_device2.dev.platform_data = &harmony_i2c2_platform_data; |
| 233 tegra_i2c_device3.dev.platform_data = &harmony_i2c3_platform_data; | 254 tegra_i2c_device3.dev.platform_data = &harmony_i2c3_platform_data; |
| 234 tegra_i2c_device4.dev.platform_data = &harmony_dvc_platform_data; | 255 tegra_i2c_device4.dev.platform_data = &harmony_dvc_platform_data; |
| 235 | 256 |
| 236 platform_device_register(&tegra_i2c_device1); | 257 platform_device_register(&tegra_i2c_device1); |
| 237 platform_device_register(&tegra_i2c_device2); | 258 platform_device_register(&tegra_i2c_device2); |
| 238 platform_device_register(&tegra_i2c_device3); | 259 platform_device_register(&tegra_i2c_device3); |
| 239 platform_device_register(&tegra_i2c_device4); | 260 platform_device_register(&tegra_i2c_device4); |
| 240 | 261 |
| 241 i2c_register_board_info(0, harmony_i2c_bus1_board_info, | 262 i2c_register_board_info(0, harmony_i2c_bus1_board_info, |
| 242 ARRAY_SIZE(harmony_i2c_bus1_board_info)); | 263 ARRAY_SIZE(harmony_i2c_bus1_board_info)); |
| 243 } | 264 } |
| 244 | 265 |
| 266 static struct harmony_audio_platform_data audio_pdata = { |
| 267 .gpio_spkr_en = GPIO_WM8903(2), |
| 268 .gpio_hp_det = TEGRA_GPIO_PW2, |
| 269 .gpio_int_mic_en = TEGRA_GPIO_PX0, |
| 270 .gpio_ext_mic_en = TEGRA_GPIO_PX1, |
| 271 }; |
| 272 |
| 273 static struct platform_device audio_device = { |
| 274 .name = "tegra-snd-harmony", |
| 275 .id = 0, |
| 276 .dev = { |
| 277 .platform_data = &audio_pdata, |
| 278 }, |
| 279 }; |
| 280 |
| 245 static struct platform_device *harmony_devices[] __initdata = { | 281 static struct platform_device *harmony_devices[] __initdata = { |
| 246 &debug_uart, | 282 &debug_uart, |
| 247 &pmu_device, | 283 &pmu_device, |
| 248 &tegra_nand_device, | 284 &tegra_nand_device, |
| 249 &tegra_udc_device, | 285 &tegra_udc_device, |
| 250 &pda_power_device, | 286 &pda_power_device, |
| 251 &tegra_ehci3_device, | 287 &tegra_ehci3_device, |
| 252 &tegra_spi_device1, | 288 &tegra_spi_device1, |
| 253 &tegra_spi_device2, | 289 &tegra_spi_device2, |
| 254 &tegra_spi_device3, | 290 &tegra_spi_device3, |
| 255 &tegra_spi_device4, | 291 &tegra_spi_device4, |
| 256 &tegra_gart_device, | 292 &tegra_gart_device, |
| 257 &tegra_i2s_device1, | 293 &tegra_i2s_device1, |
| 258 &tegra_das_device, | 294 &tegra_das_device, |
| 259 &tegra_pcm_device, | 295 &tegra_pcm_device, |
| 296 &audio_device, |
| 260 &tegra_avp_device, | 297 &tegra_avp_device, |
| 261 }; | 298 }; |
| 262 | 299 |
| 263 static void __init tegra_harmony_fixup(struct machine_desc *desc, | 300 static void __init tegra_harmony_fixup(struct machine_desc *desc, |
| 264 struct tag *tags, char **cmdline, struct meminfo *mi) | 301 struct tag *tags, char **cmdline, struct meminfo *mi) |
| 265 { | 302 { |
| 266 mi->nr_banks = 2; | 303 mi->nr_banks = 2; |
| 267 mi->bank[0].start = PHYS_OFFSET; | 304 mi->bank[0].start = PHYS_OFFSET; |
| 268 mi->bank[0].size = 448 * SZ_1M; | 305 mi->bank[0].size = 448 * SZ_1M; |
| 269 mi->bank[1].start = SZ_512M; | 306 mi->bank[1].start = SZ_512M; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 harmony_pinmux_init(); | 414 harmony_pinmux_init(); |
| 378 | 415 |
| 379 tegra_common_init(); | 416 tegra_common_init(); |
| 380 | 417 |
| 381 tegra_init_suspend(&harmony_suspend); | 418 tegra_init_suspend(&harmony_suspend); |
| 382 | 419 |
| 383 tegra_clk_init_from_table(harmony_clk_init_table); | 420 tegra_clk_init_from_table(harmony_clk_init_table); |
| 384 | 421 |
| 385 tegra_ehci3_device.dev.platform_data = &tegra_ehci_pdata; | 422 tegra_ehci3_device.dev.platform_data = &tegra_ehci_pdata; |
| 386 | 423 |
| 424 tegra_gpio_enable(audio_pdata.gpio_hp_det); |
| 425 tegra_gpio_enable(audio_pdata.gpio_int_mic_en); |
| 426 tegra_gpio_enable(audio_pdata.gpio_ext_mic_en); |
| 427 tegra_gpio_enable(TEGRA_IRQ_TO_GPIO(harmony_i2c_bus1_board_info[0].irq))
; |
| 428 |
| 387 platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices)); | 429 platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices)); |
| 388 | 430 |
| 389 harmony_panel_init(); | 431 harmony_panel_init(); |
| 390 harmony_sdhci_init(); | 432 harmony_sdhci_init(); |
| 391 harmony_i2c_init(); | 433 harmony_i2c_init(); |
| 392 } | 434 } |
| 393 | 435 |
| 394 MACHINE_START(HARMONY, "harmony") | 436 MACHINE_START(HARMONY, "harmony") |
| 395 .boot_params = 0x00000100, | 437 .boot_params = 0x00000100, |
| 396 .fixup = tegra_harmony_fixup, | 438 .fixup = tegra_harmony_fixup, |
| 397 .init_irq = tegra_init_irq, | 439 .init_irq = tegra_init_irq, |
| 398 .init_machine = tegra_harmony_init, | 440 .init_machine = tegra_harmony_init, |
| 399 .map_io = tegra_map_common_io, | 441 .map_io = tegra_map_common_io, |
| 400 .timer = &tegra_timer, | 442 .timer = &tegra_timer, |
| 401 MACHINE_END | 443 MACHINE_END |
| OLD | NEW |