From patchwork Fri May 28 06:10:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12286247 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 030DDC47087 for ; Fri, 28 May 2021 06:19:00 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B4C556113E for ; Fri, 28 May 2021 06:18:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4C556113E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: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:In-Reply-To:References: List-Owner; bh=g67aUZlA/CcObQidoT0nkvcMyjIWBAUcQywGKNBTZIU=; b=xsQRw/6cZbPDXp 6dPDz3sRqcFmGZZYN3Lq2g1aHMtgpRfxFOfPnf1FUKV6epQGJ3DRaHs0Ogns50JFcDuJ2EgKGTkVO MrnO4tn6/IZtv95jCURekSwZw5JKikdH48j3dldx2FBbncPtG1zCH4BK8n9P7DrE+Aig0R48QCjSp WWJBEsNgeYBCNuYRjGuHhm8RMkVRJkE/cCnnyF9zgJoG6yJBKtQxJ8fgBSIPQlcoEEgWaVjPiDzJ6 8S+THh7SOS4EI/yY3Ae7shbXGk+qF1cmdfcMa+A3kPo86WvWz5c/cI2ANLGFUTgFnAYeUDfVi7Nyt KPdbTQ1YxfB0iG7R6ggg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmVnI-00CWcq-Vk; Fri, 28 May 2021 06:16:29 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmVnE-00CWZy-Re; Fri, 28 May 2021 06:16:26 +0000 X-UUID: f1d127d4584540eda163ffcb353f5fbf-20210527 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=6bWTLGz5omSfDjyNRKVARq/nzi3C/uGa4bUL2BXCCRM=; b=o8GeVMhXNPw5X4K8chc05m9kOlZS1n3/jZqqbpC7PzYpnANFlT7wfu21XjVIzJWxVzRvfN4yMGvCqURsmjZrm9KLtFBgnhVMafqDbSGHctkbd3Jj8qA93BDQjRP/Lug9RMkIauCB77qPsF39kZU4ymyFwtbkXRckXr8VKNhCAO8=; X-UUID: f1d127d4584540eda163ffcb353f5fbf-20210527 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1888847856; Thu, 27 May 2021 23:16:21 -0700 Received: from MTKMBS06N1.mediatek.inc (172.21.101.129) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 23:11:05 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 28 May 2021 14:11:04 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 28 May 2021 14:11:01 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman CC: Chunfeng Yun , Matthias Brugger , , , , , Eddie Hung Subject: [PATCH 1/5] usb: mtu3: remove mtu3_ep0_setup() declaration in mtu3.h Date: Fri, 28 May 2021 14:10:56 +0800 Message-ID: <1622182260-23767-1-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210527_231624_939520_59E0E868 X-CRM114-Status: GOOD ( 13.08 ) 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 It's defined and only used in the same file, so remove its declaration in mtu3.h, and make it static Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3.h | 1 - drivers/usb/mtu3/mtu3_core.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/mtu3/mtu3.h b/drivers/usb/mtu3/mtu3.h index aef0a0bba25a..a8a7ee11f7b7 100644 --- a/drivers/usb/mtu3/mtu3.h +++ b/drivers/usb/mtu3/mtu3.h @@ -422,7 +422,6 @@ int mtu3_config_ep(struct mtu3 *mtu, struct mtu3_ep *mep, int interval, int burst, int mult); void mtu3_deconfig_ep(struct mtu3 *mtu, struct mtu3_ep *mep); void mtu3_ep_stall_set(struct mtu3_ep *mep, bool set); -void mtu3_ep0_setup(struct mtu3 *mtu); void mtu3_start(struct mtu3 *mtu); void mtu3_stop(struct mtu3 *mtu); void mtu3_dev_on_off(struct mtu3 *mtu, int is_on); diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c index b3b459937566..2ef528f39ba3 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -536,7 +536,7 @@ static void get_ep_fifo_config(struct mtu3 *mtu) rx_fifo->base, rx_fifo->limit); } -void mtu3_ep0_setup(struct mtu3 *mtu) +static void mtu3_ep0_setup(struct mtu3 *mtu) { u32 maxpacket = mtu->g.ep0->maxpacket; u32 csr; From patchwork Fri May 28 06:10:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12286245 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7F46C47087 for ; Fri, 28 May 2021 06:13:18 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 809D9613D4 for ; Fri, 28 May 2021 06:13:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 809D9613D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=GwK0Du3DVsGtgZRp+D5QWdjzFTAKqOmuYymOS9fvkK0=; b=gpNvolHRWXeLy+ GrE1i9YKx6z8hOSYvdptLWmGWVuySs8/JEEcqUpT0HZupjb6x6Rzp+n1hIf2ushjcRUlPPQ0alGJg aia4DMePpmoYaQtfDN3LlUlWJhPIbA0EdsRwRvAntN0XTotGnisaIhCagVQjFlR4YMEmOVFUEDVyc 2bdYovjHaShicFrbfGmK+M6PbFPO6+tJvQXGbXGokQsBIFu7F8WNRXIerUWwSs3pc2PhQJuqbbS1N X5gLU/ieJ4vk2oaFIv9yjTL0n3gntN2C9KQISiaghNYT6TbczAgvyRQGFY0fq5NLoWl7hrB7BdZL3 FvyVrvFEMHjT94PiU9cA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmVih-00CUDo-TB; Fri, 28 May 2021 06:11:44 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmViF-00CTzi-Nz; Fri, 28 May 2021 06:11:17 +0000 X-UUID: c05c6b7b44a4415f831e249a5bf968d4-20210527 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=QPnfK6G7D2hUUfv2h3/zel56Cz29LKQriYvO/EN4IKI=; b=bf0qxOzZRw/zF8TvbfZ2Qjyjcya/z1nkUMnKxH1/nX8Pm6qYA/t8K/FNvDbUHeM8Sw4Hd7dJYBIT0uVdv2XdSiFoUUn9OCRM4lubB5/TNrBVafLSU6DyHn0E/1+Ukcb2ojeYz2QkBNkTRSV0N2JWGYY8mYIqTxwVJQ5SMrD32rM=; X-UUID: c05c6b7b44a4415f831e249a5bf968d4-20210527 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2000793830; Thu, 27 May 2021 23:11:07 -0700 Received: from MTKMBS06N2.mediatek.inc (172.21.101.130) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 23:11:06 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 28 May 2021 14:11:04 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 28 May 2021 14:11:03 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman CC: Chunfeng Yun , Matthias Brugger , , , , , Eddie Hung Subject: [PATCH 2/5] usb: mtu3: remove repeated setting of speed Date: Fri, 28 May 2021 14:10:57 +0800 Message-ID: <1622182260-23767-2-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1622182260-23767-1-git-send-email-chunfeng.yun@mediatek.com> References: <1622182260-23767-1-git-send-email-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-20210527_231115_815056_AE8D14D2 X-CRM114-Status: GOOD ( 12.68 ) 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 mtu3_gadget_start() will set speed, no need set it again in mtu3_gadget_set_speed(), just save the desired speed. Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3.h | 1 - drivers/usb/mtu3/mtu3_core.c | 2 +- drivers/usb/mtu3/mtu3_gadget.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/mtu3/mtu3.h b/drivers/usb/mtu3/mtu3.h index a8a7ee11f7b7..531b9c78d7c3 100644 --- a/drivers/usb/mtu3/mtu3.h +++ b/drivers/usb/mtu3/mtu3.h @@ -425,7 +425,6 @@ void mtu3_ep_stall_set(struct mtu3_ep *mep, bool set); void mtu3_start(struct mtu3 *mtu); void mtu3_stop(struct mtu3 *mtu); void mtu3_dev_on_off(struct mtu3 *mtu, int is_on); -void mtu3_set_speed(struct mtu3 *mtu, enum usb_device_speed speed); int mtu3_gadget_setup(struct mtu3 *mtu); void mtu3_gadget_cleanup(struct mtu3 *mtu); diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c index 2ef528f39ba3..6b5da98de648 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -207,7 +207,7 @@ static void mtu3_intr_enable(struct mtu3 *mtu) mtu3_writel(mbase, U3D_DEV_LINK_INTR_ENABLE, SSUSB_DEV_SPEED_CHG_INTR); } -void mtu3_set_speed(struct mtu3 *mtu, enum usb_device_speed speed) +static void mtu3_set_speed(struct mtu3 *mtu, enum usb_device_speed speed) { void __iomem *mbase = mtu->mac_base; diff --git a/drivers/usb/mtu3/mtu3_gadget.c b/drivers/usb/mtu3/mtu3_gadget.c index 38f17d66d5bc..5e21ba05ebf0 100644 --- a/drivers/usb/mtu3/mtu3_gadget.c +++ b/drivers/usb/mtu3/mtu3_gadget.c @@ -577,7 +577,7 @@ mtu3_gadget_set_speed(struct usb_gadget *g, enum usb_device_speed speed) dev_dbg(mtu->dev, "%s %s\n", __func__, usb_speed_string(speed)); spin_lock_irqsave(&mtu->lock, flags); - mtu3_set_speed(mtu, speed); + mtu->speed = speed; spin_unlock_irqrestore(&mtu->lock, flags); } From patchwork Fri May 28 06:10:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12286241 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC91CC47087 for ; Fri, 28 May 2021 06:13:09 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A213D613D4 for ; Fri, 28 May 2021 06:13:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A213D613D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=ZaQ6W3qsrDNeFXIGyoLH4STL3hHIPndJUVJEMq5SsQU=; b=xmEjNIhzPbkgCf xjIWLY0Ik/ogn4luvrAdakupoNIZkmrXeZgS+8ZXgcbU5XGTNuCa96TNuoj++xGyM33lCdJJNKv+S VycOpjAsq3V5npHOyizh3lL7sf6IjNYfG9e9FiIcae6TOvU24GwlkB8Uxf+KG3jMKzYxyD9o0nQ/p LVyDRwG3mmwbF3XAB1J5NWSWNcNzAgie4tdHwKiH+dtJOulpTaKpTssT8XyjMEzXekc2VAQqHbAvK IvY0O5Yr+yhWHhghBqyz5kg0cKTF55t6Gncss0IHF96kuriNbPVDK79Owaz+HjVUO6mtWHbZ85wQG L+Z/SIhPEzagi58xrREA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmViI-00CU3R-1P; Fri, 28 May 2021 06:11:18 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmViE-00CTzi-G1; Fri, 28 May 2021 06:11:15 +0000 X-UUID: a087ff86e4ba4607a1b27bc7bb8c3084-20210527 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=NM6ZuqDcCfoMGMVsCu8e1gm6FWKPQr1EgAmCHBcSEtg=; b=cD6lpo9g0XtINuJj4VD/bV50fy5DbE4mEMuoAPI630h1jdGS97EOe5Vwz32aXnp7XU3vWo5rUdBTopSW5EOlmcqBmaRZ2E3Ajt9mdeHZn9HHNk/CMmGHaFJwOds12rjKjojAGnS0+jpM2d4SB/MJhHzHSulkqsR25w19yJEH8BQ=; X-UUID: a087ff86e4ba4607a1b27bc7bb8c3084-20210527 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2047946552; Thu, 27 May 2021 23:11:07 -0700 Received: from MTKMBS06N1.mediatek.inc (172.21.101.129) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 23:11:07 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 28 May 2021 14:11:05 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 28 May 2021 14:11:04 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman CC: Chunfeng Yun , Matthias Brugger , , , , , Eddie Hung Subject: [PATCH 3/5] usb: mtu3: dump a status register of IPPC Date: Fri, 28 May 2021 14:10:58 +0800 Message-ID: <1622182260-23767-3-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1622182260-23767-1-git-send-email-chunfeng.yun@mediatek.com> References: <1622182260-23767-1-git-send-email-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-20210527_231114_586224_FAE52B4A X-CRM114-Status: UNSURE ( 9.54 ) 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 Add a SSUSB_IP_PW_STS1 register to show ip sleep status Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/mtu3/mtu3_debugfs.c b/drivers/usb/mtu3/mtu3_debugfs.c index 7537bfd651af..d27de647c86a 100644 --- a/drivers/usb/mtu3/mtu3_debugfs.c +++ b/drivers/usb/mtu3/mtu3_debugfs.c @@ -30,6 +30,7 @@ static const struct debugfs_reg32 mtu3_ippc_regs[] = { dump_register(SSUSB_IP_PW_CTRL1), dump_register(SSUSB_IP_PW_CTRL2), dump_register(SSUSB_IP_PW_CTRL3), + dump_register(SSUSB_IP_PW_STS1), dump_register(SSUSB_OTG_STS), dump_register(SSUSB_IP_XHCI_CAP), dump_register(SSUSB_IP_DEV_CAP), From patchwork Fri May 28 06:10:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12286243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04654C47087 for ; Fri, 28 May 2021 06:13:12 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B683A613DA for ; Fri, 28 May 2021 06:13:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B683A613DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=dbOE+5Rmq5YKYmVUdjVkaYwa+6ny0S6+M6vAolJilOA=; b=YfjfbTa14nHRWi 4alq7zoHQoV5mHfe0TGys+7xxpOAETqJsWBFQrPqKeRHfk55Qbln5VHokuUijdwR2HaX2ZCpGvLgS 2veEFVz1iMG6lgj1J+wACA7lbqXMXmKUgDynPmTJfw9kKVFYhKpGV1srIVJdb6W7ZWfIlDJZADZgs LeK4PE9747ecc/J5AV/Kmsdu15C9vn0Y6bNdGiuXAXOEBYV8FOikPOzwN+PK2spMzSrO5iRFlfnqH ufxTQio+m7JnNLBkeuN8pFap8WGNzO3cQfKgwbod67ROVSW5TOuAQ4h22MhQSShGbMLqI1/oMT0dA hZy7uzqKoPfkzVJDXgew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmViT-00CU8N-W5; Fri, 28 May 2021 06:11:30 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmViE-00CU0I-G3; Fri, 28 May 2021 06:11:15 +0000 X-UUID: 50b8c867169d4065971fe176ff651c88-20210527 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=p0Iea9bCtw8nepEhDgjcy1BH2yr/dtFf02LZFBGiFJ4=; b=uVzhAO639jVEKB3VEqKjvsWkRsGsTOtJp7qK7WFyMkeWYwAW0rhm7GaNR/983xZfePsy4A0oXYYnIC/OtmFaZXWss3PZd28C35vyAinFtedFWWa4/DaGlni0rHkID7VfFz7zeRXKAZbCBI+qBjXLIBpK7r4oRSLwYieZa0gNqRU=; X-UUID: 50b8c867169d4065971fe176ff651c88-20210527 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 567510048; Thu, 27 May 2021 23:11:07 -0700 Received: from MTKMBS06N2.mediatek.inc (172.21.101.130) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 23:11:06 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 28 May 2021 14:11:05 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 28 May 2021 14:11:05 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman CC: Chunfeng Yun , Matthias Brugger , , , , , Eddie Hung Subject: [PATCH 4/5] usb: mtu3: use dev_err_probe to print error log about extcon Date: Fri, 28 May 2021 14:10:59 +0800 Message-ID: <1622182260-23767-4-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1622182260-23767-1-git-send-email-chunfeng.yun@mediatek.com> References: <1622182260-23767-1-git-send-email-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-20210527_231114_586700_30579EC9 X-CRM114-Status: GOOD ( 12.11 ) 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 Print an error log when the error number is not -EPROBE_DEFER Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_plat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index 7786a95a874e..eaeda391693a 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -302,8 +302,8 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb) if (!otg_sx->role_sw_used && of_property_read_bool(node, "extcon")) { otg_sx->edev = extcon_get_edev_by_phandle(ssusb->dev, 0); if (IS_ERR(otg_sx->edev)) { - dev_err(ssusb->dev, "couldn't get extcon device\n"); - return PTR_ERR(otg_sx->edev); + return dev_err_probe(dev, PTR_ERR(otg_sx->edev), + "couldn't get extcon device\n"); } } From patchwork Fri May 28 06:11:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12286257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9586CC4708C for ; Fri, 28 May 2021 06:22:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 58B52613D1 for ; Fri, 28 May 2021 06:22:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58B52613D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=SoxVWzzPaNNohiKfTcNAg2luN5GDMIfAOwuffcvMXd0=; b=3SnHaORi55cPOY o8JiQXN+7tkGckNFVmg7reNt0S8YSrL5aH7PX+sx7kEefowN8fVUkSjrWbXgn+l4dA5S168ipKWJS sv9jVXrDv6j+E+iIku4VZGc8WsgcACdk54Qi9TYpB9BFiQZS/0KurJ82K+i+4X3VYd2JlrUtgXKkQ dTEUij6Da1PqWvjx3QwydcdnSmFYRrDItZxQu6C2tiIrtphyyHFBLf5VVoValgEfsLJrgLUOxqPMA nc4w8OxG8f6lC+f6BUZ6AfTSOtwBveDwY0m/dva7eCvH0rnGVvfn3UvZJ72Qx4pWwr6LrBDERfGeE T/kK3eA9ganLP+TMEuNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmVs2-00CZ7i-8m; Fri, 28 May 2021 06:21:22 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmVrx-00CZ5j-RL; Fri, 28 May 2021 06:21:19 +0000 X-UUID: 83e696283de141b699f649fbeb914a1d-20210527 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=tdP32hBdfllEkuO1wA8aLEmLIQmgCOMtycANFmjZazc=; b=EycyPoM9wtp8LOz/AuSYy6KP5aM2GfeiZSA7jrBNb6uSkws9vSQXBbroSR42hWEdE6/e2vCUjo/TbPKUajMz2ArNLwz0XvteNbr94wmx6sLRIeKNiIdjYlxEXUMQJoJ60BxViczu+FBZ1IHzP3IVA0FKJ/cw6GdZg/g0juWlvDQ=; X-UUID: 83e696283de141b699f649fbeb914a1d-20210527 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1366166243; Thu, 27 May 2021 23:21:10 -0700 Received: from MTKMBS06N1.mediatek.inc (172.21.101.129) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 23:11:07 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 28 May 2021 14:11:06 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 28 May 2021 14:11:05 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman CC: Chunfeng Yun , Matthias Brugger , , , , , Eddie Hung Subject: [PATCH 5/5] usb: mtu3: skip getting extcon when use manual drd switch Date: Fri, 28 May 2021 14:11:00 +0800 Message-ID: <1622182260-23767-5-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1622182260-23767-1-git-send-email-chunfeng.yun@mediatek.com> References: <1622182260-23767-1-git-send-email-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-20210527_232117_922504_C8BF5DF2 X-CRM114-Status: GOOD ( 13.24 ) 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 When use manual drd switch, extcon is not used in fact, so no need get it even it exists, just skip it like using role switch. Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_plat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index eaeda391693a..bbfabdc1e79b 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -299,7 +299,10 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb) of_property_read_bool(node, "enable-manual-drd"); otg_sx->role_sw_used = of_property_read_bool(node, "usb-role-switch"); - if (!otg_sx->role_sw_used && of_property_read_bool(node, "extcon")) { + if (otg_sx->role_sw_used || otg_sx->manual_drd_enabled) + goto out; + + if (of_property_read_bool(node, "extcon")) { otg_sx->edev = extcon_get_edev_by_phandle(ssusb->dev, 0); if (IS_ERR(otg_sx->edev)) { return dev_err_probe(dev, PTR_ERR(otg_sx->edev),