How to enable generic sysfs-pwm interface through device tree overlays?

Bodo Kaiser <[email protected]> Fri, 8 Nov 2013 12:19:02 +0100
Newsgroups gmane.linux.ports.arm.general
Message-ID <[email protected]>
Hello,

I have a Beaglebone Black with archlinux 3.12.x and would like to use /sys/class/pwm.

My current device tree overlay is:

/*
 * Copyright (C) 2013 CircuitCo
 * Copyright (C) 2013 Texas Instruments
 */

/dts-v1/;
/plugin/;

/ {
    
    part-number = "BB-PWM-P9_14";
    version     = "00A0";
    
    compatible = 
        "ti,beaglebone", 
        "ti,beaglebone-black"
        ;

    exclusive-use =
        "P9.14",
        "ehrpwm1A"
        ;

    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            pwm_P9_14: pinmux_pwm_P9_14_pins {
                pinctrl-single,pins = <0x048 0x06>;
            };
        };
    };

    fragment@1 {
        target = <&epwmss0>;
        __overlay__ {
            status  = "okay";
        };
    };

    fragment@2 {
        target = <&epwmss1>;
        __overlay__ {
            status = "okay";
        };
    };
    
    fragment@3 {
        target = <&epwmss2>;
        __overlay__ {
            status  = "okay";
        };
    };

    fragment@4 {
        target = <&ehrpwm1>;
        __overlay__ {
            status = "okay";
        };
    };

};

This allows me to do `echo "1“ > /sys/pwm/export`. However the /sys/pwm/pwm1 device does not affect the actual anything.

Would be great if anyone could send me a working overlay!

Best,
Bodo