Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 Texas Instruments Inc. |
| 3 | * Mikkel Christensen <mlc@ti.com> |
| 4 | * |
| 5 | * Modified from mach-omap2/board-ldp.c |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/kernel.h> |
| 13 | #include <linux/init.h> |
| 14 | #include <linux/platform_device.h> |
Vikram Pandita | 70ac51a | 2009-08-28 11:24:13 -0700 | [diff] [blame] | 15 | #include <linux/input.h> |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 16 | #include <linux/gpio.h> |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame^] | 17 | #include <linux/i2c/twl.h> |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 18 | |
| 19 | #include <asm/mach-types.h> |
| 20 | #include <asm/mach/arch.h> |
| 21 | |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 22 | #include <plat/common.h> |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 23 | #include <plat/board.h> |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 24 | |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 25 | #include <mach/board-zoom.h> |
| 26 | |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 27 | #include "mux.h" |
Teerth Reddy | 02563a5 | 2009-10-14 09:56:35 -0700 | [diff] [blame] | 28 | #include "sdram-micron-mt46h32m32lf-6.h" |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 29 | |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 30 | static void __init omap_zoom2_init_irq(void) |
| 31 | { |
Teerth Reddy | 02563a5 | 2009-10-14 09:56:35 -0700 | [diff] [blame] | 32 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, |
| 33 | mt46h32m32lf6_sdrc_params); |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 34 | omap_init_irq(); |
| 35 | omap_gpio_init(); |
| 36 | } |
| 37 | |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame^] | 38 | /* EXTMUTE callback function */ |
| 39 | void zoom2_set_hs_extmute(int mute) |
| 40 | { |
| 41 | gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute); |
| 42 | } |
Vikram Pandita | 70ac51a | 2009-08-28 11:24:13 -0700 | [diff] [blame] | 43 | |
| 44 | static struct twl4030_madc_platform_data zoom2_madc_data = { |
| 45 | .irq_line = 1, |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 46 | }; |
| 47 | |
Peter Ujfalusi | f8d9aad | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 48 | static struct twl4030_codec_audio_data zoom2_audio_data = { |
| 49 | .audio_mclk = 26000000, |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame^] | 50 | .ramp_delay_value = 3, /* 161 ms */ |
| 51 | .hs_extmute = 1, |
| 52 | .set_hs_extmute = zoom2_set_hs_extmute, |
Peter Ujfalusi | f8d9aad | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | static struct twl4030_codec_data zoom2_codec_data = { |
Peter Ujfalusi | 953e2f3 | 2009-11-04 09:58:18 +0200 | [diff] [blame] | 56 | .audio_mclk = 26000000, |
Peter Ujfalusi | f8d9aad | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 57 | .audio = &zoom2_audio_data, |
| 58 | }; |
| 59 | |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 60 | static struct twl4030_platform_data zoom2_twldata = { |
| 61 | .irq_base = TWL4030_IRQ_BASE, |
| 62 | .irq_end = TWL4030_IRQ_END, |
| 63 | |
| 64 | /* platform_data for children goes here */ |
Vikram Pandita | 70ac51a | 2009-08-28 11:24:13 -0700 | [diff] [blame] | 65 | .bci = &zoom2_bci_data, |
| 66 | .madc = &zoom2_madc_data, |
| 67 | .usb = &zoom2_usb_data, |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 68 | .gpio = &zoom2_gpio_data, |
Vikram Pandita | 70ac51a | 2009-08-28 11:24:13 -0700 | [diff] [blame] | 69 | .keypad = &zoom2_kp_twl4030_data, |
Peter Ujfalusi | f8d9aad | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 70 | .codec = &zoom2_codec_data, |
Vikram Pandita | 70ac51a | 2009-08-28 11:24:13 -0700 | [diff] [blame] | 71 | .vmmc1 = &zoom2_vmmc1, |
| 72 | .vmmc2 = &zoom2_vmmc2, |
| 73 | .vsim = &zoom2_vsim, |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 74 | }; |
| 75 | |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame^] | 76 | static struct i2c_board_info __initdata zoom2_i2c_boardinfo[] = { |
| 77 | { |
| 78 | I2C_BOARD_INFO("twl4030", 0x48), |
| 79 | .flags = I2C_CLIENT_WAKE, |
| 80 | .irq = INT_34XX_SYS_NIRQ, |
| 81 | .platform_data = &zoom2_twldata, |
| 82 | }, |
| 83 | }; |
| 84 | |
| 85 | static int __init omap3_zoom2_i2c_init(void) |
| 86 | { |
| 87 | omap_register_i2c_bus(1, 2600, zoom2_i2c_boardinfo, |
| 88 | ARRAY_SIZE(zoom2_i2c_boardinfo)); |
| 89 | return 0; |
| 90 | } |
| 91 | |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 92 | |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 93 | #ifdef CONFIG_OMAP_MUX |
| 94 | static struct omap_board_mux board_mux[] __initdata = { |
| 95 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 96 | }; |
| 97 | #else |
| 98 | #define board_mux NULL |
| 99 | #endif |
| 100 | |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 101 | static void __init omap_zoom2_init(void) |
| 102 | { |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 103 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
vikram pandita | 479f12c | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 104 | zoom_peripherals_init(); |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame^] | 105 | omap3_zoom2_i2c_init(); |
vikram pandita | 62d0b336 | 2009-11-22 10:11:31 -0800 | [diff] [blame] | 106 | zoom_debugboard_init(); |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | static void __init omap_zoom2_map_io(void) |
| 110 | { |
| 111 | omap2_set_globals_343x(); |
Tony Lindgren | 6fbd55d | 2010-02-12 12:26:47 -0800 | [diff] [blame] | 112 | omap34xx_map_common_io(); |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") |
Tony Lindgren | a4f57b8 | 2010-04-30 12:57:14 -0700 | [diff] [blame] | 116 | .phys_io = ZOOM_UART_BASE, |
| 117 | .io_pg_offst = (ZOOM_UART_VIRT >> 18) & 0xfffc, |
Vikram Pandita | 577145f | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 118 | .boot_params = 0x80000100, |
| 119 | .map_io = omap_zoom2_map_io, |
| 120 | .init_irq = omap_zoom2_init_irq, |
| 121 | .init_machine = omap_zoom2_init, |
| 122 | .timer = &omap_timer, |
| 123 | MACHINE_END |