sh: rework ipr code
[pandora-kernel.git] / arch / sh / kernel / cpu / sh4 / setup-sh7760.c
index 6d3c918..3df1697 100644 (file)
@@ -109,7 +109,12 @@ static struct intc2_desc intc2_irq_desc __read_mostly = {
        },
 };
 
-static struct ipr_data sh7760_ipr_map[] = {
+void __init init_IRQ_intc2(void)
+{
+       register_intc2_controller(&intc2_irq_desc);
+}
+
+static struct ipr_data ipr_irq_table[] = {
        /* IRQ, IPR-idx, shift, priority */
        { 16, 0, 12, 2 }, /* TMU0 TUNI*/
        { 17, 0,  8, 2 }, /* TMU1 TUNI */
@@ -146,20 +151,19 @@ static unsigned long ipr_offsets[] = {
        0xffd00010UL,   /* 3: IPRD */
 };
 
-/* given the IPR index return the address of the IPR register */
-unsigned int map_ipridx_to_addr(int idx)
-{
-       if (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),
 
-void __init init_IRQ_intc2(void)
-{
-       register_intc2_controller(&intc2_irq_desc);
-}
+       .ipr_data       = ipr_irq_table,
+       .nr_irqs        = ARRAY_SIZE(ipr_irq_table),
+
+       .chip = {
+               .name   = "IPR-sh7760",
+       },
+};
 
-void __init  init_IRQ_ipr(void)
+void __init init_IRQ_ipr(void)
 {
-       make_ipr_irq(sh7760_ipr_map, ARRAY_SIZE(sh7760_ipr_map));
+       register_ipr_controller(&ipr_irq_desc);
 }