^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Virtual EISA root driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Acts as a placeholder if we don't have a proper EISA bridge.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * (C) 2003 Marc Zyngier <maz@wild-wind.fr.eu.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * modified for SNI usage by Thomas Bogendoerfer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/eisa.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) /* The default EISA device parent (virtual root device).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * Now use a platform device, since that's the obvious choice. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) static struct platform_device eisa_root_dev = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) .name = "eisa",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) .id = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) static struct eisa_root_device eisa_bus_root = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) .dev = &eisa_root_dev.dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) .bus_base_addr = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) .res = &ioport_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) .slots = EISA_MAX_SLOTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) .dma_mask = 0xffffffff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) .force_probe = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) int __init sni_eisa_root_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) int r;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) r = platform_device_register(&eisa_root_dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) if (!r)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) return r;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) dev_set_drvdata(&eisa_root_dev.dev, &eisa_bus_root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) if (eisa_root_register(&eisa_bus_root)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) /* A real bridge may have been registered before
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) * us. So quietly unregister. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) platform_device_unregister(&eisa_root_dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) return -1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) }