From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v3 7/7] ACPI: property: Replicate DT-aligned u32 properties from DisCo for Imaging
Date: Mon, 06 Nov 2023 17:31:18 +0100 [thread overview]
Message-ID: <4325211.ejJDZkT8p0@kreacher> (raw)
In-Reply-To: <4542595.LvFx2qVVIh@kreacher>
From: Sakari Ailus <sakari.ailus@linux.intel.com>
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>
---
drivers/acpi/mipi-disco-img.c | 17 +++++++++++++++++
include/acpi/acpi_bus.h | 4 ++++
2 files changed, 21 insertions(+)
Index: linux-pm/drivers/acpi/mipi-disco-img.c
===================================================================
--- linux-pm.orig/drivers/acpi/mipi-disco-img.c
+++ linux-pm/drivers/acpi/mipi-disco-img.c
@@ -597,6 +597,7 @@ static void init_crs_csi2_swnodes(struct
struct acpi_device *adev;
acpi_status status;
unsigned int i;
+ u32 val;
int ret;
/*
@@ -628,6 +629,22 @@ static void init_crs_csi2_swnodes(struct
}
}
+ 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");
Index: linux-pm/include/acpi/acpi_bus.h
===================================================================
--- linux-pm.orig/include/acpi/acpi_bus.h
+++ linux-pm/include/acpi/acpi_bus.h
@@ -381,6 +381,10 @@ struct acpi_gpio_mapping;
enum acpi_device_swnode_dev_props {
ACPI_DEVICE_SWNODE_DEV_ROTATION,
+ ACPI_DEVICE_SWNODE_DEV_CLOCK_FREQUENCY,
+ ACPI_DEVICE_SWNODE_DEV_LED_MAX_MICROAMP,
+ ACPI_DEVICE_SWNODE_DEV_FLASH_MAX_MICROAMP,
+ ACPI_DEVICE_SWNODE_DEV_FLASH_MAX_TIMEOUT_US,
ACPI_DEVICE_SWNODE_DEV_NUM_OF,
ACPI_DEVICE_SWNODE_DEV_NUM_ENTRIES
};
next prev parent reply other threads:[~2023-11-06 16:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 16:03 [PATCH v3 0/7] ACPI: scan: MIPI DisCo for Imaging support Rafael J. Wysocki
2023-11-06 16:06 ` [PATCH v3 1/7] ACPI: property: Support using strings in reference properties Rafael J. Wysocki
2023-11-06 16:09 ` [PATCH v3 2/7] ACPI: scan: Extract CSI-2 connection graph from _CRS Rafael J. Wysocki
2024-11-21 21:57 ` Miao Wang
2024-12-03 19:44 ` Rafael J. Wysocki
2024-12-05 7:23 ` Miao Wang
2024-12-05 10:54 ` Rafael J. Wysocki
2024-12-08 13:53 ` Miao Wang
2023-11-06 16:16 ` [PATCH v3 3/7] ACPI: scan: Extract _CRS CSI-2 connection information into swnodes Rafael J. Wysocki
2023-11-06 16:16 ` [PATCH v3 4/7] device property: Add SOFTWARE_NODE() macro for defining software nodes Rafael J. Wysocki
2023-11-06 16:27 ` [PATCH v3 5/7] ACPI: scan: Extract MIPI DisCo for Imaging data into swnodes Rafael J. Wysocki
2023-11-06 21:50 ` Sakari Ailus
2023-11-07 20:06 ` Rafael J. Wysocki
2023-11-06 16:28 ` [PATCH v3 6/7] ACPI: property: Dig "rotation" property for devices with CSI2 _CRS Rafael J. Wysocki
2023-11-06 16:31 ` Rafael J. Wysocki [this message]
2023-11-06 16:47 ` [PATCH v3 0/7] ACPI: scan: MIPI DisCo for Imaging support Rafael J. Wysocki
2023-11-07 19:19 ` [PATCH v3.1 5/7] ACPI: scan: Extract MIPI DisCo for Imaging data into swnodes Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4325211.ejJDZkT8p0@kreacher \
--to=rjw@rjwysocki.net \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox