How to assign sdma channel to pwm in device-tree

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to assign sdma channel to pwm in device-tree

439 Views
ganesh_k
Contributor III

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....

Labels (3)
0 Kudos
1 Reply

353 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ganesh

nxp bsps do not support pwm sdma, one can look at third party efforts with custom sdma script

GitHub - Glowforge/kernel-module-imx-pwm-audio: i.MX6 PWM audio driver 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos