On Sun, Sep 21, 2014 at 04:15:42PM +0530, Naidu Tellapati wrote: > Hi Thierry and all, > > Many thanks in advance. My name is Naidu Tellapati. I am from India. > > The Pulse Density Modulation DAC which we have on our SOC produces a > form of analogue output according to the relative density of output > pulses to the intended analogue signal amplitude. The 4 PDM outputs > are provided that can be used to control targets such as an LCD > backlight. After going through Linux PWM documentation, I understand > that our PDM DAC driver does not exactly fit into the Linux PWM > framework. > > The PDM DAC block takes only input clock and a 12 bit value (as input > pulse) configured in one of the SOC configuration registers as an > input and based on some simple internal logic, the block produces a > form of analogue output according to the relative density of output > pulses to the intended analogue signal amplitude. The PDM DAC block > won't take duty_cycle as input configuration parameters. Instead it > takes 12 bit value (input pulse) as a configuration parameter.
What does this 12-bit value represent? It sounds to me like it's exactly what the duty-cycle is for other devices. And if it's the only parameter then it seems to me like the device simply has a fixed period. Both of the above should be possible to do in the current PWM framework. For example, you could compute the period (in ns) of the PDM based on the input clock frequency and inter/extrapolate the 12-bit parameter to range [0..period]. You can also add checks to refuse setting a period in pwm_config() that doesn't correspond to the fixed period derived from the input clock. Thierry
pgpifc2Pfo9eF.pgp
Description: PGP signature
