Commit 469fb049 authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] Add CODEC and BUS device types

OPL3,OPL4,I2C lib core,L3 drivers,AK4117 receiver,ALSA Core
EMU8000 driver,AC97 Codec Core,AK4531 codec
Added SNDRV_DEV_CODEC and SNDRV_DEV_BUS types to tell from the lowlevel
components.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 03c95635
......@@ -58,6 +58,8 @@ typedef enum {
SNDRV_DEV_SEQUENCER,
SNDRV_DEV_HWDEP,
SNDRV_DEV_INFO,
SNDRV_DEV_BUS,
SNDRV_DEV_CODEC,
SNDRV_DEV_LOWLEVEL = (2*SNDRV_DEV_TYPE_RANGE_SIZE)
} snd_device_type_t;
......
......@@ -364,7 +364,7 @@ int snd_opl3_new(snd_card_t *card,
spin_lock_init(&opl3->timer_lock);
init_MUTEX(&opl3->access_mutex);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, opl3, &ops)) < 0) {
if ((err = snd_device_new(card, SNDRV_DEV_CODEC, opl3, &ops)) < 0) {
snd_opl3_free(opl3);
return err;
}
......
......@@ -229,22 +229,21 @@ int snd_opl4_create(snd_card_t *card,
return err;
}
err = snd_opl3_create(card, fm_port, fm_port + 2, opl4->hardware, 1, &opl3);
err = snd_device_new(card, SNDRV_DEV_CODEC, opl4, &ops);
if (err < 0) {
snd_opl4_free(opl4);
return err;
}
/* opl3 initialization disabled opl4, so reenable */
snd_opl4_enable_opl4(opl4);
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, opl4, &ops);
err = snd_opl3_create(card, fm_port, fm_port + 2, opl4->hardware, 1, &opl3);
if (err < 0) {
snd_device_free(card, opl3);
snd_opl4_free(opl4);
snd_device_free(card, opl4);
return err;
}
/* opl3 initialization disabled opl4, so reenable */
snd_opl4_enable_opl4(opl4);
snd_opl4_create_mixer(opl4);
#ifdef CONFIG_PROC_FS
snd_opl4_create_proc(opl4);
......
......@@ -94,7 +94,7 @@ int snd_i2c_bus_create(snd_card_t *card, const char *name, snd_i2c_bus_t *master
bus->master = master;
}
strlcpy(bus->name, name, sizeof(bus->name));
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, bus, &ops)) < 0) {
if ((err = snd_device_new(card, SNDRV_DEV_BUS, bus, &ops)) < 0) {
snd_i2c_bus_free(bus);
return err;
}
......
......@@ -17,7 +17,7 @@
* 2002-05-12 Tomas Kasparek another code cleanup
*/
/* $Id: uda1341.c,v 1.14 2004/11/29 14:09:45 tiwai Exp $ */
/* $Id: uda1341.c,v 1.15 2005/01/03 12:05:20 tiwai Exp $ */
#include <sound/driver.h>
#include <linux/module.h>
......@@ -679,7 +679,7 @@ int __init snd_chip_uda1341_mixer_new(snd_card_t *card, struct l3_client **clnt)
return err;
}
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, uda1341, &ops)) < 0) {
if ((err = snd_device_new(card, SNDRV_DEV_CODEC, uda1341, &ops)) < 0) {
l3_detach_client(uda1341);
kfree(uda1341);
return err;
......
......@@ -103,7 +103,7 @@ int snd_ak4117_create(snd_card_t *card, ak4117_read_t *read, ak4117_write_t *wri
chip->rcs1 = reg_read(chip, AK4117_REG_RCS1);
chip->rcs2 = reg_read(chip, AK4117_REG_RCS2);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0)
if ((err = snd_device_new(card, SNDRV_DEV_CODEC, chip, &ops)) < 0)
goto __fail;
if (r_ak4117)
......
......@@ -1133,7 +1133,7 @@ snd_emu8000_new(snd_card_t *card, int index, long port, int seq_ports, snd_seq_d
return err;
}
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, hw, &ops)) < 0) {
if ((err = snd_device_new(card, SNDRV_DEV_CODEC, hw, &ops)) < 0) {
snd_emu8000_free(hw);
return err;
}
......
......@@ -1844,7 +1844,7 @@ int snd_ac97_bus(snd_card_t *card, int num, ac97_bus_ops_t *ops,
bus->clock = 48000;
spin_lock_init(&bus->bus_lock);
snd_ac97_bus_proc_init(bus);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, bus, &dev_ops)) < 0) {
if ((err = snd_device_new(card, SNDRV_DEV_BUS, bus, &dev_ops)) < 0) {
snd_ac97_bus_free(bus);
return err;
}
......@@ -2137,7 +2137,7 @@ int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97)
snd_ac97_write_cache(ac97, AC97_EXTENDED_STATUS, reg);
}
snd_ac97_proc_init(ac97);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ac97, &ops)) < 0) {
if ((err = snd_device_new(card, SNDRV_DEV_CODEC, ac97, &ops)) < 0) {
snd_ac97_free(ac97);
return err;
}
......
......@@ -382,7 +382,7 @@ int snd_ak4531_mixer(snd_card_t * card, ak4531_t * _ak4531, ak4531_t ** rak4531)
}
}
snd_ak4531_proc_init(card, ak4531);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ak4531, &ops)) < 0) {
if ((err = snd_device_new(card, SNDRV_DEV_CODEC, ak4531, &ops)) < 0) {
snd_ak4531_free(ak4531);
return err;
}
......
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