From patchwork Tue May 12 22:22:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ond=C5=99ej_Jirman?= X-Patchwork-Id: 11544261 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB24314C0 for ; Tue, 12 May 2020 22:27:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AFB5E2492C for ; Tue, 12 May 2020 22:27:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=megous.com header.i=@megous.com header.b="SO6+Q+T4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731551AbgELW1U (ORCPT ); Tue, 12 May 2020 18:27:20 -0400 Received: from vps.xff.cz ([195.181.215.36]:41814 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731156AbgELW1U (ORCPT ); Tue, 12 May 2020 18:27:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1589322129; bh=8NnK5CsraaZezbyEm3ALbCdiOU7kYIlUQyLKmB3n8RA=; h=From:To:Cc:Subject:Date:References:From; b=SO6+Q+T41K4T2JL05TZZ2IY/e+nGZgKFEXLbxmq9QBlFYcu5A7X8teO00J4r4Tw2U wS6ZXVfwNFYJ1j+H58opUYdoszBJijDY3fkwh22g1xi3N0quarcGWyHpL3Wy1+Rn3G /0+dNsie3axkhfAn8fV8ZjFo/1jrPmHs7umY8phQ= From: Ondrej Jirman To: linux-sunxi@googlegroups.com, Dmitry Torokhov , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai Cc: Ondrej Jirman , Luca Weiss , Tomas Novotny , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/4] input: gpio-vibra: Allow to use vcc-supply alone to control the vibrator Date: Wed, 13 May 2020 00:22:03 +0200 Message-Id: <20200512222205.1456300-3-megous@megous.com> In-Reply-To: <20200512222205.1456300-1-megous@megous.com> References: <20200512222205.1456300-1-megous@megous.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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 --- 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)