sh: rework ipr code
[linux-2.6.git] / arch / sh / kernel / cpu / sh4a / setup-sh7722.c
index fa07fab..a3e159e 100644 (file)
@@ -44,7 +44,7 @@ static int __init sh7722_devices_setup(void)
 }
 __initcall(sh7722_devices_setup);
 
-static struct ipr_data sh7722_ipr_map[] = {
+static struct ipr_data ipr_irq_table[] = {
        /* IRQ, IPR-idx, shift, prio */
        { 16, 0, 12, 2 }, /* TMU0 */
        { 17, 0,  8, 2 }, /* TMU1 */
@@ -69,16 +69,21 @@ static unsigned long ipr_offsets[] = {
        0xa408002c, /* 11: IPRL */
 };
 
-unsigned int map_ipridx_to_addr(int idx)
-{
-       if (unlikely(idx >= ARRAY_SIZE(ipr_offsets)))
-               return 0;
-       return ipr_offsets[idx];
-}
+static struct ipr_desc ipr_irq_desc = {
+       .ipr_offsets    = ipr_offsets,
+       .nr_offsets     = ARRAY_SIZE(ipr_offsets),
+
+       .ipr_data       = ipr_irq_table,
+       .nr_irqs        = ARRAY_SIZE(ipr_irq_table),
+
+       .chip = {
+               .name   = "IPR-sh7722",
+       },
+};
 
 void __init init_IRQ_ipr(void)
 {
-       make_ipr_irq(sh7722_ipr_map, ARRAY_SIZE(sh7722_ipr_map));
+       register_ipr_controller(&ipr_irq_desc);
 }
 
 void __init plat_mem_setup(void)