Allow kxtj9 accelerometer driver to work on kxtf9

Started by Alexander Tarasikov on Jan 14, 2012

Subsystems (2)

Maintainers (2)

DORMANTno replies

open the first message on its own page

Message details and related content
	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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help