This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3358: Device Tree ecap channel configuration

Part Number: AM3358

Tool/software: Linux

Hi,

i want to controll a rgb led via the ecap module from the am3358. The led is connected to

ecap0: (A13) mcasp0_aclkx.ehrpwm0A  

ecap2: (U14) gpmc_a2.ehrpwm1A

ecap2: (T14) gpmc_a3.ehrpwm1B

Currently i`m not able to boot the system, is the driver init and the channel assignment from pinmux to ecap and from ecap to the pwm driver correct ? 

the pinmux


    /*pwm pins for RGB led*/
    pwm_pins_RG: pinmux_pwmled_pin_r {
        pinctrl-single,pins = <
            0x48 ( PIN_OUTPUT | MUX_MODE6 )     /* (U14) gpmc_a2.ehrpwm1A */
            0x4c ( PIN_OUTPUT | MUX_MODE6 )     /* (T14) gpmc_a3.ehrpwm1B */
        >;
    };
        
    pwm_pin_B: pinmux_pwmled_pin_b {
        pinctrl-single,pins = <
            0x190 ( PIN_OUTPUT | MUX_MODE1 )     /* (A13) mcasp0_aclkx.ehrpwm0A */
        >;
    };


the enable for the ecap module


/*enable pwm for the rgb led*/

&epwmss0 {
    status = "okay";
    
    ecap0: ecap@48300100 {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&pwm_pin_B>;
    };
};

&epwmss1 {
    status = "okay";

    ecap1: ecap@48302100 {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&pwm_pins_RG>;
    };
};


led driver description


    rgb_led {
    
        compatible = "pwm-leds";
    
        rgb_led_r {
            label = "rgb:red";
            pwms = <&ecap0 0 50000 PWM_POLARITY_INVERTED>;
            max-brightness = <255>;
        };
        
        rgb_led_g {
            label = "rgb:green";
            pwms = <&ecap2 2 50000 PWM_POLARITY_INVERTED>;
            max-brightness = <255>;
        };
    
        rgb_led_b {
            label = "rgb:blue";
            pwms = <&ecap2 0 50000 PWM_POLARITY_INVERTED>;
            max-brightness = <255>;
        };
    };


Thanks

Stefan