All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: "jonsmirl@gmail.com" <jonsmirl@gmail.com>,
	alsa-devel mailing list <alsa-devel@alsa-project.org>
Subject: Re: codec->card removed
Date: Fri, 26 Sep 2014 21:25:10 +0200	[thread overview]
Message-ID: <5425BD96.30609@metafoo.de> (raw)
In-Reply-To: <CAKON4OyqRaUxKPc0C2ALwOwvqeToMeSM25CJj9p00ndovh1ZSg@mail.gmail.com>

On 09/26/2014 09:19 PM, jonsmirl@gmail.com wrote:
> How should I rewrite this to reflect that codec->card has been removed?

> This is codec is on the SOC chip, not an external one.
>
> static int sunxi_codec_trigger(struct snd_pcm_substream *substream, int
> cmd, struct snd_soc_dai *dai) {
> struct snd_soc_pcm_runtime *rtd = substream->private_data;
> struct snd_soc_dai *codec_dai = rtd->codec_dai;
> struct snd_soc_codec *codec = codec_dai->codec;
> struct snd_soc_card *card = codec->card;
> struct sunxi_priv *priv = snd_soc_card_get_drvdata(card);


It was moved to the component sub-structure in the CODEC struct. So

codec->component.card

But you really shouldn't access the card from the CODEC driver, that is a 
layering violation.

Similarly accessing rtd->codec_dai from the CODEC driver is not correct, 
since codec_dai may not necessarily point to the CODEC DAI of your CODEC. 
(E.g. for multi-codec links or codec-to-codec links).

- Lars

  reply	other threads:[~2014-09-26 19:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26 19:19 codec->card removed jonsmirl
2014-09-26 19:25 ` Lars-Peter Clausen [this message]
2014-09-26 19:32   ` jonsmirl
2014-09-26 19:46     ` Lars-Peter Clausen
2014-09-26 20:42       ` jonsmirl

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=5425BD96.30609@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.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 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.