soc/amd/common/block/smbus: move ACPI name to common code
Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I47415be02571240d3cecfdb91cb9f8097c5b7fde Reviewed-on: https://review.coreboot.org/c/coreboot/+/50819 Reviewed-by: Raul Rangel <rrangel@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
@@ -58,6 +58,7 @@ static int lsmbus_write_byte(struct device *dev, u8 address, u8 val)
|
|||||||
device = dev->path.i2c.device;
|
device = dev->path.i2c.device;
|
||||||
return do_smbus_write_byte(get_sm_mmio(dev), device, address, val);
|
return do_smbus_write_byte(get_sm_mmio(dev), device, address, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct smbus_bus_operations lops_smbus_bus = {
|
static struct smbus_bus_operations lops_smbus_bus = {
|
||||||
.recv_byte = lsmbus_recv_byte,
|
.recv_byte = lsmbus_recv_byte,
|
||||||
.send_byte = lsmbus_send_byte,
|
.send_byte = lsmbus_send_byte,
|
||||||
@@ -65,15 +66,26 @@ static struct smbus_bus_operations lops_smbus_bus = {
|
|||||||
.write_byte = lsmbus_write_byte,
|
.write_byte = lsmbus_write_byte,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if CONFIG(HAVE_ACPI_TABLES)
|
||||||
|
static const char *smbus_acpi_name(const struct device *dev)
|
||||||
|
{
|
||||||
|
return "SBUS";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct device_operations smbus_ops = {
|
static struct device_operations smbus_ops = {
|
||||||
.read_resources = noop_read_resources,
|
.read_resources = noop_read_resources,
|
||||||
.set_resources = noop_set_resources,
|
.set_resources = noop_set_resources,
|
||||||
.enable_resources = pci_dev_enable_resources,
|
.enable_resources = pci_dev_enable_resources,
|
||||||
.init = sm_init,
|
.init = sm_init,
|
||||||
.scan_bus = scan_smbus,
|
.scan_bus = scan_smbus,
|
||||||
.ops_pci = &pci_dev_ops_pci,
|
.ops_pci = &pci_dev_ops_pci,
|
||||||
.ops_smbus_bus = &lops_smbus_bus,
|
.ops_smbus_bus = &lops_smbus_bus,
|
||||||
|
#if CONFIG(HAVE_ACPI_TABLES)
|
||||||
|
.acpi_name = smbus_acpi_name,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct pci_driver smbus_driver __pci_driver = {
|
static const struct pci_driver smbus_driver __pci_driver = {
|
||||||
.ops = &smbus_ops,
|
.ops = &smbus_ops,
|
||||||
.vendor = PCI_VENDOR_ID_AMD,
|
.vendor = PCI_VENDOR_ID_AMD,
|
||||||
|
@@ -39,8 +39,6 @@ static const char *soc_acpi_name(const struct device *dev)
|
|||||||
return "GNB";
|
return "GNB";
|
||||||
case IOMMU_DEVFN:
|
case IOMMU_DEVFN:
|
||||||
return "IOMM";
|
return "IOMM";
|
||||||
case SMBUS_DEVFN:
|
|
||||||
return "SBUS";
|
|
||||||
default:
|
default:
|
||||||
printk(BIOS_WARNING, "Unknown root PCI device: dev: %d, fn: %d\n",
|
printk(BIOS_WARNING, "Unknown root PCI device: dev: %d, fn: %d\n",
|
||||||
PCI_SLOT(dev->path.pci.devfn), PCI_FUNC(dev->path.pci.devfn));
|
PCI_SLOT(dev->path.pci.devfn), PCI_FUNC(dev->path.pci.devfn));
|
||||||
|
@@ -83,8 +83,6 @@ const char *soc_acpi_name(const struct device *dev)
|
|||||||
return "EHC0";
|
return "EHC0";
|
||||||
case SD_DEVFN:
|
case SD_DEVFN:
|
||||||
return "SDCN";
|
return "SDCN";
|
||||||
case SMBUS_DEVFN:
|
|
||||||
return "SBUS";
|
|
||||||
case XHCI_DEVFN:
|
case XHCI_DEVFN:
|
||||||
return "XHC0";
|
return "XHC0";
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user