Commit 0fde3187 authored by Mark Brown's avatar Mark Brown

RZ/G2L SSI: Update interrupt numbers

Merge series from Prabhakar <prabhakar.csengg@gmail.com>:

Hi All,

This patch series aims to fix interrupt numbers for SSI channels and updates
the DT binding and the driver accordingly.

Note, this patch series applies on top of [0].

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

Cheers,
Prabhakar

Lad Prabhakar (4):
  ASoC: dt-bindings: renesas,rz-ssi: Update interrupts and
    interrupt-names properties
  ASoC: sh: rz-ssi: Update interrupt handling for half duplex channels
  arm64: dts: renesas: r9a07g044: Update IRQ numbers for SSI channels
  arm64: dts: renesas: r9a07g043: Update IRQ numbers for SSI channels

 .../bindings/sound/renesas,rz-ssi.yaml        | 21 ++++---
 arch/arm64/boot/dts/renesas/r9a07g043.dtsi    | 19 +++---
 arch/arm64/boot/dts/renesas/r9a07g044.dtsi    | 19 +++---
 sound/soc/sh/rz-ssi.c                         | 63 +++++++++++++------
 4 files changed, 70 insertions(+), 52 deletions(-)

--
2.25.1
parents 7ae87d3c 38c042b5
...@@ -25,14 +25,18 @@ properties: ...@@ -25,14 +25,18 @@ properties:
maxItems: 1 maxItems: 1
interrupts: interrupts:
maxItems: 4 minItems: 2
maxItems: 3
interrupt-names: interrupt-names:
items: oneOf:
- const: int_req - items:
- const: dma_rx - const: int_req
- const: dma_tx - const: dma_rx
- const: dma_rt - const: dma_tx
- items:
- const: int_req
- const: dma_rt
clocks: clocks:
maxItems: 4 maxItems: 4
...@@ -106,9 +110,8 @@ examples: ...@@ -106,9 +110,8 @@ examples:
reg = <0x10049c00 0x400>; reg = <0x10049c00 0x400>;
interrupts = <GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH>, interrupts = <GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 327 IRQ_TYPE_EDGE_RISING>, <GIC_SPI 327 IRQ_TYPE_EDGE_RISING>,
<GIC_SPI 328 IRQ_TYPE_EDGE_RISING>, <GIC_SPI 328 IRQ_TYPE_EDGE_RISING>;
<GIC_SPI 329 IRQ_TYPE_EDGE_RISING>; interrupt-names = "int_req", "dma_rx", "dma_tx";
interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt";
clocks = <&cpg CPG_MOD R9A07G044_SSI0_PCLK2>, clocks = <&cpg CPG_MOD R9A07G044_SSI0_PCLK2>,
<&cpg CPG_MOD R9A07G044_SSI0_PCLK_SFR>, <&cpg CPG_MOD R9A07G044_SSI0_PCLK_SFR>,
<&audio_clk1>, <&audio_clk1>,
......
...@@ -109,6 +109,7 @@ struct rz_ssi_priv { ...@@ -109,6 +109,7 @@ struct rz_ssi_priv {
int irq_int; int irq_int;
int irq_tx; int irq_tx;
int irq_rx; int irq_rx;
int irq_rt;
spinlock_t lock; spinlock_t lock;
...@@ -565,6 +566,17 @@ static irqreturn_t rz_ssi_interrupt(int irq, void *data) ...@@ -565,6 +566,17 @@ static irqreturn_t rz_ssi_interrupt(int irq, void *data)
rz_ssi_reg_mask_setl(ssi, SSIFSR, SSIFSR_RDF, 0); rz_ssi_reg_mask_setl(ssi, SSIFSR, SSIFSR_RDF, 0);
} }
if (irq == ssi->irq_rt) {
struct snd_pcm_substream *substream = strm->substream;
if (rz_ssi_stream_is_play(ssi, substream)) {
strm->transfer(ssi, &ssi->playback);
} else {
strm->transfer(ssi, &ssi->capture);
rz_ssi_reg_mask_setl(ssi, SSIFSR, SSIFSR_RDF, 0);
}
}
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -993,26 +1005,39 @@ static int rz_ssi_probe(struct platform_device *pdev) ...@@ -993,26 +1005,39 @@ static int rz_ssi_probe(struct platform_device *pdev)
if (!rz_ssi_is_dma_enabled(ssi)) { if (!rz_ssi_is_dma_enabled(ssi)) {
/* Tx and Rx interrupts (pio only) */ /* Tx and Rx interrupts (pio only) */
ssi->irq_tx = platform_get_irq_byname(pdev, "dma_tx"); ssi->irq_tx = platform_get_irq_byname(pdev, "dma_tx");
if (ssi->irq_tx < 0)
return ssi->irq_tx;
ret = devm_request_irq(&pdev->dev, ssi->irq_tx,
&rz_ssi_interrupt, 0,
dev_name(&pdev->dev), ssi);
if (ret < 0)
return dev_err_probe(&pdev->dev, ret,
"irq request error (dma_tx)\n");
ssi->irq_rx = platform_get_irq_byname(pdev, "dma_rx"); ssi->irq_rx = platform_get_irq_byname(pdev, "dma_rx");
if (ssi->irq_rx < 0) if (ssi->irq_tx == -ENXIO && ssi->irq_rx == -ENXIO) {
return ssi->irq_rx; ssi->irq_rt = platform_get_irq_byname(pdev, "dma_rt");
if (ssi->irq_rt < 0)
ret = devm_request_irq(&pdev->dev, ssi->irq_rx, return ssi->irq_rt;
&rz_ssi_interrupt, 0,
dev_name(&pdev->dev), ssi); ret = devm_request_irq(&pdev->dev, ssi->irq_rt,
if (ret < 0) &rz_ssi_interrupt, 0,
return dev_err_probe(&pdev->dev, ret, dev_name(&pdev->dev), ssi);
"irq request error (dma_rx)\n"); if (ret < 0)
return dev_err_probe(&pdev->dev, ret,
"irq request error (dma_tx)\n");
} else {
if (ssi->irq_tx < 0)
return ssi->irq_tx;
if (ssi->irq_rx < 0)
return ssi->irq_rx;
ret = devm_request_irq(&pdev->dev, ssi->irq_tx,
&rz_ssi_interrupt, 0,
dev_name(&pdev->dev), ssi);
if (ret < 0)
return dev_err_probe(&pdev->dev, ret,
"irq request error (dma_tx)\n");
ret = devm_request_irq(&pdev->dev, ssi->irq_rx,
&rz_ssi_interrupt, 0,
dev_name(&pdev->dev), ssi);
if (ret < 0)
return dev_err_probe(&pdev->dev, ret,
"irq request error (dma_rx)\n");
}
} }
ssi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); ssi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment