[PATCH v2 2/4] input: gpio-vibra: Allow to use vcc-supply alone to control the vibrator

9 views
Skip to first unread message

Ondrej Jirman

unread,
May 12, 2020, 6:22:13 PM5/12/20
to linux...@googlegroups.com, Dmitry Torokhov, Rob Herring, Mark Rutland, Maxime Ripard, Chen-Yu Tsai, Ondrej Jirman, Luca Weiss, Tomas Novotny, linux...@vger.kernel.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, linux-ar...@lists.infradead.org
Make enable-gpio optional to allow using this driver with
boards that have vibrator connected to a power supply without
intermediate gpio based enable circuitry.

Signed-off-by: Ondrej Jirman <meg...@megous.com>
---
drivers/input/misc/gpio-vibra.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/misc/gpio-vibra.c b/drivers/input/misc/gpio-vibra.c
index f79f75595dd7..f11877f04b43 100644
--- a/drivers/input/misc/gpio-vibra.c
+++ b/drivers/input/misc/gpio-vibra.c
@@ -121,7 +121,8 @@ static int gpio_vibrator_probe(struct platform_device *pdev)
return err;
}

- vibrator->gpio = devm_gpiod_get(&pdev->dev, "enable", GPIOD_OUT_LOW);
+ vibrator->gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
+ GPIOD_OUT_LOW);
err = PTR_ERR_OR_ZERO(vibrator->gpio);
if (err) {
if (err != -EPROBE_DEFER)
--
2.26.2

Reply all
Reply to author
Forward
0 new messages