NetBSD-Bugs archive

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

Re: port-macppc/39414: No audio from awacs on PowerBook G3 (Firewire/Pismo)



On Wed, 27 Aug 2008, Jared D. McNeill wrote:
The audio-out jack on the back seems to work, but not the built-in speaker.

The following patch makes the built-in speaker work properly.

Index: awacs.c
===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/dev/awacs.c,v
retrieving revision 1.34
diff -u -r1.34 awacs.c
--- awacs.c     16 May 2008 02:41:50 -0000      1.34
+++ awacs.c     27 Aug 2008 12:27:23 -0000
@@ -85,6 +85,7 @@
        lwp_t *sc_thread;
        int sc_event;
        int sc_output_wanted;
+       int sc_need_parallel_output;
 #if NSGSMIX > 0
        device_t sc_sgsmix;
 #endif
@@ -283,6 +284,12 @@
 static const char *use_gpio4[] = {     "PowerMac3,3",
                                        NULL};

+/*
+ * list of machines that do not require AWACS_PARALLEL_OUTPUT
+ */
+static const char *no_parallel_output[] = {    "PowerBook3,1",
+                                               NULL};
+
 static int
 awacs_match(device_t parent, struct cfdata *match, void *aux)
 {
@@ -414,7 +421,7 @@
        awacs_write_codec(sc, sc->sc_codecctl0);

        /* Set loopthrough for external mixer on beige G3 */
-       sc->sc_codecctl1 |= (AWACS_LOOP_THROUGH | AWACS_PARALLEL_OUTPUT);
+       sc->sc_codecctl1 |= AWACS_LOOP_THROUGH;

         printf("%s: ", device_xname(sc->sc_dev));

@@ -451,6 +458,14 @@
                sc->sc_headphones_mask = 0x8;
                sc->sc_headphones_in = 0x8;
        }
+
+       if (of_compatible(root_node, no_parallel_output) != -1)
+               sc->sc_need_parallel_output = 0;
+       else {
+               sc->sc_need_parallel_output = 1;
+               sc->sc_codecctl1 |= AWACS_PARALLEL_OUTPUT;
+       }
+
        if (awacs_check_headphones(sc)) {

                 /* default output to headphones */
@@ -483,7 +498,9 @@
        /* Enable interrupts and looping mode. */
        /* XXX ... */

-       sc->sc_codecctl1 |= (AWACS_LOOP_THROUGH | AWACS_PARALLEL_OUTPUT);
+       sc->sc_codecctl1 |= AWACS_LOOP_THROUGH;
+       if (sc->sc_need_parallel_output)
+               sc->sc_codecctl1 |= AWACS_PARALLEL_OUTPUT;
        awacs_write_codec(sc, sc->sc_codecctl1);

 #if NSGSMIX > 0


Home | Main Index | Thread Index | Old Index