diff mbox series

[v4,5/5] phy: samsung: ufs: support secondary ufs phy

Message ID 20220607072907.127000-6-chanho61.park@samsung.com (mailing list archive)
State New, archived
Headers show
Series support secondary ufs for Exynos Auto v9 SoC | expand

Commit Message

Chanho Park June 7, 2022, 7:29 a.m. UTC
To support secondary ufs phy device, we need to get an offset for phy
isolation from the syscon DT node. If the first index argument of the
node is existing, we can read the offset value and set it as isol->offset.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/phy/samsung/phy-samsung-ufs.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Alim Akhtar June 7, 2022, 5:12 p.m. UTC | #1
>-----Original Message-----
>From: Chanho Park [mailto:chanho61.park@samsung.com]
>Sent: Tuesday, June 7, 2022 12:59 PM
>To: Kishon Vijay Abraham I <kishon@ti.com>; Vinod Koul
><vkoul@kernel.org>; Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>;
>Alim Akhtar <alim.akhtar@samsung.com>; Rob Herring
><robh+dt@kernel.org>; Krzysztof Kozlowski
><krzysztof.kozlowski+dt@linaro.org>
>Cc: devicetree@vger.kernel.org; linux-phy@lists.infradead.org; linux-
>samsung-soc@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Chanho
>Park <chanho61.park@samsung.com>
>Subject: [PATCH v4 5/5] phy: samsung: ufs: support secondary ufs phy
>
>To support secondary ufs phy device, we need to get an offset for phy
>isolation from the syscon DT node. If the first index argument of the node is
>existing, we can read the offset value and set it as isol->offset.
>
>Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>Signed-off-by: Chanho Park <chanho61.park@samsung.com>
>---
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>


> drivers/phy/samsung/phy-samsung-ufs.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/drivers/phy/samsung/phy-samsung-ufs.c
>b/drivers/phy/samsung/phy-samsung-ufs.c
>index 0c933e364064..206a79c69a6c 100644
>--- a/drivers/phy/samsung/phy-samsung-ufs.c
>+++ b/drivers/phy/samsung/phy-samsung-ufs.c
>@@ -288,6 +288,7 @@ static int samsung_ufs_phy_probe(struct
>platform_device *pdev)
> 	struct phy *gen_phy;
> 	struct phy_provider *phy_provider;
> 	const struct samsung_ufs_phy_drvdata *drvdata;
>+	u32 isol_offset;
> 	int err = 0;
>
> 	match = of_match_node(samsung_ufs_phy_match, dev->of_node);
>@@ -330,6 +331,10 @@ static int samsung_ufs_phy_probe(struct
>platform_device *pdev)
> 	phy->has_symbol_clk = drvdata->has_symbol_clk;
> 	memcpy(&phy->isol, &drvdata->isol, sizeof(phy->isol));
>
>+	if (!of_property_read_u32_index(dev->of_node, "samsung,pmu-
>syscon", 1,
>+					&isol_offset))
>+		phy->isol.offset = isol_offset;
>+
> 	phy->lane_cnt = PHY_DEF_LANE_CNT;
>
> 	phy_set_drvdata(gen_phy, phy);
>--
>2.36.1
diff mbox series

Patch

diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
index 0c933e364064..206a79c69a6c 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.c
+++ b/drivers/phy/samsung/phy-samsung-ufs.c
@@ -288,6 +288,7 @@  static int samsung_ufs_phy_probe(struct platform_device *pdev)
 	struct phy *gen_phy;
 	struct phy_provider *phy_provider;
 	const struct samsung_ufs_phy_drvdata *drvdata;
+	u32 isol_offset;
 	int err = 0;
 
 	match = of_match_node(samsung_ufs_phy_match, dev->of_node);
@@ -330,6 +331,10 @@  static int samsung_ufs_phy_probe(struct platform_device *pdev)
 	phy->has_symbol_clk = drvdata->has_symbol_clk;
 	memcpy(&phy->isol, &drvdata->isol, sizeof(phy->isol));
 
+	if (!of_property_read_u32_index(dev->of_node, "samsung,pmu-syscon", 1,
+					&isol_offset))
+		phy->isol.offset = isol_offset;
+
 	phy->lane_cnt = PHY_DEF_LANE_CNT;
 
 	phy_set_drvdata(gen_phy, phy);