From 23b8af2ab6456fb9cdf5c26258f91524d3f705ba Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Sun, 17 Sep 2017 00:34:47 +0300 Subject: [PATCH] input: vsense: avoid reset during probe 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 | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/input/misc/vsense.c b/drivers/input/misc/vsense.c index e57b9ac139f8..454d42f919e1 100644 --- a/drivers/input/misc/vsense.c +++ b/drivers/input/misc/vsense.c @@ -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, " -- 2.39.2