Hi all, could somebody explain how to work with gpio in trunk on mt7621?
I'm going to add to router i2c RTC.
i2c pins are gpio 3 & 4:
First of all is very strange numbers of gpio:
root@router:~# cat /sys/kernel/debug/gpio
gpiochip4: GPIOs 396-405, parent: pci/0000:03:00.0, ath9k-phy1:
gpio-404 ( |ath9k-phy1 ) out hi
gpiochip3: GPIOs 406-415, parent: pci/0000:02:00.0, ath9k-phy0:
gpio-407 ( |ath9k-phy0 ) out lo
gpiochip2: GPIOs 416-447, parent: platform/1e000600.gpio, 1e000600.gpio-bank2:
gpiochip1: GPIOs 448-479, parent: platform/1e000600.gpio, 1e000600.gpio-bank1:
gpiochip0: GPIOs 480-511, parent: platform/1e000600.gpio, 1e000600.gpio-bank0:
gpio-490 ( |green:status ) out lo ACTIVE LOW
gpio-491 ( |green:led4 ) out lo
gpio-492 ( |green:led5 ) out lo
gpio-496 ( |modem_reset ) out hi ACTIVE LOW
gpio-498 ( |reset ) in hi IRQ
gpio-499 ( |reset ) out hi ACTIVE LOW
Second -- I did not find at trunk kmod-i2c-gpio-custom to define i2c bus like described here:
/sbin/insmod i2c-dev
/sbin/insmod i2c-gpio-custom bus0=0,2,3
Third -- it looks like i2c driver does not start. Modules are compiled and present, driver reports that it works but in /dev there is no any device like i2c:
root@router:~# opkg list-installed | grep -i i2c
i2c-tools - 4.2-1
kmod-i2c-algo-bit - 5.4.72-1
kmod-i2c-core - 5.4.72-1
kmod-i2c-gpio - 5.4.72-1
libi2c - 4.2-1
root@router:~# lsmod | grep -i i2c
i2c_algo_bit 5037 1 i2c_gpio
i2c_dev 5122 0
i2c_gpio 2514 0
root@router:~# dmesg | grep -i i2c
[ 19.708770] i2c /dev entries driver
root@router:~# i2cdetect -y 0
Error: Could not open file `/dev/i2c-0' or `/dev/i2c/0': No such file or directory
root@router:~# i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory
root@router:~# i2cdetect -y 2
Error: Could not open file `/dev/i2c-2' or `/dev/i2c/2': No such file or directory
root@router:~# ls -l /dev | grep -i i2c
root@router:~#