[PATCH v4 5/6] media: ipu-bridge: Index the sensor device properties as the endpoint ones

From: Sergey Lebedev

Date: Tue Nov 10 2026 - 15:00:40 EST


Fill dev_properties through an enum and IPU_BRIDGE_NEXT_PROPERTY(), as
ep_properties already is, so that an entry can be added without
counting slots by hand. No functional change.

Signed-off-by: Sergey Lebedev <lsa.uz@xxxxx>
---
New in v4 (Sakari). The series that keeps what the software nodes point
to out of the module image is probably D. Manresa's, recalled on v3; it
changes the same lens-focus line, so whichever lands second needs a
trivial rebase:
https://lore.kernel.org/all/20261026082549.662885-1-dmanresa@xxxxxxxxx/

drivers/media/pci/intel/ipu-bridge.c | 19 ++++++++-----------
include/media/ipu-bridge.h | 11 ++++++++++-
2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c
index c99c85b7e6f..2399a3d52b6 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -570,7 +570,7 @@ static void ipu_bridge_create_fwnode_properties(
{
struct ipu_property_names *names = &sensor->prop_names;
struct software_node *nodes = sensor->swnodes;
- unsigned int i = 0;
+ unsigned int i = 0, d = 0;

sensor->prop_names = prop_names;

@@ -612,19 +612,16 @@ static void ipu_bridge_create_fwnode_properties(
SOFTWARE_NODE_REFERENCE(&nodes[SWNODE_SENSOR_ENDPOINT]);
}

- sensor->dev_properties[0] = PROPERTY_ENTRY_U32(
- sensor->prop_names.clock_frequency,
- sensor->mclkspeed);
- sensor->dev_properties[1] = PROPERTY_ENTRY_U32(
- sensor->prop_names.rotation,
- sensor->rotation);
- sensor->dev_properties[2] = PROPERTY_ENTRY_U32(
- sensor->prop_names.orientation,
- sensor->orientation);
+ sensor->dev_properties[IPU_BRIDGE_NEXT_PROPERTY(d, DEV_CLOCK_FREQUENCY)] =
+ PROPERTY_ENTRY_U32(names->clock_frequency, sensor->mclkspeed);
+ sensor->dev_properties[IPU_BRIDGE_NEXT_PROPERTY(d, DEV_ROTATION)] =
+ PROPERTY_ENTRY_U32(names->rotation, sensor->rotation);
+ sensor->dev_properties[IPU_BRIDGE_NEXT_PROPERTY(d, DEV_ORIENTATION)] =
+ PROPERTY_ENTRY_U32(names->orientation, sensor->orientation);
if (sensor->vcm_type) {
sensor->vcm_ref[0] =
SOFTWARE_NODE_REFERENCE(&sensor->swnodes[SWNODE_VCM]);
- sensor->dev_properties[3] =
+ sensor->dev_properties[IPU_BRIDGE_NEXT_PROPERTY(d, DEV_LENS_FOCUS)] =
PROPERTY_ENTRY_REF_ARRAY("lens-focus", sensor->vcm_ref);
}

diff --git a/include/media/ipu-bridge.h b/include/media/ipu-bridge.h
index 3ef94c2b767..284e0d6cc93 100644
--- a/include/media/ipu-bridge.h
+++ b/include/media/ipu-bridge.h
@@ -89,6 +89,15 @@ enum ipu_bridge_ep_props {
IPU_BRIDGE_EP_NUM_ENTRIES
};

+enum ipu_bridge_dev_props {
+ IPU_BRIDGE_DEV_CLOCK_FREQUENCY,
+ IPU_BRIDGE_DEV_ROTATION,
+ IPU_BRIDGE_DEV_ORIENTATION,
+ IPU_BRIDGE_DEV_LENS_FOCUS,
+ IPU_BRIDGE_DEV_NUM_OF,
+ IPU_BRIDGE_DEV_NUM_ENTRIES
+};
+
/*
* Get the index of the next property in a property array, with a given maximum
* value.
@@ -179,7 +188,7 @@ struct ipu_sensor {

struct ipu_property_names prop_names;
struct property_entry ep_properties[IPU_BRIDGE_EP_NUM_ENTRIES];
- struct property_entry dev_properties[5];
+ struct property_entry dev_properties[IPU_BRIDGE_DEV_NUM_ENTRIES];
struct property_entry ipu_properties[3];
struct property_entry ivsc_properties[1];
struct property_entry ivsc_sensor_ep_properties[4];
--
2.54.0