From nobody Tue Feb 10 05:26:17 2026 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D19F416EC0F for ; Tue, 7 May 2024 14:14:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091289; cv=none; b=CZy01GSFgrQY0qCY4u6d3mV5H+2Rzwy9aGiM8xCUPmYqa20dh1zUOKUZokibql3GMEUZfAuJDkCB1mT2WM0Z73fEjC7d0ZVd4066DXmldTjTOBNGpLDUeiLhLfYoIAYAydCj4X3vFshvRMenLZ4Y61Oga2JE+vHZncJvgF8/vBk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091289; c=relaxed/simple; bh=6Oq8yHjM77fS6G7Wl/q+/pRkj/j5+EWrA7Fxt21tL/M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ipCR++wN3wNcP84P6gNJAhwkItRB8fr6xkZr0SJiwU/2sShWqi0lL5/v3mPPcG380nmVnB5rtdXAWUK2Fsq8q9b+0UOZ0vBhS1YzQ7nER3B5kwGMQ+c+Cf/6qCA08S5PPkvuhpY1nAe9ro2oMQM4D+1ohRJbSEhXXuVW+44Kpuc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gBFSWZu8; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gBFSWZu8" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a5200afe39eso838619866b.1 for ; Tue, 07 May 2024 07:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715091286; x=1715696086; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=88e0LLt+lrc5lZzN56km9yoOnQ7q4J8j+3agax3Pphk=; b=gBFSWZu82+LLbFFE0YDCOaSvIlGvnyArEYMibtjS6hWATmvp/WJsW54oT4jW15ZXjD SkLKESfbj4Mwsw89NHDl3/zpkicT5Lf4IZd2dUofAwYRhK7AUsBNz3AzFZaRbv3yCOxE i6BffTcrVOJbM02x7Oa+8kNTILcw6UrwOLmFcWX5hiy6mNWWJP6i27Bo4MA2gIm1XB21 +rJuqz23rsLkah+vGDYy6JLsIQ5B6qAbOuk/te5WOG94ZfQd8jL3faCCKnYWrrbPqcnp aNENNIzbiHxepAoITyXNLe05wU8JyfliKKudVvkU4rlGrR4CQpA2jx1EuWVkqPhXVGz9 VuGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715091286; x=1715696086; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=88e0LLt+lrc5lZzN56km9yoOnQ7q4J8j+3agax3Pphk=; b=EE8C+KW4dbUWu2EuRpR9uOPOzSYuMsgPtXsjB31G+olkMP1wB1GEWAx58XAxDbmi4o S72oco1Ek6KqgTZZFbWx4VUO2iOky45+kyh6bryYyLYxbAikI6+1PisSIWHDyaAbVaX9 7APshbiAlNecLzGH1jMmGzW33geUTEf1gQpSspcautIvZ/xc7xRERK5F+CDtIwQrt0VE iCRZXMs8GIoz6zTxcf72keBLHFbHDKWtQ7yMf1a0sQVK4FtA/TuWXU0xEvZ/noOR60Rh yVpKd8WKFV33RPh22fe8s32vDSP/MvjWQ2B4As29gQlsy7cMqG/lyU7zmR0Eazw7gygj 1gDg== X-Forwarded-Encrypted: i=1; AJvYcCXF07ExnTMaPZhKbUxWsL09eGip6x+Qp6IjG7WSOgi2RkUjmO/Bf3u2xmb1/3WV6+Z3mslQuop/wbku4HBlNbC2yCFAqsSfiyrajWkV X-Gm-Message-State: AOJu0Yxkfh9LR31HcCkkySTsiamPUgnOB4hpg5oGh04O3X39tdCtwe2T anTAFx2pkezuPvkSUeOd04HRxFwiiMjOMmvGIfZfPAvaM51M/lCNjuX2eHLNvohJjopzYHJq/va Wzkpi/w== X-Google-Smtp-Source: AGHT+IE1P/hHMY3LIT1bpJkBILATQnwiTaFH5rXHwp3HQxVrvpMWG51xBDNGqOT3Uqe8ATRtG5gVQQ== X-Received: by 2002:a50:cd18:0:b0:572:a748:d46a with SMTP id z24-20020a50cd18000000b00572a748d46amr10471522edi.42.1715091286267; Tue, 07 May 2024 07:14:46 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id x2-20020a056402414200b00572cf08369asm5621928eda.23.2024.05.07.07.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:14:45 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Tue, 07 May 2024 15:14:44 +0100 Subject: [PATCH 1/5] phy: exynos5-usbdrd: uniform order of register bit macros Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240507-samsung-usb-phy-fixes-v1-1-4ccba5afa7cc@linaro.org> References: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> In-Reply-To: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Krzysztof Kozlowski , Alim Akhtar , Sam Protsenko Cc: Peter Griffin , Tudor Ambarus , Will McVicker , kernel-team@android.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.12.4 Most of the macros are ordered high -> low, but there are some outliers. Order them all uniformly from high to low. This will allow adding additional register (field) definitions in a consistent way. While at it, also remove some extra empty lines to group register bit field definitions together with the relevant register. This makes the registers easier to distinguish visually. No functional change. Signed-off-by: Andr=C3=A9 Draszik Reviewed-by: Peter Griffin --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 44 +++++++++++-----------------= ---- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung= /phy-exynos5-usbdrd.c index 04171eed5b16..2af192c15d78 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -35,13 +35,11 @@ =20 /* Exynos5: USB 3.0 DRD PHY registers */ #define EXYNOS5_DRD_LINKSYSTEM 0x04 - +#define LINKSYSTEM_XHCI_VERSION_CONTROL BIT(27) #define LINKSYSTEM_FLADJ_MASK (0x3f << 1) #define LINKSYSTEM_FLADJ(_x) ((_x) << 1) -#define LINKSYSTEM_XHCI_VERSION_CONTROL BIT(27) =20 #define EXYNOS5_DRD_PHYUTMI 0x08 - #define PHYUTMI_OTGDISABLE BIT(6) #define PHYUTMI_FORCESUSPEND BIT(1) #define PHYUTMI_FORCESLEEP BIT(0) @@ -49,40 +47,31 @@ #define EXYNOS5_DRD_PHYPIPE 0x0c =20 #define EXYNOS5_DRD_PHYCLKRST 0x10 - #define PHYCLKRST_EN_UTMISUSPEND BIT(31) - #define PHYCLKRST_SSC_REFCLKSEL_MASK (0xff << 23) #define PHYCLKRST_SSC_REFCLKSEL(_x) ((_x) << 23) - #define PHYCLKRST_SSC_RANGE_MASK (0x03 << 21) #define PHYCLKRST_SSC_RANGE(_x) ((_x) << 21) - #define PHYCLKRST_SSC_EN BIT(20) #define PHYCLKRST_REF_SSP_EN BIT(19) #define PHYCLKRST_REF_CLKDIV2 BIT(18) - #define PHYCLKRST_MPLL_MULTIPLIER_MASK (0x7f << 11) #define PHYCLKRST_MPLL_MULTIPLIER_100MHZ_REF (0x19 << 11) #define PHYCLKRST_MPLL_MULTIPLIER_50M_REF (0x32 << 11) #define PHYCLKRST_MPLL_MULTIPLIER_24MHZ_REF (0x68 << 11) #define PHYCLKRST_MPLL_MULTIPLIER_20MHZ_REF (0x7d << 11) #define PHYCLKRST_MPLL_MULTIPLIER_19200KHZ_REF (0x02 << 11) - -#define PHYCLKRST_FSEL_UTMI_MASK (0x7 << 5) #define PHYCLKRST_FSEL_PIPE_MASK (0x7 << 8) +#define PHYCLKRST_FSEL_UTMI_MASK (0x7 << 5) #define PHYCLKRST_FSEL(_x) ((_x) << 5) #define PHYCLKRST_FSEL_PAD_100MHZ (0x27 << 5) #define PHYCLKRST_FSEL_PAD_24MHZ (0x2a << 5) #define PHYCLKRST_FSEL_PAD_20MHZ (0x31 << 5) #define PHYCLKRST_FSEL_PAD_19_2MHZ (0x38 << 5) - #define PHYCLKRST_RETENABLEN BIT(4) - #define PHYCLKRST_REFCLKSEL_MASK (0x03 << 2) #define PHYCLKRST_REFCLKSEL_PAD_REFCLK (0x2 << 2) #define PHYCLKRST_REFCLKSEL_EXT_REFCLK (0x3 << 2) - #define PHYCLKRST_PORTRESET BIT(1) #define PHYCLKRST_COMMONONN BIT(0) =20 @@ -100,30 +89,27 @@ #define PHYREG1_CR_ACK BIT(0) =20 #define EXYNOS5_DRD_PHYPARAM0 0x1c - #define PHYPARAM0_REF_USE_PAD BIT(31) #define PHYPARAM0_REF_LOSLEVEL_MASK (0x1f << 26) #define PHYPARAM0_REF_LOSLEVEL (0x9 << 26) =20 #define EXYNOS5_DRD_PHYPARAM1 0x20 - #define PHYPARAM1_PCS_TXDEEMPH_MASK (0x1f << 0) #define PHYPARAM1_PCS_TXDEEMPH (0x1c) =20 #define EXYNOS5_DRD_PHYTERM 0x24 =20 #define EXYNOS5_DRD_PHYTEST 0x28 - #define PHYTEST_POWERDOWN_SSP BIT(3) #define PHYTEST_POWERDOWN_HSP BIT(2) =20 #define EXYNOS5_DRD_PHYADP 0x2c =20 #define EXYNOS5_DRD_PHYUTMICLKSEL 0x30 - #define PHYUTMICLKSEL_UTMI_CLKSEL BIT(2) =20 #define EXYNOS5_DRD_PHYRESUME 0x34 + #define EXYNOS5_DRD_LINKPORT 0x44 =20 /* USB 3.0 DRD PHY SS Function Control Reg; accessed by CR_PORT */ @@ -147,28 +133,28 @@ =20 /* Exynos850: USB DRD PHY registers */ #define EXYNOS850_DRD_LINKCTRL 0x04 -#define LINKCTRL_BUS_FILTER_BYPASS(_x) ((_x) << 4) #define LINKCTRL_FORCE_QACT BIT(8) +#define LINKCTRL_BUS_FILTER_BYPASS(_x) ((_x) << 4) =20 #define EXYNOS850_DRD_CLKRST 0x20 -#define CLKRST_LINK_SW_RST BIT(0) -#define CLKRST_PORT_RST BIT(1) #define CLKRST_PHY_SW_RST BIT(3) +#define CLKRST_PORT_RST BIT(1) +#define CLKRST_LINK_SW_RST BIT(0) =20 #define EXYNOS850_DRD_UTMI 0x50 -#define UTMI_FORCE_SLEEP BIT(0) -#define UTMI_FORCE_SUSPEND BIT(1) -#define UTMI_DM_PULLDOWN BIT(2) -#define UTMI_DP_PULLDOWN BIT(3) -#define UTMI_FORCE_BVALID BIT(4) #define UTMI_FORCE_VBUSVALID BIT(5) +#define UTMI_FORCE_BVALID BIT(4) +#define UTMI_DP_PULLDOWN BIT(3) +#define UTMI_DM_PULLDOWN BIT(2) +#define UTMI_FORCE_SUSPEND BIT(1) +#define UTMI_FORCE_SLEEP BIT(0) =20 #define EXYNOS850_DRD_HSP 0x54 -#define HSP_COMMONONN BIT(8) -#define HSP_EN_UTMISUSPEND BIT(9) -#define HSP_VBUSVLDEXT BIT(12) -#define HSP_VBUSVLDEXTSEL BIT(13) #define HSP_FSV_OUT_EN BIT(24) +#define HSP_VBUSVLDEXTSEL BIT(13) +#define HSP_VBUSVLDEXT BIT(12) +#define HSP_EN_UTMISUSPEND BIT(9) +#define HSP_COMMONONN BIT(8) =20 #define EXYNOS850_DRD_HSP_TEST 0x5c #define HSP_TEST_SIDDQ BIT(24) --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Tue Feb 10 05:26:17 2026 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B3A716F0CA for ; Tue, 7 May 2024 14:14:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091290; cv=none; b=bdfGHkyjiIo+re9u0LqN2OGKeamMXsOvLDdgB+KoKH6lfIxjh2TvbSMDKS7GjA2UkfnUqK0/kHKyTj343Q74gJZW+cd0pP9o7UoO97STwZCcfF6FkzbrM0RfalKr1SvsLQVHyo643VFSjDZ/LPOZYxMiNoTvAy9F/FJIEsW6cz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091290; c=relaxed/simple; bh=ffJbZVGjXwXnNEjgm1xAfng7yUEkFKHbk0/EPzlyDd4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KgBWr5ykPm4C3J54hHeZ2Ii+UxINqldmKVBTvwD/LRli0WmIcPQNURiyjewLW23STozW5+fI4ZK1hvnGftdWUu2PcCl3GDDgHQ0JJxPI4VdLiglVGNLlfCrv0Xaz4JGwyV9slwljYB7ejDVeG6pmKwjTnYsQ0vmi/hLltbwRceo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=k/zUVdyn; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="k/zUVdyn" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a59a17fcc6bso729567166b.1 for ; Tue, 07 May 2024 07:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715091287; x=1715696087; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5eNwp1KeR6q1csnKLq9DFYvN46m+YqLkkQLc199nW5E=; b=k/zUVdynRJLasnVkzrGxA+03vDugTnmQhIer5FYjOAsfjitSqQy0hUdVx3cgk46Rkg jZGDzfM1nApnMsigN65EglUX8I1zxB3VJblav0+IUK6hYtmmX6RCvEdoAkmb2dKtgOC0 npr+3QAucy7e2AIwuX7qONZM9Fvd15LAY7cf04QZTX76ng4WKdnrcmvMTrjxg5Xh1TTM CmQvEKd7Mf8PrIMwAsKu7E8/YIyWwcWXV8a5PjeJCAYkYpVP2xvK/WKU+sGKfHph2DoO 9+sY00Kpw8CiqMZe4XVxYdG063glwo27pCdRFGzIEzxRR/+Cd5Fl8jO4GwOZ9u5El8AV CiWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715091287; x=1715696087; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5eNwp1KeR6q1csnKLq9DFYvN46m+YqLkkQLc199nW5E=; b=DoBUpB5/z/xAL5ihyUgUX1d90/LtHnMOWqp5NwJjWvKZRiGwXWu38vJ9KBD22fs4OK yjr0xF3KuU29fdOQkh/R+kRo6zmXXkmGJfHGA2zj5FfkVzikvJ2qvG+U6glmkGY2/cik fEKaBp0JEzmzJbYktiqBYHXHRDUaIrANC4MBkWF9ot2WtUiFcVB+a/BHCRPGbOs3a1yO QF5SB13KIBIQIZQAJ8c3bAZFptKPBo30brgETGp/D4x7LS9loZrjhZUwjwgLNxohwzMx b6Th1fwMwvDO+wJe9MoCFQYw6opyHDpPGJ/qk5gJlngnV9HIXctA74gbT7dJmv79AlRi NL5g== X-Forwarded-Encrypted: i=1; AJvYcCWbPxbOlcZIRqeAwGDyDO75aLVH3H7cxL2gcItNYNFQULcVS019kK7BWwW2TYx6NX5UXsGoYKkIPjYew0XZ+Oz8oyEQa57aRZvkkqIE X-Gm-Message-State: AOJu0Yz2aKZmZQXWYEH8Uuy/uAaGAoFNRGVaklQTC15CY3RBqh7D4DwI eSxTR+I5jdh80ZSCxRxro6bxT6KRZC2aQgYB8diin9w19HGT58iq3blXEZ+SmxQ= X-Google-Smtp-Source: AGHT+IFlhgpaj8s7Ylef1U/lb5hV3d+hj+0ADsOWoK2vF6wUkDdpIOR9A24GskIxbkz+a/2MUnIIDg== X-Received: by 2002:a50:8d16:0:b0:572:6ab0:6afc with SMTP id s22-20020a508d16000000b005726ab06afcmr9113193eds.33.1715091286727; Tue, 07 May 2024 07:14:46 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id x2-20020a056402414200b00572cf08369asm5621928eda.23.2024.05.07.07.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:14:46 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Tue, 07 May 2024 15:14:45 +0100 Subject: [PATCH 2/5] phy: exynos5-usbdrd: convert udelay() to fsleep() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240507-samsung-usb-phy-fixes-v1-2-4ccba5afa7cc@linaro.org> References: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> In-Reply-To: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Krzysztof Kozlowski , Alim Akhtar , Sam Protsenko Cc: Peter Griffin , Tudor Ambarus , Will McVicker , kernel-team@android.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.12.4 The timers-howto recommends using usleep_range() and friends anytime waiting for >=3D ~10us is required. Doing so can help the timer subsystem a lot to coalesce wakeups. Additionally, fsleep() exists as a convenient wrapper so we do not have to think about which exact sleeping function is required in which case. Convert all udelay() calls in this driver to use fsleep() to follow the recommendataion. Signed-off-by: Andr=C3=A9 Draszik Reviewed-by: Peter Griffin --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung= /phy-exynos5-usbdrd.c index 2af192c15d78..1b209ab7a268 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -448,7 +448,7 @@ static int exynos5_usbdrd_phy_init(struct phy *phy) =20 writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYCLKRST); =20 - udelay(10); + fsleep(10); =20 reg &=3D ~PHYCLKRST_PORTRESET; writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYCLKRST); @@ -779,11 +779,11 @@ static void exynos850_usbdrd_utmi_init(struct exynos5= _usbdrd_phy *phy_drd) writel(reg, regs_base + EXYNOS850_DRD_HSP_TEST); =20 /* Finish PHY reset (POR=3Dlow) */ - udelay(10); /* required before doing POR=3Dlow */ + fsleep(10); /* required before doing POR=3Dlow */ reg =3D readl(regs_base + EXYNOS850_DRD_CLKRST); reg &=3D ~(CLKRST_PHY_SW_RST | CLKRST_PORT_RST); writel(reg, regs_base + EXYNOS850_DRD_CLKRST); - udelay(75); /* required after POR=3Dlow for guaranteed PHY clock */ + fsleep(75); /* required after POR=3Dlow for guaranteed PHY clock */ =20 /* Disable single ended signal out */ reg =3D readl(regs_base + EXYNOS850_DRD_HSP); @@ -836,7 +836,7 @@ static int exynos850_usbdrd_phy_exit(struct phy *phy) reg =3D readl(regs_base + EXYNOS850_DRD_CLKRST); reg |=3D CLKRST_LINK_SW_RST; writel(reg, regs_base + EXYNOS850_DRD_CLKRST); - udelay(10); /* required before doing POR=3Dlow */ + fsleep(10); /* required before doing POR=3Dlow */ reg &=3D ~CLKRST_LINK_SW_RST; writel(reg, regs_base + EXYNOS850_DRD_CLKRST); =20 --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Tue Feb 10 05:26:17 2026 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98EF316F0CE for ; Tue, 7 May 2024 14:14:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091290; cv=none; b=XGfrUWPprL0zBgPW5iOJYQ3pMOFpGcepDHyPatbHyayCXQ3cq7PXtifdqGfrJ5EliUGBUOPBGoSSWZjnbMGKTNarEkI5egzHIny6JriV/iAzTTtiVX1JN1t6jlNhLFREelNkH7k+rZvlazmVzK3AFYMnkFru6ze6dJX22uH1cMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091290; c=relaxed/simple; bh=QcH+btRFNoWS4TjpLpt+GQ3sskfBxn9Nd4Jm3dRcxGs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C7o6Cm36lTmW0TX7FIe1HVmJDnYfS/Lg/NZDO6XkKvsNTZwcjVYTRKZn2QwLwvpsJTAFKx6hBaTfMSsv59eOVLLuZJrw8zx123Rl+8VpBbTp6m6G8aJVZ0i9ofybljtfjSiaA4yBOMpECfNZPI/ZacVNzVd9AEZExzempObkZtA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Su+zFz2l; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Su+zFz2l" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a59b81d087aso682767766b.3 for ; Tue, 07 May 2024 07:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715091287; x=1715696087; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=PzqUO+Y4mCEkRzT42mutSa2giiTX1rn5tTLc65YmNFs=; b=Su+zFz2l86wwrdbf0v7o+iWoFsQtWSKhymbdA37Ly2uXEBA5aN2mixB9NtWUCeSiVL Y6nvLQkqfpl10wrc/kXZXRXiROeCoQK8HT6vBxeQYHlurgekC2UuLv2sM8ZJDSvk6/85 EsjoV9Lv/bKl5b/LfGVgr0W0ocO2VjXfqviqjPD2P4U4Dy227ILEoduVobkPudvbMhOK snCTIT3da2qNIQqvR9gmVOHW8DkvTbI71WCD/8qg/vPSY8ng8r7mGjAB6bhBGUW+3ZVw TPWiRSsZfG85f6736ReoktKFHp9RCx+uvuy9l0rhqK9ENECmA+p0Wv/vJcxTgRDmU1WT Uasw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715091287; x=1715696087; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PzqUO+Y4mCEkRzT42mutSa2giiTX1rn5tTLc65YmNFs=; b=M6gPAQ6uyHWTwQvN9LWIIhNEa9XwTMyzzdcykw7OW62vC4RaxqJK7ZEboys8pNGlJS w1mZ/hf1GLGhhOBLY2XLjnhaja2cmylUuqN94TPW3t6wxinwUVPRrZJBV0HpDLySH99N +IVCjVlzS7Q1HmAi1NzSBi2cdT+ymK1BVezVKHwhf+m4d02nokfvz6V0/s7HWECTjcSx VQKWgPKoTYn+JxN0PK656y6o+N4xKoMCItgE9nf9E0Au5WRAkXvLNTYb0jt9Xdn6OXrw 9+2iWTbcCNkE56ProbuD+OZQetwe3NVBwCWl7oxiFsEj+epviqlXMLJr2YV0aPjSB0LB V3pg== X-Forwarded-Encrypted: i=1; AJvYcCXO2LzpRSjOac1rGYIsMQfHi7gH5p6tI/VExPys9Re0w1d6vd7lBp+3aPGOM4dtnJmSD+W9Bh+RekDZO62BN1OvLZdOzJaSvzcRmndE X-Gm-Message-State: AOJu0YwO8vMkaS4CoXHnFZdZhItWclmk56c3o2Uh1pgzlABWRD7b9UBA x/Zfpz2mZom+k69L6EdqlmUQ2+oF1kh9QoUNlBhQJlxusLr8LCx6Hwd4JesZoLE= X-Google-Smtp-Source: AGHT+IFLbaE7KL4bM9NZleowwf/9bWz6QW+2cO4ZQn/n47PzlsG520bpJ6V/v0rjjw6rNMHBVt1ovw== X-Received: by 2002:a50:c319:0:b0:56f:e7b9:e67d with SMTP id a25-20020a50c319000000b0056fe7b9e67dmr13463276edb.12.1715091287117; Tue, 07 May 2024 07:14:47 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id x2-20020a056402414200b00572cf08369asm5621928eda.23.2024.05.07.07.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:14:46 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Tue, 07 May 2024 15:14:46 +0100 Subject: [PATCH 3/5] phy: exynos5-usbdrd: make phy_isol() take a bool for clarity Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240507-samsung-usb-phy-fixes-v1-3-4ccba5afa7cc@linaro.org> References: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> In-Reply-To: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Krzysztof Kozlowski , Alim Akhtar , Sam Protsenko Cc: Peter Griffin , Tudor Ambarus , Will McVicker , kernel-team@android.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.12.4 on / not on is just a boolean flag and is a bit misleading as currently on=3D=3D1 means to turn off the power, and on=3D=3D0 to turn power on. Rename the flag and make it a bool to avoid confusion of future readers of this code. No functional change. While at it, fix a whitespace issue in nearby comment. No functional change. Signed-off-by: Andr=C3=A9 Draszik Reviewed-by: Peter Griffin --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung= /phy-exynos5-usbdrd.c index 1b209ab7a268..ed4898741c99 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -173,7 +173,7 @@ struct exynos5_usbdrd_phy; =20 struct exynos5_usbdrd_phy_config { u32 id; - void (*phy_isol)(struct phy_usb_instance *inst, u32 on); + void (*phy_isol)(struct phy_usb_instance *inst, bool isolate); void (*phy_init)(struct exynos5_usbdrd_phy *phy_drd); unsigned int (*set_refclk)(struct phy_usb_instance *inst); }; @@ -273,14 +273,14 @@ static unsigned int exynos5_rate_to_clk(unsigned long= rate, u32 *reg) } =20 static void exynos5_usbdrd_phy_isol(struct phy_usb_instance *inst, - unsigned int on) + bool isolate) { unsigned int val; =20 if (!inst->reg_pmu) return; =20 - val =3D on ? 0 : EXYNOS4_PHY_ENABLE; + val =3D isolate ? 0 : EXYNOS4_PHY_ENABLE; =20 regmap_update_bits(inst->reg_pmu, inst->pmu_offset, EXYNOS4_PHY_ENABLE, val); @@ -525,8 +525,8 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy) } } =20 - /* Power-on PHY*/ - inst->phy_cfg->phy_isol(inst, 0); + /* Power-on PHY */ + inst->phy_cfg->phy_isol(inst, false); =20 return 0; =20 @@ -553,7 +553,7 @@ static int exynos5_usbdrd_phy_power_off(struct phy *phy) dev_dbg(phy_drd->dev, "Request to power_off usbdrd_phy phy\n"); =20 /* Power-off the PHY */ - inst->phy_cfg->phy_isol(inst, 1); + inst->phy_cfg->phy_isol(inst, true); =20 /* Disable VBUS supply */ if (phy_drd->vbus) --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Tue Feb 10 05:26:17 2026 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFD0316F0D4 for ; Tue, 7 May 2024 14:14:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091290; cv=none; b=EgBemmQ+CAHYRrm2XBNVeSUk1CM9DnKbEhC+fKh83E0lEb2o01coo/rR5n8mbkGhGf3I0vOqV9hcQ3Sn6G3gPrtyjCn2xYYtaN8U+uGubVVa7qHePcjr7sR0sFzCs61e47Btw7jS2Tr+wUYzqsCGcozU4bPNVWEeACegvBUXFWM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091290; c=relaxed/simple; bh=3bFJoZ914QT6J6EQqjd5/3SA82dIJ6nV/7s+Fn+7mFI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fOkBgzKCkVB5GwZWe1AdjrCg9wyb47XDmk91rFLDDk1bBLu6jEiK2fpPSi3+Jn2ysVj+KpYPOPLPABfA/A6oTqDBoXNQwmn6Ee81KGrlcYyA/o4AMkz5E2fdxzQEmZiLM3Mg4Ycf88TW/Qw8pJpS9ZVqRGlivsSS1SfFH+1WRdk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=PYRBv4F3; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PYRBv4F3" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a59b81d087aso682769166b.3 for ; Tue, 07 May 2024 07:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715091287; x=1715696087; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=LRJY6HmSgpn53uyORMcRB9h2EnMXe+jzCDlKmur6pwc=; b=PYRBv4F3VRuptvTlCe6L977JCJgqknY5uuvtWh2ulsfZ90knBw6ViZOX6lxoRe68BE 1qEy/fLayeSl2IC1hrOiglYQffpA6zXaecWohmB2+2Ka2HqNn6o2GagP5f8Ou33Ry0SL 7cbN3r0ts6YMWh8dW7XQXuh4wWsMUyUR3snkbZPTX2uQ18q8urSwHMTzkdGlV29GbBX1 sqk3RzSsPUvmoRZxubsd3E6VMx0lL1+vvOcswoNsg2tBeBg/dngeK+wPUZBWJf3Jdq4K 4Hx1tbKggmi6wF2gEpPqbGPLFeQNqpWmLKSe9hYJ6ePNItqM0UcZ1eXcgGhDh01OKjTQ Qvwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715091287; x=1715696087; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LRJY6HmSgpn53uyORMcRB9h2EnMXe+jzCDlKmur6pwc=; b=VBea4RsbXzOI/GBeXsxGvy1Rv7s1ZULz28O6oxUv7FDgx8S9+wWNrB/Tz8U1JaXVYO OJ/Zg7szAvq0WdCUr4fYu5UpT0w0xOxkX6MrVQqpqvuXusEQzgcUy5XiNefup6jOBpUN QrZyrGF0c+vVzzgkZIPOPdkDKEw/WksQsCakv54HsTVTAmJOWWTt+JO8tyeXC5AQJxx3 V4HysTvvMvRiK3sDPJ8UlAuXJY4AL3POYp8hmuJP3OwydS+OwOECY08BTiwgfScJ+cKz Vv10oaTmbk3PUssWuJdSWyyvl6BftaoBYpoZT48bXIOqWAI2FgR+VWXG11a1Ugl3Twf/ UwIg== X-Forwarded-Encrypted: i=1; AJvYcCVFZYgHhaQx7bkR0lkPOZ9dORe5YIUsKOFa6XR8+vHVyWcUUIh9jfNCN2/Iaa0cgq2Oxa5oZWoca+yK+QWCAgYOR3tSByhQozVJmPkX X-Gm-Message-State: AOJu0YzMhVkxTJoudr1cMHVO1EF6QtQLsBtW0LqyKR8USa31gCxcp7ny fKKnB3++vrEkmCmeC2NEQ2OhO7th42uDKex2++nizFcmybS6xQhyNXecT5fI/sE= X-Google-Smtp-Source: AGHT+IEdZxa78ehLtOjVAh87nK9d2t0R1fsYeVK5kmd0WktV4j/K80OYdHHk5mz5N7FPqzg+kN+QUg== X-Received: by 2002:a50:a45c:0:b0:572:9dc3:ce3b with SMTP id v28-20020a50a45c000000b005729dc3ce3bmr11623041edb.1.1715091287502; Tue, 07 May 2024 07:14:47 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id x2-20020a056402414200b00572cf08369asm5621928eda.23.2024.05.07.07.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:14:47 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Tue, 07 May 2024 15:14:47 +0100 Subject: [PATCH 4/5] phy: exynos5-usbdrd: fix definition of EXYNOS5_FSEL_26MHZ Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240507-samsung-usb-phy-fixes-v1-4-4ccba5afa7cc@linaro.org> References: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> In-Reply-To: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Krzysztof Kozlowski , Alim Akhtar , Sam Protsenko Cc: Peter Griffin , Tudor Ambarus , Will McVicker , kernel-team@android.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.12.4 Using 0x82 seems odd, where everything else is just a sequence. On E850, this macro isn't used (as a register value), only to assign its value to the 'extrefclk' variable, which is otherwise unused on that platform. Older platforms don't appear to support 26MHz in the first place (since this macro was added for E850). Furthermore, the downstream driver uses 0x82 to denote USBPHY_REFCLK_DIFF_26MHZ (whatever that means exactly), but for all the other values we match downstream's non-DIFF macros. Update to avoid confusion. No functional change intended. Signed-off-by: Andr=C3=A9 Draszik Reviewed-by: Peter Griffin --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung= /phy-exynos5-usbdrd.c index ed4898741c99..1da7a4881f72 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -30,7 +30,7 @@ #define EXYNOS5_FSEL_19MHZ2 0x3 #define EXYNOS5_FSEL_20MHZ 0x4 #define EXYNOS5_FSEL_24MHZ 0x5 -#define EXYNOS5_FSEL_26MHZ 0x82 +#define EXYNOS5_FSEL_26MHZ 0x6 #define EXYNOS5_FSEL_50MHZ 0x7 =20 /* Exynos5: USB 3.0 DRD PHY registers */ --=20 2.45.0.rc1.225.g2a3ae87e7f-goog From nobody Tue Feb 10 05:26:17 2026 Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E0DC16F0DF for ; Tue, 7 May 2024 14:14:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091291; cv=none; b=tlj84JtPhcjkjtnIkjL9BgL8LIsrd/w6vPk8f7VEAY4xFKN5eg6faS5ZXnoTi7JgmyssYt8Tu6OWjoSpTuRhyc5W0dFG2B3vfLlLdaC+qxRKZuQy+UM171job3MRS4OLubyT25aGiePwxx9o+IXfhPQeSxOpgOLoDHLbHwHUlRg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091291; c=relaxed/simple; bh=nNkzepDc1fooDRMrZKnyw8mRCNAwIUztgx5zJ3NkPpA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pCNi7rjUajYV4O0MHdz0cs4TI/zSfYo8oalq/EVNQhZ/3QtQigW6xKyLo1EqGBycFm4QA7sqvGdvj2rPUy9ZcTU5L3oWFd71SP9TK+ZqtM6wOzCjWG+3xCJl5IoqAqXOkXeSr7K6nE0g1qbyo5mapLx4Z8GH1DUMs5r3zvDtmpI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=rwz6PqYh; arc=none smtp.client-ip=209.85.208.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rwz6PqYh" Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-572c65cea55so5053062a12.0 for ; Tue, 07 May 2024 07:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715091288; x=1715696088; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2AhGxPfO0jxLeMCNC4W84i2OQnqDzy87o4JACQM4lhg=; b=rwz6PqYh12EfdzpbqGaIhigcNlzEMv20hALD5YwidYNpOkQ3mZFfYllao27HnUysO2 vD+jZIm8N6iESTx92EzUgXnsFqlzTOzrpIYHCIDsIGUzppEOnfJ4BBDniDzEW5invIfb we7pa6HsMUsQ6WQRl9zi4WJ95rkFjxLitmNVoRCkeJxjJrFBLDbWG9UeUo0DYBnFTfh6 tukubdeWu9zbAfVhJfV3+ZqvhXuimZWzPknW33ThWF5zVWP7qVunTF9+Ucb2/o9J/e+G HXV5By8Mp5E1KaT2m8w+60jow6Gc81pF3Jjr/11Be2ScV3cGTHNAU7b6Ryi9roAN90eq fQLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715091288; x=1715696088; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2AhGxPfO0jxLeMCNC4W84i2OQnqDzy87o4JACQM4lhg=; b=iQD9LDMD/zOw6Japgh+lJQE2BCtuu4c0W6kwphxBCEr22bbxKqCjqI5CTKl0cyjZVz QR7Q2QoDrZFnlqmOtU4AXPRxTlVlIhNDM+doUucecJiCAL+WtHwpfAeAgMGSzsd+WHaS o2mo/rtjDsRuJYEMVysnrvoJY7yw/gtTpPUwl8l8YqJnxwan7msWJbtZMbKEh+aJ0XTK PAh3f6ijCghYbI9e8PLAQb95YbmOygCzIFjcLuIAb6f9SB0Ply4sOUpzi9qQyJlvZYoD TC7XrGfrhvjYdOql92OdS1uOebGE2lTgPjoGCLvRZdDG5duFFVTFRf9TjFj8j+3qR5fg TWRQ== X-Forwarded-Encrypted: i=1; AJvYcCUhb76fxNgduqF/f3Ssy6Ou1MteCnuJMNDcAemXH00/oggNq1i4RzNN1OJgkmodZFymFv0zTFas+8MMd1duXYPf3xcZfO5/Srf6TAN+ X-Gm-Message-State: AOJu0YynCNRbEJkJA5NItvMoElpbvsB7mpKm3ngQW40scJkcQeeiw8/d TmgEIAn2GsVOW9+JAHT02nvxYYuSjbFPleXto4EOe5zoxmg2hpejZYPxa/yBpog= X-Google-Smtp-Source: AGHT+IF93U5EbjSwxazXGCgRUoQpkJwYIG6vkvVms1C680kr/QzgHDatBvsRnvscl1lkUzBabOX3fA== X-Received: by 2002:a50:f683:0:b0:572:a158:8a7b with SMTP id d3-20020a50f683000000b00572a1588a7bmr2479836edn.8.1715091287917; Tue, 07 May 2024 07:14:47 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id x2-20020a056402414200b00572cf08369asm5621928eda.23.2024.05.07.07.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:14:47 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Tue, 07 May 2024 15:14:48 +0100 Subject: [PATCH 5/5] phy: exynos5-usbdrd: set ref clk freq in exynos850_usbdrd_utmi_init() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240507-samsung-usb-phy-fixes-v1-5-4ccba5afa7cc@linaro.org> References: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> In-Reply-To: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Krzysztof Kozlowski , Alim Akhtar , Sam Protsenko Cc: Peter Griffin , Tudor Ambarus , Will McVicker , kernel-team@android.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.12.4 While commit 255ec3879dd4 ("phy: exynos5-usbdrd: Add 26MHz ref clk support") correctly states that CLKRSTCTRL[7:5] doesn't need to be set on modern Exynos platforms, SSPPLLCTL[2:0] should be programmed with the frequency of the reference clock for the USB2.0 phy instead. I stumbled across this while adding support for the Google Tensor gs101, but this should apply to E850 just the same. Do so. Fixes: 691525074db9 ("phy: exynos5-usbdrd: Add Exynos850 support") Signed-off-by: Andr=C3=A9 Draszik Reviewed-by: Peter Griffin --- Feel free to drop the Fixes: if you think that is unwarranted here. v2: add missing bitfield.h include (seems this is implied on some platforms, but not on others) --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung= /phy-exynos5-usbdrd.c index 1da7a4881f72..15be966b50ae 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -8,6 +8,7 @@ * Author: Vivek Gautam */ =20 +#include #include #include #include @@ -141,6 +142,9 @@ #define CLKRST_PORT_RST BIT(1) #define CLKRST_LINK_SW_RST BIT(0) =20 +#define EXYNOS850_DRD_SSPPLLCTL 0x30 +#define SSPPLLCTL_FSEL GENMASK(2, 0) + #define EXYNOS850_DRD_UTMI 0x50 #define UTMI_FORCE_VBUSVALID BIT(5) #define UTMI_FORCE_BVALID BIT(4) @@ -773,6 +777,31 @@ static void exynos850_usbdrd_utmi_init(struct exynos5_= usbdrd_phy *phy_drd) reg |=3D HSP_VBUSVLDEXT | HSP_VBUSVLDEXTSEL; writel(reg, regs_base + EXYNOS850_DRD_HSP); =20 + reg =3D readl(regs_base + EXYNOS850_DRD_SSPPLLCTL); + reg &=3D ~SSPPLLCTL_FSEL; + switch (phy_drd->extrefclk) { + case EXYNOS5_FSEL_50MHZ: + reg |=3D FIELD_PREP_CONST(SSPPLLCTL_FSEL, 7); + break; + case EXYNOS5_FSEL_26MHZ: + reg |=3D FIELD_PREP_CONST(SSPPLLCTL_FSEL, 6); + break; + case EXYNOS5_FSEL_24MHZ: + reg |=3D FIELD_PREP_CONST(SSPPLLCTL_FSEL, 2); + break; + case EXYNOS5_FSEL_20MHZ: + reg |=3D FIELD_PREP_CONST(SSPPLLCTL_FSEL, 1); + break; + case EXYNOS5_FSEL_19MHZ2: + reg |=3D FIELD_PREP_CONST(SSPPLLCTL_FSEL, 0); + break; + default: + dev_warn(phy_drd->dev, "unsupported ref clk: %#.2x\n", + phy_drd->extrefclk); + break; + } + writel(reg, regs_base + EXYNOS850_DRD_SSPPLLCTL); + /* Power up PHY analog blocks */ reg =3D readl(regs_base + EXYNOS850_DRD_HSP_TEST); reg &=3D ~HSP_TEST_SIDDQ; --=20 2.45.0.rc1.225.g2a3ae87e7f-goog