Do not rely on LED ring found for sj-201 detection

The Mark2 Dev-Kit and Mark2 retail device have different LED ring
hardware.

Only the TAS5806 is detectable over i2c for the retail Mark2 kit
so only use that for assuming a Mark2 device.
This commit is contained in:
j1nx 2023-01-02 12:31:56 +01:00
parent ecc61cbd52
commit dda79ade52
1 changed files with 7 additions and 5 deletions

View File

@ -54,7 +54,7 @@ fi
is_04=$(i2cdetect -y -a 1 0x04 0x04 | egrep "(04|UU)" | awk '{print $2}') # SJ201 Led Ring
if [ "${is_04}" == "04" ] || [ "${is_04}" == "UU" ] ; then
SJ201LED=found
echo "Mark2 SJ201 Leds $SJ201LED"
echo "Mark2-Devkit SJ201 Leds $SJ201LED"
fi
@ -102,15 +102,17 @@ if [ "$ADAFRUIT" ] ; then
/usr/sbin/i2cset -y 1 0x4b 30 # Set maximum volume to 30
fi
if [ "$TAS5806" ] && [ "$SJ201LED" ]; then
echo "Installing and configuring SJ201"
if [ "$TAS5806" ] ; then
echo "Installing and configuring SJ-201 HAT"
# Initializing XMOS xvf3510
dtoverlay xvf3510
xvf3510-flash --direct "/usr/lib/firmware/xvf3510/app_xvf3510_int_spi_boot_v4_1_0.bin"
# Initializing Texas Instruments 5806 Amplifier
/usr/bin/tas5806-init
# Initializing and resetting LED ring
/usr/bin/sj201-reset-led
if [ "$SJ201LED" ] ; then
# Initializing and resetting LED ring
/usr/bin/sj201-reset-led
fi
# Reset FAN to low speed
/usr/sbin/i2cset -a -y 1 0x04 101 30 i