Rock 5B+ Display 8HD orientation sensor

Hi folks,
I’ve successfully got working the Radxa Display 8HD using the RadxaOS image, applying the overlay (rock-5b-plus-radxa-display-8hd.dts) after booting over HDMI.

In the display specs there is a listed Gravity Sensor for Rotation. I would like to know if this is already been integrated in the current DTB or if this needs to be accessed directly using I2C ?

Cheers

Alright I think I managed to fond some clues within the sources and the visible devices on the Display.

The acceleration device in use is: SC7A20 from Silan Microelectronics
It is connected over the same FPC as the MIPI-DSI display and the touch panel but the I2C device address for this device is 0x19.
In linux these devices are compatible with other accelerometers from ST, so checking the kernel tree it seems that using the configuration entry:

CONFIG_IIO_ST_ACCEL_3AXIS=m
…
CONFIG_IIO_INTERRUPT_TRIGGER=y

It will generate compatible kenel modules for the one in Display 8HD

Module Size Used by
st_accel_i2c 20480 0
st_accel 24576 1 st_accel_i2c
st_sensors_i2c 16384 1 st_accel_i2c
st_sensors 24576 2 st_accel_i2c,st_accel

Once this is done, will need to use iio_sensor_proxy (and to test it use monitor-sensor) to get the sensor information read and parsed, then it should be sent over dbus to window managers to apply.
Still to be done:

  • updated dtb : needs to be added as overlay or as part of the Display 8HD one.
  • add window manager actions: for wayland based or x11 based actions are different.

Cheers