1 #include <device/device.h>
2 #include <device/path.h>
3 #include <device/pci.h>
4 #include <device/pci_ids.h>
5 #include <device/pci_ops.h>
6 #include <device/smbus.h>
11 static int lsmbus_read_byte(device_t dev, u8 address)
17 device = dev->path.i2c.device;
18 pbus = get_pbus_smbus(dev);
19 res = find_resource(pbus->dev, 0x20);
21 return do_smbus_read_byte(res->base, device, address);
24 static struct smbus_bus_operations lops_smbus_bus = {
25 .read_byte = lsmbus_read_byte,
28 static struct pci_operations lops_pci = {
29 /* The subsystem id follows the ide controller */
33 static struct device_operations smbus_ops = {
34 .read_resources = pci_dev_read_resources,
35 .set_resources = pci_dev_set_resources,
36 .enable_resources = pci_dev_enable_resources,
38 .scan_bus = scan_static_bus,
39 .enable = i82801ex_enable,
41 .ops_smbus_bus = &lops_smbus_bus,
44 static const struct pci_driver smbus_driver __pci_driver = {
46 .vendor = PCI_VENDOR_ID_INTEL,
47 .device = PCI_DEVICE_ID_INTEL_82801ER_SMB,