diff --git a/config/boards/pinebook-pro.wip b/config/boards/pinebook-pro.wip index 12bdbc4cf..e9348ac0b 100644 --- a/config/boards/pinebook-pro.wip +++ b/config/boards/pinebook-pro.wip @@ -6,4 +6,6 @@ BOOT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb" DESKTOP_AUTOLOGIN="no" KERNEL_TARGET="legacy,current,dev" FULL_DESKTOP="yes" +PACKAGE_LIST_DESKTOP_BOARD="xfce4-power-manager" BOOT_LOGO="desktop" +ASOUND_STATE="asound.state.pinebook-pro" diff --git a/config/sources/families/include/rockchip64_common.inc b/config/sources/families/include/rockchip64_common.inc index 503d3e7c0..7d971a122 100644 --- a/config/sources/families/include/rockchip64_common.inc +++ b/config/sources/families/include/rockchip64_common.inc @@ -269,6 +269,12 @@ family_tweaks() fi + if [[ $BOARD == pinebook-pro ]]; then + + chroot $SDCARD /bin/bash -c "echo SuspandState=freeze >> /etc/systemd/sleep.conf" + chroot $SDCARD /bin/bash -c "echo HandlePowerKey=ignore >> /etc/systemd/login.d" + fi + } @@ -294,7 +300,17 @@ family_tweaks_bsp() if [[ $BOARD == pinebook-pro ]]; then + ## accelerated X cp $SRC/packages/bsp/pinebook-pro/xorg.conf $destination/etc/X11/ + ## touchpad and keyboard tweaks + # from https://github.com/ayufan-rock64/linux-package/tree/master/root-pinebookpro + cp $SRC/packages/bsp/pinebook-pro/40-pinebookpro-touchpad.conf $destination/etc/X11/xorg.conf.d/ + mkdir -p $destination/etc/udev/hwdb.d/ + cp $SRC/packages/bsp/pinebook-pro/10-usb-kbd.hwdb $destination/etc/udev/hwdb.d/ + ## brightness and power management defaults + mkdir -p $destination/usr/local/share/xdg/xfce4/xfconf/xfce-perchannel-xml/ + cp $SRC/packages/bsp/pinebook-pro/xfce4-power-manager.xml + ## additional keyboard configs in lib/desktop.sh fi if [[ $BOARD == helios64 ]]; then diff --git a/lib/desktop.sh b/lib/desktop.sh index 59460a7a5..47dddd355 100644 --- a/lib/desktop.sh +++ b/lib/desktop.sh @@ -146,4 +146,11 @@ desktop_postinstall () echo "disp_mem_reserves=on" >> "${SDCARD}"/boot/armbianEnv.txt echo "extraargs=cma=96M" >> "${SDCARD}"/boot/armbianEnv.txt fi + + if [[ $BOARD == "pinebook-pro" ]]; then + # powerconfig, touchpad, and special keys + cp $SRC/packages/bsp/pinebook-pro/xfce4-power-manager.xml ${SDCARD}/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/ + cp $SRC/packages/bsp/pinebook-pro/pointers.xml ${SDCARD}/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/ + cp $SRC/packages/bsp/pinebook-pro/xfce4-keyboard-shortcuts.xml ${SDCARD}/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/ + fi } diff --git a/packages/blobs/asound.state/asound.state.pinebook-pro b/packages/blobs/asound.state/asound.state.pinebook-pro new file mode 100644 index 000000000..a029d831a --- /dev/null +++ b/packages/blobs/asound.state/asound.state.pinebook-pro @@ -0,0 +1,440 @@ +state.rockchipes8316c { + control.1 { + iface CARD + name 'Headphones Jack' + value false + comment { + access read + type BOOLEAN + count 1 + } + } + control.2 { + iface MIXER + name 'Headphone Playback Volume' + value.0 0 + value.1 0 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 3' + dbmin -4800 + dbmax 0 + dbvalue.0 -4800 + dbvalue.1 -4800 + } + } + control.3 { + iface MIXER + name 'Headphone Mixer Volume' + value.0 11 + value.1 11 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 11' + dbmin -1200 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.4 { + iface MIXER + name 'Playback Polarity' + value Normal + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 Normal + item.1 'R Invert' + item.2 'L Invert' + item.3 'L + R Invert' + } + } + control.5 { + iface MIXER + name 'DAC Playback Volume' + value.0 192 + value.1 192 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 192' + dbmin -9999999 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.6 { + iface MIXER + name 'DAC Soft Ramp Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.7 { + iface MIXER + name 'DAC Soft Ramp Rate' + value 4 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 4' + } + } + control.8 { + iface MIXER + name 'DAC Notch Filter Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.9 { + iface MIXER + name 'DAC Double Fs Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.10 { + iface MIXER + name 'DAC Stereo Enhancement' + value 7 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + } + } + control.11 { + iface MIXER + name 'DAC Mono Mix Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.12 { + iface MIXER + name 'Capture Polarity' + value Normal + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 Normal + item.1 Invert + } + } + control.13 { + iface MIXER + name 'Mic Boost Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.14 { + iface MIXER + name 'ADC Capture Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 192' + dbmin -9999999 + dbmax 0 + dbvalue.0 -9999999 + } + } + control.15 { + iface MIXER + name 'ADC PGA Gain Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 10' + } + } + control.16 { + iface MIXER + name 'ADC Soft Ramp Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.17 { + iface MIXER + name 'ADC Double Fs Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.18 { + iface MIXER + name 'ALC Capture Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.19 { + iface MIXER + name 'ALC Capture Max Volume' + value 28 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 28' + dbmin -650 + dbmax 3550 + dbvalue.0 3550 + } + } + control.20 { + iface MIXER + name 'ALC Capture Min Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 28' + dbmin -1200 + dbmax 3000 + dbvalue.0 -1200 + } + } + control.21 { + iface MIXER + name 'ALC Capture Target Volume' + value 11 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 10' + dbmin -1650 + dbmax -150 + dbvalue.0 0 + } + } + control.22 { + iface MIXER + name 'ALC Capture Hold Time' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 10' + } + } + control.23 { + iface MIXER + name 'ALC Capture Decay Time' + value 3 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 10' + } + } + control.24 { + iface MIXER + name 'ALC Capture Attack Time' + value 2 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 10' + } + } + control.25 { + iface MIXER + name 'ALC Capture Noise Gate Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.26 { + iface MIXER + name 'ALC Capture Noise Gate Threshold' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 31' + } + } + control.27 { + iface MIXER + name 'ALC Capture Noise Gate Type' + value 'Constant PGA Gain' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 'Constant PGA Gain' + item.1 'Mute ADC Output' + } + } + control.28 { + iface MIXER + name 'Speaker Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.29 { + iface MIXER + name 'Differential Mux' + value lin1-rin1 + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 lin1-rin1 + item.1 lin2-rin2 + item.2 'lin1-rin1 with 20db Boost' + item.3 'lin2-rin2 with 20db Boost' + } + } + control.30 { + iface MIXER + name 'Digital Mic Mux' + value 'dmic disable' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 'dmic disable' + item.1 'dmic data at high level' + item.2 'dmic data at low level' + } + } + control.31 { + iface MIXER + name 'DAC Source Mux' + value 'LDATA TO LDAC, RDATA TO RDAC' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 'LDATA TO LDAC, RDATA TO RDAC' + item.1 'LDATA TO LDAC, LDATA TO RDAC' + item.2 'RDATA TO LDAC, RDATA TO RDAC' + item.3 'RDATA TO LDAC, LDATA TO RDAC' + } + } + control.32 { + iface MIXER + name 'Left Headphone Mux' + value lin2-rin2 + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 lin1-rin1 + item.1 lin2-rin2 + item.2 'lin-rin with Boost' + item.3 'lin-rin with Boost and PGA' + } + } + control.33 { + iface MIXER + name 'Right Headphone Mux' + value lin1-rin1 + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 lin1-rin1 + item.1 lin2-rin2 + item.2 'lin-rin with Boost' + item.3 'lin-rin with Boost and PGA' + } + } + control.34 { + iface MIXER + name 'Left Headphone Mixer LLIN Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.35 { + iface MIXER + name 'Left Headphone Mixer Left DAC Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.36 { + iface MIXER + name 'Right Headphone Mixer RLIN Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.37 { + iface MIXER + name 'Right Headphone Mixer Right DAC Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } +} diff --git a/packages/blobs/desktop/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml b/packages/blobs/desktop/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml index 7c2949987..b704f5fd7 100644 --- a/packages/blobs/desktop/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml +++ b/packages/blobs/desktop/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml @@ -43,6 +43,18 @@ + + + + + + + + + + + + diff --git a/packages/bsp/common/usr/lib/armbian/armbian-hardware-optimization b/packages/bsp/common/usr/lib/armbian/armbian-hardware-optimization index bd297cb3a..02fffea75 100755 --- a/packages/bsp/common/usr/lib/armbian/armbian-hardware-optimization +++ b/packages/bsp/common/usr/lib/armbian/armbian-hardware-optimization @@ -86,8 +86,8 @@ prepare_board() { fi # IRQ distribution based on $BOARDFAMILY and/or $BOARD_NAME - case ${BOARD_NAME} in - rockpro64|renegade-elite) + case ${BOARD} in + rockpro64|renegade-elite|pinebook-pro) BOARDFAMILY=rk3399 ;; esac @@ -226,6 +226,9 @@ prepare_board() { echo 30 >/proc/irq/$i/smp_affinity done ;; + "Pinebook Pro") + echo s2idle >/sys/power/mem_sleep + ;; esac ;; s500) # Roseapple Pi/LeMaker Guitar: send USB IRQs to cpu1/cpu2, DMA0 to cpu2 and Ethernet + SD card to cpu3 diff --git a/packages/bsp/pinebook-pro/10-usb-kbd.hwdb b/packages/bsp/pinebook-pro/10-usb-kbd.hwdb new file mode 100644 index 000000000..f8348e6fb --- /dev/null +++ b/packages/bsp/pinebook-pro/10-usb-kbd.hwdb @@ -0,0 +1,4 @@ +evdev:input:b0003v258Ap001E* + KEYBOARD_KEY_700a5=brightnessdown + KEYBOARD_KEY_700a6=brightnessup + KEYBOARD_KEY_70066=sleep diff --git a/packages/bsp/pinebook-pro/40-pinebookpro-touchpad.conf b/packages/bsp/pinebook-pro/40-pinebookpro-touchpad.conf new file mode 100644 index 000000000..2ea13285f --- /dev/null +++ b/packages/bsp/pinebook-pro/40-pinebookpro-touchpad.conf @@ -0,0 +1,10 @@ +Section "InputClass" + Identifier "libinput for HAILUCK CO.,LTD USB KEYBOARD Touchpad" + MatchIsTouchpad "on" + MatchUSBID "258a:001e" + MatchDevicePath "/dev/input/event*" + + Option "AccelProfile" "adaptive" + Option "AccelSpeed" "1" + Option "ScrollMethod" "twofinger" +EndSection diff --git a/packages/bsp/pinebook-pro/pointers.xml b/packages/bsp/pinebook-pro/pointers.xml new file mode 100644 index 000000000..ea7158e19 --- /dev/null +++ b/packages/bsp/pinebook-pro/pointers.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/packages/bsp/pinebook-pro/xfce4-keyboard-shortcuts.xml b/packages/bsp/pinebook-pro/xfce4-keyboard-shortcuts.xml new file mode 100644 index 000000000..d8ed64be3 --- /dev/null +++ b/packages/bsp/pinebook-pro/xfce4-keyboard-shortcuts.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/bsp/pinebook-pro/xfce4-power-manager.xml b/packages/bsp/pinebook-pro/xfce4-power-manager.xml new file mode 100644 index 000000000..48d0d0ced --- /dev/null +++ b/packages/bsp/pinebook-pro/xfce4-power-manager.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/patch/kernel/rockchip64-current/rockpis-0017-WIP-Sync-rockchip_i2s_tdm-to-BSP-tree.patch b/patch/kernel/rockchip64-current/rockpis-0017-WIP-Sync-rockchip_i2s_tdm-to-BSP-tree.patch index d8fc006e9..323447a19 100644 --- a/patch/kernel/rockchip64-current/rockpis-0017-WIP-Sync-rockchip_i2s_tdm-to-BSP-tree.patch +++ b/patch/kernel/rockchip64-current/rockpis-0017-WIP-Sync-rockchip_i2s_tdm-to-BSP-tree.patch @@ -86,7 +86,6 @@ index e26e72e3315f..db130be87d47 100644 pinctrl-0 = <&i2s_8ch_0_sclktx &i2s_8ch_0_sclkrx diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c -index 61c984f10d8e..e6125ebfe5a9 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -1,4 +1,3 @@ @@ -315,17 +314,7 @@ index 61c984f10d8e..e6125ebfe5a9 100644 return 0; } -@@ -419,9 +448,6 @@ static int rockchip_i2s_set_sysclk(struct snd_soc_dai *cpu_dai, int clk_id, - struct rk_i2s_dev *i2s = to_info(cpu_dai); - int ret; - -- if (freq == 0) -- return 0; -- - ret = clk_set_rate(i2s->mclk, freq); - if (ret) - dev_err(i2s->dev, "Fail to set mclk %d\n", ret); -@@ -471,7 +497,6 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = { +@@ -471,7 +500,6 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = { SNDRV_PCM_FMTBIT_S32_LE), }, .ops = &rockchip_i2s_dai_ops, @@ -333,7 +322,7 @@ index 61c984f10d8e..e6125ebfe5a9 100644 }; static const struct snd_soc_component_driver rockchip_i2s_component = { -@@ -567,9 +592,16 @@ static const struct rk_i2s_pins rk3399_i2s_pins = { +@@ -567,9 +595,16 @@ static const struct rk_i2s_pins rk3399_i2s_pins = { }; static const struct of_device_id rockchip_i2s_match[] = { @@ -350,7 +339,7 @@ index 61c984f10d8e..e6125ebfe5a9 100644 { .compatible = "rockchip,rk3399-i2s", .data = &rk3399_i2s_pins }, {}, }; -@@ -586,8 +618,10 @@ static int rockchip_i2s_probe(struct platform_device *pdev) +@@ -586,8 +621,10 @@ static int rockchip_i2s_probe(struct platform_device *pdev) int val; i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL); @@ -362,7 +351,7 @@ index 61c984f10d8e..e6125ebfe5a9 100644 i2s->dev = &pdev->dev; -@@ -600,6 +634,9 @@ static int rockchip_i2s_probe(struct platform_device *pdev) +@@ -600,6 +637,9 @@ static int rockchip_i2s_probe(struct platform_device *pdev) i2s->pins = of_id->data; } @@ -372,7 +361,7 @@ index 61c984f10d8e..e6125ebfe5a9 100644 /* try to prepare related clocks */ i2s->hclk = devm_clk_get(&pdev->dev, "i2s_hclk"); if (IS_ERR(i2s->hclk)) { -@@ -633,11 +670,11 @@ static int rockchip_i2s_probe(struct platform_device *pdev) +@@ -633,11 +673,11 @@ static int rockchip_i2s_probe(struct platform_device *pdev) i2s->playback_dma_data.addr = res->start + I2S_TXDR; i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; @@ -386,7 +375,7 @@ index 61c984f10d8e..e6125ebfe5a9 100644 dev_set_drvdata(&pdev->dev, i2s); -@@ -648,13 +685,12 @@ static int rockchip_i2s_probe(struct platform_device *pdev) +@@ -648,13 +688,12 @@ static int rockchip_i2s_probe(struct platform_device *pdev) goto err_pm_disable; } @@ -404,7 +393,7 @@ index 61c984f10d8e..e6125ebfe5a9 100644 if (!of_property_read_u32(node, "rockchip,playback-channels", &val)) { if (val >= 2 && val <= 8) soc_dai->playback.channels_max = val; -@@ -665,6 +701,24 @@ static int rockchip_i2s_probe(struct platform_device *pdev) +@@ -665,6 +704,24 @@ static int rockchip_i2s_probe(struct platform_device *pdev) soc_dai->capture.channels_max = val; } @@ -429,7 +418,7 @@ index 61c984f10d8e..e6125ebfe5a9 100644 ret = devm_snd_soc_register_component(&pdev->dev, &rockchip_i2s_component, soc_dai, 1); -@@ -674,10 +728,12 @@ static int rockchip_i2s_probe(struct platform_device *pdev) +@@ -674,10 +731,12 @@ static int rockchip_i2s_probe(struct platform_device *pdev) goto err_suspend; } @@ -444,7 +433,7 @@ index 61c984f10d8e..e6125ebfe5a9 100644 } return 0; -@@ -699,14 +755,41 @@ static int rockchip_i2s_remove(struct platform_device *pdev) +@@ -699,14 +758,41 @@ static int rockchip_i2s_remove(struct platform_device *pdev) if (!pm_runtime_status_suspended(&pdev->dev)) i2s_runtime_suspend(&pdev->dev); @@ -487,7 +476,6 @@ index 61c984f10d8e..e6125ebfe5a9 100644 static struct platform_driver rockchip_i2s_driver = { diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c -index 39c1b98f9593..499b991c3c1a 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -15,9 +15,13 @@ @@ -1862,7 +1850,6 @@ index 39c1b98f9593..499b991c3c1a 100644 if (ret) { dev_err(&pdev->dev, "Could not register PCM\n"); diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.h b/sound/soc/rockchip/rockchip_i2s_tdm.h -index 1a28523cfd82..3a69fa276f8f 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.h +++ b/sound/soc/rockchip/rockchip_i2s_tdm.h @@ -18,6 +18,9 @@