Commit 0058c17b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] i2c i2c-piix4.c: fix up formatting and whitespace issues.

parent aeb7a16a
...@@ -51,37 +51,37 @@ struct sd { ...@@ -51,37 +51,37 @@ struct sd {
}; };
/* PIIX4 SMBus address offsets */ /* PIIX4 SMBus address offsets */
#define SMBHSTSTS (0 + piix4_smba) #define SMBHSTSTS (0 + piix4_smba)
#define SMBHSLVSTS (1 + piix4_smba) #define SMBHSLVSTS (1 + piix4_smba)
#define SMBHSTCNT (2 + piix4_smba) #define SMBHSTCNT (2 + piix4_smba)
#define SMBHSTCMD (3 + piix4_smba) #define SMBHSTCMD (3 + piix4_smba)
#define SMBHSTADD (4 + piix4_smba) #define SMBHSTADD (4 + piix4_smba)
#define SMBHSTDAT0 (5 + piix4_smba) #define SMBHSTDAT0 (5 + piix4_smba)
#define SMBHSTDAT1 (6 + piix4_smba) #define SMBHSTDAT1 (6 + piix4_smba)
#define SMBBLKDAT (7 + piix4_smba) #define SMBBLKDAT (7 + piix4_smba)
#define SMBSLVCNT (8 + piix4_smba) #define SMBSLVCNT (8 + piix4_smba)
#define SMBSHDWCMD (9 + piix4_smba) #define SMBSHDWCMD (9 + piix4_smba)
#define SMBSLVEVT (0xA + piix4_smba) #define SMBSLVEVT (0xA + piix4_smba)
#define SMBSLVDAT (0xC + piix4_smba) #define SMBSLVDAT (0xC + piix4_smba)
/* PCI Address Constants */ /* PCI Address Constants */
#define SMBBA 0x090 #define SMBBA 0x090
#define SMBHSTCFG 0x0D2 #define SMBHSTCFG 0x0D2
#define SMBSLVC 0x0D3 #define SMBSLVC 0x0D3
#define SMBSHDW1 0x0D4 #define SMBSHDW1 0x0D4
#define SMBSHDW2 0x0D5 #define SMBSHDW2 0x0D5
#define SMBREV 0x0D6 #define SMBREV 0x0D6
/* Other settings */ /* Other settings */
#define MAX_TIMEOUT 500 #define MAX_TIMEOUT 500
#define ENABLE_INT9 0 #define ENABLE_INT9 0
/* PIIX4 constants */ /* PIIX4 constants */
#define PIIX4_QUICK 0x00 #define PIIX4_QUICK 0x00
#define PIIX4_BYTE 0x04 #define PIIX4_BYTE 0x04
#define PIIX4_BYTE_DATA 0x08 #define PIIX4_BYTE_DATA 0x08
#define PIIX4_WORD_DATA 0x0C #define PIIX4_WORD_DATA 0x0C
#define PIIX4_BLOCK_DATA 0x14 #define PIIX4_BLOCK_DATA 0x14
/* insmod parameters */ /* insmod parameters */
...@@ -138,7 +138,7 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id ...@@ -138,7 +138,7 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id
goto END; goto END;
} }
/* Determine the address of the SMBus areas */ /* Determine the address of the SMBus areas */
if (force_addr) { if (force_addr) {
piix4_smba = force_addr & 0xfff0; piix4_smba = force_addr & 0xfff0;
force = 0; force = 0;
...@@ -161,8 +161,8 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id ...@@ -161,8 +161,8 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id
} }
pci_read_config_byte(PIIX4_dev, SMBHSTCFG, &temp); pci_read_config_byte(PIIX4_dev, SMBHSTCFG, &temp);
/* If force_addr is set, we program the new address here. Just to make /* If force_addr is set, we program the new address here. Just to make
sure, we disable the PIIX4 first. */ sure, we disable the PIIX4 first. */
if (force_addr) { if (force_addr) {
pci_write_config_byte(PIIX4_dev, SMBHSTCFG, temp & 0xfe); pci_write_config_byte(PIIX4_dev, SMBHSTCFG, temp & 0xfe);
pci_write_config_word(PIIX4_dev, SMBBA, piix4_smba); pci_write_config_word(PIIX4_dev, SMBBA, piix4_smba);
...@@ -171,12 +171,14 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id ...@@ -171,12 +171,14 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id
"new address %04x!\n", piix4_smba); "new address %04x!\n", piix4_smba);
} else if ((temp & 1) == 0) { } else if ((temp & 1) == 0) {
if (force) { if (force) {
/* This should never need to be done, but has been noted that /* This should never need to be done, but has been
many Dell machines have the SMBus interface on the PIIX4 * noted that many Dell machines have the SMBus
disabled!? NOTE: This assumes I/O space and other allocations WERE * interface on the PIIX4 disabled!? NOTE: This assumes
done by the Bios! Don't complain if your hardware does weird * I/O space and other allocations WERE done by the
things after enabling this. :') Check for Bios updates before * Bios! Don't complain if your hardware does weird
resorting to this. */ * things after enabling this. :') Check for Bios
* updates before resorting to this.
*/
pci_write_config_byte(PIIX4_dev, SMBHSTCFG, pci_write_config_byte(PIIX4_dev, SMBHSTCFG,
temp | 1); temp | 1);
dev_printk(KERN_NOTICE, &PIIX4_dev->dev, dev_printk(KERN_NOTICE, &PIIX4_dev->dev,
...@@ -202,11 +204,10 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id ...@@ -202,11 +204,10 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id
dev_dbg(&PIIX4_dev->dev, "SMBREV = 0x%X\n", temp); dev_dbg(&PIIX4_dev->dev, "SMBREV = 0x%X\n", temp);
dev_dbg(&PIIX4_dev->dev, "SMBA = 0x%X\n", piix4_smba); dev_dbg(&PIIX4_dev->dev, "SMBA = 0x%X\n", piix4_smba);
END: END:
return error_return; return error_return;
} }
/* Internally used pause function */ /* Internally used pause function */
static void piix4_do_pause(unsigned int amount) static void piix4_do_pause(unsigned int amount)
{ {
...@@ -377,7 +378,6 @@ static s32 piix4_access(struct i2c_adapter * adap, u16 addr, ...@@ -377,7 +378,6 @@ static s32 piix4_access(struct i2c_adapter * adap, u16 addr,
return 0; return 0;
} }
static u32 piix4_func(struct i2c_adapter *adapter) static u32 piix4_func(struct i2c_adapter *adapter)
{ {
return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
...@@ -399,8 +399,6 @@ static struct i2c_adapter piix4_adapter = { ...@@ -399,8 +399,6 @@ static struct i2c_adapter piix4_adapter = {
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
}; };
static struct pci_device_id piix4_ids[] __devinitdata = { static struct pci_device_id piix4_ids[] __devinitdata = {
{ {
.vendor = PCI_VENDOR_ID_INTEL, .vendor = PCI_VENDOR_ID_INTEL,
...@@ -443,7 +441,7 @@ static struct pci_device_id piix4_ids[] __devinitdata = { ...@@ -443,7 +441,7 @@ static struct pci_device_id piix4_ids[] __devinitdata = {
static int __devinit piix4_probe(struct pci_dev *dev, const struct pci_device_id *id) static int __devinit piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
{ {
int retval; int retval;
retval = piix4_setup(dev, id); retval = piix4_setup(dev, id);
if (retval) if (retval)
return retval; return retval;
...@@ -485,8 +483,6 @@ static void __exit i2c_piix4_exit(void) ...@@ -485,8 +483,6 @@ static void __exit i2c_piix4_exit(void)
release_region(piix4_smba, 8); release_region(piix4_smba, 8);
} }
MODULE_AUTHOR MODULE_AUTHOR
("Frodo Looijaard <frodol@dds.nl> and Philip Edelbrock <phil@netroedge.com>"); ("Frodo Looijaard <frodol@dds.nl> and Philip Edelbrock <phil@netroedge.com>");
MODULE_DESCRIPTION("PIIX4 SMBus driver"); MODULE_DESCRIPTION("PIIX4 SMBus driver");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment