Skip to contentSkip to conversation

pmac: sound support for latest laptops

PATCH In review [email protected] 1 participant 1 message Apr 12, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 45/198 pmac: sound support for latest laptops

From: Benjamin Herrenschmidt <[email protected]>

This patch hacks the current Alsa snd-powermac driver to add support for recent machine models with the tas3004 chip, that is basically new laptop models. The Mac Mini is _NOT_ yet supported by this patch (soon soon ...).
The G5s (iMac or Desktop) will need the rewritten sound driver on which
I'm working on (I _might_ get a hack for analog only on some G5s on the current driver, but no promise).

---

 25-akpm/sound/ppc/pmac.c    |   26 +++++++++++++++++++-----
 25-akpm/sound/ppc/tumbler.c |   46 +++++++++++++++++++++++++++++++-------------
 2 files changed, 53 insertions(+), 19 deletions(-)
sound/ppc/pmac.c renamed from sound/ppc/pmac.c~pmac-sound-support-for-latest-laptops +20 -6
diff -puN sound/ppc/pmac.c~pmac-sound-support-for-latest-laptops sound/ppc/pmac.c
@@ -881,6 +881,7 @@ static int __init snd_pmac_detect(pmac_t
 {
 	struct device_node *sound;
 	unsigned int *prop, l;
+	u32 layout_id = 0;
 
 	if (_machine != _MACH_Pmac)
 		return -ENODEV;
@@ -929,6 +930,9 @@ static int __init snd_pmac_detect(pmac_t
 	prop = (unsigned int *) get_property(sound, "sub-frame", NULL);
 	if (prop && *prop < 16)
 		chip->subframe = *prop;
+	prop = (unsigned int *) get_property(sound, "layout-id", NULL);
+	if (prop)
+		layout_id = *prop;
 	/* This should be verified on older screamers */
 	if (device_is_compatible(sound, "screamer")) {
 		chip->model = PMAC_SCREAMER;
@@ -961,12 +965,22 @@ static int __init snd_pmac_detect(pmac_t
 		chip->freq_table = tumbler_freqs;
 		chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
 	}
-	if (device_is_compatible(sound, "AOAKeylargo")) {
-		/* Seems to support the stock AWACS frequencies, but has
-		   a snapper mixer */
-		chip->model = PMAC_SNAPPER;
-		// chip->can_byte_swap = 0; /* FIXME: check this */
-		chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
+	if (device_is_compatible(sound, "AOAKeylargo") ||
+	    device_is_compatible(sound, "AOAbase")) {
+		/* For now, only support very basic TAS3004 based machines with
+		 * single frequency until proper i2s control is implemented
+		 */
+		switch(layout_id) {
+		case 0x48:
+		case 0x46:
+		case 0x33:
+		case 0x29:
+			chip->num_freqs = ARRAY_SIZE(tumbler_freqs);
+			chip->model = PMAC_SNAPPER;
+			chip->can_byte_swap = 0; /* FIXME: check this */
+			chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
+			break;
+		}
 	}
 	prop = (unsigned int *)get_property(sound, "device-id", NULL);
 	if (prop)
sound/ppc/tumbler.c renamed from sound/ppc/tumbler.c~pmac-sound-support-for-latest-laptops +33 -13

97 lines not on this page · raw message

_