Commit 61e77107 authored by Olaf Hering's avatar Olaf Hering Committed by Jaroslav Kysela

[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=106294Acked-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent e0e6ce03
...@@ -99,7 +99,7 @@ struct aoa_fabric { ...@@ -99,7 +99,7 @@ struct aoa_fabric {
* that are not assigned yet are passed to the fabric * that are not assigned yet are passed to the fabric
* again for reconsideration. */ * again for reconsideration. */
extern int extern int
aoa_fabric_register(struct aoa_fabric *fabric); aoa_fabric_register(struct aoa_fabric *fabric, struct device *dev);
/* it is vital to call this when the fabric exits! /* it is vital to call this when the fabric exits!
* When calling, the remove_codec will be called * When calling, the remove_codec will be called
......
...@@ -14,7 +14,7 @@ MODULE_PARM_DESC(index, "index for AOA sound card."); ...@@ -14,7 +14,7 @@ MODULE_PARM_DESC(index, "index for AOA sound card.");
static struct aoa_card *aoa_card; static struct aoa_card *aoa_card;
int aoa_alsa_init(char *name, struct module *mod) int aoa_alsa_init(char *name, struct module *mod, struct device *dev)
{ {
struct snd_card *alsa_card; struct snd_card *alsa_card;
int err; int err;
...@@ -28,6 +28,7 @@ int aoa_alsa_init(char *name, struct module *mod) ...@@ -28,6 +28,7 @@ int aoa_alsa_init(char *name, struct module *mod)
return -ENOMEM; return -ENOMEM;
aoa_card = alsa_card->private_data; aoa_card = alsa_card->private_data;
aoa_card->alsa_card = alsa_card; aoa_card->alsa_card = alsa_card;
alsa_card->dev = dev;
strlcpy(alsa_card->driver, "AppleOnbdAudio", sizeof(alsa_card->driver)); strlcpy(alsa_card->driver, "AppleOnbdAudio", sizeof(alsa_card->driver));
strlcpy(alsa_card->shortname, name, sizeof(alsa_card->shortname)); strlcpy(alsa_card->shortname, name, sizeof(alsa_card->shortname));
strlcpy(alsa_card->longname, name, sizeof(alsa_card->longname)); strlcpy(alsa_card->longname, name, sizeof(alsa_card->longname));
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#define __SND_AOA_ALSA_H #define __SND_AOA_ALSA_H
#include "../aoa.h" #include "../aoa.h"
extern int aoa_alsa_init(char *name, struct module *mod); extern int aoa_alsa_init(char *name, struct module *mod, struct device *dev);
extern void aoa_alsa_cleanup(void); extern void aoa_alsa_cleanup(void);
#endif /* __SND_AOA_ALSA_H */ #endif /* __SND_AOA_ALSA_H */
...@@ -82,7 +82,7 @@ void aoa_codec_unregister(struct aoa_codec *codec) ...@@ -82,7 +82,7 @@ void aoa_codec_unregister(struct aoa_codec *codec)
} }
EXPORT_SYMBOL_GPL(aoa_codec_unregister); EXPORT_SYMBOL_GPL(aoa_codec_unregister);
int aoa_fabric_register(struct aoa_fabric *new_fabric) int aoa_fabric_register(struct aoa_fabric *new_fabric, struct device *dev)
{ {
struct aoa_codec *c; struct aoa_codec *c;
int err; int err;
...@@ -98,7 +98,7 @@ int aoa_fabric_register(struct aoa_fabric *new_fabric) ...@@ -98,7 +98,7 @@ int aoa_fabric_register(struct aoa_fabric *new_fabric)
if (!new_fabric) if (!new_fabric)
return -EINVAL; return -EINVAL;
err = aoa_alsa_init(new_fabric->name, new_fabric->owner); err = aoa_alsa_init(new_fabric->name, new_fabric->owner, dev);
if (err) if (err)
return err; return err;
......
...@@ -1014,7 +1014,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) ...@@ -1014,7 +1014,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
ldev->gpio.methods->init(&ldev->gpio); ldev->gpio.methods->init(&ldev->gpio);
err = aoa_fabric_register(&layout_fabric); err = aoa_fabric_register(&layout_fabric, &sdev->ofdev.dev);
if (err && err != -EALREADY) { if (err && err != -EALREADY) {
printk(KERN_INFO "snd-aoa-fabric-layout: can't use," printk(KERN_INFO "snd-aoa-fabric-layout: can't use,"
" another fabric is active!\n"); " another fabric is active!\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment