Commit 3a0adfab authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by Benjamin Herrenschmidt

powerpc: sysdev/qe_lib/qe_ic irq_data conversion.

Signed-off-by: default avatarLennert Buytenhek <buytenh@secretlab.ca>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 41f3863b
...@@ -81,7 +81,7 @@ int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high); ...@@ -81,7 +81,7 @@ int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high);
static inline void qe_ic_cascade_low_ipic(unsigned int irq, static inline void qe_ic_cascade_low_ipic(unsigned int irq,
struct irq_desc *desc) struct irq_desc *desc)
{ {
struct qe_ic *qe_ic = desc->handler_data; struct qe_ic *qe_ic = get_irq_desc_data(desc);
unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
if (cascade_irq != NO_IRQ) if (cascade_irq != NO_IRQ)
...@@ -91,7 +91,7 @@ static inline void qe_ic_cascade_low_ipic(unsigned int irq, ...@@ -91,7 +91,7 @@ static inline void qe_ic_cascade_low_ipic(unsigned int irq,
static inline void qe_ic_cascade_high_ipic(unsigned int irq, static inline void qe_ic_cascade_high_ipic(unsigned int irq,
struct irq_desc *desc) struct irq_desc *desc)
{ {
struct qe_ic *qe_ic = desc->handler_data; struct qe_ic *qe_ic = get_irq_desc_data(desc);
unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
if (cascade_irq != NO_IRQ) if (cascade_irq != NO_IRQ)
...@@ -101,32 +101,35 @@ static inline void qe_ic_cascade_high_ipic(unsigned int irq, ...@@ -101,32 +101,35 @@ static inline void qe_ic_cascade_high_ipic(unsigned int irq,
static inline void qe_ic_cascade_low_mpic(unsigned int irq, static inline void qe_ic_cascade_low_mpic(unsigned int irq,
struct irq_desc *desc) struct irq_desc *desc)
{ {
struct qe_ic *qe_ic = desc->handler_data; struct qe_ic *qe_ic = get_irq_desc_data(desc);
unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
struct irq_chip *chip = get_irq_desc_chip(desc);
if (cascade_irq != NO_IRQ) if (cascade_irq != NO_IRQ)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
desc->chip->eoi(irq); chip->irq_eoi(&desc->irq_data);
} }
static inline void qe_ic_cascade_high_mpic(unsigned int irq, static inline void qe_ic_cascade_high_mpic(unsigned int irq,
struct irq_desc *desc) struct irq_desc *desc)
{ {
struct qe_ic *qe_ic = desc->handler_data; struct qe_ic *qe_ic = get_irq_desc_data(desc);
unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
struct irq_chip *chip = get_irq_desc_chip(desc);
if (cascade_irq != NO_IRQ) if (cascade_irq != NO_IRQ)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
desc->chip->eoi(irq); chip->irq_eoi(&desc->irq_data);
} }
static inline void qe_ic_cascade_muxed_mpic(unsigned int irq, static inline void qe_ic_cascade_muxed_mpic(unsigned int irq,
struct irq_desc *desc) struct irq_desc *desc)
{ {
struct qe_ic *qe_ic = desc->handler_data; struct qe_ic *qe_ic = get_irq_desc_data(desc);
unsigned int cascade_irq; unsigned int cascade_irq;
struct irq_chip *chip = get_irq_desc_chip(desc);
cascade_irq = qe_ic_get_high_irq(qe_ic); cascade_irq = qe_ic_get_high_irq(qe_ic);
if (cascade_irq == NO_IRQ) if (cascade_irq == NO_IRQ)
...@@ -135,7 +138,7 @@ static inline void qe_ic_cascade_muxed_mpic(unsigned int irq, ...@@ -135,7 +138,7 @@ static inline void qe_ic_cascade_muxed_mpic(unsigned int irq,
if (cascade_irq != NO_IRQ) if (cascade_irq != NO_IRQ)
generic_handle_irq(cascade_irq); generic_handle_irq(cascade_irq);
desc->chip->eoi(irq); chip->irq_eoi(&desc->irq_data);
} }
#endif /* _ASM_POWERPC_QE_IC_H */ #endif /* _ASM_POWERPC_QE_IC_H */
...@@ -189,15 +189,20 @@ static inline void qe_ic_write(volatile __be32 __iomem * base, unsigned int reg ...@@ -189,15 +189,20 @@ static inline void qe_ic_write(volatile __be32 __iomem * base, unsigned int reg
static inline struct qe_ic *qe_ic_from_irq(unsigned int virq) static inline struct qe_ic *qe_ic_from_irq(unsigned int virq)
{ {
return irq_to_desc(virq)->chip_data; return get_irq_chip_data(virq);
}
static inline struct qe_ic *qe_ic_from_irq_data(struct irq_data *d)
{
return irq_data_get_irq_chip_data(d);
} }
#define virq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq) #define virq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq)
static void qe_ic_unmask_irq(unsigned int virq) static void qe_ic_unmask_irq(struct irq_data *d)
{ {
struct qe_ic *qe_ic = qe_ic_from_irq(virq); struct qe_ic *qe_ic = qe_ic_from_irq_data(d);
unsigned int src = virq_to_hw(virq); unsigned int src = virq_to_hw(d->irq);
unsigned long flags; unsigned long flags;
u32 temp; u32 temp;
...@@ -210,10 +215,10 @@ static void qe_ic_unmask_irq(unsigned int virq) ...@@ -210,10 +215,10 @@ static void qe_ic_unmask_irq(unsigned int virq)
raw_spin_unlock_irqrestore(&qe_ic_lock, flags); raw_spin_unlock_irqrestore(&qe_ic_lock, flags);
} }
static void qe_ic_mask_irq(unsigned int virq) static void qe_ic_mask_irq(struct irq_data *d)
{ {
struct qe_ic *qe_ic = qe_ic_from_irq(virq); struct qe_ic *qe_ic = qe_ic_from_irq_data(d);
unsigned int src = virq_to_hw(virq); unsigned int src = virq_to_hw(d->irq);
unsigned long flags; unsigned long flags;
u32 temp; u32 temp;
...@@ -238,9 +243,9 @@ static void qe_ic_mask_irq(unsigned int virq) ...@@ -238,9 +243,9 @@ static void qe_ic_mask_irq(unsigned int virq)
static struct irq_chip qe_ic_irq_chip = { static struct irq_chip qe_ic_irq_chip = {
.name = "QEIC", .name = "QEIC",
.unmask = qe_ic_unmask_irq, .irq_unmask = qe_ic_unmask_irq,
.mask = qe_ic_mask_irq, .irq_mask = qe_ic_mask_irq,
.mask_ack = qe_ic_mask_irq, .irq_mask_ack = qe_ic_mask_irq,
}; };
static int qe_ic_host_match(struct irq_host *h, struct device_node *node) static int qe_ic_host_match(struct irq_host *h, struct device_node *node)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment