From 0f026e935cc74f20352682d8c4eabc4c82ed1687 Mon Sep 17 00:00:00 2001 From: user Date: Tue, 6 Oct 2026 18:13:57 +0800 Subject: [PATCH] src: v4l2: getI2CBussAddress miss ov13b10-wf - Fix getI2CBusAddress matching wrong sensor instance when multiple entities share a name prefix (e.g. ov13b10-wf/uf) Signed-off-by: syafiqnizam25 --- src/v4l2/MediaControl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/v4l2/MediaControl.cpp b/src/v4l2/MediaControl.cpp index 807d4f4bf..e94d6560a 100644 --- a/src/v4l2/MediaControl.cpp +++ b/src/v4l2/MediaControl.cpp @@ -1162,9 +1162,11 @@ int MediaControl::getI2CBusAddress(const string& sensorEntityName, const string& } } - // entityName example: "imx319 10-0010", sensorEntityName example: "imx319" - if (entityName && (strlen(entityName) > (sensorEntityNameLen + 1U))) { - *i2cBus = entityName + sensorEntityNameLen + 1; + // VIDEO_PIXEL_ARRAY is the sensor entity. Find it through the topology, + // matching this specific candidate's exact name instead of the shared + // name prefix, since multiple sensor instances (e.g. wf/uf) can share it. + if (checkHasSource(sinkEntity, std::string(entity.info.name))) { + *i2cBus = entity.info.name + sensorEntityPrefix.length(); LOG1("i2cBus is %s", i2cBus->c_str()); return OK; }