#include <linux/i2c.h>
#include <linux/smp_lock.h>
#include <linux/pci.h>
+#include <linux/delay.h>
#include <asm/io.h>
#include <linux/scx200.h>
#define MAX_DEVICES 4
static int base[MAX_DEVICES] = { 0x820, 0x840 };
-MODULE_PARM(base, "1-4i");
+module_param_array(base, int, NULL, 0);
MODULE_PARM_DESC(base, "Base addresses for the ACCESS.bus controllers");
#ifdef DEBUG
scx200_acb_machine(iface, status);
return;
}
- schedule_timeout(HZ/100+1);
+ msleep(10);
}
scx200_acb_timeout(iface);
.functionality = scx200_acb_func,
};
-struct scx200_acb_iface *scx200_acb_list;
+static struct scx200_acb_iface *scx200_acb_list;
-int scx200_acb_probe(struct scx200_acb_iface *iface)
+static int scx200_acb_probe(struct scx200_acb_iface *iface)
{
u8 val;
adapter->owner = THIS_MODULE;
adapter->id = I2C_ALGO_SMBUS;
adapter->algo = &scx200_acb_algorithm;
+ adapter->class = I2C_CLASS_HWMON;
init_MUTEX(&iface->sem);
return rc;
}
+static struct pci_device_id scx200[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SCx200_BRIDGE) },
+ { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE) },
+ { },
+};
+
static int __init scx200_acb_init(void)
{
int i;
pr_debug(NAME ": NatSemi SCx200 ACCESS.bus Driver\n");
/* Verify that this really is a SCx200 processor */
- if (pci_find_device(PCI_VENDOR_ID_NS,
- PCI_DEVICE_ID_NS_SCx200_BRIDGE,
- NULL) == NULL
- && pci_find_device(PCI_VENDOR_ID_NS,
- PCI_DEVICE_ID_NS_SC1100_BRIDGE,
- NULL) == NULL)
+ if (pci_dev_present(scx200) == 0)
return -ENODEV;
rc = -ENXIO;