AC97 problems with pxa...
Hello!
I'm trying to add sound support to a Toradex Colibri 270 v2 card, but have run into some strangeness which I don't quite understand. The v2 of this card uses the WM9712 codec and I've written a machine driver to tie the codec and the pxa2xx-ac97 driver together. I'm using the 2.6.33.1 kernel and my machine driver is a simplified version of the tosa driver (no power management or headphone jack logic). However, I get two problems:
1. Internal clock and headphone output is turned off in the AC97_POWERDOWN register and I can't see where to (properly) turn it on, neither in kernel space or in userland. No-one else using this codec seem to be doing it.
2. The init function defined in my snd_soc_card struct doesn't seem to get called, resulting in way too many mixer settings (I have a number of snd_soc_dapm_nc_pin calls) with alsa, but might it also have something to do with problem 1?
When explicitly writing 0 (the ugly way) to the AC97_POWERDOWN register I get perfect sound output, but I would like to do it the right way.
Two error reports from the dmesg output that might be relevant:
* pxa2xx_ac97_try_cold_reset: cold reset timeout (GSR=0x44)
* Error: Driver 'pxa2xx-ac97' is already registered, aborting...
The AC97 interface is added in the machine initialization through the pxa_set_ac97_info() in the same way as tosa and many others and this could explain the second error message...
Any insight would be appreciated!
Regards,
/Jakob
Quoted 25 lines · Jakob Viketoft
Hello!
I'm trying to add sound support to a Toradex Colibri 270 v2 card, but have run into some strangeness which I don't quite understand. The v2 of this card uses the WM9712 codec and I've written a machine driver to tie the codec and the pxa2xx-ac97 driver together. I'm using the 2.6.33.1 kernel and my machine driver is a simplified version of the tosa driver (no power management or headphone jack logic). However, I get two problems:
1. Internal clock and headphone output is turned off in theAC97_POWERDOWNregister and I can't see where to (properly) turn it on, neither in kernel space or in userland. No-one else using this codec seem to be doing it.
2. The init function defined in mysnd_soc_cardstruct doesn't seem to get called, resulting in way too many mixer settings (I have a number ofsnd_soc_dapm_nc_pincalls) with alsa, but might it also have something to do with problem 1?When explicitly writing 0 (the ugly way) to the
AC97_POWERDOWNregister I get perfect sound output, but I would like to do it the right way.Two error reports from the dmesg output that might be relevant:
*pxa2xx_ac97_try_cold_reset: cold reset timeout (GSR=0x44)
* Error: Driver 'pxa2xx-ac97' is already registered, aborting...
Quoted 6 lines
The AC97 interface is added in the machine initialization through the
pxa_set_ac97_info()in the same way as tosa and many others and this could explain the second error message...Any insight would be appreciated!
Better if you could come up with a patch or source code for analysis.
I'm including the source code for the machine driver inline here, but not as a patch as it's not in patch state yet. It's really quite basic. Adding a printk (with KERN_ERR) in the colibri270_v2_ac97_init function doesn't show up in dmesg and that makes me believe it's never entered. The snd_soc_dapm_nc_pin calls doesn't seem to have an effect either...
Regards,
/Jakob
-----------
/*
* SoC audio driver for Toradex Colibri 270 v2
*
* Copyright 2010 BitSim AB
*
* Author: Jakob Viketoft <[email protected]>
*
* Copied from tosa.c:
* Copyright 2005 Wolfson Microelectronics PLC.
* Copyright 2005 Openedhand Ltd.
*
* Authors: Liam Girdwood <[email protected]>
* Richard Purdie <[email protected]>
*
* This program is free software; you can redistribute it and/or
modify it
* under the terms of the GNU General Public License as published
by the
* Free Software Foundation; either version 2 of the License, or (at
your
* option) any later version.
*
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/device.h>
#include <linux/gpio.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <asm/mach-types.h>
#include <mach/audio.h>
#include "../codecs/wm9712.h"
#include "pxa2xx-pcm.h"
#include "pxa2xx-ac97.h"
static struct snd_soc_card colibri270_v2;
static int colibri270_v2_ac97_init(struct snd_soc_codec *codec)
{
/* Unused inputs */
snd_soc_dapm_nc_pin(codec, "MIC2");
snd_soc_dapm_nc_pin(codec, "PHONE");
snd_soc_dapm_nc_pin(codec, "PC_BEEP");
/* Unused outputs */
snd_soc_dapm_nc_pin(codec, "LOUT2");
snd_soc_dapm_nc_pin(codec, "ROUT2");
snd_soc_dapm_nc_pin(codec, "OUT3");
snd_soc_dapm_nc_pin(codec, "MONOOUT");
snd_soc_dapm_sync(codec);
return 0;
}static struct snd_soc_dai_link colibri270_v2_dai[] = {
{
.name = "AC97",
.stream_name = "AC97 HiFi",
.cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_HIFI],
.codec_dai = &wm9712_dai[WM9712_DAI_AC97_HIFI],
.init = colibri270_v2_ac97_init,
},
{
.name = "AC97 Aux",
.stream_name = "AC97 Aux",
.cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_AUX],
.codec_dai = &wm9712_dai[WM9712_DAI_AC97_AUX],
},};
static struct snd_soc_card colibri270_v2 = {
.name = "Colibri 270 v2",
.platform = &pxa2xx_soc_platform,
.dai_link = colibri270_v2_dai,
.num_links = ARRAY_SIZE(colibri270_v2_dai),
};static struct snd_soc_device colibri270_v2_snd_devdata = {
.card = &colibri270_v2,
.codec_dev = &soc_codec_dev_wm9712,
};static struct platform_device *colibri270_v2_snd_device;
static int __init colibri270_v2_init(void)
{
int ret;
if (!machine_is_colibri())
return -ENODEV;
colibri270_v2_snd_device = platform_device_alloc("soc-audio", -1);
if (!colibri270_v2_snd_device) {
ret = -ENOMEM;
goto err_alloc;
}
platform_set_drvdata(colibri270_v2_snd_device,
&colibri270_v2_snd_devdata);
colibri270_v2_snd_devdata.dev = &colibri270_v2_snd_device->dev;
ret = platform_device_add(colibri270_v2_snd_device);
if (!ret)
return 0;
platform_device_put(colibri270_v2_snd_device);err_alloc:
return ret; }
static void __exit colibri270_v2_exit(void)
{
platform_device_unregister(colibri270_v2_snd_device);
}module_init(colibri270_v2_init);module_exit(colibri270_v2_exit);
/* Module information */MODULE_AUTHOR("Jakob Viketoft"); MODULE_DESCRIPTION("ALSA SoC Toradex Colibri 270 v2"); MODULE_LICENSE("GPL");
Quoted 35 lines · Eric Miao
Quoted 24 lines · Jakob Viketoft
Hello!
I'm trying to add sound support to a Toradex Colibri 270 v2 card, but have run into some strangeness which I don't quite understand. The v2 of this card uses the WM9712 codec and I've written a machine driver to tie the codec and the pxa2xx-ac97 driver together. I'm using the 2.6.33.1 kernel and my machine driver is a simplified version of the tosa driver (no power management or headphone jack logic). However, I get two problems:
1. Internal clock and headphone output is turned off in theAC97_POWERDOWNregister and I can't see where to (properly) turn it on, neither in kernel space or in userland. No-one else using this codec seem to be doing it.
2. The init function defined in mysnd_soc_cardstruct doesn't seem to get called, resulting in way too many mixer settings (I have a number ofsnd_soc_dapm_nc_pincalls) with alsa, but might it also have something to do with problem 1?When explicitly writing 0 (the ugly way) to the
AC97_POWERDOWNregister I get perfect sound output, but I would like to do it the right way.Two error reports from the dmesg output that might be relevant:
*pxa2xx_ac97_try_cold_reset: cold reset timeout (GSR=0x44)
* Error: Driver 'pxa2xx-ac97' is already registered, aborting...Quoted 6 lines
The AC97 interface is added in the machine initialization through the
pxa_set_ac97_info()in the same way as tosa and many others and this could explain the second error message...Any insight would be appreciated!
Better if you could come up with a patch or source code for analysis.
Dne St 7. dubna 2010 11:13:59 Jakob Viketoft napsal(a):
Quoted 9 lines
I'm including the source code for the machine driver inline here, but not as a patch as it's not in patch state yet. It's really quite basic. Adding a printk (with
KERN_ERR) in thecolibri270_v2_ac97_initfunction doesn't show up in dmesg and that makes me believe it's never entered. Thesnd_soc_dapm_nc_pincalls doesn't seem to have an effect either...Regards,
/Jakob
Hi, first, please keep the CC consistent.
Quoted 2 lines
-----------
...
Quoted 15 lines
static int
colibri270_v2_ac97_init(struct snd_soc_codec *codec){ /* Unused inputs */ snd_soc_dapm_nc_pin(codec, "MIC2"); snd_soc_dapm_nc_pin(codec, "PHONE"); snd_soc_dapm_nc_pin(codec, "PC_BEEP"); /* Unused outputs */ snd_soc_dapm_nc_pin(codec, "LOUT2"); snd_soc_dapm_nc_pin(codec, "ROUT2"); snd_soc_dapm_nc_pin(codec, "OUT3"); snd_soc_dapm_nc_pin(codec, "MONOOUT"); snd_soc_dapm_sync(codec);
Check retval here ?
Quoted 3 lines
return 0; }
...
Quoted 7 lines
static void
__exitcolibri270_v2_exit(void){ platform_device_unregister(colibri270_v2_snd_device); }
module_init(colibri270_v2_init);module_exit(colibri270_v2_exit);
Maybe take a look at palm27x.c, it's registered as a platform_device there (and imo fits better the model).
Mark, what do you think? Correct me as I might be wrong here.
Quoted 47 lines
/* Module information */
MODULE_AUTHOR("Jakob Viketoft");MODULE_DESCRIPTION("ALSA SoC Toradex Colibri 270 v2");MODULE_LICENSE("GPL");Quoted 27 lines · Eric Miao
On Wed, Apr 7, 2010 at 5:50 AM, Jakob Viketoft
Quoted 24 lines · <[email protected]> wrote:
Hello!
I'm trying to add sound support to a Toradex Colibri 270 v2 card, but have run into some strangeness which I don't quite understand. The v2 of this card uses the WM9712 codec and I've written a machine driver to tie the codec and the pxa2xx-ac97 driver together. I'm using the 2.6.33.1 kernel and my machine driver is a simplified version of the tosa driver (no power management or headphone jack logic). However, I get two
problems: 1. Internal clock and headphone output is turned off in theAC97_POWERDOWNregister and I can't see where to (properly) turn it on, neither in kernel space or in userland. No-one else using this codec seem to be doing it.
2. The init function defined in mysnd_soc_cardstruct doesn't seem to get called, resulting in way too many mixer settings (I have a number ofsnd_soc_dapm_nc_pincalls) with alsa, but might it also have something to do with problem 1?When explicitly writing 0 (the ugly way) to the
AC97_POWERDOWNregister I get perfect sound output, but I would like to do it the right way.Two error reports from the dmesg output that might be relevant:
*pxa2xx_ac97_try_cold_reset: cold reset timeout (GSR=0x44)
* Error: Driver 'pxa2xx-ac97' is already registered, aborting...Quoted 7 lines
Quoted 5 lines
The AC97 interface is added in the machine initialization through the
pxa_set_ac97_info()in the same way as tosa and many others and this could explain the second error message...Any insight would be appreciated!
Better if you could come up with a patch or source code for analysis.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Dne ?t 6. dubna 2010 23:50:54 Jakob Viketoft napsal(a):
Quoted 17 lines
Hello!
I'm trying to add sound support to a Toradex Colibri 270 v2 card, but have run into some strangeness which I don't quite understand. The v2 of this card uses the WM9712 codec and I've written a machine driver to tie the codec and the pxa2xx-ac97 driver together. I'm using the 2.6.33.1 kernel and my machine driver is a simplified version of the tosa driver (no power management or headphone jack logic). However, I get two problems:
1. Internal clock and headphone output is turned off in theAC97_POWERDOWNregister and I can't see where to (properly) turn it on, neither in kernel space or in userland. No-one else using this codec seem to be doing it.
2. The init function defined in mysnd_soc_cardstruct doesn't seem to get called, resulting in way too many mixer settings (I have a number ofsnd_soc_dapm_nc_pincalls) with alsa, but might it also have something to do with problem 1?
Quoted 7 lines
When explicitly writing 0 (the ugly way) to the
AC97_POWERDOWNregister I get perfect sound output, but I would like to do it the right way.Two error reports from the dmesg output that might be relevant:
*pxa2xx_ac97_try_cold_reset: cold reset timeout (GSR=0x44)
* Error: Driver 'pxa2xx-ac97' is already registered, aborting...
Aren't you mixing ASoC driver with non-ASoC driver? Check how this is done on the palmtx for example (and the pxa27x.c asoc driver)
Quoted 11 lines
The AC97 interface is added in the machine initialization through the
pxa_set_ac97_info()in the same way as tosa and many others and this could explain the second error message...Any insight would be appreciated!
Regards,
/Jakob
CC Mark Brown
Quoted 6 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Do you mean mixing the AC97 non-asoc and asoc drivers or the drivers for the WM9712? I can't see the possibility of mixing anything for the WM9712, but I'm unsure of the distinction between the different AC97 pieces.
The only source code difference I can see is that the palmtx is adding a platform_driver in sound/soc/pxa/palm27x.c and a platform_device in arch/arm/mach-pxa/palmtx.c. But I haven't seen this in any of the "reference" drivers I looked at (mentioned in documentation), like spitz.c and corgi.c (which doesn't use ac97) but neither in tosa.c.
Should this make a difference? My module init function gets called, it's just the snd_soc_dai_link[0].init function that doesn't.
Regards,
/Jakob
Quoted 48 lines · Marek Vasut
Dne ?t 6. dubna 2010 23:50:54 Jakob Viketoft napsal(a):
Quoted 17 lines
Hello!
I'm trying to add sound support to a Toradex Colibri 270 v2 card, but have run into some strangeness which I don't quite understand. The v2 of this card uses the WM9712 codec and I've written a machine driver to tie the codec and the pxa2xx-ac97 driver together. I'm using the 2.6.33.1 kernel and my machine driver is a simplified version of the tosa driver (no power management or headphone jack logic). However, I get two problems:
1. Internal clock and headphone output is turned off in theAC97_POWERDOWNregister and I can't see where to (properly) turn it on, neither in kernel space or in userland. No-one else using this codec seem to be doing it.
2. The init function defined in mysnd_soc_cardstruct doesn't seem to get called, resulting in way too many mixer settings (I have a number ofsnd_soc_dapm_nc_pincalls) with alsa, but might it also have something to do with problem 1?Quoted 7 lines
When explicitly writing 0 (the ugly way) to the
AC97_POWERDOWNregister I get perfect sound output, but I would like to do it the right way.Two error reports from the dmesg output that might be relevant:
*pxa2xx_ac97_try_cold_reset: cold reset timeout (GSR=0x44)
* Error: Driver 'pxa2xx-ac97' is already registered, aborting...Aren't you mixing ASoC driver with non-ASoC driver? Check how this is done on the palmtx for example (and the
pxa27x.casoc driver)Quoted 11 lines
The AC97 interface is added in the machine initialization through the
pxa_set_ac97_info()in the same way as tosa and many others and this could explain the second error message...Any insight would be appreciated!
Regards,
/Jakob
CC Mark Brown
Quoted 5 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Wed, Apr 07, 2010 at 11:37:24AM +0200, Jakob Viketoft wrote:
Please don't top post...
Quoted 4 lines
Do you mean mixing the AC97 non-asoc and asoc drivers or the drivers for the WM9712? I can't see the possibility of mixing anything for the WM9712, but I'm unsure of the distinction between the different AC97 pieces.
...without context it's hard to work out what you are talking about.
Quoted 2 lines
Should this make a difference? My module init function gets called, it's just the snd_soc_dai_link[0].init function that doesn't.
Build soc-core.c with #define DEBUG at the top then look at your logs
Trying to bring two threads down to one.
Quoted 9 lines · Mark Brown
On Wed, Apr 07, 2010 at 11:37:24AM +0200, Jakob Viketoft wrote:
Please don't top post...
Quoted 4 lines
Do you mean mixing the AC97 non-asoc and asoc drivers or the drivers for the WM9712? I can't see the possibility of mixing anything for the WM9712, but I'm unsure of the distinction between the different AC97 pieces.
Quoted 6 lines
...without context it's hard to work out what you are talking about.
Quoted 2 lines
Should this make a difference? My module init function gets called, it's just the snd_soc_dai_link[0].init function that doesn't.
Build
soc-core.cwith #define DEBUG at the top then look at your logs
I've run with DEBUG defined and seen a bit more specifics. I have also created a device in the board init and added a driver in my machine code as per the palmtx code. Nothing I've done seem to change the behaviour and I can't quite get my head around what's going on. Does anyone run a pxa270 board with AC97 sound and can tell me what output they get from dmesg?
As I said before, by writing 0 to the AC97_POWERDOWN register (enabling everything) I get perfect sound output, so something seems right. It just won't go all the way...
The dmesg output:
Registered platform 'pxa2xx-audio'
Error: Driver 'pxa2xx-ac97' is already registered, aborting... soc-audio soc-audio: DAI pxa2xx-ac97 not registered soc-audio soc-audio: Registered card 'Colibri 270 v2' ALSA device list:
#0: pxa2xx-ac97 (Wolfson WM9711,WM9712,WM9715)
The pxa2xx-ac97 DAI not being registered does seem troublesome because the code in soc_core won't continue without this. Any insights?
Quoted 6 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 3 lines · Jakob Viketoft
The dmesg output:
Registered platform 'pxa2xx-audio'
Error: Driver 'pxa2xx-ac97' is already registered, aborting...
Have you compiled in both the sound/arm and sound/soc AC97 support by any chance?
Quoted 8 lines · Mark Brown
Quoted 3 lines · Jakob Viketoft
The dmesg output:
Registered platform 'pxa2xx-audio'
Error: Driver 'pxa2xx-ac97' is already registered, aborting...Have you compiled in both the
sound/armandsound/socAC97 support by any chance?
Yes, it appears so, the AC97 was used by an other driver accessing non-sound functions on the same chip. I tried disabling the sound/arm ac97 part but that gives me no sound cards at all. Currently I have the following (with no sound card found):
CONFIG_SND_AC97_CODEC=y
# CONFIG_SND_AC97_POWER_SAVE is not setCONFIG_SND_PXA2XX_LIB_AC97=y
# CONFIG_SND_PXA2XX_AC97 is not setCONFIG_SND_SOC_AC97_BUS=yCONFIG_SND_PXA2XX_SOC_AC97=yCONFIG_AC97_BUS=y
Quoted 6 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 7 lines · Jakob Viketoft
Mark Brown wrote:
Yes, it appears so, the AC97 was used by an other driver accessing non-sound functions on the same chip. I tried disabling the
sound/armac97 part but that gives me no sound cards at all. Currently I have the following (with no sound card found):
Quoted 7 lines
CONFIG_SND_AC97_CODEC=y
#CONFIG_SND_AC97_POWER_SAVEis not setCONFIG_SND_PXA2XX_LIB_AC97=y
#CONFIG_SND_PXA2XX_AC97is not setCONFIG_SND_SOC_AC97_BUS=yCONFIG_SND_PXA2XX_SOC_AC97=yCONFIG_AC97_BUS=y
You must have at least an ASoC machine driver in there as well otherwise these drivers are useless... Also, could you please provide the debug log requested previously?
Quoted 16 lines · Mark Brown
Quoted 7 lines · Jakob Viketoft
Mark Brown wrote:
Yes, it appears so, the AC97 was used by an other driver accessing non-sound functions on the same chip. I tried disabling the
sound/armac97 part but that gives me no sound cards at all. Currently I have the following (with no sound card found):Quoted 7 lines
CONFIG_SND_AC97_CODEC=y
#CONFIG_SND_AC97_POWER_SAVEis not setCONFIG_SND_PXA2XX_LIB_AC97=y
#CONFIG_SND_PXA2XX_AC97is not setCONFIG_SND_SOC_AC97_BUS=yCONFIG_SND_PXA2XX_SOC_AC97=yCONFIG_AC97_BUS=y
Quoted 4 lines
You must have at least an ASoC machine driver in there as well otherwise these drivers are useless... Also, could you please provide the debug log requested previously?
Sorry, I just listed the AC97 stuff. In addition there is:CONFIG_SND=yCONFIG_SND_TIMER=yCONFIG_SND_PCM=yCONFIG_SND_JACK=yCONFIG_SND_AC97_CODEC=yCONFIG_SND_DRIVERS=yCONFIG_SND_ARM=yCONFIG_SND_PXA2XX_LIB=y CONFIG_SND_PXA2XX_LIB_AC97=y
# CONFIG_SND_PXA2XX_AC97 is not set CONFIG_SND_SOC=yCONFIG_SND_SOC_AC97_BUS=yCONFIG_SND_PXA2XX_SOC=y CONFIG_SND_PXA2XX_SOC_AC97=y CONFIG_SND_PXA2XX_SOC_COLIBRI270_V2=y CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_ALL_CODECS is not set CONFIG_SND_SOC_WM9712=y
The log output with kobject listed (do you need more info?)
kobject: 'soc-audio' (c3c20c80): kobject_add_internal: parent:
'drivers', set: 'drivers'
kobject: 'soc-audio' (c3c20c80): kobject_uevent_env
kobject: 'soc-audio' (c3c20c80): fill_kobj_path: path = '/bus/platform/drivers/soc-audio'
Registered platform 'pxa2xx-audio'
kobject: 'pxa2xx-ac97' (c3c20c20): kobject_add_internal: parent:
'drivers', set: 'drivers'
Probed pxa2xx_ac97, trying to register DAI
Registered DAI 'pxa2xx-ac97'
Registered DAI 'pxa2xx-ac97-aux'
Registered DAI 'pxa2xx-ac97-mic'
kobject: 'pxa2xx-ac97' (c3c20c20): kobject_uevent_env
kobject: 'pxa2xx-ac97' (c3c20c20): fill_kobj_path: path = '/bus/platform/drivers/pxa2xx-ac97'
kobject: 'colibri270-v2-asoc' (c3c20bc0): kobject_add_internal: parent:
'drivers', set: 'drivers'
kobject: 'colibri270-v2-asoc' (c3c20bc0): kobject_uevent_env
kobject: 'colibri270-v2-asoc' (c3c20bc0): fill_kobj_path: path = '/bus/platform/drivers/colibri270-v2-asoc'
ALSA device list:
No soundcards found.
It's a small step forward, but now I need to find out what happened to the sound card...
Quoted 5 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 9 lines · Jakob Viketoft
The log output with kobject listed (do you need more info?)
kobject: 'colibri270-v2-asoc' (
c3c20bc0):kobject_add_internal:
parent: 'drivers', set: 'drivers'
kobject: 'colibri270-v2-asoc' (c3c20bc0):kobject_uevent_env
kobject: 'colibri270-v2-asoc' (c3c20bc0):fill_kobj_path: path = '/bus/platform/drivers/colibri270-v2-asoc'
ALSA device list:
No soundcards found.
So you've registered a driver for someting called 'collabri270-v2-asoc'
- what is that? This doesn't seem to correspond to the code you previously posted and there's no soc-audio anywhere here...
Quoted 12 lines · Mark Brown
Quoted 9 lines · Jakob Viketoft
The log output with kobject listed (do you need more info?)
kobject: 'colibri270-v2-asoc' (
c3c20bc0):kobject_add_internal:
parent: 'drivers', set: 'drivers'
kobject: 'colibri270-v2-asoc' (c3c20bc0):kobject_uevent_env
kobject: 'colibri270-v2-asoc' (c3c20bc0):fill_kobj_path: path = '/bus/platform/drivers/colibri270-v2-asoc'
ALSA device list:
No soundcards found.
Quoted 4 lines
So you've registered a driver for someting called 'collabri270-v2-asoc'
- what is that? This doesn't seem to correspond to the code you previously posted and there's no soc-audio anywhere here...
I had moved the platform_add_devices call in the board init file while tracking. Moving it back up a few lines in the code make my machine driver pop up as the sound card. Is this the correct behaviour? As suggested I have added the asoc device to my machine driver to look more like the palmtx is doing things. Does this mean I'm down to finding the right setting with amixer to get things running? New debug output:
kobject: 'soc-audio' (c3c27680): kobject_add_internal: parent:
'drivers', set: 'drivers'
kobject: 'soc-audio' (c3c27680): kobject_uevent_env
kobject: 'soc-audio' (c3c27680): fill_kobj_path: path = '/bus/platform/drivers/soc-audio'
Registered platform 'pxa2xx-audio'
kobject: 'pxa2xx-ac97' (c3c27620): kobject_add_internal: parent:
'drivers', set: 'drivers'
Probed pxa2xx_ac97, trying to register DAI
Registered DAI 'pxa2xx-ac97'
Registered DAI 'pxa2xx-ac97-aux'
Registered DAI 'pxa2xx-ac97-mic'
kobject: 'pxa2xx-ac97' (c3c27620): kobject_uevent_env
kobject: 'pxa2xx-ac97' (c3c27620): fill_kobj_path: path = '/bus/platform/drivers/pxa2xx-ac97'
kobject: 'colibri270-v2-asoc' (c3c275c0): kobject_add_internal: parent:
'drivers', set: 'drivers'
kobject: 'soc-audio' (c3c19a90): kobject_add_internal: parent:
'platform', set: 'devices'
kobject: 'soc-audio' (c3c19a90): kobject_uevent_env
kobject: 'soc-audio' (c3c19a90): fill_kobj_path: path = '/devices/platform/soc-audio'
soc-audio soc-audio: All components present, instantiating WM9711/WM9712 SoC Audio Codec 0.4
asoc: AC97 HiFi <-> pxa2xx-ac97 mapping ok
asoc: AC97 Aux <-> pxa2xx-ac97-aux mapping ok pxa2xx_ac97_try_cold_reset: cold reset timeout (GSR=0x44)
WM9712: Power standby
dapm: WM9712: configuring unknown pin PC_BEEP
kobject: 'pcmC0D1p' (c3c19848): kobject_add_internal: parent: 'sound',
set: 'devices'
kobject: 'pcmC0D1p' (c3c19848): kobject_uevent_env
kobject: 'pcmC0D1p' (c3c19848): fill_kobj_path: path = '/class/sound/pcmC0D1p'
kobject: 'soc-audio' (c3c19a90): fill_kobj_path: path = '/devices/platform/soc-audio'
kobject: 'pcmC0D0p' (c3c19788): kobject_add_internal: parent: 'sound',
set: 'devices'
kobject: 'pcmC0D0p' (c3c19788): kobject_uevent_env
kobject: 'pcmC0D0p' (c3c19788): fill_kobj_path: path = '/class/sound/pcmC0D0p'
kobject: 'soc-audio' (c3c19a90): fill_kobj_path: path = '/devices/platform/soc-audio'
kobject: 'pcmC0D0c' (c3c196c8): kobject_add_internal: parent: 'sound',
set: 'devices'
kobject: 'pcmC0D0c' (c3c196c8): kobject_uevent_env
kobject: 'pcmC0D0c' (c3c196c8): fill_kobj_path: path = '/class/sound/pcmC0D0c'
kobject: 'soc-audio' (c3c19a90): fill_kobj_path: path = '/devices/platform/soc-audio'
object: 'controlC0' (c3c19608): kobject_add_internal: parent: 'sound',
set: 'devices'
kobject: 'controlC0' (c3c19608): kobject_uevent_env
kobject: 'controlC0' (c3c19608): fill_kobj_path: path = '/class/sound/controlC0'
kobject: 'soc-audio' (c3c19a90): fill_kobj_path: path = '/devices/platform/soc-audio'
kobject: '0-0:WM9712' (c3c291ac): kobject_add_internal: parent:
'soc-audio', set: 'devices'
kobject: '0-0:WM9712' (c3c291ac): kobject_uevent_env
kobject: '0-0:WM9712' (c3c291ac): fill_kobj_path: path = '/devices/platform/soc-audio/0-0:WM9712'
soc-audio soc-audio: Registered card 'Colibri 270 v2'
kobject: 'colibri270-v2-asoc' (c3c275c0): kobject_uevent_env
kobject: 'colibri270-v2-asoc' (c3c275c0): fill_kobj_path: path = '/bus/platform/drivers/colibri270-v2-asoc'
ALSA device list:
#0: Colibri 270 v2 (WM9712)
Posting the updated machine driver code for completeness:
/*
* SoC audio driver for Toradex Colibri 270 v2
*
* Copyright 2010 BitSim AB
*
* Author: Jakob Viketoft <[email protected]>
*
* Copied from tosa.c:
* Copyright 2005 Wolfson Microelectronics PLC.
* Copyright 2005 Openedhand Ltd.
*
* Authors: Liam Girdwood <[email protected]>
* Richard Purdie <[email protected]>
*
* This program is free software; you can redistribute it and/or
modify it
* under the terms of the GNU General Public License as published
by the
* Free Software Foundation; either version 2 of the License, or (at
your
* option) any later version.
*
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/device.h>
#include <linux/gpio.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <asm/mach-types.h>
#include <mach/audio.h>
#include "../codecs/wm9712.h"
#include "pxa2xx-pcm.h"
#include "pxa2xx-ac97.h"
static struct snd_soc_card colibri270_v2;
static int colibri270_v2_ac97_init(struct snd_soc_codec *codec)
{
/* Unused inputs */
snd_soc_dapm_nc_pin(codec, "MIC2");
snd_soc_dapm_nc_pin(codec, "PHONE");
snd_soc_dapm_nc_pin(codec, "PC_BEEP");
/* Unused outputs */
snd_soc_dapm_nc_pin(codec, "LOUT2");
snd_soc_dapm_nc_pin(codec, "ROUT2");
snd_soc_dapm_nc_pin(codec, "OUT3");
snd_soc_dapm_nc_pin(codec, "MONOOUT");
snd_soc_dapm_sync(codec);
return 0;
}static struct snd_soc_dai_link colibri270_v2_dai[] = {
{
.name = "AC97",
.stream_name = "AC97 HiFi",
.cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_HIFI],
.codec_dai = &wm9712_dai[WM9712_DAI_AC97_HIFI],
.init = colibri270_v2_ac97_init,
},
{
.name = "AC97 Aux",
.stream_name = "AC97 Aux",
.cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_AUX],
.codec_dai = &wm9712_dai[WM9712_DAI_AC97_AUX],
},};
static struct snd_soc_card colibri270_v2 = {
.name = "Colibri 270 v2",
.platform = &pxa2xx_soc_platform,
.dai_link = colibri270_v2_dai,
.num_links = ARRAY_SIZE(colibri270_v2_dai),
};static struct snd_soc_device colibri270_v2_snd_devdata = {
.card = &colibri270_v2,
.codec_dev = &soc_codec_dev_wm9712,
};static struct platform_device *colibri270_v2_snd_device;
static int colibri270_v2_asoc_probe(struct platform_device *pdev)
{
int ret;
if (!machine_is_colibri())
return -ENODEV;
colibri270_v2_snd_device = platform_device_alloc("soc-audio", -1);
if (!colibri270_v2_snd_device)
return -ENOMEM;
platform_set_drvdata(colibri270_v2_snd_device,
&colibri270_v2_snd_devdata);
colibri270_v2_snd_devdata.dev = &colibri270_v2_snd_device->dev;
ret = platform_device_add(colibri270_v2_snd_device);
if (!ret)
return 0;
platform_device_put(colibri270_v2_snd_device);
return ret;
}static int __devexit colibri270_v2_asoc_remove(struct platform_device *pdev)
{
platform_device_unregister(colibri270_v2_snd_device);
return 0;
}static struct platform_driver colibri270_v2_wm9712_driver = {
.probe = colibri270_v2_asoc_probe,
.remove = __devexit_p(colibri270_v2_asoc_remove),
.driver = {
.name = "colibri270-v2-asoc",
.owner = THIS_MODULE,
},
};static int __init colibri270_v2_init(void)
{
platform_driver_register(&colibri270_v2_wm9712_driver);
}static void __exit colibri270_v2_exit(void)
{
platform_driver_unregister(&colibri270_v2_wm9712_driver);
}module_init(colibri270_v2_init);module_exit(colibri270_v2_exit);
/* Module information */MODULE_AUTHOR("Jakob Viketoft"); MODULE_DESCRIPTION("ALSA SoC Toradex Colibri 270 v2"); MODULE_LICENSE("GPL");
Quoted 5 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 3 lines · Jakob Viketoft
I had moved the
platform_add_devicescall in the board init file while tracking. Moving it back up a few lines in the code make my machine driver pop up as the sound card. Is this the correct
You shouldn't be registering the soc-audio device in arch/arm at all.
Quoted 4 lines
behaviour? As suggested I have added the asoc device to my machine driver to look more like the palmtx is doing things. Does this mean I'm down to finding the right setting with amixer to get things running? New debug output:
It appears so, yes.
Quoted 7 lines · Mark Brown
Quoted 3 lines · Jakob Viketoft
I had moved the
platform_add_devicescall in the board init file while tracking. Moving it back up a few lines in the code make my machine driver pop up as the sound card. Is this the correctYou shouldn't be registering the soc-audio device in
arch/armat all.
I don't, so no worries there. I just register my colibri-v2-asoc machine driver device.
Quoted 7 lines
Quoted 5 lines
behaviour? As suggested I have added the asoc device to my machine driver to look more like the palmtx is doing things. Does this mean I'm down to finding the right setting with amixer to get things running? New debug output:
It appears so, yes.
I finally got it working, thanks for all the help! Will be posting a patch after cleanup and when the rest of the system is working.
Quoted 6 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 16 lines · Mark Brown
Quoted 7 lines · Jakob Viketoft
Mark Brown wrote:
Yes, it appears so, the AC97 was used by an other driver accessing non-sound functions on the same chip. I tried disabling the
sound/armac97 part but that gives me no sound cards at all. Currently I have the following (with no sound card found):Quoted 7 lines
CONFIG_SND_AC97_CODEC=y
#CONFIG_SND_AC97_POWER_SAVEis not setCONFIG_SND_PXA2XX_LIB_AC97=y
#CONFIG_SND_PXA2XX_AC97is not setCONFIG_SND_SOC_AC97_BUS=yCONFIG_SND_PXA2XX_SOC_AC97=yCONFIG_AC97_BUS=y
Quoted 4 lines
You must have at least an ASoC machine driver in there as well otherwise these drivers are useless... Also, could you please provide the debug log requested previously?
Sorry, I just listed the AC97 stuff. In addition there is:CONFIG_SND=yCONFIG_SND_TIMER=yCONFIG_SND_PCM=yCONFIG_SND_JACK=yCONFIG_SND_AC97_CODEC=yCONFIG_SND_DRIVERS=yCONFIG_SND_ARM=yCONFIG_SND_PXA2XX_LIB=y CONFIG_SND_PXA2XX_LIB_AC97=y
# CONFIG_SND_PXA2XX_AC97 is not set CONFIG_SND_SOC=yCONFIG_SND_SOC_AC97_BUS=yCONFIG_SND_PXA2XX_SOC=y CONFIG_SND_PXA2XX_SOC_AC97=y CONFIG_SND_PXA2XX_SOC_COLIBRI270_V2=y CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_ALL_CODECS is not set CONFIG_SND_SOC_WM9712=y
The log output with kobject listed (do you need more info?)
kobject: 'soc-audio' (c3c20c80): kobject_add_internal: parent:
'drivers', set: 'drivers'
kobject: 'soc-audio' (c3c20c80): kobject_uevent_env
kobject: 'soc-audio' (c3c20c80): fill_kobj_path: path = '/bus/platform/drivers/soc-audio'
Registered platform 'pxa2xx-audio'
kobject: 'pxa2xx-ac97' (c3c20c20): kobject_add_internal: parent:
'drivers', set: 'drivers'
Probed pxa2xx_ac97, trying to register DAI
Registered DAI 'pxa2xx-ac97'
Registered DAI 'pxa2xx-ac97-aux'
Registered DAI 'pxa2xx-ac97-mic'
kobject: 'pxa2xx-ac97' (c3c20c20): kobject_uevent_env
kobject: 'pxa2xx-ac97' (c3c20c20): fill_kobj_path: path = '/bus/platform/drivers/pxa2xx-ac97'
kobject: 'colibri270-v2-asoc' (c3c20bc0): kobject_add_internal: parent:
'drivers', set: 'drivers'
kobject: 'colibri270-v2-asoc' (c3c20bc0): kobject_uevent_env
kobject: 'colibri270-v2-asoc' (c3c20bc0): fill_kobj_path: path = '/bus/platform/drivers/colibri270-v2-asoc'
ALSA device list:
No soundcards found.
It's a small step forward (the DAI gets registered), but now I need to find out what happened to the sound card...
Quoted 5 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel