Input: tsc2007 - check if I2C communication works during probe
authorRichard Röjfors <richard.rojfors.ext@mocean-labs.com>
Wed, 5 Aug 2009 05:34:10 +0000 (22:34 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 5 Aug 2009 05:35:49 +0000 (22:35 -0700)
Check the result when sending the power down command to the controller.

Signed-off-by: Richard Röjfors <richard.rojfors.ext@mocean-labs.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/tsc2007.c

index 3714d19..7ef0d14 100644 (file)
@@ -319,15 +319,17 @@ static int __devinit tsc2007_probe(struct i2c_client *client,
                goto err_free_mem;
        }
 
+       /* Prepare for touch readings - power down ADC and enable PENIRQ */
+       err = tsc2007_xfer(ts, PWRDOWN);
+       if (err < 0)
+               goto err_free_irq;
+
        err = input_register_device(input_dev);
        if (err)
                goto err_free_irq;
 
        i2c_set_clientdata(client, ts);
 
-       /* Prepare for touch readings - power down ADC and enable PENIRQ */
-       tsc2007_xfer(ts, PWRDOWN);
-
        return 0;
 
  err_free_irq: