diff options
| author | Leonard Göhrs <l.goehrs@pengutronix.de> | 2024-11-01 14:01:37 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-11-01 06:43:16 -0700 |
| commit | 08934d75ae8aa050a8632c0637558290dff34705 (patch) | |
| tree | d0b67dfe7ab4dfd97a68579c8922d47631b03feb /meta-oe/classes | |
| parent | 6cf665bde8a21f8e89f2130d0dea593c53de65ab (diff) | |
| download | meta-openembedded-08934d75ae8aa050a8632c0637558290dff34705.tar.gz | |
panel-mipi-dbi.bbclass: initial addition of the firmware blob class
The `panel-mipi-dbi.bbclass` can be used to build a firmware file for use
with the `panel-mipi-dbi` Linux driver.
The class uses the `mipi-dbi-cmd` from `panel-mipi-dbi-native` to
assemble a human readable list of init commands into a firmware file
for use with the `panel-mipi-dbi` Linux driver.
Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/classes')
| -rw-r--r-- | meta-oe/classes/panel-mipi-dbi.bbclass | 48 |
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 | |||
| 30 | DEPENDS = "panel-mipi-dbi-native" | ||
| 31 | |||
| 32 | PANEL_FIRMWARE_BIN ?= "${@d.getVar('PANEL_FIRMWARE').removesuffix('.txt')}.bin" | ||
| 33 | |||
| 34 | do_configure[noexec] = "1" | ||
| 35 | |||
| 36 | do_compile () { | ||
| 37 | mipi-dbi-cmd \ | ||
| 38 | "${B}/${PANEL_FIRMWARE_BIN}" \ | ||
| 39 | "${UNPACKDIR}/${PANEL_FIRMWARE}" | ||
| 40 | } | ||
| 41 | |||
| 42 | do_install () { | ||
| 43 | install -m 0644 -D \ | ||
| 44 | "${B}/${PANEL_FIRMWARE_BIN}" \ | ||
| 45 | "${D}${nonarch_base_libdir}/firmware/${PANEL_FIRMWARE_BIN}" | ||
| 46 | } | ||
| 47 | |||
| 48 | FILES:${PN} = "${nonarch_base_libdir}/firmware/" | ||
