Giter Club home page Giter Club logo

Comments (11)

augin avatar augin commented on June 11, 2024 1

created PR

from linux_openvfd.

arthur-liberman avatar arthur-liberman commented on June 11, 2024

@lucky62 I don't have any devices that use the v6.7 kernel, so I can't make the following changes myself.
Looks like gpiochip_find was deprecated and quickly replaced by gpio_device_find. But this is a different method, and requires some extra code to get the gpio_chip object from it.
You can see how this transition was handled in the linux kernel code:
https://elixir.bootlin.com/linux/v6.6.26/source/drivers/gpio/gpiolib.c#L1022

Maybe you can copy this whole method and paste in into the openvfd_drv.c file just above the get_chip_pin_number method.

from linux_openvfd.

arthur-liberman avatar arthur-liberman commented on June 11, 2024

Something like this patch:

diff --git a/driver/openvfd_drv.c b/driver/openvfd_drv.c
index 7766740..f20f8d3 100644
--- a/driver/openvfd_drv.c
+++ b/driver/openvfd_drv.c
@@ -617,6 +617,24 @@ static int is_right_chip(struct gpio_chip *chip, void *data)
        return 0;
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,7,0)
+static struct gpio_chip *gpiochip_find(void *data,
+                               int (*match)(struct gpio_chip *gc,
+                                            void *data))
+{
+       struct gpio_device *gdev;
+       struct gpio_chip *gc = NULL;
+
+       gdev = gpio_device_find(data, match);
+       if (gdev) {
+               gc = gdev->chip;
+               gpio_device_put(gdev);
+       }
+
+       return gc;
+}
+#endif
+
 static int get_chip_pin_number(const unsigned int gpio[])
 {
        int pin = -1;

Please let me know if it works, I'll merge it as a fix.

from linux_openvfd.

augin avatar augin commented on June 11, 2024
diff --git a/driver/openvfd_drv.c b/driver/openvfd_drv.c
index 7766740..f20f8d3 100644
--- a/driver/openvfd_drv.c
+++ b/driver/openvfd_drv.c
@@ -617,6 +617,24 @@ static int is_right_chip(struct gpio_chip *chip, void *data)
        return 0;
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,7,0)
+static struct gpio_chip *gpiochip_find(void *data,
+                               int (*match)(struct gpio_chip *gc,
+                                            void *data))
+{
+       struct gpio_device *gdev;
+       struct gpio_chip *gc = NULL;
+
+       gdev = gpio_device_find(data, match);
+       if (gdev) {
+               gc = gdev->chip;
+               gpio_device_put(gdev);
+       }
+
+       return gc;
+}
+#endif
+
 static int get_chip_pin_number(const unsigned int gpio[])
 {
        int pin = -1;

image

from linux_openvfd.

augin avatar augin commented on June 11, 2024

I add https://elixir.bootlin.com/linux/v6.7.4/source/drivers/gpio/gpiolib.h and include this. Its work!

from linux_openvfd.

arthur-liberman avatar arthur-liberman commented on June 11, 2024

Did you add it in addition to my proposed change or only that line?
Or better, can you post your diff or open a PR with the changes?

from linux_openvfd.

KuroNeko-san avatar KuroNeko-san commented on June 11, 2024

Same error. Waiting for accepting that PR.

from linux_openvfd.

arthur-liberman avatar arthur-liberman commented on June 11, 2024

Thanks for the PR, but I can't accept it as-is.
The driver is primarily targeted for CoreELEC, and the changes + additional files are not something that is required in this repo, at least at this stage.
I also think that "gpiolib.h" should not be part of the repository, and should be referenced directly against the platform the driver is built on, and the include is only required for the new kernels, so should be surrounded by #ifdef.

When I get some free time, I will try to sort it out and post a patch for you to try.

from linux_openvfd.

KuroNeko-san avatar KuroNeko-san commented on June 11, 2024

Is there anything I can do to help? For example, provide SSH access to TV-box with 6.7.4 kernel for online testing?

from linux_openvfd.

Related Issues (20)

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.