* AC97 problems with pxa... @ 2010-04-06 21:50 Jakob Viketoft 2010-04-07 2:09 ` Eric Miao 2010-04-07 7:50 ` Marek Vasut 0 siblings, 2 replies; 17+ messages in thread From: Jakob Viketoft @ 2010-04-06 21:50 UTC (permalink / raw) To: linux-arm-kernel 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 ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-06 21:50 AC97 problems with pxa Jakob Viketoft @ 2010-04-07 2:09 ` Eric Miao 2010-04-07 9:13 ` Jakob Viketoft 2010-04-07 7:50 ` Marek Vasut 1 sibling, 1 reply; 17+ messages in thread From: Eric Miao @ 2010-04-07 2:09 UTC (permalink / raw) To: linux-arm-kernel On Wed, Apr 7, 2010 at 5:50 AM, Jakob Viketoft <jakob.viketoft@bitsim.com> 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 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! > Better if you could come up with a patch or source code for analysis. ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-07 2:09 ` Eric Miao @ 2010-04-07 9:13 ` Jakob Viketoft 2010-04-07 19:08 ` Marek Vasut 0 siblings, 1 reply; 17+ messages in thread From: Jakob Viketoft @ 2010-04-07 9:13 UTC (permalink / raw) To: linux-arm-kernel 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 <javi@bitsim.com> * * Copied from tosa.c: * Copyright 2005 Wolfson Microelectronics PLC. * Copyright 2005 Openedhand Ltd. * * Authors: Liam Girdwood <lrg@slimlogic.co.uk> * Richard Purdie <richard@openedhand.com> * * 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"); Eric Miao wrote: > On Wed, Apr 7, 2010 at 5:50 AM, Jakob Viketoft > <jakob.viketoft@bitsim.com> 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 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! >> > > Better if you could come up with a patch or source code for analysis. > ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-07 9:13 ` Jakob Viketoft @ 2010-04-07 19:08 ` Marek Vasut 0 siblings, 0 replies; 17+ messages in thread From: Marek Vasut @ 2010-04-07 19:08 UTC (permalink / raw) To: linux-arm-kernel Dne St 7. dubna 2010 11:13:59 Jakob Viketoft napsal(a): > 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 Hi, first, please keep the CC consistent. > > ----------- ... > > 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 ? > > return 0; > } ... > static void __exit colibri270_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. > > /* Module information */ > MODULE_AUTHOR("Jakob Viketoft"); > MODULE_DESCRIPTION("ALSA SoC Toradex Colibri 270 v2"); > MODULE_LICENSE("GPL"); > > Eric Miao wrote: > > On Wed, Apr 7, 2010 at 5:50 AM, Jakob Viketoft > > > > <jakob.viketoft@bitsim.com> 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 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! > > > > 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 > ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-06 21:50 AC97 problems with pxa Jakob Viketoft 2010-04-07 2:09 ` Eric Miao @ 2010-04-07 7:50 ` Marek Vasut 2010-04-07 9:37 ` Jakob Viketoft 1 sibling, 1 reply; 17+ messages in thread From: Marek Vasut @ 2010-04-07 7:50 UTC (permalink / raw) To: linux-arm-kernel Dne ?t 6. dubna 2010 23:50:54 Jakob Viketoft napsal(a): > 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... > 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) > 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 > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel at lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-07 7:50 ` Marek Vasut @ 2010-04-07 9:37 ` Jakob Viketoft 2010-04-07 9:54 ` Mark Brown 0 siblings, 1 reply; 17+ messages in thread From: Jakob Viketoft @ 2010-04-07 9:37 UTC (permalink / raw) To: 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 Marek Vasut wrote: > Dne ?t 6. dubna 2010 23:50:54 Jakob Viketoft napsal(a): >> 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... >> > > 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) > >> 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 >> _______________________________________________ >> linux-arm-kernel mailing list >> linux-arm-kernel at lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >> > ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-07 9:37 ` Jakob Viketoft @ 2010-04-07 9:54 ` Mark Brown 2010-04-08 9:17 ` Jakob Viketoft 0 siblings, 1 reply; 17+ messages in thread From: Mark Brown @ 2010-04-07 9:54 UTC (permalink / raw) To: linux-arm-kernel On Wed, Apr 07, 2010 at 11:37:24AM +0200, Jakob Viketoft wrote: Please don't top post... > 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. > 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 ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-07 9:54 ` Mark Brown @ 2010-04-08 9:17 ` Jakob Viketoft 2010-04-08 9:54 ` Mark Brown 0 siblings, 1 reply; 17+ messages in thread From: Jakob Viketoft @ 2010-04-08 9:17 UTC (permalink / raw) To: linux-arm-kernel Trying to bring two threads down to one. Mark Brown wrote: > On Wed, Apr 07, 2010 at 11:37:24AM +0200, Jakob Viketoft wrote: > > Please don't top post... > >> 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. > >> 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 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? > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel at lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-08 9:17 ` Jakob Viketoft @ 2010-04-08 9:54 ` Mark Brown 2010-04-08 13:05 ` Jakob Viketoft 0 siblings, 1 reply; 17+ messages in thread From: Mark Brown @ 2010-04-08 9:54 UTC (permalink / raw) To: linux-arm-kernel On Thu, Apr 08, 2010 at 11:17:28AM +0200, Jakob Viketoft wrote: > 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? ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-08 9:54 ` Mark Brown @ 2010-04-08 13:05 ` Jakob Viketoft 2010-04-08 13:49 ` Mark Brown 0 siblings, 1 reply; 17+ messages in thread From: Jakob Viketoft @ 2010-04-08 13:05 UTC (permalink / raw) To: linux-arm-kernel Mark Brown wrote: > On Thu, Apr 08, 2010 at 11:17:28AM +0200, Jakob Viketoft wrote: > >> 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? 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 set CONFIG_SND_PXA2XX_LIB_AC97=y # CONFIG_SND_PXA2XX_AC97 is not set CONFIG_SND_SOC_AC97_BUS=y CONFIG_SND_PXA2XX_SOC_AC97=y CONFIG_AC97_BUS=y > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel at lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-08 13:05 ` Jakob Viketoft @ 2010-04-08 13:49 ` Mark Brown 2010-04-08 14:05 ` Jakob Viketoft 2010-04-08 14:06 ` Jakob Viketoft 0 siblings, 2 replies; 17+ messages in thread From: Mark Brown @ 2010-04-08 13:49 UTC (permalink / raw) To: linux-arm-kernel On Thu, Apr 08, 2010 at 03:05:04PM +0200, Jakob Viketoft wrote: > 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/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 set > CONFIG_SND_PXA2XX_LIB_AC97=y > # CONFIG_SND_PXA2XX_AC97 is not set > CONFIG_SND_SOC_AC97_BUS=y > CONFIG_SND_PXA2XX_SOC_AC97=y > CONFIG_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? ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-08 13:49 ` Mark Brown @ 2010-04-08 14:05 ` Jakob Viketoft 2010-04-08 14:12 ` Mark Brown 2010-04-08 14:06 ` Jakob Viketoft 1 sibling, 1 reply; 17+ messages in thread From: Jakob Viketoft @ 2010-04-08 14:05 UTC (permalink / raw) To: linux-arm-kernel Mark Brown wrote: > On Thu, Apr 08, 2010 at 03:05:04PM +0200, Jakob Viketoft wrote: >> 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/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 set >> CONFIG_SND_PXA2XX_LIB_AC97=y >> # CONFIG_SND_PXA2XX_AC97 is not set >> CONFIG_SND_SOC_AC97_BUS=y >> CONFIG_SND_PXA2XX_SOC_AC97=y >> CONFIG_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? > Sorry, I just listed the AC97 stuff. In addition there is: CONFIG_SND=y CONFIG_SND_TIMER=y CONFIG_SND_PCM=y CONFIG_SND_JACK=y CONFIG_SND_AC97_CODEC=y CONFIG_SND_DRIVERS=y CONFIG_SND_ARM=y CONFIG_SND_PXA2XX_LIB=y CONFIG_SND_PXA2XX_LIB_AC97=y # CONFIG_SND_PXA2XX_AC97 is not set CONFIG_SND_SOC=y CONFIG_SND_SOC_AC97_BUS=y CONFIG_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... > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel at lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-08 14:05 ` Jakob Viketoft @ 2010-04-08 14:12 ` Mark Brown 2010-04-08 14:35 ` Jakob Viketoft 0 siblings, 1 reply; 17+ messages in thread From: Mark Brown @ 2010-04-08 14:12 UTC (permalink / raw) To: linux-arm-kernel On Thu, Apr 08, 2010 at 04:05:49PM +0200, Jakob Viketoft wrote: > 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... ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-08 14:12 ` Mark Brown @ 2010-04-08 14:35 ` Jakob Viketoft 2010-04-08 14:44 ` Mark Brown 0 siblings, 1 reply; 17+ messages in thread From: Jakob Viketoft @ 2010-04-08 14:35 UTC (permalink / raw) To: linux-arm-kernel Mark Brown wrote: > On Thu, Apr 08, 2010 at 04:05:49PM +0200, Jakob Viketoft wrote: > >> 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... > 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 <javi@bitsim.com> * * Copied from tosa.c: * Copyright 2005 Wolfson Microelectronics PLC. * Copyright 2005 Openedhand Ltd. * * Authors: Liam Girdwood <lrg@slimlogic.co.uk> * Richard Purdie <richard@openedhand.com> * * 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"); > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel at lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-08 14:35 ` Jakob Viketoft @ 2010-04-08 14:44 ` Mark Brown 2010-04-08 15:07 ` Jakob Viketoft 0 siblings, 1 reply; 17+ messages in thread From: Mark Brown @ 2010-04-08 14:44 UTC (permalink / raw) To: linux-arm-kernel On Thu, Apr 08, 2010 at 04:35:35PM +0200, Jakob Viketoft wrote: > 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 You shouldn't be registering the soc-audio device in arch/arm at all. > 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. ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-08 14:44 ` Mark Brown @ 2010-04-08 15:07 ` Jakob Viketoft 0 siblings, 0 replies; 17+ messages in thread From: Jakob Viketoft @ 2010-04-08 15:07 UTC (permalink / raw) To: linux-arm-kernel Mark Brown wrote: > On Thu, Apr 08, 2010 at 04:35:35PM +0200, Jakob Viketoft wrote: > >> 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 > > You shouldn't be registering the soc-audio device in arch/arm at all. I don't, so no worries there. I just register my colibri-v2-asoc machine driver device. > >> 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. > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel at lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > ^ permalink raw reply [flat|nested] 17+ messages in thread
* AC97 problems with pxa... 2010-04-08 13:49 ` Mark Brown 2010-04-08 14:05 ` Jakob Viketoft @ 2010-04-08 14:06 ` Jakob Viketoft 1 sibling, 0 replies; 17+ messages in thread From: Jakob Viketoft @ 2010-04-08 14:06 UTC (permalink / raw) To: linux-arm-kernel Mark Brown wrote: > On Thu, Apr 08, 2010 at 03:05:04PM +0200, Jakob Viketoft wrote: >> 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/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 set >> CONFIG_SND_PXA2XX_LIB_AC97=y >> # CONFIG_SND_PXA2XX_AC97 is not set >> CONFIG_SND_SOC_AC97_BUS=y >> CONFIG_SND_PXA2XX_SOC_AC97=y >> CONFIG_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? > Sorry, I just listed the AC97 stuff. In addition there is: CONFIG_SND=y CONFIG_SND_TIMER=y CONFIG_SND_PCM=y CONFIG_SND_JACK=y CONFIG_SND_AC97_CODEC=y CONFIG_SND_DRIVERS=y CONFIG_SND_ARM=y CONFIG_SND_PXA2XX_LIB=y CONFIG_SND_PXA2XX_LIB_AC97=y # CONFIG_SND_PXA2XX_AC97 is not set CONFIG_SND_SOC=y CONFIG_SND_SOC_AC97_BUS=y CONFIG_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... > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel at lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2010-04-08 15:07 UTC | newest] Thread overview: 17+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-04-06 21:50 AC97 problems with pxa Jakob Viketoft 2010-04-07 2:09 ` Eric Miao 2010-04-07 9:13 ` Jakob Viketoft 2010-04-07 19:08 ` Marek Vasut 2010-04-07 7:50 ` Marek Vasut 2010-04-07 9:37 ` Jakob Viketoft 2010-04-07 9:54 ` Mark Brown 2010-04-08 9:17 ` Jakob Viketoft 2010-04-08 9:54 ` Mark Brown 2010-04-08 13:05 ` Jakob Viketoft 2010-04-08 13:49 ` Mark Brown 2010-04-08 14:05 ` Jakob Viketoft 2010-04-08 14:12 ` Mark Brown 2010-04-08 14:35 ` Jakob Viketoft 2010-04-08 14:44 ` Mark Brown 2010-04-08 15:07 ` Jakob Viketoft 2010-04-08 14:06 ` Jakob Viketoft
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).