Thread (66 messages) 66 messages, 12 authors, 2009-08-22

Synaptics touchscreen for HTC Dream: check that smbus is available

From: Pavel Machek <hidden>
Date: 2009-08-08 13:41:00
Also in: linux-i2c, lkml
Subsystem: staging subsystem, the rest · Maintainers: Greg Kroah-Hartman, Linus Torvalds

quoted
quoted
Because this driver is using smbus i2c apis, it will be good to add
that check too.
So I should do something like

if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA))
       ...

in addition?
Yes.
Ok, here it is.

--- 

Check that SMBUS APIs are available in touchscreen driver.
    
Signed-off-by: Pavel Machek <redacted>
diff --git a/drivers/staging/dream/synaptics_i2c_rmi.c b/drivers/staging/dream/synaptics_i2c_rmi.c
index dc1e3c7..6e23276 100644
--- a/drivers/staging/dream/synaptics_i2c_rmi.c
+++ b/drivers/staging/dream/synaptics_i2c_rmi.c
@@ -373,6 +373,12 @@ static int __devinit synaptics_ts_probe(
 		goto err_check_functionality_failed;
 	}
 
+	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA)) {
+		pr_err("synaptics_ts_probe: need I2C_FUNC_SMBUS_WORD_DATA\n");
+		ret = -ENODEV;
+		goto err_check_functionality_failed;
+	}
+
 	ts = kzalloc(sizeof(*ts), GFP_KERNEL);
 	if (ts == NULL) {
 		ret = -ENOMEM;
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help