[PATCH] Allow kxtj9 accelerometer driver to work on kxtf9

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	Kionix kxtj9 is a pin- and register-compatible replacement
	for the kxtf9 accelerometer. This patch makes the kxtj9 driver
	probe routine accept kxtf9. This has been tested briefly on
	a kxtf9 accelerometer and seems to report correct results.

Signed-off-by: Alexander Tarasikov <alexander.tarasikov@xxxxxxxxx>
---
 drivers/input/misc/kxtj9.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/input/misc/kxtj9.c b/drivers/input/misc/kxtj9.c
index 783597a..c54fe18 100644
--- a/drivers/input/misc/kxtj9.c
+++ b/drivers/input/misc/kxtj9.c
@@ -487,7 +487,10 @@ static int __devinit kxtj9_verify(struct kxtj9_data *tj9)
 		goto out;
 	}
 
-	retval = retval != 0x06 ? -EIO : 0;
+	if (retval == 0x6 || retval == 0x1)
+		retval = 0;
+	else
+		retval = -EIO;
 
 out:
 	kxtj9_device_power_off(tj9);
-- 
1.7.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux