diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2023-11-06 19:31:18 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-11-20 18:50:48 +0300 |
commit | 4cd57d6d527c3570827a6eb8bd790ae216a78ed9 (patch) | |
tree | b4778de80dc97d85432fca7a6643415e22835643 /drivers | |
parent | f533e43a2a3117cc59886cbcd66ca32e42cf1ea9 (diff) | |
download | linux-4cd57d6d527c3570827a6eb8bd790ae216a78ed9.tar.xz |
ACPI: property: Replicate DT-aligned u32 properties from DisCo for Imaging
MIPI DisCo for Imaging defines properties for camera sensors that
functionally align with DT equivalents.
Replicate these properties in the ACPI device swnodes so the code
using the corresponding DT properties already does not need to be
updated to deal with their MIPI counterparts directly.
The replicated properties are:
"mipi-img-clock-frequency" -> "clock-frequency"
"mipi-img-led-max-current" -> "led-max-microamp"
"mipi-img-flash-max-current" -> "flash-max-microamp"
"mipi-img-flash-max-timeout" -> "flash-max-timeout-us"
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
[ rjw: Changelog edits, removal of redundant braces ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/mipi-disco-img.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/acpi/mipi-disco-img.c b/drivers/acpi/mipi-disco-img.c index b2c7a4922804..cad72d1fc127 100644 --- a/drivers/acpi/mipi-disco-img.c +++ b/drivers/acpi/mipi-disco-img.c @@ -600,6 +600,7 @@ static void init_crs_csi2_swnodes(struct crs_csi2 *csi2) struct acpi_device *adev; acpi_status status; unsigned int i; + u32 val; int ret; /* @@ -631,6 +632,22 @@ static void init_crs_csi2_swnodes(struct crs_csi2 *csi2) } } + if (!fwnode_property_read_u32(adev_fwnode, "mipi-img-clock-frequency", &val)) + swnodes->dev_props[NEXT_PROPERTY(prop_index, DEV_CLOCK_FREQUENCY)] = + PROPERTY_ENTRY_U32("clock-frequency", val); + + if (!fwnode_property_read_u32(adev_fwnode, "mipi-img-led-max-current", &val)) + swnodes->dev_props[NEXT_PROPERTY(prop_index, DEV_LED_MAX_MICROAMP)] = + PROPERTY_ENTRY_U32("led-max-microamp", val); + + if (!fwnode_property_read_u32(adev_fwnode, "mipi-img-flash-max-current", &val)) + swnodes->dev_props[NEXT_PROPERTY(prop_index, DEV_FLASH_MAX_MICROAMP)] = + PROPERTY_ENTRY_U32("flash-max-microamp", val); + + if (!fwnode_property_read_u32(adev_fwnode, "mipi-img-flash-max-timeout-us", &val)) + swnodes->dev_props[NEXT_PROPERTY(prop_index, DEV_FLASH_MAX_TIMEOUT_US)] = + PROPERTY_ENTRY_U32("flash-max-timeout-us", val); + status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); if (ACPI_FAILURE(status)) { acpi_handle_info(handle, "Unable to get the path name\n"); |