summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/freedesktop.org.xml.in22
-rw-r--r--tests/mime-detection/devicetree.dtsi3
-rw-r--r--tests/mime-detection/devicetree1.dts4
-rw-r--r--tests/mime-detection/devicetree2.dts1
-rw-r--r--tests/mime-detection/list5
5 files changed, 35 insertions, 0 deletions
diff --git a/data/freedesktop.org.xml.in b/data/freedesktop.org.xml.in
index 2c09cdb0..68476bb3 100644
--- a/data/freedesktop.org.xml.in
+++ b/data/freedesktop.org.xml.in
@@ -7898,6 +7898,28 @@ command to generate the output files.
<glob pattern="*.kt"/>
</mime-type>
+ <mime-type type="text/x-devicetree-source">
+ <comment>Devicetree source code</comment>
+ <acronym>DTS</acronym>
+ <expanded-acronym>Device Tree Source</expanded-acronym>
+ <sub-class-of type="text/plain"/>
+ <glob pattern="*.dts"/>
+ <glob pattern="*.dtsi"/>
+ <magic>
+ <match type="string" mask="0x8080" value="\000\000" offset="0">
+ <match type="string" value="/dts-v1/" offset="0:4080"/>
+ </match>
+ </magic>
+ <magic priority="40">
+ <match type="string" mask="0x8080" value="\000\000" offset="0">
+ <match type="string" value="/ {" offset="0:4090"/>
+ <match type="string" value="include " offset="0:4080">
+ <match type="string" value=".dts" offset="10:4090"/>
+ </match>
+ </match>
+ </magic>
+ </mime-type>
+
<mime-type type="image/avif">
<comment>AVIF image</comment>
<acronym>AVIF</acronym>
diff --git a/tests/mime-detection/devicetree.dtsi b/tests/mime-detection/devicetree.dtsi
new file mode 100644
index 00000000..68d518c6
--- /dev/null
+++ b/tests/mime-detection/devicetree.dtsi
@@ -0,0 +1,3 @@
+/ {
+ node { };
+};
diff --git a/tests/mime-detection/devicetree1.dts b/tests/mime-detection/devicetree1.dts
new file mode 100644
index 00000000..48772d1f
--- /dev/null
+++ b/tests/mime-detection/devicetree1.dts
@@ -0,0 +1,4 @@
+/* @ 2021 */
+/dts-v1/;
+/ {
+};
diff --git a/tests/mime-detection/devicetree2.dts b/tests/mime-detection/devicetree2.dts
new file mode 100644
index 00000000..805e6674
--- /dev/null
+++ b/tests/mime-detection/devicetree2.dts
@@ -0,0 +1 @@
+#include <foo/bar.dtsi>
diff --git a/tests/mime-detection/list b/tests/mime-detection/list
index ac907977..cb20f435 100644
--- a/tests/mime-detection/list
+++ b/tests/mime-detection/list
@@ -899,6 +899,11 @@ test.gd application/x-gdscript ox
# Kotlin source code
test.kt text/x-kotlin ox
+# Device Tree Source
+devicetree1.dts text/x-devicetree-source xoo
+devicetree2.dts text/x-devicetree-source xoo
+devicetree.dtsi text/x-devicetree-source
+
# AV1 Image File Format (AVIF)
# https://aomediacodec.github.io/av1-avif/
test.avif image/avif