diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2010-10-08 16:40:23 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2010-10-08 16:40:23 +0000 |
commit | 3b8db813809f3485ceaa77bf91595e64cc588d92 (patch) | |
tree | 5d0058b2263809d5254e9e173253aea4dc801f6a /src/southbridge/intel/i82801bx/i82801bx_smbus.c | |
parent | c3af12fb8a930b8885b1c6c6b35d2aeff155b3c3 (diff) |
Intel 82801ax/82801bx: Fix and hook up i82801xx_smbus.c.
- Fix incorrect #includes, add missing ones.
- Drop unused do_smbus_write_block() and smbus_wait_until_blk_done().
- Pass smbus_io_base to all functions as the other ICH implementations do.
- Random other fixes which are required to make it build.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5924 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge/intel/i82801bx/i82801bx_smbus.c')
-rw-r--r-- | src/southbridge/intel/i82801bx/i82801bx_smbus.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/southbridge/intel/i82801bx/i82801bx_smbus.c b/src/southbridge/intel/i82801bx/i82801bx_smbus.c index 8a5476f494..671d73445c 100644 --- a/src/southbridge/intel/i82801bx/i82801bx_smbus.c +++ b/src/southbridge/intel/i82801bx/i82801bx_smbus.c @@ -18,28 +18,29 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* TODO: Check datasheets if this will work for all ICH* southbridges. */ - #include <stdint.h> -#include <smbus.h> -#include <pci.h> +#include <device/smbus.h> +#include <device/pci.h> +#include <device/pci_ids.h> #include <arch/io.h> #include "i82801bx.h" -#include "i82801_smbus.h" +#include "i82801bx_smbus.h" -static int smbus_read_byte(struct bus *bus, device_t dev, u8 address) +static int lsmbus_read_byte(device_t dev, u8 address) { - unsigned device; /* TODO: u16? */ + u16 device; struct resource *res; + struct bus *pbus; device = dev->path.i2c.device; - res = find_resource(bus->dev, 0x20); + pbus = get_pbus_smbus(dev); + res = find_resource(pbus->dev, 0x20); return do_smbus_read_byte(res->base, device, address); } static struct smbus_bus_operations lops_smbus_bus = { - .read_byte = smbus_read_byte, + .read_byte = lsmbus_read_byte, }; static const struct device_operations smbus_ops = { @@ -48,7 +49,7 @@ static const struct device_operations smbus_ops = { .enable_resources = pci_dev_enable_resources, .init = 0, .scan_bus = scan_static_bus, - .enable = i82801er_enable, + .enable = i82801bx_enable, .ops_smbus_bus = &lops_smbus_bus, }; |