diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2010-07-19 08:21:15 +0530 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-07-19 09:57:37 -0700 |
commit | 2c1b66f1ce1bd561aa3aadf13c776cf2fc4451f2 (patch) | |
tree | ce12200d93b3a0646e71ea022e57fa6450df6e92 | |
parent | 6fc960d6c86fd76e3d9357adfd6eeeafed0dd2e4 (diff) |
[arm/tegra] ventana: Board info for AK8975 and isl29018.
Registering the board info for the magnetometer AK8975 and ALS
isl29018 hw monitor i2c client driver based on ventana board
layout.
Change-Id: I48d4dbb62605c2c840af4df4e6d31ae371fe75ba
Reviewed-on: http://git-master/r/3855
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Gary King <gking@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board-generic.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-generic.c b/arch/arm/mach-tegra/board-generic.c index 7212453215e1..a179cb5790df 100644 --- a/arch/arm/mach-tegra/board-generic.c +++ b/arch/arm/mach-tegra/board-generic.c @@ -24,12 +24,16 @@ #include <linux/pda_power.h> #include <linux/io.h> #include <linux/usb/android_composite.h> +#include <linux/i2c.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> #include <asm/setup.h> +#include <mach/gpio.h> +#include <gpio-names.h> + #include <mach/iomap.h> #include <mach/irqs.h> #include <mach/nvrm_linux.h> @@ -169,6 +173,35 @@ static struct platform_device *platform_devices[] = { #endif }; +static struct i2c_board_info bus0_i2c_devices[] = { +#ifdef CONFIG_SENSORS_ISL29018 + { + I2C_BOARD_INFO("isl29018", 0x44), + .irq = (INT_GPIO_BASE + TEGRA_GPIO_PZ2), + }, +#endif +}; + +static struct i2c_board_info bus3_i2c_devices[] = { +#ifdef CONFIG_SENSORS_AK8975 + { + I2C_BOARD_INFO("mm_ak8975", 0x0C), + .irq = (INT_GPIO_BASE + TEGRA_GPIO_PN5), + }, +#endif +}; + +void __init i2c_device_setup(void) +{ + if (ARRAY_SIZE(bus0_i2c_devices)) + i2c_register_board_info(0, bus0_i2c_devices, + ARRAY_SIZE(bus0_i2c_devices)); + + if (ARRAY_SIZE(bus3_i2c_devices)) + i2c_register_board_info(3, bus3_i2c_devices, + ARRAY_SIZE(bus3_i2c_devices)); +} + extern void __init tegra_setup_nvodm(bool standard_i2c, bool standard_spi); extern void __init tegra_register_socdev(void); @@ -203,6 +236,7 @@ static void __init tegra_ventana_init(void) tegra_android_platform.product_name = ventana_dev; #endif do_system_init(false, true); + i2c_device_setup(); } static void __init tegra_generic_init(void) |