lzto / FBTFT_KeDei_35_lcd_v62

FBTFT Kernel Driver for KeDei 6.2 Display, works with latest kernel
GNU General Public License v2.0
9 stars 4 forks source link

Issues on kernel 6.1.21-v7+ #1

Open starmaid opened 8 months ago

starmaid commented 8 months ago

Hello, I am trying to get my v6.2 screen working and am running into a build issue.

System: Raspberry Pi 3B+

Linux keys 6.1.21-v7+ #1642 SMP Mon Apr  3 17:20:52 BST 2023 armv7l GNU/Linux
gcc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110

Error:

make -C /lib/modules/`uname -r`/build M=$PWD modules
make[1]: Entering directory '/usr/src/linux-headers-6.1.21-v7+'
  CC [M]  /home/keys/FBTFT_KeDei_35_lcd_v62/fbtft-core.o
  CC [M]  /home/keys/FBTFT_KeDei_35_lcd_v62/fbtft-sysfs.o
  CC [M]  /home/keys/FBTFT_KeDei_35_lcd_v62/fbtft-bus.o
  CC [M]  /home/keys/FBTFT_KeDei_35_lcd_v62/fbtft-io.o
  LD [M]  /home/keys/FBTFT_KeDei_35_lcd_v62/fbtft.o
  CC [M]  /home/keys/FBTFT_KeDei_35_lcd_v62/fb_kedei62.o
/home/keys/FBTFT_KeDei_35_lcd_v62/fb_kedei62.c: In function ‘write_vmem’:
/home/keys/FBTFT_KeDei_35_lcd_v62/fb_kedei62.c:92:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   92 |     int i;
      |     ^~~
In file included from /home/keys/FBTFT_KeDei_35_lcd_v62/fb_kedei62.c:13:
/home/keys/FBTFT_KeDei_35_lcd_v62/fb_kedei62.c: At top level:
/home/keys/FBTFT_KeDei_35_lcd_v62/fbtft.h:315:12: 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,                                 \
      |            ^~~~~~~~~~~~~~~~~~~~~~~
/home/keys/FBTFT_KeDei_35_lcd_v62/fb_kedei62.c:205:1: note: in expansion of macro ‘FBTFT_REGISTER_DRIVER’
  205 | FBTFT_REGISTER_DRIVER(DRVNAME, "kedei62", &display);
      | ^~~~~~~~~~~~~~~~~~~~~
/home/keys/FBTFT_KeDei_35_lcd_v62/fbtft.h:315:12: note: (near initialization for ‘fbtft_driver_spi_driver.remove’)
  315 |  .remove = fbtft_driver_remove_spi,                                 \
      |            ^~~~~~~~~~~~~~~~~~~~~~~
/home/keys/FBTFT_KeDei_35_lcd_v62/fb_kedei62.c:205:1: note: in expansion of macro ‘FBTFT_REGISTER_DRIVER’
  205 | FBTFT_REGISTER_DRIVER(DRVNAME, "kedei62", &display);
      | ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:250: /home/keys/FBTFT_KeDei_35_lcd_v62/fb_kedei62.o] Error 1
make[1]: *** [Makefile:2012: /home/keys/FBTFT_KeDei_35_lcd_v62] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.21-v7+'
make: *** [Makefile:54: default] Error 2

I'm seeing if i can get it to ignore that warning, but as of right now the code doesn't compile on the latest software.

starmaid commented 8 months ago

I tried editing line 282 of fbtft.h to be:

static void fbtft_driver_remove_spi(struct spi_device *spi)                 \
{                                                                          \
    struct fb_info *info = spi_get_drvdata(spi);                       \
                                       \
    return;                       \
}                                                                          \

But ran into another error:

/home/keys/FBTFT_KeDei_35_lcd_v62/fbtft_device.c:1093:11: error: implicit declaration of function ‘spi_busnum_to_master’ [-Werror=implicit-function-declaration]
 1093 |  master = spi_busnum_to_master(spi->bus_num);
      |           ^~~~~~~~~~~~~~~~~~~~

And this has a less-solvable root problem : spi_busnum_to_master was removed from kernel version 6.1.21-v7+