All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] support secondary ufs for Exynos Auto v9 SoC
       [not found] <CGME20220603020426epcas2p4799d10beba3455061b8d8e965904cafe@epcas2p4.samsung.com>
  2022-06-03  2:04   ` Chanho Park
@ 2022-06-03  2:04   ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

To support ufs #1 for Exynos Auto v9 SoC, we need to control its own pmu
register. So, we need to specify the offset of the register via an
argument of syscon node.

Changes from v2:
- Exclude dts patchset because they'll be queued by Krzysztof after
  v5.19 merge window.
- 0001-dt-bindings: Add "maxItems: 1" to the first level pmu-syscon
  items as suggested by Krzysztof
- 0002: The patch has been added to clarify the variable name
- 0004: The patch has been added to remove drvdata pointer as suggested
  by Krzysztof

Changes from v1:
- dt-bindings: Correct tab align and add "minItems: 1" to make the second
  cell as optional.
- Add 0001- patch to constify phy_cfg.
- Allocate phy->isol and copy data from drvdata to avoid const qualifier
  error
- Add 0004- patch to apply dt style for ufs0 as Krzysztof's suggestion
- Align tab and apply ufs node naming for device tree nodes

Chanho Park (5):
  dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array
  phy: samsung: ufs: rename cfg to cfgs for clarification
  phy: samsung: ufs: constify samsung_ufs_phy_cfg
  phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy
  phy: samsung: ufs: support secondary ufs phy

 .../bindings/phy/samsung,ufs-phy.yaml         | 14 ++++++++---
 drivers/phy/samsung/phy-exynos7-ufs.c         |  2 +-
 drivers/phy/samsung/phy-exynosautov9-ufs.c    |  2 +-
 drivers/phy/samsung/phy-samsung-ufs.c         | 18 +++++++++-----
 drivers/phy/samsung/phy-samsung-ufs.h         | 24 ++++++++++---------
 5 files changed, 38 insertions(+), 22 deletions(-)

-- 
2.36.1


^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v3 0/5] support secondary ufs for Exynos Auto v9 SoC
@ 2022-06-03  2:04   ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

To support ufs #1 for Exynos Auto v9 SoC, we need to control its own pmu
register. So, we need to specify the offset of the register via an
argument of syscon node.

Changes from v2:
- Exclude dts patchset because they'll be queued by Krzysztof after
  v5.19 merge window.
- 0001-dt-bindings: Add "maxItems: 1" to the first level pmu-syscon
  items as suggested by Krzysztof
- 0002: The patch has been added to clarify the variable name
- 0004: The patch has been added to remove drvdata pointer as suggested
  by Krzysztof

Changes from v1:
- dt-bindings: Correct tab align and add "minItems: 1" to make the second
  cell as optional.
- Add 0001- patch to constify phy_cfg.
- Allocate phy->isol and copy data from drvdata to avoid const qualifier
  error
- Add 0004- patch to apply dt style for ufs0 as Krzysztof's suggestion
- Align tab and apply ufs node naming for device tree nodes

Chanho Park (5):
  dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array
  phy: samsung: ufs: rename cfg to cfgs for clarification
  phy: samsung: ufs: constify samsung_ufs_phy_cfg
  phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy
  phy: samsung: ufs: support secondary ufs phy

 .../bindings/phy/samsung,ufs-phy.yaml         | 14 ++++++++---
 drivers/phy/samsung/phy-exynos7-ufs.c         |  2 +-
 drivers/phy/samsung/phy-exynosautov9-ufs.c    |  2 +-
 drivers/phy/samsung/phy-samsung-ufs.c         | 18 +++++++++-----
 drivers/phy/samsung/phy-samsung-ufs.h         | 24 ++++++++++---------
 5 files changed, 38 insertions(+), 22 deletions(-)

-- 
2.36.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v3 0/5] support secondary ufs for Exynos Auto v9 SoC
@ 2022-06-03  2:04   ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

To support ufs #1 for Exynos Auto v9 SoC, we need to control its own pmu
register. So, we need to specify the offset of the register via an
argument of syscon node.

Changes from v2:
- Exclude dts patchset because they'll be queued by Krzysztof after
  v5.19 merge window.
- 0001-dt-bindings: Add "maxItems: 1" to the first level pmu-syscon
  items as suggested by Krzysztof
- 0002: The patch has been added to clarify the variable name
- 0004: The patch has been added to remove drvdata pointer as suggested
  by Krzysztof

Changes from v1:
- dt-bindings: Correct tab align and add "minItems: 1" to make the second
  cell as optional.
- Add 0001- patch to constify phy_cfg.
- Allocate phy->isol and copy data from drvdata to avoid const qualifier
  error
- Add 0004- patch to apply dt style for ufs0 as Krzysztof's suggestion
- Align tab and apply ufs node naming for device tree nodes

Chanho Park (5):
  dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array
  phy: samsung: ufs: rename cfg to cfgs for clarification
  phy: samsung: ufs: constify samsung_ufs_phy_cfg
  phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy
  phy: samsung: ufs: support secondary ufs phy

 .../bindings/phy/samsung,ufs-phy.yaml         | 14 ++++++++---
 drivers/phy/samsung/phy-exynos7-ufs.c         |  2 +-
 drivers/phy/samsung/phy-exynosautov9-ufs.c    |  2 +-
 drivers/phy/samsung/phy-samsung-ufs.c         | 18 +++++++++-----
 drivers/phy/samsung/phy-samsung-ufs.h         | 24 ++++++++++---------
 5 files changed, 38 insertions(+), 22 deletions(-)

-- 
2.36.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v3 1/5] dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array
       [not found]   ` <CGME20220603020426epcas2p43e4c27b5a371e2fcdfa462c564d9c5e3@epcas2p4.samsung.com>
  2022-06-03  2:04       ` Chanho Park
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

To support secondary ufs phy devices, we need to get an offset value
from pmu-syscon.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 .../devicetree/bindings/phy/samsung,ufs-phy.yaml   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
index f6ed1a005e7a..17897a3b5c9e 100644
--- a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
@@ -40,9 +40,17 @@ properties:
       - const: tx0_symbol_clk
 
   samsung,pmu-syscon:
-    $ref: '/schemas/types.yaml#/definitions/phandle'
-    description: phandle for PMU system controller interface, used to
-                 control pmu registers bits for ufs m-phy
+    $ref: '/schemas/types.yaml#/definitions/phandle-array'
+    maxItems: 1
+    items:
+      minItems: 1
+      items:
+        - description: phandle for PMU system controller interface, used to
+                       control pmu registers bits for ufs m-phy
+        - description: offset of the pmu control register
+    description:
+      It can be phandle/offset pair. The second cell which can represent an
+      offset is optional.
 
 required:
   - "#phy-cells"
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 1/5] dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

To support secondary ufs phy devices, we need to get an offset value
from pmu-syscon.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 .../devicetree/bindings/phy/samsung,ufs-phy.yaml   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
index f6ed1a005e7a..17897a3b5c9e 100644
--- a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
@@ -40,9 +40,17 @@ properties:
       - const: tx0_symbol_clk
 
   samsung,pmu-syscon:
-    $ref: '/schemas/types.yaml#/definitions/phandle'
-    description: phandle for PMU system controller interface, used to
-                 control pmu registers bits for ufs m-phy
+    $ref: '/schemas/types.yaml#/definitions/phandle-array'
+    maxItems: 1
+    items:
+      minItems: 1
+      items:
+        - description: phandle for PMU system controller interface, used to
+                       control pmu registers bits for ufs m-phy
+        - description: offset of the pmu control register
+    description:
+      It can be phandle/offset pair. The second cell which can represent an
+      offset is optional.
 
 required:
   - "#phy-cells"
-- 
2.36.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 1/5] dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

To support secondary ufs phy devices, we need to get an offset value
from pmu-syscon.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 .../devicetree/bindings/phy/samsung,ufs-phy.yaml   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
index f6ed1a005e7a..17897a3b5c9e 100644
--- a/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/samsung,ufs-phy.yaml
@@ -40,9 +40,17 @@ properties:
       - const: tx0_symbol_clk
 
   samsung,pmu-syscon:
-    $ref: '/schemas/types.yaml#/definitions/phandle'
-    description: phandle for PMU system controller interface, used to
-                 control pmu registers bits for ufs m-phy
+    $ref: '/schemas/types.yaml#/definitions/phandle-array'
+    maxItems: 1
+    items:
+      minItems: 1
+      items:
+        - description: phandle for PMU system controller interface, used to
+                       control pmu registers bits for ufs m-phy
+        - description: offset of the pmu control register
+    description:
+      It can be phandle/offset pair. The second cell which can represent an
+      offset is optional.
 
 required:
   - "#phy-cells"
-- 
2.36.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 2/5] phy: samsung: ufs: rename cfg to cfgs for clarification
       [not found]   ` <CGME20220603020426epcas2p484be447d93da1c015415fb2847f659a7@epcas2p4.samsung.com>
  2022-06-03  2:04       ` Chanho Park
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

Rename **cfg to **cfgs to clarify the naming.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/phy/samsung/phy-exynos7-ufs.c      | 2 +-
 drivers/phy/samsung/phy-exynosautov9-ufs.c | 2 +-
 drivers/phy/samsung/phy-samsung-ufs.c      | 4 ++--
 drivers/phy/samsung/phy-samsung-ufs.h      | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/samsung/phy-exynos7-ufs.c b/drivers/phy/samsung/phy-exynos7-ufs.c
index 7c9008e163db..d1e9d0ae5c1d 100644
--- a/drivers/phy/samsung/phy-exynos7-ufs.c
+++ b/drivers/phy/samsung/phy-exynos7-ufs.c
@@ -67,7 +67,7 @@ static const struct samsung_ufs_phy_cfg *exynos7_ufs_phy_cfgs[CFG_TAG_MAX] = {
 };
 
 const struct samsung_ufs_phy_drvdata exynos7_ufs_phy = {
-	.cfg = exynos7_ufs_phy_cfgs,
+	.cfgs = exynos7_ufs_phy_cfgs,
 	.isol = {
 		.offset = EXYNOS7_EMBEDDED_COMBO_PHY_CTRL,
 		.mask = EXYNOS7_EMBEDDED_COMBO_PHY_CTRL_MASK,
diff --git a/drivers/phy/samsung/phy-exynosautov9-ufs.c b/drivers/phy/samsung/phy-exynosautov9-ufs.c
index d043dfdb598a..fa4d2983eec6 100644
--- a/drivers/phy/samsung/phy-exynosautov9-ufs.c
+++ b/drivers/phy/samsung/phy-exynosautov9-ufs.c
@@ -57,7 +57,7 @@ static const struct samsung_ufs_phy_cfg *exynosautov9_ufs_phy_cfgs[CFG_TAG_MAX]
 };
 
 const struct samsung_ufs_phy_drvdata exynosautov9_ufs_phy = {
-	.cfg = exynosautov9_ufs_phy_cfgs,
+	.cfgs = exynosautov9_ufs_phy_cfgs,
 	.isol = {
 		.offset = EXYNOSAUTOV9_EMBEDDED_COMBO_PHY_CTRL,
 		.mask = EXYNOSAUTOV9_EMBEDDED_COMBO_PHY_CTRL_MASK,
diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
index 602ddef259eb..ed272631e8aa 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.c
+++ b/drivers/phy/samsung/phy-samsung-ufs.c
@@ -75,7 +75,7 @@ static int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy)
 static int samsung_ufs_phy_calibrate(struct phy *phy)
 {
 	struct samsung_ufs_phy *ufs_phy = get_samsung_ufs_phy(phy);
-	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfg;
+	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
 	const struct samsung_ufs_phy_cfg *cfg;
 	int err = 0;
 	int i;
@@ -327,7 +327,7 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
 	drvdata = match->data;
 	phy->dev = dev;
 	phy->drvdata = drvdata;
-	phy->cfg = (struct samsung_ufs_phy_cfg **)drvdata->cfg;
+	phy->cfgs = (struct samsung_ufs_phy_cfg **)drvdata->cfgs;
 	phy->isol = &drvdata->isol;
 	phy->lane_cnt = PHY_DEF_LANE_CNT;
 
diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
index 91a0e9f94f98..1788b356cf56 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.h
+++ b/drivers/phy/samsung/phy-samsung-ufs.h
@@ -102,7 +102,7 @@ struct samsung_ufs_phy_cfg {
 };
 
 struct samsung_ufs_phy_drvdata {
-	const struct samsung_ufs_phy_cfg **cfg;
+	const struct samsung_ufs_phy_cfg **cfgs;
 	struct pmu_isol {
 		u32 offset;
 		u32 mask;
@@ -121,7 +121,7 @@ struct samsung_ufs_phy {
 	struct clk *rx0_symbol_clk;
 	struct clk *rx1_symbol_clk;
 	const struct samsung_ufs_phy_drvdata *drvdata;
-	struct samsung_ufs_phy_cfg **cfg;
+	struct samsung_ufs_phy_cfg **cfgs;
 	const struct pmu_isol *isol;
 	u8 lane_cnt;
 	int ufs_phy_state;
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 2/5] phy: samsung: ufs: rename cfg to cfgs for clarification
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

Rename **cfg to **cfgs to clarify the naming.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/phy/samsung/phy-exynos7-ufs.c      | 2 +-
 drivers/phy/samsung/phy-exynosautov9-ufs.c | 2 +-
 drivers/phy/samsung/phy-samsung-ufs.c      | 4 ++--
 drivers/phy/samsung/phy-samsung-ufs.h      | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/samsung/phy-exynos7-ufs.c b/drivers/phy/samsung/phy-exynos7-ufs.c
index 7c9008e163db..d1e9d0ae5c1d 100644
--- a/drivers/phy/samsung/phy-exynos7-ufs.c
+++ b/drivers/phy/samsung/phy-exynos7-ufs.c
@@ -67,7 +67,7 @@ static const struct samsung_ufs_phy_cfg *exynos7_ufs_phy_cfgs[CFG_TAG_MAX] = {
 };
 
 const struct samsung_ufs_phy_drvdata exynos7_ufs_phy = {
-	.cfg = exynos7_ufs_phy_cfgs,
+	.cfgs = exynos7_ufs_phy_cfgs,
 	.isol = {
 		.offset = EXYNOS7_EMBEDDED_COMBO_PHY_CTRL,
 		.mask = EXYNOS7_EMBEDDED_COMBO_PHY_CTRL_MASK,
diff --git a/drivers/phy/samsung/phy-exynosautov9-ufs.c b/drivers/phy/samsung/phy-exynosautov9-ufs.c
index d043dfdb598a..fa4d2983eec6 100644
--- a/drivers/phy/samsung/phy-exynosautov9-ufs.c
+++ b/drivers/phy/samsung/phy-exynosautov9-ufs.c
@@ -57,7 +57,7 @@ static const struct samsung_ufs_phy_cfg *exynosautov9_ufs_phy_cfgs[CFG_TAG_MAX]
 };
 
 const struct samsung_ufs_phy_drvdata exynosautov9_ufs_phy = {
-	.cfg = exynosautov9_ufs_phy_cfgs,
+	.cfgs = exynosautov9_ufs_phy_cfgs,
 	.isol = {
 		.offset = EXYNOSAUTOV9_EMBEDDED_COMBO_PHY_CTRL,
 		.mask = EXYNOSAUTOV9_EMBEDDED_COMBO_PHY_CTRL_MASK,
diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
index 602ddef259eb..ed272631e8aa 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.c
+++ b/drivers/phy/samsung/phy-samsung-ufs.c
@@ -75,7 +75,7 @@ static int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy)
 static int samsung_ufs_phy_calibrate(struct phy *phy)
 {
 	struct samsung_ufs_phy *ufs_phy = get_samsung_ufs_phy(phy);
-	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfg;
+	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
 	const struct samsung_ufs_phy_cfg *cfg;
 	int err = 0;
 	int i;
@@ -327,7 +327,7 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
 	drvdata = match->data;
 	phy->dev = dev;
 	phy->drvdata = drvdata;
-	phy->cfg = (struct samsung_ufs_phy_cfg **)drvdata->cfg;
+	phy->cfgs = (struct samsung_ufs_phy_cfg **)drvdata->cfgs;
 	phy->isol = &drvdata->isol;
 	phy->lane_cnt = PHY_DEF_LANE_CNT;
 
diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
index 91a0e9f94f98..1788b356cf56 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.h
+++ b/drivers/phy/samsung/phy-samsung-ufs.h
@@ -102,7 +102,7 @@ struct samsung_ufs_phy_cfg {
 };
 
 struct samsung_ufs_phy_drvdata {
-	const struct samsung_ufs_phy_cfg **cfg;
+	const struct samsung_ufs_phy_cfg **cfgs;
 	struct pmu_isol {
 		u32 offset;
 		u32 mask;
@@ -121,7 +121,7 @@ struct samsung_ufs_phy {
 	struct clk *rx0_symbol_clk;
 	struct clk *rx1_symbol_clk;
 	const struct samsung_ufs_phy_drvdata *drvdata;
-	struct samsung_ufs_phy_cfg **cfg;
+	struct samsung_ufs_phy_cfg **cfgs;
 	const struct pmu_isol *isol;
 	u8 lane_cnt;
 	int ufs_phy_state;
-- 
2.36.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 2/5] phy: samsung: ufs: rename cfg to cfgs for clarification
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

Rename **cfg to **cfgs to clarify the naming.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/phy/samsung/phy-exynos7-ufs.c      | 2 +-
 drivers/phy/samsung/phy-exynosautov9-ufs.c | 2 +-
 drivers/phy/samsung/phy-samsung-ufs.c      | 4 ++--
 drivers/phy/samsung/phy-samsung-ufs.h      | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/samsung/phy-exynos7-ufs.c b/drivers/phy/samsung/phy-exynos7-ufs.c
index 7c9008e163db..d1e9d0ae5c1d 100644
--- a/drivers/phy/samsung/phy-exynos7-ufs.c
+++ b/drivers/phy/samsung/phy-exynos7-ufs.c
@@ -67,7 +67,7 @@ static const struct samsung_ufs_phy_cfg *exynos7_ufs_phy_cfgs[CFG_TAG_MAX] = {
 };
 
 const struct samsung_ufs_phy_drvdata exynos7_ufs_phy = {
-	.cfg = exynos7_ufs_phy_cfgs,
+	.cfgs = exynos7_ufs_phy_cfgs,
 	.isol = {
 		.offset = EXYNOS7_EMBEDDED_COMBO_PHY_CTRL,
 		.mask = EXYNOS7_EMBEDDED_COMBO_PHY_CTRL_MASK,
diff --git a/drivers/phy/samsung/phy-exynosautov9-ufs.c b/drivers/phy/samsung/phy-exynosautov9-ufs.c
index d043dfdb598a..fa4d2983eec6 100644
--- a/drivers/phy/samsung/phy-exynosautov9-ufs.c
+++ b/drivers/phy/samsung/phy-exynosautov9-ufs.c
@@ -57,7 +57,7 @@ static const struct samsung_ufs_phy_cfg *exynosautov9_ufs_phy_cfgs[CFG_TAG_MAX]
 };
 
 const struct samsung_ufs_phy_drvdata exynosautov9_ufs_phy = {
-	.cfg = exynosautov9_ufs_phy_cfgs,
+	.cfgs = exynosautov9_ufs_phy_cfgs,
 	.isol = {
 		.offset = EXYNOSAUTOV9_EMBEDDED_COMBO_PHY_CTRL,
 		.mask = EXYNOSAUTOV9_EMBEDDED_COMBO_PHY_CTRL_MASK,
diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
index 602ddef259eb..ed272631e8aa 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.c
+++ b/drivers/phy/samsung/phy-samsung-ufs.c
@@ -75,7 +75,7 @@ static int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy)
 static int samsung_ufs_phy_calibrate(struct phy *phy)
 {
 	struct samsung_ufs_phy *ufs_phy = get_samsung_ufs_phy(phy);
-	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfg;
+	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
 	const struct samsung_ufs_phy_cfg *cfg;
 	int err = 0;
 	int i;
@@ -327,7 +327,7 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
 	drvdata = match->data;
 	phy->dev = dev;
 	phy->drvdata = drvdata;
-	phy->cfg = (struct samsung_ufs_phy_cfg **)drvdata->cfg;
+	phy->cfgs = (struct samsung_ufs_phy_cfg **)drvdata->cfgs;
 	phy->isol = &drvdata->isol;
 	phy->lane_cnt = PHY_DEF_LANE_CNT;
 
diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
index 91a0e9f94f98..1788b356cf56 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.h
+++ b/drivers/phy/samsung/phy-samsung-ufs.h
@@ -102,7 +102,7 @@ struct samsung_ufs_phy_cfg {
 };
 
 struct samsung_ufs_phy_drvdata {
-	const struct samsung_ufs_phy_cfg **cfg;
+	const struct samsung_ufs_phy_cfg **cfgs;
 	struct pmu_isol {
 		u32 offset;
 		u32 mask;
@@ -121,7 +121,7 @@ struct samsung_ufs_phy {
 	struct clk *rx0_symbol_clk;
 	struct clk *rx1_symbol_clk;
 	const struct samsung_ufs_phy_drvdata *drvdata;
-	struct samsung_ufs_phy_cfg **cfg;
+	struct samsung_ufs_phy_cfg **cfgs;
 	const struct pmu_isol *isol;
 	u8 lane_cnt;
 	int ufs_phy_state;
-- 
2.36.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 3/5] phy: samsung: ufs: constify samsung_ufs_phy_cfg
       [not found]   ` <CGME20220603020426epcas2p3f6b5174734313e5d06d0177c3ebd777d@epcas2p3.samsung.com>
  2022-06-03  2:04       ` Chanho Park
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

Put const qualifier of samsung_ufs_phy_cfg pointer because they will
not be changed from drvdata.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/phy/samsung/phy-samsung-ufs.c | 4 ++--
 drivers/phy/samsung/phy-samsung-ufs.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
index ed272631e8aa..e1e26da27245 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.c
+++ b/drivers/phy/samsung/phy-samsung-ufs.c
@@ -75,7 +75,7 @@ static int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy)
 static int samsung_ufs_phy_calibrate(struct phy *phy)
 {
 	struct samsung_ufs_phy *ufs_phy = get_samsung_ufs_phy(phy);
-	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
+	const struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
 	const struct samsung_ufs_phy_cfg *cfg;
 	int err = 0;
 	int i;
@@ -327,7 +327,7 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
 	drvdata = match->data;
 	phy->dev = dev;
 	phy->drvdata = drvdata;
-	phy->cfgs = (struct samsung_ufs_phy_cfg **)drvdata->cfgs;
+	phy->cfgs = drvdata->cfgs;
 	phy->isol = &drvdata->isol;
 	phy->lane_cnt = PHY_DEF_LANE_CNT;
 
diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
index 1788b356cf56..101497698f23 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.h
+++ b/drivers/phy/samsung/phy-samsung-ufs.h
@@ -121,7 +121,7 @@ struct samsung_ufs_phy {
 	struct clk *rx0_symbol_clk;
 	struct clk *rx1_symbol_clk;
 	const struct samsung_ufs_phy_drvdata *drvdata;
-	struct samsung_ufs_phy_cfg **cfgs;
+	const struct samsung_ufs_phy_cfg **cfgs;
 	const struct pmu_isol *isol;
 	u8 lane_cnt;
 	int ufs_phy_state;
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 3/5] phy: samsung: ufs: constify samsung_ufs_phy_cfg
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

Put const qualifier of samsung_ufs_phy_cfg pointer because they will
not be changed from drvdata.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/phy/samsung/phy-samsung-ufs.c | 4 ++--
 drivers/phy/samsung/phy-samsung-ufs.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
index ed272631e8aa..e1e26da27245 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.c
+++ b/drivers/phy/samsung/phy-samsung-ufs.c
@@ -75,7 +75,7 @@ static int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy)
 static int samsung_ufs_phy_calibrate(struct phy *phy)
 {
 	struct samsung_ufs_phy *ufs_phy = get_samsung_ufs_phy(phy);
-	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
+	const struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
 	const struct samsung_ufs_phy_cfg *cfg;
 	int err = 0;
 	int i;
@@ -327,7 +327,7 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
 	drvdata = match->data;
 	phy->dev = dev;
 	phy->drvdata = drvdata;
-	phy->cfgs = (struct samsung_ufs_phy_cfg **)drvdata->cfgs;
+	phy->cfgs = drvdata->cfgs;
 	phy->isol = &drvdata->isol;
 	phy->lane_cnt = PHY_DEF_LANE_CNT;
 
diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
index 1788b356cf56..101497698f23 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.h
+++ b/drivers/phy/samsung/phy-samsung-ufs.h
@@ -121,7 +121,7 @@ struct samsung_ufs_phy {
 	struct clk *rx0_symbol_clk;
 	struct clk *rx1_symbol_clk;
 	const struct samsung_ufs_phy_drvdata *drvdata;
-	struct samsung_ufs_phy_cfg **cfgs;
+	const struct samsung_ufs_phy_cfg **cfgs;
 	const struct pmu_isol *isol;
 	u8 lane_cnt;
 	int ufs_phy_state;
-- 
2.36.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 3/5] phy: samsung: ufs: constify samsung_ufs_phy_cfg
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

Put const qualifier of samsung_ufs_phy_cfg pointer because they will
not be changed from drvdata.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/phy/samsung/phy-samsung-ufs.c | 4 ++--
 drivers/phy/samsung/phy-samsung-ufs.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
index ed272631e8aa..e1e26da27245 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.c
+++ b/drivers/phy/samsung/phy-samsung-ufs.c
@@ -75,7 +75,7 @@ static int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy)
 static int samsung_ufs_phy_calibrate(struct phy *phy)
 {
 	struct samsung_ufs_phy *ufs_phy = get_samsung_ufs_phy(phy);
-	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
+	const struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
 	const struct samsung_ufs_phy_cfg *cfg;
 	int err = 0;
 	int i;
@@ -327,7 +327,7 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
 	drvdata = match->data;
 	phy->dev = dev;
 	phy->drvdata = drvdata;
-	phy->cfgs = (struct samsung_ufs_phy_cfg **)drvdata->cfgs;
+	phy->cfgs = drvdata->cfgs;
 	phy->isol = &drvdata->isol;
 	phy->lane_cnt = PHY_DEF_LANE_CNT;
 
diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
index 1788b356cf56..101497698f23 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.h
+++ b/drivers/phy/samsung/phy-samsung-ufs.h
@@ -121,7 +121,7 @@ struct samsung_ufs_phy {
 	struct clk *rx0_symbol_clk;
 	struct clk *rx1_symbol_clk;
 	const struct samsung_ufs_phy_drvdata *drvdata;
-	struct samsung_ufs_phy_cfg **cfgs;
+	const struct samsung_ufs_phy_cfg **cfgs;
 	const struct pmu_isol *isol;
 	u8 lane_cnt;
 	int ufs_phy_state;
-- 
2.36.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 4/5] phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy
       [not found]   ` <CGME20220603020426epcas2p43c70afe414dc36f3abb18cbdb1d450a4@epcas2p4.samsung.com>
  2022-06-03  2:04       ` Chanho Park
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/phy/samsung/phy-samsung-ufs.c |  9 +++++----
 drivers/phy/samsung/phy-samsung-ufs.h | 20 +++++++++++---------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
index e1e26da27245..0530513f2263 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.c
+++ b/drivers/phy/samsung/phy-samsung-ufs.c
@@ -207,7 +207,7 @@ static int samsung_ufs_phy_init(struct phy *phy)
 	ss_phy->lane_cnt = phy->attrs.bus_width;
 	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);
 		if (ret)
 			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)
 
 	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->rx0_symbol_clk);
 		clk_disable_unprepare(ss_phy->rx1_symbol_clk);
@@ -326,9 +326,10 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
 
 	drvdata = match->data;
 	phy->dev = dev;
-	phy->drvdata = drvdata;
 	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_set_drvdata(gen_phy, phy);
diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
index 101497698f23..79b535923844 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.h
+++ b/drivers/phy/samsung/phy-samsung-ufs.h
@@ -101,13 +101,15 @@ struct samsung_ufs_phy_cfg {
 	u8 id;
 };
 
+struct samsung_ufs_phy_pmu_isol {
+	u32 offset;
+	u32 mask;
+	u32 en;
+};
+
 struct samsung_ufs_phy_drvdata {
 	const struct samsung_ufs_phy_cfg **cfgs;
-	struct pmu_isol {
-		u32 offset;
-		u32 mask;
-		u32 en;
-	} isol;
+	struct samsung_ufs_phy_pmu_isol isol;
 	bool has_symbol_clk;
 };
 
@@ -120,9 +122,9 @@ struct samsung_ufs_phy {
 	struct clk *tx0_symbol_clk;
 	struct clk *rx0_symbol_clk;
 	struct clk *rx1_symbol_clk;
-	const struct samsung_ufs_phy_drvdata *drvdata;
 	const struct samsung_ufs_phy_cfg **cfgs;
-	const struct pmu_isol *isol;
+	struct samsung_ufs_phy_pmu_isol isol;
+	bool has_symbol_clk;
 	u8 lane_cnt;
 	int ufs_phy_state;
 	enum phy_mode mode;
@@ -136,8 +138,8 @@ static inline struct samsung_ufs_phy *get_samsung_ufs_phy(struct phy *phy)
 static inline void samsung_ufs_phy_ctrl_isol(
 		struct samsung_ufs_phy *phy, u32 isol)
 {
-	regmap_update_bits(phy->reg_pmu, phy->isol->offset,
-			   phy->isol->mask, isol ? 0 : phy->isol->en);
+	regmap_update_bits(phy->reg_pmu, phy->isol.offset,
+			   phy->isol.mask, isol ? 0 : phy->isol.en);
 }
 
 extern const struct samsung_ufs_phy_drvdata exynos7_ufs_phy;
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 4/5] phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/phy/samsung/phy-samsung-ufs.c |  9 +++++----
 drivers/phy/samsung/phy-samsung-ufs.h | 20 +++++++++++---------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
index e1e26da27245..0530513f2263 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.c
+++ b/drivers/phy/samsung/phy-samsung-ufs.c
@@ -207,7 +207,7 @@ static int samsung_ufs_phy_init(struct phy *phy)
 	ss_phy->lane_cnt = phy->attrs.bus_width;
 	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);
 		if (ret)
 			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)
 
 	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->rx0_symbol_clk);
 		clk_disable_unprepare(ss_phy->rx1_symbol_clk);
@@ -326,9 +326,10 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
 
 	drvdata = match->data;
 	phy->dev = dev;
-	phy->drvdata = drvdata;
 	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_set_drvdata(gen_phy, phy);
diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
index 101497698f23..79b535923844 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.h
+++ b/drivers/phy/samsung/phy-samsung-ufs.h
@@ -101,13 +101,15 @@ struct samsung_ufs_phy_cfg {
 	u8 id;
 };
 
+struct samsung_ufs_phy_pmu_isol {
+	u32 offset;
+	u32 mask;
+	u32 en;
+};
+
 struct samsung_ufs_phy_drvdata {
 	const struct samsung_ufs_phy_cfg **cfgs;
-	struct pmu_isol {
-		u32 offset;
-		u32 mask;
-		u32 en;
-	} isol;
+	struct samsung_ufs_phy_pmu_isol isol;
 	bool has_symbol_clk;
 };
 
@@ -120,9 +122,9 @@ struct samsung_ufs_phy {
 	struct clk *tx0_symbol_clk;
 	struct clk *rx0_symbol_clk;
 	struct clk *rx1_symbol_clk;
-	const struct samsung_ufs_phy_drvdata *drvdata;
 	const struct samsung_ufs_phy_cfg **cfgs;
-	const struct pmu_isol *isol;
+	struct samsung_ufs_phy_pmu_isol isol;
+	bool has_symbol_clk;
 	u8 lane_cnt;
 	int ufs_phy_state;
 	enum phy_mode mode;
@@ -136,8 +138,8 @@ static inline struct samsung_ufs_phy *get_samsung_ufs_phy(struct phy *phy)
 static inline void samsung_ufs_phy_ctrl_isol(
 		struct samsung_ufs_phy *phy, u32 isol)
 {
-	regmap_update_bits(phy->reg_pmu, phy->isol->offset,
-			   phy->isol->mask, isol ? 0 : phy->isol->en);
+	regmap_update_bits(phy->reg_pmu, phy->isol.offset,
+			   phy->isol.mask, isol ? 0 : phy->isol.en);
 }
 
 extern const struct samsung_ufs_phy_drvdata exynos7_ufs_phy;
-- 
2.36.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 4/5] phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/phy/samsung/phy-samsung-ufs.c |  9 +++++----
 drivers/phy/samsung/phy-samsung-ufs.h | 20 +++++++++++---------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
index e1e26da27245..0530513f2263 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.c
+++ b/drivers/phy/samsung/phy-samsung-ufs.c
@@ -207,7 +207,7 @@ static int samsung_ufs_phy_init(struct phy *phy)
 	ss_phy->lane_cnt = phy->attrs.bus_width;
 	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);
 		if (ret)
 			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)
 
 	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->rx0_symbol_clk);
 		clk_disable_unprepare(ss_phy->rx1_symbol_clk);
@@ -326,9 +326,10 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
 
 	drvdata = match->data;
 	phy->dev = dev;
-	phy->drvdata = drvdata;
 	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_set_drvdata(gen_phy, phy);
diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
index 101497698f23..79b535923844 100644
--- a/drivers/phy/samsung/phy-samsung-ufs.h
+++ b/drivers/phy/samsung/phy-samsung-ufs.h
@@ -101,13 +101,15 @@ struct samsung_ufs_phy_cfg {
 	u8 id;
 };
 
+struct samsung_ufs_phy_pmu_isol {
+	u32 offset;
+	u32 mask;
+	u32 en;
+};
+
 struct samsung_ufs_phy_drvdata {
 	const struct samsung_ufs_phy_cfg **cfgs;
-	struct pmu_isol {
-		u32 offset;
-		u32 mask;
-		u32 en;
-	} isol;
+	struct samsung_ufs_phy_pmu_isol isol;
 	bool has_symbol_clk;
 };
 
@@ -120,9 +122,9 @@ struct samsung_ufs_phy {
 	struct clk *tx0_symbol_clk;
 	struct clk *rx0_symbol_clk;
 	struct clk *rx1_symbol_clk;
-	const struct samsung_ufs_phy_drvdata *drvdata;
 	const struct samsung_ufs_phy_cfg **cfgs;
-	const struct pmu_isol *isol;
+	struct samsung_ufs_phy_pmu_isol isol;
+	bool has_symbol_clk;
 	u8 lane_cnt;
 	int ufs_phy_state;
 	enum phy_mode mode;
@@ -136,8 +138,8 @@ static inline struct samsung_ufs_phy *get_samsung_ufs_phy(struct phy *phy)
 static inline void samsung_ufs_phy_ctrl_isol(
 		struct samsung_ufs_phy *phy, u32 isol)
 {
-	regmap_update_bits(phy->reg_pmu, phy->isol->offset,
-			   phy->isol->mask, isol ? 0 : phy->isol->en);
+	regmap_update_bits(phy->reg_pmu, phy->isol.offset,
+			   phy->isol.mask, isol ? 0 : phy->isol.en);
 }
 
 extern const struct samsung_ufs_phy_drvdata exynos7_ufs_phy;
-- 
2.36.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 5/5] phy: samsung: ufs: support secondary ufs phy
       [not found]   ` <CGME20220603020426epcas2p3f50ebe570e01c7f10972a857659a5625@epcas2p3.samsung.com>
  2022-06-03  2:04       ` Chanho Park
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

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.

Signed-off-by: Chanho Park <chanho61.park@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 0530513f2263..22b9e04ec39b 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


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 5/5] phy: samsung: ufs: support secondary ufs phy
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

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.

Signed-off-by: Chanho Park <chanho61.park@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 0530513f2263..22b9e04ec39b 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


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 5/5] phy: samsung: ufs: support secondary ufs phy
@ 2022-06-03  2:04       ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-03  2:04 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski,
	Alim Akhtar, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel, Chanho Park

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.

Signed-off-by: Chanho Park <chanho61.park@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 0530513f2263..22b9e04ec39b 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 1/5] dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array
  2022-06-03  2:04       ` Chanho Park
  (?)
@ 2022-06-05 16:08         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:08 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> To support secondary ufs phy devices, we need to get an offset value
> from pmu-syscon.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 1/5] dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array
@ 2022-06-05 16:08         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:08 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> To support secondary ufs phy devices, we need to get an offset value
> from pmu-syscon.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 1/5] dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array
@ 2022-06-05 16:08         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:08 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> To support secondary ufs phy devices, we need to get an offset value
> from pmu-syscon.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 2/5] phy: samsung: ufs: rename cfg to cfgs for clarification
  2022-06-03  2:04       ` Chanho Park
  (?)
@ 2022-06-05 16:08         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:08 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> Rename **cfg to **cfgs to clarify the naming.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 2/5] phy: samsung: ufs: rename cfg to cfgs for clarification
@ 2022-06-05 16:08         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:08 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> Rename **cfg to **cfgs to clarify the naming.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 2/5] phy: samsung: ufs: rename cfg to cfgs for clarification
@ 2022-06-05 16:08         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:08 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> Rename **cfg to **cfgs to clarify the naming.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 3/5] phy: samsung: ufs: constify samsung_ufs_phy_cfg
  2022-06-03  2:04       ` Chanho Park
  (?)
@ 2022-06-05 16:09         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:09 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> Put const qualifier of samsung_ufs_phy_cfg pointer because they will
> not be changed from drvdata.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>
> ---
>  drivers/phy/samsung/phy-samsung-ufs.c | 4 ++--
>  drivers/phy/samsung/phy-samsung-ufs.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
> index ed272631e8aa..e1e26da27245 100644
> --- a/drivers/phy/samsung/phy-samsung-ufs.c
> +++ b/drivers/phy/samsung/phy-samsung-ufs.c
> @@ -75,7 +75,7 @@ static int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy)
>  static int samsung_ufs_phy_calibrate(struct phy *phy)
>  {
>  	struct samsung_ufs_phy *ufs_phy = get_samsung_ufs_phy(phy);
> -	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
> +	const struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
>  	const struct samsung_ufs_phy_cfg *cfg;
>  	int err = 0;
>  	int i;
> @@ -327,7 +327,7 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
>  	drvdata = match->data;
>  	phy->dev = dev;
>  	phy->drvdata = drvdata;
> -	phy->cfgs = (struct samsung_ufs_phy_cfg **)drvdata->cfgs;
> +	phy->cfgs = drvdata->cfgs;
>  	phy->isol = &drvdata->isol;
>  	phy->lane_cnt = PHY_DEF_LANE_CNT;
>  
> diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
> index 1788b356cf56..101497698f23 100644
> --- a/drivers/phy/samsung/phy-samsung-ufs.h
> +++ b/drivers/phy/samsung/phy-samsung-ufs.h
> @@ -121,7 +121,7 @@ struct samsung_ufs_phy {
>  	struct clk *rx0_symbol_clk;
>  	struct clk *rx1_symbol_clk;
>  	const struct samsung_ufs_phy_drvdata *drvdata;
> -	struct samsung_ufs_phy_cfg **cfgs;
> +	const struct samsung_ufs_phy_cfg **cfgs;

I still think this should be array of const pointers to const data, so:
	const struct samsung_ufs_phy_cfg * const *cfgs;
I proposed this in last email.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 3/5] phy: samsung: ufs: constify samsung_ufs_phy_cfg
@ 2022-06-05 16:09         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:09 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> Put const qualifier of samsung_ufs_phy_cfg pointer because they will
> not be changed from drvdata.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>
> ---
>  drivers/phy/samsung/phy-samsung-ufs.c | 4 ++--
>  drivers/phy/samsung/phy-samsung-ufs.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
> index ed272631e8aa..e1e26da27245 100644
> --- a/drivers/phy/samsung/phy-samsung-ufs.c
> +++ b/drivers/phy/samsung/phy-samsung-ufs.c
> @@ -75,7 +75,7 @@ static int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy)
>  static int samsung_ufs_phy_calibrate(struct phy *phy)
>  {
>  	struct samsung_ufs_phy *ufs_phy = get_samsung_ufs_phy(phy);
> -	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
> +	const struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
>  	const struct samsung_ufs_phy_cfg *cfg;
>  	int err = 0;
>  	int i;
> @@ -327,7 +327,7 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
>  	drvdata = match->data;
>  	phy->dev = dev;
>  	phy->drvdata = drvdata;
> -	phy->cfgs = (struct samsung_ufs_phy_cfg **)drvdata->cfgs;
> +	phy->cfgs = drvdata->cfgs;
>  	phy->isol = &drvdata->isol;
>  	phy->lane_cnt = PHY_DEF_LANE_CNT;
>  
> diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
> index 1788b356cf56..101497698f23 100644
> --- a/drivers/phy/samsung/phy-samsung-ufs.h
> +++ b/drivers/phy/samsung/phy-samsung-ufs.h
> @@ -121,7 +121,7 @@ struct samsung_ufs_phy {
>  	struct clk *rx0_symbol_clk;
>  	struct clk *rx1_symbol_clk;
>  	const struct samsung_ufs_phy_drvdata *drvdata;
> -	struct samsung_ufs_phy_cfg **cfgs;
> +	const struct samsung_ufs_phy_cfg **cfgs;

I still think this should be array of const pointers to const data, so:
	const struct samsung_ufs_phy_cfg * const *cfgs;
I proposed this in last email.

Best regards,
Krzysztof

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 3/5] phy: samsung: ufs: constify samsung_ufs_phy_cfg
@ 2022-06-05 16:09         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:09 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> Put const qualifier of samsung_ufs_phy_cfg pointer because they will
> not be changed from drvdata.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>
> ---
>  drivers/phy/samsung/phy-samsung-ufs.c | 4 ++--
>  drivers/phy/samsung/phy-samsung-ufs.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
> index ed272631e8aa..e1e26da27245 100644
> --- a/drivers/phy/samsung/phy-samsung-ufs.c
> +++ b/drivers/phy/samsung/phy-samsung-ufs.c
> @@ -75,7 +75,7 @@ static int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy)
>  static int samsung_ufs_phy_calibrate(struct phy *phy)
>  {
>  	struct samsung_ufs_phy *ufs_phy = get_samsung_ufs_phy(phy);
> -	struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
> +	const struct samsung_ufs_phy_cfg **cfgs = ufs_phy->cfgs;
>  	const struct samsung_ufs_phy_cfg *cfg;
>  	int err = 0;
>  	int i;
> @@ -327,7 +327,7 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev)
>  	drvdata = match->data;
>  	phy->dev = dev;
>  	phy->drvdata = drvdata;
> -	phy->cfgs = (struct samsung_ufs_phy_cfg **)drvdata->cfgs;
> +	phy->cfgs = drvdata->cfgs;
>  	phy->isol = &drvdata->isol;
>  	phy->lane_cnt = PHY_DEF_LANE_CNT;
>  
> diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h
> index 1788b356cf56..101497698f23 100644
> --- a/drivers/phy/samsung/phy-samsung-ufs.h
> +++ b/drivers/phy/samsung/phy-samsung-ufs.h
> @@ -121,7 +121,7 @@ struct samsung_ufs_phy {
>  	struct clk *rx0_symbol_clk;
>  	struct clk *rx1_symbol_clk;
>  	const struct samsung_ufs_phy_drvdata *drvdata;
> -	struct samsung_ufs_phy_cfg **cfgs;
> +	const struct samsung_ufs_phy_cfg **cfgs;

I still think this should be array of const pointers to const data, so:
	const struct samsung_ufs_phy_cfg * const *cfgs;
I proposed this in last email.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 4/5] phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy
  2022-06-03  2:04       ` Chanho Park
  (?)
@ 2022-06-05 16:13         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:13 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> 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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 4/5] phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy
@ 2022-06-05 16:13         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:13 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> 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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 4/5] phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy
@ 2022-06-05 16:13         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:13 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> 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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 5/5] phy: samsung: ufs: support secondary ufs phy
  2022-06-03  2:04       ` Chanho Park
  (?)
@ 2022-06-05 16:15         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:15 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> 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.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 5/5] phy: samsung: ufs: support secondary ufs phy
@ 2022-06-05 16:15         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:15 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> 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.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 5/5] phy: samsung: ufs: support secondary ufs phy
@ 2022-06-05 16:15         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 36+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-05 16:15 UTC (permalink / raw)
  To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, Alim Akhtar,
	Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

On 03/06/2022 04:04, Chanho Park wrote:
> 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.
> 
> Signed-off-by: Chanho Park <chanho61.park@samsung.com>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: [PATCH v3 3/5] phy: samsung: ufs: constify samsung_ufs_phy_cfg
  2022-06-05 16:09         ` Krzysztof Kozlowski
  (?)
@ 2022-06-07  7:12           ` Chanho Park
  -1 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-07  7:12 UTC (permalink / raw)
  To: 'Krzysztof Kozlowski', 'Kishon Vijay Abraham I',
	'Vinod Koul', 'Alim Akhtar',
	'Rob Herring', 'Krzysztof Kozlowski'
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

> > -	struct samsung_ufs_phy_cfg **cfgs;
> > +	const struct samsung_ufs_phy_cfg **cfgs;
> 
> I still think this should be array of const pointers to const data, so:
> 	const struct samsung_ufs_phy_cfg * const *cfgs; I proposed this in
> last email.

Make sense. I'll change this as you suggested.

Best Regards,
Chanho Park


^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: [PATCH v3 3/5] phy: samsung: ufs: constify samsung_ufs_phy_cfg
@ 2022-06-07  7:12           ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-07  7:12 UTC (permalink / raw)
  To: 'Krzysztof Kozlowski', 'Kishon Vijay Abraham I',
	'Vinod Koul', 'Alim Akhtar',
	'Rob Herring', 'Krzysztof	Kozlowski'
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

> > -	struct samsung_ufs_phy_cfg **cfgs;
> > +	const struct samsung_ufs_phy_cfg **cfgs;
> 
> I still think this should be array of const pointers to const data, so:
> 	const struct samsung_ufs_phy_cfg * const *cfgs; I proposed this in
> last email.

Make sense. I'll change this as you suggested.

Best Regards,
Chanho Park


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: [PATCH v3 3/5] phy: samsung: ufs: constify samsung_ufs_phy_cfg
@ 2022-06-07  7:12           ` Chanho Park
  0 siblings, 0 replies; 36+ messages in thread
From: Chanho Park @ 2022-06-07  7:12 UTC (permalink / raw)
  To: 'Krzysztof Kozlowski', 'Kishon Vijay Abraham I',
	'Vinod Koul', 'Alim Akhtar',
	'Rob Herring', 'Krzysztof	Kozlowski'
  Cc: devicetree, linux-phy, linux-samsung-soc, linux-arm-kernel

> > -	struct samsung_ufs_phy_cfg **cfgs;
> > +	const struct samsung_ufs_phy_cfg **cfgs;
> 
> I still think this should be array of const pointers to const data, so:
> 	const struct samsung_ufs_phy_cfg * const *cfgs; I proposed this in
> last email.

Make sense. I'll change this as you suggested.

Best Regards,
Chanho Park


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2022-06-07  7:14 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20220603020426epcas2p4799d10beba3455061b8d8e965904cafe@epcas2p4.samsung.com>
2022-06-03  2:04 ` [PATCH v3 0/5] support secondary ufs for Exynos Auto v9 SoC Chanho Park
2022-06-03  2:04   ` Chanho Park
2022-06-03  2:04   ` Chanho Park
     [not found]   ` <CGME20220603020426epcas2p43e4c27b5a371e2fcdfa462c564d9c5e3@epcas2p4.samsung.com>
2022-06-03  2:04     ` [PATCH v3 1/5] dt-bindings: phy: samsung,ufs-phy: make pmu-syscon as phandle-array Chanho Park
2022-06-03  2:04       ` Chanho Park
2022-06-03  2:04       ` Chanho Park
2022-06-05 16:08       ` Krzysztof Kozlowski
2022-06-05 16:08         ` Krzysztof Kozlowski
2022-06-05 16:08         ` Krzysztof Kozlowski
     [not found]   ` <CGME20220603020426epcas2p484be447d93da1c015415fb2847f659a7@epcas2p4.samsung.com>
2022-06-03  2:04     ` [PATCH v3 2/5] phy: samsung: ufs: rename cfg to cfgs for clarification Chanho Park
2022-06-03  2:04       ` Chanho Park
2022-06-03  2:04       ` Chanho Park
2022-06-05 16:08       ` Krzysztof Kozlowski
2022-06-05 16:08         ` Krzysztof Kozlowski
2022-06-05 16:08         ` Krzysztof Kozlowski
     [not found]   ` <CGME20220603020426epcas2p3f6b5174734313e5d06d0177c3ebd777d@epcas2p3.samsung.com>
2022-06-03  2:04     ` [PATCH v3 3/5] phy: samsung: ufs: constify samsung_ufs_phy_cfg Chanho Park
2022-06-03  2:04       ` Chanho Park
2022-06-03  2:04       ` Chanho Park
2022-06-05 16:09       ` Krzysztof Kozlowski
2022-06-05 16:09         ` Krzysztof Kozlowski
2022-06-05 16:09         ` Krzysztof Kozlowski
2022-06-07  7:12         ` Chanho Park
2022-06-07  7:12           ` Chanho Park
2022-06-07  7:12           ` Chanho Park
     [not found]   ` <CGME20220603020426epcas2p43c70afe414dc36f3abb18cbdb1d450a4@epcas2p4.samsung.com>
2022-06-03  2:04     ` [PATCH v3 4/5] phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy Chanho Park
2022-06-03  2:04       ` Chanho Park
2022-06-03  2:04       ` Chanho Park
2022-06-05 16:13       ` Krzysztof Kozlowski
2022-06-05 16:13         ` Krzysztof Kozlowski
2022-06-05 16:13         ` Krzysztof Kozlowski
     [not found]   ` <CGME20220603020426epcas2p3f50ebe570e01c7f10972a857659a5625@epcas2p3.samsung.com>
2022-06-03  2:04     ` [PATCH v3 5/5] phy: samsung: ufs: support secondary ufs phy Chanho Park
2022-06-03  2:04       ` Chanho Park
2022-06-03  2:04       ` Chanho Park
2022-06-05 16:15       ` Krzysztof Kozlowski
2022-06-05 16:15         ` Krzysztof Kozlowski
2022-06-05 16:15         ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.