From cd91db953ca254e0a03640fdc597dae6b616e155 Mon Sep 17 00:00:00 2001 From: "Pandya, Varshit B" Date: Thu, 3 Sep 2020 20:38:46 +0530 Subject: drivers/intel/mipi_camera: Add compatible field for NVM Add compatible field for NVM Make PRP0001 as default HID if device type is INTEL_ACPI_CAMERA_NVM Signed-off-by: Pandya, Varshit B Change-Id: Iad7afa7b3170982eb5d6215e766f3e98f7a89213 Reviewed-on: https://review.coreboot.org/c/coreboot/+/45091 Tested-by: build bot (Jenkins) Reviewed-by: Rizwan Qureshi --- src/drivers/intel/mipi_camera/camera.c | 9 ++++++--- src/drivers/intel/mipi_camera/chip.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/drivers/intel/mipi_camera/camera.c b/src/drivers/intel/mipi_camera/camera.c index 6f237a9ba8..fed0ff6cba 100644 --- a/src/drivers/intel/mipi_camera/camera.c +++ b/src/drivers/intel/mipi_camera/camera.c @@ -454,6 +454,9 @@ static void camera_fill_nvm(const struct device *dev) struct drivers_intel_mipi_camera_config *config = dev->chip_info; struct acpi_dp *dsd = acpi_dp_new_table("_DSD"); + if (!config->nvm_compat) + return; + /* It might be possible to default size or width based on type. */ if (!config->disable_nvm_defaults && !config->nvm_pagesize) config->nvm_pagesize = 1; @@ -473,6 +476,7 @@ static void camera_fill_nvm(const struct device *dev) if (config->nvm_width) acpi_dp_add_integer(dsd, "address-width", config->nvm_width); + acpi_dp_add_string(dsd, "compatible", config->nvm_compat); acpi_dp_write(dsd); } @@ -822,10 +826,9 @@ static void write_i2c_camera_device(const struct device *dev, const char *scope) if (config->acpi_hid) acpigen_write_name_string("_HID", config->acpi_hid); - else if (config->device_type == INTEL_ACPI_CAMERA_VCM) + else if (config->device_type == INTEL_ACPI_CAMERA_VCM || + config->device_type == INTEL_ACPI_CAMERA_NVM) acpigen_write_name_string("_HID", ACPI_DT_NAMESPACE_HID); - else if (config->device_type == INTEL_ACPI_CAMERA_NVM) - acpigen_write_name_string("_HID", "INT3499"); acpigen_write_name_integer("_UID", config->acpi_uid); acpigen_write_name_string("_DDN", config->chip_name); diff --git a/src/drivers/intel/mipi_camera/chip.h b/src/drivers/intel/mipi_camera/chip.h index d91e1e749d..28f8464ec2 100644 --- a/src/drivers/intel/mipi_camera/chip.h +++ b/src/drivers/intel/mipi_camera/chip.h @@ -241,6 +241,7 @@ struct drivers_intel_mipi_camera_config { uint32_t nvm_pagesize; uint32_t nvm_readonly; uint32_t nvm_width; + const char *nvm_compat; /* Settings specific to vcm */ const char *vcm_compat; -- cgit v1.2.3