arthur-liberman / linux_openvfd

FD628 and similar compatible LED controller driver for linux
GNU General Public License v3.0
21 stars 25 forks source link

Patch of_get_named_gpio_flags on latest kernels #17

Closed phodina closed 2 months ago

phodina commented 1 year ago

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

phodina commented 1 year ago

The vfd driver works and I'm able to use the VFD on my X96 max plus device. Thanks for the driver!

rossbcan commented 1 year ago

@phodina Are you using H96 Max V56 (rk3566)? If so, can you please share your vfd conf settings and dts here?

Also, I am unable to find the commit 40fc56ee608cdb20022c225ac6f1e4b7ba63f8f1 details. According to bootlin (kernel symbols x reference) of_get_named_gpio_flags went from defined function to prototype between kernels 6.2 and 6.3. Correct?

Thanks; Bill