git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
drivers
/
i2c
/
busses
/
i2c-sis5595.c
diff --git
a/drivers/i2c/busses/i2c-sis5595.c
b/drivers/i2c/busses/i2c-sis5595.c
index
90b7269
..
425733b
100644
(file)
--- a/
drivers/i2c/busses/i2c-sis5595.c
+++ b/
drivers/i2c/busses/i2c-sis5595.c
@@
-58,6
+58,7
@@
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/init.h>
@@
-123,8
+124,8
@@
static int blacklist[] = {
/* If force_addr is set to anything different from 0, we forcibly enable
the device at the given address. */
/* If force_addr is set to anything different from 0, we forcibly enable
the device at the given address. */
-static
int
force_addr = 0;
-
MODULE_PARM(force_addr, "i"
);
+static
u16
force_addr = 0;
+
module_param(force_addr, ushort, 0
);
MODULE_PARM_DESC(force_addr, "Initialize the base address of the i2c controller");
static unsigned short sis5595_base = 0;
MODULE_PARM_DESC(force_addr, "Initialize the base address of the i2c controller");
static unsigned short sis5595_base = 0;
@@
-180,9
+181,11
@@
static int sis5595_setup(struct pci_dev *SIS5595_dev)
if (force_addr) {
dev_info(&SIS5595_dev->dev, "forcing ISA address 0x%04X\n", sis5595_base);
if (force_addr) {
dev_info(&SIS5595_dev->dev, "forcing ISA address 0x%04X\n", sis5595_base);
- if (!pci_write_config_word(SIS5595_dev, ACPI_BASE, sis5595_base))
+ if (pci_write_config_word(SIS5595_dev, ACPI_BASE, sis5595_base)
+ != PCIBIOS_SUCCESSFUL)
goto error;
goto error;
- if (!pci_read_config_word(SIS5595_dev, ACPI_BASE, &a))
+ if (pci_read_config_word(SIS5595_dev, ACPI_BASE, &a)
+ != PCIBIOS_SUCCESSFUL)
goto error;
if ((a & ~(SIS5595_EXTENT - 1)) != sis5595_base) {
/* doesn't work for some chips! */
goto error;
if ((a & ~(SIS5595_EXTENT - 1)) != sis5595_base) {
/* doesn't work for some chips! */
@@
-191,13
+194,16
@@
static int sis5595_setup(struct pci_dev *SIS5595_dev)
}
}
}
}
- if (!pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val))
+ if (pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val)
+ != PCIBIOS_SUCCESSFUL)
goto error;
if ((val & 0x80) == 0) {
dev_info(&SIS5595_dev->dev, "enabling ACPI\n");
goto error;
if ((val & 0x80) == 0) {
dev_info(&SIS5595_dev->dev, "enabling ACPI\n");
- if (!pci_write_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, val | 0x80))
+ if (pci_write_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, val | 0x80)
+ != PCIBIOS_SUCCESSFUL)
goto error;
goto error;
- if (!pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val))
+ if (pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val)
+ != PCIBIOS_SUCCESSFUL)
goto error;
if ((val & 0x80) == 0) {
/* doesn't work for some chips? */
goto error;
if ((val & 0x80) == 0) {
/* doesn't work for some chips? */
@@
-239,7
+245,7
@@
static int sis5595_transaction(struct i2c_adapter *adap)
/* We will always wait for a fraction of a second! */
do {
/* We will always wait for a fraction of a second! */
do {
-
i2c_delay
(1);
+
msleep
(1);
temp = sis5595_read(SMB_STS_LO);
} while (!(temp & 0x40) && (timeout++ < MAX_TIMEOUT));
temp = sis5595_read(SMB_STS_LO);
} while (!(temp & 0x40) && (timeout++ < MAX_TIMEOUT));
@@
-360,7
+366,7
@@
static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter sis5595_adapter = {
.owner = THIS_MODULE,
static struct i2c_adapter sis5595_adapter = {
.owner = THIS_MODULE,
- .class = I2C_
ADAP_CLASS_SMBUS
,
+ .class = I2C_
CLASS_HWMON
,
.name = "unset",
.algo = &smbus_algorithm,
};
.name = "unset",
.algo = &smbus_algorithm,
};
@@
-370,6
+376,8
@@
static struct pci_device_id sis5595_ids[] __devinitdata = {
{ 0, }
};
{ 0, }
};
+MODULE_DEVICE_TABLE (pci, sis5595_ids);
+
static int __devinit sis5595_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
if (sis5595_setup(dev)) {
static int __devinit sis5595_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
if (sis5595_setup(dev)) {
@@
-392,7
+400,7
@@
static void __devexit sis5595_remove(struct pci_dev *dev)
}
static struct pci_driver sis5595_driver = {
}
static struct pci_driver sis5595_driver = {
- .name = "sis5595
smbus",
+ .name = "sis5595
_
smbus",
.id_table = sis5595_ids,
.probe = sis5595_probe,
.remove = __devexit_p(sis5595_remove),
.id_table = sis5595_ids,
.probe = sis5595_probe,
.remove = __devexit_p(sis5595_remove),
@@
-400,7
+408,7
@@
static struct pci_driver sis5595_driver = {
static int __init i2c_sis5595_init(void)
{
static int __init i2c_sis5595_init(void)
{
- return pci_
module_init
(&sis5595_driver);
+ return pci_
register_driver
(&sis5595_driver);
}
static void __exit i2c_sis5595_exit(void)
}
static void __exit i2c_sis5595_exit(void)