AD4112 Driver Integration on Toradex BSP 7 (Linux 6.6)

Hello,

I’m currently working on a Yocto-based distribution for my client (see tdx-info below), and I need to integrate the AD4112 using the driver provided by Analog Devices.

This driver is included in the mainline kernel starting from Linux 6.10, while Toradex BSP 7 uses Linux 6.6.

I’ve attempted to patch the kernel (linux-toradex) to include the driver, but I’m encountering many build errors while generating the image. This solution seems too complex and likely to result in an unstable distribution.

Do you know of a better way to integrate this driver?

Cheers,

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.101-7.4.0-devel #1 SMP PREEMPT Mon Sep  1 15:43:53 UTC 2025
Kernel command line:      root=PARTUUID=3626c516-02 ro rootwait console=tty1 console=ttymxc0,115200
Distro name:              NAME="TDX Wayland with XWayland" 
Distro version:           VERSION_ID=7.4.0-devel-20250919135608-build.0
Distro variant:           -
Hostname:                 verdin-imx8mm-15702486
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Mini WB on Verdin Development Board
Toradex version:          0055 V1.1F
Serial number:            15702486
Processor arch:           aarch64
------------------------------------------------------------

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


AD4112 Driver Integration Options

You’re correct that patching the kernel directly can be complex and error-prone. Here are better approaches for integrating the AD4112 driver:

Recommended Approach: Out-of-Tree Module

The cleanest solution is to create an out-of-tree kernel module recipe in your Yocto build. This approach:

  • Maintains kernel stability
  • Allows easier updates
  • Reduces build complexity

Alternative: Backport via Custom Recipe

Since you’re working with Toradex BSP 7 which uses Linux 6.6(1), you can create a custom recipe that backports the AD4112 driver from Linux 6.10 to your current kernel version.

Using Toradex BSP Infrastructure

Toradex provides production-quality BSP layers that are fully Yocto Project-compatible(2). The Toradex BSP infrastructure includes:

  • meta-toradex-bsp-common: BSP layer common to all Toradex computer on modules(3)
  • toradex-manifest: The Repo manifest containing all layers used by the Toradex BSP(3)

Implementation Steps

  1. Create a custom meta layer following the Custom meta layers, recipes and images in Yocto Project guide(2)

  2. Add kernel module recipe in your custom layer to build the AD4112 driver as an external module

  3. Use the standard Yocto workflow:

    • Install prerequisites and configure git(2)
    • Download repositories using the Repo tool(2)
    • Export the environment setup script(2)
    • Setup your machine for Verdin iMX8M Mini(2)
    • Use bitbake to build the image(2)

Additional Resources

For complex driver integration, consider consulting Toradex’s service partners that may do Yocto customization(2) if you need professional assistance.

This approach will give you a stable, maintainable solution while leveraging Toradex’s production-quality BSP infrastructure(4).

Best regards, Toradex AI Assistant.

Dear @nantraygues,

Your method seems like a valid option in my opinion. Would you be able to share some logs, so that we can have a look into what build errors you are encountering?
What could further help us in this investigation would be your recipe and perhaps your layer as well.

Best regards,
Collin

Dear @collin.tx ,

Thanks for your awnser.

Here’s my log while i’m building my image.

ERROR: linux-toradex-6.6.101+git-r0 do_compile_kernelmodules: oe_runmake failed
ERROR: linux-toradex-6.6.101+git-r0 do_compile_kernelmodules: ExecutionError('/yocto/build/tmp/work/verdin_imx8mm-tdx-linux/linux-toradex/6.6.101+git/temp/run.do_compile_kernelmodules.114842', 1, None, None)
ERROR: Logfile of failure stored in: /yocto/build/tmp/work/verdin_imx8mm-tdx-linux/linux-toradex/6.6.101+git/temp/log.do_compile_kernelmodules.114842



|   CC [M]  drivers/media/platform/verisilicon/hantro_g2.o
| In file included from /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:38:
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c: In function 'ad4111_openwire_event':
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:470:53: error: 'IIO_EV_TYPE_FAULT' undeclared (first use in this function); did you mean 'IIO_EV_TYPE_MAG'?
|   470 |                                                     IIO_EV_TYPE_FAULT, IIO_EV_DIR_FAULT_OPENWIRE),
|       |                                                     ^~~~~~~~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/include/linux/iio/events.h:26:16: note: in definition of macro 'IIO_EVENT_CODE'
|    26 |         (((u64)type << 56) | ((u64)diff << 55) |                        \
|       |                ^~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:469:32: note: in expansion of macro 'IIO_UNMOD_EVENT_CODE'
|   469 |                                IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, chan->address,
|       |                                ^~~~~~~~~~~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:470:53: note: each undeclared identifier is reported only once for each function it appears in
|   470 |                                                     IIO_EV_TYPE_FAULT, IIO_EV_DIR_FAULT_OPENWIRE),
|       |                                                     ^~~~~~~~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/include/linux/iio/events.h:26:16: note: in definition of macro 'IIO_EVENT_CODE'
|    26 |         (((u64)type << 56) | ((u64)diff << 55) |                        \
|       |                ^~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:469:32: note: in expansion of macro 'IIO_UNMOD_EVENT_CODE'
|   469 |                                IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, chan->address,
|       |                                ^~~~~~~~~~~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:470:72: error: 'IIO_EV_DIR_FAULT_OPENWIRE' undeclared (first use in this function)
|   470 |                                                     IIO_EV_TYPE_FAULT, IIO_EV_DIR_FAULT_OPENWIRE),
|       |                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/include/linux/iio/events.h:27:16: note: in definition of macro 'IIO_EVENT_CODE'
|    27 |          ((u64)direction << 48) | ((u64)modifier << 40) |               \
|       |                ^~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:469:32: note: in expansion of macro 'IIO_UNMOD_EVENT_CODE'
|   469 |                                IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE, chan->address,
|       |                                ^~~~~~~~~~~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c: At top level:
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:753:10: error: 'const struct ad_sigma_delta_info' has no member named 'disable_one'; did you mean 'disable_all'?
|   753 |         .disable_one = ad7173_disable_one,
|       |          ^~~~~~~~~~~
|       |          disable_all
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:756:10: error: 'const struct ad_sigma_delta_info' has no member named 'has_named_irqs'
|   756 |         .has_named_irqs = true,
|       |          ^~~~~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:761:10: error: 'const struct ad_sigma_delta_info' has no member named 'num_resetclks'
|   761 |         .num_resetclks = 64,
|       |          ^~~~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:769:10: error: 'const struct ad_sigma_delta_info' has no member named 'disable_one'; did you mean 'disable_all'?
|   769 |         .disable_one = ad7173_disable_one,
|       |          ^~~~~~~~~~~
|       |          disable_all
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:772:10: error: 'const struct ad_sigma_delta_info' has no member named 'has_named_irqs'
|   772 |         .has_named_irqs = true,
|       |          ^~~~~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:777:10: error: 'const struct ad_sigma_delta_info' has no member named 'num_resetclks'
|   777 |         .num_resetclks = 64,
|       |          ^~~~~~~~~~~~~
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_tl_reader.o
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c: In function 'ad7173_write_event_config':
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1268:14: error: 'IIO_EV_TYPE_FAULT' undeclared (first use in this function); did you mean 'IIO_EV_TYPE_MAG'?
|  1268 |         case IIO_EV_TYPE_FAULT:
|       |              ^~~~~~~~~~~~~~~~~
|       |              IIO_EV_TYPE_MAG
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c: In function 'ad7173_read_event_config':
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1285:14: error: 'IIO_EV_TYPE_FAULT' undeclared (first use in this function); did you mean 'IIO_EV_TYPE_MAG'?
|  1285 |         case IIO_EV_TYPE_FAULT:
|       |              ^~~~~~~~~~~~~~~~~
|       |              IIO_EV_TYPE_MAG
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c: At top level:
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1294:25: error: 'IIO_EV_TYPE_FAULT' undeclared here (not in a function); did you mean 'IIO_EV_TYPE_MAG'?
|  1294 |                 .type = IIO_EV_TYPE_FAULT,
|       |                         ^~~~~~~~~~~~~~~~~
|       |                         IIO_EV_TYPE_MAG
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1295:24: error: 'IIO_EV_DIR_FAULT_OPENWIRE' undeclared here (not in a function)
|  1295 |                 .dir = IIO_EV_DIR_FAULT_OPENWIRE,
|       |                        ^~~~~~~~~~~~~~~~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1311:21: error: variable 'ad4113_scan_type' has initializer but incomplete type
|  1311 | static const struct iio_scan_type ad4113_scan_type = {
|       |                     ^~~~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1312:10: error: 'const struct iio_scan_type' has no member named 'sign'
|  1312 |         .sign = 'u',
|       |          ^~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1312:17: warning: excess elements in struct initializer
|  1312 |         .sign = 'u',
|       |                 ^~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1312:17: note: (near initialization for 'ad4113_scan_type')
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1313:10: error: 'const struct iio_scan_type' has no member named 'realbits'
|  1313 |         .realbits = 16,
|       |          ^~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1313:21: warning: excess elements in struct initializer
|  1313 |         .realbits = 16,
|       |                     ^~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1313:21: note: (near initialization for 'ad4113_scan_type')
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1314:10: error: 'const struct iio_scan_type' has no member named 'storagebits'
|  1314 |         .storagebits = 16,
|       |          ^~~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1314:24: warning: excess elements in struct initializer
|  1314 |         .storagebits = 16,
|       |                        ^~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1314:24: note: (near initialization for 'ad4113_scan_type')
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1315:10: error: 'const struct iio_scan_type' has no member named 'endianness'
|  1315 |         .endianness = IIO_BE,
|       |          ^~~~~~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1315:23: warning: excess elements in struct initializer
|  1315 |         .endianness = IIO_BE,
|       |                       ^~~~~~
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1315:23: note: (near initialization for 'ad4113_scan_type')
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c: In function 'ad7173_fw_parse_channel_config':
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1593:58: error: 'ad4113_scan_type' has an incomplete type 'const struct iio_scan_type'
|  1593 |                         chan_arr[chan_index].scan_type = ad4113_scan_type;
|       |                                                          ^~~~~~~~~~~~~~~~
|   CC [M]  drivers/remoteproc/ti_k3_r5_remoteproc.o
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1635:23: error: implicit declaration of function 'fwnode_property_match_property_string'; did you mean 'fwnode_property_match_string'? [-Werror=implicit-function-declaration]
|  1635 |                 ret = fwnode_property_match_property_string(child,
|       |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|       |                       fwnode_property_match_string
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1684:58: error: 'ad4113_scan_type' has an incomplete type 'const struct iio_scan_type'
|  1684 |                         chan_arr[chan_index].scan_type = ad4113_scan_type;
|       |                                                          ^~~~~~~~~~~~~~~~
|   CC [M]  drivers/perf/fsl_imx9_ddr_perf.o
|   CC [M]  drivers/iio/adc/imx93_adc.o
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c: In function 'ad7173_fw_parse_device_config':
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1721:15: error: implicit declaration of function 'device_property_match_property_string'; did you mean 'device_property_match_string'? [-Werror=implicit-function-declaration]
|  1721 |         ret = device_property_match_property_string(dev, "clock-names",
|       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|       |               device_property_match_string
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c: At top level:
| /yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/drivers/iio/adc/ad7173.c:1311:35: error: storage size of 'ad4113_scan_type' isn't known
|  1311 | static const struct iio_scan_type ad4113_scan_type = {
|       |                                   ^~~~~~~~~~~~~~~~
|   CC [M]  drivers/iio/adc/ti-ads1015.o
| cc1: some warnings being treated as errors
| make[5]: *** [/yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/scripts/Makefile.build:243: drivers/iio/adc/ad7173.o] Error 1
|   CC [M]  drivers/media/platform/imx8/mxc-mipi-csi2_yav.o
| make[5]: *** Waiting for unfinished jobs....
|   CC [M]  drivers/media/platform/verisilicon/hantro_g2_hevc_dec.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_heap_context_alloc.o
|   CC [M]  drivers/staging/media/imx/imx8-isi-m2m.o
|   CC [M]  drivers/iio/buffer/industrialio-triggered-buffer.o
|   CC [M]  drivers/media/platform/mxc/capture/mx6s_capture.o
|   CC [M]  drivers/crypto/caam/key_gen.o
|   CC [M]  drivers/media/platform/verisilicon/hantro_g2_vp9_dec.o
|   CC [M]  drivers/media/platform/verisilicon/rockchip_vpu2_hw_jpeg_enc.o
| make[4]: *** [/yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/scripts/Makefile.build:480: drivers/iio/adc] Error 2
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_reset_gpu.o
| make[4]: *** Waiting for unfinished jobs....
|   CC [M]  drivers/media/platform/mxc/capture/mxc_mipi_csi.o
|   CC [M]  drivers/nvmem/imx-ocotp-ele.o
|   CC [M]  drivers/staging/media/imx/imx8-isi-hw.o
|   CC [M]  drivers/iio/buffer/kfifo_buf.o
|   CC [M]  drivers/crypto/caam/tag_object.o
|   CC [M]  drivers/staging/media/imx/gmsl-max9286.o
|   CC [M]  drivers/mux/gpio.o
|   CC [M]  drivers/nvmem/imx-ocotp-scu.o
|   CC [M]  drivers/staging/media/imx/imx8-media-dev.o
|   CC [M]  drivers/interconnect/imx/imx8mm.o
|   CC [M]  drivers/media/platform/mxc/capture/ov5640_mipi_v2.o
|   LD [M]  drivers/mux/mux-gpio.o
|   CC [M]  drivers/staging/media/imx/imx8-parallel-csi.o
|   CC [M]  drivers/crypto/caam/caamkeyblob.o
| make[3]: *** [/yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/scripts/Makefile.build:480: drivers/iio] Error 2
| make[3]: *** Waiting for unfinished jobs....
|   CC [M]  drivers/media/platform/verisilicon/rockchip_vpu2_hw_h264_dec.o
|   CC [M]  drivers/nvmem/snvs_lpgpr.o
|   CC [M]  drivers/interconnect/imx/imx8mp.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_csg.o
|   CC [M]  drivers/crypto/caam/caamkeygen.o
|   LD [M]  drivers/interconnect/imx/imx8mm-interconnect.o
|   LD [M]  drivers/nvmem/nvmem-imx-ocotp-ele.o
|   CC [M]  drivers/media/platform/verisilicon/rockchip_vpu2_hw_mpeg2_dec.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_csg_debugfs.o
|   LD [M]  drivers/interconnect/imx/imx8mp-interconnect.o
|   CC [M]  drivers/crypto/caam/caamalg.o
|   LD [M]  drivers/nvmem/nvmem-imx-ocotp-scu.o
|   LD [M]  drivers/nvmem/nvmem_snvs_lpgpr.o
|   CC [M]  drivers/media/platform/verisilicon/rockchip_vpu2_hw_vp8_dec.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_kcpu_debugfs.o
|   CC [M]  drivers/crypto/caam/caamhash.o
|   LD [M]  drivers/media/platform/mxc/capture/ov5640_camera_mipi_v2.o
|   CC [M]  drivers/crypto/caam/caamrng.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_sync.o
|   LD [M]  drivers/staging/media/imx/imx8-capture.o
|   LD [M]  drivers/staging/media/imx/imx8-isi-capture.o
|   LD [M]  drivers/staging/media/imx/imx8-isi-mem2mem.o
|   CC [M]  drivers/crypto/caam/caamprng.o
|   CC [M]  drivers/crypto/caam/caampkc.o
|   CC [M]  drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_sync_debugfs.o
|   CC [M]  drivers/media/platform/verisilicon/rockchip_av1_filmgrain.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_kcpu_fence_debugfs.o
|   CC [M]  drivers/media/platform/verisilicon/rockchip_av1_entropymode.o
|   CC [M]  drivers/crypto/caam/pkc_desc.o
|   CC [M]  drivers/media/platform/verisilicon/hantro_jpeg.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_protected_memory.o
|   CC [M]  drivers/media/platform/verisilicon/hantro_h264.o
|   CC [M]  drivers/crypto/caam/sm_store.o
|   CC [M]  drivers/media/platform/verisilicon/hantro_hevc.o
|   CC [M]  drivers/crypto/caam/caamalg_desc.o
|   CC [M]  drivers/media/platform/verisilicon/hantro_mpeg2.o
|   CC [M]  drivers/crypto/caam/caamhash_desc.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_tiler_heap_debugfs.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_cpu_queue.o
|   CC [M]  drivers/media/platform/verisilicon/hantro_vp8.o
|   CC [M]  drivers/crypto/caam/caamkeyblob_desc.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_cpu_queue_debugfs.o
|   CC [M]  drivers/media/platform/verisilicon/hantro_vp9.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_event.o
|   CC [M]  drivers/media/platform/verisilicon/imx8m_vpu_hw.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_firmware_log.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_firmware_core_dump.o
|   LD [M]  drivers/crypto/caam/caam.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_tiler_heap_reclaim.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_mcu_shared_reg.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_firmware.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_csf_fw_io.o
|   CC [M]  drivers/gpu/arm/midgard/csf/mali_kbase_debug_csf_fault.o
|   LD [M]  drivers/crypto/caam/caam_jr.o
|   CC [M]  drivers/gpu/arm/midgard/csf/ipa_control/mali_kbase_csf_ipa_control.o
|   CC [M]  drivers/gpu/arm/midgard/ipa/mali_kbase_ipa_simple.o
|   CC [M]  drivers/gpu/arm/midgard/ipa/mali_kbase_ipa.o
|   CC [M]  drivers/gpu/arm/midgard/ipa/mali_kbase_ipa_debugfs.o
|   CC [M]  drivers/gpu/arm/midgard/ipa/backend/mali_kbase_ipa_counter_csf.o
|   CC [M]  drivers/gpu/arm/midgard/ipa/backend/mali_kbase_ipa_counter_common_csf.o
|   LD [M]  drivers/media/platform/verisilicon/hantro-vpu.o
|   LD [M]  drivers/gpu/arm/midgard/mali_kbase.o
| make[2]: *** [/yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/scripts/Makefile.build:480: drivers] Error 2
| make[1]: *** [/yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/Makefile:1924: .] Error 2
| make: *** [/yocto/build/tmp/work-shared/verdin-imx8mm/kernel-source/Makefile:234: __sub-make] Error 2
| make: Leaving directory '/yocto/build/tmp/work/verdin_imx8mm-tdx-linux/linux-toradex/6.6.101+git/build'
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.

Regards,

Nicolas.

Dear @nantraygues,

Thank you for sharing the logs. It indeed looks like the issue is the backport of the AD4112 driver (in the Linux 6.10 kernel) to AD7173, which relies on kernel structures and defines in version 6.6. The suggestion made by @ToradexAI seems like the most valid solution to me. Creating an out of tree driver for AD4112 could be a good idea. This might however not necessarily be as trivial as expected, unless Analog Devices provides a driver targeting Kernel version 6.6. Should only drivers supported by 6.10 be available, you will likely have to make driver modifications.

Should you be interested in going down this route, we would be glad to connect you to one of our partners, who could aid you in this endeavor.

Best regards,
Collin

Analysis of Build Errors and Recommended Solution

Based on the error logs you’ve shared, the compilation failures are occurring because you’re trying to backport the AD4112 driver from Linux 6.10 to the Linux 6.6 kernel used in Toradex BSP 7. The errors indicate missing kernel structures and definitions:

Key Issues Identified

  1. Missing IIO event types: IIO_EV_TYPE_FAULT and IIO_EV_DIR_FAULT_OPENWIRE are not defined in Linux 6.6 (1)
  2. Structure incompatibilities: The ad_sigma_delta_info structure lacks members like disable_one, has_named_irqs, and num_resetclks (1)
  3. Function changes: Functions like fwnode_property_match_property_string don’t exist in the 6.6 kernel API (1)

Recommended Solution: Out-of-Tree Kernel Module

Given the complexity of backporting, I recommend building the AD4112 driver as an external kernel module using TorizonCore Builder. This approach provides better stability and maintainability (2).

Implementation Steps

Option 1: Using TorizonCore Builder (Recommended for Torizon)

If you’re using Torizon OS, you can build external kernel modules with TorizonCore Builder (2):

  1. Organize your kernel module source into a single directory with at least one C source file and a Makefile (2)

  2. Create a proper Makefile that includes the required environment variables (2):

obj-m := ad4112.o

SRC := $(shell pwd)

all:
	$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules

clean:
	$(MAKE) -C $(KERNEL_SRC) M=$(SRC) clean

(2)

  1. Use a configuration YAML file for building:
# Sample configuration file:
input:
  easy-installer:
    local: images/torizon-core-docker-verdin-imx8mm-Tezi_7.x.x.tar
customization:
  kernel:
    modules:
      - source-dir: ad4112-module/
        autoload: yes
output:
  easy-installer:
    local: torizon-core-docker-verdin-imx8mm-Tezi_7.x.x.CUSTOM

(2)

  1. Build the custom image:
$ torizoncore-builder build

(2)

Option 2: Using Yocto BSP (For Custom Yocto Builds)

For your Yocto-based distribution, create a custom kernel module recipe (3):

  1. Create a custom meta layer following Toradex guidelines (3)
  2. Add a kernel module recipe that builds the AD4112 driver as an external module (3)
  3. Ensure your custom layers are version controlled by Git as required by Torizon OS (3)

Additional Considerations

  • Driver Adaptation: You’ll likely need to modify the AD4112 driver to be compatible with Linux 6.6 APIs
  • Professional Support: Consider engaging with Toradex service partners who specialize in Yocto customization for complex driver integrations

This approach avoids the kernel patching complexities you encountered while providing a stable, maintainable solution for integrating the AD4112 driver.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.