phy: samsung: ufs: support secondary ufs phy
authorChanho Park <chanho61.park@samsung.com>
Tue, 7 Jun 2022 07:29:07 +0000 (16:29 +0900)
committerVinod Koul <vkoul@kernel.org>
Wed, 8 Jun 2022 16:21:33 +0000 (21:51 +0530)
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>
Link: https://lore.kernel.org/r/20220607072907.127000-6-chanho61.park@samsung.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/samsung/phy-samsung-ufs.c

index 0c933e3..206a79c 100644 (file)
@@ -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);