Re: Audio support on Mini6410 board

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 01/11/2013 07:17 PM, Alexander Nestorov wrote:
samsung-ac97 samsung-ac97: cfg_gpio callback not provided!
samsung-ac97: probe of samsung-ac97 failed with error -22
soc-audio soc-audio: ASoC machine MINI6410 should use snd_soc_register_card()
soc-audio soc-audio: CPU DAI samsung-ac97 not registered
platform soc-audio: Driver soc-audio requests probe deferral
soc-audio: probe of soc-audio failed with error -22
ALSA device list:
   No soundcards found.

If I uncomment the line 56 in my diff (
//s3c64xx_ac97_setup_gpio(S3C64XX_AC97_GPD); ) I get
errors about the function not being defined. I do know that it's in
arch/arm/mach-s3c64xx/dev-audio.c
and include/linux/platform_data/asoc-s3c.h but I can't see any other
board-specific code using it.

Also S3C64XX_AC97_GPD not being defined, (but present in both files).
What include am I missing? I mean, of course I could include
asoc-s3c.h, but that's not how other boards are
doing it and they do have audio support. How is that done?

Just include <linux/platform_data/asoc-s3c.h> file in the board file.
This is the only header where the required functions are declared

/* The machine init code calls s3c*_ac97_setup_gpio with
 * one of these defines in order to select appropriate bank
 * of GPIO for AC97 pins
 */
#define S3C64XX_AC97_GPD  0
#define S3C64XX_AC97_GPE  1
extern void s3c64xx_ac97_setup_gpio(int);

Maybe some boards use default gpio configuration callbacks, grep shows
that only arch/arm/mach-s5pc100/mach-smdkc100.c includes this header.

Maybe it's worth to set statically a default gpio helper function:

--------------------8<------------------------

diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c
index e367e87..bc41c13 100644
--- a/arch/arm/mach-s3c64xx/dev-audio.c
+++ b/arch/arm/mach-s3c64xx/dev-audio.c
@@ -201,7 +201,9 @@ static struct resource s3c64xx_ac97_resource[] = {
        [4] = DEFINE_RES_IRQ(IRQ_AC97),
 };

-static struct s3c_audio_pdata s3c_ac97_pdata;
+static struct s3c_audio_pdata s3c_ac97_pdata = {
+       .cfg_gpio = s3c64xx_ac97_cfg_gpd
+};

 static u64 s3c64xx_ac97_dmamask = DMA_BIT_MASK(32);

--------------------8<------------------------

so there is no need to add s3c64xx_ac97_setup_gpio(S3C64XX_AC97_GPD)
call to boards that use the GPD port.

@Andrey One more thing, what do you mean by filter all writes to reg 0x0?
Literally something like:

void s3c_ac97_write(*ac97, reg, val){
   if(reg == 0x0)
     return;

   ...code here..
   ...
}

I think this is what he meant. I would just try it and then when you
get similar results to Andrey we might consider trying to find the root
cause of this problem.

--

Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux