anpaza / linux_vfd

7-segment LED display driver for Linux based on PT6964, SM1628, TM1623, FD268 ICs
4 stars 8 forks source link

Build errors with Linux 5.12 #4

Open danboid opened 3 years ago

danboid commented 3 years ago

Hi @anpaza

Thanks for writing linux_vfd!

I have been trying without success to build linux_vfd for Linux 5.12 under Manjaro ARM. Should this driver work with recent mainline Linux kernels or does it only work with a specific Amlogic kernel?

If its possible to use it with a recent mainline kernel, do I need to do anything else other than copy the vfd dir into the kernel drivers dir such as edit the main drivers Makefile or adjust the kernel config to enabled VFD?

I have tried openvfd. That built but it didn't seem to recognise the VFD device in my X96 Air Q1000, but maybe thats due to an error in my dts? I'm hoping copy/pasting the vfd info from my Android dts into my Manjaro one would do the trick but it may need modifying?

https://github.com/danboid/linux-aml-vfd

https://github.com/danboid/meson-sm1-sei610-qca9377-bt

danboid commented 3 years ago

I think I've worked out how to get these drivers integrated into the kernel but it doesn't build under Linux 5.12

drivers/vfd/vfd.c: In function ‘vfd_probe’:
drivers/vfd/vfd.c:542:2: error: implicit declaration of function ‘setup_timer’; did you mean ‘del_timer’? [-Werror=implicit-function-declaration]
  542 |  setup_timer(&vfd->timer, vfd_timer_sr, (unsigned long)vfd);
      |  ^~~~~~~~~~~
      |  del_timer
  LD [M]  drivers/bluetooth/hci_uart.o
  LD [M]  drivers/bluetooth/btmrvl.o
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:271: drivers/vfd/vfd.o] Error 1
make[1]: *** [scripts/Makefile.build:514: drivers/vfd] Error 2
danboid commented 3 years ago

A quick search has revealed the setup_timer function is now known as timer_setup. I can try replacing that but I'll be lucky if its the only thing that has changed.

My X96 Air Q1000 uses the TM1623 which isn't supported by openvfd but should be supported by this driver, if I can build it.

danboid commented 3 years ago

I've got a bit further:

CC [M]  drivers/vfd/vfd.o                                              
  CC [M]  drivers/vfd/vfd-glyphs.o                                       
In file included from ./include/linux/workqueue.h:9,                     
                 from ./include/linux/rhashtable-types.h:15,
                 from ./include/linux/ipc.h:7,                                                                                                    
                 from ./include/uapi/linux/sem.h:5,                      
                 from ./include/linux/sem.h:5,                           
                 from ./include/linux/sched.h:15,                        
                 from ./arch/arm64/include/asm/compat.h:16,                                                                                       
                 from ./arch/arm64/include/asm/stat.h:13,  
                 from ./include/linux/stat.h:6,                                                                                                   
                 from ./include/linux/module.h:13,                                                                                                
                 from drivers/vfd/vfd.c:25:
drivers/vfd/vfd.c: In function ‘vfd_probe’:
./include/linux/timer.h:126:27: error: passing argument 2 of ‘init_timer_key’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  126 |  init_timer_key((_timer), (_fn), (_flags), NULL, NULL)
      |                           ^~~~~
      |                           |
      |                           void (*)(long unsigned int)
./include/linux/timer.h:142:2: note: in expansion of macro ‘__init_timer’
  142 |  __init_timer((timer), (callback), (flags))
      |  ^~~~~~~~~~~~
drivers/vfd/vfd.c:542:2: note: in expansion of macro ‘timer_setup’
  542 |  timer_setup(&vfd->timer, vfd_timer_sr, (unsigned long)vfd);
      |  ^~~~~~~~~~~
./include/linux/timer.h:92:14: note: expected ‘void (*)(struct timer_list *)’ but argument is of type ‘void (*)(long unsigned int)’
   92 |       void (*func)(struct timer_list *), unsigned int flags,
      |       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  CC [M]  drivers/bcma/driver_gmac_cmn.o
  CC [M]  drivers/vfd/pt6964.o
  CC [M]  drivers/bcma/driver_gpio.o 
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:271: drivers/vfd/vfd.o] Error 1
make[2]: *** Waiting for unfinished jobs....
  AR      drivers/built-in.a
  CC [M]  drivers/bcma/host_pci.o
In file included from drivers/vfd/pt6964.c:9:
drivers/vfd/pt6964.h:78:2: error: #error "No display connection scheme defined!"
   78 | #error "No display connection scheme defined!"
      |  ^~~~~
drivers/vfd/pt6964.c: In function ‘hardware_init’:
drivers/vfd/pt6964.c:244:21: error: ‘PLATFORM_DISPLAY_LEN’ undeclared (first use in this function)
  244 |  vfd->display_len = PLATFORM_DISPLAY_LEN;
      |                     ^~~~~~~~~~~~~~~~~~~~
drivers/vfd/pt6964.c:244:21: note: each undeclared identifier is reported only once for each function it appears in
drivers/vfd/pt6964.c:245:24: error: ‘PLATFORM_BRIGHTNESS’ undeclared (first use in this function)
  245 |  vfd->brightness = 1 + PLATFORM_BRIGHTNESS;
      |                        ^~~~~~~~~~~~~~~~~~~
In file included from drivers/vfd/pt6964.c:9:
drivers/vfd/pt6964.c:265:35: error: ‘PLATFORM_DISPLAY_MODE’ undeclared (first use in this function)
  265 |  pt6964_cmd(vfd, CMD_DISPLAY_MODE(PLATFORM_DISPLAY_MODE));
      |                                   ^~~~~~~~~~~~~~~~~~~~~
drivers/vfd/pt6964.h:33:42: note: in definition of macro ‘CMD_DISPLAY_MODE’
   33 | #define CMD_DISPLAY_MODE(mode)  (0x00 | (mode))
      |                                          ^~~~
make[2]: *** [scripts/Makefile.build:271: drivers/vfd/pt6964.o] Error 1
make[1]: *** [scripts/Makefile.build:514: drivers/vfd] Error 2
make[1]: *** Waiting for unfinished jobs....
  CC [M]  drivers/vhost/scsi.o
  CC [M]  drivers/bcma/host_soc.o
  CC [M]  drivers/vhost/vsock.o
  CC [M]  drivers/vhost/vhost.o
  CC [M]  drivers/vhost/iotlb.o
  LD [M]  drivers/bcma/bcma.o
  LD [M]  drivers/vhost/vhost_net.o
  LD [M]  drivers/vhost/vhost_iotlb.o
  LD [M]  drivers/vhost/vhost_vsock.o
  LD [M]  drivers/vhost/vhost_scsi.o 
make: *** [Makefile:1851: drivers] Error 2
==> ERROR: A failure occurred in build().