pitft: Add PiTFT22 support

- Add support to build overlays for PiTFT22 in the kernel.
- Setup a basic configuration for the driver

The PiTFT22 support is optional and can be enabled by adding below in
local.conf:

MACHINE_FEATURES += "pitft pitft22"

This patch also includes restructuring of kernel patches per kernel version
specific directories.

[Support #70]

Signed-off-by: Petter Mabäcker <petter@technux.se>
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
This commit is contained in:
Petter Mabäcker 2016-02-28 14:46:13 +01:00 committed by Andrei Gherzan
parent 249cb544e0
commit a42a1706de
10 changed files with 247 additions and 3 deletions

7
README
View File

@ -226,6 +226,13 @@ MACHINE_FEATURES += "pitft"
NOTE: To get this working the overlay for the PiTFT model must be build,
added and specified as well (dtoverlay=<driver> in config.txt)
Below is a list of currently supported PiTFT models in meta-raspberrypi,
the modelname should be added as a MACHINE_FEATURES in local.conf like below:
- MACHINE_FEATURES += "pitft <modelname>"
List of currently supported models:
- pitft22
4. Extra apps
=============

View File

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

View File

@ -16,6 +16,7 @@ S = "${WORKDIR}/git"
PR = "r4"
PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
PITFT22="${@bb.utils.contains("MACHINE_FEATURES", "pitft22", "1", "0", d)}"
inherit deploy
@ -83,6 +84,12 @@ do_deploy() {
echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
fi
# PiTFT22 display support
if [ "${PITFT22}" = "1" ]; then
echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
fi
}
addtask deploy before do_package after do_install

View File

@ -0,0 +1,110 @@
From 2f44861e2a2d651a9aa62a75343a032fee33e93b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petter=20Mab=C3=A4cker?= <petter@technux.se>
Date: Fri, 8 Jan 2016 09:02:44 +0100
Subject: [PATCH] dts: add overlay for pitft22 in linux 3.18
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Pending
Add the pitft22 overlay from adafruit Adafruit-Pi-Kernel-o-Matic repo:
https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic
Signed-off-by: Petter Mabäcker <petter@technux.se>
---
arch/arm/boot/dts/overlays/Makefile | 1 +
arch/arm/boot/dts/overlays/pitft22-overlay.dts | 69 ++++++++++++++++++++++++++
2 files changed, 70 insertions(+)
create mode 100755 arch/arm/boot/dts/overlays/pitft22-overlay.dts
diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile
index c766616..1eaaf81 100644
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -27,6 +27,7 @@ dtb-$(RPI_DT_OVERLAYS) += mcp2515-can0-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pitft22-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += rpi-dac-overlay.dtb
diff --git a/arch/arm/boot/dts/overlays/pitft22-overlay.dts b/arch/arm/boot/dts/overlays/pitft22-overlay.dts
new file mode 100755
index 0000000..894ba22
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/pitft22-overlay.dts
@@ -0,0 +1,69 @@
+/*
+ * Device Tree overlay for pitft by Adafruit
+ *
+ */
+
+/dts-v1/;
+/plugin/;
+
+/ {
+ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
+
+ fragment@0 {
+ target = <&spi0>;
+ __overlay__ {
+ status = "okay";
+
+ spidev@0{
+ status = "disabled";
+ };
+
+ spidev@1{
+ status = "disabled";
+ };
+ };
+ };
+
+ fragment@1 {
+ target = <&gpio>;
+ __overlay__ {
+ pitft_pins: pitft_pins {
+ brcm,pins = <25>;
+ brcm,function = <1>; /* out */
+ brcm,pull = <0>; /* none */
+ };
+ };
+ };
+
+ fragment@2 {
+ target = <&spi0>;
+ __overlay__ {
+ /* needed to avoid dtc warning */
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pitft: pitft@0{
+ compatible = "ilitek,ili9340";
+ reg = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pitft_pins>;
+
+ spi-max-frequency = <32000000>;
+ rotate = <90>;
+ fps = <25>;
+ bgr;
+ buswidth = <8>;
+ dc-gpios = <&gpio 25 0>;
+ debug = <0>;
+ };
+
+ };
+ };
+
+ __overrides__ {
+ speed = <&pitft>,"spi-max-frequency:0";
+ rotate = <&pitft>,"rotate:0";
+ fps = <&pitft>,"fps:0";
+ debug = <&pitft>,"debug:0";
+ };
+};
--
1.9.1

View File

@ -0,0 +1,110 @@
From a28bd410022b32a64e208f04b45add6326990332 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petter=20Mab=C3=A4cker?= <petter@technux.se>
Date: Fri, 8 Jan 2016 09:02:44 +0100
Subject: [PATCH] dts: add overlay for pitft22
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Pending
Add the pitft22 overlay from adafruit Adafruit-Pi-Kernel-o-Matic repo:
https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic
Signed-off-by: Petter Mabäcker <petter@technux.se>
---
arch/arm/boot/dts/overlays/Makefile | 1 +
arch/arm/boot/dts/overlays/pitft22-overlay.dts | 69 ++++++++++++++++++++++++++
2 files changed, 70 insertions(+)
create mode 100755 arch/arm/boot/dts/overlays/pitft22-overlay.dts
diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile
index 1a60e9c..a2535a2 100644
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -37,6 +37,7 @@ dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += piscreen2r-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pitft22-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += pitft28-capacitive-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
diff --git a/arch/arm/boot/dts/overlays/pitft22-overlay.dts b/arch/arm/boot/dts/overlays/pitft22-overlay.dts
new file mode 100755
index 0000000..894ba22
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/pitft22-overlay.dts
@@ -0,0 +1,69 @@
+/*
+ * Device Tree overlay for pitft by Adafruit
+ *
+ */
+
+/dts-v1/;
+/plugin/;
+
+/ {
+ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
+
+ fragment@0 {
+ target = <&spi0>;
+ __overlay__ {
+ status = "okay";
+
+ spidev@0{
+ status = "disabled";
+ };
+
+ spidev@1{
+ status = "disabled";
+ };
+ };
+ };
+
+ fragment@1 {
+ target = <&gpio>;
+ __overlay__ {
+ pitft_pins: pitft_pins {
+ brcm,pins = <25>;
+ brcm,function = <1>; /* out */
+ brcm,pull = <0>; /* none */
+ };
+ };
+ };
+
+ fragment@2 {
+ target = <&spi0>;
+ __overlay__ {
+ /* needed to avoid dtc warning */
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pitft: pitft@0{
+ compatible = "ilitek,ili9340";
+ reg = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pitft_pins>;
+
+ spi-max-frequency = <32000000>;
+ rotate = <90>;
+ fps = <25>;
+ bgr;
+ buswidth = <8>;
+ dc-gpios = <&gpio 25 0>;
+ debug = <0>;
+ };
+
+ };
+ };
+
+ __overrides__ {
+ speed = <&pitft>,"spi-max-frequency:0";
+ rotate = <&pitft>,"rotate:0";
+ fps = <&pitft>,"fps:0";
+ debug = <&pitft>,"debug:0";
+ };
+};
--
1.9.1

View File

@ -1,3 +1,5 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
LINUX_VERSION ?= "3.14.28"
SRCREV = "e294028d7733a30f3befacc41d473c251096a515"

View File

@ -1,8 +1,11 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
LINUX_VERSION ?= "3.18.16"
SRCREV = "1bb18c8f721ef674a447f3622273f2e2de7a205c"
SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-3.18.y"
SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-3.18.y \
file://0001-dts-add-overlay-for-pitft22.patch \
"
require linux-raspberrypi.inc
# Create missing out of tree 'overlays' directory prior to install step

View File

@ -1,6 +1,10 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
LINUX_VERSION ?= "4.1.17"
SRCREV = "cb2f10196a9b718a2d94bb4ac0887c2ea14988ae"
SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.1.y"
SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.1.y \
file://0001-dts-add-overlay-for-pitft22.patch \
"
require linux-raspberrypi.inc