Jetson TK1 PWM output

At http://elinux.org/Jetson/GPIO#PWM_output it is said that one can play with PWM output via sysfs.

It says PWM_SYSFS option has to be enabled in kernel configuration.
However I can’t find such option in L4T 19.3.

Any clues about this?

I do not see CONFIG_PWM_SYSFS in my R19.3. There are a number of PWM options, just grep your kernel config file for PWM. I see these enabled already:

CONFIG_PWM
CONFIG_PWM_TEGRA
CONFIG_PWM_FAN
CONFIG_BACKLIGHT_PWM
CONFIG_BACKLIGHT_TEGRA_PWM

I’m thinking one of two things about CONFIG_PWM_SYSFS: (a) Something in a SYSFS config needs to be enabled for it to show up, or (b) it’s and older, deprecated feature my R19.3 does not have. Recursive grep of the entire source tree did not mention this config…but when that article was written, Jetson arrived on R19.2.

Looks like PWM_SYSFS was not in 3.10:
http://lxr.free-electrons.com/source/drivers/pwm/Kconfig?v=3.10

But is in 3.11:
http://lxr.free-electrons.com/source/drivers/pwm/Kconfig?v=3.11

It’s not mentioned in 19r3 kernel either (3.10.24) so it doesn’t seem to be backported there and I guess the wiki page is wrong then.

Not sure how big effort it would be to backport the patch.

Hum, that’s right. I guess that elinux.org page is referring to upstream/mainline linux kernel then. Thanks.

I’m trying to output a clock signal to a GPIO pin (actually CAM1_MCLK).
Can anyone tell me the easiest or/and the more correct way to do it?

i have question? which pin is configured as PWM output?

Maybe, none yet… Maybe one has configure something in device tree or pinmux…

But I guess it is possible since Tegra K1 has 4 PWM…

Ok thanks!

You guys can try using Santyago’s “Grinch” kernel, it already has CONFIG_PWM_SYSFS and a bunch of other useful things added to the kernel, that we will probably add to the official L4T kernel eventually: https://devtalk.nvidia.com/default/topic/766303/embedded-systems/-customkernel-grinch-19-3-1-for-jetson-tk1/

NVIDIA has verified earlier that PWM works on Jetson TK1, but CONFIG_PWM_SYSFS is disabled by default. The PWM pins don’t get assigned to other functions by default, so enabling CONFIG_PWM_SYSFS is a perfectly safe thing to do, and thus we will enable it in future versions of L4T now that we realize it should have been enabled.

(I’m sure you guys have noticed that many features are disabled in L4T by default when they could have been enabled, such as PWM, Wifi, Bluetooth, etc. Basically, the L4T team had to get the kernel ready for Jetson TK1 as soon as possible and thus disabled anything not required for aerly release. Now that the early releases are done, they are ready to start considering which Linux features to start adding back to L4T. Santyago’s Grinch kernel actually looks like a good list of features we will add to L4T after we have done tests to ensure they don’t cause instabilities, etc)

PS: If you guys weren’t already aware, there is some PWM documentation in the kernel file “Documentation/ABI/testing/sysfs-class-pwm”

Hi,

I am new to Tegra board bring up; by all trial and error, I am able to bring up the board with Kernel L4T 21.4

We have enabled the SPI by going through http://neurorobotictech.com/Community/Blog/tabid/184/ID/13/Using-the-Jetson-TK1-SPI–Part-3-Configuring-SPI-in-the-device-tree.aspx

I tried to to enable the pwm modules by looking at the examples and removing the GPIO pins as well us adding the pinmux pwm0, pwm2 and pwm3 as told in http://elinux.org/Jetson/PWM

I also tried to run “cat /sys/kernel/debug/pwm”

platfor/tegra-pwm, 4 PWM devices
pwm-0 (sysfs ): requested enabled
pwm-1 (pwm-backlight ): requested
pwm-2 ((null) ):
pwm-3 ((null) ):

however when I connect scope on pin 49 in J3A2; I do not see any wave form

Please help me to figure this out.

Thanks in Advance

Regards,
Abdur