Squashed 'import-layers/meta-raspberrypi/' content from commit 2745399

Change-Id: I8a89d81813dea98209d089ef500a403ea4da5d9d
git-subtree-dir: import-layers/meta-raspberrypi
git-subtree-split: 2745399f75d7564fcc586d0365ff73be47849d0e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf
new file mode 100644
index 0000000..6fd5298
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf
@@ -0,0 +1,6 @@
+# Initial xorg.conf for the RaspberryPi
+# Most things are setup automatically by magic pixies in the system.
+# 
+# It is suggested this file is not used any more and configuration 
+# snippets are placed in xorg.conf.d instead.
+#
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/10-evdev.conf b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/10-evdev.conf
new file mode 100644
index 0000000..cc83ab2
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/10-evdev.conf
@@ -0,0 +1,40 @@
+#
+# Catch-all evdev loader for udev-based systems
+# We don't simply match on any device since that also adds accelerometers
+# and other devices that we don't really want to use. The list below
+# matches everything but joysticks.
+
+Section "InputClass"
+        Identifier "evdev pointer catchall"
+        MatchIsPointer "on"
+        MatchDevicePath "/dev/input/event*"
+        Driver "evdev"
+EndSection
+
+Section "InputClass"
+        Identifier "evdev keyboard catchall"
+        MatchIsKeyboard "on"
+        MatchDevicePath "/dev/input/event*"
+        Driver "evdev"
+EndSection
+
+Section "InputClass"
+        Identifier "evdev touchpad catchall"
+        MatchIsTouchpad "on"
+        MatchDevicePath "/dev/input/event*"
+        Driver "evdev"
+EndSection
+
+Section "InputClass"
+        Identifier "evdev tablet catchall"
+        MatchIsTablet "on"
+        MatchDevicePath "/dev/input/event*"
+        Driver "evdev"
+EndSection
+
+Section "InputClass"
+        Identifier "evdev touchscreen catchall"
+        MatchIsTouchscreen "on"
+        MatchDevicePath "/dev/input/event*"
+        Driver "evdev"
+EndSection
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/98-pitft.conf b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/98-pitft.conf
new file mode 100644
index 0000000..0d2b36b
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/98-pitft.conf
@@ -0,0 +1,5 @@
+Section "Device"
+    Identifier "Adafruit PiTFT"
+    Driver "fbdev"
+    Option "fbdev" "/dev/fb1"
+EndSection
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-calibration.conf b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-calibration.conf
new file mode 100644
index 0000000..f8b578c
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-calibration.conf
@@ -0,0 +1,6 @@
+Section "InputClass"
+        Identifier      "calibration"
+        MatchProduct    "stmpe-ts"
+        Option  "Calibration"   "3800 200 200 3800"
+        Option  "SwapAxes"      "1"
+EndSection
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
new file mode 100644
index 0000000..062de2d
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
@@ -0,0 +1,19 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append_rpi = " file://xorg.conf.d/10-evdev.conf \
+                       file://xorg.conf.d/98-pitft.conf \
+                       file://xorg.conf.d/99-calibration.conf \
+                     "
+
+do_install_append_rpi () {
+	install -d ${D}/${sysconfdir}/X11/xorg.conf.d/
+	install -m 0644 ${WORKDIR}/xorg.conf.d/10-evdev.conf ${D}/${sysconfdir}/X11/xorg.conf.d/
+
+	PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
+	if [ "${PITFT}" = "1" ]; then
+		install -m 0644 ${WORKDIR}/xorg.conf.d/98-pitft.conf ${D}/${sysconfdir}/X11/xorg.conf.d/
+		install -m 0644 ${WORKDIR}/xorg.conf.d/99-calibration.conf ${D}/${sysconfdir}/X11/xorg.conf.d/
+	fi
+}
+
+FILES_${PN}_rpi += "${sysconfdir}/X11/xorg.conf ${sysconfdir}/X11/xorg.conf.d/*"