Skip to content

Instantly share code, notes, and snippets.

@dlech
Created March 22, 2026 01:30
Show Gist options
  • Select an option

  • Save dlech/31405add9faf6ecc6593697f926464a6 to your computer and use it in GitHub Desktop.

Select an option

Save dlech/31405add9faf6ecc6593697f926464a6 to your computer and use it in GitHub Desktop.
Devicetree overlay to enable the ILI9225 display on the Raspberry Pi 4
// SPDX-License-Identifier: BSD-3-Clause
/* Copyright (c) 2026 David Lechner <david@lechnology.com> */
/*
* Devicetree overlay to enable the ILI9225 display on the Raspberry Pi 4.
*
* Wiring:
*
* ILI9225 Panel | Raspberry Pi 4
* Pin Name | Pin# | Function
* ----------------+------+--------------------------
* VCC | 1 | 3.3V
* GND | 9 | GND
* GND | x | Not connected
* NC | x | Not connected
* NC | x | Not connected
* LED | 33 | PWM 0, ch 1 (GPIO13)
* CLK | 40 | SPI1 SCLK (GPIO21)
* SPI | 38 | SPI1 MOSI (GPIO20)
* RS | 37 | GPIO26
* RST | 35 | GPIO19
* CS | 36 | GPIO16
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
&{/} {
ili9225_bl: backlight_pwm_1 {
compatible = "pwm-backlight";
pinctrl-names = "default";
pinctrl-0 = <&pwm0_1_gpio13>;
pwms = <&pwm 1 200000 0>;
brightness-levels = <0 6 8 12 16 24 32 40 48 64 96 128 160 192 224 255>;
default-brightness-level = <10>;
};
};
&gpio {
spi1_mosi_sclk_gpio20: spi1-mosi-sclk-gpio20 {
pins-spi {
pins = "gpio20", "gpio21";
function = "alt4";
};
};
};
&spi1 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&spi1_mosi_sclk_gpio20>;
/*
* spi-bcm2835aux supports only one reliable native chip select.
* Expose CS2 on GPIO16 using cs-gpios.
*/
cs-gpios = <0>, <0>, <&gpio 16 GPIO_ACTIVE_LOW>;
status = "okay";
panel@2 {
compatible = "vot,v220hf01a-t", "ilitek,ili9225";
reg = <2>;
spi-max-frequency = <12000000>;
rs-gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
backlight = <&ili9225_bl>;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment