aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarshit B Pandya <varshit.b.pandya@intel.com>2021-10-27 10:41:32 +0530
committerFelix Held <felix-coreboot@felixheld.de>2021-11-19 14:53:06 +0000
commit04e8c2b5ff85e246d6f711f58cc54b0e2ba91841 (patch)
tree0dc471ac6b2873aadb8b0dd0e34b12c5b69944cb
parent423e9e0fc0c6c20df32683be816368cb68374c05 (diff)
driver/intel/mipi_camera: Add support for _DSC field
The _DSC (Device State for Configuration) object evaluates to an integer may be used to tell Linux the highest allowed D state for a device during probe. The support for _DSC requires support from the kernel bus type if the bus driver normally sets the device in D0 state for probe. The D states and thus also the allowed values for _DSC are listed below. Number State Description 0 D0 Device fully powered on 1 D1 2 D2 3 D3hot 4 D3cold Off More details can be found here https://lkml.org/lkml/2021/10/25/397 BUG=none BRANCH=none TEST=Add corresponding field in brya, boot and dump SSDT to check if _DSC field is as per expectation. Name (_ADR, Zero) // _ADR: Address Name (_HID, "OVTI8856") // _HID: Hardware ID Name (_UID, Zero) // _UID: Unique ID Name (_DDN, "Ov 8856 Camera") // _DDN: DOS Device Name Method (_STA, 0, NotSerialized) // _STA: Status { Return (0x0F) } Method (_DSC, 0, NotSerialized) { Return (0x04) } Signed-off-by: Varshit B Pandya <varshit.b.pandya@intel.com> Change-Id: I5471f144918413a2982f86beaf3dbf7e4e66cc9b Reviewed-on: https://review.coreboot.org/c/coreboot/+/58767 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maulik V Vaghela <maulik.v.vaghela@intel.com> Reviewed-by: Subrata Banik <subrata.banik@intel.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
-rw-r--r--src/drivers/intel/mipi_camera/camera.c3
-rw-r--r--src/drivers/intel/mipi_camera/chip.h11
2 files changed, 14 insertions, 0 deletions
diff --git a/src/drivers/intel/mipi_camera/camera.c b/src/drivers/intel/mipi_camera/camera.c
index ec79e39a60..a9af25cf12 100644
--- a/src/drivers/intel/mipi_camera/camera.c
+++ b/src/drivers/intel/mipi_camera/camera.c
@@ -847,6 +847,9 @@ static void write_i2c_camera_device(const struct device *dev, const char *scope)
acpigen_write_name_integer("_UID", config->acpi_uid);
acpigen_write_name_string("_DDN", config->chip_name);
acpigen_write_STA(acpi_device_status(dev));
+ acpigen_write_method("_DSC", 0);
+ acpigen_write_return_integer(config->max_dstate_for_probe);
+ acpigen_pop_len(); /* Method _DSC */
/* Resources */
acpigen_write_name("_CRS");
diff --git a/src/drivers/intel/mipi_camera/chip.h b/src/drivers/intel/mipi_camera/chip.h
index c6ead1ffd6..55e9f33fb1 100644
--- a/src/drivers/intel/mipi_camera/chip.h
+++ b/src/drivers/intel/mipi_camera/chip.h
@@ -257,6 +257,17 @@ struct drivers_intel_mipi_camera_config {
bool has_power_resource;
/* Perform low power probe */
bool low_power_probe;
+ /*
+ * This will create a _DSC method in ACPI which returns an integer, to tell the kernel
+ * the highest allowed D state for a device during probe
+ * Number State Description
+ * 0 D0 Device fully powered on
+ * 1 D1
+ * 2 D2
+ * 3 D3hot
+ * 4 D3cold Off
+ */
+ uint8_t max_dstate_for_probe;
};
#endif