ipq40xx: fix invalid GPIO numbers since kernel 6.6
[openwrt/staging/xback.git] / package / kernel / lantiq / ltq-vmmc / patches / 605-get-irqs-from-kernel-in-tree-vmmc-driver.patch
1 --- a/src/mps/drv_mps_vmmc_linux.c
2 +++ b/src/mps/drv_mps_vmmc_linux.c
3 @@ -104,6 +104,10 @@ extern irqreturn_t ifx_mps_vc_irq (IFX_i
4 extern IFX_void_t ifx_mps_shutdown (IFX_void_t);
5 extern IFX_int32_t ifx_mps_event_activation_poll (mps_devices type,
6 MbxEventRegs_s * act);
7 +extern unsigned int ltq_get_mps_ad0_irq(void);
8 +extern unsigned int ltq_get_mps_ad1_irq(void);
9 +extern unsigned int ltq_get_mps_vc_irq(int idx);
10 +
11 mps_mbx_dev *ifx_mps_get_device (mps_devices type);
12
13 #ifdef CONFIG_PROC_FS
14 @@ -2260,7 +2264,7 @@ IFX_int32_t __init ifx_mps_init_module (
15 /* reset the device before initializing the device driver */
16 ifx_mps_reset ();
17
18 - result = request_irq (INT_NUM_IM4_IRL18,
19 + result = request_irq (ltq_get_mps_ad0_irq(),
20 #ifdef LINUX_2_6
21 ifx_mps_ad0_irq, 0x0
22 #else /* */
23 @@ -2270,7 +2274,7 @@ IFX_int32_t __init ifx_mps_init_module (
24 , "mps_mbx ad0", &ifx_mps_dev);
25 if (result)
26 return result;
27 - result = request_irq (INT_NUM_IM4_IRL19,
28 + result = request_irq (ltq_get_mps_ad1_irq(),
29 #ifdef LINUX_2_6
30 ifx_mps_ad1_irq, 0x0
31 #else /* */
32 @@ -2285,7 +2289,7 @@ IFX_int32_t __init ifx_mps_init_module (
33 for (i = 0; i < 4; ++i)
34 {
35 sprintf (&voice_channel_int_name[i][0], "mps_mbx vc%d", i);
36 - result = request_irq (INT_NUM_IM4_IRL14 + i,
37 + result = request_irq (ltq_get_mps_vc_irq(i),
38 #ifdef LINUX_2_6
39 ifx_mps_vc_irq, 0x0
40 #else /* */
41 @@ -2446,13 +2450,13 @@ ifx_mps_cleanup_module (IFX_void_t)
42 ifx_mps_release_structures (&ifx_mps_dev);
43
44 /* release all interrupts at the system */
45 - free_irq (INT_NUM_IM4_IRL18, &ifx_mps_dev);
46 - free_irq (INT_NUM_IM4_IRL19, &ifx_mps_dev);
47 + free_irq (ltq_get_mps_ad0_irq(), &ifx_mps_dev);
48 + free_irq (ltq_get_mps_ad1_irq(), &ifx_mps_dev);
49
50 /* register status interrupts for voice channels */
51 for (i = 0; i < 4; ++i)
52 {
53 - free_irq (INT_NUM_IM4_IRL14 + i, &ifx_mps_dev);
54 + free_irq (ltq_get_mps_vc_irq(i), &ifx_mps_dev);
55 }
56 #ifdef CONFIG_PROC_FS
57 #if CONFIG_MPS_HISTORY_SIZE > 0
58 --- a/src/mps/drv_mps_vmmc_common.c
59 +++ b/src/mps/drv_mps_vmmc_common.c
60 @@ -134,6 +134,8 @@ extern IFX_void_t mask_and_ack_danube_ir
61
62 #endif /* */
63
64 +extern unsigned int ltq_get_mps_vc_irq(int idx);
65 +
66 extern void sys_hw_setup (void);
67
68 extern IFXOS_event_t fw_ready_evt;
69 @@ -2979,7 +2981,7 @@ irqreturn_t ifx_mps_ad1_irq (IFX_int32_t
70 */
71 irqreturn_t ifx_mps_vc_irq (IFX_int32_t irq, mps_comm_dev * pDev)
72 {
73 - IFX_uint32_t chan = irq - INT_NUM_IM4_IRL14;
74 + IFX_uint32_t chan = irq - ltq_get_mps_vc_irq(0);
75 mps_mbx_dev *mbx_dev = (mps_mbx_dev *) & (pMPSDev->voice_mb[chan]);
76 MPS_VCStatReg_u MPS_VCStatusReg;
77 MbxEventRegs_s events;
78 --- a/src/mps/drv_mps_vmmc_device.h
79 +++ b/src/mps/drv_mps_vmmc_device.h
80 @@ -69,9 +69,6 @@
81 # define IFX_MPS_CVC3SR IFXMIPS_MPS_CVC3SR
82 # define IFX_MPS_SAD0SR IFXMIPS_MPS_SAD0SR
83 /* interrupt vectors */
84 -# define INT_NUM_IM4_IRL14 (INT_NUM_IM4_IRL0 + 14)
85 -# define INT_NUM_IM4_IRL18 (INT_NUM_IM4_IRL0 + 18)
86 -# define INT_NUM_IM4_IRL19 (INT_NUM_IM4_IRL0 + 19)
87 # define IFX_ICU_IM4_IER IFXMIPS_ICU_IM4_IER
88
89 /* ============================= */