summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPritesh Raithatha <praithatha@nvidia.com>2010-09-06 19:54:42 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2010-09-06 21:17:41 -0700
commit6d57488c0acd3ee8d152d341b97d6740cc77d911 (patch)
tree227534f4d619e3956d9b79c403d2af102e06ce7e
parentbf59cb1843c1a38b863aded00202b089a71c0653 (diff)
tegra accelerometer: Changed default initialization parameters
Fixes bug 678250 Reviewed-on: http://git-master/r/5583 Tested-by: Pritesh Raithatha <praithatha@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> (cherry picked from commit bcd2f2e113fb10b321272a53c2c0e015099e3ea8) Change-Id: I985af6334389e257ae6acd37e85c17391200b649 Reviewed-on: http://git-master.nvidia.com/r/6056 Tested-by: Pritesh Raithatha <praithatha@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/odm_kit/platform/accelerometer/nvodm_accelerometer_adi340.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/odm_kit/platform/accelerometer/nvodm_accelerometer_adi340.c b/arch/arm/mach-tegra/odm_kit/platform/accelerometer/nvodm_accelerometer_adi340.c
index f93d0eac6c74..fe11c4ed1382 100644
--- a/arch/arm/mach-tegra/odm_kit/platform/accelerometer/nvodm_accelerometer_adi340.c
+++ b/arch/arm/mach-tegra/odm_kit/platform/accelerometer/nvodm_accelerometer_adi340.c
@@ -42,7 +42,7 @@
#define NV_ACCELEROMETER_REGISTER_RANGE 8
// When acc is put in horizontal, the max value from acc.
-#define NV_ADI340_ACCELEROMETER_NORMAL_THRESHOLD 57
+#define NV_ADI340_ACCELEROMETER_NORMAL_THRESHOLD 38
#define NV_ADI340_ACCELEROMETER_TAP_THRESHOLD 7
#define NV_ADI340_LOW_POWER_SAMPLERATE 3
#define NV_ADI340_FULL_RUN_SAMPLERATE 100
@@ -536,7 +536,8 @@ NvOdmAccelOpen(NvOdmAccelHandle* hDevice)
hAccel->CtrlRegsList[0].RegAddr = XLR_CTL; //0x12
hAccel->CtrlRegsList[0].RegValue = 0x20;
hAccel->CtrlRegsList[1].RegAddr = XLR_INTCONTROL; //0x13
- hAccel->CtrlRegsList[1].RegValue = 0xF3; // modify so that sw is compatible
+ // Ignore Z-axis interrupt, as it is getting fired continuously.
+ hAccel->CtrlRegsList[1].RegValue = 0xD3; // modify so that sw is compatible,
hAccel->CtrlRegsList[2].RegAddr = XLR_INTCONTROL2; //0x14
hAccel->CtrlRegsList[2].RegValue = 0xe0;
hAccel->CtrlRegsList[3].RegAddr = XLR_THRESHG; //0x1C
@@ -657,8 +658,8 @@ NvOdmAccelOpen(NvOdmAccelHandle* hDevice)
* Write to INTCONTROL register to disable genetration of the interrupts.
* Write to INTCONTROL2 to clear the already latched interrupts.
*/
- NvOdmAccelerometerSetParameter(hAccel, XLR_ATTR_INTCONTROL, 0x0);
- NvOdmAccelerometerSetParameter(hAccel, XLR_ATTR_INTCONTROL2, 0x1);
+ NvOdmAccelerometerSetParameter(hAccel, XLR_INTCONTROL, 0x0);
+ NvOdmAccelerometerSetParameter(hAccel, XLR_INTCONTROL2, 0x1);
if(NV_FALSE == NvAccelerometerConnectSemaphore(hAccel))
{
goto error;
@@ -880,17 +881,16 @@ NvOdmAccelSetIntEnable(NvOdmAccelHandle hDevice,
}
case NvOdmAccelAxis_All:
{
+ // Z-axis interrupt is ignored so do not enable or disable it
if(Toggle == NV_TRUE)
{
uTemp |= XLR_INTCONTROL_COM_SRC_X;
uTemp |= XLR_INTCONTROL_COM_SRC_Y;
- uTemp |= XLR_INTCONTROL_COM_SRC_Z;
}
else
{
uTemp &= XLR_INTCONTROL_COM_SRC_X_MASK;
uTemp &= XLR_INTCONTROL_COM_SRC_Y_MASK;
- uTemp &= XLR_INTCONTROL_COM_SRC_Z_MASK;
}
break;
}