From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7C16606A31F for ; Sun, 6 Dec 2026 04:31:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=n9JoGF+Q; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fqXyRYV6 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-Unsubscribe-Post:List-Owner; bh=K9i/hxvS+DlX2D0/ZrnyoK8kxfON78pszhwL1usXuHA=; b=n9JoGF+Q5TC43HcTLK1VZhr9mJ AQmHviqOhbI07ZhVEF9xI7WBy7ALYMM/jyuZuK2SOgxgqE4zEm0PELVa2jWg9uzpvxFVo/zvd7E8y YhUwzUPRZuPsqN6D+RbDX5DXk44KGb7Lcw7vb8UiRpp+I3mKIlojnwQfo1VeaNvKqOKfeSzy3/Ti2 5HUjs0sV1olATbPh/s+SAdB6U+XXyKBw/5YX7r6X4hw2auJ5Lah62Jkb5MQzZ9lXLEpT1WSsdqDA9 IYjj9u0ifsCjmEQxPJEtsrQv+mAEljeC5nJmVCR7Fv4LDCuOJ50rtA6N/MVbzurleb7LEbha6bPFO OGiOGXag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xa3uU-00000003E7r-1JAW; Sun, 06 Dec 2026 04:31:38 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xa3uT-00000003E7e-223J; Sun, 06 Dec 2026 04:31:37 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 8C9FC600FC; Sun, 6 Dec 2026 04:31:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28AEF1F0093B; Sun, 6 Dec 2026 04:31:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796531496; bh=g3ifQZLOH3jF3o0PdF7BpjJ7YXiIxNLuppkjoGloAGU=; h=From:To:Cc:Subject:Date; b=fqXyRYV6cPAG72EiVwgNSxA2A6ldgFheoLKigXSFwSlRz2z8bUIJfW/Bhf7HPS5IP k/skPgZF5XxklCzxz/nNw8Usb+p1+e5fBEbTJTXixsVPS3LG+LlKZhHwI2dmw1txPQ F78KK3TkQ+rUEIFW1k5TEwXw4FW3k4jzFITCpwbn9yvApRw5cOvxfRWPaQHY1cB/fF HmtBj5cU/5klqkOZ/mj+HDh0ezemRrM8OmGKdGehJ8PIHS29WRaLFUTmuZCUzXV66q LwTBRCqJYFWfhMVYwRrKqOXr14PltnJkkTzPVRqCML2hHwGvI4wbVqgmAWuMnDu58y vg+thq+YjtJ+Q== From: Chen-Yu Tsai To: Vinod Koul , Neil Armstrong , Manivannan Sadhasivam , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, =?UTF-8?q?Ond=C5=99ej=20Jirman?= , Andre Przywara Subject: [PATCH] phy: sun4i-usb: Avoid polling just for ID pin without OTG mode Date: Sun, 6 Dec 2026 12:31:28 +0800 Message-ID: <20261206043129.1383610-1-wens@kernel.org> X-Mailer: git-send-email 2.53.0 X-Archived-By: MIME-Version: 1.0 X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On some devices only the ID pin is hooked up, and there is no VBUS sensing or control, with VBUS directly tied to system 5V. On these devices we typically just force the OTG controller to host mode only. There is no point in polling just the ID pin if the result is never going to be used. So skip polling if the mode is not OTG and the ID pin is the only thing that needs to be polled. Signed-off-by: Chen-Yu Tsai --- drivers/phy/allwinner/phy-sun4i-usb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index f26eed0db17e..66454653bfc4 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -441,8 +441,11 @@ static bool sun4i_usb_phy0_have_vbus_det(struct sun4i_usb_phy_data *data) static bool sun4i_usb_phy0_poll(struct sun4i_usb_phy_data *data) { - if ((data->id_det_gpio && data->id_det_irq <= 0) || - (data->vbus_det_gpio && data->vbus_det_irq <= 0)) + if (data->dr_mode == USB_DR_MODE_OTG && + data->id_det_gpio && data->id_det_irq <= 0) + return true; + + if (data->vbus_det_gpio && data->vbus_det_irq <= 0) return true; /* -- 2.53.0 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy