From: Thierry Reding <thierry.reding@gmail.com>
To: Naidu Tellapati <naidu.tellapati@gmail.com>
Cc: linux-pwm@vger.kernel.org
Subject: Re: quick help on PDM DAC driver
Date: Mon, 22 Sep 2014 13:27:08 +0200 [thread overview]
Message-ID: <20140922112707.GR1470@ulmo> (raw)
In-Reply-To: <CAC3mp01MC3SaR8WmcDOXmGaB60eYfifx+YMT8xvxE2L=gZ093A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2754 bytes --]
On Mon, Sep 22, 2014 at 04:37:11PM +0530, Naidu Tellapati wrote:
> Hi Thierry,
>
> Many thanks for your quick response.
>
> There are total 4 blocks available on our SOC, those could be used
> either as PWM DAC (or) PDM DAC blocks. If one of them is used as a PWM
> DAC block, it can’t be used as a PDM block. As an example if the user
> wants, based on the configuration from the device tree, he could use
> all the 4 blocks as PWM DAC blocks (or) all 4 as PDM DAC blocks (or) 2
> PDM DAC blocks & 2 PDM blocks (or) any combination of these two types.
> Since there are 4 blocks available, total 16 combinations of these two
> types (PDM & PWM) are possible.
>
> For example based on sort of channel mask defined in the device tree,
> If the user wishes to use the blocks as PWM DAC blocks, my driver
> exactly fits into linux PWM frame work. As usual, the PWM blocks
> expect the user to configure all the required configuration attributes
> (frequency, duty-cycle etc) as defined by the Linux PWM Framework.
>
> Bu if the user wishes to use the blocks as PDM DAC blocks, my driver
> does not exactly fit into PWM framework. In this case the PDM DAC
> block takes only a 12 bit value (as input) program 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 width of the
> output pulse varies with the 12-bit value we program in one of the SOC
> configuration registers.
>
> If the user wants to change the width of the output pulse, he has to
> program different values for 12-bit value. For example different
> 12-bit input values 0xFFF, 0x800, 0x0800, 0x0080, 0x0008, 0x001 will
> produce output pulses of totally different widths.
What's the relation of the 12-bit value to the resulting signal? Does
each bit in the value correspond to a fixed interval so that a one is
high and 0 low? That is, does:
0x800 produce -___________
0x080 produce ____-_______
0x008 produce ________-___
0x444 produce _-___-___-__
0x555 produce _-_-_-_-_-_-
0x00f produce ________----
...
? If so you can probably still mimic PWM behaviour by subdividing the
duty-cycle into 12 intervals.
> The idea is to implement a driver which could be upstream-able. I am
> trying to understand how I could use the existing PWM Framework to
> achieve this. If you think this does not fit into existing PWM
> Framework, I request you to please suggest me some better approach.
Even if you can't mimic PWM using PDM it's still possible to use a PWM
driver only if all channels are configured in PWM mode.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-09-22 11:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-22 11:07 quick help on PDM DAC driver Naidu Tellapati
2014-09-22 11:27 ` Thierry Reding [this message]
2014-09-22 13:58 ` Naidu Tellapati
2014-09-23 7:27 ` Thierry Reding
2014-09-23 7:45 ` Naidu Tellapati
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140922112707.GR1470@ulmo \
--to=thierry.reding@gmail.com \
--cc=linux-pwm@vger.kernel.org \
--cc=naidu.tellapati@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.