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: 11285263 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 B046B109A for ; Wed, 11 Dec 2019 14:52:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8450621556 for ; Wed, 11 Dec 2019 14:52:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="NQhJYAwR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729425AbfLKOwG (ORCPT ); Wed, 11 Dec 2019 09:52:06 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57168 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727457AbfLKOwG (ORCPT ); Wed, 11 Dec 2019 09:52:06 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20191211145204euoutp02febb66ef615e50682226d01be25dc51a~fWLP13A_A1305813058euoutp02V for ; Wed, 11 Dec 2019 14:52:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20191211145204euoutp02febb66ef615e50682226d01be25dc51a~fWLP13A_A1305813058euoutp02V 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 QQrENfFspIZ2pyg2AmpntZ6UH9sE4I/L5YSb4Ox3HLbb6z0lviwHTYZq0o0JdgPsrOzwYDG7 Cy46qwihLwg2Gh57ur3YaKj9qvM8BNlXNJxZ+k0JoRg42TOPCdgXfrS00QIOhL87KzFhoBDA N4PNtEAuAWjTlAMhFQX7LMOuasa1XwjUd4UL8l5omXJibhmyPnBsVuKWcRcsbb+OC7IYXiiW CulgWGHR/avtGRr5ey8ONnTZMOFEVwGcsxqwEhBU8b+sCoAG4M+rVVmpvEqezReEqRRZKnV2 alhSTpYRuL7XwC/LlwfAtHy0F7AMkK0WV3V8ipeSinzViaxeABlc5ie2FM/FS8XJihMneWVO glKd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PNZx952bUfdavLmbnkXPfjj6L9/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-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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(-) 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:52:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 11285273 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 2A96C109A for ; Wed, 11 Dec 2019 14:52:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08E8D214AF for ; Wed, 11 Dec 2019 14:52:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="mb8i57rO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729490AbfLKOwQ (ORCPT ); Wed, 11 Dec 2019 09:52:16 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57232 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729465AbfLKOwQ (ORCPT ); Wed, 11 Dec 2019 09:52:16 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20191211145214euoutp02a86a3dee44300e8c2254938b642853d6~fWLZLtlw21465914659euoutp02G for ; Wed, 11 Dec 2019 14:52:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20191211145214euoutp02a86a3dee44300e8c2254938b642853d6~fWLZLtlw21465914659euoutp02G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1576075934; bh=qTaGKuC9cCAB+1j7GCP6On5IHmid3yqkEWyTajSdyOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mb8i57rOTKdqMiFgX8p5YDI8YqNT+740uzElwlU95aaj0Sc85UjitjIzCDagHpvbn /6AI1IJU9Nx1snXAlV41sFf4C3ENQjXFRSDJ65mO54C8mrYTeEAWW5twEoWMGCk3Sq Oc1kSlYkKHqHRim9PZAvBWeHA60WwcZSHvrEpMvE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20191211145214eucas1p2b19c265b185e2ac4c73d146201a443e8~fWLYv5LWD0707307073eucas1p2O; Wed, 11 Dec 2019 14:52:14 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 42.DE.60698.E9201FD5; Wed, 11 Dec 2019 14:52:14 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20191211145213eucas1p2c438f848ba705fa407331bb31b03b626~fWLYd1P7J1065910659eucas1p2R; Wed, 11 Dec 2019 14:52:13 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20191211145213eusmtrp2c30d1e464771e3d3f4d441d8d5275168~fWLYdCsMM0450404504eusmtrp2M; Wed, 11 Dec 2019 14:52:13 +0000 (GMT) X-AuditID: cbfec7f5-a0fff7000001ed1a-94-5df1029ea016 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 7E.D9.08375.D9201FD5; Wed, 11 Dec 2019 14:52:13 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20191211145213eusmtip1f8bac6888c5908f6393dfadf01ec598f~fWLXzNfb-1276212762eusmtip1N; Wed, 11 Dec 2019 14:52:13 +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 2/4] ARM: dts: qcom: Correct USB3503 GPIOs polarity Date: Wed, 11 Dec 2019 15:52:08 +0100 Message-Id: <20191211145208.24976-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: H4sIAAAAAAAAA0WSe0hTYRjG+XbOzjkbzU5T9Esjc1Rg4A2NPii1oMv5IyKDwgTRmadpOZNN zYLInJc2LM07orbUNLxteU2peUldEWxeYBk2SyXpglbMDC9km8fsv9/7vO/zPS8vH4WJh/ju VHxiMqtIlCZICCHeObxs8qni/Yz0f1eII9PsKo6elun46E3vAo5yDJU4UtXoCGQ260lUtFbP Q62z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Unk1RfmlJqkJGfnGJrVK0oYWRnqGlhZ6RiaWe obF5rJWRqZK+nU1Kak5mWWqRvl2CXsa5noMsBcc4Ky58/sbSwPiLvYuRk0NCwERi55IPjF2M XBxCAksZJY4032GBSMhInJzWwAphC0v8udbFBlH0iVFi38NHYN1sAoYSXW8hEiICGxglzrx/ wgLiMAs0sUhMnfWYCaRKWMBNYsHd/0AJDg4WAVWJo/3yIGFeAVuJhxO2M0JskJdYveEAM4jN KWAn0fVtHdgVQkA1n263sU1g5FvAyLCKUSS1tDg3PbfYUK84Mbe4NC9dLzk/dxMjMJK2Hfu5 eQfjpY3BhxgFOBiVeHgXbH8fK8SaWFZcmXuIUYKDWUmE93jbu1gh3pTEyqrUovz4otKc1OJD jKZAN01klhJNzgdGeV5JvKGpobmFpaG5sbmxmYWSOG+HwMEYIYH0xJLU7NTUgtQimD4mDk6p BkYhs8pfCx+buiwpq/+1h0dywZkpDj+3fuFyPM8v5u4nUOKz22pvgtDmmJfqMxfMUdt9PrM5 fPeBzDiPexF5r8P7dJ6U+vxaXFq5RiZxw9LgZt/8f3WfZr/7mlo3ITx0766TxTudShr7esyC A3aYWzdnL1ix98Wt72+cBfn+Sn7T2mIaekRGRUeJpTgj0VCLuag4EQDc3CIRugIAAA== X-CMS-MailID: 20191211145213eucas1p2c438f848ba705fa407331bb31b03b626 X-Msg-Generator: CA X-RootMTR: 20191211145213eucas1p2c438f848ba705fa407331bb31b03b626 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20191211145213eucas1p2c438f848ba705fa407331bb31b03b626 References: <20191211145054.24835-1-m.szyprowski@samsung.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 Acked-by: Bjorn Andersson --- arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dts b/arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dts index 26160c324802..942e3a2cac35 100644 --- a/arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dts +++ b/arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dts @@ -143,7 +143,7 @@ compatible = "smsc,usb3503a"; reg = <0x8>; connect-gpios = <&gpioext2 1 GPIO_ACTIVE_HIGH>; - intn-gpios = <&gpioext2 0 GPIO_ACTIVE_LOW>; + intn-gpios = <&gpioext2 0 GPIO_ACTIVE_HIGH>; initial-mode = <1>; }; }; From patchwork Wed Dec 11 14:52:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 11285275 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 988C014E3 for ; Wed, 11 Dec 2019 14:52:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DAFF21556 for ; Wed, 11 Dec 2019 14:52:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="oUC90SXC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729696AbfLKOw0 (ORCPT ); Wed, 11 Dec 2019 09:52:26 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:35388 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729663AbfLKOwZ (ORCPT ); Wed, 11 Dec 2019 09:52:25 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20191211145223euoutp01674b020d42c615f7ac7d1f9a40b24017~fWLhhUsBa2200222002euoutp01h for ; Wed, 11 Dec 2019 14:52:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20191211145223euoutp01674b020d42c615f7ac7d1f9a40b24017~fWLhhUsBa2200222002euoutp01h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1576075943; bh=G6e9bRQSJqszd1aQwd52ZOX8/ksTctU4pV8j86XTo3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oUC90SXCFVcOLJV8pritfcW+PZOoU6c+WfmaCARp6Tiel1SxYgqDUyHvMCl+pzosB 1GQ+q0DQ8z0CKz/vrnl5khSWo4sXDpbBNeOWWKcv4DFia2aZrmKfXhpjqoqDyQedZh hUURUH1j8MZgbKU1VRcJVMhEsxxRbPjoXtHaTPdM= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20191211145222eucas1p2d6430e07a3ef5d59d68f1fbe612cf0c1~fWLg7Vwo92757227572eucas1p2D; Wed, 11 Dec 2019 14:52:22 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 47.F9.60679.6A201FD5; Wed, 11 Dec 2019 14:52:22 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20191211145222eucas1p1d761af59e04017ddadbdbd1cceb59b1f~fWLgd3r6x1209212092eucas1p1P; Wed, 11 Dec 2019 14:52:22 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20191211145222eusmtrp29491b3876f290c709fbbe27d17c8d7c1~fWLgc2eWW0452204522eusmtrp2A; Wed, 11 Dec 2019 14:52:22 +0000 (GMT) X-AuditID: cbfec7f4-0e5ff7000001ed07-62-5df102a61dd7 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B0.7B.07950.6A201FD5; Wed, 11 Dec 2019 14:52:22 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20191211145221eusmtip15e0632ba3893c653ea497e46b0dc3a7c~fWLfn9mX51278512785eusmtip1O; Wed, 11 Dec 2019 14:52:21 +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 3/4] ARM: dts: sun8i: a83t: Correct USB3503 GPIOs polarity Date: Wed, 11 Dec 2019 15:52:17 +0100 Message-Id: <20191211145217.25025-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: H4sIAAAAAAAAA0VSa0gUURjl7szOjIsb4yp5U1HaXlikmYVXKlEIHOhHRYRgiW45qKmr7Khl JJpvJx9ZmYsmiYaWz1W39ZGorY8lNM0USVLxQWCCj1B8pGnujtm/893vfOec7+NSmKxbbEOF KKNYlVIRJickuK5no/90meiX3xn+yXnUP7OJozp1rRj1ti/gKK2tCEdJpbUEGhjQkOjFVrkI 1c+MiNFQyysCDSUNAqQeaBOhkrIUDFV3jZM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GJrVK0oYWRnqGlhZ6RiaWe obF5rJWRqZK+nU1Kak5mWWqRvl2CXsa94+YF/VwVj39sZGpg3M7RxcjBISFgIjFxdkIXIxeH kMBSRok1X3sYuxg5geIyEienNbBC2MISf651sYHYQgKfGCXWz/UEsdkEDCW63oLEuThEBDYw Spx5/4QFxGEWaGKRmDrrMRNIlbCAr8T+PUvBprIIqEos/rEBbCqvgK3ElS3HoLbJS6zecIAZ xOYUsJPo+raOBWKbrcSn221sExj5FjAyrGIUSS0tzk3PLTbSK07MLS7NS9dLzs/dxAiMom3H fm7Zwdj1LvgQowAHoxIP74Lt72OFWBPLiitzDzFKcDArifAeb3sXK8SbklhZlVqUH19UmpNa fIjRFOioicxSosn5wAjPK4k3NDU0t7A0NDc2NzazUBLn7RA4GCMkkJ5YkpqdmlqQWgTTx8TB KdXA6Lz8/uLv/+7KrHX1D+1eUBe14N2tqA0TtdbKa3zW+8Ar7/GjSOHjbbfnNha81hwmZ8+z nroteCq2OLSeWy1x7fUXGx4U6zPtFm74eNv/7GKbSet55s34ocQrvWvz/0cBByZWHvwnVPzi ZIPM+va9p6YH65xsnGfk8OOVR0CLfYmVjtG2P7dYDimxFGckGmoxFxUnAgCVn2aYuAIAAA== X-CMS-MailID: 20191211145222eucas1p1d761af59e04017ddadbdbd1cceb59b1f X-Msg-Generator: CA X-RootMTR: 20191211145222eucas1p1d761af59e04017ddadbdbd1cceb59b1f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20191211145222eucas1p1d761af59e04017ddadbdbd1cceb59b1f References: <20191211145054.24835-1-m.szyprowski@samsung.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 Acked-by: Chen-Yu Tsai --- arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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:52:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 11285283 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 06DFB14E3 for ; Wed, 11 Dec 2019 14:52:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2E7621556 for ; Wed, 11 Dec 2019 14:52:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="TZlD07Mg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729746AbfLKOwd (ORCPT ); Wed, 11 Dec 2019 09:52:33 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57381 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbfLKOwd (ORCPT ); Wed, 11 Dec 2019 09:52:33 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20191211145232euoutp021c8cf23b706a5b8042d2aa70cb26030d~fWLpvEwQr1480514805euoutp02B for ; Wed, 11 Dec 2019 14:52:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20191211145232euoutp021c8cf23b706a5b8042d2aa70cb26030d~fWLpvEwQr1480514805euoutp02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1576075952; bh=jPVQGv2B63dkrb4xPXViL+0AtlLT78bLnq0v7ybfs38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TZlD07MgoWZDfuTsg4BweOr7qfRfscyfWNlVaMj8jM4AtAS705UX14VUIyxNmgel7 t6C4clfHXBHh9myAugZPFDBM6EY4VM557YiM1DE5XC+/psmoi/Q9vshlabM71JSF8a bthLcRImnMgn0MO+oYvOkoCFetYLvN5SlBiqucNo= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20191211145231eucas1p2a9956cb640d857f75b0b34dc21dd8d01~fWLpReS_k0708607086eucas1p2a; Wed, 11 Dec 2019 14:52:31 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 9C.F9.60679.FA201FD5; Wed, 11 Dec 2019 14:52:31 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20191211145231eucas1p29d4e0ed105274c79682b48a613b45904~fWLo9hIen2291422914eucas1p2X; Wed, 11 Dec 2019 14:52:31 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20191211145231eusmtrp218ee9470661b69abcd7c5ca46a1a4e4d~fWLo8wIvs0452204522eusmtrp2V; Wed, 11 Dec 2019 14:52:31 +0000 (GMT) X-AuditID: cbfec7f4-0e5ff7000001ed07-7e-5df102afc19f Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 17.E9.08375.FA201FD5; Wed, 11 Dec 2019 14:52:31 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20191211145230eusmtip10ed2da4b3dbe05eb5508cef2c0b12703~fWLoORm8Z1208212082eusmtip1u; Wed, 11 Dec 2019 14:52:30 +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 4/4] usb: usb3503: Convert to use GPIO descriptors Date: Wed, 11 Dec 2019 15:52:26 +0100 Message-Id: <20191211145226.25074-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: H4sIAAAAAAAAA0VSbUhTYRjtvfdu97q8dZuWbyoJ04oiP0p/vFBJQdEFiYqQPmjVzS4qbdN2 tTIKl1/psLAvnCtTpmi41DVl5QitZY6UnGZZP9qkNMpKLbSPVWTOu+rfOec55zkvLw+Fy52S UCpdk8VrNZxKIZURti6vK7oZ+6yM6/oSh3qHfxLolqFZgno6xgl0tr2SQPk1zVLkcllIdPlX PYasw4MSNGC/J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xeZNcAFeUnk1RfmlJqkJGfnGJrVK0oYWRnqGlhZ6RiaWe obF5rJWRqZK+nU1Kak5mWWqRvl2CXsaWx9vYC+YbVHw79YS1gfG4ehcjJ4eEgInEv9MdjF2M XBxCAksZJfacOskMkZCRODmtgRXCFpb4c62LDaLoE6NEx915jCAJNgFDia63EAkRgQ2MEmfe P2EBcZgFmlgkps56zARSJSzgKtGx7iLQKA4OFgFVickNKiBhXgFbiXcvvjJBbJCXWL3hANhm TgE7ia5v61hAbCGgmk+329gmMPItYGRYxSiSWlqcm55bbKhXnJhbXJqXrpecn7uJERhJ2479 3LyD8dLG4EOMAhyMSjy8C7a/jxViTSwrrsw9xCjBwawkwnu87V2sEG9KYmVValF+fFFpTmrx IUZToJsmMkuJJucDozyvJN7Q1NDcwtLQ3Njc2MxCSZy3Q+BgjJBAemJJanZqakFqEUwfEwen VAOjR/2TMxUGveEMRbwyb9b13JF/s3SmYdfz5wkFoRYaKlpFky7usv/mGrKtx8eQQeifyOG0 4p/mht+UJp3K//F7XmHPrDlHfz/a1Gy87fObF7XHi6zv/8kIMuF573ecY4mpWiHbf+VmhV6H 4xr+Nx155WudUjZ9FzF6aHj3mIL094h10adVeR8rsRRnJBpqMRcVJwIADZ77troCAAA= X-CMS-MailID: 20191211145231eucas1p29d4e0ed105274c79682b48a613b45904 X-Msg-Generator: CA X-RootMTR: 20191211145231eucas1p29d4e0ed105274c79682b48a613b45904 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20191211145231eucas1p29d4e0ed105274c79682b48a613b45904 References: <20191211145054.24835-1-m.szyprowski@samsung.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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(-) 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