2021-09-02 03:06 AM - last edited on 2024-11-06 12:39 AM by Andrew Neil
Can you please check my device tree configuration?
Backlight as a GPIO is working correctly, but when i try to use it as pwm, the pin line is always fixed to low.
Inside my .dts:
This is my panel definition:
panel { compatible = "newkoro,display","simple-panel"; //enable-gpios = <&gpioe 12 GPIO_ACTIVE_HIGH>; //reset-gpios = <&gpioe 11 GPIO_ACTIVE_HIGH>; backlight = <&backlight>; power-supply = <&vdd>; status = "okay"; port@0{ //reg = <0>; panel_in: endpoint { remote-endpoint = <<dc_ep0_out>; }; }; };
This is backlight as simple gpio (working)
//backlight: panel-backlight { // compatible = "gpio-backlight"; // gpios = <&gpioe 4 GPIO_ACTIVE_HIGH>; //default-off; //};
This is backlight as pwm (not working)
backlight: panel-backlight { compatible = "pwm-backlight"; pwms = <&backlight_pwm 0 100000 0>; brightness-levels = <0 31 63 95 127 159 191 223 255>; default-brightness-level = <8>; status = "okay"; //power-supply = <®_5v2>; /* 3V3_BACKLIGHT */ };
and this is timer defs:
&timers15 { status = "okay"; backlight_pwm: pwm { pinctrl-names = "default", "sleep"; pinctrl-0 = <&pwm15_pins_a>; pinctrl-1 = <&pwm15_sleep_pins_a>; status = "okay"; //#pwm-cells = <2>; }; };
inside pinctrl i have:
pwm15_pins_a: pwm15-0 { pins { pinmux = <STM32_PINMUX('E', 4, AF4)>; /* TIM15_CH1N */ bias-disable; drive-push-pull; slew-rate = <0>; }; }; pwm15_sleep_pins_a: pwm15-sleep-0 { pins { pinmux = <STM32_PINMUX('E', 4, ANALOG)>; /* TIM15_CH1N */ }; };
thank you
2024-11-06 12:33 AM
Hi @Lmoio.1 , I am also facing the same problem. When I add panel-backlight property to the panel node, there is no pwm and enable output, but when I comment out this property from the node, I can control enable and pwm. I am using STM32MP135 SoM from PHYTEC, can you check my dts file? BTW, this is the working dts.
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
/*
* Copyright (C) 2023 PHYTEC Messtechnik GmbH
* Authors: Christophe Parant <c.parant@phytec.fr>
*/
/dts-v1/;
#include "stm32mp1-phycore-custom-carrier.dtsi"
/ {
model = "CUSTOM CARRIER";
compatible = "phytec,stm32mp135f-pbacd10", "phytec,stm32mp135f-pcl076-emmc",
"phytec,stm32mp135f-pcl076", "st,stm32mp135";
memory@c0000000 {
reg = <0xc0000000 0x20000000>;
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
optee_framebuffer@dd000000 {
reg = <0xdd000000 0x1000000>;
no-map;
};
optee@de000000 {
reg = <0xde000000 0x2000000>;
no-map;
};
};
panel_rgb: rgb-panel {
compatible = "panel-dpi";
label = "dt304b-lcd";
reset-gpios = <&gpioi 0 GPIO_ACTIVE_HIGH>;
//backlight = <&panel_backlight>;
data-mapping = "bgr666";
status = "okay";
width-mm = <115>;
height-mm = <80>;
port {
panel_in_rgb: endpoint {
remote-endpoint = <<dc_ep0_out>;
};
};
//SATOZ 4.3INCH PANEL TIMINGS
panel-timing {
clock-frequency = <9000000>;
hactive = <480>;
vactive = <272>;
hfront-porch = <8>;
hback-porch = <43>;
hsync-len = <4>;
vback-porch = <12>;
vfront-porch = <8>;
vsync-len = <4>;
};
};
panel_backlight: panel-backlight {
compatible = "pwm-backlight";
status = "okay";
pwms = <&pwm_8 2 50000 0>;
enable-gpios = <&gpiob 1 GPIO_ACTIVE_HIGH>;
power-supply = <&scmi_vdd>;
brightness-levels = <0 4 8 16 32 64 128 255>;
default-brightness-level = <6>;
};
user-leds {
compatible = "gpio-leds";
sys-green-led {
gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
};
sys-red-led {
gpios = <&gpiob 5 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "gpio";
default-state = "on";
};
};
};
<dc {
pinctrl-names = "default", "sleep";
pinctrl-0 = <<dc_pins_mx>;
pinctrl-1 = <<dc_sleep_pins_mx>;
status = "okay";
port {
#address-cells = <1>;
#size-cells = <0>;
ltdc_ep0_out: endpoint@0 {
reg = <0>;
remote-endpoint = <&panel_in_rgb>;
};
};
};
&timers8 {
/delete-property/dmas;
/delete-property/dma-names;
status = "okay";
pwm_8: pwm {
pinctrl-0 = <&tim8_pwm_pins_mx>;
pinctrl-1 = <&tim8_pwm_sleep_pins_mx>;
pinctrl-names = "default", "sleep";
status = "okay";
};
};
&i2c5 {
/delete-node/i2c_rtc;
/delete-node/tlv320;
goodix: goodix_ts@14 {
compatible = "goodix,gt911";
reg = <0x14>;
interrupt-parent = <&gpiof>;
interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
interrupt-controller;
reset-gpios = <&gpiog 12 GPIO_ACTIVE_LOW>;
touchscreen-size-x = <480>;
touchscreen-size-y = <272>;
status = "okay";
};
};