aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-07-30 15:01:46 +0200
committerTakashi Iwai <tiwai@suse.de>2008-10-13 02:43:02 +0200
commitd7ffba19ce4c1b153d502a89d829400bf76d6c11 (patch)
treefca202a4d4cd4dae9ded85c274746693b22a5fb4 /sound/pci/hda/hda_codec.c
parent6c1f45ea89b59ad2cdbfa6779e23d77b274da0a7 (diff)
ALSA: hda - Add sysfs entries to hwdep devices
Added the sysfs entries to hwdep devices so that the new features like reconfiguration can be done via sysfs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 5b54ac07fcb..0741eda78a5 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -393,6 +393,20 @@ static int snd_hda_bus_dev_free(struct snd_device *device)
return snd_hda_bus_free(bus);
}
+#ifdef CONFIG_SND_HDA_HWDEP
+static int snd_hda_bus_dev_register(struct snd_device *device)
+{
+ struct hda_bus *bus = device->device_data;
+ struct hda_codec *codec;
+ list_for_each_entry(codec, &bus->codec_list, list) {
+ snd_hda_hwdep_add_sysfs(codec);
+ }
+ return 0;
+}
+#else
+#define snd_hda_bus_dev_register NULL
+#endif
+
/**
* snd_hda_bus_new - create a HDA bus
* @card: the card entry
@@ -408,6 +422,7 @@ int __devinit snd_hda_bus_new(struct snd_card *card,
struct hda_bus *bus;
int err;
static struct snd_device_ops dev_ops = {
+ .dev_register = snd_hda_bus_dev_register,
.dev_free = snd_hda_bus_dev_free,
};
@@ -686,9 +701,7 @@ int __devinit snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr,
}
snd_hda_codec_proc_new(codec);
-#ifdef CONFIG_SND_HDA_HWDEP
snd_hda_create_hwdep(codec);
-#endif
sprintf(component, "HDA:%08x,%08x,%08x", codec->vendor_id,
codec->subsystem_id, codec->revision_id);