diff --git a/arch/arm/mach-msm/board-htcleo.c b/arch/arm/mach-msm/board-htcleo.c index 069a4526..1ef7fd5f 100644 --- a/arch/arm/mach-msm/board-htcleo.c +++ b/arch/arm/mach-msm/board-htcleo.c @@ -26,6 +26,7 @@ #include #include #include +#include #include <../../../drivers/staging/android/timed_gpio.h> #include @@ -42,6 +43,7 @@ #include #include + #include "board-htcleo.h" #include "board-htcleo-ts.h" #include "devices.h" @@ -115,29 +117,15 @@ static struct regulator_init_data tps65023_data[5] = }, }; -/* Vibrator */ -static struct timed_gpio timed_gpios[] = { - { - .name = "vibrator", - .gpio = HTCLEO_GPIO_VIBRATOR_ON, - .max_timeout = 15000, - }, +// Compass +static struct akm8973_platform_data compass_platform_data = +{ + .layouts = HTCLEO_LAYOUTS, + .project_name = HTCLEO_PROJECT_NAME, + .reset = HTCLEO_GPIO_COMPASS_RST_N, + .intr = HTCLEO_GPIO_COMPASS_INT_N, }; -static struct timed_gpio_platform_data timed_gpio_data = { - .num_gpios = ARRAY_SIZE(timed_gpios), - .gpios = timed_gpios, -}; - -static struct platform_device htcleo_timed_gpios = { - .name = "timed-gpio", - .id = -1, - .dev = { - .platform_data = &timed_gpio_data, - }, -}; - - static struct i2c_board_info base_i2c_devices[] = { { @@ -150,6 +138,11 @@ static struct i2c_board_info base_i2c_devices[] = I2C_BOARD_INFO("tps65023", 0x48), .platform_data = tps65023_data, }, + { + I2C_BOARD_INFO(AKM8973_I2C_NAME, 0x1C), + .platform_data = &compass_platform_data, + .irq = MSM_GPIO_TO_INT(HTCLEO_GPIO_COMPASS_INT_N), + }, }; /////////////////////////////////////////////////////////////////////// @@ -371,6 +364,7 @@ static struct platform_device ram_console_device = { .resource = ram_console_resources, }; + /* Battery */ static struct platform_device htcleo_power = { @@ -404,6 +398,28 @@ static struct platform_device *devices[] __initdata = }; +/* Vibrator */ +static struct timed_gpio timed_gpios[] = { + { + .name = "vibrator", + .gpio = HTCLEO_GPIO_VIBRATOR_ON, + .max_timeout = 15000, + }, +}; + +static struct timed_gpio_platform_data timed_gpio_data = { + .num_gpios = ARRAY_SIZE(timed_gpios), + .gpios = timed_gpios, +}; + +static struct platform_device htcleo_timed_gpios = { + .name = "timed-gpio", + .id = -1, + .dev = { + .platform_data = &timed_gpio_data, + }, +}; + static struct msm_acpu_clock_platform_data htcleo_clock_data = { .acpu_switch_time_us = 20, .max_speed_delta_khz = 256000,