ae2d593505f06195d180808c2bea9a6ea7251c63
[openwrt-10.03/.git] / package / ifxmips-dsl-api / patches / 200-mei_compat.patch
1 Index: drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c
2 ===================================================================
3 --- drv_dsl_cpe_api-3.24.4.4.orig/src/mei/ifxmips_mei.c 2009-10-31 23:30:20.000000000 +0100
4 +++ drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c      2009-11-01 04:41:58.000000000 +0100
5 @@ -41,18 +41,19 @@
6  #include <linux/init.h>
7  #include <linux/ioport.h>
8  #include <linux/delay.h>
9 +#include <linux/device.h>
10  #include <asm/uaccess.h>
11  #include <asm/hardirq.h>
12 -#include <asm/ifx/ifx_regs.h>
13 -#include <asm/ifx/irq.h>
14 -#include <asm/ifx/ifx_gpio.h>
15 -//#include <asm/ifx/ifx_led.h>
16 -#include <asm/ifx/ifx_pmu.h>
17 -#include <asm/ifx/ifx_atm.h>
18 +
19 +#include <ifxmips.h>
20 +#include <ifxmips_irq.h>
21 +#include <ifxmips_gpio.h>
22 +#include <ifxmips_pmu.h>
23 +#include "ifxmips_atm.h"
24  #define IFX_MEI_BSP
25  #include "ifxmips_mei_interface.h"
26  
27 -#define IFXMIPS_RCU_RST                   IFX_RCU_RST_REQ
28 +/*#define IFXMIPS_RCU_RST                   IFX_RCU_RST_REQ
29  #define IFXMIPS_RCU_RST_REQ_ARC_JTAG      IFX_RCU_RST_REQ_ARC_JTAG
30  #define IFXMIPS_RCU_RST_REQ_DFE                  IFX_RCU_RST_REQ_DFE
31  #define IFXMIPS_RCU_RST_REQ_AFE                  IFX_RCU_RST_REQ_AFE
32 @@ -76,7 +77,7 @@
33  #define ifxmips_r32(reg)                        __raw_readl(reg)
34  #define ifxmips_w32(val, reg)                   __raw_writel(val, reg)
35  #define ifxmips_w32_mask(clear, set, reg)       ifxmips_w32((ifxmips_r32(reg) & ~clear) | set, reg)
36 -
37 +*/
38  #define IFX_MEI_EMSG(fmt, args...) printk(KERN_ERR  "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args)
39  #define IFX_MEI_DMSG(fmt, args...) printk(KERN_INFO "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args)
40  
41 @@ -173,7 +174,8 @@
42  extern void ifxmips_mask_and_ack_irq(unsigned int irq_nr);
43  #define MEI_MASK_AND_ACK_IRQ ifxmips_mask_and_ack_irq
44  
45 -static int dev_major = 105;
46 +#define MEI_MAJOR      105
47 +static int dev_major = MEI_MAJOR;
48  
49  static struct file_operations bsp_mei_operations = {
50        owner:THIS_MODULE,
51 @@ -2294,10 +2296,10 @@
52                 IFX_MEI_EMSG ("request_irq %d failed!\n", pDev->nIrq[IFX_DFEIR]);
53                 return -1;
54         }
55 -       if (request_irq (pDev->nIrq[IFX_DYING_GASP], IFX_MEI_Dying_Gasp_IrqHandle, 0, "DYING_GASP", pDev) != 0) {
56 +       /*if (request_irq (pDev->nIrq[IFX_DYING_GASP], IFX_MEI_Dying_Gasp_IrqHandle, 0, "DYING_GASP", pDev) != 0) {
57                 IFX_MEI_EMSG ("request_irq %d failed!\n", pDev->nIrq[IFX_DYING_GASP]);
58                 return -1;
59 -       }
60 +       }*/
61  //     IFX_MEI_DMSG("Device %d initialized. IER %#x\n", num, bsp_get_irq_ier(pDev->nIrq[IFX_DYING_GASP]));
62         return 0;
63  }
64 @@ -2922,6 +2924,7 @@
65  IFX_MEI_ModuleInit (void)
66  {
67         int i = 0;
68 +       static struct class *dsl_class;
69  
70         printk ("IFX MEI Version %ld.%02ld.%02ld", bsp_mei_version.major, bsp_mei_version.minor, bsp_mei_version.revision);
71  
72 @@ -2935,14 +2938,15 @@
73                 IFX_MEI_InitProcFS (i);
74  #endif
75         }
76 -        for (i = 0; i <= DSL_BSP_CB_LAST ; i++)
77 +               for (i = 0; i <= DSL_BSP_CB_LAST ; i++)
78                 dsl_bsp_event_callback[i].function = NULL;
79  
80  #ifdef CONFIG_IFXMIPS_MEI_FW_LOOPBACK
81         printk(KERN_INFO "[%s %s %d]: Start loopback test...\n", __FILE__, __func__, __LINE__);
82         DFE_Loopback_Test ();
83  #endif
84 -
85 +       dsl_class = class_create(THIS_MODULE, "ifx_mei");
86 +       device_create(dsl_class, NULL, MKDEV(MEI_MAJOR, 0), NULL, "ifx_mei");
87         return 0;
88  }
89  
90 @@ -2996,3 +3000,5 @@
91  
92  module_init (IFX_MEI_ModuleInit);
93  module_exit (IFX_MEI_ModuleExit);
94 +
95 +MODULE_LICENSE("Dual BSD/GPL");