All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Lars-Peter Clausen <lars@metafoo.de>, broonie@kernel.org
Cc: jeeja.kp@intel.com, alsa-devel@alsa-project.org,
	subhransu.s.prusty@intel.com, lgirdwood@gmail.com
Subject: Re: [RFC 2/4] ASoC: Intel: Add merrifield machine driver
Date: Wed, 7 May 2014 10:21:17 +0530	[thread overview]
Message-ID: <20140507045117.GF28638@intel.com> (raw)
In-Reply-To: <5369272E.5010803@metafoo.de>

On Tue, May 06, 2014 at 08:17:18PM +0200, Lars-Peter Clausen wrote:
> On 05/06/2014 06:58 PM, Vinod Koul wrote:
> >On Tue, May 06, 2014 at 05:54:53PM +0200, Lars-Peter Clausen wrote:
> >>On 05/05/2014 08:01 PM, Vinod Koul wrote:
> >>[...]
> >>>+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> >>>+
> >>>+#include <linux/module.h>
> >>>+#include <linux/init.h>
> >>>+#include <linux/device.h>
> >>>+#include <linux/slab.h>
> >>>+#include <linux/io.h>
> >>>+#include <linux/async.h>
> >>>+#include <linux/delay.h>
> >>>+#include <linux/gpio.h>
> >>>+#include <sound/pcm.h>
> >>>+#include <sound/pcm_params.h>
> >>>+#include <sound/soc.h>
> >>>+#include <sound/jack.h>
> >>>+#include <linux/input.h>
> >>>+
> >>>+#include <linux/mfd/wm8994/core.h>
> >>>+#include <linux/mfd/wm8994/registers.h>
> >>>+#include <linux/mfd/wm8994/pdata.h>
> >>>+#include "../../codecs/wm8994.h"
> >>>+#include "../platform-libs/controls_v2.h"
> >>
> >>I don't think that include exists in upstream.
> >which one ../platform-libs/controls_v2.h is part of this patch.
> 
> I just saw it's part of patch 4 of this series. But still, it should
> added before the user is added.
Yes :)

And i dont use in below code so would remove for now...
Later additions to thsi would use these defines so would amke sense to add then.

> 
> [..]
> >>
> >>>+static struct snd_soc_dai *find_codec_dai(struct snd_soc_card *card, const char *dai_name)
> >>>+{
> >>>+	int i;
> >>>+	for (i = 0; i < card->num_rtd; i++) {
> >>>+		if (!strcmp(card->rtd[i].codec_dai->name, dai_name))
> >>>+			return card->rtd[i].codec_dai;
> >>>+	}
> >>>+	pr_err("%s: unable to find codec dai\n", __func__);
> >>>+	/* this should never occur */
> >>>+	WARN_ON(1);
> >>>+	return NULL;
> >>>+}
> >>
> >>The proper way to do this is to implement the init callback for the
> >>dai link. There you get a pointer to the codec and the dai and
> >>everything else. If you need one for later store them in the private
> >>struct of the card driver.
> >again the driver would need to store the pointers to cards (we multi codec
> >systems) and multi dais. Somehow I dont feel this might be worth thr trouble.
> >Earlier we always had card->codec pointing to _one_ codec but with multi-codec
> >systems that is not the case, so we need ot lookup, but yes am not sure if above
> >is best way or something else..
> 
> Another thing you could do is just use card->rtd[X].codec_dai. The
> rtds are in the same order as the DAI links so you know which rtd is
> for which DAI.
that should work too..
Mark, Any comments on these approaches before I modify the code?

-- 
~Vinod

  reply	other threads:[~2014-05-07  5:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05 18:01 [RFC 0/4] Add support for merrfield audio Vinod Koul
2014-05-05 18:01 ` [RFC 1/4] ASoC: Intel: add SSP BE DAIs Vinod Koul
2014-05-06 14:42   ` Liam Girdwood
2014-05-05 18:01 ` [RFC 2/4] ASoC: Intel: Add merrifield machine driver Vinod Koul
2014-05-06 15:17   ` Liam Girdwood
2014-05-06 16:49     ` Vinod Koul
2014-05-06 15:54   ` Lars-Peter Clausen
2014-05-06 16:58     ` Vinod Koul
2014-05-06 18:17       ` Lars-Peter Clausen
2014-05-07  4:51         ` Vinod Koul [this message]
2014-05-05 18:01 ` [RFC 3/4] ASoC: Intel: add the low level dsp driver for mrfld Vinod Koul
2014-05-06 15:45   ` Liam Girdwood
2014-05-06 16:44     ` Vinod Koul
2014-05-07  6:09   ` Jarkko Nikula
2014-05-07  7:25     ` Vinod Koul
2014-05-05 18:01 ` [RFC 4/4] ASoC: Intel: add support for mrfld DPCM platform Vinod Koul
2014-05-06 15:53   ` Liam Girdwood
2014-05-06 16:46     ` Vinod Koul

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=20140507045117.GF28638@intel.com \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jeeja.kp@intel.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=subhransu.s.prusty@intel.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.