summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenu Byravarasu <vbyravarasu@nvidia.com>2010-05-26 13:50:12 +0530
committerYu-Huan Hsu <yhsu@nvidia.com>2010-05-27 23:08:05 -0700
commite0b21639f2b6aa8fa51558853a0519a04abc32ce (patch)
treef3dc02efaf9832f5e4b28a5c5298c758072ebc31
parent04766fad54fbc0dda7d726fc1e678c5cbb85171a (diff)
tegra: Enabled accelerometer on E1206
Enabled accelerometer configuration in harmony config file. Enabled accelerometer driver for E1206 platform. On Harmony, accelerometer driver open will return failure. Tested on: Harmony and E1206 Change-Id: Icd9676e684daae7e2c4dad475e171d5e1957f133 Reviewed-on: http://git-master/r/1483 Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
-rw-r--r--arch/arm/configs/tegra_harmony_android_defconfig4
-rw-r--r--arch/arm/mach-tegra/odm_kit/platform/accelerometer/nvodm_accelerometer_bma150.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm/configs/tegra_harmony_android_defconfig b/arch/arm/configs/tegra_harmony_android_defconfig
index 200ae1a7ffcf..b6f4c1123e82 100644
--- a/arch/arm/configs/tegra_harmony_android_defconfig
+++ b/arch/arm/configs/tegra_harmony_android_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.29
-# Tue May 25 15:27:54 2010
+# Wed May 26 13:21:56 2010
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -918,7 +918,7 @@ CONFIG_INPUT_MISC=y
CONFIG_INPUT_UINPUT=y
# CONFIG_INPUT_GPIO is not set
# CONFIG_INPUT_KEYCHORD is not set
-# CONFIG_INPUT_TEGRA_ODM_ACCEL is not set
+CONFIG_INPUT_TEGRA_ODM_ACCEL=y
# CONFIG_INPUT_TEGRA_ODM_SCROLL is not set
#
diff --git a/arch/arm/mach-tegra/odm_kit/platform/accelerometer/nvodm_accelerometer_bma150.c b/arch/arm/mach-tegra/odm_kit/platform/accelerometer/nvodm_accelerometer_bma150.c
index aedf87c837a9..90adde357478 100644
--- a/arch/arm/mach-tegra/odm_kit/platform/accelerometer/nvodm_accelerometer_bma150.c
+++ b/arch/arm/mach-tegra/odm_kit/platform/accelerometer/nvodm_accelerometer_bma150.c
@@ -39,6 +39,8 @@
#include "nvodm_query_discovery.h"
#include "nvos.h"
+#define EEPROM_ID_E1206 0x0C06
+
#define NVODMACCELEROMETER_ENABLE_PRINTF 0
#if NVODMACCELEROMETER_ENABLE_PRINTF
@@ -331,6 +333,13 @@ NvBool NvOdmAccelOpen(NvOdmAccelHandle* hDevice)
NvOdmIoModule IoModule = NvOdmIoModule_I2c;
const NvOdmPeripheralConnectivity *pConnectivity;
NvBool FoundGpio = NV_FALSE, FoundI2cModule = NV_FALSE;
+ NvOdmBoardInfo BoardInfo;
+ // Accelerometer is supported only on E1206.
+ if (!NvOdmPeripheralGetBoardInfo(EEPROM_ID_E1206, &BoardInfo))
+ {
+ NVODMACCELEROMETER_PRINTF(("\n Accelerometer is not supported \n"));
+ return NV_FALSE;
+ }
hAccel = NvOdmOsAlloc(sizeof(NvOdmAccel));
if (hAccel == NULL)