/*
     i2c-viapro.c - Part of lm_sensors, Linux kernel modules for hardware
               monitoring
-    Copyright (c) 1998 - 2002  Frodo Looijaard <frodol@dds.nl>, 
+    Copyright (c) 1998 - 2002  Frodo Looijaard <frodol@dds.nl>,
     Philip Edelbrock <phil@netroedge.com>, Kyösti Mälkki <kmalkki@cc.hut.fi>,
     Mark D. Studebaker <mdsxyz123@yahoo.com>
 
 
 static struct pci_dev *vt596_pdev;
 
-#define SMBBA1          0x90
-#define SMBBA2          0x80
-#define SMBBA3          0xD0
+#define SMBBA1         0x90
+#define SMBBA2         0x80
+#define SMBBA3         0xD0
 
 /* SMBus address offsets */
 static unsigned short vt596_smba;
 /* PCI Address Constants */
 
 /* SMBus data in configuration space can be found in two places,
-   We try to select the better one*/
+   We try to select the better one */
 
 static unsigned short smb_cf_hstcfg = 0xD2;
 
-#define SMBHSTCFG   (smb_cf_hstcfg)
-#define SMBSLVC     (smb_cf_hstcfg + 1)
-#define SMBSHDW1    (smb_cf_hstcfg + 2)
-#define SMBSHDW2    (smb_cf_hstcfg + 3)
-#define SMBREV      (smb_cf_hstcfg + 4)
+#define SMBHSTCFG      (smb_cf_hstcfg)
+#define SMBSLVC                (smb_cf_hstcfg + 1)
+#define SMBSHDW1       (smb_cf_hstcfg + 2)
+#define SMBSHDW2       (smb_cf_hstcfg + 3)
+#define SMBREV         (smb_cf_hstcfg + 4)
 
 /* Other settings */
 #define MAX_TIMEOUT    500
 #define ENABLE_INT9    0
 
 /* VT82C596 constants */
-#define VT596_QUICK      0x00
-#define VT596_BYTE       0x04
-#define VT596_BYTE_DATA  0x08
-#define VT596_WORD_DATA  0x0C
-#define VT596_BLOCK_DATA 0x14
+#define VT596_QUICK            0x00
+#define VT596_BYTE             0x04
+#define VT596_BYTE_DATA                0x08
+#define VT596_WORD_DATA                0x0C
+#define VT596_BLOCK_DATA       0x14
 
 
 /* If force is set to anything different from 0, we forcibly enable the
        int timeout = 0;
 
        dev_dbg(&vt596_adapter.dev, "Transaction (pre): CNT=%02x, CMD=%02x, "
-               "ADD=%02x, DAT0=%02x, DAT1=%02x\n", inb_p(SMBHSTCNT), 
-               inb_p(SMBHSTCMD), inb_p(SMBHSTADD), inb_p(SMBHSTDAT0), 
+               "ADD=%02x, DAT0=%02x, DAT1=%02x\n", inb_p(SMBHSTCNT),
+               inb_p(SMBHSTCMD), inb_p(SMBHSTADD), inb_p(SMBHSTDAT0),
                inb_p(SMBHSTDAT1));
 
        /* Make sure the SMBus host is ready to start transmitting */
        if ((temp = inb_p(SMBHSTSTS)) & 0x1F) {
                dev_dbg(&vt596_adapter.dev, "SMBus busy (0x%02x). "
-                               "Resetting...\n", temp);
-               
+                       "Resetting...\n", temp);
+
                outb_p(temp, SMBHSTSTS);
                if ((temp = inb_p(SMBHSTSTS)) & 0x1F) {
                        dev_dbg(&vt596_adapter.dev, "Failed! (0x%02x)\n", temp);
-                       
+
                        return -1;
                } else {
                        dev_dbg(&vt596_adapter.dev, "Successfull!\n");
        /* start the transaction by setting bit 6 */
        outb_p(inb(SMBHSTCNT) | 0x040, SMBHSTCNT);
 
-       /* We will always wait for a fraction of a second! 
+       /* We will always wait for a fraction of a second!
           I don't know if VIA needs this, Intel did  */
        do {
                msleep(1);
 
        dev_dbg(&vt596_adapter.dev, "Transaction (post): CNT=%02x, CMD=%02x, "
                "ADD=%02x, DAT0=%02x, DAT1=%02x\n", inb_p(SMBHSTCNT),
-               inb_p(SMBHSTCMD), inb_p(SMBHSTADD), inb_p(SMBHSTDAT0), 
+               inb_p(SMBHSTCMD), inb_p(SMBHSTADD), inb_p(SMBHSTDAT0),
                inb_p(SMBHSTDAT1));
-       
+
        return result;
 }
 
 /* Return -1 on error. */
 static s32 vt596_access(struct i2c_adapter *adap, u16 addr,
-               unsigned short flags,  char read_write, u8 command,
-               int size,  union i2c_smbus_data *data)
+               unsigned short flags, char read_write, u8 command,
+               int size, union i2c_smbus_data *data)
 {
        int i, len;
 
        case VT596_BYTE:
                /* Where is the result put? I assume here it is in
                 * SMBHSTDAT0 but it might just as well be in the
-                * SMBHSTCMD. No clue in the docs 
+                * SMBHSTCMD. No clue in the docs
                 */
                data->byte = inb_p(SMBHSTDAT0);
                break;
 {
        unsigned char temp;
        int error = -ENODEV;
-       
+
        /* Determine the address of the SMBus areas */
        if (force_addr) {
                vt596_smba = force_addr & 0xfff0;
                return -ENODEV;
        }
 
- found:
+found:
        if (!request_region(vt596_smba, 8, "viapro-smbus")) {
                dev_err(&pdev->dev, "SMBus region 0x%x already in use!\n",
-                       vt596_smba);
+                       vt596_smba);
                return -ENODEV;
        }
 
                pci_write_config_word(pdev, id->driver_data, vt596_smba);
                pci_write_config_byte(pdev, SMBHSTCFG, temp | 0x01);
                dev_warn(&pdev->dev, "WARNING: SMBus interface set to new "
-                    "address 0x%04x!\n", vt596_smba);
+                        "address 0x%04x!\n", vt596_smba);
        } else if ((temp & 1) == 0) {
                if (force) {
-                       /* NOTE: This assumes I/O space and other allocations 
-                        * WERE done by the Bios!  Don't complain if your 
-                        * hardware does weird things after enabling this. 
-                        * :') Check for Bios updates before resorting to 
+                       /* NOTE: This assumes I/O space and other allocations
+                        * WERE done by the Bios!  Don't complain if your
+                        * hardware does weird things after enabling this.
+                        * :') Check for Bios updates before resorting to
                         * this.
                         */
                        pci_write_config_byte(pdev, SMBHSTCFG, temp | 1);
 
        vt596_adapter.dev.parent = &pdev->dev;
        snprintf(vt596_adapter.name, I2C_NAME_SIZE,
-                       "SMBus Via Pro adapter at %04x", vt596_smba);
-       
+                "SMBus Via Pro adapter at %04x", vt596_smba);
+
        vt596_pdev = pci_dev_get(pdev);
        if (i2c_add_adapter(&vt596_adapter)) {
                pci_dev_put(vt596_pdev);
         */
        return -ENODEV;
 
- release_region:
+release_region:
        release_region(vt596_smba, 8);
        return error;
 }
        { 0, }
 };
 
-MODULE_DEVICE_TABLE (pci, vt596_ids);
+MODULE_DEVICE_TABLE(pci, vt596_ids);
 
 static struct pci_driver vt596_driver = {
        .name           = "vt596_smbus",