From e29c8ede3d43565dc01bd5d80a9f1a147ae650c1 Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Sat, 9 Mar 2019 15:01:47 -0500 Subject: [PATCH] device-ouya-ouya: Set cooling governor in initfs hook (!269) This governor is meant for simple on/off cooling fans. --- device/device-ouya-ouya/APKBUILD | 2 +- device/device-ouya-ouya/initfs-hook.sh | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/device/device-ouya-ouya/APKBUILD b/device/device-ouya-ouya/APKBUILD index 740762a72..684c90187 100644 --- a/device/device-ouya-ouya/APKBUILD +++ b/device/device-ouya-ouya/APKBUILD @@ -29,5 +29,5 @@ nonfree_firmware() { } sha512sums="f1c6befb6867ae6e2f9e42312bdd03c4c242da33a6d2e6bc6fb2df5b6437acab50fb2c51a4663a1e1799e77614a959cac40bcc59336e92d2d6ac15cfacce6e67 deviceinfo -c7253d5d6f53b7acbb1c2358e95ecba86ccbaa2bb5e99ad8db9f59e453209ddad55b13d8c1dc67f634cc4f997283b4079fa1b5b60f6d1440b13f39e5b1646d81 initfs-hook.sh +d01ac1f451275b1a269aab3c8f7fe20b482c952d00c4457ea496b45780c052f8ef98a5ba22a4af009ca128858374c1d3fb97e458102b09f7c40f3d7a718326c1 initfs-hook.sh bf442fac4dc0594e055ed7a7d8232b5c884e2e77543273e8c4f32b5fe3c199561c86d8a5f665e17406057ca7863fabb93e789fe5e168fcd89d2982e0046232ad fb.modes" diff --git a/device/device-ouya-ouya/initfs-hook.sh b/device/device-ouya-ouya/initfs-hook.sh index a8014e23a..eda297597 100644 --- a/device/device-ouya-ouya/initfs-hook.sh +++ b/device/device-ouya-ouya/initfs-hook.sh @@ -1,6 +1,16 @@ #!/bin/sh +# downstream kernel # fix display for xorg -echo 0 > /sys/class/graphics/fb0/blank -echo 16 > /sys/devices/tegradc.0/graphics/fb0/bits_per_pixel -echo 0 0 > /sys/class/graphics/fb0/pan +if [ -d /sys/devices/tegradc.0 ]; then + echo 0 > /sys/class/graphics/fb0/blank + echo 16 > /sys/devices/tegradc.0/graphics/fb0/bits_per_pixel + echo 0 0 > /sys/class/graphics/fb0/pan +fi + + +# mainline kernel +# set cooling governor that is meant for simple on/off cooling fans +if [ -d /sys/class/thermal/thermal_zone0 ]; then + echo "bang_bang" | tee /sys/class/thermal/thermal_zone0/policy +fi