drivers/wifi/generic: Add support for CNVi dummy device ops

This change reorganizes drivers/wifi/generic to add a new
device_operations structure for dummy CNVi device. This is done to
make the organization of CNVi PCI device in devicetree consistent
with all the other internal PCI devices of the SoC i.e. without a chip
around the PCI device.

Thus, with this change, CNVi entry in devicetree can be changed from:
```
chip drivers/wifi/generic
	register "wake" = "xxyyzz"
	device pci xx.y on end # CNVi PCI device
end
```

to:

```
device pci xx.y on
	chip drivers/wifi/generic
		register "wake" = "xxyyzz"
		device generic 0 on end # Dummy CNVi device
	end
end # CNVi PCI device
```

The helper functions for ACPI/SMBIOS generation are also accordingly
updated to include _pcie_ and _cnvi_ in the function name.

Change-Id: Ib3cb9ed9b81ff8d6ac85a9aaf57b641caaa2f907
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46862
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Furquan Shaikh
2020-10-27 18:00:46 -07:00
committed by Patrick Georgi
parent 6017abbc2c
commit d4367505f1
4 changed files with 48 additions and 12 deletions

View File

@ -33,10 +33,15 @@ static int smbios_write_intel_wifi(struct device *dev, int *handle, unsigned lon
return len;
}
int smbios_write_wifi(struct device *dev, int *handle, unsigned long *current)
int smbios_write_wifi_pcie(struct device *dev, int *handle, unsigned long *current)
{
if (dev->vendor == PCI_VENDOR_ID_INTEL)
return smbios_write_intel_wifi(dev, handle, current);
return 0;
}
int smbios_write_wifi_cnvi(struct device *dev, int *handle, unsigned long *current)
{
return smbios_write_wifi_pcie(dev->bus->dev, handle, current);
}