Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add waveshare spi lcd support #251

Merged
merged 4 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ dtb-$(CONFIG_CLK_RK3568) += \
rk3568-spi1-m1-cs0-spidev.dtbo \
rk3568-spi3-m0-cs0-mcp2515.dtbo \
rk3568-spi3-m0-cs0-spidev.dtbo \
rk3568-spi3-m0-cs0-waveshare35.dtbo \
rk3568-spi3-m0-cs1-spidev.dtbo \
rk3568-spi3-m1-cs0-enc28j60.dtbo \
rk3568-spi3-m1-cs0-mcp2515-gpio4_d1.dtbo \
Expand Down Expand Up @@ -336,6 +337,7 @@ dtb-$(CONFIG_CLK_RK3588) += \
rk3588-spi0-m0-cs0-spidev.dtbo \
rk3588-spi0-m1-cs0-mcp2515-8mhz.dtbo \
rk3588-spi0-m1-cs0-spidev.dtbo \
rk3588-spi0-m1-cs0-waveshare35.dtbo \
rk3588-spi0-m1-cs1-spidev.dtbo \
rk3588-spi0-m2-cs0-mcp2515-8mhz.dtbo \
rk3588-spi0-m2-cs0-spidev.dtbo \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
reg = <1>;
id = <1>;
spi-max-frequency = <2000000>;
interrupts = <18 2>;
interrupts = <RK_PC2 IRQ_TYPE_EDGE_FALLING>;
interrupt-parent = <&gpio4>;
pendown-gpio = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>;
ti,x-plate-ohms = /bits/ 16 <60>;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
metadata {
title = "Enable Waveshare 3.5 inch Display on SPI3";
compatible = "radxa,cm3-io", "radxa,cm3-rpi-cm4-io";
category = "misc";
exclusive = "GPIO4_A6", "GPIO3_C6", "GPIO3_D3", "GPIO0_C7", "GPIO4_B0", "GPIO4_B2", "GPIO4_B3";
description = "Enable Waveshare 3.5 inch Display on SPI3.";
};

fragment@0 {
target = <&spi3>;

__overlay__ {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default", "high_speed";
pinctrl-0 = <&spi3m0_cs0 &spi3m0_pins>;
pinctrl-1 = <&spi3m0_cs0 &spi3m0_pins_hs>;
max-freq = <16000000>;

ili9486@0 {
compatible = "ilitek,ili9486";
reg = <0>;
spi-max-frequency = <16000000>;
txbuflen = <32768>;
rotate = <90>;
bgr = <0>;
fps = <30>;
buswidth = <8>;
regwidth = <16>;
reset-gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_LOW>;
dc-gpios = <&gpio3 RK_PD3 GPIO_ACTIVE_HIGH>;
debug = <0>;
};

ads7846@1 {
compatible = "ti,ads7846";
status = "okay";
reg = <1>;
id = <1>;
spi-max-frequency = <2000000>;
interrupts = <RK_PC7 IRQ_TYPE_EDGE_FALLING>;
interrupt-parent = <&gpio0>;
pendown-gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
ti,x-plate-ohms = /bits/ 16 <60>;
ti,pressure-max = /bits/ 16 <255>;
ti,swap-xy = <0>;
vcc-supply = <&vcc5v0_sys>;
};
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
metadata {
title = "Enable Waveshare 3.5 inch Display on SPI0";
compatible = "radxa,cm5-io";
category = "misc";
exclusive = "GPIO1_B1", "GPIO1_D5", "GPIO4_A0", "GPIO4_A1", "GPIO4_A2", "GPIO4_A6", "GPIO4_B2" ;
description = "Enable Waveshare 3.5 inch Display on SPI0.";
};

fragment@0 {
target = <&spi0>;

__overlay__ {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&spi0m1_cs0 &spi0m1_pins>;
max-freq = <16000000>;

ili9486@0 {
compatible = "ilitek,ili9486";
reg = <0>;
spi-max-frequency = <16000000>;
txbuflen = <32768>;
rotate = <90>;
bgr = <0>;
fps = <30>;
buswidth = <8>;
regwidth = <16>;
reset-gpios = <&gpio1 RK_PB1 GPIO_ACTIVE_LOW>; // GPIO1_B1
dc-gpios = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>; // GPIO1_D5
debug = <0>;
};

ads7846@1 {
compatible = "ti,ads7846";
status = "okay";
reg = <1>;
id = <1>;
spi-max-frequency = <2000000>;
interrupt-parent = <&gpio4>;
interrupts = <RK_PA6 IRQ_TYPE_EDGE_FALLING>;
pendown-gpio = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>;
ti,x-plate-ohms = /bits/ 16 <60>;
ti,pressure-max = /bits/ 16 <255>;
ti,swap-xy = <0>;
vcc-supply = <&vcc5v0_sys>;
};
};
};
};