All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] matrix-gui-tscal: Add init package to run ts_calibrate
@ 2013-12-04 22:37 Chase Maupin
  2013-12-04 22:37 ` [PATCH 2/3] package-group-tisdk-matrix: add matrix-gui-tscal Chase Maupin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chase Maupin @ 2013-12-04 22:37 UTC (permalink / raw)
  To: meta-arago

* Add a package that will run ts_calibrate if needed.  This
  will allow separating this logic from the matrix init script
  since it is not always needed.

Signed-off-by: Chase Maupin <Chase.Maupin@ti.com>
---
 .../recipes-core/matrix/matrix-gui-tscal/init      |   43 ++++++++++++++++++++
 .../recipes-core/matrix/matrix-gui-tscal_1.0.bb    |   25 +++++++++++
 2 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100644 meta-arago-extras/recipes-core/matrix/matrix-gui-tscal/init
 create mode 100644 meta-arago-extras/recipes-core/matrix/matrix-gui-tscal_1.0.bb

diff --git a/meta-arago-extras/recipes-core/matrix/matrix-gui-tscal/init b/meta-arago-extras/recipes-core/matrix/matrix-gui-tscal/init
new file mode 100644
index 0000000..e8d9197
--- /dev/null
+++ b/meta-arago-extras/recipes-core/matrix/matrix-gui-tscal/init
@@ -0,0 +1,43 @@
+#!/bin/sh
+# Copyright (C) {2013} Texas Instruments Incorporated - http://www.ti.com/
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation version 2.
+#
+# This program is distributed "as is" WITHOUT ANY WARRANTY of any
+# kind, whether express or implied; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+tsfile=/etc/pointercal
+
+# Check if the SD card is mounted and the first partition is
+# vfat.  If so let's write the pointercal file there so that if
+# someone messes up calibration they can just delete the file from
+# any system and reboot the board.
+
+#TODO how can we find the SD card and not eMMC?  can we look for a "boot"
+# LABEL?
+mount | grep /media/mmcblk0p1 | grep vfat > /dev/null 2>&1
+if [ "$?" = "0" ]
+then
+    tsfile=/media/mmcblk0p1/pointercal
+    export TSLIB_CALIBFILE=$tsfile
+fi
+
+if [ ! -f $tsfile ] ; then
+    echo -n "Calibrating touchscreen (first time only)"
+    ts_calibrate
+    echo "."
+
+    # If we create a pointercal file and it was not in /etc/pointercal
+    # let's copy it there as well if it does not already exist.  This is so
+    # that running other applications that look for /etc/pointercal and
+    # without TSLIB_CALIBFILE set will still get the right calibration.
+    # TODO: can we just globally export TSLIB_CALIBFILE?
+    if [ ! -f /etc/pointercal -a -f $tsfile ]
+    then
+        cp $tsfile /etc/pointercal
+    fi
+fi
diff --git a/meta-arago-extras/recipes-core/matrix/matrix-gui-tscal_1.0.bb b/meta-arago-extras/recipes-core/matrix/matrix-gui-tscal_1.0.bb
new file mode 100644
index 0000000..9156a6a
--- /dev/null
+++ b/meta-arago-extras/recipes-core/matrix/matrix-gui-tscal_1.0.bb
@@ -0,0 +1,25 @@
+DESCRIPTION = "Matrix GUI TS calibration init script"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://init;beginline=2;endline=11;md5=4b2e3b15f01cf63d2cb7988afdcc6c60"
+
+PR = "r0"
+
+S = "${WORKDIR}"
+
+INITSCRIPT_NAME = "matrix-gui-tscal"
+# Start this init script before the matrix gui launches
+INITSCRIPT_PARAMS = "start 96 2 3 4 5 ."
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit update-rc.d
+
+SRC_URI = "file://init"
+
+do_install(){
+	# Install the init script
+	# TODO: replace init script with systemd files
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/matrix-gui-tscal
+}
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-01-20 21:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-04 22:37 [PATCH 1/3] matrix-gui-tscal: Add init package to run ts_calibrate Chase Maupin
2013-12-04 22:37 ` [PATCH 2/3] package-group-tisdk-matrix: add matrix-gui-tscal Chase Maupin
2013-12-04 22:37 ` [PATCH 3/3] matrix-gui: remove ts_calibrate from init Chase Maupin
2013-12-05  0:31 ` [PATCH 1/3] matrix-gui-tscal: Add init package to run ts_calibrate Cooper Jr., Franklin
2013-12-05  1:38   ` Denys Dmytriyenko
2014-01-20 21:35     ` Maupin, Chase
2013-12-05 12:52   ` Maupin, Chase

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.