Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PS5000 support #42

Merged
merged 1 commit into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ external/
kernel/
buildroot/dl/
buildroot/output/
.config*
..config.tmp
18 changes: 0 additions & 18 deletions buildroot/board/rockchip/common/base/etc/input-event-daemon.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/sh
#
# Start linux launcher...
#

case "$1" in
start)
printf "Starting launcher: "
export LC_ALL='en_US.utf8'

export WESTON_DRM_MIRROR=0
export WESTON_DRM_PREFER_EXTERNAL=1

# for QLauncher wayland
mkdir -p /tmp/.xdg && chmod 0700 /tmp/.xdg
export XDG_RUNTIME_DIR=/tmp/.xdg
weston --tty=2 --idle-time=0 &

# start brightness control
/usr/local/share/scripts/bc.sh

# select display, appropriate resolution and sound path
if [ `cat /sys/class/drm/card0-HDMI-A-1/status` == "connected" ]; then
ra_config="/sdcard/settings/retroarch/retroarch_hdmi.cfg"

else
case `cat /sys/class/drm/card0-LVDS-1/mode` in
1024x600*)
ra_config="/sdcard/settings/retroarch/retroarch.cfg" ;;
800x480*)
ra_config="/sdcard/settings/retroarch/retroarch_v3.cfg" ;;
esac

fi

( retroarch -c ${ra_config}; poweroff; ) &
;;
stop)
killall weston
printf "stop finished"
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# /etc/input-event-daemon.conf
#

[Global]
listen = /dev/input/event0

[Keys]
F3+KPPLUS = /usr/bin/brup.sh
F3+KPMINUS = /usr/bin/brdown.sh

#KPPLUS = /usr/bin/volctrl.sh
#KPMINUS = /usr/bin/volctrl.sh
#POWER:1 = /etc/power-key.sh press
#POWER:0 = /etc/power-key.sh release
#MUTE = amixer -q set Master mute
#FN+VOLUMEUP = factory_reset_cfg
#CTRL+ALT+ESC = beep
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
VALORE=$(cat /sys/class/backlight/backlight/brightness)
if [ $VALORE -ge 20 ]; then
echo $((VALORE-10)) > /sys/class/backlight/backlight/brightness
echo $((VALORE-10)) > /userdata/brightness.txt
sync
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
VALORE=$(cat /sys/class/backlight/backlight/brightness)
if [ $VALORE -le 245 ]; then
echo $((VALORE+10)) > /sys/class/backlight/backlight/brightness
echo $((VALORE+10)) > /userdata/brightness.txt
sync
fi

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
#

# check if file exist
#
CONTROLLO=$(cat /userdata/brightness.txt)

if [ -f /userdata/brightness.txt ] ; then

if [ $CONTROLLO -ge 10 ] && [ $CONTROLLO -le 255 ]; then

echo $(cat /userdata/brightness.txt) > /sys/class/backlight/backlight/brightness

else
rm /userdata/brightness.txt
echo 165 > /sys/class/backlight/backlight/brightness
echo 165 > /userdata/brightness.txt
sync
fi

else

echo 165 > /sys/class/backlight/backlight/brightness
echo 165 > /userdata/brightness.txt
sync

fi




39 changes: 39 additions & 0 deletions buildroot/board/rockchip/ps5000/fs-overlay/etc/init.d/S50launcher
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
#
# Start linux launcher...
#

case "$1" in
start)
printf "Starting launcher: "
export LC_ALL='en_US.utf8'

export WESTON_DRM_MIRROR=0
export WESTON_DRM_PREFER_EXTERNAL=1

# for QLauncher wayland
mkdir -p /tmp/.xdg && chmod 0700 /tmp/.xdg
export XDG_RUNTIME_DIR=/tmp/.xdg
weston --tty=2 --idle-time=0 &

# select display, appropriate resolution
if [ `cat /sys/class/drm/card0-HDMI-A-1/status` == "connected" ]; then
ra_config="/sdcard/settings/retroarch/retroarch_hdmi.cfg"

else
ra_config="/sdcard/settings/retroarch/retroarch_ps5000.cfg"

fi

( retroarch -c ${ra_config}; poweroff; ) &
;;
stop)
killall weston
printf "stop finished"
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# /etc/input-event-daemon.conf
#

[Global]
#listen = /dev/input/event0
listen = /dev/input/by-path/platform-adc-pot-event-joystick

[Keys]
#FN+VOLUMEUP = /usr/bin/brup.sh
#FN+VOLUMEDOWN = /usr/bin/brdown.sh
FN = /usr/bin/volctrl.sh
VOLUMEUP = /usr/bin/volctrl.sh
VOLUMEDOWN = /usr/bin/volctrl.sh
POWER:1 = /etc/power-key.sh press
POWER:0 = /etc/power-key.sh release

Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#
# Configuration for RK817 driver
#

#rockchip_rk817- cards.rk817
rockchip_rk312x cards.rk817

# default with softvol
rk817.pcm.default {
@args [ CARD ]
@args.CARD {
type string
}
type asym
playback.pcm {
type plug
slave.pcm {
type softvol
slave.pcm {
type hooks
slave.pcm {
type hw
card $CARD
}
hooks.0 {
type ctl_elems
hook_args [
{
name "Playback Path"
preserve true
value "SPK_HP"
#lock true
}
]
}
}
control {
name "Master Playback Volume"
card $CARD
}
min_dB -30.0
max_dB 0.0
resolution 101
}
}
capture.pcm {
type plug
slave.pcm {
type softvol
slave.pcm {
type hooks
slave.pcm {
type hw
card $CARD
}
hooks.0 {
type ctl_elems
hook_args [
{
name "Capture MIC Path"
preserve true
value "Main Mic"
lock true
}
]
}
}
control {
name "Digital Capture Volume"
card $CARD
}
min_dB -30.0
max_dB 0.0
resolution 101
}

# to avoid possible phase inversions with digital mics
route_policy copy
}
hint.device 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
#
# RK3128H Init...
#

case "$1" in
start)
printf "RK3128H init"
/usr/bin/rk3128h_init &
;;
stop)
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0
Binary file not shown.
13 changes: 13 additions & 0 deletions buildroot/board/rockchip/ruka-base/fs-overlay/etc/fstab
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# <file system> <mount pt> <type> <options> <dump> <pass>
/dev/root / ext2 rw,noauto 0 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts defaults,gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs mode=0777 0 0
tmpfs /tmp tmpfs mode=1777 0 0
tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0
sysfs /sys sysfs defaults 0 0
debug /sys/kernel/debug debugfs defaults 0 0
pstore /sys/fs/pstore pstore defaults 0 0
/dev/block/by-name/misc /misc emmc defaults 0 0
/dev/block/by-name/oem /oem squashfs defaults 0 2
/dev/block/by-name/userdata /userdata ext2 sync 0 2
Empty file.
26 changes: 26 additions & 0 deletions buildroot/board/rockchip/ruka-base/fs-overlay/etc/init.d/S49alsa
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
#

case "$1" in
start)
alsactl restore -f /userdata/asound.state

amixer cset name='Master Playback Volume' `cat /sys/devices/platform/adc-pot/scaled`
amixer cset name='HDMI Playback Volume' `cat /sys/devices/platform/adc-pot/scaled`

# select display, appropriate resolution and sound path
if [ `cat /sys/class/drm/card0-HDMI-A-1/status` == "connected" ]; then
amixer cset name='Playback Path' 'OFF'
else
amixer cset name='Playback Path' 'SPK'
fi

;;
stop)
#alsactl store -f /userdata/asound.state
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
#
# RK3128H Init...
#

case "$1" in
start)
printf "RK3128H init"
/usr/bin/rk3128h_init &
;;
stop)
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0
Loading