<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Philippe Schenker <<a href="mailto:philippe.schenker@toradex.com">philippe.schenker@toradex.com</a>> 于 2020年4月30日周四 20:08写道:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, 2020-04-30 at 17:43 +0800, <a href="mailto:dillon.minfei@gmail.com" target="_blank" rel="noreferrer">dillon.minfei@gmail.com</a> wrote:<br>
> From: dillon min <<a href="mailto:dillon.minfei@gmail.com" target="_blank" rel="noreferrer">dillon.minfei@gmail.com</a>><br>
> <br>
> Signed-off-by: dillon min <<a href="mailto:dillon.minfei@gmail.com" target="_blank" rel="noreferrer">dillon.minfei@gmail.com</a>><br>
> ---<br>
> .../bindings/display/panel/ilitek,ili9341.txt | 42 +++++++++++<br>
> arch/arm/boot/dts/stm32f4-pinctrl.dtsi | 79<br>
> +++++++++++++++++++<br>
> arch/arm/boot/dts/stm32f429-disco.dts | 88<br>
> ++++++++++++++++++++++<br>
> arch/arm/boot/dts/stm32f429.dtsi | 12 +++<br>
> 4 files changed, 221 insertions(+)<br>
> create mode 100644<br>
> Documentation/devicetree/bindings/display/panel/ilitek,ili9341.txt<br>
> <br>
> diff --git<br>
> a/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.txt<br>
> b/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.txt<br>
> new file mode 100644<br>
> index 0000000..f5a4e55<br>
> --- /dev/null<br>
> +++<br>
> b/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.txt<br>
> @@ -0,0 +1,42 @@<br>
> +Ilitek ILI9341 TFT panel driver with SPI control bus<br>
> +<br>
> +This is a driver for 240x320 TFT panels, accepting a rgb input<br>
> +streams that get adapted and scaled to the panel.<br>
> +<br>
> +Required properties:<br>
> + - compatible: "stm32f429-disco,ltdc-panel", "ilitek,ili9341"<br>
> + (full system-specific compatible is always required to look up<br>
> configuration)<br>
> + - reg: address of the panel on the SPI bus<br>
> +<br>
> +Optional properties:<br>
> + - reset-gpios: a GPIO spec for the reset pin, see gpio/gpio.txt<br>
> + - dc-gpios: a GPIO spec for the dc pin, see gpio/gpio.txt<br>
> +<br>
> + The following optional properties only apply to RGB input mode:<br>
> +<br>
> + - pixelclk-active: see display/panel/display-timing.txt<br>
> + - de-active: see display/panel/display-timing.txt<br>
> + - hsync-active: see display/panel/display-timing.txt<br>
> + - vsync-active: see display/panel/display-timing.txt<br>
> +<br>
> +The panel must obey the rules for a SPI slave device as specified in<br>
> +spi/spi-bus.txt<br>
> +<br>
> +The device node can contain one 'port' child node with one child<br>
> +'endpoint' node, according to the bindings defined in<br>
> +media/video-interfaces.txt. This node should describe panel's video<br>
> bus.<br>
> +<br>
> +Example:<br>
> +<br>
> +panel: display@0 {<br>
> + compatible = "stm32f429-disco,ltdc-panel", "ilitek,ili9341";<br>
> + reg = <0>;<br>
> + spi-3wire;<br>
> + spi-max-frequency = <10000000>;<br>
> + dc-gpios = <&gpiod 13 0>;<br>
> + port {<br>
> + panel_in: endpoint {<br>
> + remote-endpoint = <&display_out>;<br>
> + };<br>
> + };<br>
> +};<br>
> diff --git a/arch/arm/boot/dts/stm32f4-pinctrl.dtsi<br>
> b/arch/arm/boot/dts/stm32f4-pinctrl.dtsi<br>
> index 392fa14..45b68f4 100644<br>
> --- a/arch/arm/boot/dts/stm32f4-pinctrl.dtsi<br>
> +++ b/arch/arm/boot/dts/stm32f4-pinctrl.dtsi<br>
> @@ -316,6 +316,85 @@<br>
> };<br>
> };<br>
> <br>
> + ltdc_pins_f429_disco: ltdc-1 {<br>
> + pins {<br>
> + pinmux = <STM32_PINMUX('C',<br>
> 6, AF14)>,<br>
> + /* LCD_HSYNC */<br>
> + <STM32_PINMUX('A',<br>
> 4, AF14)>,<br>
> + /* LCD_VSYNC */<br>
> + <STM32_PINMUX('G',<br>
> 7, AF14)>,<br>
> + /* LCD_CLK */<br>
> + <STM32_PINMUX('C', 10,<br>
> AF14)>,<br>
> + /* LCD_R2 */<br>
> + <STM32_PINMUX('B',<br>
> 0, AF9)>,<br>
> + /* LCD_R3 */<br>
> + <STM32_PINMUX('A', 11,<br>
> AF14)>,<br>
> + /* LCD_R4 */<br>
> + <STM32_PINMUX('A', 12,<br>
> AF14)>,<br>
> + /* LCD_R5 */<br>
> + <STM32_PINMUX('B',<br>
> 1, AF9)>,<br>
> + /* LCD_R6*/<br>
> + <STM32_PINMUX('G',<br>
> 6, AF14)>,<br>
> + /* LCD_R7 */<br>
> + <STM32_PINMUX('A',<br>
> 6, AF14)>,<br>
> + /* LCD_G2 */<br>
> + <STM32_PINMUX('G', 10,<br>
> AF9)>,<br>
> + /* LCD_G3 */<br>
> + <STM32_PINMUX('B', 10,<br>
> AF14)>,<br>
> + /* LCD_G4 */<br>
> + <STM32_PINMUX('D',<br>
> 6, AF14)>,<br>
> + /* LCD_B2 */<br>
> + <STM32_PINMUX('G', 11,<br>
> AF14)>,<br>
> + /* LCD_B3*/<br>
> + <STM32_PINMUX('B', 11,<br>
> AF14)>,<br>
> + /* LCD_G5 */<br>
> + <STM32_PINMUX('C',<br>
> 7, AF14)>,<br>
> + /* LCD_G6 */<br>
> + <STM32_PINMUX('D',<br>
> 3, AF14)>,<br>
> + /* LCD_G7 */<br>
> + <STM32_PINMUX('G', 12,<br>
> AF9)>,<br>
> + /* LCD_B4 */<br>
> + <STM32_PINMUX('A',<br>
> 3, AF14)>,<br>
> + /* LCD_B5 */<br>
> + <STM32_PINMUX('B',<br>
> 8, AF14)>,<br>
> + /* LCD_B6 */<br>
> + <STM32_PINMUX('B',<br>
> 9, AF14)>,<br>
> + /* LCD_B7 */<br>
> + <STM32_PINMUX('F', 10,<br>
> AF14)>;<br>
> + /* LCD_DE */<br>
> + slew-rate = <2>;<br>
> + };<br>
> + };<br>
> +<br>
> + i2c3_pins: i2c3-0 {<br>
> + pins {<br>
> + pinmux = <STM32_PINMUX('C', 9,<br>
> AF4)>,<br>
> + /* I2C3_SDA */<br>
> + <STM32_PINMUX('A', 8,<br>
> AF4)>;<br>
> + /* I2C3_SCL */<br>
> + bias-disable;<br>
> + drive-open-drain;<br>
> + slew-rate = <3>;<br>
> + };<br>
> + };<br>
> +<br>
> + spi5_pins: spi5-0 {<br>
> + pins1 {<br>
> + pinmux = <STM32_PINMUX('F', 7,<br>
> AF5)>,<br>
> + /* SPI5_CLK */<br>
> + <STM32_PINMUX('F', 9,<br>
> AF5)>;<br>
> + /* SPI5_MOSI */<br>
> + bias-disable;<br>
> + drive-push-pull;<br>
> + slew-rate = <0>;<br>
> + };<br>
> + pins2 {<br>
> + pinmux = <STM32_PINMUX('F', 8,<br>
> AF5)>;<br>
> + /* SPI5_MISO */<br>
> + bias-disable;<br>
> + };<br>
> + };<br>
> +<br>
> dcmi_pins: dcmi-0 {<br>
> pins {<br>
> pinmux = <STM32_PINMUX('A', 4,<br>
> AF13)>, /* DCMI_HSYNC */<br>
> diff --git a/arch/arm/boot/dts/stm32f429-disco.dts<br>
> b/arch/arm/boot/dts/stm32f429-disco.dts<br>
> index 30c0f67..55eed05 100644<br>
> --- a/arch/arm/boot/dts/stm32f429-disco.dts<br>
> +++ b/arch/arm/boot/dts/stm32f429-disco.dts<br>
> @@ -49,6 +49,8 @@<br>
> #include "stm32f429.dtsi"<br>
> #include "stm32f429-pinctrl.dtsi"<br>
> #include <dt-bindings/input/input.h><br>
> +#include <dt-bindings/interrupt-controller/irq.h><br>
> +#include <dt-bindings/gpio/gpio.h><br>
> <br>
> / {<br>
> model = "STMicroelectronics STM32F429i-DISCO board";<br>
> @@ -98,6 +100,14 @@<br>
> regulator-name = "vcc5_host1";<br>
> regulator-always-on;<br>
> };<br>
> +<br>
> + reg_3p3v: regulator-3p3v {<br>
> + compatible = "regulator-fixed";<br>
> + regulator-name = "3P3V";<br>
> + regulator-min-microvolt = <3300000>;<br>
> + regulator-max-microvolt = <3300000>;<br>
> + regulator-always-on;<br>
> + };<br>
> };<br>
> <br>
> &clk_hse {<br>
> @@ -127,3 +137,81 @@<br>
> pinctrl-names = "default";<br>
> status = "okay";<br>
> };<br>
> +<br>
> +<dc {<br>
> + status = "okay";<br>
> + pinctrl-0 = <<dc_pins_f429_disco>;<br>
> + pinctrl-names = "default";<br>
> +<br>
> + port {<br>
> + ltdc_out_rgb: endpoint {<br>
> + remote-endpoint = <&panel_in_rgb>;<br>
> + };<br>
> + };<br>
> +};<br>
> +<br>
> +&spi5 {<br>
> + status = "okay";<br>
> + pinctrl-0 = <&spi5_pins>;<br>
> + pinctrl-names = "default";<br>
> + #address-cells = <1>;<br>
> + #size-cells = <0>;<br>
> + cs-gpios = <&gpioc 1 GPIO_ACTIVE_LOW>,<&gpioc 2<br>
> GPIO_ACTIVE_LOW>;<br>
> + dmas = <&dma2 3 2 0x400 0x0>,<br>
> + <&dma2 4 2 0x400 0x0>;<br>
> + dma-names = "rx", "tx";<br>
> + l3gd20: l3gd20@0 {<br>
> + compatible = "st,l3gd20-gyro";<br>
> + spi-max-frequency = <10000000>;<br>
> + st,drdy-int-pin = <2>;<br>
> + interrupt-parent = <&gpioa>;<br>
> + interrupts = <1 IRQ_TYPE_EDGE_RISING>,<br>
> + <2 IRQ_TYPE_EDGE_RISING>;<br>
> + reg = <0>;<br>
> + vddio = <®_3p3v>;<br>
> + vdd = <®_3p3v>;<br>
> + status = "okay";<br>
> + };<br>
> + display: display@1{<br>
> + /* Connect panel-ilitek-9341 to ltdc */<br>
> + compatible = "stm32f429-disco,ltdc-panel",<br>
> "ilitek,ili9341";<br>
> + reg = <1>;<br>
> + spi-3wire;<br>
> + spi-max-frequency = <10000000>;<br>
> + dc-gpios = <&gpiod 13 0>;<br>
> + port {<br>
> + panel_in_rgb: endpoint {<br>
> + remote-endpoint = <<dc_out_rgb>;<br>
> + };<br>
> + };<br>
> + };<br>
> +};<br>
> +<br>
> +&i2c3 {<br>
> + pinctrl-names = "default";<br>
> + pinctrl-0 = <&i2c3_pins>;<br>
> + status = "okay";<br>
> +<br>
> + touch: stmpe811@41 {<br>
> + compatible = "st,stmpe811";<br>
> + reg = <0x41>;<br>
> + interrupts = <15 IRQ_TYPE_EDGE_FALLING>;<br>
> + interrupt-parent = <&gpioa>;<br>
> + vio = <®_3p3v>;<br>
> + vcc = <®_3p3v>;<br>
> + status = "okay";<br>
> +<br>
> + stmpe_touchscreen {<br>
> + compatible = "st,stmpe-ts";<br>
> + st,sample-time = <4>;<br>
> + st,mod-12b = <1>;<br>
> + st,ref-sel = <0>;<br>
> + st,adc-freq = <1>;<br>
<br>
The above ADC related settings should go into the MFD device with<br>
compatible "st,stmpe811". The use of those in touchscreen is deprecated.<br>
<br>
Please check the bindings:<br>
Documentation/devicetree/bindings/input/touchs<br>
creen/stmpe.txt<br>
Documentation/devicetree/bindings/mfd/stmpe.txt<br><br>
Best Regards,<br>
Philippe<br>
<br>Philippe,thanks. i will try it later, and move touch panel & gyro patchs out of this sets, after well tested, i'll resubmit it.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> + st,ave-ctrl = <1>;<br>
> + st,touch-det-delay = <2>;<br>
> + st,settling = <2>;<br>
> + st,fraction-z = <7>;<br>
> + st,i-drive = <1>;<br>
> + };<br>
> + };<br>
> +};<br>
> diff --git a/arch/arm/boot/dts/stm32f429.dtsi<br>
> b/arch/arm/boot/dts/stm32f429.dtsi<br>
> index d777069..257b843 100644<br>
> --- a/arch/arm/boot/dts/stm32f429.dtsi<br>
> +++ b/arch/arm/boot/dts/stm32f429.dtsi<br>
> @@ -402,6 +402,18 @@<br>
> status = "disabled";<br>
> };<br>
> <br>
> + i2c3: i2c@40005c00 {<br>
> + compatible = "st,stm32f4-i2c";<br>
> + reg = <0x40005c00 0x400>;<br>
> + interrupts = <72>,<br>
> + <73>;<br>
> + resets = <&rcc STM32F4_APB1_RESET(I2C3)>;<br>
> + clocks = <&rcc 0 STM32F4_APB1_CLOCK(I2C3)>;<br>
> + #address-cells = <1>;<br>
> + #size-cells = <0>;<br>
> + status = "disabled";<br>
> + };<br>
> +<br>
> dac: dac@40007400 {<br>
> compatible = "st,stm32f4-dac-core";<br>
> reg = <0x40007400 0x400>;<br>
</blockquote></div></div></div>