Fix HP sense on OGU, bump kernel to 6.1.53

This commit is contained in:
mason 2023-09-13 18:09:23 +00:00
parent 8508bdc29a
commit 15fbf13b93
No known key found for this signature in database
GPG key ID: 84D9278A11FA112B
6 changed files with 51 additions and 12 deletions

View file

@ -0,0 +1,12 @@
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
cat <<EOF >/storage/.config/profile.d/001-deviceconfig
DEVICE_FAKE_JACKSENSE="true"
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-hp-detect-switch-event"
DEVICE_VOLUMECTL="true"
DEVICE_POWER_LED="false"
DEVICE_BRIGHTNESS="128"
DEVICE_TEMP_SENSOR=("/sys/devices/virtual/thermal/thermal_zone0/temp" "/sys/devices/virtual/thermal/thermal_zone3/temp" "/sys/devices/virtual/thermal/thermal_zone2/temp")
EOF

View file

@ -6,7 +6,6 @@ cat <<EOF >/storage/.config/profile.d/001-deviceconfig
# Device Features # Device Features
DEVICE_VOLUMECTL="true" DEVICE_VOLUMECTL="true"
DEVICE_POWER_LED="false" DEVICE_POWER_LED="false"
DEVICE_SW_HP_SWITCH="true"
DEVICE_BRIGHTNESS="128" DEVICE_BRIGHTNESS="128"
DEVICE_TEMP_SENSOR=("/sys/devices/virtual/thermal/thermal_zone0/temp" "/sys/devices/virtual/thermal/thermal_zone3/temp" "/sys/devices/virtual/thermal/thermal_zone2/temp") DEVICE_TEMP_SENSOR=("/sys/devices/virtual/thermal/thermal_zone0/temp" "/sys/devices/virtual/thermal/thermal_zone3/temp" "/sys/devices/virtual/thermal/thermal_zone2/temp")
EOF EOF

View file

@ -12,12 +12,3 @@ EOF
### Set sound properties ### Set sound properties
amixer -c 0 -q sset 'FRDDR_A SINK 1 SEL' 'OUT 1' amixer -c 0 -q sset 'FRDDR_A SINK 1 SEL' 'OUT 1'
amixer -c 0 -q sset 'FRDDR_A SRC 1 EN' 'on' amixer -c 0 -q sset 'FRDDR_A SRC 1 EN' 'on'
### Set correct audio output device at boot.
HEADPHONE_ENABLE="$(get_setting headphone.enabled)"
if [ "${HEADPHONE_ENABLE}" = "1" ]
then
amixer -c0 sset "${DEVICE_PLAYBACK_PATH}" "HP"
else
amixer -c0 sset "${DEVICE_PLAYBACK_PATH}" "SPK"
fi

View file

@ -0,0 +1,37 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2023-present BrooksyTech (https://github.com/brooksytech)
# Source predefined functions and variables
. /etc/profile
### Set correct audio output device at boot.
HEADPHONE_STATE=$(cat /sys/kernel/debug/gpio | grep HEADPHONE)
if [[ "${HEADPHONE_STATE}" == *"hi"* ]]; then
amixer -c0 sset "${DEVICE_PLAYBACK_PATH}" "${DEVICE_PLAYBACK_PATH_HP}"
set_setting "audio.device" "headphone"
else
amixer -c0 sset "${DEVICE_PLAYBACK_PATH}" "${DEVICE_PLAYBACK_PATH_SPK}"
set_setting "audio.device" "speakers"
fi
# Headphone sensing
DEVICE="${DEVICE_HEADPHONE_DEV}"
HP_ON='*(SW_HEADPHONE_INSERT), value 1*'
HP_OFF='*(SW_HEADPHONE_INSERT), value 0*'
evtest "${DEVICE}" | while read line; do
case $line in
(${HP_ON})
amixer -c0 sset "${DEVICE_PLAYBACK_PATH}" "${DEVICE_PLAYBACK_PATH_HP}"
set_setting "audio.device" "headphone"
;;
(${HP_OFF})
amixer -c0 sset "${DEVICE_PLAYBACK_PATH}" "${DEVICE_PLAYBACK_PATH_SPK}"
set_setting "audio.device" "speakers"
;;
esac
done

View file

@ -19,7 +19,7 @@ PKG_PATCH_DIRS+="${DEVICE}"
case ${DEVICE} in case ${DEVICE} in
S922X*) S922X*)
PKG_VERSION="6.1.52" PKG_VERSION="6.1.53"
PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz" PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz"
;; ;;
esac esac

View file

@ -37,7 +37,7 @@ case ${DEVICE} in
PKG_GIT_CLONE_BRANCH="main" PKG_GIT_CLONE_BRANCH="main"
;; ;;
RK33*) RK33*)
PKG_VERSION="6.1.52" PKG_VERSION="6.1.53"
PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz" PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz"
;; ;;
esac esac