TX2 build-in kernel compile error

Hello

I am trying to connect a MIPI-CSI2 custom camera to a Jetson TX2 board.

Based on the ov5693 camera driver source, I created custom driver code.

An error occurred during the built-in compilation of the nvidia LT4 32.3.1 kernel source, which prevents the image file from being created.

I compiled in the following order.

1. Create device driver in kernel_build / pulbic_sources / kernel / nvidia / drivers / media / i2c folder
2. Create header files
in kernel_build/public_sources/kernel/nvidia/include/media
in kernel_build/public_sources/kernel/nvidia/include/trace/events/
in kernel_build/public_sources/kernel/nvidia/include/uapi/media/
3. Modified files in Makefile , Kconfig ( kernel_build/pulbic_sources/kernel/nvidia/drivers/media/i2c )
insert code " obj-$(CONFIG_VIDEO_S5K5E8) += s5k5e8.o " in Makefile
insert code
" config VIDEO_S5K5E8
tristate “S5K5E8 camera sensor support”
depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
—help—
This is a Video4Linux2 sensor-level driver for the Samsung S5K5E8 camera.
To compile this driver as a module, choose M here: the module will be called S5K5E8 "

4. make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT menuconfig
Device Drivers
-> NVIDIA overlay Encoders, decoders, sensors and other helper chips -->
-> s5k5e8 camera sensor support (biult-in check)

5. make -C kernel/kernel-4.9/ ARCH=arm64 O=KERNEL_OUT CROSS_COMPILE={CROSS_COMPILE} -j2 Image

An error occurred as shown below.

drivers/media/i2c/built-in.o: In function `max9296_setup_control':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:311: multiple definition of `max9296_setup_control'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:311: first defined here
drivers/media/i2c/built-in.o: In function `imx185_read_reg':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx185.c:154: multiple definition of `__tracepoint_ov5693_s_stream'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/drivers/media/cec-edid.c:49: first defined here
drivers/media/i2c/built-in.o: In function `__gpio_set_value':
/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/include/asm-generic/gpio.h:112: multiple definition of `max9296_of_match'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx274.c:1169: first defined here
drivers/media/i2c/built-in.o: In function `imx274_debugfs_streaming_write':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx274.c:1176: multiple definition of `max9295_of_match'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx274.c:523: first defined here
drivers/media/i2c/built-in.o: In function `max9295_setup_control':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:277: multiple definition of `max9295_setup_control'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:277: first defined here
drivers/media/i2c/built-in.o: In function `max9296_power_off':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:250: multiple definition of `max9296_power_off'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:250: first defined here
drivers/media/i2c/built-in.o: In function `max9295_setup_streaming':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:142: multiple definition of `max9295_setup_streaming'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:142: first defined here
drivers/media/i2c/built-in.o: In function `max9296_sdev_unregister':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:442: multiple definition of `max9296_sdev_unregister'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:442: first defined here
drivers/media/i2c/built-in.o: In function `max9296_reset_control':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:346: multiple definition of `max9296_reset_control'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:346: first defined here
drivers/media/i2c/built-in.o: In function `max9295_reset_control':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:370: multiple definition of `max9295_reset_control'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:370: first defined here
drivers/media/i2c/built-in.o: In function `imx185_read_reg':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx185.c:146: multiple definition of `__tracepoint_imx185_s_stream'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/drivers/media/cec-edid.c:33: first defined here
drivers/media/i2c/built-in.o: In function `max9296_power_on':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:209: multiple definition of `max9296_power_on'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:209: first defined here
drivers/media/i2c/built-in.o: In function `max9296_start_streaming':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:616: multiple definition of `max9296_start_streaming'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:616: first defined here
drivers/media/i2c/built-in.o: In function `max9295_sdev_pair':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:396: multiple definition of `max9295_sdev_pair'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:396: first defined here
drivers/media/i2c/built-in.o: In function `perf_trace_imx185_s_stream':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/include/trace/events/imx185.h:24: multiple definition of `__tracepoint_s5k5e8_s_stream'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/drivers/media/cec-edid.c:70: first defined here
drivers/media/i2c/built-in.o: In function `max9296_sdev_register':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:373: multiple definition of `max9296_sdev_register'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:373: first defined here
drivers/media/i2c/built-in.o: In function `max9296_setup_streaming':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:671: multiple definition of `max9296_setup_streaming'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:671: first defined here
drivers/media/i2c/built-in.o: In function `max9296_setup_link':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:270: multiple definition of `max9296_setup_link'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:270: first defined here
drivers/media/i2c/built-in.o: In function `max9295_sdev_unpair':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:424: multiple definition of `max9295_sdev_unpair'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:424: first defined here
drivers/media/i2c/built-in.o: In function `max9296_stop_streaming':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:643: multiple definition of `max9296_stop_streaming'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:643: first defined here
drivers/media/i2c/built-in.o: In function `trace_event_get_offsets_imx185_s_stream':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/include/trace/events/imx185.h:24: multiple definition of `__tracepoint_ov23850_s_stream'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/drivers/media/cec-edid.c:56: first defined here
drivers/media/i2c/built-in.o: In function `imx274_parse_dt':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx274.c:931: multiple definition of `imx390_of_match'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx274.c:869: first defined here
/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/scripts/Makefile.build:509: recipe for target 'drivers/built-in.o' failed
make[2]: *** [drivers/built-in.o] Error 1
/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/Makefile:1104: recipe for target 'drivers' failed
make[1]: *** [drivers] Error 2
make[1]: Leaving directory '/home/jpchae/kernel_32.1/public_sources/build'
Makefile:171: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
make: Leaving directory '/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9'

Please good advise.

Not directly related to the error, but before you start, did you copy an existing “.config” to the “$KERNEL_OUT” location, followed by the “make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT menuconfig”?

I ask because even if you configured the one new driver in menuconfig you would still need a lot of other configurations. If for example you used an “_defconfig” first, or if you copied/gunzipped/renamed the running system’s “/proc/config.gz”, then this would correctly set up configuration prior to the menuconfig. If this was not set up, then it is possible the error is completely unrelated to your work.

Hi linuxdev,

After using the “tegar_defconfig” command below, I made an additional selection of new device drivers in menuconfig.

“make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT tegra_defconfig”


After creating a .config file using the “tegar_defconfig” command,
I didn’t use the menuconfig command and when I manually add a new driver in the .config file,
I get an error like also the terminal message below.

As Terminal message as shown below.

jpchae@ubuntu:~/kernel_32.1/public_sources$ JETSON_TX2_KERNEL_SOURCE=$(pwd)
jpchae@ubuntu:~/kernel_32.1/public_sources$ CROSS_COMPILE=$HOME/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
jpchae@ubuntu:~/kernel_32.1/public_sources$ KERNEL_OUT=$JETSON_TX2_KERNEL_SOURCE/build 
jpchae@ubuntu:~/kernel_32.1/public_sources$ KERNEL_MODULES_OUT=$JETSON_TX2_KERNEL_SOURCE/modules 
jpchae@ubuntu:~/kernel_32.1/public_sources$ make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT tegra_defconfig 
make: Entering directory '/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9'
make[1]: Entering directory '/home/jpchae/kernel_32.1/public_sources/build'
  GEN     ./Makefile
#
# configuration written to .config
#
make[1]: Leaving directory '/home/jpchae/kernel_32.1/public_sources/build'
make: Leaving directory '/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9'
jpchae@ubuntu:~/kernel_32.1/public_sources$ make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT menuconfig
make: Entering directory '/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9'
make[1]: Entering directory '/home/jpchae/kernel_32.1/public_sources/build'
  GEN     ./Makefile
scripts/kconfig/mconf  Kconfig


*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

make[1]: Leaving directory '/home/jpchae/kernel_32.1/public_sources/build'
make: Leaving directory '/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9'
jpchae@ubuntu:~/kernel_32.1/public_sources$ make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j2 Image 
make: Entering directory '/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9'
make[1]: Entering directory '/home/jpchae/kernel_32.1/public_sources/build'
  GEN     ./Makefile
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  GEN     ./Makefile
  CHK     include/generated/uapi/linux/version.h
  Using /home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9 as source for kernel
  CHK     include/generated/utsrelease.h
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    /home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC      kernel/module.o
  GZIP    kernel/config_data.gz
  CHK     kernel/config_data.h
  UPD     kernel/config_data.h
  CC      kernel/configs.o
  LD      kernel/built-in.o
  LD      drivers/media/i2c/built-in.o
  LD      drivers/media/i2c/built-in.o
  LD      drivers/media/built-in.o
  LD      drivers/built-in.o
drivers/media/i2c/built-in.o: In function `max9296_setup_control':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:311: multiple definition of `max9296_setup_control'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:311: first defined here
drivers/media/i2c/built-in.o: In function `imx185_read_reg':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx185.c:154: multiple definition of `__tracepoint_ov5693_s_stream'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/drivers/media/cec-edid.c:49: first defined here
drivers/media/i2c/built-in.o: In function `__gpio_set_value':
/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/include/asm-generic/gpio.h:112: multiple definition of `max9296_of_match'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx274.c:1169: first defined here
drivers/media/i2c/built-in.o: In function `imx274_debugfs_streaming_write':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx274.c:1176: multiple definition of `max9295_of_match'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx274.c:523: first defined here
drivers/media/i2c/built-in.o: In function `max9295_setup_control':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:277: multiple definition of `max9295_setup_control'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:277: first defined here
drivers/media/i2c/built-in.o: In function `max9296_power_off':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:250: multiple definition of `max9296_power_off'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:250: first defined here
drivers/media/i2c/built-in.o: In function `max9295_setup_streaming':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:142: multiple definition of `max9295_setup_streaming'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:142: first defined here
drivers/media/i2c/built-in.o: In function `max9296_sdev_unregister':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:442: multiple definition of `max9296_sdev_unregister'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:442: first defined here
drivers/media/i2c/built-in.o: In function `max9296_reset_control':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:346: multiple definition of `max9296_reset_control'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:346: first defined here
drivers/media/i2c/built-in.o: In function `max9295_reset_control':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:370: multiple definition of `max9295_reset_control'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:370: first defined here
drivers/media/i2c/built-in.o: In function `imx185_read_reg':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx185.c:146: multiple definition of `__tracepoint_imx185_s_stream'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/drivers/media/cec-edid.c:33: first defined here
drivers/media/i2c/built-in.o: In function `max9296_power_on':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:209: multiple definition of `max9296_power_on'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:209: first defined here
drivers/media/i2c/built-in.o: In function `max9296_start_streaming':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:616: multiple definition of `max9296_start_streaming'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:616: first defined here
drivers/media/i2c/built-in.o: In function `max9295_sdev_pair':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:396: multiple definition of `max9295_sdev_pair'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:396: first defined here
drivers/media/i2c/built-in.o: In function `perf_trace_imx185_s_stream':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/include/trace/events/imx185.h:24: multiple definition of `__tracepoint_s5k5e8_s_stream'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/drivers/media/cec-edid.c:70: first defined here
drivers/media/i2c/built-in.o: In function `max9296_sdev_register':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:373: multiple definition of `max9296_sdev_register'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:373: first defined here
drivers/media/i2c/built-in.o: In function `max9296_setup_streaming':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:671: multiple definition of `max9296_setup_streaming'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:671: first defined here
drivers/media/i2c/built-in.o: In function `max9296_setup_link':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:270: multiple definition of `max9296_setup_link'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:270: first defined here
drivers/media/i2c/built-in.o: In function `max9295_sdev_unpair':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:424: multiple definition of `max9295_sdev_unpair'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9295.c:424: first defined here
drivers/media/i2c/built-in.o: In function `max9296_stop_streaming':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:643: multiple definition of `max9296_stop_streaming'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/max9296.c:643: first defined here
drivers/media/i2c/built-in.o: In function `trace_event_get_offsets_imx185_s_stream':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/include/trace/events/imx185.h:24: multiple definition of `__tracepoint_ov23850_s_stream'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/drivers/media/cec-edid.c:56: first defined here
drivers/media/i2c/built-in.o: In function `imx274_parse_dt':
/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx274.c:931: multiple definition of `imx390_of_match'
drivers/media/built-in.o:/home/jpchae/kernel_32.1/public_sources/kernel/nvidia/drivers/media/i2c/imx274.c:869: first defined here
/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/scripts/Makefile.build:509: recipe for target 'drivers/built-in.o' failed
make[2]: *** [drivers/built-in.o] Error 1
/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9/Makefile:1104: recipe for target 'drivers' failed
make[1]: *** [drivers] Error 2
make[1]: Leaving directory '/home/jpchae/kernel_32.1/public_sources/build'
Makefile:171: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
make: Leaving directory '/home/jpchae/kernel_32.1/public_sources/kernel/kernel-4.9'

Please check reply.

Let me know what should i modify it.

I cannot say specifically where the issue is, but this excerpt is key to the problem:

drivers/media/i2c/max9296.c:311: <b>multiple definition of `max9296_setup_control</b>'

There appears to be some places where code is mistakenly being introduced twice. An example would be that if you were creating a modification of a driver which is to replace a different driver, and the original driver and the modified driver both provided some function, then this would be an error. As a contrived example, if your additions to Kconfig were to add a new driver, but the original was still being built, then this is one way the definition might be introduced incorrectly in two places. Is the original still configured to compile?

Sometimes header guards are also needed. For cases where code is split up and included in multiple other files (in other words there is no other source code in conflict, but the given code might be in more than one place), a header guard will prevent second occurrences of the file from appearing more than once. Perhaps it just needs a header guard.

You may have to resolve each of the multiple definitions individually. The error output will tell you which files see the same code and in the order of appearance during the compile, so you will at least have a check list.

Hi linuxdev,

as your advise,
I was modified custom device driver code.

I comment out of function code for removing multiple definition error.
but error was not fixed.

[b]so i edited menuconfig device drivers > NVIDIA overlay Encoders, decorders, snesors and other helper chips.

I checked excluded about LC898212 focuser support, OmniVision OV23850 sensor support, MAX9295 Serializer I2C IO Expender, MAX9296 Deserializer I2C IO Expander. [/b]

this case is compile done.

Is there any problem excluded the above devices?

I have no knowledge of the specific devices. One of the nice parts about changing a config for the actual in-tree kernel source with the config editor tools is that it takes care of all of those dependencies. In the case of building out of tree content, or custom content, you will probably have to have first hand knowledge of what other kernel features are required.

Someone from NVIDIA may be able to answer what will be missing if those particular NVIDIA features are excluded. Some of those features may only matter to specific optional hardware you are not using, but I have no way to answer if this is the case.

For the kernel build problem. I would suggest to follow to build the original source first and then add your code to make it easy debug the build error.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fkernel_custom.html

Thank you for your advise !

as your advise. I was setup compile environment step by step.
I solved build error. source version was mixed. so I cleaned up. I built up l4t.32.3.1 .

I am testing with ov5693 device driver modified little by default.
but pwdn-gpios , reset-gpios is not working.
I measured oscilloscope about these gpios. but it is not change level.
device code was passed correlty by checking debugging log message.
ov5693_gpio_set(s_data, pw->pwdn_gpio, 1); on ov5693_power_on function.
device tree is not modified.

ov5693 device tree file is removed.

and then i tested manual gpio setup as shown below.

these gpios were goog working by manual setup command.

jpchae@jpchae-desktop:/sys/class/gpio$ ls
export       gpiochip224  gpiochip256  unexport
gpiochip216  gpiochip240  gpiochip320
jpchae@jpchae-desktop:/sys/class/gpio$ echo 461 > export
jpchae@jpchae-desktop:/sys/class/gpio$ cd gpio461
jpchae@jpchae-desktop:/sys/class/gpio/gpio461$ echo "out" > direction
jpchae@jpchae-desktop:/sys/class/gpio/gpio461$ echo 1 > value 
jpchae@jpchae-desktop:/sys/class/gpio/gpio461$ echo 0 > value 
jpchae@jpchae-desktop:/sys/class/gpio/gpio461$ echo 1 > value 
jpchae@jpchae-desktop:/sys/class/gpio/gpio461$ echo 0 > value 
jpchae@jpchae-desktop:/sys/class/gpio/gpio461$ cd ..
jpchae@jpchae-desktop:/sys/class/gpio$ echo 456 > export
jpchae@jpchae-desktop:/sys/class/gpio$ cd gpio456 
jpchae@jpchae-desktop:/sys/class/gpio/gpio456$ echo "out" > direction
jpchae@jpchae-desktop:/sys/class/gpio/gpio456$ echo 1 > value
jpchae@jpchae-desktop:/sys/class/gpio/gpio456$ echo 0 > value

I solved problem.

**The power off function call was executed in the ov5693_power_on function, **
so gpio was always at a low level.