-
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.
MIPS: pci: convert lantiq driver to OF
Implement support for OF inside the lantiq PCI driver. The patch also splits pcibios_plat_dev_init and pcibios_map_irq out into their own file to accomodate coexistance with the upcoming pcie driver. Signed-off-by: John Crispin <blogic@openwrt.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3806/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
- Loading branch information
John Crispin
authored and
Ralf Baechle
committed
May 21, 2012
1 parent
ddd4eec
commit 57c8cb8
Showing
4 changed files
with
131 additions
and
94 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
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