Package: linux
Severity: wishlist
Dear maintainers,
The Debian kernel does not enable CONFIG_BMI323_I2C. On 2-in-1 convertible
laptops whose accelerometer is a Bosch BMI323 exposed under the ACPI ID
BOSC0200, no IIO device is created, so iio-sensor-proxy has no data source
and GNOME automatic screen rotation does not work.
The same hardware works correctly with Gentoo's gentoo-kernel-bin 6.18.48,
where this driver is enabled. This indicates that the sensor hardware itself
is functional and that the missing IIO device is due to the Debian kernel
configuration.
My machine:
H3C MegaBook 14 (2-in-1 convertible)
Intel Core Ultra 5 226V (Lunar Lake)
Accelerometer: Bosch BMI323, connected over I2C
ACPI device: BOSC0200:00
On Debian 13 (trixie) with kernel 7.1.8+deb13-amd64 (source version
7.1.8-1~bpo13+1):
$ grep BMI323 /boot/config-7.1.8+deb13-amd64
# CONFIG_BMI323_I2C is not set
# CONFIG_BMI323_SPI is not set
$ find /lib/modules/7.1.8+deb13-amd64 -name '*bmi323*'
(no output)
$ dmesg | grep -i bosc
[...] bmc150_accel_i2c i2c-BOSC0200:00: Invalid chip 0
$ ls /sys/bus/iio/devices/
(empty)
$ ls /sys/class/iio/
(empty)
iio-sensor-proxy 3.7-3 is installed from Debian main, but there is no IIO
device for it to read, so automatic screen rotation does not work.
The option is absent from Debian's kernel configuration, in both the backports
source matching the kernel I run and in stable trixie:
linux 7.1.8-1~bpo13+1 debian/config/config 8050 lines grep -ci bmi323
-> 0
linux 6.12.107-1 debian/config/config 8212 lines grep -ci bmi323
-> 0
In both files, the sibling driver in the same Kconfig directory is enabled
explicitly:
## file: drivers/iio/imu/bmi160/Kconfig
CONFIG_BMI160_I2C=m
CONFIG_BMI160_SPI=m
There is no entry referencing drivers/iio/imu/bmi323/Kconfig anywhere in
either file. The upstream Kconfig entry is:
config BMI323_I2C
tristate "Bosch BMI323 I2C driver"
depends on I2C
select BMI323
select REGMAP_I2C
It is a tristate with no default, so the option remains disabled when Debian's
configuration does not mention it. I could not find any Debian-specific reason
for it being disabled.
The "Invalid chip 0" line above is expected behaviour rather than an error. The
upstream bmc150 driver documents, in drivers/iio/accel/bmc150-accel-i2c.c, that
BOSC0200 is also used by BMI323-based devices such as the ASUS ROG Ally and
Ayaneo Air Plus. Because the bmc150 and BMI323 chip IDs differ, the bmc150
chip-ID check fails on those devices, which allows the BMI323 driver to bind
instead. On this system that handoff cannot happen, because the bmi323 driver
is not enabled in the Debian kernel.
Working configuration on the same hardware, with
sys-kernel/gentoo-kernel-bin-6.18.48:
$ ls /sys/bus/iio/devices/
iio:device0
$ cat /sys/bus/iio/devices/iio:device0/name
bmi323-imu
iio-sensor-proxy detects the device and GNOME automatic screen rotation works
normally.
Please enable the BMI323 I2C driver in the Debian kernel configuration:
## file: drivers/iio/imu/bmi323/Kconfig
CONFIG_BMI323_I2C=m
CONFIG_BMI323_SPI is not required for my hardware, since the sensor is
connected over I2C; enabling it as well may be appropriate for consistency
with the I2C driver.
The BOSC0200 + BMI323 combination is documented upstream for the ASUS ROG
Ally and Ayaneo Air Plus, so this change may benefit other affected systems
as well.
I searched the Debian BTS before filing; the closest match (#1106411, a bmc150
NULL-pointer dereference, since fixed) is a different issue.
Thank you for your work on the Debian kernel.