-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
John Crispin
authored and
Ralf Baechle
committed
May 21, 2012
1 parent
45a5ab3
commit 839bdbb
Showing
5 changed files
with
132 additions
and
95 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: ddd4eeca961cc6b1d57e0ca2f264403d690b6882 | ||
refs/heads/master: 57c8cb8f242988b8048a7058cd1edde025c6f232 |
This file contains 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 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 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,40 @@ | ||
/* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 as published | ||
* by the Free Software Foundation. | ||
* | ||
* Copyright (C) 2012 John Crispin <blogic@openwrt.org> | ||
*/ | ||
|
||
#include <linux/of_irq.h> | ||
#include <linux/of_pci.h> | ||
|
||
int (*ltq_pci_plat_arch_init)(struct pci_dev *dev) = NULL; | ||
int (*ltq_pci_plat_dev_init)(struct pci_dev *dev) = NULL; | ||
|
||
int pcibios_plat_dev_init(struct pci_dev *dev) | ||
{ | ||
if (ltq_pci_plat_arch_init) | ||
return ltq_pci_plat_arch_init(dev); | ||
|
||
if (ltq_pci_plat_dev_init) | ||
return ltq_pci_plat_dev_init(dev); | ||
|
||
return 0; | ||
} | ||
|
||
int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | ||
{ | ||
struct of_irq dev_irq; | ||
int irq; | ||
|
||
if (of_irq_map_pci(dev, &dev_irq)) { | ||
dev_err(&dev->dev, "trying to map irq for unknown slot:%d pin:%d\n", | ||
slot, pin); | ||
return 0; | ||
} | ||
irq = irq_create_of_mapping(dev_irq.controller, dev_irq.specifier, | ||
dev_irq.size); | ||
dev_info(&dev->dev, "SLOT:%d PIN:%d IRQ:%d\n", slot, pin, irq); | ||
return irq; | ||
} |
This file contains 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