mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-03-31 14:41:55 -07:00
SM8550: Ayaneo pocket DS dual-screen support
This commit is contained in:
@@ -87,6 +87,7 @@
|
||||
<file short="pocketace" full="AYANEO Pocket ACE">qcs8550-ayaneo-pocketace</file>
|
||||
<file short="pocketdmg" full="AYANEO Pocket DMG">qcs8550-ayaneo-pocketdmg</file>
|
||||
<file short="pocketevo" full="AYANEO Pocket EVO">qcs8550-ayaneo-pocketevo</file>
|
||||
<file short="pocketds" full="AYANEO Pocket DS">qcs8550-ayaneo-pocketds</file>
|
||||
</SM8550>
|
||||
<SM8650 mkimage_options="grub,dtb,abl" dtb_prefix="qcom">
|
||||
<file short="pockets2" full="AYANEO Pocket S2">sm8650-ayaneo-ps2</file>
|
||||
|
||||
@@ -11,8 +11,8 @@ CONFIG_AS_VERSION=24400
|
||||
CONFIG_LD_IS_BFD=y
|
||||
CONFIG_LD_VERSION=24400
|
||||
CONFIG_LLD_VERSION=0
|
||||
CONFIG_RUSTC_VERSION=109200
|
||||
CONFIG_RUSTC_LLVM_VERSION=210103
|
||||
CONFIG_RUSTC_VERSION=0
|
||||
CONFIG_RUSTC_LLVM_VERSION=0
|
||||
CONFIG_CC_CAN_LINK=y
|
||||
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
|
||||
CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
|
||||
@@ -21,11 +21,6 @@ CONFIG_CC_HAS_ASM_INLINE=y
|
||||
CONFIG_CC_HAS_ASSUME=y
|
||||
CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
|
||||
CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY=y
|
||||
CONFIG_RUSTC_HAS_COERCE_POINTEE=y
|
||||
CONFIG_RUSTC_HAS_SPAN_FILE=y
|
||||
CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES=y
|
||||
CONFIG_RUSTC_HAS_FILE_WITH_NUL=y
|
||||
CONFIG_RUSTC_HAS_FILE_AS_C_STR=y
|
||||
CONFIG_PAHOLE_VERSION=0
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_BUILDTIME_TABLE_SORT=y
|
||||
@@ -2729,7 +2724,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
|
||||
# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set
|
||||
# CONFIG_TOUCHSCREEN_EXC3000 is not set
|
||||
# CONFIG_TOUCHSCREEN_FUJITSU is not set
|
||||
# CONFIG_TOUCHSCREEN_GOODIX is not set
|
||||
CONFIG_TOUCHSCREEN_GOODIX=y
|
||||
# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_I2C is not set
|
||||
# CONFIG_TOUCHSCREEN_GOODIX_BERLIN_SPI is not set
|
||||
# CONFIG_TOUCHSCREEN_HIDEEP is not set
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
diff -rupbN linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts linux/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts
|
||||
--- linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts 2025-08-29 01:15:03.063872627 +0000
|
||||
@@ -0,0 +1,201 @@
|
||||
diff --git a/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts b/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts
|
||||
new file mode 100644
|
||||
index 000000000..e8510012e
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts
|
||||
@@ -0,0 +1,238 @@
|
||||
+// SPDX-License-Identifier: BSD-3-Clause
|
||||
+/*
|
||||
+ * Copyright (c) 2025, Teguh Sobirin.
|
||||
@@ -28,17 +30,25 @@ diff -rupbN linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts linu
|
||||
+
|
||||
+ gpio = <&tlmm 168 GPIO_ACTIVE_HIGH>;
|
||||
+ enable-active-high;
|
||||
+
|
||||
+ //pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&tca6424_vcc_pin>;
|
||||
+
|
||||
+ regulator-boot-on;
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdd_ts: vdd-ts {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vdd_ts_en";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ gpio = <&tca6408 1 GPIO_ACTIVE_HIGH>;
|
||||
+ enable-active-high;
|
||||
+ };
|
||||
+
|
||||
+};
|
||||
+
|
||||
+&tlmm {
|
||||
+ gpio-reserved-ranges = <32 4>;
|
||||
+ panel_pwr_active: panel-pwr-active-state {
|
||||
+ pins = "gpio152", "gpio153";
|
||||
+ function = "gpio";
|
||||
@@ -62,14 +72,6 @@ diff -rupbN linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts linu
|
||||
+ bias-pull-down;
|
||||
+ };
|
||||
+
|
||||
+ tca6424_vcc_pin: tca6424-vcc-pin {
|
||||
+ pins = "gpio168";
|
||||
+ function = "gpio";
|
||||
+ drive-strength = <8>;
|
||||
+ bias-pull-up;
|
||||
+ output-high;
|
||||
+ };
|
||||
+
|
||||
+ ts_rst_default: ts-rst-default-state {
|
||||
+ pins = "gpio24";
|
||||
+ function = "gpio";
|
||||
@@ -97,6 +99,22 @@ diff -rupbN linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts linu
|
||||
+ bias-pull-down;
|
||||
+ drive-strength = <2>;
|
||||
+ };
|
||||
+
|
||||
+ ts2_irq: ts2-irq-state {
|
||||
+ pins = "gpio39";
|
||||
+ function = "gpio";
|
||||
+ drive-strength = <8>;
|
||||
+ bias-disable;
|
||||
+ input-enable;
|
||||
+ };
|
||||
+
|
||||
+ ts2_reset: ts2-reset-state {
|
||||
+ pins = "gpio38";
|
||||
+ function = "gpio";
|
||||
+ drive-strength = <8>;
|
||||
+ input-enable;
|
||||
+ bias-pull-down;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2c0 {
|
||||
@@ -125,13 +143,37 @@ diff -rupbN linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts linu
|
||||
+ tca6408: tca64_20@20 {
|
||||
+ gpio-controller;
|
||||
+ compatible = "ti,tca6408";
|
||||
+ status = "ok";
|
||||
+ status = "okay";
|
||||
+ reg = <0x20>;
|
||||
+ #gpio-cells = <0x02>;
|
||||
+ vcc-supply = <&tca6424_vcc>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2c2 {
|
||||
+ clock-frequency = <400000>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ touchscreen@5d {
|
||||
+ reg = <0x5d>;
|
||||
+ compatible = "goodix,gt911";
|
||||
+
|
||||
+ interrupt-parent = <&tlmm>;
|
||||
+ interrupts = <39 IRQ_TYPE_EDGE_FALLING>;
|
||||
+
|
||||
+ reset-gpios = <&tlmm 38 GPIO_ACTIVE_HIGH>;
|
||||
+ irq-gpios = <&tlmm 39 GPIO_ACTIVE_HIGH>;
|
||||
+ VDDIO-supply = <&vdd_ts>;
|
||||
+
|
||||
+ touchscreen-size-x = <768>;
|
||||
+ touchscreen-size-y = <1024>;
|
||||
+
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&ts2_reset>, <&ts2_irq>;
|
||||
+
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2c4 {
|
||||
+ clock-frequency = <400000>;
|
||||
+ status = "okay";
|
||||
@@ -163,9 +205,7 @@ diff -rupbN linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts linu
|
||||
+
|
||||
+ vci-supply = <&vreg_l13b_3p0>;
|
||||
+ vddio-supply = <&vreg_l12b_1p8>;
|
||||
+
|
||||
+ reset-gpios = <&tlmm 133 GPIO_ACTIVE_LOW>;
|
||||
+
|
||||
+ rotation = <270>;
|
||||
+};
|
||||
+
|
||||
@@ -179,7 +219,6 @@ diff -rupbN linux.orig/arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketds.dts linu
|
||||
+ pinctrl-0 = <&sde_dsi1_active>;
|
||||
+ pinctrl-1 = <&sde_dsi1_suspend>;
|
||||
+ pinctrl-names = "default", "sleep";
|
||||
+
|
||||
+ avdd-supply = <&sgm3804>;
|
||||
+ enable-gpio = <&tca6408 0 GPIO_ACTIVE_HIGH>;
|
||||
+ reset-gpios = <&tca6408 2 GPIO_ACTIVE_LOW>;
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../AYANEO Pocket EVO/020-set-xbox-gamepad
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2025 ROCKNIX
|
||||
|
||||
# Serial device
|
||||
SERIAL_DEVICE="/dev/ttyHS0"
|
||||
|
||||
# Open serial device
|
||||
stty -F $SERIAL_DEVICE 115200 -clocal -opost -isig -icanon -echo
|
||||
|
||||
# Send frame to switch gamepad to fake xbox 360 controller
|
||||
printf "\xe7\x55\x05\x01\x00\x00\x00\x00\x00\x5b\xed" >$SERIAL_DEVICE
|
||||
sleep 0.1
|
||||
printf "\x35\x35\x30\x35\x30\x31\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30" >$SERIAL_DEVICE
|
||||
sleep 0.1
|
||||
@@ -0,0 +1,108 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2024 ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
# Simple script to watch the battery capacity and
|
||||
# turn the power LED orange when it reaches 30%, red at 20%, and blinking red at 10%
|
||||
|
||||
# Minimal OS variable loading for performance
|
||||
. /etc/profile.d/001-functions
|
||||
|
||||
LED_PATH="/sys/class/leds"
|
||||
|
||||
function led_brightness() {
|
||||
echo ${2} >${LED_PATH}/${1}/brightness
|
||||
}
|
||||
|
||||
function led_rgb() {
|
||||
echo ${2} ${3} ${4} >${LED_PATH}/${1}/multi_intensity
|
||||
}
|
||||
|
||||
function bat_led_off() {
|
||||
led_brightness power-led 0
|
||||
led_rgb power-led 0 0 0
|
||||
}
|
||||
|
||||
function bat_led_green() {
|
||||
led_brightness power-led 255
|
||||
led_rgb power-led 0 255 0
|
||||
}
|
||||
|
||||
function bat_led_red() {
|
||||
led_brightness power-led 255
|
||||
led_rgb power-led 255 0 0
|
||||
}
|
||||
|
||||
function bat_led_orange() {
|
||||
led_brightness power-led 255
|
||||
led_rgb power-led 255 20 0
|
||||
}
|
||||
|
||||
function bat_led_yellow() {
|
||||
led_brightness power-led 255
|
||||
led_rgb power-led 255 125 0
|
||||
}
|
||||
|
||||
PREV_BATCAP="null"
|
||||
while true
|
||||
do
|
||||
BAT_LED_STATE=$(get_setting led.color)
|
||||
if [ ! ${BAT_LED_STATE} == "battery" ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
CAP=$(cat /sys/class/power_supply/battery/capacity)
|
||||
STAT=$(cat /sys/class/power_supply/battery/status)
|
||||
|
||||
if [ ${STAT} == "Discharging" ]; then
|
||||
if (( ${CAP} <= 10 ))
|
||||
then
|
||||
for ctr in $(seq 1 1 5)
|
||||
do
|
||||
bat_led_red
|
||||
sleep .5
|
||||
bat_led_off
|
||||
sleep .5
|
||||
done
|
||||
continue
|
||||
elif (( ${CAP} <= 20 ))
|
||||
then
|
||||
BATCAP="D_RED"
|
||||
if [ ! ${BATCAP} = ${PREV_BATCAP} ]; then
|
||||
bat_led_red
|
||||
fi
|
||||
elif (( ${CAP} <= 30 ))
|
||||
then
|
||||
BATCAP="D_ORANGE"
|
||||
if [ ! ${BATCAP} = ${PREV_BATCAP} ]; then
|
||||
bat_led_orange
|
||||
fi
|
||||
elif (( ${CAP} <= 40 ))
|
||||
then
|
||||
BATCAP="D_YELLOW"
|
||||
if [ ! ${BATCAP} = ${PREV_BATCAP} ]; then
|
||||
bat_led_yellow
|
||||
fi
|
||||
else
|
||||
BATCAP="D_GREEN"
|
||||
if [ ! ${BATCAP} = ${PREV_BATCAP} ]; then
|
||||
bat_led_green
|
||||
fi
|
||||
fi
|
||||
elif (( ${CAP} <= 94 ))
|
||||
then
|
||||
BATCAP="C_ORANGE"
|
||||
if [ ! ${BATCAP} = ${PREV_BATCAP} ]; then
|
||||
bat_led_orange
|
||||
fi
|
||||
elif (( ${CAP} >= 95 ))
|
||||
then
|
||||
BATCAP="C_GREEN"
|
||||
if [ ! ${BATCAP} = ${PREV_BATCAP} ]; then
|
||||
bat_led_green
|
||||
fi
|
||||
fi
|
||||
PREV_BATCAP=${BATCAP}
|
||||
sleep 15
|
||||
done
|
||||
@@ -0,0 +1,110 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024 ROCKNIX (https://github.com/ROCKNIX)
|
||||
|
||||
# Minimal OS variable loading for performance
|
||||
. /etc/profile.d/001-functions
|
||||
|
||||
LED_PATH="/sys/class/leds"
|
||||
|
||||
function led_brightness() {
|
||||
echo ${2} >${LED_PATH}/${1}/brightness
|
||||
}
|
||||
|
||||
function led_rgb() {
|
||||
echo ${2} ${3} ${4} >${LED_PATH}/${1}/multi_intensity
|
||||
}
|
||||
|
||||
function led_off() {
|
||||
led_brightness power-led 0
|
||||
led_rgb power-led 0 0 0
|
||||
}
|
||||
|
||||
function led_red() {
|
||||
led_brightness power-led 255
|
||||
led_rgb power-led 255 0 0
|
||||
}
|
||||
|
||||
function led_green() {
|
||||
led_brightness power-led 255
|
||||
led_rgb power-led 0 255 0
|
||||
}
|
||||
|
||||
function led_blue() {
|
||||
led_brightness power-led 255
|
||||
led_rgb power-led 0 0 255
|
||||
}
|
||||
|
||||
function led_white() {
|
||||
led_brightness power-led 255
|
||||
led_rgb power-led 255 255 255
|
||||
}
|
||||
|
||||
function led_orange() {
|
||||
led_brightness power-led 255
|
||||
led_rgb power-led 255 20 0
|
||||
}
|
||||
|
||||
function led_yellow() {
|
||||
led_brightness power-led 255
|
||||
led_rgb power-led 255 125 0
|
||||
}
|
||||
|
||||
function led_purple() {
|
||||
led_brightness power-led 255
|
||||
led_rgb power-led 255 0 255
|
||||
}
|
||||
|
||||
case ${1} in
|
||||
red)
|
||||
led_red
|
||||
set_setting led.color ${1}
|
||||
;;
|
||||
green)
|
||||
led_green
|
||||
set_setting led.color ${1}
|
||||
;;
|
||||
blue)
|
||||
led_blue
|
||||
set_setting led.color ${1}
|
||||
;;
|
||||
white)
|
||||
led_white
|
||||
set_setting led.color ${1}
|
||||
;;
|
||||
orange)
|
||||
led_orange
|
||||
set_setting led.color ${1}
|
||||
;;
|
||||
yellow)
|
||||
led_yellow
|
||||
set_setting led.color ${1}
|
||||
;;
|
||||
purple)
|
||||
led_purple
|
||||
set_setting led.color ${1}
|
||||
;;
|
||||
off)
|
||||
led_off
|
||||
set_setting led.color ${1}
|
||||
;;
|
||||
battery)
|
||||
led_off
|
||||
set_setting led.color ${1}
|
||||
systemctl restart batteryledstatus.service
|
||||
;;
|
||||
list)
|
||||
cat <<EOF
|
||||
off
|
||||
battery
|
||||
red
|
||||
green
|
||||
blue
|
||||
white
|
||||
orange
|
||||
yellow
|
||||
purple
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -107,6 +107,17 @@ if hexdump -C /sys/class/drm/card0-DP-1/edid | grep -q "Lontium"; then
|
||||
con="DP-1"
|
||||
fi
|
||||
|
||||
if [ "${QUIRK_DEVICE}" = "AYANEO Pocket DS" ]; then
|
||||
con="DSI-1"
|
||||
echo 'for_window [app_id="emulationstation"] reload' >> $SWAY_HOME/config
|
||||
echo 'input "1046:967:Goodix_Capacitive_TouchScreen" map_to_output DSI-2' >> $SWAY_HOME/config
|
||||
echo 'input "0:0:generic_ft5x06_(44)" map_to_output DSI-1' >> $SWAY_HOME/config
|
||||
echo 'output DSI-2 power off' >> $SWAY_HOME/config
|
||||
echo 'for_window [shell="xdg_shell"] output DSI-2 power on' >> $SWAY_HOME/config
|
||||
echo "exec_always swaymsg 'seat touchseat attach 1046:967:Goodix_Capacitive_TouchScreen'" >> $SWAY_HOME/config
|
||||
echo "exec_always swaymsg 'seat touchseat attach 0:0:generic_ft5x06_(44)'" >> $SWAY_HOME/config
|
||||
fi
|
||||
|
||||
# Move the secondary window to the second output
|
||||
if [ "${DEVICE_HAS_DUAL_SCREEN}" = "true" ]; then
|
||||
second_con=$([[ "${connected_cons[0]}" == "$con" ]] && echo "${connected_cons[1]}" || echo "${connected_cons[0]}")
|
||||
|
||||
Reference in New Issue
Block a user