Skip to content

xm: probe for ImageDesign (MIS) sensors - #252

Merged
widgetii merged 1 commit into
masterfrom
xm-imagedesign
Oct 18, 2026
Merged

widgetii merged 1 commit into
masterfrom
xm-imagedesign

Conversation

@widgetii

Copy link
Copy Markdown
Member

On Xiongmai, ipcinfo --short-sensor prints nothing for a MIS2003 board, so the WebUI shows the sensor as unknown (OpenIPC/openxiongmai#8).

The XM HAL's xm_possible_i2c_addrs has no SENSOR_IMAGEDESIGN entry, so detect_imagedesign_sensor never runs on XM. libsns_X123_XM530 finds MIS2003/MIS2006 at 0x30 (0x60 in the 8-bit form this table uses) and reads the ID from 0x3000/0x3001, which is exactly what detect_imagedesign_sensor already does. This adds the address. clang-format reflows the table once the line gets longer.

Tested

  • Lab XM550 + IMX335, unpacked static ipcinfo from this branch (arm-openipc-linux-musleabi gcc 13):
    stock: imx335 / xm550
    new: [imx335] / [xm550] rc=0
    imx335_i2c
    
    Sony is probed first, so the new entry doesn't change what an IMX335 board reports.
  • MIS2003: no board available. In the qemu-hisilicon xm530 machine with an emulated MIS2003 (ID 0x2003 at 0x30), booting nightly-20261016-2a2e35c:
    IPC_STOCK=[] IPC_NEW=[mis2003] LONG=[mis2003_i2c] LIB=/usr/lib/sensors/libsns_X123_XM530.so
    
    load_xiongmai keeps choosing libsns_X123_XM530: only imx335/sc335e map to X50.
  • cYAML_test passes.

The UPX-packed build couldn't be tried on the camera: the local UPX 5 stub needs memfd_create, which this 3.10 kernel doesn't have. That's separate from this change.

The XM HAL listed no ImageDesign address, so detect_imagedesign_sensor
never ran on Xiongmai and a MIS2003 board reported no sensor at all: the
WebUI showed "unknown". libsns_X123_XM530 finds MIS2003/MIS2006 at 0x30
(0x60 8-bit), reading the ID from 0x3000/0x3001, which is what
detect_imagedesign_sensor already does.

Reported in OpenIPC/openxiongmai#8.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

xm: enable ImageDesign MIS sensor detection

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Add the ImageDesign I²C address to XM sensor candidates so existing MIS detection can run.
• Allow MIS2003/MIS2006 boards to report a sensor instead of unknown, without changing the probe.
Diagram

graph TD
  A["XM HAL"] --> B["Address table"] --> C["Probe dispatch"] --> D["MIS ID probe"] --> E["XM I2C"] --> F["MIS sensor"]
  D --> G["Sensor ID"]
Loading
High-Level Assessment

Adding the address to XM's existing candidate table is the smallest appropriate fix: it reuses the established ID probe and preserves probe ordering. A separate XM-specific detector would duplicate that logic.

Files changed (1) +7 / -7

Bug fix (1) +7 / -7
xm.cEnable ImageDesign probing at the XM MIS sensor address +7/-7

Enable ImageDesign probing at the XM MIS sensor address

• Adds the 8-bit address 0x60 for ImageDesign MIS2003/MIS2006 sensors to XM's candidate table, allowing the existing ID probe to run. The table is also reformatted.

src/hal/xm.c

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can move or hide resolved findings to focus on what still needs action

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@widgetii
widgetii merged commit 2515e48 into master Oct 18, 2026
5 checks passed
@widgetii
widgetii deleted the xm-imagedesign branch October 18, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant