linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] spi s3c64xx ioclk handling
@ 2016-07-12 10:02 Andi Shyti
  2016-07-12 10:02 ` [PATCH v3 1/7] bindings: spi-samsung: add exynos5433 spi compatible Andi Shyti
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Andi Shyti @ 2016-07-12 10:02 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	Mark Brown, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd
  Cc: Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti,
	Andi Shyti

Hi,

this patchset improves the compatibility between the s3c64xx
driver and the exynos5433. One point of incompatibility, indeed,
was that the SPI controller in exynos5433 is fed by three clocks
which need to be handled by the driver. The third clock is the
ioclk which support is the main purpose of this patchset.
  
The last patch was first sent on its own and it was its 5th
version, it has been queued to this patchset as there is a
dependency with it.

Changelog V1 -> V2:

 - patch 1: the exynos5433-spi compatible is placed in
   alphabetical order compared to exynos7-spi

 - patch 1: deprecates exynos7-spi

 - patch 2: [new] added the clocks and clock-name documentation
   in the bindings

 - patch 3: fixed some typos, renamed the goto label from
   err_power_off to err_pm_put add the reviewd-by Krzysztof

 - patch 4: new patch

 - patch 5: fixed typos in commit message and use low letters for
   hex numbers

 - patch 6: removed one line of comment

 - patch 7: added to ensure sequentiality.

Changelog V2 -> V3

 - patch 2: reworded the property descriptions

 - patch 6: reworded the added comment

 - added on all the patches the proper reviewed and acks

Thanks,
Andi

Andi Shyti (7):
  bindings: spi-samsung: add exynos5433 spi compatible
  bindings: spi-samsung: document the clocks and the clock-name property
  spi: s3c64xx: rename goto labels to meaningful names
  spi: s3c64xx: use error code from clk_prepare_enable()
  spi: s3c64xx: add Exynos5433 compatible for ioclk handling
  spi: s3c64xx: restore removed comments
  clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks

 .../devicetree/bindings/spi/spi-samsung.txt        | 12 ++-
 drivers/clk/samsung/clk-exynos5433.c               |  5 +-
 drivers/spi/spi-s3c64xx.c                          | 90 +++++++++++++++++-----
 3 files changed, 82 insertions(+), 25 deletions(-)

-- 
2.8.1

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

* [PATCH v3 1/7] bindings: spi-samsung: add exynos5433 spi compatible
  2016-07-12 10:02 [PATCH v3 0/7] spi s3c64xx ioclk handling Andi Shyti
@ 2016-07-12 10:02 ` Andi Shyti
  2016-07-14 16:25   ` Mark Brown
  2016-07-16 20:26   ` Rob Herring
  2016-07-12 10:02 ` [PATCH v3 2/7] bindings: spi-samsung: document the clocks and the clock-name property Andi Shyti
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 18+ messages in thread
From: Andi Shyti @ 2016-07-12 10:02 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	Mark Brown, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd
  Cc: Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti,
	Andi Shyti

The samsung,exynos5433-spi has some peculiarities that bring the
need of creating a new compatible in the binding.

One of those is the 3-clocks controller management where the spi
is fed with three clocks: "spi", "busclkN" and "ioclk".

By adding the exynos5433-spi, we deprecate the exynos7 compatible
and discourage its use.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Reviewed-by: Michael Turquette <mturquette@baylibre.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 Documentation/devicetree/bindings/spi/spi-samsung.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/spi/spi-samsung.txt b/Documentation/devicetree/bindings/spi/spi-samsung.txt
index 6dbdeb3..57d5539 100644
--- a/Documentation/devicetree/bindings/spi/spi-samsung.txt
+++ b/Documentation/devicetree/bindings/spi/spi-samsung.txt
@@ -9,7 +9,8 @@ Required SoC Specific Properties:
     - samsung,s3c2443-spi: for s3c2443, s3c2416 and s3c2450 platforms
     - samsung,s3c6410-spi: for s3c6410 platforms
     - samsung,s5pv210-spi: for s5pv210 and s5pc110 platforms
-    - samsung,exynos7-spi: for exynos7 platforms
+    - samsung,exynos5433-spi: for exynos5433 compatible controllers
+    - samsung,exynos7-spi: for exynos7 platforms <DEPRECATED>
 
 - reg: physical base address of the controller and length of memory mapped
   region.
-- 
2.8.1

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

* [PATCH v3 2/7] bindings: spi-samsung: document the clocks and the clock-name property
  2016-07-12 10:02 [PATCH v3 0/7] spi s3c64xx ioclk handling Andi Shyti
  2016-07-12 10:02 ` [PATCH v3 1/7] bindings: spi-samsung: add exynos5433 spi compatible Andi Shyti
@ 2016-07-12 10:02 ` Andi Shyti
  2016-07-16 20:30   ` Rob Herring
  2016-07-12 10:02 ` [PATCH v3 3/7] spi: s3c64xx: rename goto labels to meaningful names Andi Shyti
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Andi Shyti @ 2016-07-12 10:02 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	Mark Brown, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd
  Cc: Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti,
	Andi Shyti

These two properties were not documented but used in the spi
dts. Add the related documentation.

Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Reviewed-by: Michael Turquette <mturquette@baylibre.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 Documentation/devicetree/bindings/spi/spi-samsung.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/spi/spi-samsung.txt b/Documentation/devicetree/bindings/spi/spi-samsung.txt
index 57d5539..f45c6eb 100644
--- a/Documentation/devicetree/bindings/spi/spi-samsung.txt
+++ b/Documentation/devicetree/bindings/spi/spi-samsung.txt
@@ -24,6 +24,15 @@ Required SoC Specific Properties:
 - dma-names: Names for the dma channels. There must be at least one channel
   named "tx" for transmit and named "rx" for receive.
 
+- clocks: specifies the clock IDs provided to the SPI controller; they are
+  required for interacting with the controller itself, for synchronizing the bus
+  and as I/O clock (the latter is required by exynos5433 and exynos7).
+
+- clock-names: string names of the clocks in the 'clocks' property; for all the
+  the devices the names must be "spi", "spi_busclkN" (where N is determined by
+  "samsung,spi-src-clk"), while Exynos5433 should specify a third clock
+  "spi_ioclk" for the I/O clock.
+
 Required Board Specific Properties:
 
 - #address-cells: should be 1.
-- 
2.8.1

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

* [PATCH v3 3/7] spi: s3c64xx: rename goto labels to meaningful names
  2016-07-12 10:02 [PATCH v3 0/7] spi s3c64xx ioclk handling Andi Shyti
  2016-07-12 10:02 ` [PATCH v3 1/7] bindings: spi-samsung: add exynos5433 spi compatible Andi Shyti
  2016-07-12 10:02 ` [PATCH v3 2/7] bindings: spi-samsung: document the clocks and the clock-name property Andi Shyti
@ 2016-07-12 10:02 ` Andi Shyti
  2016-07-12 10:02 ` [PATCH v3 4/7] spi: s3c64xx: use error code from clk_prepare_enable() Andi Shyti
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Andi Shyti @ 2016-07-12 10:02 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	Mark Brown, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd
  Cc: Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti,
	Andi Shyti

The goto labels of the style of

  err4:
  err3:
  err2:
  err1:

are complex to insert in between new errors without renaming all
the goto statements. Replace the errX naming style to meaningful
names in order to make it easier to insert new goto exit points.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Michael Turquette <mturquette@baylibre.com>
---
 drivers/spi/spi-s3c64xx.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 6f2e91a..0784a4d 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1071,7 +1071,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 		if (ret < 0) {
 			dev_err(&pdev->dev, "failed to get alias id, errno %d\n",
 				ret);
-			goto err0;
+			goto err_deref_master;
 		}
 		sdd->port_id = ret;
 	} else {
@@ -1109,13 +1109,13 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 	sdd->regs = devm_ioremap_resource(&pdev->dev, mem_res);
 	if (IS_ERR(sdd->regs)) {
 		ret = PTR_ERR(sdd->regs);
-		goto err0;
+		goto err_deref_master;
 	}
 
 	if (sci->cfg_gpio && sci->cfg_gpio()) {
 		dev_err(&pdev->dev, "Unable to config gpio\n");
 		ret = -EBUSY;
-		goto err0;
+		goto err_deref_master;
 	}
 
 	/* Setup clocks */
@@ -1123,13 +1123,13 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 	if (IS_ERR(sdd->clk)) {
 		dev_err(&pdev->dev, "Unable to acquire clock 'spi'\n");
 		ret = PTR_ERR(sdd->clk);
-		goto err0;
+		goto err_deref_master;
 	}
 
 	if (clk_prepare_enable(sdd->clk)) {
 		dev_err(&pdev->dev, "Couldn't enable clock 'spi'\n");
 		ret = -EBUSY;
-		goto err0;
+		goto err_deref_master;
 	}
 
 	sprintf(clk_name, "spi_busclk%d", sci->src_clk_nr);
@@ -1138,13 +1138,13 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev,
 			"Unable to acquire clock '%s'\n", clk_name);
 		ret = PTR_ERR(sdd->src_clk);
-		goto err2;
+		goto err_disable_clk;
 	}
 
 	if (clk_prepare_enable(sdd->src_clk)) {
 		dev_err(&pdev->dev, "Couldn't enable clock '%s'\n", clk_name);
 		ret = -EBUSY;
-		goto err2;
+		goto err_disable_clk;
 	}
 
 	pm_runtime_set_autosuspend_delay(&pdev->dev, AUTOSUSPEND_TIMEOUT);
@@ -1164,7 +1164,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 	if (ret != 0) {
 		dev_err(&pdev->dev, "Failed to request IRQ %d: %d\n",
 			irq, ret);
-		goto err3;
+		goto err_pm_put;
 	}
 
 	writel(S3C64XX_SPI_INT_RX_OVERRUN_EN | S3C64XX_SPI_INT_RX_UNDERRUN_EN |
@@ -1174,7 +1174,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 	ret = devm_spi_register_master(&pdev->dev, master);
 	if (ret != 0) {
 		dev_err(&pdev->dev, "cannot register SPI master: %d\n", ret);
-		goto err3;
+		goto err_pm_put;
 	}
 
 	dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached\n",
@@ -1188,15 +1188,15 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 
 	return 0;
 
-err3:
+err_pm_put:
 	pm_runtime_put_noidle(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
 
 	clk_disable_unprepare(sdd->src_clk);
-err2:
+err_disable_clk:
 	clk_disable_unprepare(sdd->clk);
-err0:
+err_deref_master:
 	spi_master_put(master);
 
 	return ret;
-- 
2.8.1

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

* [PATCH v3 4/7] spi: s3c64xx: use error code from clk_prepare_enable()
  2016-07-12 10:02 [PATCH v3 0/7] spi s3c64xx ioclk handling Andi Shyti
                   ` (2 preceding siblings ...)
  2016-07-12 10:02 ` [PATCH v3 3/7] spi: s3c64xx: rename goto labels to meaningful names Andi Shyti
@ 2016-07-12 10:02 ` Andi Shyti
  2016-07-12 10:02 ` [PATCH v3 5/7] spi: s3c64xx: add Exynos5433 compatible for ioclk handling Andi Shyti
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Andi Shyti @ 2016-07-12 10:02 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	Mark Brown, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd
  Cc: Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti,
	Andi Shyti

If clk_prepare_enable() fails do not return -EBUSY but use the
value provided by the function itself.

Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Reviewed-by: Michael Turquette <mturquette@baylibre.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 0784a4d..3a65adf 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1126,9 +1126,9 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 		goto err_deref_master;
 	}
 
-	if (clk_prepare_enable(sdd->clk)) {
+	ret = clk_prepare_enable(sdd->clk);
+	if (ret) {
 		dev_err(&pdev->dev, "Couldn't enable clock 'spi'\n");
-		ret = -EBUSY;
 		goto err_deref_master;
 	}
 
@@ -1141,9 +1141,9 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 		goto err_disable_clk;
 	}
 
-	if (clk_prepare_enable(sdd->src_clk)) {
+	ret = clk_prepare_enable(sdd->src_clk);
+	if (ret) {
 		dev_err(&pdev->dev, "Couldn't enable clock '%s'\n", clk_name);
-		ret = -EBUSY;
 		goto err_disable_clk;
 	}
 
-- 
2.8.1

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

* [PATCH v3 5/7] spi: s3c64xx: add Exynos5433 compatible for ioclk handling
  2016-07-12 10:02 [PATCH v3 0/7] spi s3c64xx ioclk handling Andi Shyti
                   ` (3 preceding siblings ...)
  2016-07-12 10:02 ` [PATCH v3 4/7] spi: s3c64xx: use error code from clk_prepare_enable() Andi Shyti
@ 2016-07-12 10:02 ` Andi Shyti
  2016-07-12 10:02 ` [PATCH v3 6/7] spi: s3c64xx: restore removed comments Andi Shyti
  2016-07-12 10:02 ` [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks Andi Shyti
  6 siblings, 0 replies; 18+ messages in thread
From: Andi Shyti @ 2016-07-12 10:02 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	Mark Brown, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd
  Cc: Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti,
	Andi Shyti

The new compatible is related to the Samsung Exynos5433 SoC. The
difference between the previous is that in the exynos5433 the SPI
controller is driven by three clocks instead of only one.

The new clock (ioclk) is controlling the input/output clock
whenever the controller is slave or master.

The presence of the clock line is detected from the compatibility
structure (exynos5433_spi_port_config) as a boolean value.

The probe function checks whether the ioclk is present and if so,
it acquires.

The runtime suspend and resume functions will handle the clock
enabling and disabling as well.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Reviewed-by: Michael Turquette <mturquette@baylibre.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/spi/spi-s3c64xx.c | 57 ++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 52 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 3a65adf..6da663f 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -156,12 +156,14 @@ struct s3c64xx_spi_port_config {
 	int	quirks;
 	bool	high_speed;
 	bool	clk_from_cmu;
+	bool	clk_ioclk;
 };
 
 /**
  * struct s3c64xx_spi_driver_data - Runtime info holder for SPI driver.
  * @clk: Pointer to the spi clock.
  * @src_clk: Pointer to the clock used to generate SPI signals.
+ * @ioclk: Pointer to the i/o clock between master and slave
  * @master: Pointer to the SPI Protocol master.
  * @cntrlr_info: Platform specific data for the controller this driver manages.
  * @tgl_spi: Pointer to the last CS left untoggled by the cs_change hint.
@@ -181,6 +183,7 @@ struct s3c64xx_spi_driver_data {
 	void __iomem                    *regs;
 	struct clk                      *clk;
 	struct clk                      *src_clk;
+	struct clk                      *ioclk;
 	struct platform_device          *pdev;
 	struct spi_master               *master;
 	struct s3c64xx_spi_info  *cntrlr_info;
@@ -1147,6 +1150,21 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 		goto err_disable_clk;
 	}
 
+	if (sdd->port_conf->clk_ioclk) {
+		sdd->ioclk = devm_clk_get(&pdev->dev, "spi_ioclk");
+		if (IS_ERR(sdd->ioclk)) {
+			dev_err(&pdev->dev, "Unable to acquire 'ioclk'\n");
+			ret = PTR_ERR(sdd->ioclk);
+			goto err_disable_src_clk;
+		}
+
+		ret = clk_prepare_enable(sdd->ioclk);
+		if (ret) {
+			dev_err(&pdev->dev, "Couldn't enable clock 'ioclk'\n");
+			goto err_disable_src_clk;
+		}
+	}
+
 	pm_runtime_set_autosuspend_delay(&pdev->dev, AUTOSUSPEND_TIMEOUT);
 	pm_runtime_use_autosuspend(&pdev->dev);
 	pm_runtime_set_active(&pdev->dev);
@@ -1193,6 +1211,8 @@ err_pm_put:
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
 
+	clk_disable_unprepare(sdd->ioclk);
+err_disable_src_clk:
 	clk_disable_unprepare(sdd->src_clk);
 err_disable_clk:
 	clk_disable_unprepare(sdd->clk);
@@ -1211,6 +1231,8 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
 
 	writel(0, sdd->regs + S3C64XX_SPI_INT_EN);
 
+	clk_disable_unprepare(sdd->ioclk);
+
 	clk_disable_unprepare(sdd->src_clk);
 
 	clk_disable_unprepare(sdd->clk);
@@ -1269,6 +1291,7 @@ static int s3c64xx_spi_runtime_suspend(struct device *dev)
 
 	clk_disable_unprepare(sdd->clk);
 	clk_disable_unprepare(sdd->src_clk);
+	clk_disable_unprepare(sdd->ioclk);
 
 	return 0;
 }
@@ -1279,17 +1302,28 @@ static int s3c64xx_spi_runtime_resume(struct device *dev)
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 	int ret;
 
+	if (sdd->port_conf->clk_ioclk) {
+		ret = clk_prepare_enable(sdd->ioclk);
+		if (ret != 0)
+			return ret;
+	}
+
 	ret = clk_prepare_enable(sdd->src_clk);
 	if (ret != 0)
-		return ret;
+		goto err_disable_ioclk;
 
 	ret = clk_prepare_enable(sdd->clk);
-	if (ret != 0) {
-		clk_disable_unprepare(sdd->src_clk);
-		return ret;
-	}
+	if (ret != 0)
+		goto err_disable_src_clk;
 
 	return 0;
+
+err_disable_src_clk:
+	clk_disable_unprepare(sdd->src_clk);
+err_disable_ioclk:
+	clk_disable_unprepare(sdd->ioclk);
+
+	return ret;
 }
 #endif /* CONFIG_PM */
 
@@ -1345,6 +1379,16 @@ static struct s3c64xx_spi_port_config exynos7_spi_port_config = {
 	.quirks		= S3C64XX_SPI_QUIRK_CS_AUTO,
 };
 
+static struct s3c64xx_spi_port_config exynos5433_spi_port_config = {
+	.fifo_lvl_mask	= { 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x1ff},
+	.rx_lvl_offset	= 15,
+	.tx_st_done	= 25,
+	.high_speed	= true,
+	.clk_from_cmu	= true,
+	.clk_ioclk	= true,
+	.quirks		= S3C64XX_SPI_QUIRK_CS_AUTO,
+};
+
 static const struct platform_device_id s3c64xx_spi_driver_ids[] = {
 	{
 		.name		= "s3c2443-spi",
@@ -1375,6 +1419,9 @@ static const struct of_device_id s3c64xx_spi_dt_match[] = {
 	{ .compatible = "samsung,exynos7-spi",
 			.data = (void *)&exynos7_spi_port_config,
 	},
+	{ .compatible = "samsung,exynos5433-spi",
+			.data = (void *)&exynos5433_spi_port_config,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, s3c64xx_spi_dt_match);
-- 
2.8.1

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

* [PATCH v3 6/7] spi: s3c64xx: restore removed comments
  2016-07-12 10:02 [PATCH v3 0/7] spi s3c64xx ioclk handling Andi Shyti
                   ` (4 preceding siblings ...)
  2016-07-12 10:02 ` [PATCH v3 5/7] spi: s3c64xx: add Exynos5433 compatible for ioclk handling Andi Shyti
@ 2016-07-12 10:02 ` Andi Shyti
  2016-07-12 10:02 ` [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks Andi Shyti
  6 siblings, 0 replies; 18+ messages in thread
From: Andi Shyti @ 2016-07-12 10:02 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	Mark Brown, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd
  Cc: Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti,
	Andi Shyti

Patch a9e93e8 has erroneously removed some comments which are
important to understand why the bus frequency is multiplied by
two during the spi transfer.

Reword the previous comment to a more appropriate message.

Suggested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Reviewed-by: Michael Turquette <mturquette@baylibre.com>
---
 drivers/spi/spi-s3c64xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 6da663f..5bedafc 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -639,6 +639,7 @@ static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd)
 	writel(val, regs + S3C64XX_SPI_MODE_CFG);
 
 	if (sdd->port_conf->clk_from_cmu) {
+		/* The src_clk clock is divided internally by 2 */
 		clk_set_rate(sdd->src_clk, sdd->cur_speed * 2);
 	} else {
 		/* Configure Clock */
-- 
2.8.1

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

* [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks
  2016-07-12 10:02 [PATCH v3 0/7] spi s3c64xx ioclk handling Andi Shyti
                   ` (5 preceding siblings ...)
  2016-07-12 10:02 ` [PATCH v3 6/7] spi: s3c64xx: restore removed comments Andi Shyti
@ 2016-07-12 10:02 ` Andi Shyti
  2016-07-12 22:17   ` Michael Turquette
  2016-07-13 21:56   ` Michael Turquette
  6 siblings, 2 replies; 18+ messages in thread
From: Andi Shyti @ 2016-07-12 10:02 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	Mark Brown, Sylwester Nawrocki, Tomasz Figa, Michael Turquette,
	Stephen Boyd
  Cc: Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti,
	Andi Shyti

Because the Exynos5433 SPI driver supports the ioclk handling and
the following patch:

  http://marc.info/?l=linux-kernel&m=146787645626318&w=2

fixes a synchronus abort issue, none of the SPI clocks require
any critical handling: remove, then, the CLK_IGNORE_UNUSED flag
for the SPI related clocks.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Michael Turquette <mturquette@baylibre.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/clk/samsung/clk-exynos5433.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c
index c3a5318..fb19525 100644
--- a/drivers/clk/samsung/clk-exynos5433.c
+++ b/drivers/clk/samsung/clk-exynos5433.c
@@ -1661,8 +1661,7 @@ static struct samsung_gate_clock peric_gate_clks[] __initdata = {
 	GATE(CLK_SCLK_IOCLK_SPI2, "sclk_ioclk_spi2", "ioclk_spi2_clk_in",
 			ENABLE_SCLK_PERIC, 13, CLK_SET_RATE_PARENT, 0),
 	GATE(CLK_SCLK_IOCLK_SPI1, "sclk_ioclk_spi1", "ioclk_spi1_clk_in",
-			ENABLE_SCLK_PERIC, 12,
-			CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
+			ENABLE_SCLK_PERIC, 12, CLK_SET_RATE_PARENT, 0),
 	GATE(CLK_SCLK_IOCLK_SPI0, "sclk_ioclk_spi0", "ioclk_spi0_clk_in",
 			ENABLE_SCLK_PERIC, 11, CLK_SET_RATE_PARENT, 0),
 	GATE(CLK_SCLK_IOCLK_I2S1_BCLK, "sclk_ioclk_i2s1_bclk",
@@ -1677,7 +1676,7 @@ static struct samsung_gate_clock peric_gate_clks[] __initdata = {
 	GATE(CLK_SCLK_SPI2, "sclk_spi2", "sclk_spi2_peric", ENABLE_SCLK_PERIC,
 			5, CLK_SET_RATE_PARENT, 0),
 	GATE(CLK_SCLK_SPI1, "sclk_spi1", "sclk_spi1_peric", ENABLE_SCLK_PERIC,
-			4, CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
+			4, CLK_SET_RATE_PARENT, 0),
 	GATE(CLK_SCLK_SPI0, "sclk_spi0", "sclk_spi0_peric", ENABLE_SCLK_PERIC,
 			3, CLK_SET_RATE_PARENT, 0),
 	GATE(CLK_SCLK_UART2, "sclk_uart2", "sclk_uart2_peric",
-- 
2.8.1

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

* Re: [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks
  2016-07-12 10:02 ` [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks Andi Shyti
@ 2016-07-12 22:17   ` Michael Turquette
  2016-07-13  2:08     ` Andi Shyti
                       ` (2 more replies)
  2016-07-13 21:56   ` Michael Turquette
  1 sibling, 3 replies; 18+ messages in thread
From: Michael Turquette @ 2016-07-12 22:17 UTC (permalink / raw)
  To: Andi Shyti, Rob Herring, Mark Rutland, Kukjin Kim,
	Krzysztof Kozlowski, Mark Brown, Sylwester Nawrocki, Tomasz Figa,
	Stephen Boyd
  Cc: Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti,
	Andi Shyti

Quoting Andi Shyti (2016-07-12 03:02:16)
> Because the Exynos5433 SPI driver supports the ioclk handling and
> the following patch:
> =

>   http://marc.info/?l=3Dlinux-kernel&m=3D146787645626318&w=3D2
> =

> fixes a synchronus abort issue, none of the SPI clocks require
> any critical handling: remove, then, the CLK_IGNORE_UNUSED flag
> for the SPI related clocks.
> =

> Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Reviewed-by: Michael Turquette <mturquette@baylibre.com>
> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Do you want these patches to go through same tree? If not, I can take
this patch into clk-next.

Regards,
Mike

> ---
>  drivers/clk/samsung/clk-exynos5433.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> =

> diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/c=
lk-exynos5433.c
> index c3a5318..fb19525 100644
> --- a/drivers/clk/samsung/clk-exynos5433.c
> +++ b/drivers/clk/samsung/clk-exynos5433.c
> @@ -1661,8 +1661,7 @@ static struct samsung_gate_clock peric_gate_clks[] =
__initdata =3D {
>         GATE(CLK_SCLK_IOCLK_SPI2, "sclk_ioclk_spi2", "ioclk_spi2_clk_in",
>                         ENABLE_SCLK_PERIC, 13, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_IOCLK_SPI1, "sclk_ioclk_spi1", "ioclk_spi1_clk_in",
> -                       ENABLE_SCLK_PERIC, 12,
> -                       CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
> +                       ENABLE_SCLK_PERIC, 12, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_IOCLK_SPI0, "sclk_ioclk_spi0", "ioclk_spi0_clk_in",
>                         ENABLE_SCLK_PERIC, 11, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_IOCLK_I2S1_BCLK, "sclk_ioclk_i2s1_bclk",
> @@ -1677,7 +1676,7 @@ static struct samsung_gate_clock peric_gate_clks[] =
__initdata =3D {
>         GATE(CLK_SCLK_SPI2, "sclk_spi2", "sclk_spi2_peric", ENABLE_SCLK_P=
ERIC,
>                         5, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_SPI1, "sclk_spi1", "sclk_spi1_peric", ENABLE_SCLK_P=
ERIC,
> -                       4, CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
> +                       4, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_SPI0, "sclk_spi0", "sclk_spi0_peric", ENABLE_SCLK_P=
ERIC,
>                         3, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_UART2, "sclk_uart2", "sclk_uart2_peric",
> -- =

> 2.8.1
>=20

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

* Re: [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks
  2016-07-12 22:17   ` Michael Turquette
@ 2016-07-13  2:08     ` Andi Shyti
  2016-07-13  9:21     ` Sylwester Nawrocki
  2016-07-13 12:44     ` Andi Shyti
  2 siblings, 0 replies; 18+ messages in thread
From: Andi Shyti @ 2016-07-13  2:08 UTC (permalink / raw)
  To: Michael Turquette
  Cc: Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	Mark Brown, Sylwester Nawrocki, Tomasz Figa, Stephen Boyd,
	Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti

Hi Mike,

> > Because the Exynos5433 SPI driver supports the ioclk handling and
> > the following patch:
> > 
> >   http://marc.info/?l=linux-kernel&m=146787645626318&w=2
> > 
> > fixes a synchronus abort issue, none of the SPI clocks require
> > any critical handling: remove, then, the CLK_IGNORE_UNUSED flag
> > for the SPI related clocks.
> > 
> > Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
> > Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> > Reviewed-by: Michael Turquette <mturquette@baylibre.com>
> > Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> 
> Do you want these patches to go through same tree? If not, I can take
> this patch into clk-next.

I think this patchset doesn't apply in your repository, but in
Mark Brown's spi/topic/s3c64xx branch. So that I guess Mark
should take this patchset.

Sorry, I should have specified it in the cover letter.

Thanks,
Andi

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

* Re: [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks
  2016-07-12 22:17   ` Michael Turquette
  2016-07-13  2:08     ` Andi Shyti
@ 2016-07-13  9:21     ` Sylwester Nawrocki
  2016-07-13  9:54       ` Krzysztof Kozlowski
  2016-07-13 12:44     ` Andi Shyti
  2 siblings, 1 reply; 18+ messages in thread
From: Sylwester Nawrocki @ 2016-07-13  9:21 UTC (permalink / raw)
  To: Michael Turquette
  Cc: Andi Shyti, Rob Herring, Mark Rutland, Kukjin Kim,
	Krzysztof Kozlowski, Mark Brown, Tomasz Figa, Stephen Boyd,
	Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti

On 07/13/2016 12:17 AM, Michael Turquette wrote:
>
> Do you want these patches to go through same tree? If not, I can take
> this patch into clk-next.

I think this patch can safely go separately through the clk tree,
we just need to ensure whole series is merged for same release
to avoid regressions. There should be no problems with git bisect
since there is no exynos5433 based board dts in mainline yet.

--
Thanks,
Sylwester

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

* Re: [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks
  2016-07-13  9:21     ` Sylwester Nawrocki
@ 2016-07-13  9:54       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2016-07-13  9:54 UTC (permalink / raw)
  To: Sylwester Nawrocki, Michael Turquette
  Cc: Andi Shyti, Rob Herring, Mark Rutland, Kukjin Kim, Mark Brown,
	Tomasz Figa, Stephen Boyd, Chanwoo Choi, Jaehoon Chung,
	linux-clk, devicetree, linux-arm-kernel, linux-samsung-soc,
	linux-spi, Andi Shyti

On 07/13/2016 11:21 AM, Sylwester Nawrocki wrote:
> On 07/13/2016 12:17 AM, Michael Turquette wrote:
>>
>> Do you want these patches to go through same tree? If not, I can take
>> this patch into clk-next.
> 
> I think this patch can safely go separately through the clk tree,
> we just need to ensure whole series is merged for same release
> to avoid regressions. There should be no problems with git bisect
> since there is no exynos5433 based board dts in mainline yet.

Ack.

Best regards,
Krzysztof

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

* Re: [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks
  2016-07-12 22:17   ` Michael Turquette
  2016-07-13  2:08     ` Andi Shyti
  2016-07-13  9:21     ` Sylwester Nawrocki
@ 2016-07-13 12:44     ` Andi Shyti
  2 siblings, 0 replies; 18+ messages in thread
From: Andi Shyti @ 2016-07-13 12:44 UTC (permalink / raw)
  To: Michael Turquette
  Cc: Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	Mark Brown, Sylwester Nawrocki, Tomasz Figa, Stephen Boyd,
	Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti

Hi Mike,

> > Because the Exynos5433 SPI driver supports the ioclk handling and
> > the following patch:
> > 
> >   http://marc.info/?l=linux-kernel&m=146787645626318&w=2
> > 
> > fixes a synchronus abort issue, none of the SPI clocks require
> > any critical handling: remove, then, the CLK_IGNORE_UNUSED flag
> > for the SPI related clocks.
> > 
> > Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
> > Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> > Reviewed-by: Michael Turquette <mturquette@baylibre.com>
> > Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> 
> Do you want these patches to go through same tree? If not, I can take
> this patch into clk-next.

oh yes, as Krzysztof and Sylwester pointed out, the dependency is
not that strict as there is no exynos5433 dts yet, so that we
wouldn't break anything if patch 7/7 gets in before the others.

If you want to take in your branch the 7/7, please feel free to
do so. Only the patches on the drivers/spi/spi-s3c64xx.c file
have some dependencies on some previous patches I sent to Mark.

Andi

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

* Re: [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks
  2016-07-12 10:02 ` [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks Andi Shyti
  2016-07-12 22:17   ` Michael Turquette
@ 2016-07-13 21:56   ` Michael Turquette
  1 sibling, 0 replies; 18+ messages in thread
From: Michael Turquette @ 2016-07-13 21:56 UTC (permalink / raw)
  To: Andi Shyti, Rob Herring, Mark Rutland, Kukjin Kim,
	Krzysztof Kozlowski, Mark Brown, Sylwester Nawrocki, Tomasz Figa,
	Stephen Boyd
  Cc: Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti,
	Andi Shyti

Quoting Andi Shyti (2016-07-12 03:02:16)
> Because the Exynos5433 SPI driver supports the ioclk handling and
> the following patch:
> =

>   http://marc.info/?l=3Dlinux-kernel&m=3D146787645626318&w=3D2
> =

> fixes a synchronus abort issue, none of the SPI clocks require
> any critical handling: remove, then, the CLK_IGNORE_UNUSED flag
> for the SPI related clocks.
> =

> Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Reviewed-by: Michael Turquette <mturquette@baylibre.com>
> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Applied towards v4.8.

Regards,
Mike

> ---
>  drivers/clk/samsung/clk-exynos5433.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> =

> diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/c=
lk-exynos5433.c
> index c3a5318..fb19525 100644
> --- a/drivers/clk/samsung/clk-exynos5433.c
> +++ b/drivers/clk/samsung/clk-exynos5433.c
> @@ -1661,8 +1661,7 @@ static struct samsung_gate_clock peric_gate_clks[] =
__initdata =3D {
>         GATE(CLK_SCLK_IOCLK_SPI2, "sclk_ioclk_spi2", "ioclk_spi2_clk_in",
>                         ENABLE_SCLK_PERIC, 13, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_IOCLK_SPI1, "sclk_ioclk_spi1", "ioclk_spi1_clk_in",
> -                       ENABLE_SCLK_PERIC, 12,
> -                       CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
> +                       ENABLE_SCLK_PERIC, 12, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_IOCLK_SPI0, "sclk_ioclk_spi0", "ioclk_spi0_clk_in",
>                         ENABLE_SCLK_PERIC, 11, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_IOCLK_I2S1_BCLK, "sclk_ioclk_i2s1_bclk",
> @@ -1677,7 +1676,7 @@ static struct samsung_gate_clock peric_gate_clks[] =
__initdata =3D {
>         GATE(CLK_SCLK_SPI2, "sclk_spi2", "sclk_spi2_peric", ENABLE_SCLK_P=
ERIC,
>                         5, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_SPI1, "sclk_spi1", "sclk_spi1_peric", ENABLE_SCLK_P=
ERIC,
> -                       4, CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
> +                       4, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_SPI0, "sclk_spi0", "sclk_spi0_peric", ENABLE_SCLK_P=
ERIC,
>                         3, CLK_SET_RATE_PARENT, 0),
>         GATE(CLK_SCLK_UART2, "sclk_uart2", "sclk_uart2_peric",
> -- =

> 2.8.1
>=20

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

* Re: [PATCH v3 1/7] bindings: spi-samsung: add exynos5433 spi compatible
  2016-07-12 10:02 ` [PATCH v3 1/7] bindings: spi-samsung: add exynos5433 spi compatible Andi Shyti
@ 2016-07-14 16:25   ` Mark Brown
  2016-07-16 20:26   ` Rob Herring
  1 sibling, 0 replies; 18+ messages in thread
From: Mark Brown @ 2016-07-14 16:25 UTC (permalink / raw)
  To: Andi Shyti
  Cc: Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	Sylwester Nawrocki, Tomasz Figa, Michael Turquette, Stephen Boyd,
	Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti

[-- Attachment #1: Type: text/plain, Size: 325 bytes --]

On Tue, Jul 12, 2016 at 07:02:10PM +0900, Andi Shyti wrote:
> The samsung,exynos5433-spi has some peculiarities that bring the
> need of creating a new compatible in the binding.

Please submit patches using subject lines reflecting the style for the
subsystem.  This makes it easier for people to identify relevant
patches.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH v3 1/7] bindings: spi-samsung: add exynos5433 spi compatible
  2016-07-12 10:02 ` [PATCH v3 1/7] bindings: spi-samsung: add exynos5433 spi compatible Andi Shyti
  2016-07-14 16:25   ` Mark Brown
@ 2016-07-16 20:26   ` Rob Herring
  1 sibling, 0 replies; 18+ messages in thread
From: Rob Herring @ 2016-07-16 20:26 UTC (permalink / raw)
  To: Andi Shyti
  Cc: Mark Rutland, Kukjin Kim, Krzysztof Kozlowski, Mark Brown,
	Sylwester Nawrocki, Tomasz Figa, Michael Turquette, Stephen Boyd,
	Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti

On Tue, Jul 12, 2016 at 07:02:10PM +0900, Andi Shyti wrote:
> The samsung,exynos5433-spi has some peculiarities that bring the
> need of creating a new compatible in the binding.
> 
> One of those is the 3-clocks controller management where the spi
> is fed with three clocks: "spi", "busclkN" and "ioclk".
> 
> By adding the exynos5433-spi, we deprecate the exynos7 compatible
> and discourage its use.
> 
> Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
> Reviewed-by: Michael Turquette <mturquette@baylibre.com>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
>  Documentation/devicetree/bindings/spi/spi-samsung.txt | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Acked-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v3 2/7] bindings: spi-samsung: document the clocks and the clock-name property
  2016-07-12 10:02 ` [PATCH v3 2/7] bindings: spi-samsung: document the clocks and the clock-name property Andi Shyti
@ 2016-07-16 20:30   ` Rob Herring
  2016-07-18 10:30     ` Sylwester Nawrocki
  0 siblings, 1 reply; 18+ messages in thread
From: Rob Herring @ 2016-07-16 20:30 UTC (permalink / raw)
  To: Andi Shyti
  Cc: Mark Rutland, Kukjin Kim, Krzysztof Kozlowski, Mark Brown,
	Sylwester Nawrocki, Tomasz Figa, Michael Turquette, Stephen Boyd,
	Chanwoo Choi, Jaehoon Chung, linux-clk, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-spi, Andi Shyti

On Tue, Jul 12, 2016 at 07:02:11PM +0900, Andi Shyti wrote:
> These two properties were not documented but used in the spi
> dts. Add the related documentation.
> 
> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
> Reviewed-by: Michael Turquette <mturquette@baylibre.com>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> ---
>  Documentation/devicetree/bindings/spi/spi-samsung.txt | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/spi/spi-samsung.txt b/Documentation/devicetree/bindings/spi/spi-samsung.txt
> index 57d5539..f45c6eb 100644
> --- a/Documentation/devicetree/bindings/spi/spi-samsung.txt
> +++ b/Documentation/devicetree/bindings/spi/spi-samsung.txt
> @@ -24,6 +24,15 @@ Required SoC Specific Properties:
>  - dma-names: Names for the dma channels. There must be at least one channel
>    named "tx" for transmit and named "rx" for receive.
>  
> +- clocks: specifies the clock IDs provided to the SPI controller; they are
> +  required for interacting with the controller itself, for synchronizing the bus
> +  and as I/O clock (the latter is required by exynos5433 and exynos7).
> +
> +- clock-names: string names of the clocks in the 'clocks' property; for all the
> +  the devices the names must be "spi", "spi_busclkN" (where N is determined by
> +  "samsung,spi-src-clk"), while Exynos5433 should specify a third clock

This sounds like you are describing the configuration of the clocks, not 
the connections. The binding here should list clocks for all possible 
vaules of N as those are all the input clocks to the block.

> +  "spi_ioclk" for the I/O clock.
> +
>  Required Board Specific Properties:
>  
>  - #address-cells: should be 1.
> -- 
> 2.8.1
> 

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

* Re: [PATCH v3 2/7] bindings: spi-samsung: document the clocks and the clock-name property
  2016-07-16 20:30   ` Rob Herring
@ 2016-07-18 10:30     ` Sylwester Nawrocki
  0 siblings, 0 replies; 18+ messages in thread
From: Sylwester Nawrocki @ 2016-07-18 10:30 UTC (permalink / raw)
  To: Rob Herring, Andi Shyti
  Cc: Mark Rutland, Kukjin Kim, Krzysztof Kozlowski, Mark Brown,
	Tomasz Figa, Michael Turquette, Stephen Boyd, Chanwoo Choi,
	Jaehoon Chung, linux-clk, devicetree, linux-arm-kernel,
	linux-samsung-soc, linux-spi, Andi Shyti

On 07/16/2016 10:30 PM, Rob Herring wrote:
>> diff --git a/Documentation/devicetree/bindings/spi/spi-samsung.txt 
>> b/Documentation/devicetree/bindings/spi/spi-samsung.txt
>> > index 57d5539..f45c6eb 100644
>> > --- a/Documentation/devicetree/bindings/spi/spi-samsung.txt
>> > +++ b/Documentation/devicetree/bindings/spi/spi-samsung.txt
>> > @@ -24,6 +24,15 @@ Required SoC Specific Properties:
>> >  - dma-names: Names for the dma channels. There must be at least one channel
>> >    named "tx" for transmit and named "rx" for receive.
>> >  
>> > +- clocks: specifies the clock IDs provided to the SPI controller; they are
>> > +  required for interacting with the controller itself, for synchronizing the bus
>> > +  and as I/O clock (the latter is required by exynos5433 and exynos7).
>> > +
>> > +- clock-names: string names of the clocks in the 'clocks' property; for all the
>> > +  the devices the names must be "spi", "spi_busclkN" (where N is determined by
>> > +  "samsung,spi-src-clk"), while Exynos5433 should specify a third clock
>
> This sounds like you are describing the configuration of the clocks, not 
> the connections. The binding here should list clocks for all possible 
> vaules of N as those are all the input clocks to the block.
> 
>> > +  "spi_ioclk" for the I/O clock.

I agree we should list all possible spi_busclkN, I must admit  I might
have introduced some confusion by suggesting wording for clock-names 
similar to the above while discussing those things internally.  Afterwards 
I came to a similar conclusion all possible input clocks should be listed
These will differ depending  on the compatible.  I checked in documentation 
of most of related SoCs and for "samsung,s3c6410-spi" or older compatibles 
possible N is 0..2 (PCLK, USBCLK, PLL clock), for "samsung,s5pv210-spi" 
and newer possible N is 0 (SCLK_SPI).  

It's important to have all the input clocks listed so we have a list 
of parent clocks to the SPI controller's internal clocks, should we 
ever decide to model them with the clk API.

--
Thanks, 
Sylwester

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

end of thread, other threads:[~2016-07-18 10:30 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-12 10:02 [PATCH v3 0/7] spi s3c64xx ioclk handling Andi Shyti
2016-07-12 10:02 ` [PATCH v3 1/7] bindings: spi-samsung: add exynos5433 spi compatible Andi Shyti
2016-07-14 16:25   ` Mark Brown
2016-07-16 20:26   ` Rob Herring
2016-07-12 10:02 ` [PATCH v3 2/7] bindings: spi-samsung: document the clocks and the clock-name property Andi Shyti
2016-07-16 20:30   ` Rob Herring
2016-07-18 10:30     ` Sylwester Nawrocki
2016-07-12 10:02 ` [PATCH v3 3/7] spi: s3c64xx: rename goto labels to meaningful names Andi Shyti
2016-07-12 10:02 ` [PATCH v3 4/7] spi: s3c64xx: use error code from clk_prepare_enable() Andi Shyti
2016-07-12 10:02 ` [PATCH v3 5/7] spi: s3c64xx: add Exynos5433 compatible for ioclk handling Andi Shyti
2016-07-12 10:02 ` [PATCH v3 6/7] spi: s3c64xx: restore removed comments Andi Shyti
2016-07-12 10:02 ` [PATCH v3 7/7] clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks Andi Shyti
2016-07-12 22:17   ` Michael Turquette
2016-07-13  2:08     ` Andi Shyti
2016-07-13  9:21     ` Sylwester Nawrocki
2016-07-13  9:54       ` Krzysztof Kozlowski
2016-07-13 12:44     ` Andi Shyti
2016-07-13 21:56   ` Michael Turquette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).