ARM: tegra: ardbeg: Add Cm32181 ALS sensor support
Sri Krishna chowdary [Thu, 18 Apr 2013 10:37:48 +0000 (15:37 +0530)]
Bug 1256462

Change-Id: I2be13a97c529f7e569ef4ede3c8a1be4aeaec4fb
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/220557
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit

arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/board-ardbeg-sensors.c [new file with mode: 0644]
arch/arm/mach-tegra/board-ardbeg.c
arch/arm/mach-tegra/board-ardbeg.h

index 07a2425..19d621c 100644 (file)
@@ -263,6 +263,7 @@ obj-${CONFIG_MACH_TEGRA_PLUTO}          += panel-s-1080p-5.o
 obj-${CONFIG_MACH_ARDBEG}               += board-ardbeg.o
 obj-${CONFIG_MACH_ARDBEG}               += board-ardbeg-kbc.o
 obj-${CONFIG_MACH_ARDBEG}               += board-ardbeg-sdhci.o
+obj-${CONFIG_MACH_ARDBEG}               += board-ardbeg-sensors.o
 obj-${CONFIG_MACH_ARDBEG}               += board-ardbeg-panel.o
 obj-${CONFIG_MACH_ARDBEG}               += board-ardbeg-pinmux.o
 obj-${CONFIG_MACH_ARDBEG}               += panel-a-1080p-11-6.o
diff --git a/arch/arm/mach-tegra/board-ardbeg-sensors.c b/arch/arm/mach-tegra/board-ardbeg-sensors.c
new file mode 100644 (file)
index 0000000..47d22c5
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * arch/arm/mach-tegra/board-ardbeg-sensors.c
+ *
+ * Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/i2c.h>
+
+static struct i2c_board_info ardbeg_i2c_board_info_cm32181[] = {
+       {
+               I2C_BOARD_INFO("cm32181", 0x48),
+       },
+};
+
+int __init ardbeg_sensors_init(void)
+{
+       i2c_register_board_info(0, ardbeg_i2c_board_info_cm32181,
+               ARRAY_SIZE(ardbeg_i2c_board_info_cm32181));
+
+       return 0;
+}
index 0992f3c..29bc96b 100644 (file)
@@ -164,6 +164,7 @@ static void __init tegra_ardbeg_init(void)
        ardbeg_kbc_init();
        ardbeg_sdhci_init();
        ardbeg_panel_init();
+       ardbeg_sensors_init();
        platform_add_devices(ardbeg_devices, ARRAY_SIZE(ardbeg_devices));
        tegra_register_fuse();
 }
index d51ed9f..951ea77 100644 (file)
@@ -27,5 +27,6 @@ int ardbeg_pinmux_init(void);
 int ardbeg_panel_init(void);
 int ardbeg_kbc_init(void);
 int ardbeg_sdhci_init(void);
+int ardbeg_sensors_init(void);
 
 #endif