From patchwork Fri Nov 20 15:38:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11921153 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=-16.8 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,URIBL_BLOCKED, 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 17873C2D0E4 for ; Fri, 20 Nov 2020 15:40:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 75BC722252 for ; Fri, 20 Nov 2020 15:40:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hKffY6In"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="idKg8a9h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75BC722252 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=JSDwPuVMsXH/ruFoWSCN6dmvbL/G9wqDdHD8L/U5Ujk=; b=hKffY6In0CniYiG8WYRZTWGIPH 58AuAOFBUnuohq+DO5s8jbpmR2iEwoImpLO1MjTtsip2xp4lm68niIvqje7BNXUJfQSUk6yZhDdy3 bw5pJIRvvEilSYAyCZMY7uryhI7Dl0YFi3WMdCMuatpj6Gxw9DxJ+aknt9sUcXm0W7kWH+exOtMsW +yTSIBxsctb7QIW5K/1AzPMzmp3T2xBKnZyGJgO/0FXZRiJQPEFF7Ug8bXloWSq7osYcCnhX63gDr y4bnTxodV1vEpHGCx7pATbfMZLbIWe9PS+S59SVdFWy9ufFqy3tAvTk4CKySPHw9A74L7VdfGy/O6 zz2B6rfg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg8V7-0001kH-10; Fri, 20 Nov 2020 15:39:05 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg8V3-0001ir-Da for linux-arm-kernel@lists.infradead.org; Fri, 20 Nov 2020 15:39:02 +0000 Received: by mail-wr1-x443.google.com with SMTP id d12so10389762wrr.13 for ; Fri, 20 Nov 2020 07:39:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Jt0xR/XFtpMRIuj7oLrfJvxFoX3/OcrnceaJeMN2qXk=; b=idKg8a9h4DmuA2CHSqlnfdiwPyTJyJUDzreNBsk55cXRvx1yJnTndM8bscb0OIT6bp eCH1w6RGo0XyGZ0FKyuVu1JhmkvMSnVLXNoT2s8Exk+pZa/+8I5jHAo91Pj8T2hmJ8ef x6/jcY/Z6Hc6Sm/sJxK1fC5QZG0NkR7tt7M9eBaAKNUc3lV2FYbdbZVibfgghtVI5lqZ n3sz/aQoD17JwtdAlfGkBRNgdQx6N8mLro3LpoynVFPAPLGNf7D4rCzHNtbloPj946JK /Gxj04J8xYC7A4fI8uoIGWGW8gRbYNVsx2SQeFFZh1LGij4oif34QiNWKwm3Lhu4KaQl jUZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Jt0xR/XFtpMRIuj7oLrfJvxFoX3/OcrnceaJeMN2qXk=; b=ohcY0liYQvqrm7Gd8wMHVgJ9j9KTq+AdMwFWAHjYelfadu8jGwGt1vKIO+oAsE9tWr 6uIcyJ9vRCehxkc3+qOKStOBfD9QyywY4Cmf4kdnvk/a30TxafSubHbp9OV8vrw1Zl0Q 3hNiHHhIvP5MvtiH7tPxfrmW8Bj9nVkLZTCBX1ogFFR8OHXCBD/T/0XAxInDjhYaJt54 vgiJcjzJZStaFi+4kRGfbIeb2Tjcl1KgrGQQRE3k6H6WwtyWawKh/HAhx1uq/qo7hjf6 nHdVZMn2gMDP4IgDPW58m0FWdeHKUoM0FflbPwaZJrZT54SeD2zuvL+2p6YwBfRFj4b7 ruMw== X-Gm-Message-State: AOAM532K/27TVax8Xk8MHGpUQJfZdhZT8Fo8KRciKKLpEIwzGlW7bXfB 9UNlcTwwr0864XRo7VOF2pjKTA== X-Google-Smtp-Source: ABdhPJzmjSiKUSGQWJXOUnb98ph3ukVEonWNRpVs1Gssn89XGBVl/IvBKBKU2+ysbbvZvrO0wLuWHg== X-Received: by 2002:adf:a54d:: with SMTP id j13mr17709111wrb.132.1605886740225; Fri, 20 Nov 2020 07:39:00 -0800 (PST) Received: from localhost.localdomain ([2a01:e35:2ec0:82b0:419f:dca4:d17a:66a7]) by smtp.gmail.com with ESMTPSA id b14sm5189845wrs.46.2020.11.20.07.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2020 07:38:59 -0800 (PST) From: Neil Armstrong To: vkoul@kernel.org, kishon@ti.com Subject: [PATCH v3] phy: amlogic: phy-meson-gxl-usb2: keep ID pull-up even in Host mode Date: Fri, 20 Nov 2020 16:38:55 +0100 Message-Id: <20201120153855.3920757-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201120_103901_495786_C9E007E2 X-CRM114-Status: GOOD ( 14.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Martin Blumenstingl , Kevin Hilman , linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In order to keep OTG ID detection even when in Host mode, the ID line of the PHY (if the current phy is an OTG one) pull-up should be kept enable in both modes. This fixes OTG switch on GXL, GXM & AXG platforms, otherwise once switched to Host, the ID detection doesn't work anymore to switch back to Device. Signed-off-by: Neil Armstrong Reviewed-by: Kevin Hilman Reviewed-by: Martin Blumenstingl --- drivers/phy/amlogic/phy-meson-gxl-usb2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb2.c b/drivers/phy/amlogic/phy-meson-gxl-usb2.c index 875afb2672c7..2b3c0d730f20 100644 --- a/drivers/phy/amlogic/phy-meson-gxl-usb2.c +++ b/drivers/phy/amlogic/phy-meson-gxl-usb2.c @@ -158,7 +158,8 @@ static int phy_meson_gxl_usb2_set_mode(struct phy *phy, U2P_R0_DM_PULLDOWN); regmap_update_bits(priv->regmap, U2P_R0, U2P_R0_DP_PULLDOWN, U2P_R0_DP_PULLDOWN); - regmap_update_bits(priv->regmap, U2P_R0, U2P_R0_ID_PULLUP, 0); + regmap_update_bits(priv->regmap, U2P_R0, U2P_R0_ID_PULLUP, + U2P_R0_ID_PULLUP); break; case PHY_MODE_USB_DEVICE: