123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <linux/of_address.h>
- #include <linux/of_pci.h>
- #include <linux/pci-ecam.h>
- #include <linux/platform_device.h>
- static struct pci_ecam_ops gen_pci_cfg_cam_bus_ops = {
- .bus_shift = 16,
- .pci_ops = {
- .map_bus = pci_ecam_map_bus,
- .read = pci_generic_config_read,
- .write = pci_generic_config_write,
- }
- };
- static const struct of_device_id gen_pci_of_match[] = {
- { .compatible = "pci-host-cam-generic",
- .data = &gen_pci_cfg_cam_bus_ops },
- { .compatible = "pci-host-ecam-generic",
- .data = &pci_generic_ecam_ops },
- { },
- };
- static int gen_pci_probe(struct platform_device *pdev)
- {
- const struct of_device_id *of_id;
- struct pci_ecam_ops *ops;
- of_id = of_match_node(gen_pci_of_match, pdev->dev.of_node);
- ops = (struct pci_ecam_ops *)of_id->data;
- return pci_host_common_probe(pdev, ops);
- }
- static struct platform_driver gen_pci_driver = {
- .driver = {
- .name = "pci-host-generic",
- .of_match_table = gen_pci_of_match,
- },
- .probe = gen_pci_probe,
- };
- builtin_platform_driver(gen_pci_driver);
|