Skip to content

Commit 16ff022

Browse files
committed
Input: zforce_ts - stop treating VDD regulator as optional
This regulator is not optional from the controller point of view, so stop treating it as such. For hard-wired designs that omit the regulator from their device trees regulator subsystem will create a dummy instance. This may introduce unnecessary delay of 100us in case of dummy regulator, but if it is important the driver should be marked as using asynchronous probing to avoid even longer delays waiting for the command completions. Also use usleep_range() instead of udelay() to avoid spinning. Tested-by: Andreas Kemnade <[email protected]> # Tolino Shine2HD Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent b5ed81c commit 16ff022

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

drivers/input/touchscreen/zforce_ts.c

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -742,23 +742,21 @@ static int zforce_probe(struct i2c_client *client)
742742
"failed to request reset GPIO\n");
743743
}
744744

745-
ts->reg_vdd = devm_regulator_get_optional(&client->dev, "vdd");
745+
ts->reg_vdd = devm_regulator_get(&client->dev, "vdd");
746746
error = PTR_ERR_OR_ZERO(ts->gpio_rst);
747-
if (error) {
748-
if (error != -ENOENT)
749-
return dev_err_probe(&client->dev, error,
750-
"failed to request vdd supply\n");
751-
} else {
752-
error = regulator_enable(ts->reg_vdd);
753-
if (error)
754-
return error;
747+
if (error)
748+
return dev_err_probe(&client->dev, error,
749+
"failed to request vdd supply\n");
755750

756-
/*
757-
* according to datasheet add 100us grace time after regular
758-
* regulator enable delay.
759-
*/
760-
udelay(100);
761-
}
751+
error = regulator_enable(ts->reg_vdd);
752+
if (error)
753+
return error;
754+
755+
/*
756+
* According to datasheet add 100us grace time after regular
757+
* regulator enable delay.
758+
*/
759+
usleep_range(100, 200);
762760

763761
error = devm_add_action_or_reset(&client->dev, zforce_reset, ts);
764762
if (error)

0 commit comments

Comments
 (0)