linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: PowerPC dev list <Linuxppc-dev@ozlabs.org>
Subject: Re: Audio codec device tree entries
Date: Thu, 25 Oct 2007 11:14:22 -0500	[thread overview]
Message-ID: <4720C0DE.8050707@freescale.com> (raw)
In-Reply-To: <9e4733910710242011y771d5cbbuaa1eb274672ccb48@mail.gmail.com>

Jon Smirl wrote:

> This could work. The generic codec is a alsa soc_device_driver, not a
> of_device_driver. The codec node could instantiate the fabric as a
> of_device_driver which could then instantiate the soc_device_driver
> for the generic codec.
> 
> The generic codecs are supposed to work cross platform so they can't
> include code that munges the of device tree.

My understanding of ASoC is that the fabric driver is supposed to be OF-aware, 
and the codec and other drivers are not.  The other drivers have ASoC entry 
points that the fabric driver calls to provide information.

Example:

Fabric driver:

static int mpc8610hpcd_startup(struct snd_pcm_substream *substream)
{
	...
	if (codec_dai->dai_ops.set_fmt) {
		ret = codec_dai->dai_ops.set_fmt(codec_dai, machine_data->dai_format);
		if (ret < 0) {
			printk(KERN_ERR "mpc8610-hpcd: could not set codec "
				"driver audio format (ret=%i)\n", ret);
			return ret;
		}
	}

codec driver:

static int cs4270_set_dai_fmt(struct snd_soc_codec_dai *codec_dai,
			      unsigned int format)
{
	...

	switch (format & SND_SOC_DAIFMT_FORMAT_MASK) {
	case SND_SOC_DAIFMT_I2S:
	case SND_SOC_DAIFMT_LEFT_J:
		cs4270->mode = format & SND_SOC_DAIFMT_FORMAT_MASK;
		break;


In my device tree, the I2S node specifies the interface (this node layout is 
what I came up with 6 months ago when I started working on this.)

		ssi@16000 {
			compatible = "fsl,ssi";
			reg = <16000 100>;
			interrupt-parent = <&mpic>;
			interrupts = <3e 2>;
			/* This is probably not the right way to tell the
			   SSI driver how to configure the interface */
			fsl,mode = "i2s-slave";
			codec {
				compatible = "cs4270";
			};
		};


The fabric driver reads "i2s-slave" and converts that to SND_SOC_DAIFMT_I2S.

  reply	other threads:[~2007-10-25 16:14 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-23  1:59 Audio codec device tree entries Jon Smirl
2007-10-23  2:57 ` David Gibson
2007-10-23  3:57 ` Grant Likely
2007-10-23  8:06   ` Segher Boessenkool
2007-10-23 15:27 ` Timur Tabi
2007-10-23 16:56   ` Segher Boessenkool
2007-10-23 22:29     ` Jon Smirl
2007-10-24 14:13       ` Timur Tabi
2007-10-24 15:00         ` Jon Smirl
2007-10-24 15:07           ` Timur Tabi
2007-10-24 15:28             ` Grant Likely
2007-10-24 23:52               ` David Gibson
2007-10-24 15:16           ` Grant Likely
2007-10-24 15:20             ` Grant Likely
2007-10-24 15:28               ` Jon Smirl
2007-10-24 15:43                 ` Grant Likely
2007-10-24 15:54                   ` Jon Smirl
2007-10-24 16:01                     ` Timur Tabi
2007-10-24 16:39                       ` Grant Likely
2007-10-24 16:41                         ` Timur Tabi
2007-10-24 16:47                           ` Grant Likely
2007-10-24 16:38                     ` Grant Likely
2007-10-24 16:41                       ` Timur Tabi
2007-10-24 16:52                         ` Grant Likely
2007-10-24 17:01                       ` Jon Smirl
2007-10-24 17:13                         ` Grant Likely
2007-10-24 17:13                         ` Timur Tabi
2007-10-24 19:31                           ` Jon Smirl
2007-10-24 19:41                             ` Timur Tabi
2007-10-24 19:56                               ` Jon Smirl
2007-10-25  0:04                       ` David Gibson
2007-10-25  0:17                         ` Jon Smirl
2007-10-25  0:38                           ` David Gibson
2007-10-25  3:11                             ` Jon Smirl
2007-10-25 16:14                               ` Timur Tabi [this message]
2007-10-24 23:55                     ` David Gibson
2007-10-24 15:23             ` Jon Smirl
2007-10-24 15:40               ` Timur Tabi
2007-10-24 15:54                 ` Grant Likely
2007-10-24 15:08         ` Grant Likely
2007-10-24 15:19           ` Jon Smirl
2007-10-25  0:01             ` David Gibson

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=4720C0DE.8050707@freescale.com \
    --to=timur@freescale.com \
    --cc=Linuxppc-dev@ozlabs.org \
    --cc=jonsmirl@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).