Identity
| Part | Silan SC7A20 3-axis accelerometer |
| Role | Tablet orientation / motion sensing |
| Bus / address | PineTab2 i2c5 addr 0x18; WHO_AM_I (reg 0x0f) = 0x11 |
| GPIO / IRQ | INT on GPIO3_A2 in the Linux DTS; IRQ is not wired in the first FreeBSD driver slice |
| PineTab2 DTS | compatible = "silan,sc7a20" |
| Linux reference | mainline drivers/iio/accel/st_accel*; SC7A20 is treated as LIS2DH-compatible |
Status — ◐ partial
The local tree now has a candidate iicbus driver at
src/sys/dev/iicbus/sc7a20.c, and PINETAB2 includes device sc7a20.
It probes silan,sc7a20, checks WHO_AM_I == 0x11, enables normal
100 Hz XYZ sampling, and exposes raw axis sysctls under
dev.sc7a20.0.*.
This is still bench-pending. No PineTab2 run has confirmed that the
chip responds on i2c5, that the board axis signs match the Linux
orientation policy, or that the GPIO3_A2 interrupt mapping works.
Driver Shape
dev.sc7a20.0.whoami— identity byte; expected0x11.dev.sc7a20.0.enable— write0/1to power down or resume 100 Hz sampling.dev.sc7a20.0.status— rawSTATUS_REG.dev.sc7a20.0.accel_{x,y,z}_raw— signed 12-bit sample shifted out of the left-justified output registers.dev.sc7a20.0.accel_{x,y,z}_mg— same first-pass value, named for the high-resolution +/-2 g mode’s approximate 1 mg/count scale.
The first slice intentionally avoids IRQs and evdev. Polled sysctls are enough to prove the I2C path and board orientation without adding a tablet policy surface before the hardware is on the bench.
Bring-Up Predicate
After a PineTab2 boot with the first-boot DTB:
sysctl dev.sc7a20.0
Expected first-pass evidence:
dev.sc7a20.0.whoamireports17(0x11).- One of
accel_*_mgsits near +/-1000 when the tablet is flat and stationary. - Rotating the tablet moves that +/-1000 g-vector between axes with a stable sign.
statuschanges while the tablet is being moved.
Open Work
- Wire the
GPIO3_A2interrupt and cache samples from a taskqueue worker, following the PinePhone Prompu6500pattern. - Confirm axis orientation against the panel’s native rotation before adding a compositor rotation daemon.
- Decide whether this stays as sysctls plus userland policy or grows an evdev / IIO-equivalent interface.