Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Mar 2009 17:13:13 +0100
From:      Marco Trillo <marcotrillo@gmail.com>
To:        Justin Hibbits <jrh29@alumni.cwru.edu>
Cc:        freebsd-ppc@freebsd.org
Subject:   Re: No mixer with Snapper
Message-ID:  <b9c23c9f0903010813p8d1aa55nd2a3f6d94547862b@mail.gmail.com>
In-Reply-To: <20090301142432.GC1166@narn.knownspace>
References:  <20090228165533.GA1166@narn.knownspace> <b9c23c9f0903010445k32205622u6dca98b98a26e93b@mail.gmail.com> <20090301142432.GC1166@narn.knownspace>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Hi,

On 3/1/09, Justin Hibbits <jrh29@alumni.cwru.edu> wrote:
> On Sun, Mar 01, 2009 at 01:45:57PM +0100, Marco Trillo wrote:
>> On 2/28/09, Justin Hibbits <jrh29@alumni.cwru.edu> wrote:
>> > After upgrading my kernel to one with the Snapper audio driver
>> > integrated,
>> > there
>> > is no longer a /dev/mixer, so mixer setting does not work.  I have a DSP
>> > device,
>> >    and sound does play, it's just very quiet.  Output from sndstat is:
>> >
>> > FreeBSD Audio Driver (newpcm: 32bit 2007061600/powerpc)
>> > Installed devices:
>> > pcm0: <Apple I2S Audio Controller> at i2s [MPSAFE] (1p:1v/0r:0v channels
>> > default)
>> >
>> > Previously I was using Marco's AOA2 patch, which worked well, and had an
>> > adjustable mixer.
>> >
>>
>> Hmm... the version of the AOA driver in -current changed the way the
>> mixer is detected: it now attaches a real I2C device driver to the
>> mixer device node.
>>
>> It seems that in this case the device node properties are different to
>> what the driver knows, so it fails to match.
>>
>> Could you send the output of the 'i2c' OF device tree? Something like
>> the following, from FreeBSD -current:
>>
>> % ofwdump -pr mac-io/i2c
>>
>
> Attached is the output of ofwdump.
>

Thanks! The problem is that an <i2c-address> property is used, while
the OFW-I2C code only looks for <reg>.

The attached patch -- to apply in /usr/src/sys -- makes the OFW-I2C
code also look for the <i2c-address> property. With the patch, the
mixer should attach and work fine.

Regards
Marco

[-- Attachment #2 --]
--- dev/ofw/ofw_iicbus.c.orig	2009-03-01 16:41:57.000000000 +0100
+++ dev/ofw/ofw_iicbus.c	2009-03-01 16:45:50.000000000 +0100
@@ -118,7 +118,8 @@
 	node = ofw_bus_get_node(dev);
 
 	for (child = OF_child(node); child != 0; child = OF_peer(child)) {
-		if (OF_getprop(child, "reg", &addr, sizeof(addr)) == -1)
+		if (OF_getprop(child, "reg", &addr, sizeof(addr)) == -1 && 
+		    OF_getprop(child, "i2c-address", &addr, sizeof(addr)) == -1)
 			continue;
 
 		/*
home | help

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