All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] ASoC: dwc: add optional reset support
@ 2023-05-04  7:16 Maxim Kochetkov
  2023-05-04  7:16 ` [PATCH v2 2/2] ASoC: dt-bindings: designware-i2s: add optional resets Maxim Kochetkov via Alsa-devel
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Maxim Kochetkov @ 2023-05-04  7:16 UTC (permalink / raw
  To: alsa-devel
  Cc: lgirdwood, broonie, perex, tiwai, p.zabel, ckeepax,
	u.kleine-koenig, nicolas.ferre, Maxim Kochetkov

Some SoC may have resets for I2S subsystem. So add optional reset support.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
---
 sound/soc/dwc/dwc-i2s.c | 27 +++++++++++++++++++++------
 sound/soc/dwc/local.h   |  1 +
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c
index acdf98b2ee9c..e2b2ba014a2e 100644
--- a/sound/soc/dwc/dwc-i2s.c
+++ b/sound/soc/dwc/dwc-i2s.c
@@ -17,6 +17,7 @@
 #include <linux/io.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
+#include <linux/reset.h>
 #include <linux/slab.h>
 #include <linux/pm_runtime.h>
 #include <sound/designware_i2s.h>
@@ -648,6 +649,14 @@ static int dw_i2s_probe(struct platform_device *pdev)
 	if (IS_ERR(dev->i2s_base))
 		return PTR_ERR(dev->i2s_base);
 
+	dev->reset = devm_reset_control_array_get_optional_shared(&pdev->dev);
+	if (IS_ERR(dev->reset))
+		return PTR_ERR(dev->reset);
+
+	ret = reset_control_deassert(dev->reset);
+	if (ret)
+		return ret;
+
 	dev->dev = &pdev->dev;
 
 	irq = platform_get_irq_optional(pdev, 0);
@@ -656,7 +665,7 @@ static int dw_i2s_probe(struct platform_device *pdev)
 				pdev->name, dev);
 		if (ret < 0) {
 			dev_err(&pdev->dev, "failed to request irq\n");
-			return ret;
+			goto err_assert_reset;
 		}
 	}
 
@@ -676,24 +685,27 @@ static int dw_i2s_probe(struct platform_device *pdev)
 		ret = dw_configure_dai_by_dt(dev, dw_i2s_dai, res);
 	}
 	if (ret < 0)
-		return ret;
+		goto err_assert_reset;
 
 	if (dev->capability & DW_I2S_MASTER) {
 		if (pdata) {
 			dev->i2s_clk_cfg = pdata->i2s_clk_cfg;
 			if (!dev->i2s_clk_cfg) {
 				dev_err(&pdev->dev, "no clock configure method\n");
-				return -ENODEV;
+				ret = -ENODEV;
+				goto err_assert_reset;
 			}
 		}
 		dev->clk = devm_clk_get(&pdev->dev, clk_id);
 
-		if (IS_ERR(dev->clk))
-			return PTR_ERR(dev->clk);
+		if (IS_ERR(dev->clk)) {
+			ret = PTR_ERR(dev->clk);
+			goto err_assert_reset;
+		}
 
 		ret = clk_prepare_enable(dev->clk);
 		if (ret < 0)
-			return ret;
+			goto err_assert_reset;
 	}
 
 	dev_set_drvdata(&pdev->dev, dev);
@@ -727,6 +739,8 @@ static int dw_i2s_probe(struct platform_device *pdev)
 err_clk_disable:
 	if (dev->capability & DW_I2S_MASTER)
 		clk_disable_unprepare(dev->clk);
+err_assert_reset:
+	reset_control_assert(dev->reset);
 	return ret;
 }
 
@@ -737,6 +751,7 @@ static void dw_i2s_remove(struct platform_device *pdev)
 	if (dev->capability & DW_I2S_MASTER)
 		clk_disable_unprepare(dev->clk);
 
+	reset_control_assert(dev->reset);
 	pm_runtime_disable(&pdev->dev);
 }
 
diff --git a/sound/soc/dwc/local.h b/sound/soc/dwc/local.h
index 1c361eb6127e..d64bd4f8fd34 100644
--- a/sound/soc/dwc/local.h
+++ b/sound/soc/dwc/local.h
@@ -89,6 +89,7 @@ union dw_i2s_snd_dma_data {
 struct dw_i2s_dev {
 	void __iomem *i2s_base;
 	struct clk *clk;
+	struct reset_control *reset;
 	int active;
 	unsigned int capability;
 	unsigned int quirks;
-- 
2.39.2


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

* [PATCH v2 2/2] ASoC: dt-bindings: designware-i2s: add optional resets
  2023-05-04  7:16 [PATCH v2 1/2] ASoC: dwc: add optional reset support Maxim Kochetkov
  2023-05-04  7:16 ` [PATCH v2 2/2] ASoC: dt-bindings: designware-i2s: add optional resets Maxim Kochetkov via Alsa-devel
@ 2023-05-04  7:16 ` Maxim Kochetkov
  2023-05-05 10:48   ` Krzysztof Kozlowski
  2023-05-09  6:38 ` [PATCH v2 1/2] ASoC: dwc: add optional reset support Mark Brown
  2 siblings, 1 reply; 5+ messages in thread
From: Maxim Kochetkov @ 2023-05-04  7:16 UTC (permalink / raw
  To: alsa-devel
  Cc: lgirdwood, broonie, perex, tiwai, p.zabel, ckeepax,
	u.kleine-koenig, nicolas.ferre, Maxim Kochetkov

Some SoC may have resets for I2S subsystem. So add optional resets support.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
---
 .../devicetree/bindings/sound/snps,designware-i2s.yaml         | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml b/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
index 56e623d4e168..a970fd264b21 100644
--- a/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
+++ b/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
@@ -36,7 +36,8 @@ properties:
     const: i2sclk
 
   resets:
-    maxItems: 1
+    items:
+      - description: Optional controller resets
 
   dmas:
     items:
-- 
2.39.2


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

* [PATCH v2 2/2] ASoC: dt-bindings: designware-i2s: add optional resets
  2023-05-04  7:16 [PATCH v2 1/2] ASoC: dwc: add optional reset support Maxim Kochetkov
@ 2023-05-04  7:16 ` Maxim Kochetkov via Alsa-devel
  2023-05-04  7:16 ` Maxim Kochetkov
  2023-05-09  6:38 ` [PATCH v2 1/2] ASoC: dwc: add optional reset support Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Maxim Kochetkov via Alsa-devel @ 2023-05-04  7:16 UTC (permalink / raw
  To: alsa-devel
  Cc: lgirdwood, broonie, tiwai, p.zabel, ckeepax, u.kleine-koenig,
	nicolas.ferre, Maxim Kochetkov


[-- Attachment #0: Type: message/rfc822, Size: 6383 bytes --]

From: Maxim Kochetkov <fido_max@inbox.ru>
To: alsa-devel@alsa-project.org
Cc: lgirdwood@gmail.com, broonie@kernel.org, tiwai@suse.com, p.zabel@pengutronix.de, ckeepax@opensource.cirrus.com, u.kleine-koenig@pengutronix.de, nicolas.ferre@microchip.com, Maxim Kochetkov <fido_max@inbox.ru>
Subject: [PATCH v2 2/2] ASoC: dt-bindings: designware-i2s: add optional resets
Date: Thu,  4 May 2023 10:16:18 +0300
Message-ID: <20230504071618.52012-2-fido_max@inbox.ru>

Some SoC may have resets for I2S subsystem. So add optional resets support.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
---
 .../devicetree/bindings/sound/snps,designware-i2s.yaml         | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml b/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
index 56e623d4e168..a970fd264b21 100644
--- a/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
+++ b/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
@@ -36,7 +36,8 @@ properties:
     const: i2sclk
 
   resets:
-    maxItems: 1
+    items:
+      - description: Optional controller resets
 
   dmas:
     items:
-- 
2.39.2


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

* Re: [PATCH v2 2/2] ASoC: dt-bindings: designware-i2s: add optional resets
  2023-05-04  7:16 ` Maxim Kochetkov
@ 2023-05-05 10:48   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-05 10:48 UTC (permalink / raw
  To: Maxim Kochetkov, alsa-devel
  Cc: lgirdwood, broonie, tiwai, p.zabel, ckeepax, u.kleine-koenig,
	nicolas.ferre

On 04/05/2023 09:16, Maxim Kochetkov wrote:
> Some SoC may have resets for I2S subsystem. So add optional resets support.

Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC.  It might happen, that command when run on an older
kernel, gives you outdated entries.  Therefore please be sure you base
your patches on recent Linux kernel.

You missed at least DT list (maybe more), so this won't be tested.
Please resend and include all necessary entries.

> 
> Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
> ---
>  .../devicetree/bindings/sound/snps,designware-i2s.yaml         | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml b/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
> index 56e623d4e168..a970fd264b21 100644
> --- a/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
> +++ b/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
> @@ -36,7 +36,8 @@ properties:
>      const: i2sclk
>  
>    resets:
> -    maxItems: 1
> +    items:
> +      - description: Optional controller resets


This does not make much sense. Your change does nothing. NAK.

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/2] ASoC: dwc: add optional reset support
  2023-05-04  7:16 [PATCH v2 1/2] ASoC: dwc: add optional reset support Maxim Kochetkov
  2023-05-04  7:16 ` [PATCH v2 2/2] ASoC: dt-bindings: designware-i2s: add optional resets Maxim Kochetkov via Alsa-devel
  2023-05-04  7:16 ` Maxim Kochetkov
@ 2023-05-09  6:38 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2023-05-09  6:38 UTC (permalink / raw
  To: alsa-devel, Maxim Kochetkov
  Cc: lgirdwood, tiwai, p.zabel, ckeepax, u.kleine-koenig,
	nicolas.ferre

On Thu, 04 May 2023 10:16:17 +0300, Maxim Kochetkov wrote:
> Some SoC may have resets for I2S subsystem. So add optional reset support.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: dwc: add optional reset support
      commit: c00018cadfbf07b95d10b0e152c4edd7d5d19779
[2/2] ASoC: dt-bindings: designware-i2s: add optional resets
      commit: 12b99ec3b9b6349a38223cf4d13818cb5cbdcd46

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

end of thread, other threads:[~2023-05-09  6:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-04  7:16 [PATCH v2 1/2] ASoC: dwc: add optional reset support Maxim Kochetkov
2023-05-04  7:16 ` [PATCH v2 2/2] ASoC: dt-bindings: designware-i2s: add optional resets Maxim Kochetkov via Alsa-devel
2023-05-04  7:16 ` Maxim Kochetkov
2023-05-05 10:48   ` Krzysztof Kozlowski
2023-05-09  6:38 ` [PATCH v2 1/2] ASoC: dwc: add optional reset support Mark Brown

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.