OpenWRT 22.03.4 mt7628 I2C driver build error

I compiled openwrt 22.03.4 to a board with mt7628 CPU, and added an rtc-jxr160 I2C driver to the ./package/kernel/rtc-jxr160 directory and compiled with an error:

make[3]: Entering directory '/home/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/linux-5.10.176'
  MODPOST /home/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/rtc-jxr160/Module.symvers
ERROR: modpost: "devm_rtc_device_register" [/home/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/rtc-jxr160/rtc-jxr160.ko] undefined!
make[4]: *** [scripts/Makefile.modpost:123: /home/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/rtc-jxr160/Module.symvers] Error 1

If I choose to compile to mt7621 it compiles fine, but mt7628 gives a compilation error.

How can I solve this?

I try to change .config file:

CONFIG_PACKAGE_kmod-rtc-jxr160=y

mt7628 cpu, choose y or m, both compile with error。

I found devm_rtc_device_register is an exported symbol, the rtc-jxr160 driver declare MODULE_LICENSE("GPL").

Is there a configuration item missing?

I found Kconfig have RTC_CLASS, how to enable it?

The make menuconfig not found TARGET_mt7628 rtc support, how enable RTC_SUPPORT to mt7628?

  β”‚ Symbol: RTC_SUPPORT [=n]
  β”‚ Type  : bool
  β”‚ Defined at target/Config.in:45
  β”‚ Selected by [n]:
      ...
  |   - TARGET_mediatek_mt7622 [=n] && <choice> && TARGET_mediatek [=n]
  β”‚   - TARGET_mediatek_mt7623 [=n] && <choice> && TARGET_mediatek [=n]
  β”‚   - TARGET_mpc85xx_p1010 [=n] && <choice> && TARGET_mpc85xx [=n]
  β”‚   - TARGET_mpc85xx_p1020 [=n] && <choice> && TARGET_mpc85xx [=n]
  β”‚   - TARGET_mpc85xx_p2020 [=n] && <choice> && TARGET_mpc85xx [=n]
  β”‚   - TARGET_mvebu_cortexa9 [=n] && <choice> && TARGET_mvebu [=n]
  β”‚   - TARGET_mvebu_cortexa53 [=n] && <choice> && TARGET_mvebu [=n]
  β”‚   - TARGET_mvebu_cortexa72 [=n] && <choice> && TARGET_mvebu [=n]
  β”‚   - TARGET_oxnas_ox810se [=n] && <choice> && TARGET_oxnas [=n]
  β”‚   - TARGET_oxnas_ox820 [=n] && <choice> && TARGET_oxnas [=n]
  β”‚   - TARGET_qoriq_generic [=n] && <choice> && TARGET_qoriq [=n]
  β”‚   - TARGET_ramips_mt7621 [=n] && <choice> && TARGET_ramips [=y]
  ...

This is because the mt76x8 does not enable RTC_SUPPORT, this is my PR.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.