/sys/class/pwm/export and numbering

Hi,

I’m using a BeagleBone RevA6 with the latest Angstrom (as of a few days ago at least).

I’m able to get pwm pins up and running via the capemgr and the helpful dts files for the various pwms in the /lib/firmware dir. I can echo various duty and period values into the corresponding /sys/devices/ocp.2/pwm_test_PX_YY.ZZ/{duty,period} files and control servos. This all seems fine.

I understand that for gpios there are 32 gpios per chip, so gpio 1[18] = (1 * 32) + 18 = 50, and that seems to work. Is there some corresponding relationship for pwms?

-P

Paul,

This link explains how sysfs works with the PWM driver:

http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/pwm.txt#n48

The PWM chip and channel number are determined by the device tree. If you ‘cat /sys/kernel/debug/pwm’, do you see PWM_P9_14 listed? More information:

http://hipstercircuits.com/enable-pwm-on-beaglebone-with-device-tree-overlays/