Merge pull request #113 from fewtarius/dev

Fix jacksense on the 351 devices.
This commit is contained in:
fewtarius 2022-05-05 22:04:04 -04:00 committed by GitHub
commit 74429041c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 5 deletions

View file

@ -7,6 +7,7 @@ DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=true
DEVICE_AUDIO_MIXER="Playback"
DEVICE_VOLUME_DEV="/dev/input/by-path/platform-rg351-keys-event"
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-rk817-sound-event"
DEVICE_CONTROLLER_DEV="/dev/input/event2"
DEVICE_BRIGHTNESS="70"
DISPLAY_ROTATED=false
@ -21,7 +22,7 @@ DEVICE_WIFI="5"
DEVICE_LED="77"
DEVICE_PWM_MOTOR="pwmchip0"
#DEVICE_PWM_FAN=""
DEVICE_JACK="/sys/class/gpio/gpio86/value"
DEVICE_JACK="86"
# FREQ governors
CPU_FREQ=("/sys/devices/system/cpu/cpufreq/policy0")

View file

@ -7,6 +7,7 @@ DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=true
DEVICE_AUDIO_MIXER="Playback"
DEVICE_VOLUME_DEV="/dev/input/by-path/platform-rg351-keys-event"
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-rk817-sound-event"
DEVICE_CONTROLLER_DEV="/dev/input/event3"
DEVICE_BRIGHTNESS="70"
DISPLAY_ROTATED=true
@ -21,7 +22,7 @@ DEVICE_WIFI="5"
DEVICE_LED="77"
DEVICE_PWM_MOTOR="pwmchip0"
#DEVICE_PWM_FAN=""
DEVICE_JACK="/sys/class/gpio/gpio86/value"
DEVICE_JACK="86"
# FREQ governors
CPU_FREQ=("/sys/devices/system/cpu/cpufreq/policy0")

View file

@ -7,6 +7,7 @@ DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=true
DEVICE_AUDIO_MIXER="Playback"
DEVICE_VOLUME_DEV="/dev/input/by-path/platform-rg351-keys-event"
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-rk817-sound-event"
DEVICE_CONTROLLER_DEV="/dev/input/event3"
DEVICE_BRIGHTNESS="70"
DISPLAY_ROTATED=false
@ -21,7 +22,7 @@ DEVICE_WIFI="5"
DEVICE_LED="77"
DEVICE_PWM_MOTOR="pwmchip0"
#DEVICE_PWM_FAN=""
DEVICE_JACK="/sys/class/gpio/gpio86/value"
DEVICE_JACK="86"
# FREQ governors
CPU_FREQ=("/sys/devices/system/cpu/cpufreq/policy0")

View file

@ -7,7 +7,7 @@
. /etc/profile
# Switch to headphones if we have them already connected at boot
GPIO=$(cat ${DEVICE_JACK})
GPIO=$(cat /sys/class/gpio/gpio${DEVICE_JACK}/value)
[[ "$GPIO" == "0" ]] && set_setting "audio.device" "headphone" || set_setting "audio.device" "speakers"
if [ -e "/storage/.config/system/configs/system.cfg" ]; then
@ -16,7 +16,7 @@ if [ -e "/storage/.config/system/configs/system.cfg" ]; then
fi
# Headphone sensing
DEVICE="${DEVICE_VOLUME_DEV}"
DEVICE="${DEVICE_HEADPHONE_DEV}"
HP_ON='*(SW_HEADPHONE_INSERT), value 0*'
HP_OFF='*(SW_HEADPHONE_INSERT), value 1*'