| 334 | | ctrl |= 0x7; |
| 335 | | pci_write_config_word(dev,ALI1563_SMBBA,ctrl); |
| 336 | | } |
| 337 | | |
| 338 | | static int __devinit ali1563_setup(struct pci_dev * dev) |
| 339 | | { |
| 340 | | u16 ctrl; |
| 341 | | |
| 342 | | pci_read_config_word(dev,ALI1563_SMBBA,&ctrl); |
| 343 | | |
| 344 | | /* Check if device is even enabled first */ |
| 345 | | if (!(ctrl & ALI1563_SMB_IOEN)) { |
| 346 | | printk(KERN_WARNING "ali1563: I/O space not enabled, trying manually\n"); |
| 347 | | ali1563_enable(dev); |
| 348 | | } |
| 349 | | if (!(ctrl & ALI1563_SMB_IOEN)) { |
| 350 | | printk(KERN_WARNING "ali1563: I/O space still not enabled, giving up\n"); |
| 351 | | goto Err; |
| 352 | | } |
| 353 | | if (!(ctrl & ALI1563_SMB_HOSTEN)) { |
| 354 | | printk(KERN_WARNING "ali1563: Host Controller not enabled\n"); |
| 355 | | goto Err; |
| 356 | | } |
| | 342 | |
| | 343 | /* Check if device is enabled */ |
| | 344 | if (!(ctrl & ALI1563_SMB_HOSTEN)) { |
| | 345 | printk(KERN_WARNING "ali1563: Host Controller not enabled\n"); |
| | 346 | goto Err; |
| | 347 | } |
| | 348 | if (!(ctrl & ALI1563_SMB_IOEN)) { |
| | 349 | printk(KERN_WARNING "I/O space not enabled, trying manually\n"); |
| | 350 | pci_write_config_word(dev, ALI1563_SMBBA, |
| | 351 | ctrl | ALI1563_SMB_IOEN); |
| | 352 | pci_read_config_word(dev, ALI1563_SMBBA, &ctrl); |
| | 353 | if (!(ctrl & ALI1563_SMB_IOEN)) { |
| | 354 | printk(KERN_WARNING "I/O space still not enabled, " |
| | 355 | "giving up\n"); |
| | 356 | goto Err; |
| | 357 | } |
| | 358 | } |
| | 359 | |