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.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 26e07addc9d7..cdc0c1021863 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -20,6 +20,8 @@
20#include <linux/wl12xx.h> 20#include <linux/wl12xx.h>
21#include <linux/mmc/host.h> 21#include <linux/mmc/host.h>
22#include <linux/platform_data/gpio-omap.h> 22#include <linux/platform_data/gpio-omap.h>
23#include <linux/platform_data/omap-twl4030.h>
24#include <linux/usb/phy.h>
23 25
24#include <asm/mach-types.h> 26#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
@@ -34,11 +36,9 @@
34#include "common-board-devices.h" 36#include "common-board-devices.h"
35 37
36#define OMAP_ZOOM_WLAN_PMENA_GPIO (101) 38#define OMAP_ZOOM_WLAN_PMENA_GPIO (101)
37#define ZOOM2_HEADSET_EXTMUTE_GPIO (153) 39#define OMAP_ZOOM_TSC2004_IRQ_GPIO (153)
38#define OMAP_ZOOM_WLAN_IRQ_GPIO (162) 40#define OMAP_ZOOM_WLAN_IRQ_GPIO (162)
39 41
40#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES)
41
42/* Zoom2 has Qwerty keyboard*/ 42/* Zoom2 has Qwerty keyboard*/
43static uint32_t board_keymap[] = { 43static uint32_t board_keymap[] = {
44 KEY(0, 0, KEY_E), 44 KEY(0, 0, KEY_E),
@@ -226,22 +226,31 @@ static struct omap2_hsmmc_info mmc[] = {
226 {} /* Terminator */ 226 {} /* Terminator */
227}; 227};
228 228
229static struct omap_tw4030_pdata omap_twl4030_audio_data = {
230 .voice_connected = true,
231 .custom_routing = true,
232
233 .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
234 .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
235
236 .has_mainmic = true,
237 .has_submic = true,
238 .has_hsmic = true,
239 .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
240};
241
229static int zoom_twl_gpio_setup(struct device *dev, 242static int zoom_twl_gpio_setup(struct device *dev,
230 unsigned gpio, unsigned ngpio) 243 unsigned gpio, unsigned ngpio)
231{ 244{
232 int ret;
233
234 /* gpio + 0 is "mmc0_cd" (input/IRQ) */ 245 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
235 mmc[0].gpio_cd = gpio + 0; 246 mmc[0].gpio_cd = gpio + 0;
236 omap_hsmmc_late_init(mmc); 247 omap_hsmmc_late_init(mmc);
237 248
238 ret = gpio_request_one(LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, 249 /* Audio setup */
239 "lcd enable"); 250 omap_twl4030_audio_data.jack_detect = gpio + 2;
240 if (ret) 251 omap_twl4030_audio_init("Zoom2", &omap_twl4030_audio_data);
241 pr_err("Failed to get LCD_PANEL_ENABLE_GPIO (gpio%d).\n",
242 LCD_PANEL_ENABLE_GPIO);
243 252
244 return ret; 253 return 0;
245} 254}
246 255
247static struct twl4030_gpio_platform_data zoom_gpio_data = { 256static struct twl4030_gpio_platform_data zoom_gpio_data = {
@@ -264,14 +273,9 @@ static int __init omap_i2c_init(void)
264 TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, 273 TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO,
265 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2); 274 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
266 275
267 if (machine_is_omap_zoom2()) { 276 if (machine_is_omap_zoom2())
268 struct twl4030_codec_data *codec_data; 277 zoom_twldata.audio->codec->ramp_delay_value = 3; /* 161 ms */
269 codec_data = zoom_twldata.audio->codec;
270 278
271 codec_data->ramp_delay_value = 3; /* 161 ms */
272 codec_data->hs_extmute = 1;
273 codec_data->hs_extmute_gpio = ZOOM2_HEADSET_EXTMUTE_GPIO;
274 }
275 omap_pmic_init(1, 2400, "twl5030", 7 + OMAP_INTC_START, &zoom_twldata); 279 omap_pmic_init(1, 2400, "twl5030", 7 + OMAP_INTC_START, &zoom_twldata);
276 omap_register_i2c_bus(2, 400, NULL, 0); 280 omap_register_i2c_bus(2, 400, NULL, 0);
277 omap_register_i2c_bus(3, 400, NULL, 0); 281 omap_register_i2c_bus(3, 400, NULL, 0);
@@ -298,6 +302,7 @@ void __init zoom_peripherals_init(void)
298 omap_hsmmc_init(mmc); 302 omap_hsmmc_init(mmc);
299 omap_i2c_init(); 303 omap_i2c_init();
300 platform_device_register(&omap_vwlan_device); 304 platform_device_register(&omap_vwlan_device);
305 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
301 usb_musb_init(NULL); 306 usb_musb_init(NULL);
302 enable_board_wakeup_source(); 307 enable_board_wakeup_source();
303 omap_serial_init(); 308 omap_serial_init();