Support RK3588 Orange Pi 5 Plus

This commit is contained in:
orangepi-xunlong
2023-04-10 09:20:03 +08:00
parent 4b897b01ff
commit 9d1ca3ddaa
154 changed files with 627 additions and 5230 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/bash
echo 0 > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/export
echo 10000 > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/pwm0/period
echo 8000 > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/pwm0/duty_cycle
echo normal > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/pwm0/polarity
echo 1 > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/pwm0/enable
sleep 3
while true
do
a=$(cat /sys/class/thermal/thermal_zone0/temp)
time=$(date)
pwm=$(echo ${a} | awk '{printf("%d",$1*0.15-800)}')
if (( $pwm > 8500 ))
then
pwm=8500
elif (( $pwm < 5000 ))
then
pwm=5000
fi
echo ${pwm} > /sys/devices/platform/fd8b0030.pwm/pwm/pwmchip*/pwm0/duty_cycle
echo [${time}] Thermal value: ${a}, write fan PWM cycle ${pwm}
sleep 5
done

View File

@@ -0,0 +1,33 @@
#!/bin/bash
trap 'onCtrlC' INT
function onCtrlC () {
echo 'Ctrl+C is captured'
killall gst-launch-1.0
exit 0
}
device_id=$(v4l2-ctl --list-devices | grep -A1 hdmirx | grep -v hdmirx | awk -F ' ' '{print $NF}')
v4l2-ctl -d $device_id --set-dv-bt-timings query 2>&1 > /dev/null
width=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active width" |awk -F ' ' '{print $NF}')
heigh=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active heigh" |awk -F ' ' '{print $NF}')
es8388_card=$(aplay -l | grep "es8388" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmi0_card=$(aplay -l | grep "hdmi0" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmi1_card=$(aplay -l | grep "hdmi1" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmiin_card=$(arecord -l | grep "hdmiin" | cut -d ":" -f 1 | cut -d ' ' -f 2)
DISPLAY=:0.0 gst-launch-1.0 v4l2src device=${device_id} io-mode=4 ! videoconvert \
! video/x-raw,format=NV12,width=${width},height=${heigh} \
! videoscale ! video/x-raw,width=1280,height=720 \
! autovideosink 2>&1 > /dev/null &
gst-launch-1.0 alsasrc device=hw:${hdmiin_card},0 ! audioconvert ! audioresample ! queue \
! tee name=t ! queue ! alsasink device="hw:${hdmi0_card},0" \
t. ! queue ! alsasink device="hw:${hdmi1_card},0" \
t. ! queue ! alsasink device="hw:${es8388_card},0" &
while true
do
sleep 10
done

View File

@@ -0,0 +1,11 @@
[Unit]
Description=PWM-Fan-Simple-Control
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/pwm-fan
Restart=always
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,23 @@
# Usecase for device HDMI1/Display Port stereo playback on rockchip platforms
# For Audio in I2S mode
SectionDevice."HDMI1" {
Comment "HDMI"
Value {
PlaybackPriority 400
PlaybackPCM "hw:${CardId}"
If.1 {
Condition {
Type ControlExists
Control "iface=CARD,name='rockchip-hdmi1 Jack'"
}
True {
JackControl "rockchip-hdmi1 Jack"
}
False {
JackControl "rockchip-hdmi1 Jack"
}
}
}
}

View File

@@ -0,0 +1,8 @@
Syntax 2
Comment "Rockchip HDMI card"
SectionUseCase."HDMI" {
File "Hdmi.conf"
Comment "HDMI"
}