1 From 2b873c59fd313aee57864f96d64a228f2ea7c208 Mon Sep 17 00:00:00 2001
2 From: Martin Schiller <ms@dev.tdt.de>
3 Date: Mon, 13 May 2024 10:42:24 +0200
4 Subject: [PATCH] MIPS: lantiq: xway: vmmc: use platform_get_irq to get irqs
7 Let's fetch the irqs from the dts here and expose them to the voice
8 driver like it is done for the cp1 base memory.
11 Maybe it is possible to drop this driver completely and merge this
12 handling to the voice driver.
14 Signed-off-by: Martin Schiller <ms@dev.tdt.de>
16 arch/mips/lantiq/xway/vmmc.c | 53 ++++++++++++++++++++++++++++++++++++
17 1 file changed, 53 insertions(+)
19 --- a/arch/mips/lantiq/xway/vmmc.c
20 +++ b/arch/mips/lantiq/xway/vmmc.c
23 static unsigned int *cp1_base;
27 +static int vc_irq[4];
29 unsigned int *ltq_get_cp1_base(void)
32 @@ -23,6 +27,33 @@ unsigned int *ltq_get_cp1_base(void)
34 EXPORT_SYMBOL(ltq_get_cp1_base);
36 +unsigned int ltq_get_mps_ad0_irq(void)
39 + panic("no ad0 irq was set\n");
43 +EXPORT_SYMBOL(ltq_get_mps_ad0_irq);
45 +unsigned int ltq_get_mps_ad1_irq(void)
48 + panic("no ad1 irq was set\n");
52 +EXPORT_SYMBOL(ltq_get_mps_ad1_irq);
54 +unsigned int ltq_get_mps_vc_irq(int idx)
57 + panic("no vc%d irq was set\n", idx);
61 +EXPORT_SYMBOL(ltq_get_mps_vc_irq);
63 static int vmmc_probe(struct platform_device *pdev)
65 #define CP1_SIZE (1 << 20)
66 @@ -30,11 +61,33 @@ static int vmmc_probe(struct platform_de
73 (void *) CPHYSADDR(dma_alloc_coherent(&pdev->dev, CP1_SIZE,
76 + ad0_irq = platform_get_irq(pdev, 4);
78 + dev_err(&pdev->dev, "failed to get MPS AD0 irq: %d\n", ad0_irq);
82 + ad1_irq = platform_get_irq(pdev, 5);
84 + dev_err(&pdev->dev, "failed to get MPS AD1 irq: %d\n", ad1_irq);
88 + for (i = 0; i < 4; i++) {
89 + vc_irq[i] = platform_get_irq(pdev, i);
90 + if (vc_irq[i] < 0) {
91 + dev_err(&pdev->dev, "failed to get MPS VC%d irq: %d\n",
97 gpio_count = gpiod_count(&pdev->dev, NULL);
98 while (gpio_count > 0) {
99 gpio = devm_gpiod_get_index(&pdev->dev,