Enabling PWM for L4T 21.3 - Grinch Kernel 21.3.4

Hi everyone, I’m trying to enable the pwm output on my Jetson Tk1 but I’m running into some problem. FYI, I’m a new to all of this and I’m just trying to learn so go easy on me. Anyway, i have read the tutorial on http://elinux.org/Jetson/PWM#PWM_in_L4T_rel21 about applying the patch in order to enable PWM0, PWM2, and PWM3 on L4T but I’m having trouble understanding the instruction and I need someone to elaborate on it for me. More specifically, the instruction ask me to use $git diff command but it gives me the following error:

Not a git repository
To compare two paths outside a working tree:
usage: git diff [–no-index]

Then I try the next command which is:
$ diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-jetson_tk1-gpio-pm375-0000-c00-00.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-jetson_tk1-gpio-pm375-0000-c00-00.dtsi

and it gives me this error:
diff: unrecognized option ‘–git’
diff: Try ‘diff --help’ for more information.

My question is how do I use git diff to apply the patch like mentioned http://elinux.org/Jetson/PWM#PWM_in_L4T_rel21? I don’t seem to know what is the exact command to type into Terminal and in what directory. Any help would be greatly appreciated.

“git diff” is a command used in a git repository/directory, and takes its information from that. Basically you would run this command from a directory that had been created by a git clone of somewhere in the outside world.

That leads to the truly difficult part…finding out which git repository you need to clone in order to have the same one that the article uses. Here is the general git root for web browsing, with the R21.3 release probably being what you want:

However, you may not need git to do this, as the code is from the R21 kernel. The kernel source is available directly from the R21.3 downloads page, “kernel sources” link:

The text that is given in the article like this is the same under a local patch file or under git:

--- a/arch/arm/boot/dts/tegra124-platforms/tegra124-jetson_tk1-gpio-pm375-0000-c00-00.dtsi
+++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-jetson_tk1-gpio-pm375-0000-c00-00.dtsi
@@ -36,10 +36,7 @@

If you know how diff/patch work, you could apply these edits by hand (I’m not recommending this). A diff file could also be created from this, and the patch command used to apply it instead of the git command. If you get the kernel source via git clone of one of those web addresses above, you could simply let git do the work. It’s worth looking at any short intro tutorial on git and/or patch before you do anything (which is recommended), basics won’t take long.