Snitro / fbtft-ili9488

Linux5.10 fbtft ili9488
5 stars 1 forks source link

error: initialization of ‘void (*)(struct spi_device *)’ from incompatible pointer type ‘int (*)(struct spi_device *) #1

Open yuanwb1984 opened 4 months ago

yuanwb1984 commented 4 months ago

armbian and orangepi zero plus ; I don't know programming, so I followed some tutorials on the Internet. MakeFile: ifneq ($(KERNELRELEASE),) obj-m += fb_ili9488.o else PWD=$(shell pwd) KDIR=/usr/src/linux-headers-$(shell uname -r) all: $(MAKE) -C $(KDIR) M=$(PWD) modules clean: $(MAKE) -C $(KDIR) M=$(PWD) clean endif

and get error: Opi0plus:fb_ili9488:# make all make -C /usr/src/linux-headers-6.6.21-current-sunxi64 M=/root/fb_ili9488 modules make[1]: Entering directory '/usr/src/linux-headers-6.6.21-current-sunxi64' CC [M] /root/fb_ili9488/fb_ili9488.o /root/fb_ili9488/fb_ili9488.c: In function ‘write_vmem16_bus8’: /root/fb_ili9488/fb_ili9488.c:98:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 98 | if ((int)(par->gpio.dc) != -1) | ^ In file included from /root/fb_ili9488/fb_ili9488.c:13: /root/fb_ili9488/fb_ili9488.c: At top level: /root/fb_ili9488/fbtft.h:315:19: error: initialization of ‘void ()(struct spi_device )’ from incompatible pointer type ‘int ()(struct spi_device )’ [-Werror=incompatible-pointer-types] 315 | .remove = fbtft_driver_remove_spi, \ | ^~~~~~~ /root/fb_ili9488/fb_ili9488.c:148:1: note: in expansion of macro ‘FBTFT_REGISTER_DRIVER’ 148 | FBTFT_REGISTER_DRIVER(DRVNAME, "ilitek,ili9488", &display); | ^~~~~ /root/fb_ili9488/fbtft.h:315:19: note: (near initialization for ‘fbtft_driver_spi_driver.remove’) 315 | .remove = fbtft_driver_remove_spi, \ | ^~~~~~~ /root/fb_ili9488/fb_ili9488.c:148:1: note: in expansion of macro ‘FBTFT_REGISTER_DRIVER’ 148 | FBTFT_REGISTER_DRIVER(DRVNAME, "ilitek,ili9488", &display); | ^~~~~ cc1: some warnings being treated as errors make[3]: [scripts/Makefile.build:243: /root/fb_ili9488/fb_ili9488.o] Error 1 make[2]: [/usr/src/linux-headers-6.6.21-current-sunxi64/Makefile:1915: /root/fb_ili9488] Error 2 make[1]: [Makefile:234: __sub-make] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-6.6.21-current-sunxi64' make: [Makefile:7: all] Error 2

yuanwb1984 commented 4 months ago

use fbtft.h in https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/tree/drivers/staging/fbtft?h=staging-testing get .ko but not work well

yuanwb1984 commented 4 months ago

The colors are wrong, red and blue are inverted, adding bgr=<1> in dts has no effect. The Gamma parameter needs to be adjusted.