All of lore.kernel.org
 help / color / mirror / Atom feed
* ALSA SOC Driver (mxs-wm8753)
@ 2013-03-04 18:25 John Graham
  2013-04-29 20:41 ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: John Graham @ 2013-03-04 18:25 UTC (permalink / raw)
  To: alsa-devel

Hi there,

I'm completely new to both kernel/ALSA driver programming (at least at
a serious level) and was looking for some help on a project I'm
working on - I'm part way there but I've kind of hit a brick wall and
don't know where to turn.

I'm trying to get a codec working on a new platform (new for the codec
- the platform itself is not new). Here are the details:

The audio codec is the Wolfson WM8753, which already has a codec
driver in the kernel mainline tree. We also have a vendor-supplied
(but GPL) patch to make the wm8753 work on a CC9M2443 (based on the
Samsung S3C2443). This includes the glue code ("platform" code?) in
sound/soc/s3c24xx/cc9m2443js_wm8753.c. We have a product with this
combination fully working.

The platform is the Karo TX28 (based on the Freescale i.MX28), and
there are already drivers in the kernel tree to make the TX28 work
with an SGTL5000 codec in sound/soc/mxs/mxs-sgtl5000.c. We also have a
product with this combination fully working.

Now we want to move the WM8753 over from the CC9M2443 to work on the TX28.

To simplify, what I *have* is:

    CC9M2443 <----> WM8753
    TX28     <----> SGTL5000

and what I *want* is:

                /-> WM8753
    TX28     <-/

What I was hoping I could do was just "mash" the existing drivers
together - i.e. copy sound/soc/mxs/mxs-sgtl5000.c into
sound/soc/mxs/mxs-wm8753.c, change the parts in it that were specific
for the SGTL5000 to the parts that drive the wm8753 in
sound/soc/s3c24xx/cc9m2443js_wm8753.c, tell the TX28 to probe for it
and that it would "magically work" (hey, crazier things have
happened...).

Obviously, it does not work, but I've got it a little way down the
line. The WM8752 is probed for by the TX28 and recognized - the I2C
control works, and you can change the mixer settings with amixer. When
I try to record (using arecord) I can see with an oscilloscope the I2S
clock lines look correct (in that they look the same as when the
CC9M2443 talks to the WM8753 at the same audio rate).

The problem now is that the I2S data lines don't look right - the line
from codec to TX28 looks like a (more-or-less) square wave with the
same period as the I2S clock, but only going from ~3.1 - ~3.5 V, as
opposed to the 0 - ~3.3 V I expect. Furthermore, it's a pretty regular
square wave - it doesn't have all the breaks you see on a working I2S
data line.

I know I probably haven't provided the right detail to get to the
bottom of this problem, but part of my problem is that I'm so new to
this that I'm not entirely sure where the problem might lie, or what
extra detail to include to ask for more help. Is anyone able to point
me in the right direction/suggest some ideas as to what might be
wrong/anything else at all?

Any help would be much appreciated - many thanks,

John Graham

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ALSA SOC Driver (mxs-wm8753)
  2013-03-04 18:25 John Graham
@ 2013-04-29 20:41 ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2013-04-29 20:41 UTC (permalink / raw)
  To: John Graham; +Cc: alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 955 bytes --]

On Mon, Mar 04, 2013 at 06:25:05PM +0000, John Graham wrote:

You should CC maintainers on e-mails, often things just on the list get
lost in the noise.

> The problem now is that the I2S data lines don't look right - the line
> from codec to TX28 looks like a (more-or-less) square wave with the
> same period as the I2S clock, but only going from ~3.1 - ~3.5 V, as
> opposed to the 0 - ~3.3 V I expect. Furthermore, it's a pretty regular
> square wave - it doesn't have all the breaks you see on a working I2S
> data line.

My immediate thought here is that you're probably seeing some sort of
electrical problem if the logic levels aren't being hit - normally this
is because both ends of the link are driving simultaneously.  I'd check
the pin mux settings on the SoC, probably in arch/arm, to make sure that
everything on the SoC is in the correct mode then check that the CPU is
configured as a slave (which sounds like the intended configuration).

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ALSA SOC Driver (mxs-wm8753)
@ 2014-07-15  9:14 Kevin Startup
  2014-07-18  8:44 ` Charles Keepax
  0 siblings, 1 reply; 9+ messages in thread
From: Kevin Startup @ 2014-07-15  9:14 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org

Hi there

I am attempting to configure a Wolfson WM8753 on a Ka-Ro TX28S, I was wondering if you had any success managing this and if you could give me some pointers.  Currently, I think my device tree may be wrong.  I am getting this message on bootup:

mxs-wm8753 sounds.12: ASoC: CODEC DAI wm8753 not registered

Any help would be greatly appreciated
Many Thanks
Kevin Startup
A.W. Communication Systems Ltd.
email: kevin@awcsl.com<mailto:kevin@awcsl.com>
Tel: +44(0)1697 748717
Fax: +44(0)1697 748778

A.W. Communication Systems Ltd
VAT No. GB 827 4389 00
Registered No. 4891652
Registered Office Crook Barn, The Crook, Roweltown, Carlisle, UK

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ALSA SOC Driver (mxs-wm8753)
  2014-07-15  9:14 ALSA SOC Driver (mxs-wm8753) Kevin Startup
@ 2014-07-18  8:44 ` Charles Keepax
  2014-07-18 10:14   ` Kevin Startup
  0 siblings, 1 reply; 9+ messages in thread
From: Charles Keepax @ 2014-07-18  8:44 UTC (permalink / raw)
  To: Kevin Startup; +Cc: alsa-devel@alsa-project.org

On Tue, Jul 15, 2014 at 09:14:31AM +0000, Kevin Startup wrote:
> Hi there
> 
> I am attempting to configure a Wolfson WM8753 on a Ka-Ro TX28S, I was wondering if you had any success managing this and if you could give me some pointers.  Currently, I think my device tree may be wrong.  I am getting this message on bootup:
> 
> mxs-wm8753 sounds.12: ASoC: CODEC DAI wm8753 not registered
> 

It does indeed sound like your DT is wrong. "wm8753" is not the
name of any of the DAIs on the device. The two DAIs are called
"wm8753-hifi" and "wm8753-voice".

Thanks,
Charles

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ALSA SOC Driver (mxs-wm8753)
  2014-07-18  8:44 ` Charles Keepax
@ 2014-07-18 10:14   ` Kevin Startup
  2014-07-18 10:53     ` Charles Keepax
  0 siblings, 1 reply; 9+ messages in thread
From: Kevin Startup @ 2014-07-18 10:14 UTC (permalink / raw)
  To: Charles Keepax; +Cc: alsa-devel@alsa-project.org

That's great info, thanks very much.  My DT looks like this, inside sound{} I have:

compatible = "fs,imx28-tx28-wm8753", "fsl,mxs-audio-wm8753";
model = "wm8753";
saif-controllers = <&saif0 &saif1>;
audio-controllers = <&i2c0>;
audio-code = <&wm8753>;

Inside i2c0{} I have:

wm8753: wm8753@1a {
    Compatible = "wlf,wm8753";
    reg = <0x1a>;

I have tried changing model to "wm8753-voice" but still get the same error.

Am I changing it in the wrong place?  Or do I need another setting?

I'm very much a beginner at this DT stiff and also configuring and using sound devices so any info you can supply will be of great help.

Many Thanks
Kevin Startup
A.W. Communication Systems Ltd. 
email: kevin@awcsl.com
Tel: +44(0)1697 748717
Fax: +44(0)1697 748778

A.W. Communication Systems Ltd
VAT No. GB 827 4389 00
Registered No. 4891652
Registered Office Crook Barn, The Crook, Roweltown, Carlisle, UK

-----Original Message-----
From: Charles Keepax [mailto:ckeepax@opensource.wolfsonmicro.com] 
Sent: 18 July 2014 09:44
To: Kevin Startup
Cc: alsa-devel@alsa-project.org
Subject: Re: [alsa-devel] ALSA SOC Driver (mxs-wm8753)

On Tue, Jul 15, 2014 at 09:14:31AM +0000, Kevin Startup wrote:
> Hi there
> 
> I am attempting to configure a Wolfson WM8753 on a Ka-Ro TX28S, I was wondering if you had any success managing this and if you could give me some pointers.  Currently, I think my device tree may be wrong.  I am getting this message on bootup:
> 
> mxs-wm8753 sounds.12: ASoC: CODEC DAI wm8753 not registered
> 

It does indeed sound like your DT is wrong. "wm8753" is not the name of any of the DAIs on the device. The two DAIs are called "wm8753-hifi" and "wm8753-voice".

Thanks,
Charles

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ALSA SOC Driver (mxs-wm8753)
  2014-07-18 10:14   ` Kevin Startup
@ 2014-07-18 10:53     ` Charles Keepax
  2014-07-18 13:02       ` Kevin Startup
  0 siblings, 1 reply; 9+ messages in thread
From: Charles Keepax @ 2014-07-18 10:53 UTC (permalink / raw)
  To: Kevin Startup; +Cc: alsa-devel@alsa-project.org

On Fri, Jul 18, 2014 at 10:14:16AM +0000, Kevin Startup wrote:
> That's great info, thanks very much.  My DT looks like this, inside sound{} I have:
> 
> compatible = "fs,imx28-tx28-wm8753", "fsl,mxs-audio-wm8753";
> model = "wm8753";
> saif-controllers = <&saif0 &saif1>;
> audio-controllers = <&i2c0>;
> audio-code = <&wm8753>;
> 
> Inside i2c0{} I have:
> 
> wm8753: wm8753@1a {
>     Compatible = "wlf,wm8753";
>     reg = <0x1a>;
> 
> I have tried changing model to "wm8753-voice" but still get the same error.
> 
> Am I changing it in the wrong place?  Or do I need another setting?
> 
> I'm very much a beginner at this DT stiff and also configuring and using sound devices so any info you can supply will be of great help.

How exactly the DT needs to be specified depends on the machine
driver, as it will be what parses the sound node. I would assume
that you are writing this as well? Whatever in there is setting
the codec_dai_name on the dai_link seems to be setting the wrong
value.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ALSA SOC Driver (mxs-wm8753)
  2014-07-18 10:53     ` Charles Keepax
@ 2014-07-18 13:02       ` Kevin Startup
  2014-07-18 14:28         ` Charles Keepax
  0 siblings, 1 reply; 9+ messages in thread
From: Kevin Startup @ 2014-07-18 13:02 UTC (permalink / raw)
  To: Charles Keepax; +Cc: alsa-devel@alsa-project.org

Hi Charles

Thanks very much, the pointers you gave me have helped a lot.  I have changed the reference to .codec_dai_name to "wm8753-hifi" in the mxs-wm8753.c program which has made my CPU recognise the WM8753 as a valid ALSA device!
This makes me very happy as I have been trying to get this to happen for several weeks now!

I still don't seem to be able to send sound to the device though.
I am now receiving this message:

mxs-i2c 80058000.i2c: PIO: Failed to finish WRITE cmd!

This happens a dozen times or so on bootup and any time that I try to write to one of the PCM devices ....
I wonder if you could give me any more pointers?

Many Thanks
Kevin

Kevin Startup
A.W. Communication Systems Ltd. 
email: kevin@awcsl.com
Tel: +44(0)1697 748717
Fax: +44(0)1697 748778

A.W. Communication Systems Ltd
VAT No. GB 827 4389 00
Registered No. 4891652
Registered Office Crook Barn, The Crook, Roweltown, Carlisle, UK

-----Original Message-----
From: Charles Keepax [mailto:ckeepax@opensource.wolfsonmicro.com] 
Sent: 18 July 2014 11:53
To: Kevin Startup
Cc: alsa-devel@alsa-project.org
Subject: Re: [alsa-devel] ALSA SOC Driver (mxs-wm8753)

On Fri, Jul 18, 2014 at 10:14:16AM +0000, Kevin Startup wrote:
> That's great info, thanks very much.  My DT looks like this, inside sound{} I have:
> 
> compatible = "fs,imx28-tx28-wm8753", "fsl,mxs-audio-wm8753"; model = 
> "wm8753"; saif-controllers = <&saif0 &saif1>; audio-controllers = 
> <&i2c0>; audio-code = <&wm8753>;
> 
> Inside i2c0{} I have:
> 
> wm8753: wm8753@1a {
>     Compatible = "wlf,wm8753";
>     reg = <0x1a>;
> 
> I have tried changing model to "wm8753-voice" but still get the same error.
> 
> Am I changing it in the wrong place?  Or do I need another setting?
> 
> I'm very much a beginner at this DT stiff and also configuring and using sound devices so any info you can supply will be of great help.

How exactly the DT needs to be specified depends on the machine driver, as it will be what parses the sound node. I would assume that you are writing this as well? Whatever in there is setting the codec_dai_name on the dai_link seems to be setting the wrong value.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ALSA SOC Driver (mxs-wm8753)
  2014-07-18 13:02       ` Kevin Startup
@ 2014-07-18 14:28         ` Charles Keepax
  2014-07-23  8:40           ` Kevin Startup
  0 siblings, 1 reply; 9+ messages in thread
From: Charles Keepax @ 2014-07-18 14:28 UTC (permalink / raw)
  To: Kevin Startup; +Cc: alsa-devel@alsa-project.org

On Fri, Jul 18, 2014 at 01:02:41PM +0000, Kevin Startup wrote:
> Hi Charles
> 
> Thanks very much, the pointers you gave me have helped a lot.  I have changed the reference to .codec_dai_name to "wm8753-hifi" in the mxs-wm8753.c program which has made my CPU recognise the WM8753 as a valid ALSA device!
> This makes me very happy as I have been trying to get this to happen for several weeks now!
> 
> I still don't seem to be able to send sound to the device though.
> I am now receiving this message:
> 
> mxs-i2c 80058000.i2c: PIO: Failed to finish WRITE cmd!
> 
> This happens a dozen times or so on bootup and any time that I try to write to one of the PCM devices ....
> I wonder if you could give me any more pointers?
> 
> Many Thanks
> Kevin

Looks like probably the i2c transactions are not being acked,
afraid I don't know much about the i2c driver in question so not
really sure. I assume this is the i2c link to the CODEC, so I
would check the CODECs reset lines and supplies to make sure it
has everything it needs to respond.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ALSA SOC Driver (mxs-wm8753)
  2014-07-18 14:28         ` Charles Keepax
@ 2014-07-23  8:40           ` Kevin Startup
  0 siblings, 0 replies; 9+ messages in thread
From: Kevin Startup @ 2014-07-23  8:40 UTC (permalink / raw)
  To: Charles Keepax; +Cc: alsa-devel@alsa-project.org

Hi Charles

Thanks, we've started having a look at this but still not sure what the issue is, I'm hoping to employ some help from the i.MX manufacturer's support (it's quite expensive though!) but what is worrying us at the moment is that one of our suppliers is marking the WM8753 as "Obsolete" ?  I wonder if you knew what the lifetime for manufacturing this chip might be from Wolfson themselves?

Cheerz
Kevin

Kevin Startup
A.W. Communication Systems Ltd. 
email: kevin@awcsl.com
Tel: +44(0)1697 748717
Fax: +44(0)1697 748778

A.W. Communication Systems Ltd
VAT No. GB 827 4389 00
Registered No. 4891652
Registered Office Crook Barn, The Crook, Roweltown, Carlisle, UK

-----Original Message-----
From: Charles Keepax [mailto:ckeepax@opensource.wolfsonmicro.com] 
Sent: 18 July 2014 15:29
To: Kevin Startup
Cc: alsa-devel@alsa-project.org
Subject: Re: [alsa-devel] ALSA SOC Driver (mxs-wm8753)

On Fri, Jul 18, 2014 at 01:02:41PM +0000, Kevin Startup wrote:
> Hi Charles
> 
> Thanks very much, the pointers you gave me have helped a lot.  I have changed the reference to .codec_dai_name to "wm8753-hifi" in the mxs-wm8753.c program which has made my CPU recognise the WM8753 as a valid ALSA device!
> This makes me very happy as I have been trying to get this to happen for several weeks now!
> 
> I still don't seem to be able to send sound to the device though.
> I am now receiving this message:
> 
> mxs-i2c 80058000.i2c: PIO: Failed to finish WRITE cmd!
> 
> This happens a dozen times or so on bootup and any time that I try to write to one of the PCM devices ....
> I wonder if you could give me any more pointers?
> 
> Many Thanks
> Kevin

Looks like probably the i2c transactions are not being acked, afraid I don't know much about the i2c driver in question so not really sure. I assume this is the i2c link to the CODEC, so I would check the CODECs reset lines and supplies to make sure it has everything it needs to respond.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-07-23  8:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-15  9:14 ALSA SOC Driver (mxs-wm8753) Kevin Startup
2014-07-18  8:44 ` Charles Keepax
2014-07-18 10:14   ` Kevin Startup
2014-07-18 10:53     ` Charles Keepax
2014-07-18 13:02       ` Kevin Startup
2014-07-18 14:28         ` Charles Keepax
2014-07-23  8:40           ` Kevin Startup
  -- strict thread matches above, loose matches on Subject: below --
2013-03-04 18:25 John Graham
2013-04-29 20:41 ` Mark Brown

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.