diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-10-27 01:41:39 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-10-27 01:41:39 -0400 |
commit | 8df3a615da1a9fee6c3e0dc561e56a499072213f (patch) | |
tree | a393a8e45c7ad43a9de69de0c44151207e46ce8a /arch/sh/kernel | |
parent | 0d338071f2fff7551f9afe22016d9b34b45900b5 (diff) |
sh: IPR IRQs irq_data conversion.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r-- | arch/sh/kernel/cpu/irq/ipr.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c index a4a9906e12d0..7516c35ee514 100644 --- a/arch/sh/kernel/cpu/irq/ipr.c +++ b/arch/sh/kernel/cpu/irq/ipr.c | |||
@@ -24,25 +24,25 @@ | |||
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
25 | #include <linux/topology.h> | 25 | #include <linux/topology.h> |
26 | 26 | ||
27 | static inline struct ipr_desc *get_ipr_desc(unsigned int irq) | 27 | static inline struct ipr_desc *get_ipr_desc(struct irq_data *data) |
28 | { | 28 | { |
29 | struct irq_chip *chip = get_irq_chip(irq); | 29 | struct irq_chip *chip = irq_data_get_irq_chip(data); |
30 | return container_of(chip, struct ipr_desc, chip); | 30 | return container_of(chip, struct ipr_desc, chip); |
31 | } | 31 | } |
32 | 32 | ||
33 | static void disable_ipr_irq(unsigned int irq) | 33 | static void disable_ipr_irq(struct irq_data *data) |
34 | { | 34 | { |
35 | struct ipr_data *p = get_irq_chip_data(irq); | 35 | struct ipr_data *p = irq_data_get_irq_chip_data(data); |
36 | unsigned long addr = get_ipr_desc(irq)->ipr_offsets[p->ipr_idx]; | 36 | unsigned long addr = get_ipr_desc(data)->ipr_offsets[p->ipr_idx]; |
37 | /* Set the priority in IPR to 0 */ | 37 | /* Set the priority in IPR to 0 */ |
38 | __raw_writew(__raw_readw(addr) & (0xffff ^ (0xf << p->shift)), addr); | 38 | __raw_writew(__raw_readw(addr) & (0xffff ^ (0xf << p->shift)), addr); |
39 | (void)__raw_readw(addr); /* Read back to flush write posting */ | 39 | (void)__raw_readw(addr); /* Read back to flush write posting */ |
40 | } | 40 | } |
41 | 41 | ||
42 | static void enable_ipr_irq(unsigned int irq) | 42 | static void enable_ipr_irq(struct irq_data *data) |
43 | { | 43 | { |
44 | struct ipr_data *p = get_irq_chip_data(irq); | 44 | struct ipr_data *p = irq_data_get_irq_chip_data(data); |
45 | unsigned long addr = get_ipr_desc(irq)->ipr_offsets[p->ipr_idx]; | 45 | unsigned long addr = get_ipr_desc(data)->ipr_offsets[p->ipr_idx]; |
46 | /* Set priority in IPR back to original value */ | 46 | /* Set priority in IPR back to original value */ |
47 | __raw_writew(__raw_readw(addr) | (p->priority << p->shift), addr); | 47 | __raw_writew(__raw_readw(addr) | (p->priority << p->shift), addr); |
48 | } | 48 | } |
@@ -56,9 +56,8 @@ void register_ipr_controller(struct ipr_desc *desc) | |||
56 | { | 56 | { |
57 | int i; | 57 | int i; |
58 | 58 | ||
59 | desc->chip.mask = disable_ipr_irq; | 59 | desc->chip.irq_mask = disable_ipr_irq; |
60 | desc->chip.unmask = enable_ipr_irq; | 60 | desc->chip.irq_unmask = enable_ipr_irq; |
61 | desc->chip.mask_ack = disable_ipr_irq; | ||
62 | 61 | ||
63 | for (i = 0; i < desc->nr_irqs; i++) { | 62 | for (i = 0; i < desc->nr_irqs; i++) { |
64 | struct ipr_data *p = desc->ipr_data + i; | 63 | struct ipr_data *p = desc->ipr_data + i; |
@@ -68,7 +67,7 @@ void register_ipr_controller(struct ipr_desc *desc) | |||
68 | BUG_ON(!desc->ipr_offsets[p->ipr_idx]); | 67 | BUG_ON(!desc->ipr_offsets[p->ipr_idx]); |
69 | 68 | ||
70 | res = irq_alloc_desc_at(p->irq, numa_node_id()); | 69 | res = irq_alloc_desc_at(p->irq, numa_node_id()); |
71 | if (unlikely(res != p->irq && res != -EEXIST)) | 70 | if (unlikely(res != p->irq && res != -EEXIST)) { |
72 | printk(KERN_INFO "can not get irq_desc for %d\n", | 71 | printk(KERN_INFO "can not get irq_desc for %d\n", |
73 | p->irq); | 72 | p->irq); |
74 | continue; | 73 | continue; |
@@ -78,7 +77,7 @@ void register_ipr_controller(struct ipr_desc *desc) | |||
78 | set_irq_chip_and_handler_name(p->irq, &desc->chip, | 77 | set_irq_chip_and_handler_name(p->irq, &desc->chip, |
79 | handle_level_irq, "level"); | 78 | handle_level_irq, "level"); |
80 | set_irq_chip_data(p->irq, p); | 79 | set_irq_chip_data(p->irq, p); |
81 | disable_ipr_irq(p->irq); | 80 | disable_ipr_irq(irq_get_irq_data(p->irq)); |
82 | } | 81 | } |
83 | } | 82 | } |
84 | EXPORT_SYMBOL(register_ipr_controller); | 83 | EXPORT_SYMBOL(register_ipr_controller); |