drivers/intel/mipi_camera: Rework info print output

Fix the INFO print for a mipi camera device:

- fix device path type for generic devices
- print parent device path and PCI devfn for generic devices
- reformat the output for both device types to improve readability

before:
[INFO ]  \_SB.PCI0.IPU0.IPU0: Intel MIPI Camera Device I2C address 00h
[INFO ]  \_SB.PCI0.I2C3.CAM0: Intel MIPI Camera Device I2C address 010h
[INFO ]  \_SB.PCI0.I2C3.VCM0: Intel MIPI Camera Device I2C address 0ch
[INFO ]  \_SB.PCI0.I2C3.NVM0: Intel MIPI Camera Device I2C address 050h

after:
[INFO ]  \_SB.PCI0.IPU0: Intel MIPI Camera Device at PCI 05.0
[INFO ]  \_SB.PCI0.I2C3.CAM0: Intel MIPI Camera Device at I2C 0x10
[INFO ]  \_SB.PCI0.I2C3.VCM0: Intel MIPI Camera Device at I2C 0x0c
[INFO ]  \_SB.PCI0.I2C3.NVM0: Intel MIPI Camera Device at I2C 0x50

Change-Id: I5c4a072e35c4e0a14b6df0d5f199c5ffb3d61d32
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87249
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
This commit is contained in:
Matt DeVillier 2025-04-08 13:01:00 -05:00
commit fc8e88da9b

View file

@ -930,10 +930,9 @@ static void camera_fill_ssdt(const struct device *dev)
{
struct drivers_intel_mipi_camera_config *config = dev->chip_info;
const char *scope = NULL;
const struct device *pdev;
const struct device *pdev = dev->upstream->dev;
if (config->has_power_resource) {
pdev = dev->upstream->dev;
if (!pdev || !pdev->enabled)
return;
@ -957,7 +956,6 @@ static void camera_fill_ssdt(const struct device *dev)
write_i2c_camera_device(dev, scope);
break;
case DEVICE_PATH_GENERIC:
pdev = dev->upstream->dev;
scope = acpi_device_scope(pdev);
if (!scope)
return;
@ -976,11 +974,12 @@ static void camera_fill_ssdt(const struct device *dev)
acpigen_pop_len(); /* Device */
acpigen_pop_len(); /* Scope */
if (dev->path.type == DEVICE_PATH_PCI) {
printk(BIOS_INFO, "%s: %s PCI address 0%x\n", acpi_device_path(dev),
dev->chip_ops->name, dev->path.pci.devfn);
if (dev->path.type == DEVICE_PATH_GENERIC) {
printk(BIOS_INFO, "%s: %s at PCI %02x.%01x\n", acpi_device_path(pdev),
dev->chip_ops->name, PCI_SLOT(pdev->path.pci.devfn),
PCI_FUNC(pdev->path.pci.devfn));
} else {
printk(BIOS_INFO, "%s: %s I2C address 0%xh\n", acpi_device_path(dev),
printk(BIOS_INFO, "%s: %s at I2C 0x%02x\n", acpi_device_path(dev),
dev->chip_ops->name, dev->path.i2c.device);
}
}