summaryrefslogtreecommitdiffstats
path: root/meta-oe/classes/panel-mipi-dbi.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/classes/panel-mipi-dbi.bbclass')
-rw-r--r--meta-oe/classes/panel-mipi-dbi.bbclass48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta-oe/classes/panel-mipi-dbi.bbclass b/meta-oe/classes/panel-mipi-dbi.bbclass
new file mode 100644
index 0000000000..7ceebc72e0
--- /dev/null
+++ b/meta-oe/classes/panel-mipi-dbi.bbclass
@@ -0,0 +1,48 @@
1# SPDX-License-Identifier: MIT
2#
3# Copyright Pengutronix <yocto@pengutronix.de>
4#
5# Class to generate firmware files for use with the `panel-mipi-dbi` Linux
6# driver.
7#
8# The firmware source file contains a list of commands to send to the display
9# controller in order to initialize it:
10#
11# $ cat shineworld,lh133k.txt
12# command 0x11 # exit sleep mode
13# delay 120
14#
15# # Enable color inversion
16# command 0x21 # INVON
17# ...
18#
19# A recipe to compile such a command list into a firmware blob for use with
20# the `panel-mipi-dbi` driver looks something like this:
21#
22# $ cat panel-shineworld-lh133k.bb
23# inherit panel-mipi-dbi
24#
25# SRC_URI = "file://${PANEL_FIRMWARE}"
26#
27# PANEL_FIRMWARE = "shineworld,lh133k.txt"
28# ...
29
30DEPENDS = "panel-mipi-dbi-native"
31
32PANEL_FIRMWARE_BIN ?= "${@d.getVar('PANEL_FIRMWARE').removesuffix('.txt')}.bin"
33
34do_configure[noexec] = "1"
35
36do_compile () {
37 mipi-dbi-cmd \
38 "${B}/${PANEL_FIRMWARE_BIN}" \
39 "${UNPACKDIR}/${PANEL_FIRMWARE}"
40}
41
42do_install () {
43 install -m 0644 -D \
44 "${B}/${PANEL_FIRMWARE_BIN}" \
45 "${D}${nonarch_base_libdir}/firmware/${PANEL_FIRMWARE_BIN}"
46}
47
48FILES:${PN} = "${nonarch_base_libdir}/firmware/"