If you’ve flashed from Linux with SDK Manager you will have a “Linux_for_Tegra/” subdirectory. Within this will be the script “source_sync.sh”. One way of downloading the kernel source (both in and out of tree content) for release R32.1:
./source_sync.sh -k tegra-l4t-r32.1
…the “sources/” subdirectory will contain the content. Within “sources/” the “edid.c” file is at:
./kernel/nvidia/drivers/video/tegra/dc/edid.c
Before you update the kernel you might save a copy of the existing configuration on the running Nano. Save a copy of “/proc/config.gz”. Once CONFIG_LOCALVERSION of this is edited to become “-tegra” that file is an exact match to the running system’s configuration. You’ll use the same configuration after making the edit. FYI, config.gz can be uncompressed, “gunzip config.gz”. This can be edited, and a copy added to the top level kernel source directory (placed in “kernel/kernel-4.9/” as name “.config”) before starting the kernel build.
Note: In some cases changing the base kernel code would imply wanting to change CONFIG_LOCALVERSION slightly. Probably it is ok in this case, and reusing the old modules should be fine as long as the code is not being put in a module. The kernel loads modules at “/lib/modules/$(uname -r)/”, and the suffix is what the CONFIG_LOCALVERSION is. If you change the base Image too much, then you’d change the CONFIG_LOCALVERSION, and as a consequence you’d also need to rebuild all of the modules and place them in the new location since “uname -r” would change. The old kernel could be left in place as alternate boot items to be selected by serial console during boot.