Hi, I am doing some overlay for fbtft LCD driver - SSD1322. I did compile an add my patch, now I would like to load the LCD driver with DT overlay. This is what I have done:
Now the problem is, that I haven't found any information on how those GPIOs are defined. I took pieces of code here and there, the gpio declaration comes from user @martinayotte
So my assumption is to control GPIO4_D5 it should be dc-gpios = <&gpio4 29 1 0xae>; Since D=3, then 3*8+5=29. Still don't know what 1 and 0xae means, but obviously is wrong. The dmesg reveals invalid GPIO .
Question
Marko Buršič
Hi, I am doing some overlay for fbtft LCD driver - SSD1322. I did compile an add my patch, now I would like to load the LCD driver with DT overlay. This is what I have done:
/dts-v1/; /plugin/; / { compatible = "rockchip,rk3399"; fragment@0 { target = <&spi1>; __overlay__ { status = "okay"; }; }; fragment@1 { target = <&spi1>; __overlay__ { /* needed to avoid dtc warning */ #address-cells = <1>; #size-cells = <0>; status = "okay"; mytft@0{ compatible = "solomon,ssd1322"; reg = <0>; spi-max-frequency = <1000000>; buswidth = <8>; rotate = <0>; bgr = <0>; fps = <20>; reset-gpios = <0>, <1 21 1 0xae>; dc-gpios = <0>, <1 21 1 0xae>; debug = <0>; status = "okay"; }; }; }; };
Now the problem is, that I haven't found any information on how those GPIOs are defined. I took pieces of code here and there, the gpio declaration comes from user @martinayotte
cs-gpio = <0>, <1 21 1 0xae>; // csgpio = <&gpio1 21 1 0xae>; // csgpio = <&pinctrl/gpio1@ff730000 21 1 0xae>;
He uses several ways to declare them, but what really means <0>, <1 21 1 0xae> ? How can I compute this kind of coding for arbitrary RK3399 Gpio?
0001-Signed-off-by-root-marko.bursic73-gmail.com.patch
EDIT:
I have found this
https://forum.radxa.com/t/how-to-control-the-gpio/148/32
So my assumption is to control GPIO4_D5 it should be dc-gpios = <&gpio4 29 1 0xae>; Since D=3, then 3*8+5=29. Still don't know what 1 and 0xae means, but obviously is wrong. The dmesg reveals invalid GPIO .
Call trace:
[ 81.742210] gpio_to_desc+0xa8/0xf0
[ 81.742222] write_vmem+0x38/0x190
[ 81.742232] fbtft_update_display+0xd0/0x218
[ 81.742241] fbtft_deferred_io+0xc0/0xd8
[ 81.742250] fb_deferred_io_work+0xdc/0x158
[ 81.742261] process_one_work+0x1e0/0x338
[ 81.742270] worker_thread+0x40/0x440
[ 81.742282] kthread+0x120/0x128
[ 81.742294] ret_from_fork+0x10/0x18
[ 81.742301] ---[ end trace 8a7abacfafe1f15a ]---
[ 81.945879] ------------[ cut here ]------------
[ 81.945890] invalid GPIO -257459296
[ 81.945950] WARNING: CPU: 4 PID: 507 at drivers/gpio/gpiolib.c:126 gpio_to_desc+0xa8/0xf0
Link to comment
Share on other sites
1 answer to this question
Recommended Posts