linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] sound/soc: Use platform_get_irq() to fetch IRQ's
@ 2021-12-19 18:10 Lad Prabhakar
  2021-12-19 18:10 ` [PATCH 1/2] ASoC: xlnx: Use platform_get_irq() to get the interrupt Lad Prabhakar
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lad Prabhakar @ 2021-12-19 18:10 UTC (permalink / raw)
  To: Rob Herring, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Florian Fainelli, bcm-kernel-feedback-list,
	Michal Simek
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, Prabhakar, Lad Prabhakar

Hi All,

This patch series aims to drop using platform_get_resource() for IRQ types
in preparation for removal of static setup of IRQ resource from DT core
code.

Dropping usage of platform_get_resource() was agreed based on
the discussion [0].

[0] https://patchwork.kernel.org/project/linux-renesas-soc/
patch/20211209001056.29774-1-prabhakar.mahadev-lad.rj@bp.renesas.com/

Note: I have just build tested the patches.

Cheers,
Prabhakar

Lad Prabhakar (2):
  ASoC: xlnx: Use platform_get_irq() to get the interrupt
  ASoC: bcm: Use platform_get_irq() to get the interrupt

 sound/soc/bcm/bcm63xx-i2s.h          |  1 -
 sound/soc/bcm/bcm63xx-pcm-whistler.c | 12 +++++-------
 sound/soc/xilinx/xlnx_spdif.c        | 10 +++-------
 3 files changed, 8 insertions(+), 15 deletions(-)

-- 
2.17.1


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

* [PATCH 1/2] ASoC: xlnx: Use platform_get_irq() to get the interrupt
  2021-12-19 18:10 [PATCH 0/2] sound/soc: Use platform_get_irq() to fetch IRQ's Lad Prabhakar
@ 2021-12-19 18:10 ` Lad Prabhakar
  2021-12-19 18:10 ` [PATCH 2/2] ASoC: bcm: " Lad Prabhakar
  2021-12-21 19:12 ` [PATCH 0/2] sound/soc: Use platform_get_irq() to fetch IRQ's Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Lad Prabhakar @ 2021-12-19 18:10 UTC (permalink / raw)
  To: Rob Herring, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Florian Fainelli, bcm-kernel-feedback-list,
	Michal Simek
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, Prabhakar, Lad Prabhakar

platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 sound/soc/xilinx/xlnx_spdif.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sound/soc/xilinx/xlnx_spdif.c b/sound/soc/xilinx/xlnx_spdif.c
index e2ca087adee6..cba0e868a7d7 100644
--- a/sound/soc/xilinx/xlnx_spdif.c
+++ b/sound/soc/xilinx/xlnx_spdif.c
@@ -237,7 +237,6 @@ MODULE_DEVICE_TABLE(of, xlnx_spdif_of_match);
 static int xlnx_spdif_probe(struct platform_device *pdev)
 {
 	int ret;
-	struct resource *res;
 	struct snd_soc_dai_driver *dai_drv;
 	struct spdif_dev_data *ctx;
 
@@ -273,13 +272,10 @@ static int xlnx_spdif_probe(struct platform_device *pdev)
 	if (ctx->mode) {
 		dai_drv = &xlnx_spdif_tx_dai;
 	} else {
-		res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-		if (!res) {
-			dev_err(dev, "No IRQ resource found\n");
-			ret = -ENODEV;
+		ret = platform_get_irq(pdev, 0);
+		if (ret < 0)
 			goto clk_err;
-		}
-		ret = devm_request_irq(dev, res->start,
+		ret = devm_request_irq(dev, ret,
 				       xlnx_spdifrx_irq_handler,
 				       0, "XLNX_SPDIF_RX", ctx);
 		if (ret) {
-- 
2.17.1


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

* [PATCH 2/2] ASoC: bcm: Use platform_get_irq() to get the interrupt
  2021-12-19 18:10 [PATCH 0/2] sound/soc: Use platform_get_irq() to fetch IRQ's Lad Prabhakar
  2021-12-19 18:10 ` [PATCH 1/2] ASoC: xlnx: Use platform_get_irq() to get the interrupt Lad Prabhakar
@ 2021-12-19 18:10 ` Lad Prabhakar
  2021-12-19 18:20   ` Florian Fainelli
  2021-12-20 18:30   ` Mark Brown
  2021-12-21 19:12 ` [PATCH 0/2] sound/soc: Use platform_get_irq() to fetch IRQ's Mark Brown
  2 siblings, 2 replies; 6+ messages in thread
From: Lad Prabhakar @ 2021-12-19 18:10 UTC (permalink / raw)
  To: Rob Herring, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Florian Fainelli, bcm-kernel-feedback-list,
	Michal Simek
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, Prabhakar, Lad Prabhakar

platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().

While at it also drop "r_irq" member from struct bcm_i2s_priv as there
are no users of it.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 sound/soc/bcm/bcm63xx-i2s.h          |  1 -
 sound/soc/bcm/bcm63xx-pcm-whistler.c | 12 +++++-------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/sound/soc/bcm/bcm63xx-i2s.h b/sound/soc/bcm/bcm63xx-i2s.h
index edc328ba53d3..f30556bec89e 100644
--- a/sound/soc/bcm/bcm63xx-i2s.h
+++ b/sound/soc/bcm/bcm63xx-i2s.h
@@ -74,7 +74,6 @@
 
 struct bcm_i2s_priv {
 	struct device *dev;
-	struct resource *r_irq;
 	struct regmap *regmap_i2s;
 	struct clk *i2s_clk;
 	struct snd_pcm_substream	*play_substream;
diff --git a/sound/soc/bcm/bcm63xx-pcm-whistler.c b/sound/soc/bcm/bcm63xx-pcm-whistler.c
index b5096f64c576..41f80d564020 100644
--- a/sound/soc/bcm/bcm63xx-pcm-whistler.c
+++ b/sound/soc/bcm/bcm63xx-pcm-whistler.c
@@ -387,14 +387,12 @@ int bcm63xx_soc_platform_probe(struct platform_device *pdev,
 {
 	int ret;
 
-	i2s_priv->r_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!i2s_priv->r_irq) {
-		dev_err(&pdev->dev, "Unable to get register irq resource.\n");
-		return -ENODEV;
-	}
+	ret = platform_get_irq(pdev, 0);
+	if (ret < 0)
+		return ret;
 
-	ret = devm_request_irq(&pdev->dev, i2s_priv->r_irq->start, i2s_dma_isr,
-			i2s_priv->r_irq->flags, "i2s_dma", (void *)i2s_priv);
+	ret = devm_request_irq(&pdev->dev, ret, i2s_dma_isr,
+			       irq_get_trigger_type(ret), "i2s_dma", (void *)i2s_priv);
 	if (ret) {
 		dev_err(&pdev->dev,
 			"i2s_init: failed to request interrupt.ret=%d\n", ret);
-- 
2.17.1


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

* Re: [PATCH 2/2] ASoC: bcm: Use platform_get_irq() to get the interrupt
  2021-12-19 18:10 ` [PATCH 2/2] ASoC: bcm: " Lad Prabhakar
@ 2021-12-19 18:20   ` Florian Fainelli
  2021-12-20 18:30   ` Mark Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2021-12-19 18:20 UTC (permalink / raw)
  To: Lad Prabhakar, Rob Herring, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Florian Fainelli,
	bcm-kernel-feedback-list, Michal Simek
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, Prabhakar



On 12/19/2021 10:10 AM, Lad Prabhakar wrote:
> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypasses the hierarchical setup and messes up the
> irq chaining.
> 
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq().
> 
> While at it also drop "r_irq" member from struct bcm_i2s_priv as there
> are no users of it.
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

Thanks!
-- 
Florian

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

* Re: [PATCH 2/2] ASoC: bcm: Use platform_get_irq() to get the interrupt
  2021-12-19 18:10 ` [PATCH 2/2] ASoC: bcm: " Lad Prabhakar
  2021-12-19 18:20   ` Florian Fainelli
@ 2021-12-20 18:30   ` Mark Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2021-12-20 18:30 UTC (permalink / raw)
  To: Lad Prabhakar
  Cc: Rob Herring, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Florian Fainelli, bcm-kernel-feedback-list, Michal Simek,
	alsa-devel, linux-arm-kernel, linux-kernel, Prabhakar

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

On Sun, Dec 19, 2021 at 06:10:39PM +0000, Lad Prabhakar wrote:
> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypasses the hierarchical setup and messes up the
> irq chaining.

This doesn't compile for at least x86_64 allmodconfig:

/mnt/kernel/sound/soc/bcm/bcm63xx-pcm-whistler.c: In function 'bcm63xx_soc_platform_probe':
/mnt/kernel/sound/soc/bcm/bcm63xx-pcm-whistler.c:395:11: error: implicit declaration of function 'irq_get_trigger_type' [-Werror=implicit-function-declaration]
  395 |           irq_get_trigger_type(ret), "i2s_dma", (void *)i2s_priv);
      |           ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

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

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

* Re: [PATCH 0/2] sound/soc: Use platform_get_irq() to fetch IRQ's
  2021-12-19 18:10 [PATCH 0/2] sound/soc: Use platform_get_irq() to fetch IRQ's Lad Prabhakar
  2021-12-19 18:10 ` [PATCH 1/2] ASoC: xlnx: Use platform_get_irq() to get the interrupt Lad Prabhakar
  2021-12-19 18:10 ` [PATCH 2/2] ASoC: bcm: " Lad Prabhakar
@ 2021-12-21 19:12 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2021-12-21 19:12 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, Florian Fainelli, Michal Simek,
	Takashi Iwai, Lad Prabhakar, bcm-kernel-feedback-list,
	Rob Herring
  Cc: linux-arm-kernel, alsa-devel, Prabhakar, linux-kernel

On Sun, 19 Dec 2021 18:10:37 +0000, Lad Prabhakar wrote:
> This patch series aims to drop using platform_get_resource() for IRQ types
> in preparation for removal of static setup of IRQ resource from DT core
> code.
> 
> Dropping usage of platform_get_resource() was agreed based on
> the discussion [0].
> 
> [...]

Applied to

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

Thanks!

[1/2] ASoC: xlnx: Use platform_get_irq() to get the interrupt
      commit: c2efaf8f2d53ffa2ecc487e21c62d13bbb8d88c3
[2/2] ASoC: bcm: Use platform_get_irq() to get the interrupt
      commit: 5de035c270047e7ae754fbfb69031707aa5b54f7

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] 6+ messages in thread

end of thread, other threads:[~2021-12-21 19:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-19 18:10 [PATCH 0/2] sound/soc: Use platform_get_irq() to fetch IRQ's Lad Prabhakar
2021-12-19 18:10 ` [PATCH 1/2] ASoC: xlnx: Use platform_get_irq() to get the interrupt Lad Prabhakar
2021-12-19 18:10 ` [PATCH 2/2] ASoC: bcm: " Lad Prabhakar
2021-12-19 18:20   ` Florian Fainelli
2021-12-20 18:30   ` Mark Brown
2021-12-21 19:12 ` [PATCH 0/2] sound/soc: Use platform_get_irq() to fetch IRQ's Mark Brown

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).