diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-12-01 13:05:16 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-12-05 18:52:10 -0500 |
commit | 023bba36387de704b3ea2a69bf9f9ed2301cfbcc (patch) | |
tree | 15bee8bfcdb11d793bf7e68bfad92506ee90df22 /Documentation/IRQ-domain.txt | |
parent | d202b7b970b2a21278505c2467919fd441a7b6c8 (diff) |
irqdomain: update documentation
This updates the IRQdomain documentation a bit, by adding a more
verbose explanation to why we need this, and by adding some
extended documentation of the irq_domain_simple() usecase.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'Documentation/IRQ-domain.txt')
-rw-r--r-- | Documentation/IRQ-domain.txt | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/Documentation/IRQ-domain.txt b/Documentation/IRQ-domain.txt index 1401cece745a..9bc95942ec22 100644 --- a/Documentation/IRQ-domain.txt +++ b/Documentation/IRQ-domain.txt | |||
@@ -7,6 +7,21 @@ systems with multiple interrupt controllers the kernel must ensure | |||
7 | that each one gets assigned non-overlapping allocations of Linux | 7 | that each one gets assigned non-overlapping allocations of Linux |
8 | IRQ numbers. | 8 | IRQ numbers. |
9 | 9 | ||
10 | The number of interrupt controllers registered as unique irqchips | ||
11 | show a rising tendency: for example subdrivers of different kinds | ||
12 | such as GPIO controllers avoid reimplementing identical callback | ||
13 | mechanisms as the IRQ core system by modelling their interrupt | ||
14 | handlers as irqchips, i.e. in effect cascading interrupt controllers. | ||
15 | |||
16 | Here the interrupt number loose all kind of correspondence to | ||
17 | hardware interrupt numbers: whereas in the past, IRQ numbers could | ||
18 | be chosen so they matched the hardware IRQ line into the root | ||
19 | interrupt controller (i.e. the component actually fireing the | ||
20 | interrupt line to the CPU) nowadays this number is just a number. | ||
21 | |||
22 | For this reason we need a mechanism to separate controller-local | ||
23 | interrupt numbers, called hardware irq's, from Linux IRQ numbers. | ||
24 | |||
10 | The irq_alloc_desc*() and irq_free_desc*() APIs provide allocation of | 25 | The irq_alloc_desc*() and irq_free_desc*() APIs provide allocation of |
11 | irq numbers, but they don't provide any support for reverse mapping of | 26 | irq numbers, but they don't provide any support for reverse mapping of |
12 | the controller-local IRQ (hwirq) number into the Linux IRQ number | 27 | the controller-local IRQ (hwirq) number into the Linux IRQ number |
@@ -40,6 +55,10 @@ required hardware setup. | |||
40 | When an interrupt is received, irq_find_mapping() function should | 55 | When an interrupt is received, irq_find_mapping() function should |
41 | be used to find the Linux IRQ number from the hwirq number. | 56 | be used to find the Linux IRQ number from the hwirq number. |
42 | 57 | ||
58 | The irq_create_mapping() function must be called *atleast once* | ||
59 | before any call to irq_find_mapping(), lest the descriptor will not | ||
60 | be allocated. | ||
61 | |||
43 | If the driver has the Linux IRQ number or the irq_data pointer, and | 62 | If the driver has the Linux IRQ number or the irq_data pointer, and |
44 | needs to know the associated hwirq number (such as in the irq_chip | 63 | needs to know the associated hwirq number (such as in the irq_chip |
45 | callbacks) then it can be directly obtained from irq_data->hwirq. | 64 | callbacks) then it can be directly obtained from irq_data->hwirq. |
@@ -119,4 +138,17 @@ numbers. | |||
119 | 138 | ||
120 | Most users of legacy mappings should use irq_domain_add_simple() which | 139 | Most users of legacy mappings should use irq_domain_add_simple() which |
121 | will use a legacy domain only if an IRQ range is supplied by the | 140 | will use a legacy domain only if an IRQ range is supplied by the |
122 | system and will otherwise use a linear domain mapping. | 141 | system and will otherwise use a linear domain mapping. The semantics |
142 | of this call are such that if an IRQ range is specified then | ||
143 | descriptors will be allocated on-the-fly for it, and if no range is | ||
144 | specified it will fall through to irq_domain_add_linear() which meand | ||
145 | *no* irq descriptors will be allocated. | ||
146 | |||
147 | A typical use case for simple domains is where an irqchip provider | ||
148 | is supporting both dynamic and static IRQ assignments. | ||
149 | |||
150 | In order to avoid ending up in a situation where a linear domain is | ||
151 | used and no descriptor gets allocated it is very important to make sure | ||
152 | that the driver using the simple domain call irq_create_mapping() | ||
153 | before any irq_find_mapping() since the latter will actually work | ||
154 | for the static IRQ assignment case. | ||