Loading...
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 *
4 * Copyright (C) 2012 John Crispin <john@phrozen.org>
5 */
6
7#include <linux/of_irq.h>
8#include <linux/of_pci.h>
9
10int (*ltq_pci_plat_arch_init)(struct pci_dev *dev) = NULL;
11int (*ltq_pci_plat_dev_init)(struct pci_dev *dev) = NULL;
12
13int pcibios_plat_dev_init(struct pci_dev *dev)
14{
15 if (ltq_pci_plat_arch_init)
16 return ltq_pci_plat_arch_init(dev);
17
18 if (ltq_pci_plat_dev_init)
19 return ltq_pci_plat_dev_init(dev);
20
21 return 0;
22}
23
24int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
25{
26 return of_irq_parse_and_map_pci(dev, slot, pin);
27}
1/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
5 *
6 * Copyright (C) 2012 John Crispin <john@phrozen.org>
7 */
8
9#include <linux/of_irq.h>
10#include <linux/of_pci.h>
11
12int (*ltq_pci_plat_arch_init)(struct pci_dev *dev) = NULL;
13int (*ltq_pci_plat_dev_init)(struct pci_dev *dev) = NULL;
14
15int pcibios_plat_dev_init(struct pci_dev *dev)
16{
17 if (ltq_pci_plat_arch_init)
18 return ltq_pci_plat_arch_init(dev);
19
20 if (ltq_pci_plat_dev_init)
21 return ltq_pci_plat_dev_init(dev);
22
23 return 0;
24}
25
26int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
27{
28 return of_irq_parse_and_map_pci(dev, slot, pin);
29}