Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-15-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+13 -15
+13 -15
drivers/input/touchscreen/zforce_ts.c
··· 742 742 "failed to request reset GPIO\n"); 743 743 } 744 744 745 - ts->reg_vdd = devm_regulator_get_optional(&client->dev, "vdd"); 745 + ts->reg_vdd = devm_regulator_get(&client->dev, "vdd"); 746 746 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"); 755 750 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); 762 760 763 761 error = devm_add_action_or_reset(&client->dev, zforce_reset, ts); 764 762 if (error)