All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Alexander Nestorov <alexandernst@gmail.com>
Cc: Andrey Gusakov <dron0gus@gmail.com>,
	linux-samsung-soc <linux-samsung-soc@vger.kernel.org>
Subject: Re: Audio support on Mini6410 board
Date: Fri, 11 Jan 2013 23:50:08 +0100	[thread overview]
Message-ID: <50F09720.7000102@gmail.com> (raw)
In-Reply-To: <CACuz9s3fMLQUdm8rbLUBKFbHi0E3tGHYUdHLGQQB9wYAt-zo8g@mail.gmail.com>

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

  reply	other threads:[~2013-01-11 22:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CACuz9s2w28eVG8qS9FXkUYAggXn7y2deHi2fPGizcURu_Bp4wg@mail.gmail.com>
     [not found] ` <50D19AE6.1080306@gmail.com>
     [not found]   ` <50D19D03.3060203@gmail.com>
     [not found]     ` <CACuz9s0hXGO_kBtWWLqMtktMyUhVBw-a0+auVEEfMvVEX4jD=w@mail.gmail.com>
     [not found]       ` <50D2109D.9@gmail.com>
     [not found]         ` <CACuz9s3vY3XvaWymLGwnzEudBkOUW4o-LpfJQTF0=mgy0cAhzg@mail.gmail.com>
     [not found]           ` <CACuz9s0a2A6F7zWyxQkBAZtj=Xi1NwT7cLEHe-fa6G5p__bUgg@mail.gmail.com>
     [not found]             ` <50D2F879.6020501@gmail.com>
     [not found]               ` <CACuz9s0rTGDGvB9PcKfjGvvt8vEdBDKKvQTx94fuj1MrDcNfOg@mail.gmail.com>
     [not found]                 ` <50D305CF.2030600@gmail.com>
     [not found]                   ` <CACuz9s19M2Qv8dOBY0h0EKNidD3r4G3esvAAWZAUDZEjFMCGiA@mail.gmail.com>
     [not found]                     ` <50D30F6C.7000004@gmail.com>
     [not found]                       ` <CACuz9s1_KKfVDCa4FvZLe9pEVWuqQzuLPX7pYX9Tw1NUQGPtzA@mail.gmail.com>
     [not found]                         ` <CACuz9s1waQ3VgRjdxw9CoiHX2BtfOaxTosqLDwhX+O7px0=JXg@mail.gmail.com>
     [not found]                           ` <50D31BF8.8040301@gmail.com>
     [not found]                             ` <CACuz9s3xtCndC2jks4T-ytSWxwTBjLbXUrehE tsNwm7H=wJC1Q@mail.gmail.com>
     [not found]                               ` <50D31F63.6090304@gmail.com>
     [not found]                                 ` <CACuz9s06v5nXNze+AAZyPTyxib4OXmqRi9E_Hw4SqBoprym0UA@mail.gmail.com>
     [not found]                                   ` <CACuz9s1mnOon=EywOrcxZjMOGrx2=f0-4sj6ietZFoEXC66uWQ@mail.gmail.com>
2013-01-10 23:16                                     ` Audio support on Mini6410 board [was Re: Hi again] Sylwester Nawrocki
2013-01-11 10:13                                       ` Andrey Gusakov
2013-01-11 18:17                                         ` Alexander Nestorov
2013-01-11 22:50                                           ` Sylwester Nawrocki [this message]
2013-01-12 17:07                                             ` Audio support on Mini6410 board Alexander Nestorov
2013-01-13 10:42                                               ` Andrey Gusakov
2013-01-14 22:44                                               ` Sylwester Nawrocki
     [not found]                                               ` <CACuz9s2fQYw-2pbE6dyNY7MiUSQxGiWArmXARxdwn1ULuDwm_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-15  9:30                                                 ` Juergen Beisert
2013-01-15 18:58                                                   ` [oselas] " Alexander Nestorov
2013-01-20 20:46                                                     ` Alexander Nestorov
2013-01-21  7:32                                                       ` Andrey Gusakov
2013-01-21  8:07                                                         ` Alexander Nestorov
2013-01-21  9:01                                                           ` Andrey Gusakov
2013-02-09 18:21                                                       ` Sylwester Nawrocki
2013-02-09 18:41                                                         ` Sylwester Nawrocki
2013-02-09 18:52                                                         ` Tomasz Figa
     [not found]                                   ` <50D85D93.7060201@gmail.com>
     [not found]                                     ` <CACuz9s19ssgPkVM3fB+3JQ5EOp9rTTOncaZro_rA=4c98DJGZQ@mail.gmail.com>
     [not found]                                       ` <CACuz9s1Bs4W8Nq_2R3uMQn4dJVahtrqWhfEAVH1PGwguZWALEA@mail.gmail.com>
     [not found]                                         ` <50E081DE.5070208@gmail.com>
     [not found]                                           ` <CACuz9s30Om4DTqy8=VVQma=+GEC0=vmbK_n1+ic4v6YiCfdYQQ@mail.gmail.com>
     [not found]                                             ` <50E359D2.4080105@gmail.com>
     [not found]                                               ` <CACuz9s3_+MsDcwNdPeyaTaPC3zvknCe0sZ6vGCENUcQdfz6ZJg@mail.gmail.com>
     [not found]                                                 ` <5109A415.8090300@gmail.com>
     [not found]                                                   ` <CACuz9s3nrTYsSvDSecV3OO4U22DmEVynmixkkJ6BQX83smNL1A@mail.gmail.com>
     [not found]                                                     ` <CACuz9s2MwexhTuNYf2rN5QSaN=Q0FZ2qJXK2Ud7ytkr-rUoQ6w@mail.gmail.com>
2013-02-06 23:53                                                       ` Hi again Sylwester Nawrocki
2013-02-07 22:34                                                         ` Sylwester Nawrocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50F09720.7000102@gmail.com \
    --to=sylvester.nawrocki@gmail.com \
    --cc=alexandernst@gmail.com \
    --cc=dron0gus@gmail.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.