From patchwork Mon Dec 14 11:34:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 343493 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp2918108jai; Mon, 14 Dec 2020 03:34:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9IoriLtq5JMixpng9dQvn9KNNO7To1W8p8ZN3aO5Moonf9SidG4Cg/GIYNFJ9fWPKocYN X-Received: by 2002:a17:906:1744:: with SMTP id d4mr22653078eje.176.1607945690998; Mon, 14 Dec 2020 03:34:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607945690; cv=none; d=google.com; s=arc-20160816; b=Kmx6vc+9Ut7hk9olKsy/J+n03ZYagK0It0cIlldgNZepPufFtKJGI1LwbOKkDIbFA9 iTeNOfIpcUX9WBwqTAfoFxDRVlWNYzuUBLGPgxBRMhi9y7P5YkqO7lQ2zEy3+FyU6DPm 0omJ3hK0DLeBfTwsFLHN2LiRt5keKuCzrWxBldyN3OPLSEncldFSov/AD0lEwk6qliOH Xk8+/H+dtJAdap7ecMv3JNZSIaS4pMCrbZLyl/PbmTXt5nlbvndquS9N6aMvCboi4B6i lndtHBJj99uRbKNFXy2+1hvJcjE6DkA0+N1FWHt7Lwxu6M26a9QcF/oHclvQkmTDPvGs VxyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:cms-type:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=0IVGif5ilUpSeG00Prh0wm52IU2BOP+iajtgbRV//3c=; b=DMCzsEbDICekrmrY5UjPo+NWcHgo7WiFugpBehxEZMO6ld/62tPpLM4Ajp3hl9uU/g GkxnvWgPXRyMZtGd9DNUME6WaiqhnXZB/d+/B+faAKXsq+SiKEqSeC4Twha2q/E5vfpp Eb6/56URsSNdhAMjbWWkzhpoC19d2Y2yAhPyPikUl4VrRJiravFe3vgdA7QNp4uIrLGa TDRXGeJEVXjYBAKQ3brwLHzkykOMHTfc6N+no+GNJZrv0xgvvdM5ldtI2kEJ3FFeuZbQ H303IFMNO4wKalsbU3IHoqsS2VBRsPu0D69jwagzN+VCDvfVmaj946SlQ7W6Xd6sSJ5Z nrIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HNNdswV0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id z16si2368166ejw.548.2020.12.14.03.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 03:34:50 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HNNdswV0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D23138280D; Mon, 14 Dec 2020 12:34:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="HNNdswV0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9608082817; Mon, 14 Dec 2020 12:34:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9B88A8278A for ; Mon, 14 Dec 2020 12:34:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=m.szyprowski@samsung.com Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201214113433euoutp02c6443739fb9e2ff4e22aebcc1bf20904~QkhI6Vu9e2821328213euoutp026 for ; Mon, 14 Dec 2020 11:34:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201214113433euoutp02c6443739fb9e2ff4e22aebcc1bf20904~QkhI6Vu9e2821328213euoutp026 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1607945673; bh=0IVGif5ilUpSeG00Prh0wm52IU2BOP+iajtgbRV//3c=; h=From:To:Cc:Subject:Date:References:From; b=HNNdswV0R9u2ttOHKuTee9s595JDOBqHc4g5SPdVkS7kCkERV4a73TLDpXw6t9Jhn GOP3nQTzRi7ecdG5qDnGUEHWi4rlkqj+IJ4jk7WpSY/SCetsd2Zv4Sr7yjNAO2V+6d WldkMKVhXFBS6lj9hSIBL+jzSp6UG7n9qAbrpIqc= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201214113428eucas1p2b1da679582fea61d558417806bf2d5d7~QkhDmOjPd2275522755eucas1p2F; Mon, 14 Dec 2020 11:34:28 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 8B.D8.27958.4CD47DF5; Mon, 14 Dec 2020 11:34:28 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201214113427eucas1p203c6afe2f9af60e5bfb5ccc04dd966d5~QkhC3p2hi2275522755eucas1p2E; Mon, 14 Dec 2020 11:34:27 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201214113427eusmtrp26a62aa38ba48f3b53e0d22197485972b~QkhC27In51456114561eusmtrp2i; Mon, 14 Dec 2020 11:34:27 +0000 (GMT) X-AuditID: cbfec7f2-f15ff70000006d36-c8-5fd74dc4b793 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 6B.4D.21957.3CD47DF5; Mon, 14 Dec 2020 11:34:27 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201214113426eusmtip1f2b5ab79772c7cce58de39d9c3cb1480~QkhCYQMxm2938829388eusmtip13; Mon, 14 Dec 2020 11:34:26 +0000 (GMT) From: Marek Szyprowski To: u-boot@lists.denx.de, u-boot-amlogic@groups.io Cc: Marek Szyprowski , Neil Armstrong , Lukasz Majewski , Kever Yang , Simon Glass , Jaehoon Chung , Bartlomiej Zolnierkiewicz Subject: [PATCH] usb: dwc3-meson-g12a: always configure dr-mode Date: Mon, 14 Dec 2020 12:34:19 +0100 Message-Id: <20201214113419.19103-1-m.sz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AA== X-CMS-MailID: 20201214113427eucas1p203c6afe2f9af60e5bfb5ccc04dd966d5 X-Msg-Generator: CA X-RootMTR: 20201214113427eucas1p203c6afe2f9af60e5bfb5ccc04dd966d5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201214113427eucas1p203c6afe2f9af60e5bfb5ccc04dd966d5 References: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean dwc3_meson_g12a_force_mode() sets the dr-mode of the USB PHY. However it skips setting the mode if it matches the one done during driver probe (stored in private structure). This fails if the mode has been changed to other value and then back to initial one. Fix this by configuring the dr-mode always, regadless of the one set at the driver probe). This fixes operation of USB gadget based drivers when they are initialized for the second time. Signed-off-by: Marek Szyprowski --- drivers/usb/dwc3/dwc3-meson-g12a.c | 3 --- 1 file changed, 3 deletions(-) -- 2.17.1 Acked-by: Neil Armstrong diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index 6567502cdd1..6f0bac2a00c 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -269,9 +269,6 @@ int dwc3_meson_g12a_force_mode(struct udevice *dev, enum usb_dr_mode mode) if (!priv->phys[USB2_OTG_PHY].dev) return -EINVAL; - if (mode == priv->otg_mode) - return 0; - if (mode == USB_DR_MODE_HOST) debug("%s: switching to Host Mode\n", __func__); else