From patchwork Tue Sep 27 22:05:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12991421 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B269C07E9D for ; Tue, 27 Sep 2022 22:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=FL7nKeRB1UdUFOrOAoLw0+dZLvC0437aAYdDPx0I0rA=; b=ZfetB96WD13nWJ dJ6nu1EBjTRouUQK4sWj0CZXiUqlknLKVILJxGez+KwGRA1H4/ag8/DVjOT3e2MZjnXNMOpumrxPj XxqQBCIqvzf+d9lR9+/Txc/3WTcyLIkJ3QfNPpgcdwboqrHrtMX86gT4xC2HcacYttIUrVauhKirq 6LWrkgr0li7e7oclFjciioDF9pXE0tlCma/nfmQ0NeYYbnFvSL+v2shjZE+pdXSUzGKB0TWuyItER QiuDmHHde22HIXmvjJGeveJGeTEpkQxsY/YbP5zLTZtbjFTQdOZt0vpXEGRNPU1MpcdXcBzPBwV2o M8XJZXqAGOfqrSviXPKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1odIhY-00Cpfo-6B; Tue, 27 Sep 2022 22:05:17 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1odIhV-00CpdS-Hi for linux-arm-kernel@lists.infradead.org; Tue, 27 Sep 2022 22:05:14 +0000 Received: by mail-pj1-x1029.google.com with SMTP id u12so2395275pjj.1 for ; Tue, 27 Sep 2022 15:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=PnX3CTK8Zi/GFiq6cOApXc7JemEFXP3BVlCstRnzeVE=; b=UZxCiPMdneRhR1zMpsq6m+Za1l+DjCwmsa12S2HstAjJJAGw0wrjYRm6sZUCylDLIH UvAFcV2u+J688aF9AGJ+0kW5aIEUsSle4gI/HkDu/kMb5MzDgY5/60DaiwA85D9zdc+F T7m95eI7arF9MJmNOS9Bw4bsvqe37h6uL2cdh+8pXT5B92x6OIjhMrEo+OzKhIE7sb0x hKl5fGG65VTblomdsVxvixTTuOYrwewaYz7pTo/M+t8XpBxKRxKoI416/bNoiVlzvy1X R40QyK4+S17bdq7ZI8A6ao2YkDEg3RHGmlWbQ/4Al+kNh2iBGd/ADI2OL5lpFMJcinEV Clhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=PnX3CTK8Zi/GFiq6cOApXc7JemEFXP3BVlCstRnzeVE=; b=DZ4wrrUfBqFI6doWshsPePPRAGjcoa5k7zJckCCOK3/eeBeuyUXE/DF3fC4LCwTxjG +7Q3xtHGqXqcuZJCTGAzsx/RwNeo+ftAkU+J0CBzVx20WpCGuUEJmZ2gp24AIsxiLrM5 OIe3G3G77VOlxYD8qouGn3eq2sDDuIqLfRlezOK1ClI0cALevj2rWnnZ0nHe1pK5+gC0 OoEX7508oJoiEMn/CQygDc0+AIV0hxAwf+4fmszmoIA/aMqEOBgW9qH4AndqCIJfB399 wo8vVycpWaIAM/3PxBzGFC7KNaw54e4zpYmDBxGpbny2QACqYsregdMykb645mbqXMpE NSIA== X-Gm-Message-State: ACrzQf1xZLQiPfDit3IgZUMikMxX6JCzM9hjT6Fv6PbJWxx8QFPgc0vQ addfpjSCacVNMZnskKv4vi8= X-Google-Smtp-Source: AMsMyM6Qey9ZeFIp1MguvDe3X+YReqLE0XvCk637reYX3ZwJhK/u/om/ItckfnCalVVon+Z4AfAKHQ== X-Received: by 2002:a17:902:d512:b0:178:6946:a2aa with SMTP id b18-20020a170902d51200b001786946a2aamr29503248plg.116.1664316309002; Tue, 27 Sep 2022 15:05:09 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:9739:ab49:3830:2cbb]) by smtp.gmail.com with ESMTPSA id e9-20020a17090301c900b001782398648dsm2051220plh.8.2022.09.27.15.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 15:05:08 -0700 (PDT) From: Dmitry Torokhov To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman Cc: Alan Stern , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO Date: Tue, 27 Sep 2022 15:05:03 -0700 Message-Id: <20220927220504.3744878-1-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220927_150513_639238_71E698D6 X-CRM114-Status: GOOD ( 13.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org EHCI Oxynos (drivers/usb/host/ehci-exynos.c) drives VBUS GPIO high when trying to power up the bus, therefore the GPIO in DTS must be marked as "active high". This will be important when EHCI driver is converted to gpiod API that respects declared polarities. Fixes: 4e8991def565 ("ARM: dts: exynos: Enable AX88760 USB hub on Origen board") Signed-off-by: Dmitry Torokhov --- arch/arm/boot/dts/exynos4412-origen.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/exynos4412-origen.dts b/arch/arm/boot/dts/exynos4412-origen.dts index 6db09dba07ff..a3905e27b9cd 100644 --- a/arch/arm/boot/dts/exynos4412-origen.dts +++ b/arch/arm/boot/dts/exynos4412-origen.dts @@ -95,7 +95,7 @@ &exynos_usbphy { }; &ehci { - samsung,vbus-gpio = <&gpx3 5 1>; + samsung,vbus-gpio = <&gpx3 5 GPIO_ACTIVE_HIGH>; status = "okay"; phys = <&exynos_usbphy 2>, <&exynos_usbphy 3>; phy-names = "hsic0", "hsic1"; From patchwork Tue Sep 27 22:05:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12991422 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E836EC6FA82 for ; Tue, 27 Sep 2022 22:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=D91g4teZfB5h88QziwYUqJbTrcO9S1ceOofukEYZrog=; b=EZfbRFzIzNG7BZ 0MCIkUwHxYKWKSxPk0eHth2ia1N8SnqmWFvsatcaAoQNQcVzseWDGNjhM5ebY+ldONgbjWCHhskpC 1VFv1hoMQPQeZRj8ZK/OAZ52yPIFdNIHx6+DcWPDQXyp+mshRi6iR45Xu4pfHAIwS3UXC8fGoIQlD sNN0TIgZ198Tw9b8jRswJoUU1uyoVCb15PNsMFm+ctwooCSMafddP0/+8XtNT4zTI1cVfCJKhHZ9c kYQZffKic169MiEJSQ5Ak36mvB9y/TLXTdO/jsgy+TQsSprFwt1LFN8LNj249BkFbUNn2AkqUVHzu bOmvH3pKZvqj2GI/UIQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1odIhh-00Cpil-D1; Tue, 27 Sep 2022 22:05:25 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1odIhZ-00CpeB-Ds for linux-arm-kernel@lists.infradead.org; Tue, 27 Sep 2022 22:05:18 +0000 Received: by mail-pf1-x435.google.com with SMTP id y136so10893338pfb.3 for ; Tue, 27 Sep 2022 15:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=sSNiRI+ap5x7MQu5aicCdFhgVcBXQnxVbZJ3Z+sJpp8=; b=OOyC2BrocNE0X+rCeeu5h8pK/QD9DXH43+jMmNO5mvsOZ1mxwh/D5n0xieeWhMZMnJ s4nHeJeglfR0/5RU++bvcwYzn6G4IrgSYGOpSs/8vrzWLfC3QhiAjd8d5J0IHFGG72+b jh1EWUQL8qtdxipQcm7saWcg8ckvv4bqxrIgzZDkfiq8H4zxtRZrSJceGlfjpfmA45LF bphWnbtWxfEZXZTatXhOlRTEL4QYDsUTf8Gwpq1uwtwfnsxGgy5PoXKCGaHpmKQiWk6F nwcdWVgZ+JBOENToCG2htL6cs8qi4PaCHV83K/lr5Ni/I/jWFAjJyQKg/VYsy92EPMVP 12DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=sSNiRI+ap5x7MQu5aicCdFhgVcBXQnxVbZJ3Z+sJpp8=; b=jdTw0uKyGRbCPM2wAy68Wv+ihXSbywb4bp9iixvWVfe934I4W5LNDjG0t5uriIEda8 8QaC1xHJGiL4A+lAnLgXKfy+/gWf/MfQW04HoMLPxQ6/R4N6gtBBoFgT2o4txeUI8NiL M92UVcXm0VHA5A13Looi8U6W4X2fa3dXBjYMNa6tpolHZVm+SmnEnQF5RdRCGFtpkWCy t8WDmoyeJhU0xCbXJ/k2BgmdxRbC9mORtC5fPLStEbuLce67HIpGkabGYKu9/As3bUTU 8e4oUiY3ygyZgsUdS41rS6ygsCpnCuuCvrJLP5rjqnZ+4qI1R70wfzeRdzYR8JEHXZpJ bg2A== X-Gm-Message-State: ACrzQf044iHAOg7GnWh5eSOB9IzMVrwnGBf8bvMqpDZv0oH/L78cJZue EeDubPRyAITBa6KEKvvWTI4= X-Google-Smtp-Source: AMsMyM7B+45kOzKa6I+J8lHdpYg6f15aeiEZITup3tLWRn8nUeSzydKNeCzYrlQc6OG9pm1jFIonVw== X-Received: by 2002:a63:1521:0:b0:43c:9566:7a6a with SMTP id v33-20020a631521000000b0043c95667a6amr15583244pgl.339.1664316311492; Tue, 27 Sep 2022 15:05:11 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:9739:ab49:3830:2cbb]) by smtp.gmail.com with ESMTPSA id e9-20020a17090301c900b001782398648dsm2051220plh.8.2022.09.27.15.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 15:05:10 -0700 (PDT) From: Dmitry Torokhov To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman Cc: Alan Stern , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API Date: Tue, 27 Sep 2022 15:05:04 -0700 Message-Id: <20220927220504.3744878-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog In-Reply-To: <20220927220504.3744878-1-dmitry.torokhov@gmail.com> References: <20220927220504.3744878-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220927_150517_560390_4DE3B5D3 X-CRM114-Status: GOOD ( 13.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch switches the driver from using legacy gpio API to the newer gpiod API. Signed-off-by: Dmitry Torokhov Acked-by: Krzysztof Kozlowski Acked-by: Alan Stern --- drivers/usb/host/ehci-exynos.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index c8e152c2e0ce..a333231616f4 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -131,20 +131,13 @@ static void exynos_ehci_phy_disable(struct device *dev) static void exynos_setup_vbus_gpio(struct device *dev) { + struct gpio_desc *gpio; int err; - int gpio; - if (!dev->of_node) - return; - - gpio = of_get_named_gpio(dev->of_node, "samsung,vbus-gpio", 0); - if (!gpio_is_valid(gpio)) - return; - - err = devm_gpio_request_one(dev, gpio, GPIOF_OUT_INIT_HIGH, - "ehci_vbus_gpio"); + gpio = devm_gpiod_get_optional(dev, "samsung,vbus", GPIOD_OUT_HIGH); + err = PTR_ERR_OR_ZERO(gpio); if (err) - dev_err(dev, "can't request ehci vbus gpio %d", gpio); + dev_err(dev, "can't request ehci vbus gpio: %d\n", err); } static int exynos_ehci_probe(struct platform_device *pdev)