-
Notifications
You must be signed in to change notification settings - Fork 94
Add NI_IRQ_RESOLVER #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Add NI_IRQ_RESOLVER #289
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17699,6 +17699,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next | |
| F: drivers/mtd/nand/ | ||
| F: include/linux/mtd/*nand*.h | ||
|
|
||
| NATIONAL INSTRUMENTS DEVICETREE IRQ RESOLVER | ||
| M: Alison Montag <[email protected]> | ||
| S: Maintained | ||
| F: drivers/misc/niirqresolver.c | ||
| F: include/linux/niirqresolver.h | ||
|
|
||
| NATIONAL INSTRUMENTS SERIAL DRIVER | ||
| M: Chaitanya Vadrevu <[email protected]> | ||
| L: [email protected] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // SPDX-License-Identifier: GPL-2.0 | ||
| /* | ||
| * Generic devicetree interrupt specifier -> Linux virq resolver. | ||
| * | ||
| * This file has no knowledge of any specific device, board, or interrupt | ||
| * controller: the caller supplies the controller's devicetree "compatible" | ||
| * string and its raw, controller-specific interrupt specifier cells (for | ||
| * example <type, spi-number, trigger-flags> for an ARM GIC). | ||
| */ | ||
|
|
||
| #include <linux/export.h> | ||
| #include <linux/niirqresolver.h> | ||
| #include <linux/of.h> | ||
| #include <linux/of_irq.h> | ||
| #include <linux/types.h> | ||
|
|
||
| /** | ||
| * ni_of_resolve_irq - resolve a Linux virq from a devicetree interrupt specifier | ||
| * @compatible: devicetree "compatible" string of the interrupt controller node | ||
| * @args: raw interrupt specifier cells, controller-specific | ||
| * @args_count: number of valid entries in @args (must not exceed MAX_PHANDLE_ARGS) | ||
| * | ||
| * Finds the first devicetree node matching @compatible and asks its | ||
| * irqdomain to map @args to a Linux virq. Repeated calls with the same | ||
| * arguments return the same virq. | ||
| * | ||
| * Return: the Linux virtual IRQ number, or 0 if it could not be resolved | ||
| * (no matching node, args_count out of range, or the domain couldn't map it). | ||
| */ | ||
| unsigned int ni_of_resolve_irq(const char *compatible, const unsigned int *args, | ||
| unsigned int args_count) | ||
| { | ||
| struct device_node *node; | ||
| struct of_phandle_args irq_spec; | ||
| unsigned int virq; | ||
| unsigned int i; | ||
|
|
||
| if (args_count > MAX_PHANDLE_ARGS) | ||
| return 0; | ||
|
|
||
| node = of_find_compatible_node(NULL, NULL, compatible); | ||
| if (!node) | ||
| return 0; | ||
|
|
||
| irq_spec.np = node; | ||
| irq_spec.args_count = args_count; | ||
| for (i = 0; i < args_count; i++) | ||
| irq_spec.args[i] = args[i]; | ||
|
|
||
| virq = irq_create_of_mapping(&irq_spec); | ||
|
|
||
| of_node_put(node); | ||
|
|
||
| return virq; | ||
| } | ||
| EXPORT_SYMBOL(ni_of_resolve_irq); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0 */ | ||
| /* | ||
| * Generic devicetree interrupt specifier -> Linux virq resolver. | ||
| * | ||
| * Public declaration for the NI IRQ resolver implemented in | ||
| * drivers/misc/niirqresolver.c. | ||
| */ | ||
|
|
||
| #ifndef _LINUX_NIIRQRESOLVER_H_ | ||
| #define _LINUX_NIIRQRESOLVER_H_ | ||
|
|
||
| /** | ||
| * ni_of_resolve_irq - resolve a Linux virq from a devicetree interrupt specifier | ||
| * @compatible: devicetree "compatible" string of the interrupt controller node | ||
| * @args: raw interrupt specifier cells, controller-specific | ||
| * @args_count: number of valid entries in @args (must not exceed MAX_PHANDLE_ARGS) | ||
| * | ||
| * Return: the Linux virtual IRQ number, or 0 if it could not be resolved. | ||
| */ | ||
| unsigned int ni_of_resolve_irq(const char *compatible, const unsigned int *args, | ||
| unsigned int args_count); | ||
|
|
||
| #endif /* _LINUX_NIIRQRESOLVER_H_ */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bluefin and slsc have no need for this, neither of them use nikal-based drivers