From patchwork Fri Apr 14 15:24:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 83495 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp476553vqo; Fri, 14 Apr 2023 08:44:28 -0700 (PDT) X-Google-Smtp-Source: AKy350ZCEyWCFnKKImS6Fh3n81cKPl6aaPFAMzAhDSEwKwT8qcYjknrp4BgMTKq7h0QYrznkvvuK X-Received: by 2002:a17:903:234e:b0:1a6:413c:4a3e with SMTP id c14-20020a170903234e00b001a6413c4a3emr3974397plh.5.1681487068568; Fri, 14 Apr 2023 08:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681487068; cv=none; d=google.com; s=arc-20160816; b=NI//CGx4t+HvHM20OGirNSlXv3GPp3AGAMsByZfOzQ4lUeaF3RbyKkIRRTbFNAHOYq fgiV2drwhGdTQwypPCzNUshAU2FnjptQcjL5rkPv25YP9jtKwxgmm6IihdkAkTT3HeSH agiVRvNb8zOhT1fpSWc6QiNGMrG5/eP+bmglawuFYIxuF9I0qcmzjc8Ph/SVwZAmto08 pLedaevPTwpgiDC/iGUokhwkMhAipdj/uvPjctzGqX+KGOtC/9dx2j+6Gnc8iv5p26pA hsBBXdfc4oKZZ4nu9sdCUDAzCIEa7Oj1UgW1x+L7p/RC4hI8C8G3cNc+//LsSzuAYBmC 4NmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LsFSCOE/U7ctFiRSO+kttWX/RvhA2tL+4PMkcrQ5e54=; b=Iut6nEsZR6drT4NSvrVZg2ISxOx7HHItecoSnAKiZndJt0I3fQ5ItQ6KUM0kMaPQw0 wEbmImeIECIvrdu4kCoNWZC8ISn7JsanAc2m7lyhL/WBFFHs2Iy1OIXnHoFBIPZMsu8P U97P9n5qBXT65KKIi0OsYBuYv9eHbQEsCV+Tu6cVqImhExz1wv3VNDguIDGFrHkSwfi5 PUDgenJhvHbxWHxQ6Xzze/viHYjvExLoPqDjLbvrcZvCXOhFmZnjO7k5FgHIUYVPx227 ApVMzbyBKOtfxuGzuXqMZe+psJtEqrTFF4FjgReO996ElgnxrxfJvT2I74V4oz7tMCLc FWIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=DCPYUaMz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t4-20020a1709028c8400b001a63e4508dcsi4754211plo.411.2023.04.14.08.44.13; Fri, 14 Apr 2023 08:44:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=DCPYUaMz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231260AbjDNPYt (ORCPT + 99 others); Fri, 14 Apr 2023 11:24:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230182AbjDNPYh (ORCPT ); Fri, 14 Apr 2023 11:24:37 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AD30AF25; Fri, 14 Apr 2023 08:24:36 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id ECF2C5FD27; Fri, 14 Apr 2023 18:24:34 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1681485875; bh=LsFSCOE/U7ctFiRSO+kttWX/RvhA2tL+4PMkcrQ5e54=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=DCPYUaMz60Nl/RmT7yM88Yzy3adQ6G3ZPztlvKLMMHmWigHQ74VVmrsOIRibpLc2m cCwojrhnuzPzkEay4O5INDE2OsrP+FNrLfxgBV+GDOfP9YpUYQSuyX2p5yMux2crDp 8srpJotp+JwjAzegvx1/WjvvuR/MlcKPrgfEZZ04+XLMSuCRHiENWA9jIfWIrOAa9m eQJ/Mho4V+V6Hk4yCrseev6BCxZyc0+0vwTxFX2mJLXmGUnw9NZ8aOGK4xByKUNVnI M2uVFDtZkSCjSzLx4V2L9OoWsk7v9ogaueGA+/bEeK4rF/W7tTGLfnJBSRu0g6UX8T tfik05VQ2pe1A== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 14 Apr 2023 18:24:34 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v1 4/5] usb: dwc3-meson-g12a: support OTG switch Date: Fri, 14 Apr 2023 18:24:22 +0300 Message-ID: <20230414152423.19842-5-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230414152423.19842-1-ddrokosov@sberdevices.ru> References: <20230414152423.19842-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/04/14 08:08:00 #21104846 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763166984009782731?= X-GMAIL-MSGID: =?utf-8?q?1763166984009782731?= From now, the Amlogic A1 USB controller is capable of switching between host and gadget modes, based on the status of the OTG_ID signal or by manual usb role changing. Signed-off-by: Dmitry Rokosov --- drivers/usb/dwc3/dwc3-meson-g12a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index b282ad0e69c6..10469b95deb9 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -242,7 +242,7 @@ static const struct dwc3_meson_g12a_drvdata g12a_drvdata = { }; static const struct dwc3_meson_g12a_drvdata a1_drvdata = { - .otg_switch_supported = false, + .otg_switch_supported = true, .clks = meson_a1_clocks, .num_clks = ARRAY_SIZE(meson_a1_clocks), .phy_names = meson_a1_phy_names,