diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-01-15 12:21:48 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-01-15 12:28:12 -0500 |
commit | 45e513b689b8b0a01ec2b01cc21816e4780d7ea6 (patch) | |
tree | 1c1b4657bf2065b076f08b98ff817e4a629a9c81 /sound/aoa/soundbus | |
parent | 37a76bd4f1b716949fc38a6842e89f0ccb8384d0 (diff) |
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')
-rw-r--r-- | sound/aoa/soundbus/i2sbus/core.c | 22 |
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 @@ | |||
1 | /* | 1 | /* |
2 | * i2sbus driver | 2 | * i2sbus driver |
3 | * | 3 | * |
4 | * Copyright 2006 Johannes Berg <johannes@sipsolutions.net> | 4 | * Copyright 2006-2008 Johannes Berg <johannes@sipsolutions.net> |
5 | * | 5 | * |
6 | * GPL v2, can be found in COPYING. | 6 | * GPL v2, can be found in COPYING. |
7 | */ | 7 | */ |
@@ -186,13 +186,25 @@ static int i2sbus_add_dev(struct macio_dev *macio, | |||
186 | } | 186 | } |
187 | } | 187 | } |
188 | if (i == 1) { | 188 | if (i == 1) { |
189 | const u32 *layout_id = | 189 | const u32 *id = of_get_property(sound, "layout-id", NULL); |
190 | of_get_property(sound, "layout-id", NULL); | 190 | |
191 | if (layout_id) { | 191 | if (id) { |
192 | layout = *layout_id; | 192 | layout = *id; |
193 | snprintf(dev->sound.modalias, 32, | 193 | snprintf(dev->sound.modalias, 32, |
194 | "sound-layout-%d", layout); | 194 | "sound-layout-%d", layout); |
195 | ok = 1; | 195 | ok = 1; |
196 | } else { | ||
197 | id = of_get_property(sound, "device-id", NULL); | ||
198 | /* | ||
199 | * We probably cannot handle all device-id machines, | ||
200 | * so restrict to those we do handle for now. | ||
201 | */ | ||
202 | if (id && (*id == 22 || *id == 14 || *id == 35)) { | ||
203 | snprintf(dev->sound.modalias, 32, | ||
204 | "aoa-device-id-%d", *id); | ||
205 | ok = 1; | ||
206 | layout = -1; | ||
207 | } | ||
196 | } | 208 | } |
197 | } | 209 | } |
198 | /* for the time being, until we can handle non-layout-id | 210 | /* for the time being, until we can handle non-layout-id |