From 55ced327818d7e505cad9c208a14e16a922cd2d0 Mon Sep 17 00:00:00 2001 From: j1nx Date: Mon, 11 Dec 2023 07:56:44 +0000 Subject: [PATCH] [RPI] Upgrade i2csound system to detect both R6 and R10 SJ-201 boards Configuring the R6 fan the old way Configuring the R10 fan as kernel pwm model Configruing the buttons as standard linux input device --- .../rootfs-overlay/usr/libexec/ovos-i2csound | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/buildroot-external/board/ovos/raspberrypi/rootfs-overlay/usr/libexec/ovos-i2csound b/buildroot-external/board/ovos/raspberrypi/rootfs-overlay/usr/libexec/ovos-i2csound index ad69c9a3..55517398 100755 --- a/buildroot-external/board/ovos/raspberrypi/rootfs-overlay/usr/libexec/ovos-i2csound +++ b/buildroot-external/board/ovos/raspberrypi/rootfs-overlay/usr/libexec/ovos-i2csound @@ -40,6 +40,12 @@ if [ "${is_4b}" == "4b" ] || [ "${is_4b}" == "UU" ] ; then echo "Adafruit $ADAFRUIT" fi +is_2f=$(i2cdetect -y 1 0x2c 0x2c | grep -E "(2c|UU)" | awk '{print $2}') # TAS5806 +if [ "${is_2c}" == "2c" ] || [ "${is_2c}" == "UU" ] ; then + XMOS=found + echo "XMOS Chip $XMOS" +fi + is_2f=$(i2cdetect -y 1 0x2f 0x2f | grep -E "(2f|UU)" | awk '{print $2}') # TAS5806 if [ "${is_2f}" == "2f" ] || [ "${is_2f}" == "UU" ] ; then TAS5806=found @@ -81,9 +87,15 @@ if [ "$TAS5806" ] ; then # Initializing Texas Instruments 5806 Amplifier /usr/bin/tas5806-init if [ "$SJ201LED" ] ; then + echo "Found revision-6 SJ-201 board" # Initializing and resetting LED ring /usr/bin/sj201-reset-led + # Reset FAN to low speed + /usr/sbin/i2cset -a -y 1 0x04 101 30 i + else + echo "Assume revision-10 SJ-201 board" + dtoverlay sj201-rev10-pwm-fan-overlay fi - # Reset FAN to low speed - /usr/sbin/i2cset -a -y 1 0x04 101 30 i + echo "Configuring buttons" + dtoverlay sj201-buttons-overlay fi