From 5aa40074b99ecabb1ec3666878def9ef89d0e1ba Mon Sep 17 00:00:00 2001 From: Gerben Jan Dijkman Date: Wed, 19 Jan 2022 13:27:17 +0100 Subject: [PATCH] Version Bump: --- sys-kernel/pinephone-pro-sources/Manifest | 2 + ...9-pinephone-pro-improve-sound-device.patch | 51 ++----- ...wer-Off-Notification-bit-to-complete.patch | 59 ++++++++ .../pinephone-pro-sources-5.16.0.ebuild | 4 +- .../pinephone-pro-sources-5.16.1.ebuild | 129 ++++++++++++++++++ 5 files changed, 202 insertions(+), 43 deletions(-) create mode 100644 sys-kernel/pinephone-pro-sources/files/mmc-core-wait-for-command-setting-Power-Off-Notification-bit-to-complete.patch create mode 100644 sys-kernel/pinephone-pro-sources/pinephone-pro-sources-5.16.1.ebuild diff --git a/sys-kernel/pinephone-pro-sources/Manifest b/sys-kernel/pinephone-pro-sources/Manifest index 99b7eae..f337eee 100644 --- a/sys-kernel/pinephone-pro-sources/Manifest +++ b/sys-kernel/pinephone-pro-sources/Manifest @@ -1,3 +1,5 @@ DIST genpatches-5.16-1.base.tar.xz 3920 BLAKE2B e5749033cbb870b0fb43733b388a7b34a92c91cd4414587d9a6fe9cdd0352f4edb775ce2ae44af339f1bc773998c6df51ebc04d7e66714b19bec1a76ed9c88fc SHA512 9ec28a2171d1e28bc33cb28ba4b7250a02c052cb0b45bafc57d400202862dbffdb183880e5843424dd55d4026af3ddf6fc8dce16c4d4c4595f6a9f22963527ca DIST genpatches-5.16-1.extras.tar.xz 3780 BLAKE2B 59d482903c1eab9800ca9e9dad75bf4cc54d5676e44693f23a48e138bba8dea157f1ca9eb23fb081f8287fc62cc74746ec73504456d544958ef8d1f992fe9a33 SHA512 1271830d5c99c17ad7b00b9305f0cc9b02aafd3c798b8d1cee8eafd755191b30530f75207108b50429410ed581a1327cea5b866b150725399fba63eab9972235 +DIST genpatches-5.16-2.base.tar.xz 17640 BLAKE2B 7b7c6f70018b0848c33340a43a5630b691fd800d2a5f1cd67cc3c80a89bd555d4572616ad2d0f1cd53bb056a1ba9d5a1bb944506a4f91628c987bc5398935f38 SHA512 89f9867077f891e17e9982802be254cf89c72327a99eaeea4935e6120cc93758ddad303779adef3e87d1b153c8cfc47587b4f774b80248ef7a6ecb471ac0d21f +DIST genpatches-5.16-2.extras.tar.xz 3780 BLAKE2B 7d7fae377bff21723ccc52384838479848c5d8ac7d35cbc89f9d1c8cf4789ea6bf5599dc3288ff99bb4120684a531ed462678882d5c6a2afb29819f3b16b7e0d SHA512 59b6fce125dbaa2e63ba2f1b37496a9223ab6bb66ea7b5585def89935d9991b483bb81bb1a836e6283e06d1ffe32887bcfb4ee17e48acd94721d3433a388a14a DIST linux-5.16.tar.xz 123114100 BLAKE2B 07a90cc640ff89e1359c06cee8c38abd33e51f9b9a89833e31a1d2750526fda4a59e8884db3c1ea63df0a37f0d3de6b5a922b014b7313d8abce20d90ac08adcb SHA512 7a257dd576bc8493595ec7d6f3c9cb6e22c772a8b2dbe735d2485c4f5c56e26a08695546e7e0f1f1cd04a533f25e829361958d4da0b98bf0ba8094dd57a85aaf diff --git a/sys-kernel/pinephone-pro-sources/files/0057-arm64-dts-rk3399-pinephone-pro-improve-sound-device.patch b/sys-kernel/pinephone-pro-sources/files/0057-arm64-dts-rk3399-pinephone-pro-improve-sound-device.patch index 4dd7817..cbf82a7 100644 --- a/sys-kernel/pinephone-pro-sources/files/0057-arm64-dts-rk3399-pinephone-pro-improve-sound-device.patch +++ b/sys-kernel/pinephone-pro-sources/files/0057-arm64-dts-rk3399-pinephone-pro-improve-sound-device.patch @@ -1,56 +1,24 @@ +From 54ddce1cf18b40b4e89b445885f5bf03a2fb6483 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Thu, 9 Dec 2021 16:52:29 +0100 -Subject: arm64: dts: rk3399-pinephone-pro: improve sound device definition +Subject: [PATCH] arm64: dts: rk3399-pinephone-pro: improve sound device + definition This commit renames the sound card and the "Headphone" widget so they match the names used by the ALSA UCM profiles. -It also adds a jack detection GPIO to the sound card definition, and -creates a new set of ADC keys for handling headset buttons. +It also adds a jack detection GPIO to the sound card definition. Signed-off-by: Arnaud Ferraris --- - .../boot/dts/rockchip/rk3399-pinephone-pro.dts | 41 ++++++++++++++++++---- - 1 file changed, 34 insertions(+), 7 deletions(-) + .../boot/dts/rockchip/rk3399-pinephone-pro.dts | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts -index 91687f6..b63a153 100644 +index 13141c643..63f0d5a5c 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts -@@ -48,6 +48,32 @@ button-down { - }; - }; - -+ headset-keys { -+ compatible = "adc-keys"; -+ io-channels = <&saradc 2>; -+ io-channel-names = "buttons"; -+ keyup-threshold-microvolt = <900000>; -+ poll-interval = <100>; -+ -+ headset-play { -+ label = "Play"; -+ linux,code = ; -+ press-threshold-microvolt = <650000>; -+ }; -+ -+ headset-up { -+ label = "Volume Up"; -+ linux,code = ; -+ press-threshold-microvolt = <750000>; -+ }; -+ -+ headset-down { -+ label = "Volume Down"; -+ linux,code = ; -+ press-threshold-microvolt = <850000>; -+ }; -+ }; -+ - bat: battery { - compatible = "simple-battery"; - voltage-min-design-microvolt = <3400000>; -@@ -184,29 +210,30 @@ ring_indicator: ring-indicator { +@@ -177,29 +177,30 @@ power { // spaker - amp enabled by SPK_CTL_H // // mclk - GPIO4_A0/I2S_CLK @@ -88,3 +56,6 @@ index 91687f6..b63a153 100644 "Internal Earpiece", "SPOLP", "Internal Earpiece", "SPOLN", "Internal Speaker", "Speaker Amp OUTL", +-- +2.34.1 + diff --git a/sys-kernel/pinephone-pro-sources/files/mmc-core-wait-for-command-setting-Power-Off-Notification-bit-to-complete.patch b/sys-kernel/pinephone-pro-sources/files/mmc-core-wait-for-command-setting-Power-Off-Notification-bit-to-complete.patch new file mode 100644 index 0000000..2bd916f --- /dev/null +++ b/sys-kernel/pinephone-pro-sources/files/mmc-core-wait-for-command-setting-Power-Off-Notification-bit-to-complete.patch @@ -0,0 +1,59 @@ +From 0829026de2b951c7401340fed9925dd7d192a65f Mon Sep 17 00:00:00 2001 +From: Andrey Skvortsov +Date: Sat, 15 Jan 2022 15:14:46 +0300 +Subject: mmc: core: Wait for command setting 'Power Off Notification' bit to + complete + +SD card is allowed to signal busy on DAT0 up to 1s after the +CMD49. According to SD spec (version 6.0 section 5.8.1.3) first host +waits until busy of CMD49 is released and only then polls Power +Management Status register up to 1s until the card indicates ready to +power off. + +Without waiting for busy before polling status register sometimes card +becomes unresponsive and system fails to suspend: + + [ 205.907459] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. + [ 206.421274] sunxi-mmc 1c0f000.mmc: data error, sending stop command + [ 206.421321] sunxi-mmc 1c0f000.mmc: send stop command failed + [ 206.421347] mmc0: error -110 reading status reg of PM func + [ 206.421366] PM: dpm_run_callback(): mmc_bus_suspend+0x0/0x74 returns -110 + [ 206.421402] mmcblk mmc0:aaaa: PM: failed to suspend async: error -110 + [ 206.437064] PM: Some devices failed to suspend, or early wake event detected + +Tested with Sandisk Extreme PRO A2 64GB on Allwinner A64 system. + +Signed-off-by: Andrey Skvortsov +--- + drivers/mmc/core/sd.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c +index c9db24e16af1..baaa37f22873 100644 +--- a/drivers/mmc/core/sd.c ++++ b/drivers/mmc/core/sd.c +@@ -67,7 +67,7 @@ static const unsigned int sd_au_size[] = { + __res & __mask; \ + }) + +-#define SD_POWEROFF_NOTIFY_TIMEOUT_MS 2000 ++#define SD_POWEROFF_NOTIFY_TIMEOUT_MS 1000 + #define SD_WRITE_EXTR_SINGLE_TIMEOUT_MS 1000 + + struct sd_busy_data { +@@ -1664,6 +1664,13 @@ static int sd_poweroff_notify(struct mmc_card *card) + goto out; + } + ++ /* Find out when the command is completed. */ ++ err = mmc_poll_for_busy(card, SD_POWEROFF_NOTIFY_TIMEOUT_MS, false, ++ MMC_BUSY_EXTR_SINGLE); ++ ++ if (err) ++ goto out; ++ + cb_data.card = card; + cb_data.reg_buf = reg_buf; + err = __mmc_poll_for_busy(card, SD_POWEROFF_NOTIFY_TIMEOUT_MS, +-- +cgit v1.2.3 diff --git a/sys-kernel/pinephone-pro-sources/pinephone-pro-sources-5.16.0.ebuild b/sys-kernel/pinephone-pro-sources/pinephone-pro-sources-5.16.0.ebuild index 5155062..d08db03 100644 --- a/sys-kernel/pinephone-pro-sources/pinephone-pro-sources-5.16.0.ebuild +++ b/sys-kernel/pinephone-pro-sources/pinephone-pro-sources-5.16.0.ebuild @@ -16,7 +16,7 @@ KEYWORDS="~arm64" DEPEND="${RDEPEND} >=sys-devel/patch-2.7.5" -DESCRIPTION="Full sources for the Linux kernel with gentoo patchset and with megi's patch for Pinephone (Pro)" +DESCRIPTION="Full sources for the Linux kernel with gentoo patchset and with megi's patch for the PinePhone Pro" SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}" @@ -115,8 +115,6 @@ pkg_postinst() { einfo "make Image Image.gz modules" einfo "make DTC_FLAGS="-@" dtbs" einfo "make install; make modules_intall; make dtbs_install" - einfo "If you use kernel config coming with this ebuild, don't forget to also copy dracut-pp.conf to /etc/dracut.conf.d/" - einfo "to make sure proper kernel modules are loaded into initramfs" einfo "if you want to cross compile pinephone kernel on amd64 host, follow the https://wiki.gentoo.org/wiki/Cross_build_environment" einfo "to setup cross toolchain environment, then create a xmake wrapper like the following, and replace make with xmake in above commands" einfo "#!/bin/sh" diff --git a/sys-kernel/pinephone-pro-sources/pinephone-pro-sources-5.16.1.ebuild b/sys-kernel/pinephone-pro-sources/pinephone-pro-sources-5.16.1.ebuild new file mode 100644 index 0000000..6b5a3e1 --- /dev/null +++ b/sys-kernel/pinephone-pro-sources/pinephone-pro-sources-5.16.1.ebuild @@ -0,0 +1,129 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + + +EAPI="8" +ETYPE="sources" +K_WANT_GENPATCHES="base extras" +K_GENPATCHES_VER="2" + +inherit kernel-2 +detect_version +detect_arch + +KEYWORDS="~arm64" + +DEPEND="${RDEPEND} + >=sys-devel/patch-2.7.5" + +DESCRIPTION="Full sources for the Linux kernel with gentoo patchset and with megi'/s patch for the PinePhone Pro" + +SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}" + +PATCHES=( + # Mobian Patches + "${FILESDIR}"/0001-base-property-Swap-order-of-search-for-connection-to.patch + "${FILESDIR}"/0002-clk-rk3399-Export-SCLK_CIF_OUT_SRC-to-device-tree.patch + "${FILESDIR}"/0003-media-rockchip-rga-Fix-probe-bugs.patch + "${FILESDIR}"/0004-drm-dw-mipi-dsi-rockchip-Ensure-that-lane-is-properl.patch + "${FILESDIR}"/0005-drm-rockchip-dw-mipi-dsi-Fix-missing-clk_disable_unp.patch + "${FILESDIR}"/0006-drm-bridge-dw-mipi-dsi-Fix-enable-disable-of-dsi-con.patch + "${FILESDIR}"/0007-drm-dw-mipi-dsi-rockchip-Never-allow-lane-bandwidth-.patch + "${FILESDIR}"/0008-drm-rockchip-cdn-dp-Disable-CDN-DP-on-disconnect.patch + "${FILESDIR}"/0009-video-fbdev-Add-events-for-early-fb-event-support.patch + "${FILESDIR}"/0010-power-rk818-Configure-rk808-clkout2-function.patch + "${FILESDIR}"/0011-power-rk818-battery-Add-battery-driver-for-RK818.patch + "${FILESDIR}"/0012-power-supply-rk818-battery-Use-a-more-propper-compat.patch + "${FILESDIR}"/0013-power-supply-core-Don-t-ignore-max_current-of-0-when.patch + "${FILESDIR}"/0014-power-supply-rk818-charger-Implement-charger-driver-.patch + "${FILESDIR}"/0015-usb-typec-fusb302-Set-the-current-before-enabling-pu.patch + "${FILESDIR}"/0016-usb-typec-fusb302-Extend-debugging-interface-with-dr.patch + "${FILESDIR}"/0017-usb-typec-fusb302-Retry-reading-of-CC-pins-status-if.patch + "${FILESDIR}"/0018-usb-typec-fusb302-More-useful-of-logging-status-on-i.patch + "${FILESDIR}"/0019-usb-typec-fusb302-Update-VBUS-state-even-if-VBUS-int.patch + "${FILESDIR}"/0020-usb-typec-fusb302-Make-tcpm-fusb302-logs-less-pollut.patch + "${FILESDIR}"/0021-usb-typec-fusb302-Add-OF-extcon-support.patch + "${FILESDIR}"/0022-usb-typec-fusb302-Fix-register-definitions.patch + "${FILESDIR}"/0023-usb-typec-fusb302-Clear-interrupts-before-we-start-t.patch + "${FILESDIR}"/0024-usb-typec-typec-extcon-Add-typec-extcon-bridge-drive.patch + "${FILESDIR}"/0025-phy-rockchip-typec-Make-sure-the-plug-orientation-is.patch + "${FILESDIR}"/0026-media-i2c-imx258-Add-support-for-powerdown-gpio.patch + "${FILESDIR}"/0027-media-i2c-imx258-Don-t-be-too-strict-about-clock-rat.patch + "${FILESDIR}"/0028-media-i2c-imx258-Add-support-for-reset-gpio.patch + "${FILESDIR}"/0029-media-i2c-imx258-Add-support-for-power-supplies.patch + "${FILESDIR}"/0030-drm-panel-hx8394-Add-driver-for-HX8394-based-HannSta.patch + "${FILESDIR}"/0031-drm-panel-hx8394-Improve-the-panel-driver-make-it-wo.patch + "${FILESDIR}"/0032-drm-panel-hx8394-Fix-mode-clock-for-the-pinephone-pr.patch + "${FILESDIR}"/0033-input-goodix-Add-option-to-power-off-the-controller-.patch + "${FILESDIR}"/0034-input-goodix-Don-t-disable-regulators-during-suspend.patch + "${FILESDIR}"/0035-input-touchscreen-goodix-Respect-IRQ-flags-from-DT-w.patch + "${FILESDIR}"/0036-input-touchscreen-goodix-Add-support-for-GT1158.patch + "${FILESDIR}"/0037-arm64-dts-rk3399-pinephone-pro-Add-support-for-Pinep.patch + "${FILESDIR}"/0038-arm64-dts-rk3399-pinephone-pro-Fixup-DT-validation-i.patch + "${FILESDIR}"/0039-arm64-dts-rk3399-pinephone-pro-Make-charging-and-per.patch + "${FILESDIR}"/0040-arm64-dts-rk3399-pinephone-pro-Fix-goodix-toucscreen.patch + "${FILESDIR}"/0041-arm64-dts-rk3399-pinephone-pro-Correct-the-pmu1830-i.patch + "${FILESDIR}"/0042-arm64-dts-rk3399-pinephone-pro-Power-off-goodix-touc.patch + "${FILESDIR}"/0043-arm64-dts-rk3399-pinephone-pro-Add-support-for-both-.patch + "${FILESDIR}"/0044-arm64-dts-rk3399-pinephone-pro-Fix-SD-card-power-sup.patch + "${FILESDIR}"/0045-arm64-dts-rk3399-pinephone-pro-Correct-the-battery-s.patch + "${FILESDIR}"/0046-arm64-dts-rk3399-pinephone-pro-Cleanup-some-USB-node.patch + "${FILESDIR}"/0047-arm64-dts-rk3399-pinephone-pro-Fix-PDOs-to-be-more-r.patch + "${FILESDIR}"/0048-arm64-dts-rk3399-pinephone-pro-Add-chassis-type-hand.patch + "${FILESDIR}"/0049-arm64-dts-rk3399-pinephone-pro-Add-mmc-aliases-to-ge.patch + "${FILESDIR}"/0050-arm64-dts-rk3399-pinephone-pro-Use-a-new-rk818-batte.patch + "${FILESDIR}"/0051-arm64-dts-rk3399-pinephone-pro-Full-support-for-Type.patch + "${FILESDIR}"/0052-arm64-dts-rk3399-pinephone-pro-Use-DCLK_VOP-_FRAC-to.patch + "${FILESDIR}"/0053-arm64-dts-rk3399-pinephone-pro-Add-support-for-power.patch + "${FILESDIR}"/0054-arm64-dts-rk3399-pinephone-pro-Add-audio-support.patch + "${FILESDIR}"/0055-arm64-dts-rk3399-pinephone-pro-Add-flash-and-fix-led.patch + "${FILESDIR}"/0056-arm64-dts-rk3399-pinephone-pro-add-modem-RI-pin.patch + "${FILESDIR}"/0057-arm64-dts-rk3399-pinephone-pro-improve-sound-device.patch + "${FILESDIR}"/0058-arm64-dts-rk3399-pinephone-pro-remove-front-camera-n.patch + # Pinephone Keyboard + "${FILESDIR}"/pp-keyboard.patch + "${FILESDIR}"/ppp-keyboard.patch + # https://gitlab.com/mobian1/issues/-/issues/389#note_811711315 + "${FILESDIR}"/mmc-core-wait-for-command-setting-Power-Off-Notification-bit-to-complete.patch + # Bootsplash + "${FILESDIR}"/0001-revert-garbage-collect-fbdev-scrolling-acceleration.patch + "${FILESDIR}"/0002-revert-fbcon-remove-now-unusued-softback_lines-cursor-argument.patch + "${FILESDIR}"/0003-revert-fbcon-remove-no-op-fbcon_set_origin.patch + "${FILESDIR}"/0004-revert-fbcon-remove-soft-scrollback-code.patch + "${FILESDIR}"/0001-bootsplash.patch + "${FILESDIR}"/0002-bootsplash.patch + "${FILESDIR}"/0003-bootsplash.patch + "${FILESDIR}"/0004-bootsplash.patch + "${FILESDIR}"/0005-bootsplash.patch + "${FILESDIR}"/0006-bootsplash.patch + "${FILESDIR}"/0007-bootsplash.patch + "${FILESDIR}"/0008-bootsplash.patch + "${FILESDIR}"/0009-bootsplash.patch + "${FILESDIR}"/0010-bootsplash.patch + "${FILESDIR}"/0011-bootsplash.patch + "${FILESDIR}"/0012-bootsplash.patch +) + +src_prepare() { + default + eapply_user +} + +pkg_postinst() { + kernel-2_pkg_postinst + einfo "For more info on this patchset, and how to report problems, see:" + einfo "${HOMEPAGE}" + einfo "To build the kernel use the following command:" + einfo "make Image Image.gz modules" + einfo "make DTC_FLAGS="-@" dtbs" + einfo "make install; make modules_intall; make dtbs_install" + einfo "if you want to cross compile pinephone kernel on amd64 host, follow the https://wiki.gentoo.org/wiki/Cross_build_environment" + einfo "to setup cross toolchain environment, then create a xmake wrapper like the following, and replace make with xmake in above commands" + einfo "#!/bin/sh" + einfo "exec make ARCH="${FILESDIR}"/arm64"${FILESDIR}"/ CROSS_COMPILE="${FILESDIR}"/aarch64-unknown-linux-gnu-"${FILESDIR}"/ INSTALL_MOD_PATH="${FILESDIR}"/${SYSROOT}"${FILESDIR}"/ "${FILESDIR}"/$@"${FILESDIR}"/" +} + +pkg_postrm() { + kernel-2_pkg_postrm +} +