Pdm

How to use PDM(Pulse-density modulation) on the Debian?
I know this feature of audio interfaces PDM, at datasheet of APQ8016 Device Specification.

2.2.1.1 General purpose clocks, PDM, and related signals
The APQ8016 IC has several general purpose clock outputs, as well as general purpose pulse density modulated (PDM) outputs:
GP_PDM – a configurable pulse-density output (12-bit value configurable), with the base frequency set at 4.8 MHz.
The APQ8016 supports three different instances of this configurable PDM output

Debian上でPDMはどうやって使いますか?
APQ8016 Device SpecificationにはPDMの項目がありますが、使い方が判りません。

There are two very different types of PDM, the first type is used to transport audio information between the PMIC, and the Processor. This is already running in the source code. I suspect you are interested in the ‘other’ type of PDM, the PDMs are sort of like a PWM and there are three of them as you have noticed. Accessing the three PDMs will require quite a bit of work. I can give you an overview of what needs to be done.

First is the Hardware connections: Each one of the three PDMs can be muxed onto one of two GPIOs.

GP_PDM0 - GPIO_20 or GPIO_25
GP_PDM1 - GPIO_21 or GPIO_52
GP_PDM2 - GPIO_98 or GPIO_113

On the 410c board the physical wiring of the GPIOs are as follows

GPIO_20 is wired to HDMI_HPD (Hot Plug Detect) - we can’t turn this GPIO into an output (due to the HW conflict) so this GPIO is not available.
GPIO_25 is wired to the Low Speed connector GPIOH - this can be programmed as input, output, or PWM as desired.

GPIO_12 is wired to USER_LED_1 - you could use the PWM to change the brightness of the LED.
GPIO_52 is not connected anywhere on the board and cannot be used.

GPIO_98 is not connected anywhere on the board and cannot be used.
GPIO_113 is connected to the Low Speed Connector as the MI2S_SCLK. If you are not using the I2S, then this gpio could be programmed as input, output or PWM.

Next there is the SW portion of the problem. I couldn’t find any PDM code in the Debian source tree (but I might have been looking in the wrong places) so I think you will have to write your own device drivers and device tree entries. First you need to connect the PDM block to the GPIO, the registers to do this are described in the TLMM section of Hardware Register Description (HRD) Pages 3045 to 3046. Next you need to program the PDM block, the registers for the PDM are described in Section 22. HPG

Full Disclosure, I am an employee of Qualcomm Canada, any opinions expressed in this or any other post may not reflect the opinions of my employer.