From patchwork Wed Dec 11 14:51:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 181218 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp635990ile; Wed, 11 Dec 2019 06:52:08 -0800 (PST) X-Google-Smtp-Source: APXvYqy0RMHDDa49q78kGDf5UswVkC/KA+GVVwuiKvX+g0Dvz6IeSscnXgXT027CGodApuFzEilt X-Received: by 2002:aca:cdd6:: with SMTP id d205mr2972294oig.90.1576075927875; Wed, 11 Dec 2019 06:52:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576075927; cv=none; d=google.com; s=arc-20160816; b=t2WI+wJuYHHFhL4b1DEPPtTy5GJes3ZzUTLrwin1bgt9XT8fu3Q7efF7KKJDkUg5j+ 0vqd4kjgZF98eIp25P+RbNJn/YLJNyu6QTLHLB4j47f5bV7Su6nHYow/9JpKMsnWAgdX nEARhIQT+zoB5/Au5BEpW8/omkgLF+MFu4Ti9TJMhK4TUwSSoa7Sg+2UDSnoKbV5R+j5 8RPxxijTKb5u96sDrQQ1yT6/R2fgSg9mLKw75bmmDR8OY8oLUUaCLcJqNLPRorUKNs7K e1pf5W7PTWC4z4Wr3I4nWKdR9bUyndHSrdqhG609Q9P9JAEQIuAQcJz9NjqjI4dqfPJX bs1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=6yPCbgLPq9lCGS66YYBtZYi6Uzkol1G5zMpyUCDGzKk=; b=GVtwVpHhLdlyWC0nLYsU3ZeXdfNZfxirzBrnkNHfWatiejVZmEESZ3lsI7Jvdq3mAG NLzuNUbTO9nen4xhiuD4qmqGFeHODSmup5HbrKJx0szPADBjHOAyUpx3tAcnGLQOcefR EdSJ0UXUygkjcQjO+TrHKBgvfHReLElB9Mp0FA8hjHdl1vel5RyY8Q+g53sbjJuTxHPb ICx2A6+PiHnE5uuTDtJH7msy+tTiJOekiOAv3/7uh9BTt57Mk7TkO6Wx03r8WDWYxzg1 5l6d4/lTL53E7B8iDbVpNROZ14kBUobX9TUg2uKZV2OfXdH6PCCzy/1MCFtDTQRYy7Uy 91gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=NQhJYAwR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m24si1243961otn.67.2019.12.11.06.52.07; Wed, 11 Dec 2019 06:52:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=NQhJYAwR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729461AbfLKOwG (ORCPT + 27 others); Wed, 11 Dec 2019 09:52:06 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:35246 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbfLKOwG (ORCPT ); Wed, 11 Dec 2019 09:52:06 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20191211145204euoutp01fbb17d38aab8048611cd86925ff66739~fWLPwdzDB2200522005euoutp01P for ; Wed, 11 Dec 2019 14:52:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20191211145204euoutp01fbb17d38aab8048611cd86925ff66739~fWLPwdzDB2200522005euoutp01P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1576075924; bh=6yPCbgLPq9lCGS66YYBtZYi6Uzkol1G5zMpyUCDGzKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NQhJYAwR9CmUxA4hzacki723PcW4H11W77l+Y0JXiM/ZgYIQ6/v4yFLwU0wp4TREa PG0m1P5UZaunMhJTgNVzlcojrxVTYVM5galUq0DI0OObVm1u+LoTkeEsFkvvko0tck pcIAfyH7ngYexBbR25UCSvKFZI2o6xuOlvfdiU/Q= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20191211145204eucas1p1eed87b54d9998261541ed5de631bd8f1~fWLPcvuGs1611016110eucas1p1B; Wed, 11 Dec 2019 14:52:04 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 5D.CE.60698.49201FD5; Wed, 11 Dec 2019 14:52:04 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20191211145203eucas1p2aa9445d7b778451ff1da0e552ccdae18~fWLPKC6pS1912919129eucas1p23; Wed, 11 Dec 2019 14:52:03 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20191211145203eusmtrp2e34c38f422a444028fab665fdba7fe16~fWLPJR_qW0452204522eusmtrp2h; Wed, 11 Dec 2019 14:52:03 +0000 (GMT) X-AuditID: cbfec7f5-a0fff7000001ed1a-76-5df102949857 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 67.6B.07950.39201FD5; Wed, 11 Dec 2019 14:52:03 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20191211145202eusmtip2fcc25505ece3a2c913bad879caf94a57~fWLOW-cWL1112911129eusmtip2C; Wed, 11 Dec 2019 14:52:02 +0000 (GMT) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marek Szyprowski , Greg Kroah-Hartman , Krzysztof Kozlowski , Matthias Brugger , Maxime Ripard , Chen-Yu Tsai , Andy Gross , Bjorn Andersson , Stefan Agner , Chunfeng Yun , Linus Walleij , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 1/4] ARM: dts: exynos: Correct USB3503 GPIOs polarity Date: Wed, 11 Dec 2019 15:51:55 +0100 Message-Id: <20191211145155.24927-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191211145054.24835-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0iTURjufHdnk2/T8GCSMcgwUpNJnbKsQOgjgvJPPwTTpZ+3vLE5rQiq aVajwsTI7KKpaXjZ5hRNsy01WiY4dbYknVZmUKBhWrayy7Yv699ze8/z8nIYXGohA5j07Dxe ma3IlFEiov2p0xpahs3Hb3k9TqLB6R8EainXk2jAPEeg86bbBCqs0VPIajXQqGy5HkPGaTuJ bF23KGQrHAao3GrCUHXdORw1P3HQSFMkR8UX60jUqjtPI2evFdsj4WqWJnHO8LaR5DorHDRn bLhIcRP2booz326iudba01xRv5ngrrQ1AG7BuO6QKE60M5nPTM/nleHRiaI0Te0EyNVJjp8t GcXOgCEfLfBiIBsJTd8/01ogYqTsfQCn9AOU25CyiwDeHP9rLAD46J4GX5lYqNRQglEP4ILe QQrENfF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UioCqxc/52MJtXwFbiy88FLBAr5CVWbzjADGJzCthJ dH1bxwJxkq3Ep9ttbBMY+RYwMqxiFEktLc5Nzy020itOzC0uzUvXS87P3cQIjKRtx35u2cHY 9S74EKMAB6MSD++C7e9jhVgTy4orcw8xSnAwK4nwHm97FyvEm5JYWZValB9fVJqTWnyI0RTo qInMUqLJ+cAozyuJNzQ1NLewNDQ3Njc2s1AS5+0QOBgjJJCeWJKanZpakFoE08fEwSnVwLjA x0pO3KBY64Kd3eJjgXYPNlb/+lwtGfGs3jjv2ZbjK/g51ziudfayO/kyfcbUp4Ivnq1vUtnQ znQwOcs8sEfabt6HZOdKz4iadKZtEzIPNZx952bUfdavLmbnkXPfjj6L9/l/vPJV7P67nK45 m9pPfVh86VafpnfN6beO6mlKy1U3uCTovFZiKc5INNRiLipOBADiH/wougIAAA== X-CMS-MailID: 20191211145203eucas1p2aa9445d7b778451ff1da0e552ccdae18 X-Msg-Generator: CA X-RootMTR: 20191211145203eucas1p2aa9445d7b778451ff1da0e552ccdae18 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20191211145203eucas1p2aa9445d7b778451ff1da0e552ccdae18 References: <20191211145054.24835-1-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Current USB3503 driver ignores GPIO polarity and always operates as if the GPIO lines were flagged as ACTIVE_HIGH. Fix the polarity for the existing USB3503 chip applications to match the chip specification and common convention for naming the pins. The only pin, which has to be ACTIVE_LOW is the reset pin. The remaining are ACTIVE_HIGH. This change allows later to fix the USB3503 driver to properly use generic GPIO bindings and read polarity from DT. Signed-off-by: Marek Szyprowski --- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 2 +- arch/arm/boot/dts/exynos5250-arndale.dts | 2 +- arch/arm/boot/dts/exynos5410-odroidxu.dts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi index ea55f377d17c..9c39e82e4ecb 100644 --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi @@ -267,7 +267,7 @@ intn-gpios = <&gpx3 0 GPIO_ACTIVE_HIGH>; connect-gpios = <&gpx3 4 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpx3 5 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpx3 5 GPIO_ACTIVE_LOW>; initial-mode = <1>; }; diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts index d6c85efdb465..3eddf5dbcf7b 100644 --- a/arch/arm/boot/dts/exynos5250-arndale.dts +++ b/arch/arm/boot/dts/exynos5250-arndale.dts @@ -154,7 +154,7 @@ compatible = "smsc,usb3503a"; reset-gpios = <&gpx3 5 GPIO_ACTIVE_LOW>; - connect-gpios = <&gpd1 7 GPIO_ACTIVE_LOW>; + connect-gpios = <&gpd1 7 GPIO_ACTIVE_HIGH>; }; }; diff --git a/arch/arm/boot/dts/exynos5410-odroidxu.dts b/arch/arm/boot/dts/exynos5410-odroidxu.dts index e0db251e253f..4f9297ae0763 100644 --- a/arch/arm/boot/dts/exynos5410-odroidxu.dts +++ b/arch/arm/boot/dts/exynos5410-odroidxu.dts @@ -170,7 +170,7 @@ intn-gpios = <&gpx0 7 GPIO_ACTIVE_HIGH>; connect-gpios = <&gpx0 6 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpx1 4 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpx1 4 GPIO_ACTIVE_LOW>; initial-mode = <1>; clock-names = "refclk"; From patchwork Wed Dec 11 14:46:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 181214 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp630015ile; Wed, 11 Dec 2019 06:47:00 -0800 (PST) X-Google-Smtp-Source: APXvYqxi5GeKNnNWERVy1EJ5NqpBNsEykCkEpyK5zPNvTaMiMF0opLVr9JfFarDiparUxy13HdMF X-Received: by 2002:a05:6830:1b71:: with SMTP id d17mr2375559ote.42.1576075620758; Wed, 11 Dec 2019 06:47:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576075620; cv=none; d=google.com; s=arc-20160816; b=CP8jxE6fIJp9dfVDcRlPDXkIQzkcL0Ivh3PkSriS8X+SStLYlvTZKTLehwNLh6DIIF EvOE6NPLts8stHDX7xdKbP4isPFmO6PzNkWalBocN+yOOxID/wG6dtVhN3lLDwPp8bN8 XmTCzCQKvDb75P90gxUMdr9XJSeTOpp9+6KHjNCxa5rNLFwlb3ROibylrRfEGTpfylL/ F6nnRSBl7iCd41E9Z/WrB36R6xqIKeWZmvBYSpsUNhXMoqK7ghuIVMb/MOPBxTekyHc4 pGh5uu6maSDyXOBzAjMb6dILNI6bSvZrESPNjWE8eQAqK92niDUYvdheksJngif20f6X XWIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=G6e9bRQSJqszd1aQwd52ZOX8/ksTctU4pV8j86XTo3M=; b=w0T9YVpnhvxzn70xJHOM77G2zzjz71mGjuFMU9ZT/WaNcpQcTmNjcO+mojDt0CZiK5 5bG7Ynj4UMdasNs7lT29+YjxNQbZOQGLYS1I0RSyGeP/zKZtG2eNj18x9V7Hwjj6NP7u R11GxfhkpszKh01vivQQQwYhanRBRLoPxfaN5ZPTZzh0a2YDW0eMyRcdCJGJWCCwDNnn otH30/p07AHf24I4CvGzHNoeR1OeBRzqjXq2mddKebMimodYQAGm9tLyzQm+8EebrfYY FdAwJNZwabwJQMA6IGveq4GHPdS8Fi1YVd7mOd+2ZLtF2lRqvwFSLkLXdzftboyDgAwV kgFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=lzubIgKw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si1235993ott.186.2019.12.11.06.47.00; Wed, 11 Dec 2019 06:47:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=lzubIgKw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730048AbfLKOq7 (ORCPT + 27 others); Wed, 11 Dec 2019 09:46:59 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:55239 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729481AbfLKOqx (ORCPT ); Wed, 11 Dec 2019 09:46:53 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20191211144650euoutp02947c0ff4532acb91e3c22e69975f7e0a~fWGr0dYU71029810298euoutp02K for ; Wed, 11 Dec 2019 14:46:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20191211144650euoutp02947c0ff4532acb91e3c22e69975f7e0a~fWGr0dYU71029810298euoutp02K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1576075611; bh=G6e9bRQSJqszd1aQwd52ZOX8/ksTctU4pV8j86XTo3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lzubIgKwZfy4HAX7lB01PSkFt3fBJBiHmnLe3JGi/tZ+mb/P15Ppr007AHVIkS1cp Ot6qG+dQYkjnLK/hM7Z6bo6DupRQXsNSk2UMyotVaW4i6a0Dc+mhI/sMIbfcy0+r2m yu8Opi5w15lTTHPwDYsqqm+fGrKSN0JaL0ynn1zY= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20191211144650eucas1p231d382044738e0fdbc83b784f98e5e90~fWGrO-Lbn0790307903eucas1p2r; Wed, 11 Dec 2019 14:46:50 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id E2.2F.61286.A5101FD5; Wed, 11 Dec 2019 14:46:50 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20191211144649eucas1p2ec8ca5bec84c179a5cbf01a285e82837~fWGq4tLeb1014710147eucas1p2Q; Wed, 11 Dec 2019 14:46:49 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20191211144649eusmtrp29e7ed2584f7d5ea7a929a28493ec9685~fWGq39SQt0169801698eusmtrp27; Wed, 11 Dec 2019 14:46:49 +0000 (GMT) X-AuditID: cbfec7f2-ef1ff7000001ef66-90-5df1015aeb85 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F0.AA.07950.95101FD5; Wed, 11 Dec 2019 14:46:49 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20191211144649eusmtip1a62ee86c383fc63f9046d4477260ebca~fWGqQL9vk0730007300eusmtip1M; Wed, 11 Dec 2019 14:46:49 +0000 (GMT) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marek Szyprowski , Greg Kroah-Hartman , Krzysztof Kozlowski , Matthias Brugger , Maxime Ripard , Chen-Yu Tsai , Andy Gross , Bjorn Andersson , Stefan Agner , Chunfeng Yun , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 3/4] ARM: dts: sun8i: a83t: Correct USB3503 GPIOs polarity Date: Wed, 11 Dec 2019 15:46:37 +0100 Message-Id: <20191211144638.24676-4-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191211144638.24676-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSe0iTURzl7nu6WnxN04uFwsrAMG0ZdOkhGf3xZUQSQWBZLf1Qcz7YnGZB Pps5LCsMx9Cs+ShfUzfRNPONo0TnHIhUSj6oFDTNwhdofn5W/51z7jm/87uXS2PSVsKdjopN 4FSxCqWMFOMNPcu2gyFgPvSQZVGK+idWcVSnryFQb9ssjrJaC3GUUVxDIputlkLmiSECOZoL SOTIsAOkt7WKkLHsPoaqu0colJ7pj7TZZQSymLIotNxpE51i2OLFUYytHa8k2CbDCMWaK7JJ 9vNQC8m2FVZRrKUkhc1834azj+orALtg9ggWh4hPhHPKqERO5RdwQxw5aj0anyu+PbFUJ0oF jbQOONGQOQJLJmdIHRDTUuY1gCuDU4RAfgHYMZ+1RRYANOZN4DpAb0ZmC6IF/RWAL0ufE/yo zcQ3gw+PSUYOdTO6zbEuTBWAqw/1OE8wph+DhRl2nHc5Mxdg2nou4DHOeMG5dzkUjyXMSWiZ 6iOFBT1hZW07xjc7MQEwryOZnwOZIQp+mlsXCZ4zUN/RjQnYGU5b6ykB74HrTUU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s5II7/G2d7FCvCmJlVWpRfnxRaU5qcWHGE2BbprI LCWanA+M6rySeENTQ3MLS0NzY3NjMwslcd4OgYMxQgLpiSWp2ampBalFMH1MHJxSDYxzfysY lifYiR1q/Nn/p7Vduba9WTjLy0qsb3v+Cp5DmZKOS9c+Kny95GOA9830KOEb554cfGTKIX5+ aWu14c5ztl/3/bpqOVtb1WLn6t7E4vJtqx7el3/HkdnCMvWcmdKOtyXN0w5uz7bS3GJqsCNQ 2pXl02P3lv7Cv5fvT20+e/DTYtmgGfuVWIozEg21mIuKEwHzY67vsgIAAA== X-CMS-MailID: 20191211144649eucas1p2ec8ca5bec84c179a5cbf01a285e82837 X-Msg-Generator: CA X-RootMTR: 20191211144649eucas1p2ec8ca5bec84c179a5cbf01a285e82837 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20191211144649eucas1p2ec8ca5bec84c179a5cbf01a285e82837 References: <20191211144638.24676-1-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Current USB3503 driver ignores GPIO polarity and always operates as if the GPIO lines were flagged as ACTIVE_HIGH. Fix the polarity for the existing USB3503 chip applications to match the chip specification and common convention for naming the pins. The only pin, which has to be ACTIVE_LOW is the reset pin. The remaining are ACTIVE_HIGH. This change allows later to fix the USB3503 driver to properly use generic GPIO bindings and read polarity from DT. Signed-off-by: Marek Szyprowski --- arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts index fb928503ad45..d9be511f054f 100644 --- a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts +++ b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts @@ -101,7 +101,7 @@ initial-mode = <1>; /* initialize in HUB mode */ disabled-ports = <1>; intn-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ - reset-gpios = <&pio 4 16 GPIO_ACTIVE_HIGH>; /* PE16 */ + reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */ connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */ refclk-frequency = <19200000>; }; From patchwork Wed Dec 11 14:46:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 181215 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp630057ile; Wed, 11 Dec 2019 06:47:02 -0800 (PST) X-Google-Smtp-Source: APXvYqzCdgkLInKOKeypSzFX0Mk4KjXPRPlc7o9jMYijgHIzF4dnQP/z4EsSdzGA7hMrKLrtEKKM X-Received: by 2002:a05:6830:1e69:: with SMTP id m9mr2460319otr.335.1576075622312; Wed, 11 Dec 2019 06:47:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576075622; cv=none; d=google.com; s=arc-20160816; b=e96ABZkza0asd0ufKUTyrU0yj3zynDzKtey6JmF88qDemaiyTJdBDvQIODa7OXzh/0 OiPcht1dzRRhA4hehnyfb8pA9fS/MQdg1BldY2YSMk9hh+tGhBDN1YhzXknThOEzefWG DGe7lxYRNKRLCBp0EdpgCXfYjK49UhrPeMDfwbqPls5Ri+vFf4VWRvX+MjkaLjCo8KpY BYgsrJEvgQCb8k7QET1V8YX8NX8Fr4fzK/Zp3vdPmhO7aMhMF9Pdmrd/rFGPDG5JtffF ID+kHX34Z6k11alw3oqAD/+k3a3JFuPhZi01y86BSHj0IywZ7yvfTBAtG5oXICJlbVWv niCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=jPVQGv2B63dkrb4xPXViL+0AtlLT78bLnq0v7ybfs38=; b=n8+R11Xw4TY4zYJMzzHnVoSzUHFhiiOqhRFpOUSWnbsSYvM4GROzJUYI8Xn5JjYCCc wu4WQhcq+aoOwgbAvy+YegDMhW9+D1SkdaZmVWhzXHY3UpsymIK1CNgijmkGOen/oByL b5FZzKB75mZfnGzlWSGyEAHu9+eOeDnUy7lAakcdYaPw1IqHNqZn1HBJHb2vdutyE5DZ BWoa47XQu45Lz+qHQXQ4vOg7OFvOIiDlSClz1Sv7Rue2aaSBnRIELAuMnFGc/twTCjN+ 9kuPeNdvUULqe2YegoVAqqD2z8wZ/3iKt1SYossulY3PwE+arcC1NINMhPn67qEqyG03 NAUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="THjkas/M"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si1235993ott.186.2019.12.11.06.47.01; Wed, 11 Dec 2019 06:47:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="THjkas/M"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730067AbfLKOrB (ORCPT + 27 others); Wed, 11 Dec 2019 09:47:01 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:33329 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729370AbfLKOqx (ORCPT ); Wed, 11 Dec 2019 09:46:53 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20191211144651euoutp01c20e69bb536b438dc49d86130c39dbbb~fWGsp0Zas1954619546euoutp01C for ; Wed, 11 Dec 2019 14:46:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20191211144651euoutp01c20e69bb536b438dc49d86130c39dbbb~fWGsp0Zas1954619546euoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1576075611; bh=jPVQGv2B63dkrb4xPXViL+0AtlLT78bLnq0v7ybfs38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=THjkas/MzYhyi5bxqtCiFaTMibrLiG6/ck6oyH1BG9YDd+R0tv75XJyMeZIH2Z3Uc Cqb6KktBqHRIYoiJmozBgSLRRo8su4NtNjz4qtYJyLCPMFdXUie/JzePoGOJ64PTnI WCMy3cUoT1Q0+9I6X+VX/ESrMMr24h7OiDpZmNcQ= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20191211144651eucas1p2a3b9c45b1a4754c000c8860c82504333~fWGr_xD2d0794007940eucas1p2Z; Wed, 11 Dec 2019 14:46:51 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id E4.2F.61286.B5101FD5; Wed, 11 Dec 2019 14:46:51 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20191211144650eucas1p221857c5e96ee4b5730fad80e105933ac~fWGroaE5d1014710147eucas1p2R; Wed, 11 Dec 2019 14:46:50 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20191211144650eusmtrp26bb810620493b236aed5f8ff33c1102f~fWGrnsfxn0169801698eusmtrp29; Wed, 11 Dec 2019 14:46:50 +0000 (GMT) X-AuditID: cbfec7f2-f0bff7000001ef66-93-5df1015b3e91 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 42.AA.07950.A5101FD5; Wed, 11 Dec 2019 14:46:50 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20191211144649eusmtip1181d94ddc9fa416ac400580ecdc322e8~fWGq4HQtg0888708887eusmtip19; Wed, 11 Dec 2019 14:46:49 +0000 (GMT) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marek Szyprowski , Greg Kroah-Hartman , Krzysztof Kozlowski , Matthias Brugger , Maxime Ripard , Chen-Yu Tsai , Andy Gross , Bjorn Andersson , Stefan Agner , Chunfeng Yun , Bartlomiej Zolnierkiewicz , Linus Walleij Subject: [PATCH v2 4/4] usb: usb3503: Convert to use GPIO descriptors Date: Wed, 11 Dec 2019 15:46:38 +0100 Message-Id: <20191211144638.24676-5-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191211144638.24676-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSaUhUURjlzntv3nNw5DkjeF1KGigryAWjLqWSYfGEjET6k0015XPBlRnX /iTuDikmSpNmiYqW+5bOaGkuOamD44JmkFppoImWS4Yams9n9u+c757znXMvl8Ik7whrKjg8 ilWGK0JlQhHe3LsxeMoPLMud+uoxNDizhaN6TS2BBjqWcJTWXoijpJJaITIa60iU+6dcgBpm xgk02vpUiEaThgHSGNsFqLgsBUPVPZMkSkx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kZ2hpoWdkYqln aGwea2VkqqRvZ5OSmpNZllqkb5egl7Hl8Tb2gvkGFd9OPWFtYDyu3sXIwSEhYCLReliji5GL Q0hgKaPE0yfHmLsYOYHiMhInpzWwQtjCEn+udbFBFH1ilFh9ajNYgk3AUKLrLURCRGADo8SZ 909YQBLMAk0sEicPqYDYwgKuEh3rLoI1sAioSszu6GMCsXkFbCX2n/nHCLFBXmL1hgPMIBdx CthJTDlYCRIWAiq5N+kQ2wRGvgWMDKsYRVJLi3PTc4uN9IoTc4tL89L1kvNzNzECo2jbsZ9b djB2vQs+xCjAwajEw7tg+/tYIdbEsuLK3EOMEhzMSiK8x9vexQrxpiRWVqUW5ccXleakFh9i NAW6aSKzlGhyPjDC80riDU0NzS0sDc2NzY3NLJTEeTsEDsYICaQnlqRmp6YWpBbB9DFxcEo1 MKpknr333+BegsOc+Rc3p//yKv4fKy7yJ4zvc3qNimDDs6hMP2XXmflvzFO3b1j3al7Jxcdi PZ+nc9sILFq0ZsUBuWU50oUfL3/kfKkw94LmGu/JOy9NFM7Z9OdFrcv869ffP1PdLPfmjahc 2pH7BuK8xQYCxis2xiZ92/r3TvOOz8ftumqVZj5TYinOSDTUYi4qTgQArFTau7gCAAA= X-CMS-MailID: 20191211144650eucas1p221857c5e96ee4b5730fad80e105933ac X-Msg-Generator: CA X-RootMTR: 20191211144650eucas1p221857c5e96ee4b5730fad80e105933ac X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20191211144650eucas1p221857c5e96ee4b5730fad80e105933ac References: <20191211144638.24676-1-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij This converts the USB3503 to pick GPIO descriptors from the device tree instead of iteratively picking out GPIO number references and then referencing these from the global GPIO numberspace. The USB3503 is only used from device tree among the in-tree platforms. If board files would still desire to use it they can provide machine descriptor tables. Make sure to preserve semantics such as the reset delay introduced by Stefan. Cc: Chunfeng Yun Cc: Marek Szyprowski Cc: Stefan Agner Cc: Krzysztof Kozlowski Signed-off-by: Linus Walleij [mszyprow: invert the logic behind reset GPIO line] Signed-off-by: Marek Szyprowski --- drivers/usb/misc/usb3503.c | 94 ++++++++++----------------- include/linux/platform_data/usb3503.h | 3 - 2 files changed, 35 insertions(+), 62 deletions(-) -- 2.17.1 diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c index 72f39a9751b5..116bd789e568 100644 --- a/drivers/usb/misc/usb3503.c +++ b/drivers/usb/misc/usb3503.c @@ -7,11 +7,10 @@ #include #include -#include +#include #include #include #include -#include #include #include #include @@ -47,19 +46,19 @@ struct usb3503 { struct device *dev; struct clk *clk; u8 port_off_mask; - int gpio_intn; - int gpio_reset; - int gpio_connect; + struct gpio_desc *intn; + struct gpio_desc *reset; + struct gpio_desc *connect; bool secondary_ref_clk; }; static int usb3503_reset(struct usb3503 *hub, int state) { - if (!state && gpio_is_valid(hub->gpio_connect)) - gpio_set_value_cansleep(hub->gpio_connect, 0); + if (!state && hub->connect) + gpiod_set_value_cansleep(hub->connect, 0); - if (gpio_is_valid(hub->gpio_reset)) - gpio_set_value_cansleep(hub->gpio_reset, state); + if (hub->reset) + gpiod_set_value_cansleep(hub->reset, !state); /* Wait T_HUBINIT == 4ms for hub logic to stabilize */ if (state) @@ -115,8 +114,8 @@ static int usb3503_connect(struct usb3503 *hub) } } - if (gpio_is_valid(hub->gpio_connect)) - gpio_set_value_cansleep(hub->gpio_connect, 1); + if (hub->connect) + gpiod_set_value_cansleep(hub->connect, 1); hub->mode = USB3503_MODE_HUB; dev_info(dev, "switched to HUB mode\n"); @@ -163,13 +162,11 @@ static int usb3503_probe(struct usb3503 *hub) int err; u32 mode = USB3503_MODE_HUB; const u32 *property; + enum gpiod_flags flags; int len; if (pdata) { hub->port_off_mask = pdata->port_off_mask; - hub->gpio_intn = pdata->gpio_intn; - hub->gpio_connect = pdata->gpio_connect; - hub->gpio_reset = pdata->gpio_reset; hub->mode = pdata->initial_mode; } else if (np) { u32 rate = 0; @@ -230,59 +227,38 @@ static int usb3503_probe(struct usb3503 *hub) } } - hub->gpio_intn = of_get_named_gpio(np, "intn-gpios", 0); - if (hub->gpio_intn == -EPROBE_DEFER) - return -EPROBE_DEFER; - hub->gpio_connect = of_get_named_gpio(np, "connect-gpios", 0); - if (hub->gpio_connect == -EPROBE_DEFER) - return -EPROBE_DEFER; - hub->gpio_reset = of_get_named_gpio(np, "reset-gpios", 0); - if (hub->gpio_reset == -EPROBE_DEFER) - return -EPROBE_DEFER; of_property_read_u32(np, "initial-mode", &mode); hub->mode = mode; } - if (hub->port_off_mask && !hub->regmap) - dev_err(dev, "Ports disabled with no control interface\n"); - - if (gpio_is_valid(hub->gpio_intn)) { - int val = hub->secondary_ref_clk ? GPIOF_OUT_INIT_LOW : - GPIOF_OUT_INIT_HIGH; - err = devm_gpio_request_one(dev, hub->gpio_intn, val, - "usb3503 intn"); - if (err) { - dev_err(dev, - "unable to request GPIO %d as interrupt pin (%d)\n", - hub->gpio_intn, err); - return err; - } - } - - if (gpio_is_valid(hub->gpio_connect)) { - err = devm_gpio_request_one(dev, hub->gpio_connect, - GPIOF_OUT_INIT_LOW, "usb3503 connect"); - if (err) { - dev_err(dev, - "unable to request GPIO %d as connect pin (%d)\n", - hub->gpio_connect, err); - return err; - } - } - - if (gpio_is_valid(hub->gpio_reset)) { - err = devm_gpio_request_one(dev, hub->gpio_reset, - GPIOF_OUT_INIT_LOW, "usb3503 reset"); + if (hub->secondary_ref_clk) + flags = GPIOD_OUT_LOW; + else + flags = GPIOD_OUT_HIGH; + hub->intn = devm_gpiod_get_optional(dev, "intn", flags); + if (IS_ERR(hub->intn)) + return PTR_ERR(hub->intn); + if (hub->intn) + gpiod_set_consumer_name(hub->intn, "usb3503 intn"); + + hub->connect = devm_gpiod_get_optional(dev, "connect", GPIOD_OUT_LOW); + if (IS_ERR(hub->connect)) + return PTR_ERR(hub->connect); + if (hub->connect) + gpiod_set_consumer_name(hub->connect, "usb3503 connect"); + + hub->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(hub->reset)) + return PTR_ERR(hub->reset); + if (hub->reset) { /* Datasheet defines a hardware reset to be at least 100us */ usleep_range(100, 10000); - if (err) { - dev_err(dev, - "unable to request GPIO %d as reset pin (%d)\n", - hub->gpio_reset, err); - return err; - } + gpiod_set_consumer_name(hub->reset, "usb3503 reset"); } + if (hub->port_off_mask && !hub->regmap) + dev_err(dev, "Ports disabled with no control interface\n"); + usb3503_switch_mode(hub, hub->mode); dev_info(dev, "%s: probed in %s mode\n", __func__, diff --git a/include/linux/platform_data/usb3503.h b/include/linux/platform_data/usb3503.h index e049d51c1353..d01ef97ddf36 100644 --- a/include/linux/platform_data/usb3503.h +++ b/include/linux/platform_data/usb3503.h @@ -17,9 +17,6 @@ enum usb3503_mode { struct usb3503_platform_data { enum usb3503_mode initial_mode; u8 port_off_mask; - int gpio_intn; - int gpio_connect; - int gpio_reset; }; #endif