It looks like kmod-i2c-gpio-custom
is missing in 21.02. What is the right way to read from i2c now?
Before I could just do insmod i2c-gpio-custom bus0=0,12,14
and use i2cdump
.
I set it up in DTS:
i2c {
compatible = "i2c-gpio";
sda-gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
scl-gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
};
and this is the kernel output
dmesg | grep i2c
[ 0.163349] i2c-gpio i2c: using lines 12 (SDA) and 14 (SCL)
[ 1.542175] i2c /dev entries driver
but this is the i2cdump - nothing.
i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
But this is what I get on an old kernel with kmod-gpio-custom
i2cdetect 0
i2cdetect: WARNING! This program can confuse your I2C bus
Continue? [y/N] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --