Giter Club home page Giter Club logo

linux_openvfd's People

Contributors

arthur-liberman avatar kszaq avatar portisch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linux_openvfd's Issues

OpenVFD: Failed to verify VFD config file, attempt using device tree

I have already viewed issue #3 and unfortunately did not find a solution there. Keep in mind I added some variables to the DTB as an attempt to go around using the config file, but to no avail. Here is my dmesg after modprobe openvfd:

[   35.008376] openvfd: loading out-of-tree module taints kernel.
[   35.013056] OpenVFD: Version: V1.4.0
[   35.013075] OpenVFD: vfd_gpio_clk:           Empty.
[   35.013081] OpenVFD: vfd_gpio_dat:           Empty.
[   35.013087] OpenVFD: vfd_gpio_stb:           Empty.
[   35.013101] OpenVFD: vfd_gpio0:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[   35.013113] OpenVFD: vfd_gpio1:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[   35.013124] OpenVFD: vfd_gpio2:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[   35.013135] OpenVFD: vfd_gpio3:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[   35.013145] OpenVFD: vfd_gpio_protocol:      #0 = 0x00; #1 = 0x00;
[   35.013151] OpenVFD: vfd_chars:              Empty.
[   35.013157] OpenVFD: vfd_dot_bits:           Empty.
[   35.013163] OpenVFD: vfd_display_type:       Empty.
[   35.013175] OpenVFD: Detected gpio chips:    periphs-banks, aobus-banks.
[   35.013181] OpenVFD: Failed to verify VFD configuration file, attempt using device tree as fallback.
[   35.027411] OF: /openvfd: could not find phandle
[   35.027434] OpenVFD: openvfd_gpio_clk: pin = -22, flags = 0x00
[   35.027694] OF: /openvfd: could not find phandle
[   35.027718] OpenVFD: openvfd_gpio_dat: pin = -22, flags = 0x00
[   35.027831] OF: /openvfd: could not find phandle
[   35.027858] OpenVFD: openvfd_gpio_stb: pin = -22, flags = 0x00
[   35.027867] OpenVFD: openvfd_gpio0 pin entry not found
[   35.027874] OpenVFD: openvfd_gpio1 pin entry not found
[   35.027880] OpenVFD: openvfd_gpio2 pin entry not found
[   35.027896] OpenVFD: openvfd_gpio3 pin entry not found
[   35.027916] OpenVFD: chars_prop = 000000003a704ee5
[   35.027932] OpenVFD: chars_prop->length = 10
[   35.027948] OpenVFD: char #0: 50
[   35.027960] OpenVFD: char #1: 44
[   35.027965] OpenVFD: char #2: 49
[   35.027970] OpenVFD: char #3: 44
[   35.027975] OpenVFD: char #4: 50
[   35.027980] OpenVFD: char #5: 44
[   35.027985] OpenVFD: char #6: 51
[   35.027993] OpenVFD: dot_bits_prop = 000000003c43f2ae
[   35.027998] OpenVFD: dot_bits_prop->length = 14
[   35.028004] OpenVFD: dot_bit #0: 48
[   35.028009] OpenVFD: dot_bit #1: 44
[   35.028014] OpenVFD: dot_bit #2: 49
[   35.028019] OpenVFD: dot_bit #3: 44
[   35.028024] OpenVFD: dot_bit #4: 51
[   35.028029] OpenVFD: dot_bit #5: 44
[   35.028034] OpenVFD: dot_bit #6: 50
[   35.028039] OpenVFD: dot_bit #7: 44
[   35.028044] OpenVFD: dot_bit #8: 52
[   35.028050] OpenVFD: dot_bit #9: 44
[   35.028055] OpenVFD: dot_bit #10: 53
[   35.028060] OpenVFD: dot_bit #11: 44
[   35.028065] OpenVFD: dot_bit #12: 54
[   35.028070] OpenVFD: dot_bit #13: 0
[   35.028082] OpenVFD: display.type = 51, display.controller = 48, pdata->dev->dtb_active.display.flags = 0x78
[   35.028088] OpenVFD: can't request gpio of gpio_clk
[   35.028139] openvfd: probe of openvfd failed with error -22

DTB looks like this:

openvfd {
                compatible = "open,vfd";
                dev_name = "openvfd";
                status = "okay";
                openvfd_gpio_clk = "0,76,0";
                openvfd_gpio_dat = "0,75,0";
                openvfd_gpio_stb = "0,0,0xFF";
                openvfd_chars = "2,1,2,3,4";
                openvfd_dot_bits = "0,1,3,2,4,5,6";
                openvfd_display_type = "0x03,0x00,0x00,0x03";
        };

When starting openvfd the first time:

root@arm-64:~# systemctl status openvfd
● openvfd.service - openvfd
     Loaded: loaded (/etc/systemd/system/openvfd.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2021-12-26 02:16:44 IST; 3s ago
    Process: 1770 ExecStartPre=/bin/sh -c ./root/.config/vfd.conf; /sbin/modprobe openvfd vfd_gpio_clk=$vfd_gpio_clk vfd_gpio_dat=$vfd_gpio_dat vfd_gpio_stb=$vfd_gpio_stb vfd_chars=$vfd_chars vfd_dot_bits=$vfd_dot_bits v>
    Process: 1773 ExecStart=/root/linux_openvfd/OpenVFDService $OPTS & (code=exited, status=1/FAILURE)
    Process: 1774 ExecStopPost=/sbin/rmmod openvfd (code=exited, status=0/SUCCESS)
   Main PID: 1773 (code=exited, status=1/FAILURE)
        CPU: 48ms

Dec 26 02:16:44 arm-64 systemd[1]: Starting openvfd...
Dec 26 02:16:44 arm-64 sh[1771]: /bin/sh: 1: ./root/.config/vfd.conf: Permission denied
Dec 26 02:16:44 arm-64 systemd[1]: Started openvfd.
Dec 26 02:16:44 arm-64 OpenVFDService[1773]: Open device failed.
Dec 26 02:16:44 arm-64 OpenVFDService[1773]: : No such file or directory
Dec 26 02:16:44 arm-64 systemd[1]: openvfd.service: Main process exited, code=exited, status=1/FAILURE
Dec 26 02:16:44 arm-64 systemd[1]: openvfd.service: Failed with result 'exit-code'.
lines 1-16/16 (END)

If I start openvfd again right after, it somehow manages to run. If I try running the demo, it freezes here:

root@arm-64:~/linux_openvfd# ./OpenVFDService -t -dt 1
Display type 0x00000001
Initializing...
Process ID = 1862

dmesg:

[  234.656983] openvfd: `' invalid for parameter `vfd_gpio_clk'
[  234.657004] openvfd: `' invalid for parameter `vfd_gpio_dat'
[  234.657015] openvfd: `' invalid for parameter `vfd_gpio_stb'
[  234.657023] openvfd: `' invalid for parameter `vfd_chars'
[  234.657031] openvfd: `' invalid for parameter `vfd_dot_bits'
[  234.657039] openvfd: `' invalid for parameter `vfd_display_type'
[  261.862175] openvfd: `' invalid for parameter `vfd_gpio_clk'
[  261.862195] openvfd: `' invalid for parameter `vfd_gpio_dat'
[  261.862205] openvfd: `' invalid for parameter `vfd_gpio_stb'
[  261.862213] openvfd: `' invalid for parameter `vfd_chars'
[  261.862221] openvfd: `' invalid for parameter `vfd_dot_bits'
[  261.862229] openvfd: `' invalid for parameter `vfd_display_type'
[  314.384819] openvfd: `' invalid for parameter `vfd_gpio_clk'
[  314.384840] openvfd: `' invalid for parameter `vfd_gpio_dat'
[  314.384851] openvfd: `' invalid for parameter `vfd_gpio_stb'
[  314.384859] openvfd: `' invalid for parameter `vfd_chars'
[  314.384867] openvfd: `' invalid for parameter `vfd_dot_bits'
[  314.384875] openvfd: `' invalid for parameter `vfd_display_type'
[  323.782887] OpenVFD: Version: V1.4.0
[  323.782911] OpenVFD: vfd_gpio_clk:           #0 = 0x00; #1 = 0x4C; #2 = 0x00;
[  323.782923] OpenVFD: vfd_gpio_dat:           #0 = 0x00; #1 = 0x4B; #2 = 0x00;
[  323.782934] OpenVFD: vfd_gpio_stb:           #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  323.782946] OpenVFD: vfd_gpio0:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  323.782958] OpenVFD: vfd_gpio1:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  323.782969] OpenVFD: vfd_gpio2:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  323.782980] OpenVFD: vfd_gpio3:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  323.782990] OpenVFD: vfd_gpio_protocol:      #0 = 0x00; #1 = 0x00;
[  323.783005] OpenVFD: vfd_chars:              #0 = 0x02; #1 = 0x01; #2 = 0x02; #3 = 0x03; #4 = 0x04;
[  323.783025] OpenVFD: vfd_dot_bits:           #0 = 0x00; #1 = 0x01; #2 = 0x02; #3 = 0x03; #4 = 0x04; #5 = 0x05; #6 = 0x06;
[  323.783038] OpenVFD: vfd_display_type:       #0 = 0x03; #1 = 0x00; #2 = 0x00; #3 = 0x03;
[  323.783050] OpenVFD: Detected gpio chips:    periphs-banks, aobus-banks.
[  323.783063] OpenVFD: "periphs-banks" chip found.     base = 401, pin count = 100, pin = 76, offset = 477
[  323.783072] OpenVFD: "periphs-banks" chip found.     base = 401, pin count = 100, pin = 75, offset = 476
[  323.783078] OpenVFD: Skipping vfd_gpio_stb evaluation (0xFF)
[  323.783083] OpenVFD: Skipping vfd_gpio0 evaluation (0xFF)
[  323.783088] OpenVFD: Skipping vfd_gpio1 evaluation (0xFF)
[  323.783093] OpenVFD: Skipping vfd_gpio2 evaluation (0xFF)
[  323.783098] OpenVFD: Skipping vfd_gpio3 evaluation (0xFF)
[  323.783753] OpenVFD: Select FD650 controller
[  323.783844] OpenVFD: SW I2C interface intialized (address = 0x0000 (N/A), MSB mode, pull-ups off)
[  434.394024] OpenVFD: Select FD628 controller
[  434.394434] OpenVFD: SW SPI 3-wire interface failed to intialize. Invalid CLK (477), DAT (476) or STB (-2) pins
[  434.394440] OpenVFD: Failed to initialize the controller, reverting to Dummy controller
[  434.395056] OpenVFD: openvfd_dev_write: count = 14, sizeof(data) = 660
[  442.953527] OpenVFD: openvfd_dev_write: count = 14, sizeof(data) = 660
[  444.026300] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  444.562713] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  445.099077] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  445.635504] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  446.172069] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  446.708701] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  447.245232] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  447.783569] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660

Understandably, it's writing but nothing actually writes to the LCD. I've tried changing the config file location, changing its permissions, moving the config to the dtb, but not luck.

License

Hi @arthur-liberman,

I assume this repo has two licenses right?

For the kernel module GPL2 is applicable.
The user space tool is under GPL3.

Warning and error while compiling driver

Hi,
I would like to ask I have encountered this warning and error while compiling driver.
warning: "CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND" is not defined, evaluates to 0 [-Wundef]
#elif CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND
My tv box is tx3 mini running Armbian buster kernel version 5.9.0.
Could you please take a look and help me? Thank you!

vfd.conf - correct pin numbers and Display Type setting

Hi Arthur,
I'm using an RK3318 box with Linux (4.4 kernel), and have successfully compiled the driver and service, with systemctl successfully loading the module and launching the service.

I have been unsuccessful in unpacking the device-tree from the Android firmware to get the right pin numbers.

So I booted into Android, and ran the following command:

xxd -g4 /proc/device-tree/fd655_dev/clk-pin
00000000:0000008a 00000013 00000000

This shows that CLK is on pin 13

xxd -g4 /proc/device-tree/fd655_dev/dat-pin
00000000:0000008a 00000016 00000000

This shows that DAT is on pin 16

Those two pin numbers are consistent with other rk33x8 vfd pin settings that I've seen, and all of those have STB pin set to 12.

one thing to note though is the output of this command (in Android) gave completely different pin numbers:

cat /sys/kernel/debug/gpio

gpio

This shows that FD655_DEV is using:
pin 19 for CLK
pin 22 for DAT
(so I would assume pin 18 would be for STB?)

So, I took the vfd.conf for MINI ONE (which is for RK3229), and modified it with my pin numbers.

First I tried:

vfd_gpio_clk='4,13,0'
vfd_gpio_dat='4,16,0'
vfd_gpio_stb='4,12,0'

but nothing shows up when I restarted the service
I tried this command with numberous led names:
echo (led_name) > sys/class/leds/openvfd/led_on
still nothing on the display

Then I tried:

vfd_gpio_clk='4,19,0'
vfd_gpio_dat='4,22,0'
vfd_gpio_stb='4,18,0'

same thing. nothing shows up when restarting the service, and nothing happens when I try
echo (led_name) > sys/class/leds/openvfd/led_on

Could an incorrect DISPLAY TYPE setting cause this (nothing showing up on the display at all)?

I've tried many different variations of values for the DISPLAY TYPE, all with no success.

currently I have it set to:
vfd_display_type='0x00,0x00,0x00,0x00'

Do you have any ideas as to what I should be using in the vfd.conf file?

Here's what the display looks like:
vfd

Here's my dmesg:

[ 1624.464307] brightness = 0
[ 1624.512213] OpenVFD: Version: V1.3.0
[ 1624.512231] OpenVFD: vfd_gpio_clk:		#0 = 0x02; #1 = 0x0D; #2 = 0x00; 
[ 1624.512241] OpenVFD: vfd_gpio_dat:		#0 = 0x02; #1 = 0x10; #2 = 0x00; 
[ 1624.512250] OpenVFD: vfd_gpio_stb:		#0 = 0x02; #1 = 0x0C; #2 = 0x00; 
[ 1624.512259] OpenVFD: vfd_gpio0:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1624.512268] OpenVFD: vfd_gpio1:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1624.512277] OpenVFD: vfd_gpio2:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1624.512286] OpenVFD: vfd_gpio3:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1624.512294] OpenVFD: vfd_gpio_protocol:	#0 = 0x00; #1 = 0x00; 
[ 1624.512305] OpenVFD: vfd_chars:		#0 = 0x02; #1 = 0x04; #2 = 0x03; #3 = 0x01; #4 = 0x00; 
[ 1624.512319] OpenVFD: vfd_dot_bits:		#0 = 0x00; #1 = 0x01; #2 = 0x04; #3 = 0x03; #4 = 0x02; #5 = 0x05; #6 = 0x06; 
[ 1624.512329] OpenVFD: vfd_display_type:	#0 = 0x00; #1 = 0x00; #2 = 0x00; #3 = 0x00; 
[ 1624.512340] OpenVFD: Detected gpio chips:	gpio0, gpio1, gpio2, gpio3.
[ 1624.512350] OpenVFD: "gpio0" chip found.	base = 0, pin count = 32, pin = 13, offset = 13
[ 1624.512358] OpenVFD: "gpio0" chip found.	base = 0, pin count = 32, pin = 16, offset = 16
[ 1624.512366] OpenVFD: "gpio0" chip found.	base = 0, pin count = 32, pin = 12, offset = 12
[ 1624.512372] OpenVFD: Skipping vfd_gpio0 evaluation (0xFF)
[ 1624.512377] OpenVFD: Skipping vfd_gpio1 evaluation (0xFF)
[ 1624.512382] OpenVFD: Skipping vfd_gpio2 evaluation (0xFF)
[ 1624.512387] OpenVFD: Skipping vfd_gpio3 evaluation (0xFF)
[ 1624.512907] OpenVFD: Select FD628 controller
[ 1624.512977] OpenVFD: SW SPI 3-wire interface intialized (LSB mode)
[ 1657.412215] brightness = 8

Note: dmesg shows "brightness" is set to zero, so I set it to 8, and still nothing.

Thanks so much for your time.

Missing gpiochip_find() when compiling on newer kernels

I am trying to compile on armbian 6.7.4-edge-rockchip64:

linux_openvfd/driver/openvfd_drv.c:635:24: error: implicit declaration of function ‘gpiochip_find’; did you mean ‘gpiochip_add’? [-Werror=implicit-function-declaration]
635 | chip = gpiochip_find((char *)bank_name, is_right_chip);

image

Seems function was removed.
How to solve?

RK3566 - "periphs-banks" chip not found (multiple banks issue, new $ARCH?)

Hi Arthur;

I am using armbian on a H96 Max V56 (rk3566, FD6551, kernel 6.2) box with your latest openvfd. Am planning to do so for V58 (rk3588) also.

Here's the log:
[ 1240.658303] OpenVFD: Version: V1.4.4 [ 1240.658347] OpenVFD: vfd_gpio_clk: #0 = 0x00; #1 = 0x0B; #2 = 0x00; [ 1240.658367] OpenVFD: vfd_gpio_dat: #0 = 0x00; #1 = 0x0C; #2 = 0x00; [ 1240.658384] OpenVFD: vfd_gpio_stb: #0 = 0x00; #1 = 0x00; #2 = 0xFF; [ 1240.658400] OpenVFD: vfd_gpio0: #0 = 0x00; #1 = 0x00; #2 = 0xFF; [ 1240.658416] OpenVFD: vfd_gpio1: #0 = 0x00; #1 = 0x00; #2 = 0xFF; [ 1240.658430] OpenVFD: vfd_gpio2: #0 = 0x00; #1 = 0x00; #2 = 0xFF; [ 1240.658444] OpenVFD: vfd_gpio3: #0 = 0x00; #1 = 0x00; #2 = 0xFF; [ 1240.658459] OpenVFD: vfd_gpio_protocol: #0 = 0x00; #1 = 0x00; [ 1240.658475] OpenVFD: vfd_chars: #0 = 0x00; #1 = 0x01; #2 = 0x02; #3 = 0x03; #4 = 0x04; [ 1240.658496] OpenVFD: vfd_dot_bits: #0 = 0x00; #1 = 0x00; #2 = 0x00; #3 = 0x06; #4 = 0x05; #5 = 0x00; #6 = 0x00; [ 1240.658514] OpenVFD: vfd_display_type: #0 = 0x01; #1 = 0x00; #2 = 0x00; #3 = 0x06; [ 1240.658534] OpenVFD: Detected gpio chips: gpio0, gpio1, gpio2, gpio3, gpio4. [ 1240.658546] OpenVFD: "periphs-banks" chip was not found [ 1240.658555] OpenVFD: Could not get pin number for vfd_gpio_clk [ 1240.659092] OpenVFD: Failed to verify VFD configuration file, attempt using device tree as fallback. [ 1240.659903] OpenVFD: openvfd_gpio_clk pin entry not found [ 1240.659913] OpenVFD: openvfd_gpio_dat pin entry not found [ 1240.659922] OpenVFD: openvfd_gpio_stb pin entry not found [ 1240.659931] OpenVFD: openvfd_gpio0 pin entry not found [ 1240.659940] OpenVFD: openvfd_gpio1 pin entry not found [ 1240.659948] OpenVFD: openvfd_gpio2 pin entry not found [ 1240.659957] OpenVFD: openvfd_gpio3 pin entry not found [ 1240.659967] OpenVFD: can't find openvfd_chars list, falling back to defaults. [ 1240.659974] OpenVFD: chars_prop = 0000000000000000 [ 1240.660704] OpenVFD: can't find openvfd_dot_bits list, falling back to defaults. [ 1240.660715] OpenVFD: dot_bits_prop = 0000000000000000 [ 1240.661381] OpenVFD: display.type = 0, display.controller = 0, pdata->dev->dtb_active.display.flags = 0x00 [ 1240.661397] OpenVFD: can't request gpio of gpio_clk [ 1240.661411] openvfd: probe of openvfd failed with error -22

It seems that openvfd (openvfd_drv.c, line ~700) should be using (or iterating over) the "Detected gpio chips: gpio0, gpio1, gpio2, gpio3, gpio4" for pin verification as opposed to entries from "const char *pin_banks[] = { "periphs-banks", "aobus-banks", "gpio0", "gpio1", "gpio2", "gpio3" };"

root@box:~# ls /dev/ | grep gpio
gpiochip0
gpiochip1
gpiochip2
gpiochip3
gpiochip4

I am willing to test any suggestions you may have. Would you like me to alter the pin_banks[] declaration to remove "periphs-banks", "aobus-banks"? Perhaps this can be handled with $ARCH def's?

A search of issues for rk3566 yields nada, so, this appears to be a new openvfd target $ARCH.

Thanks;
Bill

Kernel module name collision

Hi,
when building the module I ran into an issue with another kernel module in the network space.

error: the following would cause module name conflict:
  drivers/net/dummy.ko
  drivers/auxdisplay/openvfd/controllers/dummy.ko

I've renamed the dummy to dummy_vfd. What do you think?

Problems configuring X96 Air Q1000 VFD display

Hi Arthur

Thanks for writing openvfd! I built your repo yesterday with Linux 5.12 under Manjaro ARM and I'm in the process of configuring it now.

There doesn't seem to be any docs for openvfd in your repo but I would presume that most if not all of what can be read in the README at https://github.com/LibreELEC/linux_openvfd also applies to your upstream code?

I tried to report a bug to the LE fork yesterday but I was told by one of the LE devs that their fork is dead so I think it would be a good idea to borrow and update (if required) their docs for your repo.

Auto switch to wrong controller

Hi, I have a strange problem with the driver, it seems to switch to wrong controller after changing display type.
my box: rk3318 (H96 Max)
system: Armbian - Linux rk3318-box 5.10.37-rockchip64
controller: FD6551
my openvfd.dts:

/dts-v1/;
/plugin/;
/ {
   fragment@0 {
      target-path = "/";
      __overlay__ {
         openvfd {
            compatible = "open,vfd";
            dev_name = "openvfd";
            status = "okay";
         };
      };
   };
};

driver parameters are set with /etc/modprobe.d/openvfd.conf

options openvfd vfd_gpio_clk="4,0x16,0"
options openvfd vfd_gpio_dat="4,0x15,0"
options openvfd vfd_gpio_stb="4,0x14,0"
options openvfd vfd_chars="0,4,3,2,1"
options openvfd vfd_dot_bits="0,1,3,2,4,5,6"
options openvfd vfd_display_type="0x02,0x00,0x00,0x06"

after module is loaded, last lines from dmesg shows:

OpenVFD: display.type = 2, display.controller = 6, pdata->dev->dtb_active.display.flags = 0x00
OpenVFD: Select FD6551 controller
OpenVFD: SW I2C interface intialized (address = 0x0000 (N/A), MSB mode, pull-ups off)

and OpenVFDService correctly prestents time on display, but after trying to check another display type:

./OpenVFDService -dt [N]

driver switches to another controller

OpenVFD: Select FD628 controller
OpenVFD: SW SPI 3-wire interface intialized (LSB mode)

And display stops working, until driver module is reloaded, am I doing something wrong?

What is the required file ?

i tested it on armbian, it runs sucessfully, then
trying to run on openwrt (using the same armbian kernel) got this error :

-bash: /usr/bin/OpenVFDService: cannot execute: required file not found

i make sure :
/storage/.config/vfd.conf is exist
module openvfd.ko is loaded

perhaps copying that "required file" from armbian to openwrt make it able to run on openwrt ?

Display something other then the time?

Hello!

Would it be possible to display numbers on the time display through userspace?

I see that in Demo mode the OpenVFDService does rotate through a number of different character output on the HH:MM, however I can't really see how I could modify that to achieve my goal.

I'm using a python script for my box, and I'd like to send something other then time, for example, the cpu temp to HH and cpu usage to MM.

I can get those values in my python script, but I'm not sure how to send them to the HH:MM display

Ideally I'd like to populate those two values (HH and MM) separately.

Since I'm using python, I can easily enable and disable the other leds (wifi, eth, etc) by executing the usual command line command:

echo wifi > /sys/class/leds/openvfd/led_on

Is there a way I can send the temperature in a similar way through a command line command, or if not, directly through python?

If you could point me in the right direction, I'd be super appreciative.

Thanks so much for all hard work.

Q: How to compile?

Hello, I would like to compile this driver for my RK3318 based TV box running Armbian.

I already have the armbian source downloaded from here and compiled.

How to include this driver into kernel tree correctly and compile as module?

Here is the similar driver and I read:

To use this driver, copy the subdirectory vfd into AMLogic kernel tree, into the directory drivers/amlogic/input/.

So should I copy the driver directory somewhere into Rockchip kernel tree? Where exactly?
How to compile the service?

Sorry for the newbie questions...

No display with HK1 Box On Armbian

Hi, Arthur

Thanks for your openvfd first, But I'm having trouble with it not working!

I used HK1 Box (a TV Box similar X96 Max Plus, And with the Amlogic S905X3 Soc) running Armbian 20.10 bullseye 5.9.0,
And I compile openvfd driver With Amlogic_s905-kernel, make option ARCH is arm64 CROSS_COMPILE is aarch64-linux-gnu-
Then I source hk1-x3-vfd.conf and run this command:

insmod openvfd.ko vfd_gpio_clk=${vfd_gpio_clk} \
                         vfd_gpio_dat=${vfd_gpio_dat} \
                         vfd_gpio_stb=${vfd_gpio_stb:-0,0,0xFF} \
                         vfd_gpio0=${vfd_gpio0:-0,0,0xFF} \
                         vfd_gpio1=${vfd_gpio1:-0,0,0xFF} \
                         vfd_gpio2=${vfd_gpio2:-0,0,0xFF} \
                         vfd_gpio3=${vfd_gpio3:-0,0,0xFF} \
                         vfd_gpio_protocol=${vfd_gpio_protocol:-0,0} \
                         vfd_chars=${vfd_chars} vfd_dot_bits=${vfd_dot_bits} \
                         vfd_display_type=${vfd_display_type}

And I from dmesg get this:

[ 1476.669968] OpenVFD: Version: V1.3.0
[ 1476.669989] OpenVFD: vfd_gpio_clk:		#0 = 0x00; #1 = 0x41; #2 = 0x00; 
[ 1476.670001] OpenVFD: vfd_gpio_dat:		#0 = 0x00; #1 = 0x40; #2 = 0x00; 
[ 1476.670012] OpenVFD: vfd_gpio_stb:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1476.670023] OpenVFD: vfd_gpio0:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1476.670034] OpenVFD: vfd_gpio1:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1476.670044] OpenVFD: vfd_gpio2:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1476.670055] OpenVFD: vfd_gpio3:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1476.670064] OpenVFD: vfd_gpio_protocol:	#0 = 0x00; #1 = 0x00; 
[ 1476.670078] OpenVFD: vfd_chars:		#0 = 0x00; #1 = 0x04; #2 = 0x03; #3 = 0x02; #4 = 0x01; 
[ 1476.670096] OpenVFD: vfd_dot_bits:		#0 = 0x00; #1 = 0x01; #2 = 0x03; #3 = 0x02; #4 = 0x04; #5 = 0x05; #6 = 0x06; 
[ 1476.670108] OpenVFD: vfd_display_type:	#0 = 0x00; #1 = 0x00; #2 = 0x00; #3 = 0x06; 
[ 1476.670119] OpenVFD: Detected gpio chips:	aobus-banks, periphs-banks.
[ 1476.670130] OpenVFD: "periphs-banks" chip found.	base = 427, pin count = 85, pin = 65, offset = 492
[ 1476.670139] OpenVFD: "periphs-banks" chip found.	base = 427, pin count = 85, pin = 64, offset = 491
[ 1476.670144] OpenVFD: Skipping vfd_gpio_stb evaluation (0xFF)
[ 1476.670148] OpenVFD: Skipping vfd_gpio0 evaluation (0xFF)
[ 1476.670153] OpenVFD: Skipping vfd_gpio1 evaluation (0xFF)
[ 1476.670158] OpenVFD: Skipping vfd_gpio2 evaluation (0xFF)
[ 1476.670162] OpenVFD: Skipping vfd_gpio3 evaluation (0xFF)
[ 1476.670658] OpenVFD: Select FD6551 controller
[ 1476.670829] OpenVFD: SW I2C interface intialized (address = 0x0000 (N/A), MSB mode, pull-ups off)
root@arm-64:~# 

Then I use ./OpenVFDService ,But nothing happen, The LCD screen still does not show.

Also I have tried source x96-max-1gbit-vfd.conf, I will get this from dmesg:

[ 1786.779440] OpenVFD: Version: V1.3.0
[ 1786.779459] OpenVFD: vfd_gpio_clk:		#0 = 0x00; #1 = 0x41; #2 = 0x00; 
[ 1786.779471] OpenVFD: vfd_gpio_dat:		#0 = 0x00; #1 = 0x40; #2 = 0x00; 
[ 1786.779482] OpenVFD: vfd_gpio_stb:		#0 = 0x01; #1 = 0x0A; #2 = 0x00; 
[ 1786.779493] OpenVFD: vfd_gpio0:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1786.779504] OpenVFD: vfd_gpio1:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1786.779514] OpenVFD: vfd_gpio2:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1786.779525] OpenVFD: vfd_gpio3:		#0 = 0x00; #1 = 0x00; #2 = 0xFF; 
[ 1786.779534] OpenVFD: vfd_gpio_protocol:	#0 = 0x00; #1 = 0x00; 
[ 1786.779548] OpenVFD: vfd_chars:		#0 = 0x04; #1 = 0x00; #2 = 0x01; #3 = 0x02; #4 = 0x03; 
[ 1786.779565] OpenVFD: vfd_dot_bits:		#0 = 0x00; #1 = 0x01; #2 = 0x02; #3 = 0x03; #4 = 0x04; #5 = 0x05; #6 = 0x06; 
[ 1786.779578] OpenVFD: vfd_display_type:	#0 = 0x02; #1 = 0x00; #2 = 0x01; #3 = 0x00; 
[ 1786.779588] OpenVFD: Detected gpio chips:	aobus-banks, periphs-banks.
[ 1786.779599] OpenVFD: "periphs-banks" chip found.	base = 427, pin count = 85, pin = 65, offset = 492
[ 1786.779608] OpenVFD: "periphs-banks" chip found.	base = 427, pin count = 85, pin = 64, offset = 491
[ 1786.779616] OpenVFD: "aobus-banks" chip found.	base = 412, pin count = 15, pin = 10, offset = 422
[ 1786.779622] OpenVFD: Skipping vfd_gpio0 evaluation (0xFF)
[ 1786.779627] OpenVFD: Skipping vfd_gpio1 evaluation (0xFF)
[ 1786.779632] OpenVFD: Skipping vfd_gpio2 evaluation (0xFF)
[ 1786.779636] OpenVFD: Skipping vfd_gpio3 evaluation (0xFF)
[ 1786.780108] OpenVFD: Select FD628 controller
[ 1786.780144] OpenVFD: SW SPI 3-wire interface intialized (LSB mode)
root@arm-64:~# 

But still not working, Include ./OpenVFDService -t

Above, can you help me? Thanks.

Patch of_get_named_gpio_flags on latest kernels

The function of_get_named_gpio_flags has been removed in the commit 40fc56ee608cdb20022c225ac6f1e4b7ba63f8f1 and the of_get_named_gpiod_flags is also private.

drivers/auxdisplay/openvfd/openvfd_drv.c: In function 'get_pin_from_dt':
drivers/auxdisplay/openvfd/openvfd_drv.c:734:28: error: implicit declaration of function 'of_get_named_gpio_flags'; did you mean 'of_get_named_gpio'? [-Werror=implicit-function-declaration]
  734 |                 pin->pin = of_get_named_gpio_flags(pdev->dev.of_node, name, 0, &pin->flags.value);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
      |                            of_get_named_gpio
cc1: some warnings being treated as errors

Building against kernel v6.3.3

I've patched the function with this one:

   if (of_find_property(pdev->dev.of_node, name, NULL)) {
 -        pin->pin = of_get_named_gpio_flags(pdev->dev.of_node, name, 0, &pin->flags.value);
 -        pr_dbg2("%s: pin = %d, flags = 0x%02X\n", name, pin->pin, pin->flags.value);
+       pin->pin = of_get_named_gpio(pdev->dev.of_node, name, 0);
+       pr_dbg2("%s: pin = %d, flags = 0x%02X\n", name, pin->pin, pin->flags.value);
   } else {

I can send MR if you want

No LED indication on tanix tx6 android box

Hello arthur, one issue raised on my tanix tx6 box which is allwinner H6 SOC based, I am running on android for this box, the LED controller is FD650, but no indication on the LED when I used the openvfd driver for the android system. The dmesg copied below, I used the contents from vfd.conf and phased in sysconfig.fex (device tree for android) for android rom pack. The dmesg always show "OpenVFD: Select Dummy controller" and I cannot switch to controller FD650. Can you please have a look? Thank you.

vfd.conf:
;This file must be renamed to vfd.conf and placed in the /storage/.config/ folder.
;
; Tanix TX6 - Allwinner H6 configuration
;--------------------
;gpio_xxx:
; [0] 0 = &gpiochip0, 1 = &gpiochip1.
; [1] pin number
; [0] Reserved - must be 0.

vfd_gpio_clk='1,229,0'
vfd_gpio_dat='1,230,0'
vfd_gpio_stb='0,0,0xFF'
vfd_gpio_chip_name='300b000.pinctrl'

;chars:
; < DHHMM > Order of display chars (D=dots, represented by a single char)

vfd_chars='2,4,3,2,1'

;dot_bits:
; Order of dot bits. Typical configurations:
; Display Type 0, 1 usually has Alarm, USB, Play, Pause, Col, Ethernet, Wifi dots
; Alarm = 0, USB = 1, Play = 2, Pause = 3, Col = 4, Eth = 5, Wifi = 6
; Display Type 2 usually has APPS, USB, SETUP, CARD, Col, HDMI, CVBS dots
; APPS = 0, USB = 1, SETUP = 2, CARD = 3, Col = 4, HDMI = 5, CVBS = 6
; Display Type 3 Power, LAN, Col, Low Wifi, High Wifi
; N/A = 0, N/A = 1, Power = 2, LAN = 3, Col = 4, Low Wifi = 5, High Wifi = 6

vfd_dot_bits='0,1,2,3,4,5,6'

;display_type:
; [0] - Display type.
; [1] - Reserved - must be 0..
; [2] - Flags. (bit 0 = '1' - Common Anode display)
; [3] - Controller.

vfd_display_type='0x01,0x00,0x00,0x03'

dmesg:
[ 7.830385] OpenVFD: Version: V1.4.1
[ 7.834328] OpenVFD: vfd_gpio_clk: Empty.
[ 7.838838] OpenVFD: vfd_gpio_dat: Empty.
[ 7.843617] OpenVFD: vfd_gpio_stb: Empty.
[ 7.848119] OpenVFD: vfd_gpio0: #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 7.857572] OpenVFD: vfd_gpio1: #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 7.864588] OpenVFD: vfd_gpio2: #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 7.873018] OpenVFD: vfd_gpio3: #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 7.880416] OpenVFD: vfd_gpio_protocol: #0 = 0x00; #1 = 0x00;
[ 7.887442] OpenVFD: vfd_chars: Empty.
[ 7.892095] OpenVFD: vfd_dot_bits: Empty.
[ 7.896809] OpenVFD: vfd_display_type: Empty.
[ 7.902171] OpenVFD: Detected gpio chips: pio, r_pio.
[ 7.910410] OpenVFD: Failed to verify VFD configuration file, attempt using device tree as fallback.
[ 7.921209] OpenVFD: openvfd_gpio_clk: pin = 229, flags = 0xE5
[ 7.927650] OpenVFD: openvfd_gpio_dat: pin = 230, flags = 0xE6
[ 7.934653] OpenVFD: openvfd_gpio_stb pin entry not found
[ 7.940929] OpenVFD: openvfd_gpio0 pin entry not found
[ 7.946594] OpenVFD: openvfd_gpio1 pin entry not found
[ 7.983617] OpenVFD: openvfd_gpio2 pin entry not found
[ 7.989587] OpenVFD: openvfd_gpio3 pin entry not found
[ 7.995901] OpenVFD: chars_prop = ffffffc0bbfde618
[ 8.001867] OpenVFD: chars_prop->length = 11
[ 8.006567] OpenVFD: char #0: 50
[ 8.010277] OpenVFD: char #1: 44
[ 8.014072] OpenVFD: char #2: 52
[ 8.017606] OpenVFD: char #3: 44
[ 8.021380] OpenVFD: char #4: 51
[ 8.025367] OpenVFD: char #5: 44
[ 8.028878] OpenVFD: char #6: 50
[ 8.032686] OpenVFD: dot_bits_prop = ffffffc0bbfde648
[ 8.038266] OpenVFD: dot_bits_prop->length = 15
[ 8.043504] OpenVFD: dot_bit #0: 48
[ 8.047344] OpenVFD: dot_bit #1: 44
[ 8.051350] OpenVFD: dot_bit #2: 49
[ 8.055198] OpenVFD: dot_bit #3: 44
[ 8.059047] OpenVFD: dot_bit #4: 50
[ 8.063124] OpenVFD: dot_bit #5: 44
[ 8.066964] OpenVFD: dot_bit #6: 51
[ 8.070958] OpenVFD: dot_bit #7: 44
[ 8.074799] OpenVFD: dot_bit #8: 52
[ 8.078640] OpenVFD: dot_bit #9: 44
[ 8.082776] OpenVFD: dot_bit #10: 53
[ 8.086766] OpenVFD: dot_bit #11: 44
[ 8.090862] OpenVFD: dot_bit #12: 54
[ 8.094806] OpenVFD: dot_bit #13: 39
[ 8.098755] OpenVFD: dot_bit #14: 0
[ 8.102850] OpenVFD: display.type = 51, display.controller = 48, pdata->dev->dtb_active.display.flags = 0x78
[ 8.115436] OpenVFD: Select Dummy controller
[ 8.143211] no ioctl found(cmd:0x13) in disp_unregister_compat_ioctl_func
[ 8.143423] init: Starting service 'openvfd'...

How to enter a port number greater than 255?

Hi Arthur.

At the outset, I would like to thank you for your wonderful work.
I am trying to implement your software into Allwinner H616 based system.
My board (H616 - T95MAX - V4.0) uses port I bits 11 and 12 respectively:

scl-gpios = <&pio 0x08 0x0b (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; PI11

sda-gpios = <&pio 0x08 0x0c (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; PI12

According to the principle of calculating the pin number (position of letter in alphabet - 1) * 32 + pin number

https://linux-sunxi.org/GPIO

my pin numbers are accordingly: 267, 268.
How can i input the above pin numbers ?
I tried to change the first byte as the port number (I = 8) but of course it didn't work.
..............................
gpio_xxx:
[0] 0 = &gpio, 1 = &gpio_ao.
[1] pin number - https://github.com/openSUSE/kernel/blob/master/include/dt-bindings/gpio/meson-gxl-gpio.h
[2] Reserved - must be 0.
...............................

The "gpioinfo" program always points to pins up to 255

root@orangepizero2:~# gpioinfo
gpiochip0 - 288 lines:
line 0: unnamed kernel input active-high [used]
.
line 254: unnamed "openvfd" input active-high [used]
line 255: unnamed "openvfd" input active-high [used]

If I enter the correct pin numbers (267, 268) the command "dmesg | grep vfd" returns an error:
...
[ 9.572509] openvfd: 0' invalid for parameter vfd_gpio_clk'
[ 9.572524] openvfd: 0' invalid for parameter vfd_gpio_dat'

Do you have any idea how to enter a port number greater than 255?

Greetings,
Kazimierz Bielewicz

OpenVFD: Failed to verify VFD configuration file, attempt using device tree as fallback.

Hi Arthur;

Tanix Tx92, Armbian Ubuntu bionic (built linux_openvfd)

Thank you very much for linux_openvfd.
It appears my config file for TX92: https://github.com/arthur-liberman/vfd-configurations/blob/master/tx92-vfd.conf

is not being read or is incorrect, leading to topic title. I tried the following locations:
/storage/.config/vfd.conf
/.config/vfd.conf
and in same directory as OpenVFDService

to no avail. I even tried fgrep -r vfd.conf in the build directory, in case the path was changed. No references in source or object files.

has vfd.conf been renamed, moved, or obsoleted?

My dtb handles this OK, but I want to avoid a dtb per target, take care of vfd layout using conf file.

Your thoughts?
Thanks, Bill

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.