stepan | 836ae29 | 2010-12-08 05:42:47 +0000 | [diff] [blame] | 1 | #include "smbus.h" |
Li-Ta Lo | 416b3d7 | 2006-03-02 18:02:24 +0000 | [diff] [blame] | 2 | |
| 3 | #define SMBUS_IO_BASE 0x6000 |
| 4 | |
| 5 | /* initialization for SMBus Controller */ |
Nils Jacobs | e474070 | 2010-07-26 23:46:25 +0000 | [diff] [blame] | 6 | static void cs5535_enable_smbus(void) |
Li-Ta Lo | 416b3d7 | 2006-03-02 18:02:24 +0000 | [diff] [blame] | 7 | { |
| 8 | unsigned char val; |
| 9 | |
Li-Ta Lo | 042f043 | 2006-03-17 20:11:38 +0000 | [diff] [blame] | 10 | /* reset SMBUS controller */ |
Li-Ta Lo | 71eae20 | 2006-03-13 21:58:43 +0000 | [diff] [blame] | 11 | outb(0, SMBUS_IO_BASE + SMB_CTRL2); |
Li-Ta Lo | 416b3d7 | 2006-03-02 18:02:24 +0000 | [diff] [blame] | 12 | |
Li-Ta Lo | 71eae20 | 2006-03-13 21:58:43 +0000 | [diff] [blame] | 13 | /* Set SCL freq and enable SMB controller */ |
| 14 | val = inb(SMBUS_IO_BASE + SMB_CTRL2); |
Li-Ta Lo | a413ecc | 2006-03-13 22:18:39 +0000 | [diff] [blame] | 15 | val |= ((0x20 << 1) | SMB_CTRL2_ENABLE); |
Li-Ta Lo | 71eae20 | 2006-03-13 21:58:43 +0000 | [diff] [blame] | 16 | outb(val, SMBUS_IO_BASE + SMB_CTRL2); |
Li-Ta Lo | 416b3d7 | 2006-03-02 18:02:24 +0000 | [diff] [blame] | 17 | |
Li-Ta Lo | 71eae20 | 2006-03-13 21:58:43 +0000 | [diff] [blame] | 18 | /* Setup SMBus host controller address to 0xEF */ |
Li-Ta Lo | 416b3d7 | 2006-03-02 18:02:24 +0000 | [diff] [blame] | 19 | val = inb(SMBUS_IO_BASE + SMB_ADD); |
| 20 | val |= (0xEF | SMB_ADD_SAEN); |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 21 | outb(val, SMBUS_IO_BASE + SMB_ADD); |
Li-Ta Lo | 042f043 | 2006-03-17 20:11:38 +0000 | [diff] [blame] | 22 | } |