aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-zoom-peripherals.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-zoom-peripherals.c')
-rw-r--r--arch/arm/mach-omap2/board-zoom-peripherals.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 239c1f0eb940..86c9b2102952 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -16,6 +16,8 @@
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/i2c/twl.h> 17#include <linux/i2c/twl.h>
18#include <linux/regulator/machine.h> 18#include <linux/regulator/machine.h>
19#include <linux/regulator/fixed.h>
20#include <linux/wl12xx.h>
19#include <linux/mmc/host.h> 21#include <linux/mmc/host.h>
20 22
21#include <asm/mach-types.h> 23#include <asm/mach-types.h>
@@ -30,6 +32,9 @@
30#include "mux.h" 32#include "mux.h"
31#include "hsmmc.h" 33#include "hsmmc.h"
32 34
35#define OMAP_ZOOM_WLAN_PMENA_GPIO (101)
36#define OMAP_ZOOM_WLAN_IRQ_GPIO (162)
37
33/* Zoom2 has Qwerty keyboard*/ 38/* Zoom2 has Qwerty keyboard*/
34static uint32_t board_keymap[] = { 39static uint32_t board_keymap[] = {
35 KEY(0, 0, KEY_E), 40 KEY(0, 0, KEY_E),
@@ -109,6 +114,11 @@ static struct regulator_consumer_supply zoom_vmmc2_supply = {
109 .supply = "vmmc", 114 .supply = "vmmc",
110}; 115};
111 116
117static struct regulator_consumer_supply zoom_vmmc3_supply = {
118 .supply = "vmmc",
119 .dev_name = "mmci-omap-hs.2",
120};
121
112/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ 122/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
113static struct regulator_init_data zoom_vmmc1 = { 123static struct regulator_init_data zoom_vmmc1 = {
114 .constraints = { 124 .constraints = {
@@ -154,6 +164,38 @@ static struct regulator_init_data zoom_vsim = {
154 .consumer_supplies = &zoom_vsim_supply, 164 .consumer_supplies = &zoom_vsim_supply,
155}; 165};
156 166
167static struct regulator_init_data zoom_vmmc3 = {
168 .constraints = {
169 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
170 },
171 .num_consumer_supplies = 1,
172 .consumer_supplies = &zoom_vmmc3_supply,
173};
174
175static struct fixed_voltage_config zoom_vwlan = {
176 .supply_name = "vwl1271",
177 .microvolts = 1800000, /* 1.8V */
178 .gpio = OMAP_ZOOM_WLAN_PMENA_GPIO,
179 .startup_delay = 70000, /* 70msec */
180 .enable_high = 1,
181 .enabled_at_boot = 0,
182 .init_data = &zoom_vmmc3,
183};
184
185static struct platform_device omap_vwlan_device = {
186 .name = "reg-fixed-voltage",
187 .id = 1,
188 .dev = {
189 .platform_data = &zoom_vwlan,
190 },
191};
192
193struct wl12xx_platform_data omap_zoom_wlan_data __initdata = {
194 .irq = OMAP_GPIO_IRQ(OMAP_ZOOM_WLAN_IRQ_GPIO),
195 /* ZOOM ref clock is 26 MHz */
196 .board_ref_clock = 1,
197};
198
157static struct omap2_hsmmc_info mmc[] __initdata = { 199static struct omap2_hsmmc_info mmc[] __initdata = {
158 { 200 {
159 .name = "external", 201 .name = "external",
@@ -171,6 +213,14 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
171 .nonremovable = true, 213 .nonremovable = true,
172 .power_saving = true, 214 .power_saving = true,
173 }, 215 },
216 {
217 .name = "wl1271",
218 .mmc = 3,
219 .caps = MMC_CAP_4_BIT_DATA,
220 .gpio_wp = -EINVAL,
221 .gpio_cd = -EINVAL,
222 .nonremovable = true,
223 },
174 {} /* Terminator */ 224 {} /* Terminator */
175}; 225};
176 226
@@ -191,6 +241,11 @@ static int zoom_twl_gpio_setup(struct device *dev,
191 return 0; 241 return 0;
192} 242}
193 243
244/* EXTMUTE callback function */
245void zoom2_set_hs_extmute(int mute)
246{
247 gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute);
248}
194 249
195static int zoom_batt_table[] = { 250static int zoom_batt_table[] = {
196/* 0 C*/ 251/* 0 C*/
@@ -260,6 +315,11 @@ static struct i2c_board_info __initdata zoom_i2c_boardinfo[] = {
260 315
261static int __init omap_i2c_init(void) 316static int __init omap_i2c_init(void)
262{ 317{
318 if (machine_is_omap_zoom2()) {
319 zoom_audio_data.ramp_delay_value = 3; /* 161 ms */
320 zoom_audio_data.hs_extmute = 1;
321 zoom_audio_data.set_hs_extmute = zoom2_set_hs_extmute;
322 }
263 omap_register_i2c_bus(1, 2400, zoom_i2c_boardinfo, 323 omap_register_i2c_bus(1, 2400, zoom_i2c_boardinfo,
264 ARRAY_SIZE(zoom_i2c_boardinfo)); 324 ARRAY_SIZE(zoom_i2c_boardinfo));
265 omap_register_i2c_bus(2, 400, NULL, 0); 325 omap_register_i2c_bus(2, 400, NULL, 0);
@@ -282,7 +342,11 @@ static void enable_board_wakeup_source(void)
282 342
283void __init zoom_peripherals_init(void) 343void __init zoom_peripherals_init(void)
284{ 344{
345 if (wl12xx_set_platform_data(&omap_zoom_wlan_data))
346 pr_err("error setting wl12xx data\n");
347
285 omap_i2c_init(); 348 omap_i2c_init();
349 platform_device_register(&omap_vwlan_device);
286 usb_musb_init(&musb_board_data); 350 usb_musb_init(&musb_board_data);
287 enable_board_wakeup_source(); 351 enable_board_wakeup_source();
288 omap_serial_init(); 352 omap_serial_init();