AnsweredAssumed Answered

How to assign sdma channel to pwm in device-tree

Question asked by Ganesh Koda on Jul 19, 2018
Latest reply on Jul 20, 2018 by igorpadykov

Hello everyone,

 

               Have to assign one sdma channel to pwm for data transfer, can you please tell me how to pass the parameters through device-tree.

 

Here i m using the pwm to generate the audio.

 

below the params(sdma-params) need to pass from the device-tree

 

 /* Read SDMA channel number and load address */
     if (of_property_read_u32_array(pdev->dev.of_node, "sdma-params",
     sdma_params, ARRAY_SIZE(sdma_params)) == 0) {
     self->sdma_ch_num = sdma_params[0];
     self->sdma_script_origin = sdma_params[1];
   } else {    
         dev_err(&pdev->dev, "sdma-params property not specified");
         goto failed_sdma_init;  
          } 

and below is my device-tree:
****************************

 

&pwm3 {
          comaptible = "glowforge,imx-pwm-audio";
         pinctrl-names = "default";
         pinctrl-0 = <&pinctrl_pwm3>;
         enable-gpio = <&gpio1 4 0>;
         timer = <0x10>;
         sdma-params = <0x19 0xdc0>;
         status = "okay";`       }

can anyone please help me out from this issue.

 

Thank you all....

Outcomes