Open Soundtrack9407 opened 7 years ago
It might be a problem with the IRQs implementation in the kernel, it is supposed the package lirc-gpio-generic comes with a couple of patches for fixing IRQ/GPIO in AR7xx. Try to rebuild your firmware, first make a kernel clean:
make target/linux/clean
and then compile the firmware again
make
I already tried to check the kernel patch and rebuilt my firmware, but the error still exists. Last 2 days I try to understand demo(lirc_gpio_generic.c), for example:
/* Translate our GPIO number into absolute number */ gpio_out_pin = gpio_out_pin + base; gpio_in_pin = gpio_in_pin + base;
but base = 0, it's an error?
Everything seems OK......
[ 13.140000] lirc_gpio_generic: Found GPIO chip, label = ath79, base = 0
[ 13.590000] lirc_gpio_generic: auto-detected active high receiver on GPIO pin 21
[ 13.590000] lirc_gpio_generic IN: ath79, base = 0, offset = 21
[ 13.600000] lirc_gpio_generic OUT: ath79, base = 0, offset = 20
[ 13.600000] lirc_gpio_generic lirc_gpio_generic.0: lirc_dev: driver lirc_gpio_generic registered at minor = 0
[ 13.610000] lirc_gpio_generic: driver registered!
Thank you. Soundtrack
I think the problem is at the gpio-irq driver itsel, I picked up the patches for AR7xx from https://github.com/GBert/openwrt-misc/tree/master/gpio-test/src/patches-3.18
Check them. I tested lirc-gpio-generic only with AR7240. You could also try to remove the patch I provided with the package. In theory with latest Openwrt versions IRQs for gpios were fixed, but it wasn't my case (the reason of providing the patch).
If the problem persists you better should contact with AR71xx developers from Openwrt/LEDE teams.
Hi danitlool,
Thanks for your advice. I have a good news, I use bb branch driver on CC platform boldly, and it worked. So I think that the problem is lirc_gpio_generic.c(cc branch) code. In addition, According to the datasheet, AR9331 has the same serial port(GPIO9,10) with AR7240. Now, it can only open device(cat /dev/lirc0) and receivce some current signal but not IR signal. [13997.460000] lirc_gpio_generic: 6lirc_gpio_generic: freed IRQ 60 [14008.510000] lirc_gpio_generic: cleaned up module [14073.390000] lirc_gpio_generic: manually using active low receiver on GPIO pin 9 [14073.400000] lirc_gpio_generic lirc_gpio_generic.0: lirc_dev: driver lirc_gpio_generic registered at minor = 0 [14073.410000] lirc_gpio_generic: driver registered! [15909.080000] lirc_gpio_generic: AIEEEE: 1 1 585bd17c 585bd14f 59a31 528f3 [16036.460000] lirc_gpio_generic: AIEEEE: 0 0 585bd1fb 585bd17c b66b6 5b04e [16701.260000] lirc_gpio_generic: cleaned up module [16711.670000] lirc_gpio_generic: to_irq 60 [16712.630000] lirc_gpio_generic: auto-detected active high receiver on GPIO pin 9 [16712.630000] lirc_gpio_generic lirc_gpio_generic.0: lirc_dev: driver lirc_gpio_generic registered at minor = 0 [16712.640000] lirc_gpio_generic: driver registered! [16724.720000] lirc_gpio_generic: Interrupt 60 obtained [16724.720000] lirc_gpio_generic: in init_timing_params, freq=38000 pulse=13157, space=13158 [16733.100000] lirc_gpio_generic: 6lirc_gpio_generic: freed IRQ 60
There are minor differences between both drivers, the one from CC is supposed to toggle the gpio at lower level like the original rpi driver did. The driver from BB uses the legacy gpio libraries, they also should work ok.
A few days ago I tested successfully the CC driver in the last LEDE snapshot. I took the driver and LIRC software as is, and it worked quite fine (only receiver tested) in a brcm63xx board.
Right now I have no idea what's going on with ar71xx.
Hi, it turns out that the gpio driver hadn't _.toirq in the gpiochip structure and was causing the kernel error. Now lirc-gpio-generic driver should work for ar71xx in commit : https://github.com/danitool/openwrt-pkgs/commit/42573d9c8dc14fd589dd8eb4b74151a25f9739ea
Tested succesfully in AR7240 platform.
Regards.
Hi danitool,
GL-iNet 6416(based on AR9331), chaos calmer, kernel 3.18.44(728-MIPS-ath79-add-gpio-irq.patch has been apply)
root@soundtrack:~# cat /sys/kernel/debug/gpio GPIOs 0-29, ath79: ...... gpio-20 (lirc_gpio_generic ir) out lo gpio-21 (lirc_gpio_generic ir) in lo ...... everything seems normally, but when I test the receiver( execute "irw" ), some error has happen:
After that rmmod lirc_gpio_generic module was failed, and I still couldn't receiver any signal from IR receiver. What should I do to fix this error?
Thanks. Soundtrack