I using custom board based on Hilink HLK-7621A (HiLink HLK-7621A evaluation board) module.
I build OpenWrt (OpenWrt SNAPSHOT r18810-923cc869a6).
I change mt7621_hilink_hlk-7621a-evb.dts file and add to end:
&i2c {
status = "okay";
clock-frequency = <100000>;
};
Image boot and works fine.
But, i cannot find I2C driver kernel module package - kmod-i2c-? (what package name ?).
In make menuconfig ( Kernel modules -> I2C support ) i can't find menu item with this driver.
In make kernel_menuconfig i check Device drivers -> I2C support -> I2C Hardware Bus support -> MT7621/MT7628 I2C Controller
Module i2c-mt7621.ko is created. I manually copy it to working board, i may modprobe it, and it works fine.
But, kmod-i2c- for 7621 SoC is not created and not present in resulting image.
My questons:
1. What name of package with i2c driver ?
2. What select in make [kernel_]menuconfig ?
If you added the &i2c "status = okay" like you did, it will load automatically during boot.
The I2C driver is selected by default (see the config-5.10 or 5.15 files in openwrt/target/linux/ramips/mt7621). CONFIG_I2C=y and CONFIG_I2C_MT7621=y
I added the exact lines to my own dts file (xiaomi 4a gigabit edition) which is pointless but should load the driver anyway and it does.
I can't find kmod-i2c-mt7621 in make menuconfig.
but i find kmod-i2c-mt7628.
I add it in file: target/linux/ramips/image/mt7621.mk DEVICE_PACKAGES += kmod-mt76x2 kmod-usb3 kmod-i2c-mt7628
And it doesn't show up in the boot log? That seems very strange to me.
Edit:
I tried building it like a module and it doesn't load and/or doesn't show up under modules. Building it "build-in" works just fine.
Is there any reason why you need it as a module? For testing you need to be able to unload it? In that case, adding it manually as .ko file during the testing should not be such a big deal, right?