pitft: Add support for pitft28r

The support for PiTFT 28 inch resistive touchscreen is optional
and can be enabled by adding below in local.conf:

MACHINE_FEATURES += "pitft pitft28r"

While at it also fix a minor typo in README.

Signed-off-by: Petter Mabäcker <petter@technux.se>
This commit is contained in:
Petter Mabäcker 2016-03-30 16:35:45 +02:00 committed by Andrei Gherzan
parent 84af6e7de3
commit 9797874a23
7 changed files with 21 additions and 3 deletions

3
README
View File

@ -204,7 +204,7 @@ kernels.
NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for
older kernel versions. older kernel versions.
3.L. Eenable SPI bus 3.L. Enable SPI bus
==================== ====================
When using device tree kernels, set this variable to enable the SPI bus When using device tree kernels, set this variable to enable the SPI bus
ENABLE_SPI_BUS = "1" ENABLE_SPI_BUS = "1"
@ -232,6 +232,7 @@ the modelname should be added as a MACHINE_FEATURES in local.conf like below:
List of currently supported models: List of currently supported models:
- pitft22 - pitft22
- pitft28r
4. Extra apps 4. Extra apps

View File

@ -33,6 +33,7 @@ KERNEL_DEVICETREE ?= " \
overlays/iqaudio-dacplus-overlay.dtb \ overlays/iqaudio-dacplus-overlay.dtb \
overlays/lirc-rpi-overlay.dtb \ overlays/lirc-rpi-overlay.dtb \
overlays/pitft22-overlay.dtb \ overlays/pitft22-overlay.dtb \
overlays/pitft28-resistive-overlay.dtb \
overlays/pps-gpio-overlay.dtb \ overlays/pps-gpio-overlay.dtb \
overlays/w1-gpio-overlay.dtb \ overlays/w1-gpio-overlay.dtb \
overlays/w1-gpio-pullup-overlay.dtb \ overlays/w1-gpio-pullup-overlay.dtb \

View File

@ -17,6 +17,7 @@ PR = "r4"
PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
PITFT22="${@bb.utils.contains("MACHINE_FEATURES", "pitft22", "1", "0", d)}" PITFT22="${@bb.utils.contains("MACHINE_FEATURES", "pitft22", "1", "0", d)}"
PITFT28r="${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "1", "0", d)}"
inherit deploy inherit deploy
@ -90,6 +91,11 @@ do_deploy() {
echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
fi fi
if [ "${PITFT28r}" = "1" ]; then
echo "# Enable PITFT28r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "dtoverlay=pitft28-resistive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
fi
} }
addtask deploy before do_package after do_install addtask deploy before do_package after do_install

View File

@ -0,0 +1,6 @@
Section "InputClass"
Identifier "calibration"
MatchProduct "stmpe-ts"
Option "Calibration" "3800 200 200 3800"
Option "SwapAxes" "1"
EndSection

View File

@ -1,7 +1,8 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI_append_rpi = " file://xorg.conf.d/10-evdev.conf \ SRC_URI_append_rpi = " file://xorg.conf.d/10-evdev.conf \
file://xorg.conf.d/99-pitft.conf \ file://xorg.conf.d/98-pitft.conf \
file://xorg.conf.d/99-calibration.conf \
" "
do_install_append_rpi () { do_install_append_rpi () {
@ -10,7 +11,8 @@ do_install_append_rpi () {
PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
if [ "${PITFT}" = "1" ]; then if [ "${PITFT}" = "1" ]; then
install -m 0644 ${WORKDIR}/xorg.conf.d/99-pitft.conf ${D}/${sysconfdir}/X11/xorg.conf.d/ 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 fi
} }

View File

@ -27,6 +27,8 @@ CMDLINE_append = ' ${@base_conditional("ENABLE_KGDB", "1", "kgdboc=ttyAMA0,11520
UDEV_GE_141 ?= "1" UDEV_GE_141 ?= "1"
KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}"
# Set programmatically some variables during recipe parsing # Set programmatically some variables during recipe parsing
# See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions # See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions
python __anonymous () { python __anonymous () {