input: vsense: avoid reset during probe
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 16 Sep 2017 21:34:47 +0000 (00:34 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 16 Sep 2017 21:34:47 +0000 (00:34 +0300)
It relies on the time between probes of both nubs, which is not
consistent. According to atmel docs the nub controllers should not need
an explicit reset, but if they do, it needs to be readded with a
consistent length.

drivers/input/misc/vsense.c

index e57b9ac..454d42f 100644 (file)
@@ -550,7 +550,9 @@ static int vsense_probe(struct i2c_client *client,
        }
 
        if (!vsense_reset_refcount) {
-               ret = gpio_request_one(pdata->gpio_reset, GPIOF_OUT_INIT_HIGH,
+               /* resetting drains power, as well as disabling supply,
+                * so keep it powered and out of reset at all times */
+               ret = gpio_request_one(pdata->gpio_reset, GPIOF_OUT_INIT_LOW,
                        "vsense reset");
                if (ret < 0) {
                        dev_err(&client->dev, "gpio_request error: %d, %d\n",
@@ -608,12 +610,6 @@ static int vsense_probe(struct i2c_client *client,
                goto err_regulator_enable;
        }
 
-       /* HACK */
-       if (vsense_reset_refcount == 2)
-               /* resetting drains power, as well as disabling supply,
-                * so keep it powered and out of reset at all times */
-               vsense_reset(ddata, 0);
-
        ret = vsense_input_register(ddata, ddata->mode);
        if (ret) {
                dev_err(&client->dev, "failed to register input device, "