pandora-scripts: add op_lcdrate.sh
authorGrazvydas Ignotas <notasas@gmail.com>
Mon, 7 Jun 2010 21:26:29 +0000 (00:26 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Mon, 7 Jun 2010 21:34:52 +0000 (00:34 +0300)
This is inteded to be used by programs (or the user directly)
to change LCD refresh rate. Useful for emulators mostly to match
screen refresh rate of emulated system.

recipes/pandora-system/pandora-scripts.bb
recipes/pandora-system/pandora-scripts/op_lcdrate.sh [new file with mode: 0755]
recipes/pandora-system/pandora-sudoers/50_openpandora

index 06c33f7..4e9367e 100644 (file)
@@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 DEPENDS = "zenity dbus"
 RDEPENDS = "zenity dbus"
 
-PR = "r24"
+PR = "r25"
 
 SRC_URI = " \
           file://op_bright.sh \
@@ -34,6 +34,7 @@ SRC_URI = " \
 #          file://op_usermanager.desktop \
           file://op_lcdsettings.sh \
 #          file://op_lcdsettings.desktop \
+          file://op_lcdrate.sh \
           file://op_nubmode.sh \
 #        file://op_nubmode.desktop \
           file://gui.conf \
@@ -54,6 +55,7 @@ do_install() {
           install -m 0755 ${WORKDIR}/op_datetime.sh ${D}${prefix}/pandora/scripts/
          install -m 0755 ${WORKDIR}/op_usermanager.sh ${D}${prefix}/pandora/scripts/
           install -m 0755 ${WORKDIR}/op_lcdsettings.sh ${D}${prefix}/pandora/scripts/
+          install -m 0755 ${WORKDIR}/op_lcdrate.sh ${D}${prefix}/pandora/scripts/
          install -m 0755 ${WORKDIR}/op_nubmode.sh ${D}${prefix}/pandora/scripts/
 
           install -d ${D}${prefix}/pandora/apps/
diff --git a/recipes/pandora-system/pandora-scripts/op_lcdrate.sh b/recipes/pandora-system/pandora-scripts/op_lcdrate.sh
new file mode 100755 (executable)
index 0000000..928ee83
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+# LCD mode setup script
+# Copyright (c) 2010, GraÅžvydas Ignotas
+# License: BSD (http://www.opensource.org/licenses/bsd-license.php)
+
+modedb="\
+60|36000,800/68/214/1,480/39/34/1 \
+50|36000,800/189/214/1,480/83/34/1"
+
+# timings file for LCD device
+timings_file="/sys/devices/platform/omapdss/display0/timings"
+
+
+set -e
+
+for mode in $modedb
+do
+       name=`echo $mode | awk -F '|' '{print $1}'`
+       if [ "x$name" = "x$1" ]
+       then
+               timings=`echo $mode | awk -F '|' '{print $2}'`
+               echo $timings > $timings_file
+               exit 0
+       fi
+done
+
+echo "$0: missing rate: $1"
+exit 1
index f05b17b..eefd14a 100755 (executable)
@@ -20,5 +20,6 @@
 %wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_datetime.sh
 %wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_wifi.sh
 %wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_lcdsettings.sh
+%wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_lcdrate.sh
 %wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_nubmode.sh