From patchwork Mon Apr 17 02:52:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 13213164 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 A79B3C77B61 for ; Mon, 17 Apr 2023 02:53:35 +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=SZ3HLL0LyAbLHGTnSATl4eIpYy/bxNkc+fvgJaNgTIE=; b=42SavMoJDvvQCl Ih7fGSXoVO7CF4p5f39QHkZSq8JSB9p/UfU2NV2PC2mWmlNzWwEGSpDhKPWS/NhRZYx0BwfY5hQxQ fx8hs5Pcw3kLcv37CA/8U6CGzHNDL9zYVGyhNatul7uk6sG8bCZ4tERvssgXtWwddZPfPW7G/FYL9 7ZAI7nTqsDDPV8GkNTRpcFuUsqwEGImvwGyl1ZnrlF/k2bey9qhlWoLO+qUJHoTGOsGOJp5JCNnFY nkcUQYr4b6ZuwtsrLmPN+FRcwZKcE5dQz8F/rAfUITU3CAswTFReC/6BGsT18vxVDcWlJizcGfdZv dEefdnBTLsgR6Aw4MObA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1poEz2-00Eirk-2f; Mon, 17 Apr 2023 02:52:48 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1poEyq-00Eij7-1E; Mon, 17 Apr 2023 02:52:39 +0000 X-UUID: e4d19f22dcca11ed8687db9d93187ff1-20230416 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=R8FF6lMcTE2Du4EqFA1FCtjHRKeby9msjh9agEcXgfE=; b=DqFAJJh+NapZkgNFFF5JnWkLA5gA/csY23EVOfEKq0E7JbDOxd7n41uTcmR12jG35BE3G68OkjhMfe8Pw2+loIZF8xCJMgcBA0TgEpkRXiRJDPxXt4UdmYZYeUKQuhECqDSIst63ZrCPNb/olIiHUefMmb5L1z97NrMcyw0LoBA=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:5f2befcb-913b-407d-9c5d-620848ebcc3e,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.22,REQID:5f2befcb-913b-407d-9c5d-620848ebcc3e,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:120426c,CLOUDID:fb6786a1-8fcb-430b-954a-ba3f00fa94a5,B ulkID:230417105220XGC9MV59,BulkQuantity:4,Recheck:0,SF:48|38|29|28|17|19,T C:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:40,QS:nil,BEC:nil,COL :0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: e4d19f22dcca11ed8687db9d93187ff1-20230416 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2053449012; Sun, 16 Apr 2023 19:52:29 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Mon, 17 Apr 2023 10:52:08 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Mon, 17 Apr 2023 10:52:08 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring CC: Chunfeng Yun , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , , , , , , Tianping Fang Subject: [PATCH v3 5/7] usb: mtu3: expose role-switch control to userspace Date: Mon, 17 Apr 2023 10:52:01 +0800 Message-ID: <20230417025203.18097-5-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230417025203.18097-1-chunfeng.yun@mediatek.com> References: <20230417025203.18097-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230416_195236_424328_AED9BC7F X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. 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 The allow_userspace_control flag enables manual role switch from userspace, turn this feature on like several other USB DRD controller drivers. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Chunfeng Yun --- v3: no changes v2: add Reviewed-by AngeloGioacchino --- drivers/usb/mtu3/mtu3_dr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/mtu3/mtu3_dr.c b/drivers/usb/mtu3/mtu3_dr.c index 9b8aded3d95e..8191b7ed3852 100644 --- a/drivers/usb/mtu3/mtu3_dr.c +++ b/drivers/usb/mtu3/mtu3_dr.c @@ -294,6 +294,7 @@ static int ssusb_role_sw_register(struct otg_switch_mtk *otg_sx) role_sx_desc.get = ssusb_role_sw_get; role_sx_desc.fwnode = dev_fwnode(dev); role_sx_desc.driver_data = ssusb; + role_sx_desc.allow_userspace_control = true; otg_sx->role_sw = usb_role_switch_register(dev, &role_sx_desc); if (IS_ERR(otg_sx->role_sw)) return PTR_ERR(otg_sx->role_sw);