Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

native: dump gpiochip parent + MAX98357A gpio consumer state

+21 -3
+21 -3
fedac/native/initramfs/init
··· 270 270 zcat /proc/config.gz 2>/dev/null | grep -E "^CONFIG_(PINCTRL_JASPERLAKE|PINCTRL_INTEL|PINCTRL_METEORLAKE|GPIOLIB|GPIO_ACPI|I2C_DESIGNWARE|SND_SOC_MAX98357A|SND_SOC_INTEL_SOF_RT5682)=" >> $LOG 271 271 fi 272 272 echo "GPIO chips:" >> $LOG 273 - ls /sys/bus/gpio/devices/ 2>/dev/null >> $LOG 274 - for chip in /sys/class/gpio/*; do 275 - [ -d "$chip" ] && echo " $(basename $chip)" >> $LOG 273 + for d in /sys/bus/gpio/devices/*; do 274 + [ -d "$d" ] || continue 275 + name=$(basename "$d") 276 + ngpio=$(cat "$d/dev" 2>/dev/null) 277 + label=$(cat "$d/label" 2>/dev/null) 278 + base=$(cat "$d/base" 2>/dev/null) 279 + # The device's parent is the platform_device — e.g. INT34C8:00 for JSL. 280 + parent=$(basename "$(readlink "$d/../../" 2>/dev/null)" 2>/dev/null) 281 + echo " $name label='$label' base=$base parent=$parent" >> $LOG 276 282 done 283 + # MAX98357A's GPIO consumer state — if the amp driver successfully got a 284 + # gpiod handle for SD_MODE, this directory has an `enable` gpio-* file. 285 + echo "MAX98357A GPIO consumers:" >> $LOG 286 + for d in /sys/bus/platform/devices/MX98360A:00/ /sys/bus/platform/devices/MAX98357A:*/; do 287 + [ -d "$d" ] || continue 288 + ls -la "$d" 2>/dev/null | grep -iE 'gpio|sdmode|enable|of_node' | head -10 >> $LOG 289 + done 290 + # gpio descriptor consumers — shows which driver holds which pin. 291 + if [ -r /sys/kernel/debug/gpio ]; then 292 + echo "gpio descriptor consumers (debugfs):" >> $LOG 293 + head -60 /sys/kernel/debug/gpio >> $LOG 2>&1 294 + fi 277 295 # MAX98357A amp state — if the driver is bound but SD_MODE GPIO isn't 278 296 # assigned, the amp stays in power-down mode and speakers are silent even 279 297 # though the sound card registers cleanly. Dump its device dir so we see