| 1 | /* |
|---|
| 2 | amd756.c - Part of lm_sensors, Linux kernel modules for hardware |
|---|
| 3 | monitoring |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 1999-2002 Merlin Hughes <merlin@merlin.org> |
|---|
| 6 | |
|---|
| 7 | Shamelessly ripped from i2c-piix4.c: |
|---|
| 8 | |
|---|
| 9 | Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl> and |
|---|
| 10 | Philip Edelbrock <phil@netroedge.com> |
|---|
| 11 | |
|---|
| 12 | This program is free software; you can redistribute it and/or modify |
|---|
| 13 | it under the terms of the GNU General Public License as published by |
|---|
| 14 | the Free Software Foundation; either version 2 of the License, or |
|---|
| 15 | (at your option) any later version. |
|---|
| 16 | |
|---|
| 17 | This program is distributed in the hope that it will be useful, |
|---|
| 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 20 | GNU General Public License for more details. |
|---|
| 21 | |
|---|
| 22 | You should have received a copy of the GNU General Public License |
|---|
| 23 | along with this program; if not, write to the Free Software |
|---|
| 24 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 25 | */ |
|---|
| 26 | |
|---|
| 27 | /* |
|---|
| 28 | 2002-04-08: Added nForce support. (Csaba Halasz) |
|---|
| 29 | 2002-10-03: Fixed nForce PnP I/O port. (Michael Steil) |
|---|
| 30 | 2002-12-28: Rewritten into something that resembles a Linux driver (hch) |
|---|
| 31 | */ |
|---|
| 32 | |
|---|
| 33 | /* |
|---|
| 34 | Supports AMD756, AMD766, AMD768 and nVidia nForce |
|---|
| 35 | Note: we assume there can only be one device, with one SMBus interface. |
|---|
| 36 | */ |
|---|
| 37 | |
|---|
| 38 | #include <linux/module.h> |
|---|
| 39 | #include <linux/pci.h> |
|---|
| 40 | #include <linux/kernel.h> |
|---|
| 41 | #include <linux/stddef.h> |
|---|
| 42 | #include <linux/sched.h> |
|---|
| 43 | #include <linux/ioport.h> |
|---|
| 44 | #include <linux/i2c.h> |
|---|
| 45 | #include <linux/init.h> |
|---|
| 46 | #include <asm/io.h> |
|---|
| 47 | #include "version.h" |
|---|
| 48 | |
|---|
| 49 | #define DRV_NAME "i2c-amd756" |
|---|
| 50 | |
|---|
| 51 | /* AMD756 SMBus address offsets */ |
|---|
| 52 | #define SMB_ADDR_OFFSET 0xE0 |
|---|
| 53 | #define SMB_IOSIZE 16 |
|---|
| 54 | #define SMB_GLOBAL_STATUS (0x0 + amd756_ioport) |
|---|
| 55 | #define SMB_GLOBAL_ENABLE (0x2 + amd756_ioport) |
|---|
| 56 | #define SMB_HOST_ADDRESS (0x4 + amd756_ioport) |
|---|
| 57 | #define SMB_HOST_DATA (0x6 + amd756_ioport) |
|---|
| 58 | #define SMB_HOST_COMMAND (0x8 + amd756_ioport) |
|---|
| 59 | #define SMB_HOST_BLOCK_DATA (0x9 + amd756_ioport) |
|---|
| 60 | #define SMB_HAS_DATA (0xA + amd756_ioport) |
|---|
| 61 | #define SMB_HAS_DEVICE_ADDRESS (0xC + amd756_ioport) |
|---|
| 62 | #define SMB_HAS_HOST_ADDRESS (0xE + amd756_ioport) |
|---|
| 63 | #define SMB_SNOOP_ADDRESS (0xF + amd756_ioport) |
|---|
| 64 | |
|---|
| 65 | /* PCI Address Constants */ |
|---|
| 66 | |
|---|
| 67 | /* address of I/O space */ |
|---|
| 68 | #define SMBBA 0x058 /* mh */ |
|---|
| 69 | #define SMBBANFORCE 0x014 |
|---|
| 70 | |
|---|
| 71 | /* general configuration */ |
|---|
| 72 | #define SMBGCFG 0x041 /* mh */ |
|---|
| 73 | |
|---|
| 74 | /* silicon revision code */ |
|---|
| 75 | #define SMBREV 0x008 |
|---|
| 76 | |
|---|
| 77 | /* Other settings */ |
|---|
| 78 | #define MAX_TIMEOUT 500 |
|---|
| 79 | |
|---|
| 80 | /* AMD756 constants */ |
|---|
| 81 | #define AMD756_QUICK 0x00 |
|---|
| 82 | #define AMD756_BYTE 0x01 |
|---|
| 83 | #define AMD756_BYTE_DATA 0x02 |
|---|
| 84 | #define AMD756_WORD_DATA 0x03 |
|---|
| 85 | #define AMD756_PROCESS_CALL 0x04 |
|---|
| 86 | #define AMD756_BLOCK_DATA 0x05 |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | static unsigned short amd756_ioport = 0; |
|---|
| 90 | |
|---|
| 91 | /* |
|---|
| 92 | SMBUS event = I/O 28-29 bit 11 |
|---|
| 93 | see E0 for the status bits and enabled in E2 |
|---|
| 94 | |
|---|
| 95 | */ |
|---|
| 96 | |
|---|
| 97 | #define GS_ABRT_STS (1 << 0) |
|---|
| 98 | #define GS_COL_STS (1 << 1) |
|---|
| 99 | #define GS_PRERR_STS (1 << 2) |
|---|
| 100 | #define GS_HST_STS (1 << 3) |
|---|
| 101 | #define GS_HCYC_STS (1 << 4) |
|---|
| 102 | #define GS_TO_STS (1 << 5) |
|---|
| 103 | #define GS_SMB_STS (1 << 11) |
|---|
| 104 | |
|---|
| 105 | #define GS_CLEAR_STS (GS_ABRT_STS | GS_COL_STS | GS_PRERR_STS | \ |
|---|
| 106 | GS_HCYC_STS | GS_TO_STS ) |
|---|
| 107 | |
|---|
| 108 | #define GE_CYC_TYPE_MASK (7) |
|---|
| 109 | #define GE_HOST_STC (1 << 3) |
|---|
| 110 | #define GE_ABORT (1 << 5) |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | static int amd756_transaction(void) |
|---|
| 114 | { |
|---|
| 115 | int temp; |
|---|
| 116 | int result = 0; |
|---|
| 117 | int timeout = 0; |
|---|
| 118 | |
|---|
| 119 | pr_debug(DRV_NAME |
|---|
| 120 | ": Transaction (pre): GS=%04x, GE=%04x, ADD=%04x, DAT=%04x\n", |
|---|
| 121 | inw_p(SMB_GLOBAL_STATUS), inw_p(SMB_GLOBAL_ENABLE), |
|---|
| 122 | inw_p(SMB_HOST_ADDRESS), inb_p(SMB_HOST_DATA)); |
|---|
| 123 | |
|---|
| 124 | /* Make sure the SMBus host is ready to start transmitting */ |
|---|
| 125 | if ((temp = inw_p(SMB_GLOBAL_STATUS)) & (GS_HST_STS | GS_SMB_STS)) { |
|---|
| 126 | pr_debug(DRV_NAME ": SMBus busy (%04x). Waiting... \n", temp); |
|---|
| 127 | do { |
|---|
| 128 | i2c_delay(1); |
|---|
| 129 | temp = inw_p(SMB_GLOBAL_STATUS); |
|---|
| 130 | } while ((temp & (GS_HST_STS | GS_SMB_STS)) && |
|---|
| 131 | (timeout++ < MAX_TIMEOUT)); |
|---|
| 132 | /* If the SMBus is still busy, we give up */ |
|---|
| 133 | if (timeout >= MAX_TIMEOUT) { |
|---|
| 134 | pr_debug(DRV_NAME ": Busy wait timeout (%04x)\n", temp); |
|---|
| 135 | goto abort; |
|---|
| 136 | } |
|---|
| 137 | timeout = 0; |
|---|
| 138 | } |
|---|
| 139 | |
|---|
| 140 | /* start the transaction by setting the start bit */ |
|---|
| 141 | outw_p(inw(SMB_GLOBAL_ENABLE) | GE_HOST_STC, SMB_GLOBAL_ENABLE); |
|---|
| 142 | |
|---|
| 143 | /* We will always wait for a fraction of a second! */ |
|---|
| 144 | do { |
|---|
| 145 | i2c_delay(1); |
|---|
| 146 | temp = inw_p(SMB_GLOBAL_STATUS); |
|---|
| 147 | } while ((temp & GS_HST_STS) && (timeout++ < MAX_TIMEOUT)); |
|---|
| 148 | |
|---|
| 149 | /* If the SMBus is still busy, we give up */ |
|---|
| 150 | if (timeout >= MAX_TIMEOUT) { |
|---|
| 151 | pr_debug(DRV_NAME ": Completion timeout!\n"); |
|---|
| 152 | goto abort; |
|---|
| 153 | } |
|---|
| 154 | |
|---|
| 155 | if (temp & GS_PRERR_STS) { |
|---|
| 156 | result = -1; |
|---|
| 157 | pr_debug(DRV_NAME ": SMBus Protocol error (no response)!\n"); |
|---|
| 158 | } |
|---|
| 159 | |
|---|
| 160 | if (temp & GS_COL_STS) { |
|---|
| 161 | result = -1; |
|---|
| 162 | printk(KERN_WARNING DRV_NAME " SMBus collision!\n"); |
|---|
| 163 | } |
|---|
| 164 | |
|---|
| 165 | if (temp & GS_TO_STS) { |
|---|
| 166 | result = -1; |
|---|
| 167 | pr_debug(DRV_NAME ": SMBus protocol timeout!\n"); |
|---|
| 168 | } |
|---|
| 169 | |
|---|
| 170 | if (temp & GS_HCYC_STS) |
|---|
| 171 | pr_debug(DRV_NAME " SMBus protocol success!\n"); |
|---|
| 172 | |
|---|
| 173 | outw_p(GS_CLEAR_STS, SMB_GLOBAL_STATUS); |
|---|
| 174 | |
|---|
| 175 | #ifdef DEBUG |
|---|
| 176 | if (((temp = inw_p(SMB_GLOBAL_STATUS)) & GS_CLEAR_STS) != 0x00) { |
|---|
| 177 | pr_debug(DRV_NAME |
|---|
| 178 | ": Failed reset at end of transaction (%04x)\n", temp); |
|---|
| 179 | } |
|---|
| 180 | |
|---|
| 181 | pr_debug(DRV_NAME |
|---|
| 182 | ": Transaction (post): GS=%04x, GE=%04x, ADD=%04x, DAT=%04x\n", |
|---|
| 183 | inw_p(SMB_GLOBAL_STATUS), inw_p(SMB_GLOBAL_ENABLE), |
|---|
| 184 | inw_p(SMB_HOST_ADDRESS), inb_p(SMB_HOST_DATA)); |
|---|
| 185 | #endif |
|---|
| 186 | |
|---|
| 187 | return result; |
|---|
| 188 | |
|---|
| 189 | abort: |
|---|
| 190 | printk(KERN_WARNING DRV_NAME ": Sending abort.\n"); |
|---|
| 191 | outw_p(inw(SMB_GLOBAL_ENABLE) | GE_ABORT, SMB_GLOBAL_ENABLE); |
|---|
| 192 | i2c_delay(100); |
|---|
| 193 | outw_p(GS_CLEAR_STS, SMB_GLOBAL_STATUS); |
|---|
| 194 | return -1; |
|---|
| 195 | } |
|---|
| 196 | |
|---|
| 197 | /* Return -1 on error. */ |
|---|
| 198 | |
|---|
| 199 | static s32 amd756_access(struct i2c_adapter * adap, u16 addr, |
|---|
| 200 | unsigned short flags, char read_write, |
|---|
| 201 | u8 command, int size, union i2c_smbus_data * data) |
|---|
| 202 | { |
|---|
| 203 | int i, len; |
|---|
| 204 | |
|---|
| 205 | /** TODO: Should I supporte the 10-bit transfers? */ |
|---|
| 206 | switch (size) { |
|---|
| 207 | /* TODO: proc call is supported, I'm just not sure what to do here... */ |
|---|
| 208 | case I2C_SMBUS_QUICK: |
|---|
| 209 | outw_p(((addr & 0x7f) << 1) | (read_write & 0x01), |
|---|
| 210 | SMB_HOST_ADDRESS); |
|---|
| 211 | size = AMD756_QUICK; |
|---|
| 212 | break; |
|---|
| 213 | case I2C_SMBUS_BYTE: |
|---|
| 214 | outw_p(((addr & 0x7f) << 1) | (read_write & 0x01), |
|---|
| 215 | SMB_HOST_ADDRESS); |
|---|
| 216 | /* TODO: Why only during write? */ |
|---|
| 217 | if (read_write == I2C_SMBUS_WRITE) |
|---|
| 218 | outb_p(command, SMB_HOST_COMMAND); |
|---|
| 219 | size = AMD756_BYTE; |
|---|
| 220 | break; |
|---|
| 221 | case I2C_SMBUS_BYTE_DATA: |
|---|
| 222 | outw_p(((addr & 0x7f) << 1) | (read_write & 0x01), |
|---|
| 223 | SMB_HOST_ADDRESS); |
|---|
| 224 | outb_p(command, SMB_HOST_COMMAND); |
|---|
| 225 | if (read_write == I2C_SMBUS_WRITE) |
|---|
| 226 | outw_p(data->byte, SMB_HOST_DATA); |
|---|
| 227 | size = AMD756_BYTE_DATA; |
|---|
| 228 | break; |
|---|
| 229 | case I2C_SMBUS_WORD_DATA: |
|---|
| 230 | outw_p(((addr & 0x7f) << 1) | (read_write & 0x01), |
|---|
| 231 | SMB_HOST_ADDRESS); |
|---|
| 232 | outb_p(command, SMB_HOST_COMMAND); |
|---|
| 233 | if (read_write == I2C_SMBUS_WRITE) |
|---|
| 234 | outw_p(data->word, SMB_HOST_DATA); /* TODO: endian???? */ |
|---|
| 235 | size = AMD756_WORD_DATA; |
|---|
| 236 | break; |
|---|
| 237 | case I2C_SMBUS_BLOCK_DATA: |
|---|
| 238 | outw_p(((addr & 0x7f) << 1) | (read_write & 0x01), |
|---|
| 239 | SMB_HOST_ADDRESS); |
|---|
| 240 | outb_p(command, SMB_HOST_COMMAND); |
|---|
| 241 | if (read_write == I2C_SMBUS_WRITE) { |
|---|
| 242 | len = data->block[0]; |
|---|
| 243 | if (len < 0) |
|---|
| 244 | len = 0; |
|---|
| 245 | if (len > 32) |
|---|
| 246 | len = 32; |
|---|
| 247 | outw_p(len, SMB_HOST_DATA); |
|---|
| 248 | /* i = inw_p(SMBHSTCNT); Reset SMBBLKDAT */ |
|---|
| 249 | for (i = 1; i <= len; i++) |
|---|
| 250 | outb_p(data->block[i], |
|---|
| 251 | SMB_HOST_BLOCK_DATA); |
|---|
| 252 | } |
|---|
| 253 | size = AMD756_BLOCK_DATA; |
|---|
| 254 | break; |
|---|
| 255 | default: |
|---|
| 256 | printk |
|---|
| 257 | (KERN_WARNING "i2c-amd756.o: Unsupported transaction %d\n", size); |
|---|
| 258 | return -1; |
|---|
| 259 | } |
|---|
| 260 | |
|---|
| 261 | /* How about enabling interrupts... */ |
|---|
| 262 | outw_p(size & GE_CYC_TYPE_MASK, SMB_GLOBAL_ENABLE); |
|---|
| 263 | |
|---|
| 264 | if (amd756_transaction()) /* Error in transaction */ |
|---|
| 265 | return -1; |
|---|
| 266 | |
|---|
| 267 | if ((read_write == I2C_SMBUS_WRITE) || (size == AMD756_QUICK)) |
|---|
| 268 | return 0; |
|---|
| 269 | |
|---|
| 270 | |
|---|
| 271 | switch (size) { |
|---|
| 272 | case AMD756_BYTE: |
|---|
| 273 | data->byte = inw_p(SMB_HOST_DATA); |
|---|
| 274 | break; |
|---|
| 275 | case AMD756_BYTE_DATA: |
|---|
| 276 | data->byte = inw_p(SMB_HOST_DATA); |
|---|
| 277 | break; |
|---|
| 278 | case AMD756_WORD_DATA: |
|---|
| 279 | data->word = inw_p(SMB_HOST_DATA); /* TODO: endian???? */ |
|---|
| 280 | break; |
|---|
| 281 | case AMD756_BLOCK_DATA: |
|---|
| 282 | data->block[0] = inw_p(SMB_HOST_DATA) & 0x3f; |
|---|
| 283 | if(data->block[0] > 32) |
|---|
| 284 | data->block[0] = 32; |
|---|
| 285 | /* i = inw_p(SMBHSTCNT); Reset SMBBLKDAT */ |
|---|
| 286 | for (i = 1; i <= data->block[0]; i++) |
|---|
| 287 | data->block[i] = inb_p(SMB_HOST_BLOCK_DATA); |
|---|
| 288 | break; |
|---|
| 289 | } |
|---|
| 290 | |
|---|
| 291 | return 0; |
|---|
| 292 | } |
|---|
| 293 | |
|---|
| 294 | static u32 amd756_func(struct i2c_adapter *adapter) |
|---|
| 295 | { |
|---|
| 296 | return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | |
|---|
| 297 | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | |
|---|
| 298 | I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_PROC_CALL; |
|---|
| 299 | } |
|---|
| 300 | |
|---|
| 301 | static struct i2c_algorithm smbus_algorithm = { |
|---|
| 302 | .name = "Non-I2C SMBus adapter", |
|---|
| 303 | .id = I2C_ALGO_SMBUS, |
|---|
| 304 | .smbus_xfer = amd756_access, |
|---|
| 305 | .functionality = amd756_func, |
|---|
| 306 | }; |
|---|
| 307 | |
|---|
| 308 | static struct i2c_adapter amd756_adapter = { |
|---|
| 309 | .owner = THIS_MODULE, |
|---|
| 310 | .name = "unset", |
|---|
| 311 | .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_AMD756, |
|---|
| 312 | .algo = &smbus_algorithm, |
|---|
| 313 | }; |
|---|
| 314 | |
|---|
| 315 | enum chiptype { AMD756, AMD766, AMD768, NFORCE }; |
|---|
| 316 | |
|---|
| 317 | static struct pci_device_id amd756_ids[] __devinitdata = { |
|---|
| 318 | {PCI_VENDOR_ID_AMD, 0x740B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD756 }, |
|---|
| 319 | {PCI_VENDOR_ID_AMD, 0x7413, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD766 }, |
|---|
| 320 | {PCI_VENDOR_ID_AMD, 0x7443, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD768 }, |
|---|
| 321 | {PCI_VENDOR_ID_NVIDIA, 0x01B4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, NFORCE }, |
|---|
| 322 | { 0, } |
|---|
| 323 | }; |
|---|
| 324 | |
|---|
| 325 | static int __devinit amd756_probe(struct pci_dev *pdev, |
|---|
| 326 | const struct pci_device_id *id) |
|---|
| 327 | { |
|---|
| 328 | int nforce = (id->driver_data == NFORCE), error; |
|---|
| 329 | u8 temp; |
|---|
| 330 | |
|---|
| 331 | if (amd756_ioport) { |
|---|
| 332 | printk(KERN_ERR DRV_NAME ": Only one device supported. " |
|---|
| 333 | "(you have a strange motherboard, btw..)\n"); |
|---|
| 334 | return -ENODEV; |
|---|
| 335 | } |
|---|
| 336 | |
|---|
| 337 | if (nforce) { |
|---|
| 338 | if (PCI_FUNC(pdev->devfn) != 1) |
|---|
| 339 | return -ENODEV; |
|---|
| 340 | |
|---|
| 341 | pci_read_config_word(pdev, SMBBANFORCE, &amd756_ioport); |
|---|
| 342 | amd756_ioport &= 0xfffc; |
|---|
| 343 | } else { /* amd */ |
|---|
| 344 | if (PCI_FUNC(pdev->devfn) != 3) |
|---|
| 345 | return -ENODEV; |
|---|
| 346 | |
|---|
| 347 | pci_read_config_byte(pdev, SMBGCFG, &temp); |
|---|
| 348 | if ((temp & 128) == 0) { |
|---|
| 349 | printk(KERN_ERR DRV_NAME |
|---|
| 350 | ": Error: SMBus controller I/O not enabled!\n"); |
|---|
| 351 | return -ENODEV; |
|---|
| 352 | } |
|---|
| 353 | |
|---|
| 354 | /* Determine the address of the SMBus areas */ |
|---|
| 355 | /* Technically it is a dword but... */ |
|---|
| 356 | pci_read_config_word(pdev, SMBBA, &amd756_ioport); |
|---|
| 357 | amd756_ioport &= 0xff00; |
|---|
| 358 | amd756_ioport += SMB_ADDR_OFFSET; |
|---|
| 359 | } |
|---|
| 360 | |
|---|
| 361 | if (!request_region(amd756_ioport, SMB_IOSIZE, "amd756-smbus")) { |
|---|
| 362 | printk(KERN_ERR DRV_NAME |
|---|
| 363 | ": SMB region 0x%x already in use!\n", amd756_ioport); |
|---|
| 364 | return -ENODEV; |
|---|
| 365 | } |
|---|
| 366 | |
|---|
| 367 | #ifdef DEBUG |
|---|
| 368 | pci_read_config_byte(pdev, SMBREV, &temp); |
|---|
| 369 | printk(KERN_DEBUG DRV_NAME ": SMBREV = 0x%X\n", temp); |
|---|
| 370 | printk(KERN_DEBUG DRV_NAME ": AMD756_smba = 0x%X\n", amd756_ioport); |
|---|
| 371 | #endif |
|---|
| 372 | |
|---|
| 373 | sprintf(amd756_adapter.name, |
|---|
| 374 | "SMBus AMD75x adapter at %04x", amd756_ioport); |
|---|
| 375 | |
|---|
| 376 | error = i2c_add_adapter(&amd756_adapter); |
|---|
| 377 | if (error) { |
|---|
| 378 | printk(KERN_ERR DRV_NAME |
|---|
| 379 | ": Adapter registration failed, module not inserted.\n"); |
|---|
| 380 | goto out_err; |
|---|
| 381 | } |
|---|
| 382 | |
|---|
| 383 | return 0; |
|---|
| 384 | |
|---|
| 385 | out_err: |
|---|
| 386 | release_region(amd756_ioport, SMB_IOSIZE); |
|---|
| 387 | return error; |
|---|
| 388 | } |
|---|
| 389 | |
|---|
| 390 | |
|---|
| 391 | static void __devexit amd756_remove(struct pci_dev *dev) |
|---|
| 392 | { |
|---|
| 393 | i2c_del_adapter(&amd756_adapter); |
|---|
| 394 | } |
|---|
| 395 | |
|---|
| 396 | static struct pci_driver amd756_driver = { |
|---|
| 397 | .name = "amd75x smbus", |
|---|
| 398 | .id_table = amd756_ids, |
|---|
| 399 | .probe = amd756_probe, |
|---|
| 400 | .remove = __devexit_p(amd756_remove), |
|---|
| 401 | }; |
|---|
| 402 | |
|---|
| 403 | static int __init i2c_amd756_init(void) |
|---|
| 404 | { |
|---|
| 405 | printk(KERN_INFO "i2c-amd756.o version %s (%s)\n", LM_VERSION, LM_DATE); |
|---|
| 406 | return pci_module_init(&amd756_driver); |
|---|
| 407 | } |
|---|
| 408 | |
|---|
| 409 | |
|---|
| 410 | static void __exit i2c_amd756_exit(void) |
|---|
| 411 | { |
|---|
| 412 | pci_unregister_driver(&amd756_driver); |
|---|
| 413 | release_region(amd756_ioport, SMB_IOSIZE); |
|---|
| 414 | } |
|---|
| 415 | |
|---|
| 416 | MODULE_AUTHOR("Merlin Hughes <merlin@merlin.org>"); |
|---|
| 417 | MODULE_DESCRIPTION("AMD756/766/768/nVidia nForce SMBus driver"); |
|---|
| 418 | MODULE_LICENSE("GPL"); |
|---|
| 419 | |
|---|
| 420 | module_init(i2c_amd756_init) |
|---|
| 421 | module_exit(i2c_amd756_exit) |
|---|