diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/irq.h | 82 | ||||
| -rw-r--r-- | include/linux/irqdesc.h | 3 | ||||
| -rw-r--r-- | include/linux/irqdomain.h | 8 | ||||
| -rw-r--r-- | include/linux/platform_data/irq-renesas-irqc.h | 27 |
4 files changed, 66 insertions, 54 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h index 48cb7d1aa58f..812149160d3b 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
| @@ -126,13 +126,21 @@ struct msi_desc; | |||
| 126 | struct irq_domain; | 126 | struct irq_domain; |
| 127 | 127 | ||
| 128 | /** | 128 | /** |
| 129 | * struct irq_data - per irq and irq chip data passed down to chip functions | 129 | * struct irq_common_data - per irq data shared by all irqchips |
| 130 | * @state_use_accessors: status information for irq chip functions. | ||
| 131 | * Use accessor functions to deal with it | ||
| 132 | */ | ||
| 133 | struct irq_common_data { | ||
| 134 | unsigned int state_use_accessors; | ||
| 135 | }; | ||
| 136 | |||
| 137 | /** | ||
| 138 | * struct irq_data - per irq chip data passed down to chip functions | ||
| 130 | * @mask: precomputed bitmask for accessing the chip registers | 139 | * @mask: precomputed bitmask for accessing the chip registers |
| 131 | * @irq: interrupt number | 140 | * @irq: interrupt number |
| 132 | * @hwirq: hardware interrupt number, local to the interrupt domain | 141 | * @hwirq: hardware interrupt number, local to the interrupt domain |
| 133 | * @node: node index useful for balancing | 142 | * @node: node index useful for balancing |
| 134 | * @state_use_accessors: status information for irq chip functions. | 143 | * @common: point to data shared by all irqchips |
| 135 | * Use accessor functions to deal with it | ||
| 136 | * @chip: low level interrupt hardware access | 144 | * @chip: low level interrupt hardware access |
| 137 | * @domain: Interrupt translation domain; responsible for mapping | 145 | * @domain: Interrupt translation domain; responsible for mapping |
| 138 | * between hwirq number and linux irq number. | 146 | * between hwirq number and linux irq number. |
| @@ -153,7 +161,7 @@ struct irq_data { | |||
| 153 | unsigned int irq; | 161 | unsigned int irq; |
| 154 | unsigned long hwirq; | 162 | unsigned long hwirq; |
| 155 | unsigned int node; | 163 | unsigned int node; |
| 156 | unsigned int state_use_accessors; | 164 | struct irq_common_data *common; |
| 157 | struct irq_chip *chip; | 165 | struct irq_chip *chip; |
| 158 | struct irq_domain *domain; | 166 | struct irq_domain *domain; |
| 159 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY | 167 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY |
| @@ -166,7 +174,7 @@ struct irq_data { | |||
| 166 | }; | 174 | }; |
| 167 | 175 | ||
| 168 | /* | 176 | /* |
| 169 | * Bit masks for irq_data.state | 177 | * Bit masks for irq_common_data.state_use_accessors |
| 170 | * | 178 | * |
| 171 | * IRQD_TRIGGER_MASK - Mask for the trigger type bits | 179 | * IRQD_TRIGGER_MASK - Mask for the trigger type bits |
| 172 | * IRQD_SETAFFINITY_PENDING - Affinity setting is pending | 180 | * IRQD_SETAFFINITY_PENDING - Affinity setting is pending |
| @@ -198,34 +206,36 @@ enum { | |||
| 198 | IRQD_WAKEUP_ARMED = (1 << 19), | 206 | IRQD_WAKEUP_ARMED = (1 << 19), |
| 199 | }; | 207 | }; |
| 200 | 208 | ||
| 209 | #define __irqd_to_state(d) ((d)->common->state_use_accessors) | ||
| 210 | |||
| 201 | static inline bool irqd_is_setaffinity_pending(struct irq_data *d) | 211 | static inline bool irqd_is_setaffinity_pending(struct irq_data *d) |
| 202 | { | 212 | { |
| 203 | return d->state_use_accessors & IRQD_SETAFFINITY_PENDING; | 213 | return __irqd_to_state(d) & IRQD_SETAFFINITY_PENDING; |
| 204 | } | 214 | } |
| 205 | 215 | ||
| 206 | static inline bool irqd_is_per_cpu(struct irq_data *d) | 216 | static inline bool irqd_is_per_cpu(struct irq_data *d) |
| 207 | { | 217 | { |
| 208 | return d->state_use_accessors & IRQD_PER_CPU; | 218 | return __irqd_to_state(d) & IRQD_PER_CPU; |
| 209 | } | 219 | } |
| 210 | 220 | ||
| 211 | static inline bool irqd_can_balance(struct irq_data *d) | 221 | static inline bool irqd_can_balance(struct irq_data *d) |
| 212 | { | 222 | { |
| 213 | return !(d->state_use_accessors & (IRQD_PER_CPU | IRQD_NO_BALANCING)); | 223 | return !(__irqd_to_state(d) & (IRQD_PER_CPU | IRQD_NO_BALANCING)); |
| 214 | } | 224 | } |
| 215 | 225 | ||
| 216 | static inline bool irqd_affinity_was_set(struct irq_data *d) | 226 | static inline bool irqd_affinity_was_set(struct irq_data *d) |
| 217 | { | 227 | { |
| 218 | return d->state_use_accessors & IRQD_AFFINITY_SET; | 228 | return __irqd_to_state(d) & IRQD_AFFINITY_SET; |
| 219 | } | 229 | } |
| 220 | 230 | ||
| 221 | static inline void irqd_mark_affinity_was_set(struct irq_data *d) | 231 | static inline void irqd_mark_affinity_was_set(struct irq_data *d) |
| 222 | { | 232 | { |
| 223 | d->state_use_accessors |= IRQD_AFFINITY_SET; | 233 | __irqd_to_state(d) |= IRQD_AFFINITY_SET; |
| 224 | } | 234 | } |
| 225 | 235 | ||
| 226 | static inline u32 irqd_get_trigger_type(struct irq_data *d) | 236 | static inline u32 irqd_get_trigger_type(struct irq_data *d) |
| 227 | { | 237 | { |
| 228 | return d->state_use_accessors & IRQD_TRIGGER_MASK; | 238 | return __irqd_to_state(d) & IRQD_TRIGGER_MASK; |
| 229 | } | 239 | } |
| 230 | 240 | ||
| 231 | /* | 241 | /* |
| @@ -233,43 +243,43 @@ static inline u32 irqd_get_trigger_type(struct irq_data *d) | |||
| 233 | */ | 243 | */ |
| 234 | static inline void irqd_set_trigger_type(struct irq_data *d, u32 type) | 244 | static inline void irqd_set_trigger_type(struct irq_data *d, u32 type) |
| 235 | { | 245 | { |
| 236 | d->state_use_accessors &= ~IRQD_TRIGGER_MASK; | 246 | __irqd_to_state(d) &= ~IRQD_TRIGGER_MASK; |
| 237 | d->state_use_accessors |= type & IRQD_TRIGGER_MASK; | 247 | __irqd_to_state(d) |= type & IRQD_TRIGGER_MASK; |
| 238 | } | 248 | } |
| 239 | 249 | ||
| 240 | static inline bool irqd_is_level_type(struct irq_data *d) | 250 | static inline bool irqd_is_level_type(struct irq_data *d) |
| 241 | { | 251 | { |
| 242 | return d->state_use_accessors & IRQD_LEVEL; | 252 | return __irqd_to_state(d) & IRQD_LEVEL; |
| 243 | } | 253 | } |
| 244 | 254 | ||
| 245 | static inline bool irqd_is_wakeup_set(struct irq_data *d) | 255 | static inline bool irqd_is_wakeup_set(struct irq_data *d) |
| 246 | { | 256 | { |
| 247 | return d->state_use_accessors & IRQD_WAKEUP_STATE; | 257 | return __irqd_to_state(d) & IRQD_WAKEUP_STATE; |
| 248 | } | 258 | } |
| 249 | 259 | ||
| 250 | static inline bool irqd_can_move_in_process_context(struct irq_data *d) | 260 | static inline bool irqd_can_move_in_process_context(struct irq_data *d) |
| 251 | { | 261 | { |
| 252 | return d->state_use_accessors & IRQD_MOVE_PCNTXT; | 262 | return __irqd_to_state(d) & IRQD_MOVE_PCNTXT; |
| 253 | } | 263 | } |
| 254 | 264 | ||
| 255 | static inline bool irqd_irq_disabled(struct irq_data *d) | 265 | static inline bool irqd_irq_disabled(struct irq_data *d) |
| 256 | { | 266 | { |
| 257 | return d->state_use_accessors & IRQD_IRQ_DISABLED; | 267 | return __irqd_to_state(d) & IRQD_IRQ_DISABLED; |
| 258 | } | 268 | } |
| 259 | 269 | ||
| 260 | static inline bool irqd_irq_masked(struct irq_data *d) | 270 | static inline bool irqd_irq_masked(struct irq_data *d) |
| 261 | { | 271 | { |
| 262 | return d->state_use_accessors & IRQD_IRQ_MASKED; | 272 | return __irqd_to_state(d) & IRQD_IRQ_MASKED; |
| 263 | } | 273 | } |
| 264 | 274 | ||
| 265 | static inline bool irqd_irq_inprogress(struct irq_data *d) | 275 | static inline bool irqd_irq_inprogress(struct irq_data *d) |
| 266 | { | 276 | { |
| 267 | return d->state_use_accessors & IRQD_IRQ_INPROGRESS; | 277 | return __irqd_to_state(d) & IRQD_IRQ_INPROGRESS; |
| 268 | } | 278 | } |
| 269 | 279 | ||
| 270 | static inline bool irqd_is_wakeup_armed(struct irq_data *d) | 280 | static inline bool irqd_is_wakeup_armed(struct irq_data *d) |
| 271 | { | 281 | { |
| 272 | return d->state_use_accessors & IRQD_WAKEUP_ARMED; | 282 | return __irqd_to_state(d) & IRQD_WAKEUP_ARMED; |
| 273 | } | 283 | } |
| 274 | 284 | ||
| 275 | 285 | ||
| @@ -280,12 +290,12 @@ static inline bool irqd_is_wakeup_armed(struct irq_data *d) | |||
| 280 | */ | 290 | */ |
| 281 | static inline void irqd_set_chained_irq_inprogress(struct irq_data *d) | 291 | static inline void irqd_set_chained_irq_inprogress(struct irq_data *d) |
| 282 | { | 292 | { |
| 283 | d->state_use_accessors |= IRQD_IRQ_INPROGRESS; | 293 | __irqd_to_state(d) |= IRQD_IRQ_INPROGRESS; |
| 284 | } | 294 | } |
| 285 | 295 | ||
| 286 | static inline void irqd_clr_chained_irq_inprogress(struct irq_data *d) | 296 | static inline void irqd_clr_chained_irq_inprogress(struct irq_data *d) |
| 287 | { | 297 | { |
| 288 | d->state_use_accessors &= ~IRQD_IRQ_INPROGRESS; | 298 | __irqd_to_state(d) &= ~IRQD_IRQ_INPROGRESS; |
| 289 | } | 299 | } |
| 290 | 300 | ||
| 291 | static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) | 301 | static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) |
| @@ -462,6 +472,8 @@ extern void handle_nested_irq(unsigned int irq); | |||
| 462 | 472 | ||
| 463 | extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg); | 473 | extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg); |
| 464 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY | 474 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY |
| 475 | extern void irq_chip_enable_parent(struct irq_data *data); | ||
| 476 | extern void irq_chip_disable_parent(struct irq_data *data); | ||
| 465 | extern void irq_chip_ack_parent(struct irq_data *data); | 477 | extern void irq_chip_ack_parent(struct irq_data *data); |
| 466 | extern int irq_chip_retrigger_hierarchy(struct irq_data *data); | 478 | extern int irq_chip_retrigger_hierarchy(struct irq_data *data); |
| 467 | extern void irq_chip_mask_parent(struct irq_data *data); | 479 | extern void irq_chip_mask_parent(struct irq_data *data); |
| @@ -523,6 +535,15 @@ irq_set_chained_handler(unsigned int irq, irq_flow_handler_t handle) | |||
| 523 | __irq_set_handler(irq, handle, 1, NULL); | 535 | __irq_set_handler(irq, handle, 1, NULL); |
| 524 | } | 536 | } |
| 525 | 537 | ||
| 538 | /* | ||
| 539 | * Set a highlevel chained flow handler and its data for a given IRQ. | ||
| 540 | * (a chained handler is automatically enabled and set to | ||
| 541 | * IRQ_NOREQUEST, IRQ_NOPROBE, and IRQ_NOTHREAD) | ||
| 542 | */ | ||
| 543 | void | ||
| 544 | irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle, | ||
| 545 | void *data); | ||
| 546 | |||
| 526 | void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set); | 547 | void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set); |
| 527 | 548 | ||
| 528 | static inline void irq_set_status_flags(unsigned int irq, unsigned long set) | 549 | static inline void irq_set_status_flags(unsigned int irq, unsigned long set) |
| @@ -630,6 +651,23 @@ static inline u32 irq_get_trigger_type(unsigned int irq) | |||
| 630 | return d ? irqd_get_trigger_type(d) : 0; | 651 | return d ? irqd_get_trigger_type(d) : 0; |
| 631 | } | 652 | } |
| 632 | 653 | ||
| 654 | static inline int irq_data_get_node(struct irq_data *d) | ||
| 655 | { | ||
| 656 | return d->node; | ||
| 657 | } | ||
| 658 | |||
| 659 | static inline struct cpumask *irq_get_affinity_mask(int irq) | ||
| 660 | { | ||
| 661 | struct irq_data *d = irq_get_irq_data(irq); | ||
| 662 | |||
| 663 | return d ? d->affinity : NULL; | ||
| 664 | } | ||
| 665 | |||
| 666 | static inline struct cpumask *irq_data_get_affinity_mask(struct irq_data *d) | ||
| 667 | { | ||
| 668 | return d->affinity; | ||
| 669 | } | ||
| 670 | |||
| 633 | unsigned int arch_dynirq_lower_bound(unsigned int from); | 671 | unsigned int arch_dynirq_lower_bound(unsigned int from); |
| 634 | 672 | ||
| 635 | int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, | 673 | int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, |
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index a113a8dc7438..c52d1480f272 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
| @@ -17,7 +17,7 @@ struct pt_regs; | |||
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| 19 | * struct irq_desc - interrupt descriptor | 19 | * struct irq_desc - interrupt descriptor |
| 20 | * @irq_data: per irq and chip data passed down to chip functions | 20 | * @irq_common_data: per irq and chip data passed down to chip functions |
| 21 | * @kstat_irqs: irq stats per cpu | 21 | * @kstat_irqs: irq stats per cpu |
| 22 | * @handle_irq: highlevel irq-events handler | 22 | * @handle_irq: highlevel irq-events handler |
| 23 | * @preflow_handler: handler called before the flow handler (currently used by sparc) | 23 | * @preflow_handler: handler called before the flow handler (currently used by sparc) |
| @@ -47,6 +47,7 @@ struct pt_regs; | |||
| 47 | * @name: flow handler name for /proc/interrupts output | 47 | * @name: flow handler name for /proc/interrupts output |
| 48 | */ | 48 | */ |
| 49 | struct irq_desc { | 49 | struct irq_desc { |
| 50 | struct irq_common_data irq_common_data; | ||
| 50 | struct irq_data irq_data; | 51 | struct irq_data irq_data; |
| 51 | unsigned int __percpu *kstat_irqs; | 52 | unsigned int __percpu *kstat_irqs; |
| 52 | irq_flow_handler_t handle_irq; | 53 | irq_flow_handler_t handle_irq; |
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 676d7306a360..744ac0ec98eb 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h | |||
| @@ -258,6 +258,10 @@ int irq_domain_xlate_onetwocell(struct irq_domain *d, struct device_node *ctrlr, | |||
| 258 | /* V2 interfaces to support hierarchy IRQ domains. */ | 258 | /* V2 interfaces to support hierarchy IRQ domains. */ |
| 259 | extern struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain, | 259 | extern struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain, |
| 260 | unsigned int virq); | 260 | unsigned int virq); |
| 261 | extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, | ||
| 262 | irq_hw_number_t hwirq, struct irq_chip *chip, | ||
| 263 | void *chip_data, irq_flow_handler_t handler, | ||
| 264 | void *handler_data, const char *handler_name); | ||
| 261 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY | 265 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY |
| 262 | extern struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent, | 266 | extern struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent, |
| 263 | unsigned int flags, unsigned int size, | 267 | unsigned int flags, unsigned int size, |
| @@ -281,10 +285,6 @@ extern int irq_domain_set_hwirq_and_chip(struct irq_domain *domain, | |||
| 281 | irq_hw_number_t hwirq, | 285 | irq_hw_number_t hwirq, |
| 282 | struct irq_chip *chip, | 286 | struct irq_chip *chip, |
| 283 | void *chip_data); | 287 | void *chip_data); |
| 284 | extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, | ||
| 285 | irq_hw_number_t hwirq, struct irq_chip *chip, | ||
| 286 | void *chip_data, irq_flow_handler_t handler, | ||
| 287 | void *handler_data, const char *handler_name); | ||
| 288 | extern void irq_domain_reset_irq_data(struct irq_data *irq_data); | 288 | extern void irq_domain_reset_irq_data(struct irq_data *irq_data); |
| 289 | extern void irq_domain_free_irqs_common(struct irq_domain *domain, | 289 | extern void irq_domain_free_irqs_common(struct irq_domain *domain, |
| 290 | unsigned int virq, | 290 | unsigned int virq, |
diff --git a/include/linux/platform_data/irq-renesas-irqc.h b/include/linux/platform_data/irq-renesas-irqc.h deleted file mode 100644 index 3ae17b3e00ed..000000000000 --- a/include/linux/platform_data/irq-renesas-irqc.h +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Renesas IRQC Driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Magnus Damm | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __IRQ_RENESAS_IRQC_H__ | ||
| 21 | #define __IRQ_RENESAS_IRQC_H__ | ||
| 22 | |||
| 23 | struct renesas_irqc_config { | ||
| 24 | unsigned int irq_base; | ||
| 25 | }; | ||
| 26 | |||
| 27 | #endif /* __IRQ_RENESAS_IRQC_H__ */ | ||
