Commit f86c1d0a authored by Chanho Park's avatar Chanho Park Committed by Vinod Koul

phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy

To change an offset of pmu_isol, we need to store its data instead of
having drvdata's pointer. The definition of the pmu_isol structure
should be extracted from samsung_ufs_phy_drvdata and rename the name
with samsung_ufs_phy_ prefix.
Suggested-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: default avatarChanho Park <chanho61.park@samsung.com>
Reviewed-by: default avatarAlim Akhtar <alim.akhtar@samsung.com>
Link: https://lore.kernel.org/r/20220607072907.127000-5-chanho61.park@samsung.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 521f88bf
...@@ -207,7 +207,7 @@ static int samsung_ufs_phy_init(struct phy *phy) ...@@ -207,7 +207,7 @@ static int samsung_ufs_phy_init(struct phy *phy)
ss_phy->lane_cnt = phy->attrs.bus_width; ss_phy->lane_cnt = phy->attrs.bus_width;
ss_phy->ufs_phy_state = CFG_PRE_INIT; ss_phy->ufs_phy_state = CFG_PRE_INIT;
if (ss_phy->drvdata->has_symbol_clk) { if (ss_phy->has_symbol_clk) {
ret = samsung_ufs_phy_symbol_clk_init(ss_phy); ret = samsung_ufs_phy_symbol_clk_init(ss_phy);
if (ret) if (ret)
dev_err(ss_phy->dev, "failed to set ufs phy symbol clocks\n"); dev_err(ss_phy->dev, "failed to set ufs phy symbol clocks\n");
...@@ -259,7 +259,7 @@ static int samsung_ufs_phy_exit(struct phy *phy) ...@@ -259,7 +259,7 @@ static int samsung_ufs_phy_exit(struct phy *phy)
clk_disable_unprepare(ss_phy->ref_clk); clk_disable_unprepare(ss_phy->ref_clk);
if (ss_phy->drvdata->has_symbol_clk) { if (ss_phy->has_symbol_clk) {
clk_disable_unprepare(ss_phy->tx0_symbol_clk); clk_disable_unprepare(ss_phy->tx0_symbol_clk);
clk_disable_unprepare(ss_phy->rx0_symbol_clk); clk_disable_unprepare(ss_phy->rx0_symbol_clk);
clk_disable_unprepare(ss_phy->rx1_symbol_clk); clk_disable_unprepare(ss_phy->rx1_symbol_clk);
...@@ -326,9 +326,10 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev) ...@@ -326,9 +326,10 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
drvdata = match->data; drvdata = match->data;
phy->dev = dev; phy->dev = dev;
phy->drvdata = drvdata;
phy->cfgs = drvdata->cfgs; phy->cfgs = drvdata->cfgs;
phy->isol = &drvdata->isol; phy->has_symbol_clk = drvdata->has_symbol_clk;
memcpy(&phy->isol, &drvdata->isol, sizeof(phy->isol));
phy->lane_cnt = PHY_DEF_LANE_CNT; phy->lane_cnt = PHY_DEF_LANE_CNT;
phy_set_drvdata(gen_phy, phy); phy_set_drvdata(gen_phy, phy);
......
...@@ -101,13 +101,15 @@ struct samsung_ufs_phy_cfg { ...@@ -101,13 +101,15 @@ struct samsung_ufs_phy_cfg {
u8 id; u8 id;
}; };
struct samsung_ufs_phy_drvdata { struct samsung_ufs_phy_pmu_isol {
const struct samsung_ufs_phy_cfg **cfgs;
struct pmu_isol {
u32 offset; u32 offset;
u32 mask; u32 mask;
u32 en; u32 en;
} isol; };
struct samsung_ufs_phy_drvdata {
const struct samsung_ufs_phy_cfg **cfgs;
struct samsung_ufs_phy_pmu_isol isol;
bool has_symbol_clk; bool has_symbol_clk;
}; };
...@@ -122,7 +124,8 @@ struct samsung_ufs_phy { ...@@ -122,7 +124,8 @@ struct samsung_ufs_phy {
struct clk *rx1_symbol_clk; struct clk *rx1_symbol_clk;
const struct samsung_ufs_phy_drvdata *drvdata; const struct samsung_ufs_phy_drvdata *drvdata;
const struct samsung_ufs_phy_cfg * const *cfgs; const struct samsung_ufs_phy_cfg * const *cfgs;
const struct pmu_isol *isol; struct samsung_ufs_phy_pmu_isol isol;
bool has_symbol_clk;
u8 lane_cnt; u8 lane_cnt;
int ufs_phy_state; int ufs_phy_state;
enum phy_mode mode; enum phy_mode mode;
...@@ -136,8 +139,8 @@ static inline struct samsung_ufs_phy *get_samsung_ufs_phy(struct phy *phy) ...@@ -136,8 +139,8 @@ static inline struct samsung_ufs_phy *get_samsung_ufs_phy(struct phy *phy)
static inline void samsung_ufs_phy_ctrl_isol( static inline void samsung_ufs_phy_ctrl_isol(
struct samsung_ufs_phy *phy, u32 isol) struct samsung_ufs_phy *phy, u32 isol)
{ {
regmap_update_bits(phy->reg_pmu, phy->isol->offset, regmap_update_bits(phy->reg_pmu, phy->isol.offset,
phy->isol->mask, isol ? 0 : phy->isol->en); phy->isol.mask, isol ? 0 : phy->isol.en);
} }
extern const struct samsung_ufs_phy_drvdata exynos7_ufs_phy; extern const struct samsung_ufs_phy_drvdata exynos7_ufs_phy;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment