Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Nov 2008 10:59:09 +0100
From:      "Marco Trillo" <marcotrillo@gmail.com>
To:        "Andreas Tobler" <andreast-list@fgznet.ch>
Cc:        FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: feedback: Apple Tumbler and Snapper audio: looking for testers
Message-ID:  <b9c23c9f0811040159p22278891j65669ae63330b43e@mail.gmail.com>
In-Reply-To: <490F5E89.4040608@fgznet.ch>
References:  <490F5E89.4040608@fgznet.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Mon, Nov 3, 2008 at 9:26 PM, Andreas Tobler <andreast-list@fgznet.ch> wrote:
> took a while, but finally I managed to test your patch on my AluBook.
>
> It seems to work. I can hear a very quite output either on built-in speaker
> or on headphones.
>
> I've done this on yesterdays src tree. Including my speed hacks.
>
> The messages from the kernel:
>
[...]
> kiic0: <Keywest I2C controller> mem 0x18000-0x18fff irq 26 on macio0
>
[...]
> Unfortunately I do not seem to be able to use the mixer correctly. mixer
> doesn't report a default device. So I can't set the volume.

Thanks a lot for testing the driver!

Hmm... it seems that it is not able to detect the codec, so the volume
cannot be changed.

I think the following patch should solve this problem -- it makes the
driver also look for a "layout-id" property and use that, if the other
match attempts have failed.

The patch is for the /usr/src/sys/dev/sound/macio/i2s.c file:

--- i2s.c.orig  2008-10-09 11:05:57.000000000 +0200
+++ i2s.c       2008-11-04 10:50:39.000000000 +0100
@@ -526,6 +526,11 @@
        void            (*init)(struct i2s_softc *);
        int             (*set_volume)(void *, int, int);
 };
+enum {
+    I2S_CODEC_TUMBLER,
+       I2S_CODEC_SNAPPER,
+       I2S_CODEC_UNKNOWN
+};
 static struct i2s_codec i2s_codecs[] = {
        {"tumbler", NULL, 0x68, tumbler_init, tumbler_set_volume},
        {"snapper", "tas", 0x6a, snapper_init, tumbler_set_volume},
@@ -569,6 +574,24 @@
                        return 0;
                }
        }
+
+       /* If still no match, try with `layout-id' property. */
+       if (OF_getprop(soundbus, "layout-id", &ref, sizeof(ref)) ==
+           sizeof(ref)) {
+
+               c = NULL;
+               switch (ref) {
+               case 41:
+               case 51:
+                       c = &i2s_codecs[I2S_CODEC_SNAPPER];
+                       break;
+               }
+
+               if (c != NULL) {
+                   sc->codec = c;
+                       return 0;
+               }
+       }

        return -1;
 }


Thanks!
Marco



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b9c23c9f0811040159p22278891j65669ae63330b43e>