From: Tony SIM Date: Tue, 7 Dec 2010 09:12:14 +0000 (+0000) Subject: ARM: mach-shmobile: mackerel: Add Accelerometer sensor support X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=80f1dc7cc9341b160beb9c833edc1cd131f45a7f;p=deliverable%2Flinux.git ARM: mach-shmobile: mackerel: Add Accelerometer sensor support Signed-off-by: Tony SIM Signed-off-by: Paul Mundt --- diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index cf3e660d8e70..a0caa9e39c5a 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -420,6 +420,16 @@ static struct i2c_board_info i2c0_devices[] = { }, }; +#define IRQ21 evt2irq(0x32a0) + +static struct i2c_board_info i2c1_devices[] = { + /* Accelerometer */ + { + I2C_BOARD_INFO("adxl34x", 0x53), + .irq = IRQ21, + }, +}; + static struct map_desc mackerel_io_desc[] __initdata = { /* create a 1:1 entity map for 0xe6xxxxxx * used by CPGA, INTC and PFC. @@ -515,9 +525,14 @@ static void __init mackerel_init(void) intc_set_priority(IRQ_FSI, 3); /* irq priority FSI(3) > SMSC911X(2) */ + /* enable Accelerometer */ + gpio_request(GPIO_FN_IRQ21, NULL); + set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH); i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); + i2c_register_board_info(1, i2c1_devices, + ARRAY_SIZE(i2c1_devices)); sh7372_add_standard_devices();