chip.c (fe200ae48ef5c79bf7941fe8046ff9505c570ff6) | chip.c (4699923861513671d3f6ade8efb4e56a9a7ecadf) |
---|---|
1/* 2 * linux/kernel/irq/chip.c 3 * 4 * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar 5 * Copyright (C) 2005-2006, Thomas Gleixner, Russell King 6 * 7 * This file contains the core interrupt handling code, for irq-chip 8 * based architectures. --- 178 unchanged lines hidden (view full) --- 187 if (nest) 188 desc->status |= IRQ_NESTED_THREAD; 189 else 190 desc->status &= ~IRQ_NESTED_THREAD; 191 raw_spin_unlock_irqrestore(&desc->lock, flags); 192} 193EXPORT_SYMBOL_GPL(set_irq_nested_thread); 194 | 1/* 2 * linux/kernel/irq/chip.c 3 * 4 * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar 5 * Copyright (C) 2005-2006, Thomas Gleixner, Russell King 6 * 7 * This file contains the core interrupt handling code, for irq-chip 8 * based architectures. --- 178 unchanged lines hidden (view full) --- 187 if (nest) 188 desc->status |= IRQ_NESTED_THREAD; 189 else 190 desc->status &= ~IRQ_NESTED_THREAD; 191 raw_spin_unlock_irqrestore(&desc->lock, flags); 192} 193EXPORT_SYMBOL_GPL(set_irq_nested_thread); 194 |
195int irq_startup(struct irq_desc *desc) 196{ 197 desc->status &= ~(IRQ_MASKED | IRQ_DISABLED); 198 desc->depth = 0; 199 200 if (desc->irq_data.chip->irq_startup) 201 return desc->irq_data.chip->irq_startup(&desc->irq_data); 202 203 desc->irq_data.chip->irq_enable(&desc->irq_data); 204 return 0; 205} 206 207void irq_shutdown(struct irq_desc *desc) 208{ 209 desc->status |= IRQ_MASKED | IRQ_DISABLED; 210 desc->depth = 1; 211 desc->irq_data.chip->irq_shutdown(&desc->irq_data); 212} 213 |
|
195/* 196 * default enable function 197 */ 198static void default_enable(struct irq_data *data) 199{ 200 struct irq_desc *desc = irq_data_to_desc(data); 201 202 desc->irq_data.chip->irq_unmask(&desc->irq_data); 203 desc->status &= ~IRQ_MASKED; 204} 205 206/* 207 * default disable function 208 */ 209static void default_disable(struct irq_data *data) 210{ 211} 212 213/* | 214/* 215 * default enable function 216 */ 217static void default_enable(struct irq_data *data) 218{ 219 struct irq_desc *desc = irq_data_to_desc(data); 220 221 desc->irq_data.chip->irq_unmask(&desc->irq_data); 222 desc->status &= ~IRQ_MASKED; 223} 224 225/* 226 * default disable function 227 */ 228static void default_disable(struct irq_data *data) 229{ 230} 231 232/* |
214 * default startup function 215 */ 216static unsigned int default_startup(struct irq_data *data) 217{ 218 struct irq_desc *desc = irq_data_to_desc(data); 219 220 desc->irq_data.chip->irq_enable(data); 221 return 0; 222} 223 224/* | |
225 * default shutdown function 226 */ 227static void default_shutdown(struct irq_data *data) 228{ 229 struct irq_desc *desc = irq_data_to_desc(data); 230 231 desc->irq_data.chip->irq_mask(&desc->irq_data); | 233 * default shutdown function 234 */ 235static void default_shutdown(struct irq_data *data) 236{ 237 struct irq_desc *desc = irq_data_to_desc(data); 238 239 desc->irq_data.chip->irq_mask(&desc->irq_data); |
232 desc->status |= IRQ_MASKED; | |
233} 234 235#ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED 236/* Temporary migration helpers */ 237static void compat_irq_mask(struct irq_data *data) 238{ 239 data->chip->mask(data->irq); 240} --- 91 unchanged lines hidden (view full) --- 332#endif 333 /* 334 * The real defaults 335 */ 336 if (!chip->irq_enable) 337 chip->irq_enable = default_enable; 338 if (!chip->irq_disable) 339 chip->irq_disable = default_disable; | 240} 241 242#ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED 243/* Temporary migration helpers */ 244static void compat_irq_mask(struct irq_data *data) 245{ 246 data->chip->mask(data->irq); 247} --- 91 unchanged lines hidden (view full) --- 339#endif 340 /* 341 * The real defaults 342 */ 343 if (!chip->irq_enable) 344 chip->irq_enable = default_enable; 345 if (!chip->irq_disable) 346 chip->irq_disable = default_disable; |
340 if (!chip->irq_startup) 341 chip->irq_startup = default_startup; | |
342 /* 343 * We use chip->irq_disable, when the user provided its own. When 344 * we have default_disable set for chip->irq_disable, then we need 345 * to use default_shutdown, otherwise the irq line is not 346 * disabled on free_irq(): 347 */ 348 if (!chip->irq_shutdown) 349 chip->irq_shutdown = chip->irq_disable != default_disable ? --- 392 unchanged lines hidden (view full) --- 742 mask_ack_irq(desc); 743 desc->status |= IRQ_DISABLED; 744 desc->depth = 1; 745 } 746 desc->handle_irq = handle; 747 desc->name = name; 748 749 if (handle != handle_bad_irq && is_chained) { | 347 /* 348 * We use chip->irq_disable, when the user provided its own. When 349 * we have default_disable set for chip->irq_disable, then we need 350 * to use default_shutdown, otherwise the irq line is not 351 * disabled on free_irq(): 352 */ 353 if (!chip->irq_shutdown) 354 chip->irq_shutdown = chip->irq_disable != default_disable ? --- 392 unchanged lines hidden (view full) --- 747 mask_ack_irq(desc); 748 desc->status |= IRQ_DISABLED; 749 desc->depth = 1; 750 } 751 desc->handle_irq = handle; 752 desc->name = name; 753 754 if (handle != handle_bad_irq && is_chained) { |
750 desc->status &= ~IRQ_DISABLED; | |
751 desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE; | 755 desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE; |
752 desc->depth = 0; 753 desc->irq_data.chip->irq_startup(&desc->irq_data); | 756 irq_startup(desc); |
754 } 755 raw_spin_unlock_irqrestore(&desc->lock, flags); 756 chip_bus_sync_unlock(desc); 757} 758EXPORT_SYMBOL_GPL(__set_irq_handler); 759 760void 761set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip, --- 31 unchanged lines hidden --- | 757 } 758 raw_spin_unlock_irqrestore(&desc->lock, flags); 759 chip_bus_sync_unlock(desc); 760} 761EXPORT_SYMBOL_GPL(__set_irq_handler); 762 763void 764set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip, --- 31 unchanged lines hidden --- |