summary refs log tree commit diff
path: root/sound/aoa/soundbus/i2sbus
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-01-15 18:21:48 +0100
committerTakashi Iwai <tiwai@suse.de>2009-01-15 18:28:12 +0100
commit45e513b689b8b0a01ec2b01cc21816e4780d7ea6 (patch)
tree1c1b4657bf2065b076f08b98ff817e4a629a9c81 /sound/aoa/soundbus/i2sbus
parent37a76bd4f1b716949fc38a6842e89f0ccb8384d0 (diff)
downloadlinux-45e513b689b8b0a01ec2b01cc21816e4780d7ea6.tar.gz
ALSA: snd-aoa: handle older machines
This patch changes snd-aoa to handle some older machines that are
currently handled by snd-powermac. snd-aoa has a number of advantages
though, notably it can autoload better and is generally a more modern
driver.

By hardcoding the accepted device-ids (last hunk of the patch) I'm
trying to avoid regressions because this driver will otherwise load
automatically and not let snd-powermac load. People who are unhappy
with snd-powermac and have a device-id property in the device tree
are encouraged to read this patch and make a patch to amend this as
appropriate.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/aoa/soundbus/i2sbus')
-rw-r--r--sound/aoa/soundbus/i2sbus/core.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c
index be468edf3ecb..418c84c99d69 100644
--- a/sound/aoa/soundbus/i2sbus/core.c
+++ b/sound/aoa/soundbus/i2sbus/core.c
@@ -1,7 +1,7 @@
 /*
  * i2sbus driver
  *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2006-2008 Johannes Berg <johannes@sipsolutions.net>
  *
  * GPL v2, can be found in COPYING.
  */
@@ -186,13 +186,25 @@ static int i2sbus_add_dev(struct macio_dev *macio,
 		}
 	}
 	if (i == 1) {
-		const u32 *layout_id =
-			of_get_property(sound, "layout-id", NULL);
-		if (layout_id) {
-			layout = *layout_id;
+		const u32 *id = of_get_property(sound, "layout-id", NULL);
+
+		if (id) {
+			layout = *id;
 			snprintf(dev->sound.modalias, 32,
 				 "sound-layout-%d", layout);
 			ok = 1;
+		} else {
+			id = of_get_property(sound, "device-id", NULL);
+			/*
+			 * We probably cannot handle all device-id machines,
+			 * so restrict to those we do handle for now.
+			 */
+			if (id && (*id == 22 || *id == 14 || *id == 35)) {
+				snprintf(dev->sound.modalias, 32,
+					 "aoa-device-id-%d", *id);
+				ok = 1;
+				layout = -1;
+			}
 		}
 	}
 	/* for the time being, until we can handle non-layout-id