Commit 61e77107fa849b69f50ebe96217ba3468a216ba8

Authored by Olaf Hering
Committed by Jaroslav Kysela
1 parent e0e6ce0380

[ALSA] create device symlink in snd-aoa

create sysfs device symlinks for snd-aoa in /sys/class/sound/controlC0 This
allows hald to recognize the device as sound device.  Furthermore it allows
the desktop user to actually access the sound device nodes.  hald and
related packages will modify the acl attributes.
Fixes https://bugzilla.novell.com/show_bug.cgi?id=106294
Acked-by: Johannes Berg <johannes@sipsolutions.net>

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>

Showing 5 changed files with 7 additions and 6 deletions Side-by-side Diff

... ... @@ -99,7 +99,7 @@
99 99 * that are not assigned yet are passed to the fabric
100 100 * again for reconsideration. */
101 101 extern int
102   -aoa_fabric_register(struct aoa_fabric *fabric);
  102 +aoa_fabric_register(struct aoa_fabric *fabric, struct device *dev);
103 103  
104 104 /* it is vital to call this when the fabric exits!
105 105 * When calling, the remove_codec will be called
sound/aoa/core/snd-aoa-alsa.c
... ... @@ -14,7 +14,7 @@
14 14  
15 15 static struct aoa_card *aoa_card;
16 16  
17   -int aoa_alsa_init(char *name, struct module *mod)
  17 +int aoa_alsa_init(char *name, struct module *mod, struct device *dev)
18 18 {
19 19 struct snd_card *alsa_card;
20 20 int err;
... ... @@ -28,6 +28,7 @@
28 28 return -ENOMEM;
29 29 aoa_card = alsa_card->private_data;
30 30 aoa_card->alsa_card = alsa_card;
  31 + alsa_card->dev = dev;
31 32 strlcpy(alsa_card->driver, "AppleOnbdAudio", sizeof(alsa_card->driver));
32 33 strlcpy(alsa_card->shortname, name, sizeof(alsa_card->shortname));
33 34 strlcpy(alsa_card->longname, name, sizeof(alsa_card->longname));
sound/aoa/core/snd-aoa-alsa.h
... ... @@ -10,7 +10,7 @@
10 10 #define __SND_AOA_ALSA_H
11 11 #include "../aoa.h"
12 12  
13   -extern int aoa_alsa_init(char *name, struct module *mod);
  13 +extern int aoa_alsa_init(char *name, struct module *mod, struct device *dev);
14 14 extern void aoa_alsa_cleanup(void);
15 15  
16 16 #endif /* __SND_AOA_ALSA_H */
sound/aoa/core/snd-aoa-core.c
... ... @@ -82,7 +82,7 @@
82 82 }
83 83 EXPORT_SYMBOL_GPL(aoa_codec_unregister);
84 84  
85   -int aoa_fabric_register(struct aoa_fabric *new_fabric)
  85 +int aoa_fabric_register(struct aoa_fabric *new_fabric, struct device *dev)
86 86 {
87 87 struct aoa_codec *c;
88 88 int err;
... ... @@ -98,7 +98,7 @@
98 98 if (!new_fabric)
99 99 return -EINVAL;
100 100  
101   - err = aoa_alsa_init(new_fabric->name, new_fabric->owner);
  101 + err = aoa_alsa_init(new_fabric->name, new_fabric->owner, dev);
102 102 if (err)
103 103 return err;
104 104  
sound/aoa/fabrics/snd-aoa-fabric-layout.c
... ... @@ -1014,7 +1014,7 @@
1014 1014  
1015 1015 ldev->gpio.methods->init(&ldev->gpio);
1016 1016  
1017   - err = aoa_fabric_register(&layout_fabric);
  1017 + err = aoa_fabric_register(&layout_fabric, &sdev->ofdev.dev);
1018 1018 if (err && err != -EALREADY) {
1019 1019 printk(KERN_INFO "snd-aoa-fabric-layout: can't use,"
1020 1020 " another fabric is active!\n");