2 * This file is part of the coreboot project.
4 * Copyright (C) 2005 Yinghai Lu <yinghailu@gmail.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include <device/smbus.h>
23 #include <device/pci.h>
24 #include <device/pci_ids.h>
27 #include "i82801ax_smbus.h"
29 static int lsmbus_read_byte(device_t dev, u8 address)
35 device = dev->path.i2c.device;
36 pbus = get_pbus_smbus(dev);
37 res = find_resource(pbus->dev, 0x20);
39 return do_smbus_read_byte(res->base, device, address);
42 static struct smbus_bus_operations lops_smbus_bus = {
43 .read_byte = lsmbus_read_byte,
46 static const struct device_operations smbus_ops = {
47 .read_resources = pci_dev_read_resources,
48 .set_resources = pci_dev_set_resources,
49 .enable_resources = pci_dev_enable_resources,
51 .scan_bus = scan_static_bus,
52 .enable = i82801ax_enable,
53 .ops_smbus_bus = &lops_smbus_bus,
57 static const struct pci_driver i82801aa_smb __pci_driver = {
59 .vendor = PCI_VENDOR_ID_INTEL,
60 .device = PCI_DEVICE_ID_INTEL_82801AA_SMB,
64 static const struct pci_driver i82801ab_smb __pci_driver = {
66 .vendor = PCI_VENDOR_ID_INTEL,
67 .device = PCI_DEVICE_ID_INTEL_82801AB_SMB,