// SPDX-License-Identifier: (GPL-2.0+ OR MIT) /* * Copyright (C) 2017 Icenowy Zheng * * Based on sun8i-h3-bananapi-m2-plus.dts, which is: * Copyright (C) 2016 Chen-Yu Tsai */ /dts-v1/; #include "sun8i-h2-plus-bananapi-m2-zero.dts" / { model = "Banana Pi BPI-M2-Zero"; compatible = "sinovoip,bpi-m2-zero", "allwinner,sun8i-h2-plus"; gpio_keys { compatible = "gpio-keys"; pinctrl-names = "default"; pinctrl-0 = <&gpio_button_0>; //address-cells = <1>; //size-cells = <0>; //autorepeat; sw4 { label = "power"; linux,code = ; gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; }; btn1 { label = "B1"; linux,code = ; gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; }; btn2 { label = "B2"; linux,code = ; gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; }; btn3 { label = "B3"; linux,code = ; gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; }; }; }; &pio { __overlay__ { fbtft_rst: fbtft_rst { pins = "PA15"; function = "gpio_out"; }; fbtft_dc: fbtft_dc { pins = "PC4"; function = "gpio_out"; }; fbtft_led: fbtft_led { pins = "PA16"; function = "gpio_out"; }; ads7846_pins: ads7846_pins { pins= "PA2"; function = "irq"; }; spi0_cs0: spi0_cs0 { pins = "PC3"; function = "gpio_out"; output-high; }; spi0_cs1: spi0_cs1 { pins = "PC7"; function = "gpio_out"; output-high; }; gpio_button_0: gpio_button_0 { pins= "PA0", "PA1", "PA3"; function = "irq"; bias-pull-up; }; }; }; &spi0 { status = "okay"; num-cs = <2>; pins = "PC0", "PC1", "PC2", "PC3", "PC7"; pinctrl-names = "default", "default"; //pinctrl-0 = <&spi0_cs0>; pinctrl-1 = <&spi0_cs1>; cs-gpios = <0>, <&pio 2 7 0>; /* + PC7 */ /* modprobe fbtft_device custom name=rpi-display gpios=reset:15,led:16,dc:68 cs=0 speed=32000000 rotate=180 busnum=0 */ /* modprobe ads7846 model=7846 cs=1 gpio_pendown=25 speed=2000000 keep_vref_on=1 x_plate_ohms=60 pressure_max=255 x_min=200 x_max=3900 y_min=200 y_max=3900 */ /* modprobe ads7846 gpio_pendown=25 speed=2000000 keep_vref_on=1 x_plate_ohms=60 pressure_max=255 x_min=200 x_max=3900 y_min=200 y_max=3900 */ display: rpi-display@0 { compatible = "fb_ili9341"; reg = <0>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&fbtft_rst &fbtft_dc &fbtft_led>; spi-max-frequency = <32000000>; rotate = <180>; bgr = <0>; fps = <50>; buswidth = <8>; backlight = <0>; readwrite = <1>; reset-gpios = <&pio 0 15 0>; /* PA15, pio out */ dc-gpios = <&pio 2 4 0>; /* PC4, pio out */ led-gpios = <&pio 0 16 0>; /* PA16, pio out */ debug = <0>; }; touchscreen: ads7846@1 { compatible = "ti,ads7846"; reg = <1>; /* Chip Select 1 */ status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&ads7846_pins>; spi-max-frequency = <2000000>; interrupt-parent = <&pio>; interrupts = <0 2 2>; /* PA2 IRQ_TYPE_EDGE_FALLING */ pendown-gpio = <&pio 0 2 0>; /* PA2 */ /* driver defaults, optional */ ti,x-min = /bits/ 16 <200>; ti,x-max = /bits/ 16 <3900>; ti,y-min = /bits/ 16 <200>; ti,y-max = /bits/ 16 <3900>; ti,swap-xy = <0>; ti,pressure-min = /bits/ 16 <0>; ti,pressure-max = /bits/ 16 <255>; ti,x-plate-ohms = /bits/ 16 <60>; ti,debounce_max = /bits/ 16 <15000>; ti,debounce_tol = /bits/ 16 <65535>; ti,debounce_rep = /bits/ 16 <100>; ti,vref-delay-usecs = /bits/ 16 <450>; ti,keep_vref_on = <1>; ti,settle_delay_usecs = /bits/ 16 <100>; ti,penirq-recheck-delay-usecs = /bits/ 16 <100>; }; }; &i2c0 { pinctrl-names = "default"; pinctrl-0 = <&i2c0_pins>; status = "okay"; }; /* * EOF */