Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^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)  * EISA bus support functions for sysfs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * (C) 2002, 2003 Marc Zyngier <maz@wild-wind.fr.eu.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/eisa.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/moduleparam.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) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/ioport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <asm/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #define SLOT_ADDRESS(r,n) (r->bus_base_addr + (0x1000 * n))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #define EISA_DEVINFO(i,s) { .id = { .sig = i }, .name = s }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) struct eisa_device_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	struct eisa_device_id id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	char name[50];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #ifdef CONFIG_EISA_NAMES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) static struct eisa_device_info __initdata eisa_table[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #include "devlist.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #define EISA_INFOS (sizeof (eisa_table) / (sizeof (struct eisa_device_info)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #define EISA_MAX_FORCED_DEV 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) static int enable_dev[EISA_MAX_FORCED_DEV];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) static unsigned int enable_dev_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) static int disable_dev[EISA_MAX_FORCED_DEV];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) static unsigned int disable_dev_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) static int is_forced_dev(int *forced_tab,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 			 int forced_count,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 			 struct eisa_root_device *root,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 			 struct eisa_device *edev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	int i, x;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	for (i = 0; i < forced_count; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 		x = (root->bus_nr << 8) | edev->slot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 		if (forced_tab[i] == x)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 			return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) static void __init eisa_name_device(struct eisa_device *edev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) #ifdef CONFIG_EISA_NAMES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	for (i = 0; i < EISA_INFOS; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 		if (!strcmp(edev->id.sig, eisa_table[i].id.sig)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 			strlcpy(edev->pretty_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 				eisa_table[i].name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 				sizeof(edev->pretty_name));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	/* No name was found */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	sprintf(edev->pretty_name, "EISA device %.7s", edev->id.sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) static char __init *decode_eisa_sig(unsigned long addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	static char sig_str[EISA_SIG_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	u8 sig[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	u16 rev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	for (i = 0; i < 4; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) #ifdef CONFIG_EISA_VLB_PRIMING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		 * This ugly stuff is used to wake up VL-bus cards
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		 * (AHA-284x is the only known example), so we can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		 * read the EISA id.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 		 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 		 * Thankfully, this only exists on x86...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		outb(0x80 + i, addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		sig[i] = inb(addr + i);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		if (!i && (sig[0] & 0x80))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 			return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	sig_str[0] = ((sig[0] >> 2) & 0x1f) + ('A' - 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	sig_str[1] = (((sig[0] & 3) << 3) | (sig[1] >> 5)) + ('A' - 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	sig_str[2] = (sig[1] & 0x1f) + ('A' - 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	rev = (sig[2] << 8) | sig[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	sprintf(sig_str + 3, "%04X", rev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	return sig_str;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) static int eisa_bus_match(struct device *dev, struct device_driver *drv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	struct eisa_device *edev = to_eisa_device(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	struct eisa_driver *edrv = to_eisa_driver(drv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	const struct eisa_device_id *eids = edrv->id_table;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	if (!eids)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	while (strlen(eids->sig)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		if (!strcmp(eids->sig, edev->id.sig) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		    edev->state & EISA_CONFIG_ENABLED) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 			edev->id.driver_data = eids->driver_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 			return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		eids++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) static int eisa_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	struct eisa_device *edev = to_eisa_device(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	add_uevent_var(env, "MODALIAS=" EISA_DEVICE_MODALIAS_FMT, edev->id.sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) struct bus_type eisa_bus_type = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	.name  = "eisa",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	.match = eisa_bus_match,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	.uevent = eisa_bus_uevent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) EXPORT_SYMBOL(eisa_bus_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) int eisa_driver_register(struct eisa_driver *edrv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	edrv->driver.bus = &eisa_bus_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	return driver_register(&edrv->driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) EXPORT_SYMBOL(eisa_driver_register);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) void eisa_driver_unregister(struct eisa_driver *edrv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	driver_unregister(&edrv->driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) EXPORT_SYMBOL(eisa_driver_unregister);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) static ssize_t eisa_show_sig(struct device *dev, struct device_attribute *attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 			     char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	struct eisa_device *edev = to_eisa_device(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	return sprintf(buf, "%s\n", edev->id.sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) static DEVICE_ATTR(signature, S_IRUGO, eisa_show_sig, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) static ssize_t eisa_show_state(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 			       struct device_attribute *attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 			       char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	struct eisa_device *edev = to_eisa_device(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	return sprintf(buf, "%d\n", edev->state & EISA_CONFIG_ENABLED);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) static DEVICE_ATTR(enabled, S_IRUGO, eisa_show_state, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) static ssize_t eisa_show_modalias(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 				  struct device_attribute *attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 				  char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	struct eisa_device *edev = to_eisa_device(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	return sprintf(buf, EISA_DEVICE_MODALIAS_FMT "\n", edev->id.sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) static DEVICE_ATTR(modalias, S_IRUGO, eisa_show_modalias, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) static int __init eisa_init_device(struct eisa_root_device *root,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 				   struct eisa_device *edev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 				   int slot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	char *sig;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	unsigned long sig_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	sig_addr = SLOT_ADDRESS(root, slot) + EISA_VENDOR_ID_OFFSET;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	sig = decode_eisa_sig(sig_addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	if (!sig)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		return -1;	/* No EISA device here */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	memcpy(edev->id.sig, sig, EISA_SIG_LEN);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	edev->slot = slot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	edev->state = inb(SLOT_ADDRESS(root, slot) + EISA_CONFIG_OFFSET)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 		      & EISA_CONFIG_ENABLED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	edev->base_addr = SLOT_ADDRESS(root, slot);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	edev->dma_mask = root->dma_mask; /* Default DMA mask */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	eisa_name_device(edev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	edev->dev.parent = root->dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	edev->dev.bus = &eisa_bus_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	edev->dev.dma_mask = &edev->dma_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	edev->dev.coherent_dma_mask = edev->dma_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	dev_set_name(&edev->dev, "%02X:%02X", root->bus_nr, slot);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	for (i = 0; i < EISA_MAX_RESOURCES; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) #ifdef CONFIG_EISA_NAMES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 		edev->res[i].name = edev->pretty_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 		edev->res[i].name = edev->id.sig;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	if (is_forced_dev(enable_dev, enable_dev_count, root, edev))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 		edev->state = EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	if (is_forced_dev(disable_dev, disable_dev_count, root, edev))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 		edev->state = EISA_CONFIG_FORCED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) static int __init eisa_register_device(struct eisa_device *edev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	int rc = device_register(&edev->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	if (rc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 		put_device(&edev->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 		return rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	rc = device_create_file(&edev->dev, &dev_attr_signature);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	if (rc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 		goto err_devreg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	rc = device_create_file(&edev->dev, &dev_attr_enabled);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	if (rc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 		goto err_sig;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	rc = device_create_file(&edev->dev, &dev_attr_modalias);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	if (rc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 		goto err_enab;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) err_enab:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 	device_remove_file(&edev->dev, &dev_attr_enabled);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) err_sig:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	device_remove_file(&edev->dev, &dev_attr_signature);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) err_devreg:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	device_unregister(&edev->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	return rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) static int __init eisa_request_resources(struct eisa_root_device *root,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 					 struct eisa_device *edev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 					 int slot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 	for (i = 0; i < EISA_MAX_RESOURCES; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 		/* Don't register resource for slot 0, since this is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 		 * very likely to fail... :-( Instead, grab the EISA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 		 * id, now we can display something in /proc/ioports.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 		/* Only one region for mainboard */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 		if (!slot && i > 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 			edev->res[i].start = edev->res[i].end = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 		if (slot) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 			edev->res[i].name  = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 			edev->res[i].start = SLOT_ADDRESS(root, slot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 					     + (i * 0x400);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 			edev->res[i].end   = edev->res[i].start + 0xff;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 			edev->res[i].flags = IORESOURCE_IO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 			edev->res[i].name  = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 			edev->res[i].start = SLOT_ADDRESS(root, slot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 					     + EISA_VENDOR_ID_OFFSET;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 			edev->res[i].end   = edev->res[i].start + 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 			edev->res[i].flags = IORESOURCE_IO | IORESOURCE_BUSY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 		if (request_resource(root->res, &edev->res[i]))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 			goto failed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)  failed:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 	while (--i >= 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 		release_resource(&edev->res[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 	return -1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) static void __init eisa_release_resources(struct eisa_device *edev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 	for (i = 0; i < EISA_MAX_RESOURCES; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 		if (edev->res[i].start || edev->res[i].end)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 			release_resource(&edev->res[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) static int __init eisa_probe(struct eisa_root_device *root)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	int i, c;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 	struct eisa_device *edev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 	char *enabled_str;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 	dev_info(root->dev, "Probing EISA bus %d\n", root->bus_nr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 	/* First try to get hold of slot 0. If there is no device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 	 * here, simply fail, unless root->force_probe is set. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 	edev = kzalloc(sizeof(*edev), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 	if (!edev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 	if (eisa_request_resources(root, edev, 0)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 		dev_warn(root->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 			 "EISA: Cannot allocate resource for mainboard\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 		kfree(edev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 		if (!root->force_probe)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 			return -EBUSY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 		goto force_probe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 	if (eisa_init_device(root, edev, 0)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 		eisa_release_resources(edev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 		kfree(edev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 		if (!root->force_probe)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 			return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 		goto force_probe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 	dev_info(&edev->dev, "EISA: Mainboard %s detected\n", edev->id.sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 	if (eisa_register_device(edev)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 		dev_err(&edev->dev, "EISA: Failed to register %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 			edev->id.sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 		eisa_release_resources(edev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 		kfree(edev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)  force_probe:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 	for (c = 0, i = 1; i <= root->slots; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 		edev = kzalloc(sizeof(*edev), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 		if (!edev) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 			dev_err(root->dev, "EISA: Out of memory for slot %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 				i);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 		if (eisa_request_resources(root, edev, i)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 			dev_warn(root->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 				 "Cannot allocate resource for EISA slot %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 				 i);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 			kfree(edev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 		if (eisa_init_device(root, edev, i)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 			eisa_release_resources(edev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 			kfree(edev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 		if (edev->state == (EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 			enabled_str = " (forced enabled)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 		else if (edev->state == EISA_CONFIG_FORCED)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 			enabled_str = " (forced disabled)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 		else if (edev->state == 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 			enabled_str = " (disabled)";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 		else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 			enabled_str = "";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 		dev_info(&edev->dev, "EISA: slot %d: %s detected%s\n", i,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 			 edev->id.sig, enabled_str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 		c++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 		if (eisa_register_device(edev)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 			dev_err(&edev->dev, "EISA: Failed to register %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 				edev->id.sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 			eisa_release_resources(edev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 			kfree(edev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 	dev_info(root->dev, "EISA: Detected %d card%s\n", c, c == 1 ? "" : "s");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) static struct resource eisa_root_res = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 	.name  = "EISA root resource",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 	.start = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 	.end   = 0xffffffff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 	.flags = IORESOURCE_IO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) static int eisa_bus_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) int __init eisa_root_register(struct eisa_root_device *root)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 	int err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 	/* Use our own resources to check if this bus base address has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 	 * been already registered. This prevents the virtual root
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 	 * device from registering after the real one has, for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 	 * example... */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 	root->eisa_root_res.name  = eisa_root_res.name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 	root->eisa_root_res.start = root->res->start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 	root->eisa_root_res.end   = root->res->end;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 	root->eisa_root_res.flags = IORESOURCE_BUSY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 	err = request_resource(&eisa_root_res, &root->eisa_root_res);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 		return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 	root->bus_nr = eisa_bus_count++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 	err = eisa_probe(root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 		release_resource(&root->eisa_root_res);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 	return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) static int __init eisa_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 	int r;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 	r = bus_register(&eisa_bus_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 	if (r)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 		return r;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 	printk(KERN_INFO "EISA bus registered\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) module_param_array(enable_dev, int, &enable_dev_count, 0444);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) module_param_array(disable_dev, int, &disable_dev_count, 0444);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) postcore_initcall(eisa_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) int EISA_bus;		/* for legacy drivers */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) EXPORT_SYMBOL(EISA_bus);