All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolin Chen <nicoleotsuka@gmail.com>
To: Shawn Embedded <programassem@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Support two wm8962 codec in i.mx6 board.
Date: Tue, 17 Mar 2015 11:00:07 -0700	[thread overview]
Message-ID: <20150317180006.GA5336@Asurada> (raw)
In-Reply-To: <CAOaGyfUBoQLpa0YZjKEtZXmhRL_p=zGq3XEJ9oZHbHrVr1SQ8w@mail.gmail.com>

On Tue, Mar 17, 2015 at 09:51:22AM +0800, Shawn Embedded wrote:

>    Actually I donot know much about dai-link. I just got started
> recently to working on this requirement.
>    You mean to create the same platform device as the now-working one
> in board-xxx.c. Sure I can do that.

Are you using old kernel version that's not included Device Tree yet?

If so, yes, you need to add a similar platform device as the original
one but you need to assign a different AUDMUX port.

>    Since the two wm8962 codecs are on different I2C buses, so I just
> need to update the corresponding i2c's i2c_board_info structure to
> support the second one as a I2C device?

Exactly.

> > Supposing two WM8962 chips on one board, there should be two WM8962
> > nodes hanging to the I2C node with different I2C slave addresses.
> 
>   Yes, but the I2C slave addresses should be the same, IIRC, only on
> different I2C buses.

No problem for this. You can use same slave address but connecting to
different I2C buses. As long as you system probes two different CODECs,
that's fine.

>   What do you mean by "two wm8962 nodes" ?

If you are not using code from Linux Mainline, just forget about it.

>   In my experience, the corresponding files are board-xxx.c,
> imx-wm8962.c, wm8962.c.
> 
>   I looked at the wm8962.c, which is the codec driver file, very independent.
>   There comes the wm8962_i2c_probe() and wm8962_probe().
>   In wm8962_i2c_probe(), snd_soc_register_codec() is called, so a new
> codec structure will be created when there comes another i2c device
> named "wm8962".
>   Seems no need to change anything in wm8962.c, if the external
> hardware signals of the second wm8962 are connected in the same way as
> the first now-working one, right?

No, you don't need to. Just register it in the board level driver.

>   Do you think any changes should be made to imx-wm8962.c which is the
> machine driver file for wm8962 on imx6?

Ideally, You only need to append a new platform device in the board
level driver, same as you do for WM8962 CODECs.

> static struct snd_soc_dai_link imx_dai[] = {
> {
> .name = "HiFi",
> .stream_name = "HiFi",
> .codec_dai_name = "wm8962",
> .codec_name = "wm8962.0-001a",
> .cpu_dai_name = "imx-ssi.1",
> .platform_name = "imx-pcm-audio.1",
> .init = imx_wm8962_init,
> .ops = &imx_hifi_ops,
> },
> };

Okay...this one looks like you are using an old version BSP, other
than the code from Linux Mainline.

> in imx-wm8962.c, should I copy them to create a new copy of them
> respectively? Or no need to do this?

In this case, yes, because the structure has hard code. Otherwise,
you new dai-link will not be successfully connected.

> In board-xxx.c, do I just need to copy declarations related to wm8962?
> Is that enough?

I think so.

>   Again, could you tell me how to make two different dai-link nodes?
>   Sorry for knowing not much about this.

That's for Device Tree which you are not using.

Nicolin

  reply	other threads:[~2015-03-17 18:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16  7:30 Support two wm8962 codec in i.mx6 board Shawn Embedded
2015-03-17  0:55 ` Nicolin Chen
2015-03-17  1:51   ` Shawn Embedded
2015-03-17 18:00     ` Nicolin Chen [this message]
2015-03-18  1:12       ` Shawn Embedded
2015-03-18  1:33         ` Nicolin Chen
2015-03-18  4:48           ` Shawn Embedded
2015-03-18  4:58             ` Nicolin Chen
2015-03-18  5:10               ` Shawn Embedded

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=20150317180006.GA5336@Asurada \
    --to=nicoleotsuka@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=programassem@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.