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
26 #include "i82801_smbus.h"
28 static int smbus_read_byte(struct bus *bus, device_t dev, u8 address)
30 unsigned device; /* TODO: u16? */
33 device = dev->path.i2c.device;
34 res = find_resource(bus->dev, 0x20);
36 return do_smbus_read_byte(res->base, device, address);
39 static struct smbus_bus_operations lops_smbus_bus = {
40 .read_byte = smbus_read_byte,
43 static const struct device_operations smbus_ops = {
44 .read_resources = pci_dev_read_resources,
45 .set_resources = pci_dev_set_resources,
46 .enable_resources = pci_dev_enable_resources,
48 .scan_bus = scan_static_bus,
49 .enable = i82801er_enable,
50 .ops_smbus_bus = &lops_smbus_bus,
54 static const struct pci_driver i82801aa_smb __pci_driver = {
56 .vendor = PCI_VENDOR_ID_INTEL,
57 .device = PCI_DEVICE_ID_INTEL_82801AA_SMB,
61 static const struct pci_driver i82801ab_smb __pci_driver = {
63 .vendor = PCI_VENDOR_ID_INTEL,
64 .device = PCI_DEVICE_ID_INTEL_82801AB_SMB,