diff --git a/[refs] b/[refs] index 28b0b6eb8382..e680189d277b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b028b81835d7503d68b230446cd5e39d14ff5b9f +refs/heads/master: 3733e424c4fcd8edff2090f0628f4fd245daddb5 diff --git a/trunk/include/linux/pci_ids.h b/trunk/include/linux/pci_ids.h index f23f8bf02b04..a311008af5e1 100644 --- a/trunk/include/linux/pci_ids.h +++ b/trunk/include/linux/pci_ids.h @@ -1308,7 +1308,6 @@ #define PCI_SUBDEVICE_ID_CREATIVE_SB08801 0x0041 #define PCI_SUBDEVICE_ID_CREATIVE_SB08802 0x0042 #define PCI_SUBDEVICE_ID_CREATIVE_SB08803 0x0043 -#define PCI_SUBDEVICE_ID_CREATIVE_SB1270 0x0062 #define PCI_SUBDEVICE_ID_CREATIVE_HENDRIX 0x6000 #define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */ diff --git a/trunk/sound/core/misc.c b/trunk/sound/core/misc.c index eb9fe2e1d291..2c41825c836e 100644 --- a/trunk/sound/core/misc.c +++ b/trunk/sound/core/misc.c @@ -58,6 +58,26 @@ static const char *sanity_file_name(const char *path) else return path; } + +/* print file and line with a certain printk prefix */ +static int print_snd_pfx(unsigned int level, const char *path, int line, + const char *format) +{ + const char *file = sanity_file_name(path); + char tmp[] = "<0>"; + const char *pfx = level ? KERN_DEBUG : KERN_DEFAULT; + int ret = 0; + + if (format[0] == '<' && format[2] == '>') { + tmp[1] = format[1]; + pfx = tmp; + ret = 1; + } + printk("%sALSA %s:%d: ", pfx, file, line); + return ret; +} +#else +#define print_snd_pfx(level, path, line, format) 0 #endif #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK) @@ -65,29 +85,15 @@ void __snd_printk(unsigned int level, const char *path, int line, const char *format, ...) { va_list args; -#ifdef CONFIG_SND_VERBOSE_PRINTK - struct va_format vaf; - char verbose_fmt[] = KERN_DEFAULT "ALSA %s:%d %pV"; -#endif - + #ifdef CONFIG_SND_DEBUG if (debug < level) return; #endif - va_start(args, format); -#ifdef CONFIG_SND_VERBOSE_PRINTK - vaf.fmt = format; - vaf.va = &args; - if (format[0] == '<' && format[2] == '>') { - memcpy(verbose_fmt, format, 3); - vaf.fmt = format + 3; - } else if (level) - memcpy(verbose_fmt, KERN_DEBUG, 3); - printk(verbose_fmt, sanity_file_name(path), line, &vaf); -#else + if (print_snd_pfx(level, path, line, format)) + format += 3; /* skip the printk level-prefix */ vprintk(format, args); -#endif va_end(args); } EXPORT_SYMBOL_GPL(__snd_printk); diff --git a/trunk/sound/pci/ad1889.c b/trunk/sound/pci/ad1889.c index d8f6fd65ebbb..fe617ee93214 100644 --- a/trunk/sound/pci/ad1889.c +++ b/trunk/sound/pci/ad1889.c @@ -1055,7 +1055,7 @@ static DEFINE_PCI_DEVICE_TABLE(snd_ad1889_ids) = { MODULE_DEVICE_TABLE(pci, snd_ad1889_ids); static struct pci_driver ad1889_pci_driver = { - .name = "AD1889 Audio", + .name = KBUILD_MODNAME, .id_table = snd_ad1889_ids, .probe = snd_ad1889_probe, .remove = __devexit_p(snd_ad1889_remove), diff --git a/trunk/sound/pci/ali5451/ali5451.c b/trunk/sound/pci/ali5451/ali5451.c index 5c6e322a48f0..2def167d7df6 100644 --- a/trunk/sound/pci/ali5451/ali5451.c +++ b/trunk/sound/pci/ali5451/ali5451.c @@ -2295,7 +2295,7 @@ static void __devexit snd_ali_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "ALI 5451", + .name = KBUILD_MODNAME, .id_table = snd_ali_ids, .probe = snd_ali_probe, .remove = __devexit_p(snd_ali_remove), diff --git a/trunk/sound/pci/als300.c b/trunk/sound/pci/als300.c index d7653cb7ac60..0958daccd15e 100644 --- a/trunk/sound/pci/als300.c +++ b/trunk/sound/pci/als300.c @@ -846,7 +846,7 @@ static int __devinit snd_als300_probe(struct pci_dev *pci, } static struct pci_driver driver = { - .name = "ALS300", + .name = KBUILD_MODNAME, .id_table = snd_als300_ids, .probe = snd_als300_probe, .remove = __devexit_p(snd_als300_remove), diff --git a/trunk/sound/pci/als4000.c b/trunk/sound/pci/als4000.c index 0e247cb90ecc..a9c1af33f276 100644 --- a/trunk/sound/pci/als4000.c +++ b/trunk/sound/pci/als4000.c @@ -1036,7 +1036,7 @@ static int snd_als4000_resume(struct pci_dev *pci) static struct pci_driver driver = { - .name = "ALS4000", + .name = KBUILD_MODNAME, .id_table = snd_als4000_ids, .probe = snd_card_als4000_probe, .remove = __devexit_p(snd_card_als4000_remove), diff --git a/trunk/sound/pci/asihpi/asihpi.c b/trunk/sound/pci/asihpi/asihpi.c index 2ca6f4f85b41..ddf882ed1dfb 100644 --- a/trunk/sound/pci/asihpi/asihpi.c +++ b/trunk/sound/pci/asihpi/asihpi.c @@ -2924,7 +2924,7 @@ static DEFINE_PCI_DEVICE_TABLE(asihpi_pci_tbl) = { MODULE_DEVICE_TABLE(pci, asihpi_pci_tbl); static struct pci_driver driver = { - .name = "asihpi", + .name = KBUILD_MODNAME, .id_table = asihpi_pci_tbl, .probe = snd_asihpi_probe, .remove = __devexit_p(snd_asihpi_remove), diff --git a/trunk/sound/pci/atiixp.c b/trunk/sound/pci/atiixp.c index 3119cd97a217..550b574b4734 100644 --- a/trunk/sound/pci/atiixp.c +++ b/trunk/sound/pci/atiixp.c @@ -1701,7 +1701,7 @@ static void __devexit snd_atiixp_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "ATI IXP AC97 controller", + .name = KBUILD_MODNAME, .id_table = snd_atiixp_ids, .probe = snd_atiixp_probe, .remove = __devexit_p(snd_atiixp_remove), diff --git a/trunk/sound/pci/atiixp_modem.c b/trunk/sound/pci/atiixp_modem.c index 2f74c2fdf1ea..2fef550bef94 100644 --- a/trunk/sound/pci/atiixp_modem.c +++ b/trunk/sound/pci/atiixp_modem.c @@ -1332,7 +1332,7 @@ static void __devexit snd_atiixp_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "ATI IXP MC97 controller", + .name = KBUILD_MODNAME, .id_table = snd_atiixp_ids, .probe = snd_atiixp_probe, .remove = __devexit_p(snd_atiixp_remove), diff --git a/trunk/sound/pci/au88x0/au88x0.c b/trunk/sound/pci/au88x0/au88x0.c index 7b72c88e449d..4933e4e9ac87 100644 --- a/trunk/sound/pci/au88x0/au88x0.c +++ b/trunk/sound/pci/au88x0/au88x0.c @@ -375,7 +375,7 @@ static void __devexit snd_vortex_remove(struct pci_dev *pci) // pci_driver definition static struct pci_driver driver = { - .name = CARD_NAME_SHORT, + .name = KBUILD_MODNAME, .id_table = snd_vortex_ids, .probe = snd_vortex_probe, .remove = __devexit_p(snd_vortex_remove), diff --git a/trunk/sound/pci/aw2/aw2-alsa.c b/trunk/sound/pci/aw2/aw2-alsa.c index c15002242d98..8410edb5fbaf 100644 --- a/trunk/sound/pci/aw2/aw2-alsa.c +++ b/trunk/sound/pci/aw2/aw2-alsa.c @@ -171,7 +171,7 @@ MODULE_DEVICE_TABLE(pci, snd_aw2_ids); /* pci_driver definition */ static struct pci_driver driver = { - .name = "Emagic Audiowerk 2", + .name = KBUILD_MODNAME, .id_table = snd_aw2_ids, .probe = snd_aw2_probe, .remove = __devexit_p(snd_aw2_remove), diff --git a/trunk/sound/pci/azt3328.c b/trunk/sound/pci/azt3328.c index 9b7a6346037a..71d3525719fc 100644 --- a/trunk/sound/pci/azt3328.c +++ b/trunk/sound/pci/azt3328.c @@ -2860,7 +2860,7 @@ snd_azf3328_resume(struct pci_dev *pci) static struct pci_driver driver = { - .name = "AZF3328", + .name = KBUILD_MODNAME, .id_table = snd_azf3328_ids, .probe = snd_azf3328_probe, .remove = __devexit_p(snd_azf3328_remove), diff --git a/trunk/sound/pci/bt87x.c b/trunk/sound/pci/bt87x.c index 2958a05b5293..89428099d811 100644 --- a/trunk/sound/pci/bt87x.c +++ b/trunk/sound/pci/bt87x.c @@ -965,7 +965,7 @@ static DEFINE_PCI_DEVICE_TABLE(snd_bt87x_default_ids) = { }; static struct pci_driver driver = { - .name = "Bt87x", + .name = KBUILD_MODNAME, .id_table = snd_bt87x_ids, .probe = snd_bt87x_probe, .remove = __devexit_p(snd_bt87x_remove), diff --git a/trunk/sound/pci/ca0106/ca0106_main.c b/trunk/sound/pci/ca0106/ca0106_main.c index 437759239694..620787509339 100644 --- a/trunk/sound/pci/ca0106/ca0106_main.c +++ b/trunk/sound/pci/ca0106/ca0106_main.c @@ -1933,7 +1933,7 @@ MODULE_DEVICE_TABLE(pci, snd_ca0106_ids); // pci_driver definition static struct pci_driver driver = { - .name = "CA0106", + .name = KBUILD_MODNAME, .id_table = snd_ca0106_ids, .probe = snd_ca0106_probe, .remove = __devexit_p(snd_ca0106_remove), diff --git a/trunk/sound/pci/cmipci.c b/trunk/sound/pci/cmipci.c index f4e573555da3..84af5bece127 100644 --- a/trunk/sound/pci/cmipci.c +++ b/trunk/sound/pci/cmipci.c @@ -3398,7 +3398,7 @@ static int snd_cmipci_resume(struct pci_dev *pci) #endif /* CONFIG_PM */ static struct pci_driver driver = { - .name = "C-Media PCI", + .name = KBUILD_MODNAME, .id_table = snd_cmipci_ids, .probe = snd_cmipci_probe, .remove = __devexit_p(snd_cmipci_remove), diff --git a/trunk/sound/pci/cs4281.c b/trunk/sound/pci/cs4281.c index 6772070ed492..67052d9069cf 100644 --- a/trunk/sound/pci/cs4281.c +++ b/trunk/sound/pci/cs4281.c @@ -2085,7 +2085,7 @@ static int cs4281_resume(struct pci_dev *pci) #endif /* CONFIG_PM */ static struct pci_driver driver = { - .name = "CS4281", + .name = KBUILD_MODNAME, .id_table = snd_cs4281_ids, .probe = snd_cs4281_probe, .remove = __devexit_p(snd_cs4281_remove), diff --git a/trunk/sound/pci/cs46xx/cs46xx.c b/trunk/sound/pci/cs46xx/cs46xx.c index 767fa7f06cd0..1af95559aaaa 100644 --- a/trunk/sound/pci/cs46xx/cs46xx.c +++ b/trunk/sound/pci/cs46xx/cs46xx.c @@ -162,7 +162,7 @@ static void __devexit snd_card_cs46xx_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "Sound Fusion CS46xx", + .name = KBUILD_MODNAME, .id_table = snd_cs46xx_ids, .probe = snd_card_cs46xx_probe, .remove = __devexit_p(snd_card_cs46xx_remove), diff --git a/trunk/sound/pci/cs5530.c b/trunk/sound/pci/cs5530.c index bc07e275d4d4..a4669346d146 100644 --- a/trunk/sound/pci/cs5530.c +++ b/trunk/sound/pci/cs5530.c @@ -285,7 +285,7 @@ static int __devinit snd_cs5530_probe(struct pci_dev *pci, } static struct pci_driver driver = { - .name = "CS5530_Audio", + .name = KBUILD_MODNAME, .id_table = snd_cs5530_ids, .probe = snd_cs5530_probe, .remove = __devexit_p(snd_cs5530_remove), diff --git a/trunk/sound/pci/cs5535audio/cs5535audio.c b/trunk/sound/pci/cs5535audio/cs5535audio.c index afb803708416..a6a877747e71 100644 --- a/trunk/sound/pci/cs5535audio/cs5535audio.c +++ b/trunk/sound/pci/cs5535audio/cs5535audio.c @@ -395,7 +395,7 @@ static void __devexit snd_cs5535audio_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = DRIVER_NAME, + .name = KBUILD_MODNAME, .id_table = snd_cs5535audio_ids, .probe = snd_cs5535audio_probe, .remove = __devexit_p(snd_cs5535audio_remove), diff --git a/trunk/sound/pci/ctxfi/ct20k2reg.h b/trunk/sound/pci/ctxfi/ct20k2reg.h index ca501ba03d64..e0394e3996e8 100644 --- a/trunk/sound/pci/ctxfi/ct20k2reg.h +++ b/trunk/sound/pci/ctxfi/ct20k2reg.h @@ -55,7 +55,6 @@ /* GPIO Registers */ #define GPIO_DATA 0x1B7020 #define GPIO_CTRL 0x1B7024 -#define GPIO_EXT_DATA 0x1B70A0 /* Virtual memory registers */ #define VMEM_PTPAL 0x1C6300 /* 0x1C6300 + (16 * Chn) */ diff --git a/trunk/sound/pci/ctxfi/ctatc.c b/trunk/sound/pci/ctxfi/ctatc.c index d8a4423539ce..13f33c0719d3 100644 --- a/trunk/sound/pci/ctxfi/ctatc.c +++ b/trunk/sound/pci/ctxfi/ctatc.c @@ -18,6 +18,7 @@ #include "ctatc.h" #include "ctpcm.h" #include "ctmixer.h" +#include "cthardware.h" #include "ctsrc.h" #include "ctamixer.h" #include "ctdaio.h" @@ -29,6 +30,7 @@ #include #define MONO_SUM_SCALE 0x19a8 /* 2^(-0.5) in 14-bit floating format */ +#define DAIONUM 7 #define MAX_MULTI_CHN 8 #define IEC958_DEFAULT_CON ((IEC958_AES0_NONAUDIO \ @@ -51,8 +53,6 @@ static struct snd_pci_quirk __devinitdata subsys_20k1_list[] = { static struct snd_pci_quirk __devinitdata subsys_20k2_list[] = { SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, PCI_SUBDEVICE_ID_CREATIVE_SB0760, "SB0760", CTSB0760), - SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, PCI_SUBDEVICE_ID_CREATIVE_SB1270, - "SB1270", CTSB1270), SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, PCI_SUBDEVICE_ID_CREATIVE_SB08801, "SB0880", CTSB0880), SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, PCI_SUBDEVICE_ID_CREATIVE_SB08802, @@ -75,7 +75,6 @@ static const char *ct_subsys_name[NUM_CTCARDS] = { [CTSB0760] = "SB076x", [CTHENDRIX] = "Hendrix", [CTSB0880] = "SB0880", - [CTSB1270] = "SB1270", [CT20K2_UNKNOWN] = "Unknown", }; @@ -460,12 +459,12 @@ static void setup_src_node_conf(struct ct_atc *atc, struct ct_atc_pcm *apcm, apcm->substream->runtime->rate); *n_srcc = 0; - if (1 == atc->msr) { /* FIXME: do we really need SRC here if pitch==1 */ + if (1 == atc->msr) { *n_srcc = apcm->substream->runtime->channels; conf[0].pitch = pitch; conf[0].mix_msr = conf[0].imp_msr = conf[0].msr = 1; conf[0].vo = 1; - } else if (2 <= atc->msr) { + } else if (2 == atc->msr) { if (0x8000000 < pitch) { /* Need two-stage SRCs, SRCIMPs and * AMIXERs for converting format */ @@ -971,39 +970,11 @@ static int atc_select_mic_in(struct ct_atc *atc) return 0; } -static struct capabilities atc_capabilities(struct ct_atc *atc) +static int atc_have_digit_io_switch(struct ct_atc *atc) { struct hw *hw = atc->hw; - return hw->capabilities(hw); -} - -static int atc_output_switch_get(struct ct_atc *atc) -{ - struct hw *hw = atc->hw; - - return hw->output_switch_get(hw); -} - -static int atc_output_switch_put(struct ct_atc *atc, int position) -{ - struct hw *hw = atc->hw; - - return hw->output_switch_put(hw, position); -} - -static int atc_mic_source_switch_get(struct ct_atc *atc) -{ - struct hw *hw = atc->hw; - - return hw->mic_source_switch_get(hw); -} - -static int atc_mic_source_switch_put(struct ct_atc *atc, int position) -{ - struct hw *hw = atc->hw; - - return hw->mic_source_switch_put(hw, position); + return hw->have_digit_io_switch(hw); } static int atc_select_digit_io(struct ct_atc *atc) @@ -1074,11 +1045,6 @@ static int atc_line_in_unmute(struct ct_atc *atc, unsigned char state) return atc_daio_unmute(atc, state, LINEIM); } -static int atc_mic_unmute(struct ct_atc *atc, unsigned char state) -{ - return atc_daio_unmute(atc, state, MIC); -} - static int atc_spdif_out_unmute(struct ct_atc *atc, unsigned char state) { return atc_daio_unmute(atc, state, SPDIFOO); @@ -1365,20 +1331,17 @@ static int atc_get_resources(struct ct_atc *atc) struct srcimp_mgr *srcimp_mgr; struct sum_desc sum_dsc = {0}; struct sum_mgr *sum_mgr; - int err, i, num_srcs, num_daios; + int err, i; - num_daios = ((atc->model == CTSB1270) ? 8 : 7); - num_srcs = ((atc->model == CTSB1270) ? 6 : 4); - - atc->daios = kzalloc(sizeof(void *)*num_daios, GFP_KERNEL); + atc->daios = kzalloc(sizeof(void *)*(DAIONUM), GFP_KERNEL); if (!atc->daios) return -ENOMEM; - atc->srcs = kzalloc(sizeof(void *)*num_srcs, GFP_KERNEL); + atc->srcs = kzalloc(sizeof(void *)*(2*2), GFP_KERNEL); if (!atc->srcs) return -ENOMEM; - atc->srcimps = kzalloc(sizeof(void *)*num_srcs, GFP_KERNEL); + atc->srcimps = kzalloc(sizeof(void *)*(2*2), GFP_KERNEL); if (!atc->srcimps) return -ENOMEM; @@ -1388,9 +1351,8 @@ static int atc_get_resources(struct ct_atc *atc) daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO]; da_desc.msr = atc->msr; - for (i = 0, atc->n_daio = 0; i < num_daios; i++) { - da_desc.type = (atc->model != CTSB073X) ? i : - ((i == SPDIFIO) ? SPDIFI1 : i); + for (i = 0, atc->n_daio = 0; i < DAIONUM-1; i++) { + da_desc.type = i; err = daio_mgr->get_daio(daio_mgr, &da_desc, (struct daio **)&atc->daios[i]); if (err) { @@ -1400,12 +1362,23 @@ static int atc_get_resources(struct ct_atc *atc) } atc->n_daio++; } + if (atc->model == CTSB073X) + da_desc.type = SPDIFI1; + else + da_desc.type = SPDIFIO; + err = daio_mgr->get_daio(daio_mgr, &da_desc, + (struct daio **)&atc->daios[i]); + if (err) { + printk(KERN_ERR "ctxfi: Failed to get S/PDIF-in resource!!!\n"); + return err; + } + atc->n_daio++; src_mgr = atc->rsc_mgrs[SRC]; src_dsc.multi = 1; src_dsc.msr = atc->msr; src_dsc.mode = ARCRW; - for (i = 0, atc->n_src = 0; i < num_srcs; i++) { + for (i = 0, atc->n_src = 0; i < (2*2); i++) { err = src_mgr->get_src(src_mgr, &src_dsc, (struct src **)&atc->srcs[i]); if (err) @@ -1415,8 +1388,8 @@ static int atc_get_resources(struct ct_atc *atc) } srcimp_mgr = atc->rsc_mgrs[SRCIMP]; - srcimp_dsc.msr = 8; - for (i = 0, atc->n_srcimp = 0; i < num_srcs; i++) { + srcimp_dsc.msr = 8; /* SRCIMPs for S/PDIFIn SRT */ + for (i = 0, atc->n_srcimp = 0; i < (2*1); i++) { err = srcimp_mgr->get_srcimp(srcimp_mgr, &srcimp_dsc, (struct srcimp **)&atc->srcimps[i]); if (err) @@ -1424,6 +1397,15 @@ static int atc_get_resources(struct ct_atc *atc) atc->n_srcimp++; } + srcimp_dsc.msr = 8; /* SRCIMPs for LINE/MICIn SRT */ + for (i = 0; i < (2*1); i++) { + err = srcimp_mgr->get_srcimp(srcimp_mgr, &srcimp_dsc, + (struct srcimp **)&atc->srcimps[2*1+i]); + if (err) + return err; + + atc->n_srcimp++; + } sum_mgr = atc->rsc_mgrs[SUM]; sum_dsc.msr = atc->msr; @@ -1506,18 +1488,6 @@ static void atc_connect_resources(struct ct_atc *atc) src = atc->srcs[3]; mixer->set_input_right(mixer, MIX_LINE_IN, &src->rsc); - if (atc->model == CTSB1270) { - /* Titanium HD has a dedicated ADC for the Mic. */ - dai = container_of(atc->daios[MIC], struct dai, daio); - atc_connect_dai(atc->rsc_mgrs[SRC], dai, - (struct src **)&atc->srcs[4], - (struct srcimp **)&atc->srcimps[4]); - src = atc->srcs[4]; - mixer->set_input_left(mixer, MIX_MIC_IN, &src->rsc); - src = atc->srcs[5]; - mixer->set_input_right(mixer, MIX_MIC_IN, &src->rsc); - } - dai = container_of(atc->daios[SPDIFIO], struct dai, daio); atc_connect_dai(atc->rsc_mgrs[SRC], dai, (struct src **)&atc->srcs[0], @@ -1636,17 +1606,12 @@ static struct ct_atc atc_preset __devinitdata = { .line_clfe_unmute = atc_line_clfe_unmute, .line_rear_unmute = atc_line_rear_unmute, .line_in_unmute = atc_line_in_unmute, - .mic_unmute = atc_mic_unmute, .spdif_out_unmute = atc_spdif_out_unmute, .spdif_in_unmute = atc_spdif_in_unmute, .spdif_out_get_status = atc_spdif_out_get_status, .spdif_out_set_status = atc_spdif_out_set_status, .spdif_out_passthru = atc_spdif_out_passthru, - .capabilities = atc_capabilities, - .output_switch_get = atc_output_switch_get, - .output_switch_put = atc_output_switch_put, - .mic_source_switch_get = atc_mic_source_switch_get, - .mic_source_switch_put = atc_mic_source_switch_put, + .have_digit_io_switch = atc_have_digit_io_switch, #ifdef CONFIG_PM .suspend = atc_suspend, .resume = atc_resume, diff --git a/trunk/sound/pci/ctxfi/ctatc.h b/trunk/sound/pci/ctxfi/ctatc.h index 3a0def656af0..7167c0185d52 100644 --- a/trunk/sound/pci/ctxfi/ctatc.h +++ b/trunk/sound/pci/ctxfi/ctatc.h @@ -25,7 +25,6 @@ #include #include "ctvmem.h" -#include "cthardware.h" #include "ctresource.h" enum CTALSADEVS { /* Types of alsa devices */ @@ -116,17 +115,12 @@ struct ct_atc { int (*line_clfe_unmute)(struct ct_atc *atc, unsigned char state); int (*line_rear_unmute)(struct ct_atc *atc, unsigned char state); int (*line_in_unmute)(struct ct_atc *atc, unsigned char state); - int (*mic_unmute)(struct ct_atc *atc, unsigned char state); int (*spdif_out_unmute)(struct ct_atc *atc, unsigned char state); int (*spdif_in_unmute)(struct ct_atc *atc, unsigned char state); int (*spdif_out_get_status)(struct ct_atc *atc, unsigned int *status); int (*spdif_out_set_status)(struct ct_atc *atc, unsigned int status); int (*spdif_out_passthru)(struct ct_atc *atc, unsigned char state); - struct capabilities (*capabilities)(struct ct_atc *atc); - int (*output_switch_get)(struct ct_atc *atc); - int (*output_switch_put)(struct ct_atc *atc, int position); - int (*mic_source_switch_get)(struct ct_atc *atc); - int (*mic_source_switch_put)(struct ct_atc *atc, int position); + int (*have_digit_io_switch)(struct ct_atc *atc); /* Don't touch! Used for internal object. */ void *rsc_mgrs[NUM_RSCTYP]; /* chip resource managers */ diff --git a/trunk/sound/pci/ctxfi/ctdaio.c b/trunk/sound/pci/ctxfi/ctdaio.c index 0c00eb4088ef..47d9ea97de02 100644 --- a/trunk/sound/pci/ctxfi/ctdaio.c +++ b/trunk/sound/pci/ctxfi/ctdaio.c @@ -22,9 +22,20 @@ #include #include +#define DAIO_RESOURCE_NUM NUM_DAIOTYP #define DAIO_OUT_MAX SPDIFOO -struct daio_usage { +union daio_usage { + struct { + unsigned short lineo1:1; + unsigned short lineo2:1; + unsigned short lineo3:1; + unsigned short lineo4:1; + unsigned short spdifoo:1; + unsigned short lineim:1; + unsigned short spdifio:1; + unsigned short spdifi1:1; + } bf; unsigned short data; }; @@ -50,7 +61,6 @@ struct daio_rsc_idx idx_20k2[NUM_DAIOTYP] = { [LINEO3] = {.left = 0x50, .right = 0x51}, [LINEO4] = {.left = 0x70, .right = 0x71}, [LINEIM] = {.left = 0x45, .right = 0xc5}, - [MIC] = {.left = 0x55, .right = 0xd5}, [SPDIFOO] = {.left = 0x00, .right = 0x01}, [SPDIFIO] = {.left = 0x05, .right = 0x85}, }; @@ -128,7 +138,6 @@ static unsigned int daio_device_index(enum DAIOTYP type, struct hw *hw) case LINEO3: return 5; case LINEO4: return 6; case LINEIM: return 4; - case MIC: return 5; default: return -EINVAL; } default: @@ -510,17 +519,17 @@ static int dai_rsc_uninit(struct dai *dai) static int daio_mgr_get_rsc(struct rsc_mgr *mgr, enum DAIOTYP type) { - if (((struct daio_usage *)mgr->rscs)->data & (0x1 << type)) + if (((union daio_usage *)mgr->rscs)->data & (0x1 << type)) return -ENOENT; - ((struct daio_usage *)mgr->rscs)->data |= (0x1 << type); + ((union daio_usage *)mgr->rscs)->data |= (0x1 << type); return 0; } static int daio_mgr_put_rsc(struct rsc_mgr *mgr, enum DAIOTYP type) { - ((struct daio_usage *)mgr->rscs)->data &= ~(0x1 << type); + ((union daio_usage *)mgr->rscs)->data &= ~(0x1 << type); return 0; } @@ -703,7 +712,7 @@ int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr) if (!daio_mgr) return -ENOMEM; - err = rsc_mgr_init(&daio_mgr->mgr, DAIO, NUM_DAIOTYP, hw); + err = rsc_mgr_init(&daio_mgr->mgr, DAIO, DAIO_RESOURCE_NUM, hw); if (err) goto error1; diff --git a/trunk/sound/pci/ctxfi/ctdaio.h b/trunk/sound/pci/ctxfi/ctdaio.h index 85ccb6ee1ab4..0f52ce571ee8 100644 --- a/trunk/sound/pci/ctxfi/ctdaio.h +++ b/trunk/sound/pci/ctxfi/ctdaio.h @@ -33,7 +33,6 @@ enum DAIOTYP { SPDIFOO, /* S/PDIF Out (Flexijack/Optical) */ LINEIM, SPDIFIO, /* S/PDIF In (Flexijack/Optical) on the card */ - MIC, /* Dedicated mic on Titanium HD */ SPDIFI1, /* S/PDIF In on internal Drive Bay */ NUM_DAIOTYP }; diff --git a/trunk/sound/pci/ctxfi/cthardware.h b/trunk/sound/pci/ctxfi/cthardware.h index 908315bec3b4..af55405f5dec 100644 --- a/trunk/sound/pci/ctxfi/cthardware.h +++ b/trunk/sound/pci/ctxfi/cthardware.h @@ -39,7 +39,6 @@ enum CTCARDS { CT20K2_MODEL_FIRST = CTSB0760, CTHENDRIX, CTSB0880, - CTSB1270, CT20K2_UNKNOWN, NUM_CTCARDS /* This should always be the last */ }; @@ -61,13 +60,6 @@ struct card_conf { unsigned int msr; /* master sample rate in rsrs */ }; -struct capabilities { - unsigned int digit_io_switch:1; - unsigned int dedicated_mic:1; - unsigned int output_switch:1; - unsigned int mic_source_switch:1; -}; - struct hw { int (*card_init)(struct hw *hw, struct card_conf *info); int (*card_stop)(struct hw *hw); @@ -78,11 +70,7 @@ struct hw { #endif int (*is_adc_source_selected)(struct hw *hw, enum ADCSRC source); int (*select_adc_source)(struct hw *hw, enum ADCSRC source); - struct capabilities (*capabilities)(struct hw *hw); - int (*output_switch_get)(struct hw *hw); - int (*output_switch_put)(struct hw *hw, int position); - int (*mic_source_switch_get)(struct hw *hw); - int (*mic_source_switch_put)(struct hw *hw, int position); + int (*have_digit_io_switch)(struct hw *hw); /* SRC operations */ int (*src_rsc_get_ctrl_blk)(void **rblk); diff --git a/trunk/sound/pci/ctxfi/cthw20k1.c b/trunk/sound/pci/ctxfi/cthw20k1.c index 1ff692a9d016..a5c957db5cea 100644 --- a/trunk/sound/pci/ctxfi/cthw20k1.c +++ b/trunk/sound/pci/ctxfi/cthw20k1.c @@ -1777,17 +1777,10 @@ static int hw_adc_init(struct hw *hw, const struct adc_conf *info) return adc_init_SBx(hw, info->input, info->mic20db); } -static struct capabilities hw_capabilities(struct hw *hw) +static int hw_have_digit_io_switch(struct hw *hw) { - struct capabilities cap; - /* SB073x and Vista compatible cards have no digit IO switch */ - cap.digit_io_switch = !(hw->model == CTSB073X || hw->model == CTUAA); - cap.dedicated_mic = 0; - cap.output_switch = 0; - cap.mic_source_switch = 0; - - return cap; + return !(hw->model == CTSB073X || hw->model == CTUAA); } #define CTLBITS(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) @@ -2179,7 +2172,7 @@ static struct hw ct20k1_preset __devinitdata = { .pll_init = hw_pll_init, .is_adc_source_selected = hw_is_adc_input_selected, .select_adc_source = hw_adc_input_select, - .capabilities = hw_capabilities, + .have_digit_io_switch = hw_have_digit_io_switch, #ifdef CONFIG_PM .suspend = hw_suspend, .resume = hw_resume, diff --git a/trunk/sound/pci/ctxfi/cthw20k2.c b/trunk/sound/pci/ctxfi/cthw20k2.c index ea559a9e2934..5364164674e4 100644 --- a/trunk/sound/pci/ctxfi/cthw20k2.c +++ b/trunk/sound/pci/ctxfi/cthw20k2.c @@ -8,7 +8,7 @@ * @File cthw20k2.c * * @Brief - * This file contains the implementation of hardware access method for 20k2. + * This file contains the implementation of hardware access methord for 20k2. * * @Author Liu Chun * @Date May 14 2008 @@ -38,8 +38,6 @@ struct hw20k2 { unsigned char dev_id; unsigned char addr_size; unsigned char data_size; - - int mic_source; }; static u32 hw_read_20kx(struct hw *hw, u32 reg); @@ -1165,12 +1163,7 @@ static int hw_daio_init(struct hw *hw, const struct daio_conf *info) hw_write_20kx(hw, AUDIO_IO_TX_BLRCLK, 0x01010101); hw_write_20kx(hw, AUDIO_IO_RX_BLRCLK, 0); } else if (2 == info->msr) { - if (hw->model != CTSB1270) { - hw_write_20kx(hw, AUDIO_IO_MCLK, 0x11111111); - } else { - /* PCM4220 on Titanium HD is different. */ - hw_write_20kx(hw, AUDIO_IO_MCLK, 0x11011111); - } + hw_write_20kx(hw, AUDIO_IO_MCLK, 0x11111111); /* Specify all playing 96khz * EA [0] - Enabled * RTA [4:5] - 96kHz @@ -1182,10 +1175,6 @@ static int hw_daio_init(struct hw *hw, const struct daio_conf *info) * RTD [28:29] - 96kHz */ hw_write_20kx(hw, AUDIO_IO_TX_BLRCLK, 0x11111111); hw_write_20kx(hw, AUDIO_IO_RX_BLRCLK, 0); - } else if ((4 == info->msr) && (hw->model == CTSB1270)) { - hw_write_20kx(hw, AUDIO_IO_MCLK, 0x21011111); - hw_write_20kx(hw, AUDIO_IO_TX_BLRCLK, 0x21212121); - hw_write_20kx(hw, AUDIO_IO_RX_BLRCLK, 0); } else { printk(KERN_ALERT "ctxfi: ERROR!!! Invalid sampling rate!!!\n"); return -EINVAL; @@ -1193,8 +1182,6 @@ static int hw_daio_init(struct hw *hw, const struct daio_conf *info) for (i = 0; i < 8; i++) { if (i <= 3) { - /* This comment looks wrong since loop is over 4 */ - /* channels and emu20k2 supports 4 spdif IOs. */ /* 1st 3 channels are SPDIFs (SB0960) */ if (i == 3) data = 0x1001001; @@ -1219,16 +1206,12 @@ static int hw_daio_init(struct hw *hw, const struct daio_conf *info) hw_write_20kx(hw, AUDIO_IO_TX_CSTAT_H+(0x40*i), 0x0B); } else { - /* Again, loop is over 4 channels not 5. */ /* Next 5 channels are I2S (SB0960) */ data = 0x11; hw_write_20kx(hw, AUDIO_IO_RX_CTL+(0x40*i), data); if (2 == info->msr) { /* Four channels per sample period */ data |= 0x1000; - } else if (4 == info->msr) { - /* FIXME: check this against the chip spec */ - data |= 0x2000; } hw_write_20kx(hw, AUDIO_IO_TX_CTL+(0x40*i), data); } @@ -1574,7 +1557,7 @@ static int hw20k2_i2c_write(struct hw *hw, u16 addr, u32 data) hw_write_20kx(hw, I2C_IF_STATUS, i2c_status); hw20k2_i2c_wait_data_ready(hw); - /* Dummy write to trigger the write operation */ + /* Dummy write to trigger the write oprtation */ hw_write_20kx(hw, I2C_IF_WDATA, 0); hw20k2_i2c_wait_data_ready(hw); @@ -1585,30 +1568,6 @@ static int hw20k2_i2c_write(struct hw *hw, u16 addr, u32 data) return 0; } -static void hw_dac_stop(struct hw *hw) -{ - u32 data; - data = hw_read_20kx(hw, GPIO_DATA); - data &= 0xFFFFFFFD; - hw_write_20kx(hw, GPIO_DATA, data); - mdelay(10); -} - -static void hw_dac_start(struct hw *hw) -{ - u32 data; - data = hw_read_20kx(hw, GPIO_DATA); - data |= 0x2; - hw_write_20kx(hw, GPIO_DATA, data); - mdelay(50); -} - -static void hw_dac_reset(struct hw *hw) -{ - hw_dac_stop(hw); - hw_dac_start(hw); -} - static int hw_dac_init(struct hw *hw, const struct dac_conf *info) { int err; @@ -1635,21 +1594,6 @@ static int hw_dac_init(struct hw *hw, const struct dac_conf *info) 0x00000000 /* Vol Control B4 */ }; - if (hw->model == CTSB1270) { - hw_dac_stop(hw); - data = hw_read_20kx(hw, GPIO_DATA); - data &= ~0x0600; - if (1 == info->msr) - data |= 0x0000; /* Single Speed Mode 0-50kHz */ - else if (2 == info->msr) - data |= 0x0200; /* Double Speed Mode 50-100kHz */ - else - data |= 0x0600; /* Quad Speed Mode 100-200kHz */ - hw_write_20kx(hw, GPIO_DATA, data); - hw_dac_start(hw); - return 0; - } - /* Set DAC reset bit as output */ data = hw_read_20kx(hw, GPIO_CTRL); data |= 0x02; @@ -1662,8 +1606,22 @@ static int hw_dac_init(struct hw *hw, const struct dac_conf *info) for (i = 0; i < 2; i++) { /* Reset DAC twice just in-case the chip * didn't initialized properly */ - hw_dac_reset(hw); - hw_dac_reset(hw); + data = hw_read_20kx(hw, GPIO_DATA); + /* GPIO data bit 1 */ + data &= 0xFFFFFFFD; + hw_write_20kx(hw, GPIO_DATA, data); + mdelay(10); + data |= 0x2; + hw_write_20kx(hw, GPIO_DATA, data); + mdelay(50); + + /* Reset the 2nd time */ + data &= 0xFFFFFFFD; + hw_write_20kx(hw, GPIO_DATA, data); + mdelay(10); + data |= 0x2; + hw_write_20kx(hw, GPIO_DATA, data); + mdelay(50); if (hw20k2_i2c_read(hw, CS4382_MC1, &cs_read.mode_control_1)) continue; @@ -1767,11 +1725,7 @@ static int hw_dac_init(struct hw *hw, const struct dac_conf *info) static int hw_is_adc_input_selected(struct hw *hw, enum ADCSRC type) { u32 data; - if (hw->model == CTSB1270) { - /* Titanium HD has two ADC chips, one for line in and one */ - /* for MIC. We don't need to switch the ADC input. */ - return 1; - } + data = hw_read_20kx(hw, GPIO_DATA); switch (type) { case ADC_MICIN: @@ -1788,47 +1742,35 @@ static int hw_is_adc_input_selected(struct hw *hw, enum ADCSRC type) #define MIC_BOOST_0DB 0xCF #define MIC_BOOST_STEPS_PER_DB 2 - -static void hw_wm8775_input_select(struct hw *hw, u8 input, s8 gain_in_db) -{ - u32 adcmc, gain; - - if (input > 3) - input = 3; - - adcmc = ((u32)1 << input) | 0x100; /* Link L+R gain... */ - - hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_ADCMC, adcmc), - MAKE_WM8775_DATA(adcmc)); - - if (gain_in_db < -103) - gain_in_db = -103; - if (gain_in_db > 24) - gain_in_db = 24; - - gain = gain_in_db * MIC_BOOST_STEPS_PER_DB + MIC_BOOST_0DB; - - hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_AADCL, gain), - MAKE_WM8775_DATA(gain)); - /* ...so there should be no need for the following. */ - hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_AADCR, gain), - MAKE_WM8775_DATA(gain)); -} +#define MIC_BOOST_20DB (MIC_BOOST_0DB + 20 * MIC_BOOST_STEPS_PER_DB) static int hw_adc_input_select(struct hw *hw, enum ADCSRC type) { u32 data; + data = hw_read_20kx(hw, GPIO_DATA); switch (type) { case ADC_MICIN: data |= (0x1 << 14); hw_write_20kx(hw, GPIO_DATA, data); - hw_wm8775_input_select(hw, 0, 20); /* Mic, 20dB */ + hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_ADCMC, 0x101), + MAKE_WM8775_DATA(0x101)); /* Mic-in */ + hw20k2_i2c_write(hw, + MAKE_WM8775_ADDR(WM8775_AADCL, MIC_BOOST_20DB), + MAKE_WM8775_DATA(MIC_BOOST_20DB)); /* +20dB */ + hw20k2_i2c_write(hw, + MAKE_WM8775_ADDR(WM8775_AADCR, MIC_BOOST_20DB), + MAKE_WM8775_DATA(MIC_BOOST_20DB)); /* +20dB */ break; case ADC_LINEIN: data &= ~(0x1 << 14); hw_write_20kx(hw, GPIO_DATA, data); - hw_wm8775_input_select(hw, 1, 0); /* Line-in, 0dB */ + hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_ADCMC, 0x102), + MAKE_WM8775_DATA(0x102)); /* Line-in */ + hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_AADCL, 0xCF), + MAKE_WM8775_DATA(0xCF)); /* No boost */ + hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_AADCR, 0xCF), + MAKE_WM8775_DATA(0xCF)); /* No boost */ break; default: break; @@ -1840,7 +1782,7 @@ static int hw_adc_input_select(struct hw *hw, enum ADCSRC type) static int hw_adc_init(struct hw *hw, const struct adc_conf *info) { int err; - u32 data, ctl; + u32 mux = 2, data, ctl; /* Set ADC reset bit as output */ data = hw_read_20kx(hw, GPIO_CTRL); @@ -1854,42 +1796,19 @@ static int hw_adc_init(struct hw *hw, const struct adc_conf *info) goto error; } - /* Reset the ADC (reset is active low). */ + /* Make ADC in normal operation */ data = hw_read_20kx(hw, GPIO_DATA); data &= ~(0x1 << 15); - hw_write_20kx(hw, GPIO_DATA, data); - - if (hw->model == CTSB1270) { - /* Set up the PCM4220 ADC on Titanium HD */ - data &= ~0x0C; - if (1 == info->msr) - data |= 0x00; /* Single Speed Mode 32-50kHz */ - else if (2 == info->msr) - data |= 0x08; /* Double Speed Mode 50-108kHz */ - else - data |= 0x04; /* Quad Speed Mode 108kHz-216kHz */ - hw_write_20kx(hw, GPIO_DATA, data); - } - mdelay(10); - /* Return the ADC to normal operation. */ data |= (0x1 << 15); hw_write_20kx(hw, GPIO_DATA, data); mdelay(50); - /* I2C write to register offset 0x0B to set ADC LRCLK polarity */ - /* invert bit, interface format to I2S, word length to 24-bit, */ - /* enable ADC high pass filter. Fixes bug 5323? */ - hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_IC, 0x26), - MAKE_WM8775_DATA(0x26)); - /* Set the master mode (256fs) */ if (1 == info->msr) { - /* slave mode, 128x oversampling 256fs */ hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_MMC, 0x02), MAKE_WM8775_DATA(0x02)); - } else if ((2 == info->msr) || (4 == info->msr)) { - /* slave mode, 64x oversampling, 256fs */ + } else if (2 == info->msr) { hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_MMC, 0x0A), MAKE_WM8775_DATA(0x0A)); } else { @@ -1899,113 +1818,55 @@ static int hw_adc_init(struct hw *hw, const struct adc_conf *info) goto error; } - if (hw->model != CTSB1270) { - /* Configure GPIO bit 14 change to line-in/mic-in */ - ctl = hw_read_20kx(hw, GPIO_CTRL); - ctl |= 0x1 << 14; - hw_write_20kx(hw, GPIO_CTRL, ctl); - hw_adc_input_select(hw, ADC_LINEIN); - } else { - hw_wm8775_input_select(hw, 0, 0); - } - - return 0; -error: - hw20k2_i2c_uninit(hw); - return err; -} - -static struct capabilities hw_capabilities(struct hw *hw) -{ - struct capabilities cap; - - cap.digit_io_switch = 0; - cap.dedicated_mic = hw->model == CTSB1270; - cap.output_switch = hw->model == CTSB1270; - cap.mic_source_switch = hw->model == CTSB1270; - - return cap; -} - -static int hw_output_switch_get(struct hw *hw) -{ - u32 data = hw_read_20kx(hw, GPIO_EXT_DATA); - - switch (data & 0x30) { - case 0x00: - return 0; - case 0x10: - return 1; - case 0x20: - return 2; - default: - return 3; - } -} - -static int hw_output_switch_put(struct hw *hw, int position) -{ - u32 data; + /* Configure GPIO bit 14 change to line-in/mic-in */ + ctl = hw_read_20kx(hw, GPIO_CTRL); + ctl |= 0x1 << 14; + hw_write_20kx(hw, GPIO_CTRL, ctl); - if (position == hw_output_switch_get(hw)) - return 0; - - /* Mute line and headphones (intended for anti-pop). */ + /* Check using Mic-in or Line-in */ data = hw_read_20kx(hw, GPIO_DATA); - data |= (0x03 << 11); - hw_write_20kx(hw, GPIO_DATA, data); - data = hw_read_20kx(hw, GPIO_EXT_DATA) & ~0x30; - switch (position) { - case 0: - break; - case 1: - data |= 0x10; - break; - default: - data |= 0x20; - } - hw_write_20kx(hw, GPIO_EXT_DATA, data); + if (mux == 1) { + /* Configures GPIO data to select Mic-in */ + data |= 0x1 << 14; + hw_write_20kx(hw, GPIO_DATA, data); - /* Unmute line and headphones. */ - data = hw_read_20kx(hw, GPIO_DATA); - data &= ~(0x03 << 11); - hw_write_20kx(hw, GPIO_DATA, data); + hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_ADCMC, 0x101), + MAKE_WM8775_DATA(0x101)); /* Mic-in */ + hw20k2_i2c_write(hw, + MAKE_WM8775_ADDR(WM8775_AADCL, MIC_BOOST_20DB), + MAKE_WM8775_DATA(MIC_BOOST_20DB)); /* +20dB */ + hw20k2_i2c_write(hw, + MAKE_WM8775_ADDR(WM8775_AADCR, MIC_BOOST_20DB), + MAKE_WM8775_DATA(MIC_BOOST_20DB)); /* +20dB */ + } else if (mux == 2) { + /* Configures GPIO data to select Line-in */ + data &= ~(0x1 << 14); + hw_write_20kx(hw, GPIO_DATA, data); - return 1; -} + /* Setup ADC */ + hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_ADCMC, 0x102), + MAKE_WM8775_DATA(0x102)); /* Line-in */ + hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_AADCL, 0xCF), + MAKE_WM8775_DATA(0xCF)); /* No boost */ + hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_AADCR, 0xCF), + MAKE_WM8775_DATA(0xCF)); /* No boost */ + } else { + printk(KERN_ALERT "ctxfi: ERROR!!! Invalid input mux!!!\n"); + err = -EINVAL; + goto error; + } -static int hw_mic_source_switch_get(struct hw *hw) -{ - struct hw20k2 *hw20k2 = (struct hw20k2 *)hw; + return 0; - return hw20k2->mic_source; +error: + hw20k2_i2c_uninit(hw); + return err; } -static int hw_mic_source_switch_put(struct hw *hw, int position) +static int hw_have_digit_io_switch(struct hw *hw) { - struct hw20k2 *hw20k2 = (struct hw20k2 *)hw; - - if (position == hw20k2->mic_source) - return 0; - - switch (position) { - case 0: - hw_wm8775_input_select(hw, 0, 0); /* Mic, 0dB */ - break; - case 1: - hw_wm8775_input_select(hw, 1, 0); /* FP Mic, 0dB */ - break; - case 2: - hw_wm8775_input_select(hw, 3, 0); /* Aux Ext, 0dB */ - break; - default: - return 0; - } - - hw20k2->mic_source = position; - - return 1; + return 0; } static irqreturn_t ct_20k2_interrupt(int irq, void *dev_id) @@ -2162,16 +2023,13 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) /* Reset all SRC pending interrupts */ hw_write_20kx(hw, SRC_IP, 0); - if (hw->model != CTSB1270) { - /* TODO: detect the card ID and configure GPIO accordingly. */ - /* Configures GPIO (0xD802 0x98028) */ - /*hw_write_20kx(hw, GPIO_CTRL, 0x7F07);*/ - /* Configures GPIO (SB0880) */ - /*hw_write_20kx(hw, GPIO_CTRL, 0xFF07);*/ - hw_write_20kx(hw, GPIO_CTRL, 0xD802); - } else { - hw_write_20kx(hw, GPIO_CTRL, 0x9E5F); - } + /* TODO: detect the card ID and configure GPIO accordingly. */ + /* Configures GPIO (0xD802 0x98028) */ + /*hw_write_20kx(hw, GPIO_CTRL, 0x7F07);*/ + /* Configures GPIO (SB0880) */ + /*hw_write_20kx(hw, GPIO_CTRL, 0xFF07);*/ + hw_write_20kx(hw, GPIO_CTRL, 0xD802); + /* Enable audio ring */ hw_write_20kx(hw, MIXER_AR_ENABLE, 0x01); @@ -2248,11 +2106,7 @@ static struct hw ct20k2_preset __devinitdata = { .pll_init = hw_pll_init, .is_adc_source_selected = hw_is_adc_input_selected, .select_adc_source = hw_adc_input_select, - .capabilities = hw_capabilities, - .output_switch_get = hw_output_switch_get, - .output_switch_put = hw_output_switch_put, - .mic_source_switch_get = hw_mic_source_switch_get, - .mic_source_switch_put = hw_mic_source_switch_put, + .have_digit_io_switch = hw_have_digit_io_switch, #ifdef CONFIG_PM .suspend = hw_suspend, .resume = hw_resume, diff --git a/trunk/sound/pci/ctxfi/ctmixer.c b/trunk/sound/pci/ctxfi/ctmixer.c index 0cc13eeef8da..c3519ff42fbb 100644 --- a/trunk/sound/pci/ctxfi/ctmixer.c +++ b/trunk/sound/pci/ctxfi/ctmixer.c @@ -86,7 +86,9 @@ enum CTALSA_MIXER_CTL { MIXER_LINEIN_C_S, MIXER_MIC_C_S, MIXER_SPDIFI_C_S, + MIXER_LINEIN_P_S, MIXER_SPDIFO_P_S, + MIXER_SPDIFI_P_S, MIXER_WAVEF_P_S, MIXER_WAVER_P_S, MIXER_WAVEC_P_S, @@ -135,11 +137,11 @@ ct_kcontrol_init_table[NUM_CTALSA_MIXERS] = { }, [MIXER_LINEIN_P] = { .ctl = 1, - .name = "Line Playback Volume", + .name = "Line-in Playback Volume", }, [MIXER_LINEIN_C] = { .ctl = 1, - .name = "Line Capture Volume", + .name = "Line-in Capture Volume", }, [MIXER_MIC_P] = { .ctl = 1, @@ -151,15 +153,15 @@ ct_kcontrol_init_table[NUM_CTALSA_MIXERS] = { }, [MIXER_SPDIFI_P] = { .ctl = 1, - .name = "IEC958 Playback Volume", + .name = "S/PDIF-in Playback Volume", }, [MIXER_SPDIFI_C] = { .ctl = 1, - .name = "IEC958 Capture Volume", + .name = "S/PDIF-in Capture Volume", }, [MIXER_SPDIFO_P] = { .ctl = 1, - .name = "Digital Playback Volume", + .name = "S/PDIF-out Playback Volume", }, [MIXER_WAVEF_P] = { .ctl = 1, @@ -177,13 +179,14 @@ ct_kcontrol_init_table[NUM_CTALSA_MIXERS] = { .ctl = 1, .name = "Surround Playback Volume", }, + [MIXER_PCM_C_S] = { .ctl = 1, .name = "PCM Capture Switch", }, [MIXER_LINEIN_C_S] = { .ctl = 1, - .name = "Line Capture Switch", + .name = "Line-in Capture Switch", }, [MIXER_MIC_C_S] = { .ctl = 1, @@ -191,11 +194,19 @@ ct_kcontrol_init_table[NUM_CTALSA_MIXERS] = { }, [MIXER_SPDIFI_C_S] = { .ctl = 1, - .name = "IEC958 Capture Switch", + .name = "S/PDIF-in Capture Switch", + }, + [MIXER_LINEIN_P_S] = { + .ctl = 1, + .name = "Line-in Playback Switch", }, [MIXER_SPDIFO_P_S] = { .ctl = 1, - .name = "Digital Playback Switch", + .name = "S/PDIF-out Playback Switch", + }, + [MIXER_SPDIFI_P_S] = { + .ctl = 1, + .name = "S/PDIF-in Playback Switch", }, [MIXER_WAVEF_P_S] = { .ctl = 1, @@ -225,8 +236,6 @@ ct_mixer_recording_select(struct ct_mixer *mixer, enum CT_AMIXER_CTL type); static void ct_mixer_recording_unselect(struct ct_mixer *mixer, enum CT_AMIXER_CTL type); -/* FIXME: this static looks like it would fail if more than one card was */ -/* installed. */ static struct snd_kcontrol *kctls[2] = {NULL}; static enum CT_AMIXER_CTL get_amixer_index(enum CTALSA_MIXER_CTL alsa_index) @@ -411,77 +420,6 @@ static struct snd_kcontrol_new vol_ctl = { .tlv = { .p = ct_vol_db_scale }, }; -static int output_switch_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *info) -{ - static const char *const names[3] = { - "FP Headphones", "Headphones", "Speakers" - }; - - return snd_ctl_enum_info(info, 1, 3, names); -} - -static int output_switch_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - struct ct_atc *atc = snd_kcontrol_chip(kcontrol); - ucontrol->value.enumerated.item[0] = atc->output_switch_get(atc); - return 0; -} - -static int output_switch_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - struct ct_atc *atc = snd_kcontrol_chip(kcontrol); - if (ucontrol->value.enumerated.item[0] > 2) - return -EINVAL; - return atc->output_switch_put(atc, ucontrol->value.enumerated.item[0]); -} - -static struct snd_kcontrol_new output_ctl = { - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, - .name = "Analog Output Playback Enum", - .info = output_switch_info, - .get = output_switch_get, - .put = output_switch_put, -}; - -static int mic_source_switch_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *info) -{ - static const char *const names[3] = { - "Mic", "FP Mic", "Aux" - }; - - return snd_ctl_enum_info(info, 1, 3, names); -} - -static int mic_source_switch_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - struct ct_atc *atc = snd_kcontrol_chip(kcontrol); - ucontrol->value.enumerated.item[0] = atc->mic_source_switch_get(atc); - return 0; -} - -static int mic_source_switch_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - struct ct_atc *atc = snd_kcontrol_chip(kcontrol); - if (ucontrol->value.enumerated.item[0] > 2) - return -EINVAL; - return atc->mic_source_switch_put(atc, - ucontrol->value.enumerated.item[0]); -} - -static struct snd_kcontrol_new mic_source_ctl = { - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, - .name = "Mic Source Capture Enum", - .info = mic_source_switch_info, - .get = mic_source_switch_get, - .put = mic_source_switch_put, -}; - static void do_line_mic_switch(struct ct_atc *atc, enum CTALSA_MIXER_CTL type) { @@ -527,7 +465,6 @@ do_digit_io_switch(struct ct_atc *atc, int state) static void do_switch(struct ct_atc *atc, enum CTALSA_MIXER_CTL type, int state) { struct ct_mixer *mixer = atc->mixer; - struct capabilities cap = atc->capabilities(atc); /* Do changes in mixer. */ if ((SWH_CAPTURE_START <= type) && (SWH_CAPTURE_END >= type)) { @@ -540,17 +477,8 @@ static void do_switch(struct ct_atc *atc, enum CTALSA_MIXER_CTL type, int state) } } /* Do changes out of mixer. */ - if (!cap.dedicated_mic && - (MIXER_LINEIN_C_S == type || MIXER_MIC_C_S == type)) { - if (state) - do_line_mic_switch(atc, type); - atc->line_in_unmute(atc, state); - } else if (cap.dedicated_mic && (MIXER_LINEIN_C_S == type)) - atc->line_in_unmute(atc, state); - else if (cap.dedicated_mic && (MIXER_MIC_C_S == type)) - atc->mic_unmute(atc, state); - else if (MIXER_SPDIFI_C_S == type) - atc->spdif_in_unmute(atc, state); + if (state && (MIXER_LINEIN_C_S == type || MIXER_MIC_C_S == type)) + do_line_mic_switch(atc, type); else if (MIXER_WAVEF_P_S == type) atc->line_front_unmute(atc, state); else if (MIXER_WAVES_P_S == type) @@ -559,8 +487,12 @@ static void do_switch(struct ct_atc *atc, enum CTALSA_MIXER_CTL type, int state) atc->line_clfe_unmute(atc, state); else if (MIXER_WAVER_P_S == type) atc->line_rear_unmute(atc, state); + else if (MIXER_LINEIN_P_S == type) + atc->line_in_unmute(atc, state); else if (MIXER_SPDIFO_P_S == type) atc->spdif_out_unmute(atc, state); + else if (MIXER_SPDIFI_P_S == type) + atc->spdif_in_unmute(atc, state); else if (MIXER_DIGITAL_IO_S == type) do_digit_io_switch(atc, state); @@ -739,7 +671,6 @@ static int ct_mixer_kcontrols_create(struct ct_mixer *mixer) { enum CTALSA_MIXER_CTL type; struct ct_atc *atc = mixer->atc; - struct capabilities cap = atc->capabilities(atc); int err; /* Create snd kcontrol instances on demand */ @@ -753,8 +684,8 @@ static int ct_mixer_kcontrols_create(struct ct_mixer *mixer) } } - ct_kcontrol_init_table[MIXER_DIGITAL_IO_S].ctl = cap.digit_io_switch; - + ct_kcontrol_init_table[MIXER_DIGITAL_IO_S].ctl = + atc->have_digit_io_switch(atc); for (type = SWH_MIXER_START; type <= SWH_MIXER_END; type++) { if (ct_kcontrol_init_table[type].ctl) { swh_ctl.name = ct_kcontrol_init_table[type].name; @@ -777,17 +708,6 @@ static int ct_mixer_kcontrols_create(struct ct_mixer *mixer) if (err) return err; - if (cap.output_switch) { - err = ct_mixer_kcontrol_new(mixer, &output_ctl); - if (err) - return err; - } - - if (cap.mic_source_switch) { - err = ct_mixer_kcontrol_new(mixer, &mic_source_ctl); - if (err) - return err; - } atc->line_front_unmute(atc, 1); set_switch_state(mixer, MIXER_WAVEF_P_S, 1); atc->line_surround_unmute(atc, 0); @@ -799,12 +719,13 @@ static int ct_mixer_kcontrols_create(struct ct_mixer *mixer) atc->spdif_out_unmute(atc, 0); set_switch_state(mixer, MIXER_SPDIFO_P_S, 0); atc->line_in_unmute(atc, 0); - if (cap.dedicated_mic) - atc->mic_unmute(atc, 0); + set_switch_state(mixer, MIXER_LINEIN_P_S, 0); atc->spdif_in_unmute(atc, 0); - set_switch_state(mixer, MIXER_PCM_C_S, 0); - set_switch_state(mixer, MIXER_LINEIN_C_S, 0); - set_switch_state(mixer, MIXER_SPDIFI_C_S, 0); + set_switch_state(mixer, MIXER_SPDIFI_P_S, 0); + + set_switch_state(mixer, MIXER_PCM_C_S, 1); + set_switch_state(mixer, MIXER_LINEIN_C_S, 1); + set_switch_state(mixer, MIXER_SPDIFI_C_S, 1); return 0; } diff --git a/trunk/sound/pci/ctxfi/xfi.c b/trunk/sound/pci/ctxfi/xfi.c index 7afa765afa3c..d20ddfee2c1f 100644 --- a/trunk/sound/pci/ctxfi/xfi.c +++ b/trunk/sound/pci/ctxfi/xfi.c @@ -80,11 +80,11 @@ ct_card_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) "are 48000 and 44100, Value 48000 is assumed.\n"); reference_rate = 48000; } - if ((multiple != 1) && (multiple != 2) && (multiple != 4)) { + if ((multiple != 1) && (multiple != 2)) { printk(KERN_ERR "ctxfi: Invalid multiple value %u!!!\n", multiple); printk(KERN_ERR "ctxfi: The valid values for multiple are " - "1, 2 and 4, Value 2 is assumed.\n"); + "1 and 2, Value 2 is assumed.\n"); multiple = 2; } err = ct_atc_create(card, pci, reference_rate, multiple, @@ -143,7 +143,7 @@ static int ct_card_resume(struct pci_dev *pci) #endif static struct pci_driver ct_driver = { - .name = "SB-XFi", + .name = KBUILD_MODNAME, .id_table = ct_pci_dev_ids, .probe = ct_card_probe, .remove = __devexit_p(ct_card_remove), diff --git a/trunk/sound/pci/echoaudio/echoaudio.c b/trunk/sound/pci/echoaudio/echoaudio.c index 20763dd03fa0..d302e0f39596 100644 --- a/trunk/sound/pci/echoaudio/echoaudio.c +++ b/trunk/sound/pci/echoaudio/echoaudio.c @@ -2327,7 +2327,7 @@ static void __devexit snd_echo_remove(struct pci_dev *pci) /* pci_driver definition */ static struct pci_driver driver = { - .name = "Echoaudio " ECHOCARD_NAME, + .name = KBUILD_MODNAME, .id_table = snd_echo_ids, .probe = snd_echo_probe, .remove = __devexit_p(snd_echo_remove), diff --git a/trunk/sound/pci/emu10k1/emu10k1.c b/trunk/sound/pci/emu10k1/emu10k1.c index aff8387c45cf..a9c45d2cdb13 100644 --- a/trunk/sound/pci/emu10k1/emu10k1.c +++ b/trunk/sound/pci/emu10k1/emu10k1.c @@ -264,7 +264,7 @@ static int snd_emu10k1_resume(struct pci_dev *pci) #endif static struct pci_driver driver = { - .name = "EMU10K1_Audigy", + .name = KBUILD_MODNAME, .id_table = snd_emu10k1_ids, .probe = snd_card_emu10k1_probe, .remove = __devexit_p(snd_card_emu10k1_remove), diff --git a/trunk/sound/pci/emu10k1/emu10k1_main.c b/trunk/sound/pci/emu10k1/emu10k1_main.c index 15f0161ce4a2..5e619a84da06 100644 --- a/trunk/sound/pci/emu10k1/emu10k1_main.c +++ b/trunk/sound/pci/emu10k1/emu10k1_main.c @@ -1440,14 +1440,6 @@ static struct snd_emu_chip_details emu_chip_details[] = { .ca0102_chip = 1, .spk71 = 1, .emu_model = EMU_MODEL_EMU0404}, /* EMU 0404 */ - /* EMU0404 PCIe */ - {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40051102, - .driver = "Audigy2", .name = "E-mu 0404 PCIe [MAEM8984]", - .id = "EMU0404", - .emu10k2_chip = 1, - .ca0108_chip = 1, - .spk71 = 1, - .emu_model = EMU_MODEL_EMU0404}, /* EMU 0404 PCIe ver_03 */ /* Note that all E-mu cards require kernel 2.6 or newer. */ {.vendor = 0x1102, .device = 0x0008, .driver = "Audigy2", .name = "SB Audigy 2 Value [Unknown]", diff --git a/trunk/sound/pci/emu10k1/emu10k1x.c b/trunk/sound/pci/emu10k1/emu10k1x.c index 0c701e4ec8a5..c9cb73105525 100644 --- a/trunk/sound/pci/emu10k1/emu10k1x.c +++ b/trunk/sound/pci/emu10k1/emu10k1x.c @@ -1613,7 +1613,7 @@ MODULE_DEVICE_TABLE(pci, snd_emu10k1x_ids); // pci_driver definition static struct pci_driver driver = { - .name = "EMU10K1X", + .name = KBUILD_MODNAME, .id_table = snd_emu10k1x_ids, .probe = snd_emu10k1x_probe, .remove = __devexit_p(snd_emu10k1x_remove), diff --git a/trunk/sound/pci/ens1370.c b/trunk/sound/pci/ens1370.c index 863eafea691f..a61dd4229773 100644 --- a/trunk/sound/pci/ens1370.c +++ b/trunk/sound/pci/ens1370.c @@ -2489,7 +2489,7 @@ static void __devexit snd_audiopci_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = DRIVER_NAME, + .name = KBUILD_MODNAME, .id_table = snd_audiopci_ids, .probe = snd_audiopci_probe, .remove = __devexit_p(snd_audiopci_remove), diff --git a/trunk/sound/pci/es1938.c b/trunk/sound/pci/es1938.c index 553b75217259..84141d16e701 100644 --- a/trunk/sound/pci/es1938.c +++ b/trunk/sound/pci/es1938.c @@ -1882,7 +1882,7 @@ static void __devexit snd_es1938_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "ESS ES1938 (Solo-1)", + .name = KBUILD_MODNAME, .id_table = snd_es1938_ids, .probe = snd_es1938_probe, .remove = __devexit_p(snd_es1938_remove), diff --git a/trunk/sound/pci/es1968.c b/trunk/sound/pci/es1968.c index ab0a6156a704..14a2e163fa8c 100644 --- a/trunk/sound/pci/es1968.c +++ b/trunk/sound/pci/es1968.c @@ -2925,7 +2925,7 @@ static void __devexit snd_es1968_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "ES1968 (ESS Maestro)", + .name = KBUILD_MODNAME, .id_table = snd_es1968_ids, .probe = snd_es1968_probe, .remove = __devexit_p(snd_es1968_remove), diff --git a/trunk/sound/pci/fm801.c b/trunk/sound/pci/fm801.c index a7ec7030cf87..db3963c4bf88 100644 --- a/trunk/sound/pci/fm801.c +++ b/trunk/sound/pci/fm801.c @@ -1394,7 +1394,7 @@ static int snd_fm801_resume(struct pci_dev *pci) #endif static struct pci_driver driver = { - .name = "FM801", + .name = KBUILD_MODNAME, .id_table = snd_fm801_ids, .probe = snd_card_fm801_probe, .remove = __devexit_p(snd_card_fm801_remove), diff --git a/trunk/sound/pci/hda/hda_beep.h b/trunk/sound/pci/hda/hda_beep.h index 4967eabe774e..f1de1bac042c 100644 --- a/trunk/sound/pci/hda/hda_beep.h +++ b/trunk/sound/pci/hda/hda_beep.h @@ -50,12 +50,7 @@ int snd_hda_enable_beep_device(struct hda_codec *codec, int enable); int snd_hda_attach_beep_device(struct hda_codec *codec, int nid); void snd_hda_detach_beep_device(struct hda_codec *codec); #else -static inline int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) -{ - return 0; -} -void snd_hda_detach_beep_device(struct hda_codec *codec) -{ -} +#define snd_hda_attach_beep_device(...) 0 +#define snd_hda_detach_beep_device(...) #endif #endif diff --git a/trunk/sound/pci/hda/hda_intel.c b/trunk/sound/pci/hda/hda_intel.c index 486f6deb3eee..29f1d36d6cb0 100644 --- a/trunk/sound/pci/hda/hda_intel.c +++ b/trunk/sound/pci/hda/hda_intel.c @@ -2908,7 +2908,7 @@ MODULE_DEVICE_TABLE(pci, azx_ids); /* pci_driver definition */ static struct pci_driver driver = { - .name = "HDA Intel", + .name = KBUILD_MODNAME, .id_table = azx_ids, .probe = azx_probe, .remove = __devexit_p(azx_remove), diff --git a/trunk/sound/pci/hda/patch_conexant.c b/trunk/sound/pci/hda/patch_conexant.c index 694b9daf691f..3e6b9a8539c2 100644 --- a/trunk/sound/pci/hda/patch_conexant.c +++ b/trunk/sound/pci/hda/patch_conexant.c @@ -3102,7 +3102,6 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = { SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS), SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo G565", CXT5066_AUTO), SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ - SND_PCI_QUIRK(0x1b0a, 0x2092, "CyberpowerPC Gamer Xplorer N57001", CXT5066_AUTO), {} }; diff --git a/trunk/sound/pci/hda/patch_realtek.c b/trunk/sound/pci/hda/patch_realtek.c index 61a774b3d3cb..7a4e10002f56 100644 --- a/trunk/sound/pci/hda/patch_realtek.c +++ b/trunk/sound/pci/hda/patch_realtek.c @@ -1141,13 +1141,6 @@ static void update_speakers(struct hda_codec *codec) struct alc_spec *spec = codec->spec; int on; - /* Control HP pins/amps depending on master_mute state; - * in general, HP pins/amps control should be enabled in all cases, - * but currently set only for master_mute, just to be safe - */ - do_automute(codec, ARRAY_SIZE(spec->autocfg.hp_pins), - spec->autocfg.hp_pins, spec->master_mute, true); - if (!spec->automute) on = 0; else @@ -6208,6 +6201,11 @@ static const struct snd_kcontrol_new alc260_input_mixer[] = { /* update HP, line and mono out pins according to the master switch */ static void alc260_hp_master_update(struct hda_codec *codec) { + struct alc_spec *spec = codec->spec; + + /* change HP pins */ + do_automute(codec, ARRAY_SIZE(spec->autocfg.hp_pins), + spec->autocfg.hp_pins, spec->master_mute, true); update_speakers(codec); } @@ -11926,7 +11924,7 @@ static const struct hda_verb alc262_nec_verbs[] = { * 0x1b = port replicator headphone out */ -#define ALC_HP_EVENT ALC880_HP_EVENT +#define ALC_HP_EVENT 0x37 static const struct hda_verb alc262_fujitsu_unsol_verbs[] = { {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT}, @@ -13316,8 +13314,9 @@ static void alc268_acer_lc_setup(struct hda_codec *codec) struct alc_spec *spec = codec->spec; spec->autocfg.hp_pins[0] = 0x15; spec->autocfg.speaker_pins[0] = 0x14; + spec->automute_mixer_nid[0] = 0x0f; spec->automute = 1; - spec->automute_mode = ALC_AUTOMUTE_AMP; + spec->automute_mode = ALC_AUTOMUTE_MIXER; spec->ext_mic.pin = 0x18; spec->ext_mic.mux_idx = 0; spec->int_mic.pin = 0x12; @@ -13861,7 +13860,6 @@ static const struct snd_pci_quirk alc268_cfg_tbl[] = { SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One", ALC268_ACER_ASPIRE_ONE), SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), - SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron 910", ALC268_AUTO), SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0, "Dell Inspiron Mini9/Vostro A90", ALC268_DELL), /* almost compatible with toshiba but with optional digital outs; diff --git a/trunk/sound/pci/ice1712/ice1712.c b/trunk/sound/pci/ice1712/ice1712.c index f4594d76b6ea..7410df93769c 100644 --- a/trunk/sound/pci/ice1712/ice1712.c +++ b/trunk/sound/pci/ice1712/ice1712.c @@ -2802,7 +2802,7 @@ static void __devexit snd_ice1712_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "ICE1712", + .name = KBUILD_MODNAME, .id_table = snd_ice1712_ids, .probe = snd_ice1712_probe, .remove = __devexit_p(snd_ice1712_remove), diff --git a/trunk/sound/pci/ice1712/ice1724.c b/trunk/sound/pci/ice1712/ice1724.c index c1498fa5545f..5e7db8dab1a2 100644 --- a/trunk/sound/pci/ice1712/ice1724.c +++ b/trunk/sound/pci/ice1712/ice1724.c @@ -2802,7 +2802,7 @@ static int snd_vt1724_resume(struct pci_dev *pci) #endif static struct pci_driver driver = { - .name = "ICE1724", + .name = KBUILD_MODNAME, .id_table = snd_vt1724_ids, .probe = snd_vt1724_probe, .remove = __devexit_p(snd_vt1724_remove), diff --git a/trunk/sound/pci/intel8x0.c b/trunk/sound/pci/intel8x0.c index 6c896dbfd796..c01a89b78d43 100644 --- a/trunk/sound/pci/intel8x0.c +++ b/trunk/sound/pci/intel8x0.c @@ -3266,7 +3266,7 @@ static void __devexit snd_intel8x0_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "Intel ICH", + .name = KBUILD_MODNAME, .id_table = snd_intel8x0_ids, .probe = snd_intel8x0_probe, .remove = __devexit_p(snd_intel8x0_remove), diff --git a/trunk/sound/pci/intel8x0m.c b/trunk/sound/pci/intel8x0m.c index f3353b49c785..5eed9ebb446b 100644 --- a/trunk/sound/pci/intel8x0m.c +++ b/trunk/sound/pci/intel8x0m.c @@ -1325,7 +1325,7 @@ static void __devexit snd_intel8x0m_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "Intel ICH Modem", + .name = KBUILD_MODNAME, .id_table = snd_intel8x0m_ids, .probe = snd_intel8x0m_probe, .remove = __devexit_p(snd_intel8x0m_remove), diff --git a/trunk/sound/pci/korg1212/korg1212.c b/trunk/sound/pci/korg1212/korg1212.c index 6d795700be79..544a6cdfa2d5 100644 --- a/trunk/sound/pci/korg1212/korg1212.c +++ b/trunk/sound/pci/korg1212/korg1212.c @@ -2477,7 +2477,7 @@ static void __devexit snd_korg1212_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "korg1212", + .name = KBUILD_MODNAME, .id_table = snd_korg1212_ids, .probe = snd_korg1212_probe, .remove = __devexit_p(snd_korg1212_remove), diff --git a/trunk/sound/pci/lola/lola.c b/trunk/sound/pci/lola/lola.c index 34b24286d279..77c5e8675419 100644 --- a/trunk/sound/pci/lola/lola.c +++ b/trunk/sound/pci/lola/lola.c @@ -771,7 +771,7 @@ MODULE_DEVICE_TABLE(pci, lola_ids); /* pci_driver definition */ static struct pci_driver driver = { - .name = DRVNAME, + .name = KBUILD_MODNAME, .id_table = lola_ids, .probe = lola_probe, .remove = __devexit_p(lola_remove), diff --git a/trunk/sound/pci/lx6464es/lx6464es.c b/trunk/sound/pci/lx6464es/lx6464es.c index 1bd7a540fd49..b0bd3c53e876 100644 --- a/trunk/sound/pci/lx6464es/lx6464es.c +++ b/trunk/sound/pci/lx6464es/lx6464es.c @@ -1137,7 +1137,7 @@ static void __devexit snd_lx6464es_remove(struct pci_dev *pci) static struct pci_driver driver = { - .name = "Digigram LX6464ES", + .name = KBUILD_MODNAME, .id_table = snd_lx6464es_ids, .probe = snd_lx6464es_probe, .remove = __devexit_p(snd_lx6464es_remove), diff --git a/trunk/sound/pci/maestro3.c b/trunk/sound/pci/maestro3.c index 3c40d726b46e..0499bf8716d0 100644 --- a/trunk/sound/pci/maestro3.c +++ b/trunk/sound/pci/maestro3.c @@ -2885,7 +2885,7 @@ static void __devexit snd_m3_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "Maestro3", + .name = KBUILD_MODNAME, .id_table = snd_m3_ids, .probe = snd_m3_probe, .remove = __devexit_p(snd_m3_remove), diff --git a/trunk/sound/pci/mixart/mixart.c b/trunk/sound/pci/mixart/mixart.c index 6c3fd4d1c49d..9d87e44abd6c 100644 --- a/trunk/sound/pci/mixart/mixart.c +++ b/trunk/sound/pci/mixart/mixart.c @@ -1381,7 +1381,7 @@ static void __devexit snd_mixart_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "Digigram miXart", + .name = KBUILD_MODNAME, .id_table = snd_mixart_ids, .probe = snd_mixart_probe, .remove = __devexit_p(snd_mixart_remove), diff --git a/trunk/sound/pci/nm256/nm256.c b/trunk/sound/pci/nm256/nm256.c index 5a60492ac7b3..fd19b7f936ba 100644 --- a/trunk/sound/pci/nm256/nm256.c +++ b/trunk/sound/pci/nm256/nm256.c @@ -1743,7 +1743,7 @@ static void __devexit snd_nm256_remove(struct pci_dev *pci) static struct pci_driver driver = { - .name = "NeoMagic 256", + .name = KBUILD_MODNAME, .id_table = snd_nm256_ids, .probe = snd_nm256_probe, .remove = __devexit_p(snd_nm256_remove), diff --git a/trunk/sound/pci/oxygen/oxygen.c b/trunk/sound/pci/oxygen/oxygen.c index d7e8ddd9a67b..218d9854e5cb 100644 --- a/trunk/sound/pci/oxygen/oxygen.c +++ b/trunk/sound/pci/oxygen/oxygen.c @@ -859,7 +859,7 @@ static int __devinit generic_oxygen_probe(struct pci_dev *pci, } static struct pci_driver oxygen_driver = { - .name = "CMI8788", + .name = KBUILD_MODNAME, .id_table = oxygen_ids, .probe = generic_oxygen_probe, .remove = __devexit_p(oxygen_pci_remove), diff --git a/trunk/sound/pci/oxygen/virtuoso.c b/trunk/sound/pci/oxygen/virtuoso.c index 469010a8b849..773db794b43f 100644 --- a/trunk/sound/pci/oxygen/virtuoso.c +++ b/trunk/sound/pci/oxygen/virtuoso.c @@ -88,7 +88,7 @@ static int __devinit xonar_probe(struct pci_dev *pci, } static struct pci_driver xonar_driver = { - .name = "AV200", + .name = KBUILD_MODNAME, .id_table = xonar_ids, .probe = xonar_probe, .remove = __devexit_p(oxygen_pci_remove), diff --git a/trunk/sound/pci/pcxhr/pcxhr.c b/trunk/sound/pci/pcxhr/pcxhr.c index 95cfde27d25c..cb215a01ebb6 100644 --- a/trunk/sound/pci/pcxhr/pcxhr.c +++ b/trunk/sound/pci/pcxhr/pcxhr.c @@ -1608,7 +1608,7 @@ static void __devexit pcxhr_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "Digigram pcxhr", + .name = KBUILD_MODNAME, .id_table = pcxhr_ids, .probe = pcxhr_probe, .remove = __devexit_p(pcxhr_remove), diff --git a/trunk/sound/pci/riptide/riptide.c b/trunk/sound/pci/riptide/riptide.c index ad5202efd7a9..91c0cb69d306 100644 --- a/trunk/sound/pci/riptide/riptide.c +++ b/trunk/sound/pci/riptide/riptide.c @@ -2176,7 +2176,7 @@ static void __devexit snd_card_riptide_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "RIPTIDE", + .name = KBUILD_MODNAME, .id_table = snd_riptide_ids, .probe = snd_card_riptide_probe, .remove = __devexit_p(snd_card_riptide_remove), @@ -2188,7 +2188,7 @@ static struct pci_driver driver = { #ifdef SUPPORT_JOYSTICK static struct pci_driver joystick_driver = { - .name = "Riptide Joystick", + .name = KBUILD_MODNAME "-joystick", .id_table = snd_riptide_joystick_ids, .probe = snd_riptide_joystick_probe, .remove = __devexit_p(snd_riptide_joystick_remove), diff --git a/trunk/sound/pci/rme32.c b/trunk/sound/pci/rme32.c index 3c04524de37c..c7bcc63097f4 100644 --- a/trunk/sound/pci/rme32.c +++ b/trunk/sound/pci/rme32.c @@ -1985,7 +1985,7 @@ static void __devexit snd_rme32_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "RME Digi32", + .name = KBUILD_MODNAME, .id_table = snd_rme32_ids, .probe = snd_rme32_probe, .remove = __devexit_p(snd_rme32_remove), diff --git a/trunk/sound/pci/rme96.c b/trunk/sound/pci/rme96.c index 9ff247fc8871..a3646118abb0 100644 --- a/trunk/sound/pci/rme96.c +++ b/trunk/sound/pci/rme96.c @@ -2396,7 +2396,7 @@ static void __devexit snd_rme96_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "RME Digi96", + .name = KBUILD_MODNAME, .id_table = snd_rme96_ids, .probe = snd_rme96_probe, .remove = __devexit_p(snd_rme96_remove), diff --git a/trunk/sound/pci/rme9652/hdsp.c b/trunk/sound/pci/rme9652/hdsp.c index 2d8332416c83..da50c5562942 100644 --- a/trunk/sound/pci/rme9652/hdsp.c +++ b/trunk/sound/pci/rme9652/hdsp.c @@ -5637,7 +5637,7 @@ static void __devexit snd_hdsp_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "RME Hammerfall DSP", + .name = KBUILD_MODNAME, .id_table = snd_hdsp_ids, .probe = snd_hdsp_probe, .remove = __devexit_p(snd_hdsp_remove), diff --git a/trunk/sound/pci/rme9652/hdspm.c b/trunk/sound/pci/rme9652/hdspm.c index 3f08afc0f0d3..2785f4cef349 100644 --- a/trunk/sound/pci/rme9652/hdspm.c +++ b/trunk/sound/pci/rme9652/hdspm.c @@ -521,7 +521,6 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}"); #define HDSPM_DMA_AREA_KILOBYTES (HDSPM_DMA_AREA_BYTES/1024) /* revisions >= 230 indicate AES32 card */ -#define HDSPM_MADI_OLD_REV 207 #define HDSPM_MADI_REV 210 #define HDSPM_RAYDAT_REV 211 #define HDSPM_AIO_REV 212 @@ -1144,7 +1143,7 @@ static int hdspm_external_sample_rate(struct hdspm *hdspm) /* if wordclock has synced freq and wordclock is valid */ if ((status2 & HDSPM_wcLock) != 0 && - (status2 & HDSPM_SelSyncRef0) == 0) { + (status & HDSPM_SelSyncRef0) == 0) { rate_bits = status2 & HDSPM_wcFreqMask; @@ -1640,14 +1639,12 @@ static int snd_hdspm_midi_input_read (struct hdspm_midi *hmidi) } } hmidi->pending = 0; - spin_unlock_irqrestore(&hmidi->lock, flags); - spin_lock_irqsave(&hmidi->hdspm->lock, flags); hmidi->hdspm->control_register |= hmidi->ie; hdspm_write(hmidi->hdspm, HDSPM_controlRegister, hmidi->hdspm->control_register); - spin_unlock_irqrestore(&hmidi->hdspm->lock, flags); + spin_unlock_irqrestore (&hmidi->lock, flags); return snd_hdspm_midi_output_write (hmidi); } @@ -6380,7 +6377,6 @@ static int __devinit snd_hdspm_create(struct snd_card *card, switch (hdspm->firmware_rev) { case HDSPM_MADI_REV: - case HDSPM_MADI_OLD_REV: hdspm->io_type = MADI; hdspm->card_name = "RME MADI"; hdspm->midiPorts = 3; @@ -6779,7 +6775,7 @@ static void __devexit snd_hdspm_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "RME Hammerfall DSP MADI", + .name = KBUILD_MODNAME, .id_table = snd_hdspm_ids, .probe = snd_hdspm_probe, .remove = __devexit_p(snd_hdspm_remove), diff --git a/trunk/sound/pci/rme9652/rme9652.c b/trunk/sound/pci/rme9652/rme9652.c index c492af5b25f3..9646a8422a85 100644 --- a/trunk/sound/pci/rme9652/rme9652.c +++ b/trunk/sound/pci/rme9652/rme9652.c @@ -2632,7 +2632,7 @@ static void __devexit snd_rme9652_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "RME Digi9652 (Hammerfall)", + .name = KBUILD_MODNAME, .id_table = snd_rme9652_ids, .probe = snd_rme9652_probe, .remove = __devexit_p(snd_rme9652_remove), diff --git a/trunk/sound/pci/sis7019.c b/trunk/sound/pci/sis7019.c index 2b5c7a95ae1f..02654dc1d382 100644 --- a/trunk/sound/pci/sis7019.c +++ b/trunk/sound/pci/sis7019.c @@ -1436,7 +1436,7 @@ static void __devexit snd_sis7019_remove(struct pci_dev *pci) } static struct pci_driver sis7019_driver = { - .name = "SiS7019", + .name = KBUILD_MODNAME, .id_table = snd_sis7019_ids, .probe = snd_sis7019_probe, .remove = __devexit_p(snd_sis7019_remove), diff --git a/trunk/sound/pci/sonicvibes.c b/trunk/sound/pci/sonicvibes.c index 337b9facadfd..860903e10f0f 100644 --- a/trunk/sound/pci/sonicvibes.c +++ b/trunk/sound/pci/sonicvibes.c @@ -1530,7 +1530,7 @@ static void __devexit snd_sonic_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "S3 SonicVibes", + .name = KBUILD_MODNAME, .id_table = snd_sonic_ids, .probe = snd_sonic_probe, .remove = __devexit_p(snd_sonic_remove), diff --git a/trunk/sound/pci/trident/trident.c b/trunk/sound/pci/trident/trident.c index 6d0581841d7a..d8a128f6fc02 100644 --- a/trunk/sound/pci/trident/trident.c +++ b/trunk/sound/pci/trident/trident.c @@ -172,7 +172,7 @@ static void __devexit snd_trident_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "Trident4DWaveAudio", + .name = KBUILD_MODNAME, .id_table = snd_trident_ids, .probe = snd_trident_probe, .remove = __devexit_p(snd_trident_remove), diff --git a/trunk/sound/pci/via82xx.c b/trunk/sound/pci/via82xx.c index 8c5f8b5a59f0..d0e19c0c4f0a 100644 --- a/trunk/sound/pci/via82xx.c +++ b/trunk/sound/pci/via82xx.c @@ -2611,7 +2611,7 @@ static void __devexit snd_via82xx_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "VIA 82xx Audio", + .name = KBUILD_MODNAME, .id_table = snd_via82xx_ids, .probe = snd_via82xx_probe, .remove = __devexit_p(snd_via82xx_remove), diff --git a/trunk/sound/pci/via82xx_modem.c b/trunk/sound/pci/via82xx_modem.c index f7e8bbbe3953..c55401acf6b2 100644 --- a/trunk/sound/pci/via82xx_modem.c +++ b/trunk/sound/pci/via82xx_modem.c @@ -1224,7 +1224,7 @@ static void __devexit snd_via82xx_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "VIA 82xx Modem", + .name = KBUILD_MODNAME, .id_table = snd_via82xx_modem_ids, .probe = snd_via82xx_probe, .remove = __devexit_p(snd_via82xx_remove), diff --git a/trunk/sound/pci/vx222/vx222.c b/trunk/sound/pci/vx222/vx222.c index 99a9a814be0b..371d9d399d25 100644 --- a/trunk/sound/pci/vx222/vx222.c +++ b/trunk/sound/pci/vx222/vx222.c @@ -290,7 +290,7 @@ static int snd_vx222_resume(struct pci_dev *pci) #endif static struct pci_driver driver = { - .name = "Digigram VX222", + .name = KBUILD_MODNAME, .id_table = snd_vx222_ids, .probe = snd_vx222_probe, .remove = __devexit_p(snd_vx222_remove), diff --git a/trunk/sound/pci/ymfpci/ymfpci.c b/trunk/sound/pci/ymfpci/ymfpci.c index 80c682113381..511d57653124 100644 --- a/trunk/sound/pci/ymfpci/ymfpci.c +++ b/trunk/sound/pci/ymfpci/ymfpci.c @@ -345,7 +345,7 @@ static void __devexit snd_card_ymfpci_remove(struct pci_dev *pci) } static struct pci_driver driver = { - .name = "Yamaha DS-1 PCI", + .name = KBUILD_MODNAME, .id_table = snd_ymfpci_ids, .probe = snd_card_ymfpci_probe, .remove = __devexit_p(snd_card_ymfpci_remove), diff --git a/trunk/sound/soc/atmel/atmel_ssc_dai.c b/trunk/sound/soc/atmel/atmel_ssc_dai.c index eda955b15834..7fbfa051f6e1 100644 --- a/trunk/sound/soc/atmel/atmel_ssc_dai.c +++ b/trunk/sound/soc/atmel/atmel_ssc_dai.c @@ -848,10 +848,9 @@ int atmel_ssc_set_audio(int ssc_id) if (IS_ERR(ssc)) pr_warn("Unable to parent ASoC SSC DAI on SSC: %ld\n", PTR_ERR(ssc)); - else { + else ssc_pdev->dev.parent = &(ssc->pdev->dev); - ssc_free(ssc); - } + ssc_free(ssc); ret = platform_device_add(ssc_pdev); if (ret < 0) diff --git a/trunk/sound/soc/blackfin/bf5xx-ad1836.c b/trunk/sound/soc/blackfin/bf5xx-ad1836.c index f79d1655e035..ea4951cf5526 100644 --- a/trunk/sound/soc/blackfin/bf5xx-ad1836.c +++ b/trunk/sound/soc/blackfin/bf5xx-ad1836.c @@ -75,7 +75,7 @@ static struct snd_soc_dai_link bf5xx_ad1836_dai[] = { .cpu_dai_name = "bfin-tdm.0", .codec_dai_name = "ad1836-hifi", .platform_name = "bfin-tdm-pcm-audio", - .codec_name = "spi0.4", + .codec_name = "ad1836.0", .ops = &bf5xx_ad1836_ops, }, { @@ -84,7 +84,7 @@ static struct snd_soc_dai_link bf5xx_ad1836_dai[] = { .cpu_dai_name = "bfin-tdm.1", .codec_dai_name = "ad1836-hifi", .platform_name = "bfin-tdm-pcm-audio", - .codec_name = "spi0.4", + .codec_name = "ad1836.0", .ops = &bf5xx_ad1836_ops, }, }; diff --git a/trunk/sound/soc/codecs/ad1836.c b/trunk/sound/soc/codecs/ad1836.c index 754c496412bd..ab63d52e36e1 100644 --- a/trunk/sound/soc/codecs/ad1836.c +++ b/trunk/sound/soc/codecs/ad1836.c @@ -145,22 +145,22 @@ static int ad1836_hw_params(struct snd_pcm_substream *substream, /* bit size */ switch (params_format(params)) { case SNDRV_PCM_FORMAT_S16_LE: - word_len = AD1836_WORD_LEN_16; + word_len = 3; break; case SNDRV_PCM_FORMAT_S20_3LE: - word_len = AD1836_WORD_LEN_20; + word_len = 1; break; case SNDRV_PCM_FORMAT_S24_LE: case SNDRV_PCM_FORMAT_S32_LE: - word_len = AD1836_WORD_LEN_24; + word_len = 0; break; } - snd_soc_update_bits(codec, AD1836_DAC_CTRL1, AD1836_DAC_WORD_LEN_MASK, - word_len << AD1836_DAC_WORD_LEN_OFFSET); + snd_soc_update_bits(codec, AD1836_DAC_CTRL1, + AD1836_DAC_WORD_LEN_MASK, word_len); - snd_soc_update_bits(codec, AD1836_ADC_CTRL2, AD1836_ADC_WORD_LEN_MASK, - word_len << AD1836_ADC_WORD_OFFSET); + snd_soc_update_bits(codec, AD1836_ADC_CTRL2, + AD1836_ADC_WORD_LEN_MASK, word_len); return 0; } diff --git a/trunk/sound/soc/codecs/ad1836.h b/trunk/sound/soc/codecs/ad1836.h index 9d6a3f8f8aaf..845596717fdf 100644 --- a/trunk/sound/soc/codecs/ad1836.h +++ b/trunk/sound/soc/codecs/ad1836.h @@ -25,7 +25,6 @@ #define AD1836_DAC_SERFMT_PCK256 (0x4 << 5) #define AD1836_DAC_SERFMT_PCK128 (0x5 << 5) #define AD1836_DAC_WORD_LEN_MASK 0x18 -#define AD1836_DAC_WORD_LEN_OFFSET 3 #define AD1836_DAC_CTRL2 1 #define AD1836_DACL1_MUTE 0 @@ -52,7 +51,6 @@ #define AD1836_ADCL2_MUTE 2 #define AD1836_ADCR2_MUTE 3 #define AD1836_ADC_WORD_LEN_MASK 0x30 -#define AD1836_ADC_WORD_OFFSET 5 #define AD1836_ADC_SERFMT_MASK (7 << 6) #define AD1836_ADC_SERFMT_PCK256 (0x4 << 6) #define AD1836_ADC_SERFMT_PCK128 (0x5 << 6) @@ -62,8 +60,4 @@ #define AD1836_NUM_REGS 16 -#define AD1836_WORD_LEN_24 0x0 -#define AD1836_WORD_LEN_20 0x1 -#define AD1836_WORD_LEN_16 0x2 - #endif diff --git a/trunk/sound/soc/codecs/wm8804.c b/trunk/sound/soc/codecs/wm8804.c index 9a5e67c5a6bd..6785688f8806 100644 --- a/trunk/sound/soc/codecs/wm8804.c +++ b/trunk/sound/soc/codecs/wm8804.c @@ -680,25 +680,20 @@ static struct snd_soc_dai_ops wm8804_dai_ops = { #define WM8804_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ SNDRV_PCM_FMTBIT_S24_LE) -#define WM8804_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ - SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \ - SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | \ - SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000) - static struct snd_soc_dai_driver wm8804_dai = { .name = "wm8804-spdif", .playback = { .stream_name = "Playback", .channels_min = 2, .channels_max = 2, - .rates = WM8804_RATES, + .rates = SNDRV_PCM_RATE_8000_192000, .formats = WM8804_FORMATS, }, .capture = { .stream_name = "Capture", .channels_min = 2, .channels_max = 2, - .rates = WM8804_RATES, + .rates = SNDRV_PCM_RATE_8000_192000, .formats = WM8804_FORMATS, }, .ops = &wm8804_dai_ops, diff --git a/trunk/sound/soc/codecs/wm8915.c b/trunk/sound/soc/codecs/wm8915.c index e2ab4fac2819..a0b1a7278284 100644 --- a/trunk/sound/soc/codecs/wm8915.c +++ b/trunk/sound/soc/codecs/wm8915.c @@ -1839,7 +1839,7 @@ static int wm8915_set_sysclk(struct snd_soc_dai *dai, int old; /* Disable SYSCLK while we reconfigure */ - old = snd_soc_read(codec, WM8915_AIF_CLOCKING_1) & WM8915_SYSCLK_ENA; + old = snd_soc_read(codec, WM8915_AIF_CLOCKING_1); snd_soc_update_bits(codec, WM8915_AIF_CLOCKING_1, WM8915_SYSCLK_ENA, 0); @@ -2038,7 +2038,6 @@ static int wm8915_set_fll(struct snd_soc_codec *codec, int fll_id, int source, break; case WM8915_FLL_MCLK2: reg = 1; - break; case WM8915_FLL_DACLRCLK1: reg = 2; break; diff --git a/trunk/sound/soc/codecs/wm8962.c b/trunk/sound/soc/codecs/wm8962.c index 5e05eed96c38..f90ae427242b 100644 --- a/trunk/sound/soc/codecs/wm8962.c +++ b/trunk/sound/soc/codecs/wm8962.c @@ -1999,12 +1999,12 @@ static int wm8962_put_hp_sw(struct snd_kcontrol *kcontrol, return 0; /* If the left PGA is enabled hit that VU bit... */ - if (snd_soc_read(codec, WM8962_PWR_MGMT_2) & WM8962_HPOUTL_PGA_ENA) + if (reg_cache[WM8962_PWR_MGMT_2] & WM8962_HPOUTL_PGA_ENA) return snd_soc_write(codec, WM8962_HPOUTL_VOLUME, reg_cache[WM8962_HPOUTL_VOLUME]); /* ...otherwise the right. The VU is stereo. */ - if (snd_soc_read(codec, WM8962_PWR_MGMT_2) & WM8962_HPOUTR_PGA_ENA) + if (reg_cache[WM8962_PWR_MGMT_2] & WM8962_HPOUTR_PGA_ENA) return snd_soc_write(codec, WM8962_HPOUTR_VOLUME, reg_cache[WM8962_HPOUTR_VOLUME]); diff --git a/trunk/sound/soc/fsl/fsl_dma.c b/trunk/sound/soc/fsl/fsl_dma.c index 6680c0b4d203..15dac0f20cd8 100644 --- a/trunk/sound/soc/fsl/fsl_dma.c +++ b/trunk/sound/soc/fsl/fsl_dma.c @@ -310,7 +310,7 @@ static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai, * should allocate a DMA buffer only for the streams that are valid. */ - if (pcm->streams[0].substream) { + if (dai->driver->playback.channels_min) { ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, fsl_dma_hardware.buffer_bytes_max, &pcm->streams[0].substream->dma_buffer); @@ -320,13 +320,13 @@ static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai, } } - if (pcm->streams[1].substream) { + if (dai->driver->capture.channels_min) { ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, fsl_dma_hardware.buffer_bytes_max, &pcm->streams[1].substream->dma_buffer); if (ret) { - dev_err(card->dev, "can't alloc capture dma buffer\n"); snd_dma_free_pages(&pcm->streams[0].substream->dma_buffer); + dev_err(card->dev, "can't alloc capture dma buffer\n"); return ret; } } @@ -449,8 +449,7 @@ static int fsl_dma_open(struct snd_pcm_substream *substream) dma_private->ld_buf_phys = ld_buf_phys; dma_private->dma_buf_phys = substream->dma_buffer.addr; - ret = request_irq(dma_private->irq, fsl_dma_isr, 0, "fsldma-audio", - dma_private); + ret = request_irq(dma_private->irq, fsl_dma_isr, 0, "DMA", dma_private); if (ret) { dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n", dma_private->irq, ret); diff --git a/trunk/sound/soc/samsung/i2s.c b/trunk/sound/soc/samsung/i2s.c index 992a732b5211..ffa09b3b2caa 100644 --- a/trunk/sound/soc/samsung/i2s.c +++ b/trunk/sound/soc/samsung/i2s.c @@ -191,7 +191,7 @@ static inline bool tx_active(struct i2s_dai *i2s) if (!i2s) return false; - active = readl(i2s->addr + I2SCON); + active = readl(i2s->addr + I2SMOD); if (is_secondary(i2s)) active &= CON_TXSDMA_ACTIVE; @@ -223,7 +223,7 @@ static inline bool rx_active(struct i2s_dai *i2s) if (!i2s) return false; - active = readl(i2s->addr + I2SCON) & CON_RXDMA_ACTIVE; + active = readl(i2s->addr + I2SMOD) & CON_RXDMA_ACTIVE; return active ? true : false; } diff --git a/trunk/sound/soc/soc-cache.c b/trunk/sound/soc/soc-cache.c index c005ceb70c9d..06b7b81a1601 100644 --- a/trunk/sound/soc/soc-cache.c +++ b/trunk/sound/soc/soc-cache.c @@ -466,9 +466,6 @@ static bool snd_soc_set_cache_val(void *base, unsigned int idx, static unsigned int snd_soc_get_cache_val(const void *base, unsigned int idx, unsigned int word_size) { - if (!base) - return -1; - switch (word_size) { case 1: { const u8 *cache = base; diff --git a/trunk/sound/soc/soc-dapm.c b/trunk/sound/soc/soc-dapm.c index 32ab7fc4579a..776e6f418306 100644 --- a/trunk/sound/soc/soc-dapm.c +++ b/trunk/sound/soc/soc-dapm.c @@ -350,9 +350,9 @@ static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm, } /* create new dapm mixer control */ -static int dapm_new_mixer(struct snd_soc_dapm_widget *w) +static int dapm_new_mixer(struct snd_soc_dapm_context *dapm, + struct snd_soc_dapm_widget *w) { - struct snd_soc_dapm_context *dapm = w->dapm; int i, ret = 0; size_t name_len, prefix_len; struct snd_soc_dapm_path *path; @@ -450,9 +450,9 @@ static int dapm_new_mixer(struct snd_soc_dapm_widget *w) } /* create new dapm mux control */ -static int dapm_new_mux(struct snd_soc_dapm_widget *w) +static int dapm_new_mux(struct snd_soc_dapm_context *dapm, + struct snd_soc_dapm_widget *w) { - struct snd_soc_dapm_context *dapm = w->dapm; struct snd_soc_dapm_path *path = NULL; struct snd_kcontrol *kcontrol; struct snd_card *card = dapm->card->snd_card; @@ -535,7 +535,8 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w) } /* create new dapm volume control */ -static int dapm_new_pga(struct snd_soc_dapm_widget *w) +static int dapm_new_pga(struct snd_soc_dapm_context *dapm, + struct snd_soc_dapm_widget *w) { if (w->num_kcontrols) dev_err(w->dapm->dev, @@ -1825,13 +1826,13 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) case snd_soc_dapm_mixer: case snd_soc_dapm_mixer_named_ctl: w->power_check = dapm_generic_check_power; - dapm_new_mixer(w); + dapm_new_mixer(dapm, w); break; case snd_soc_dapm_mux: case snd_soc_dapm_virt_mux: case snd_soc_dapm_value_mux: w->power_check = dapm_generic_check_power; - dapm_new_mux(w); + dapm_new_mux(dapm, w); break; case snd_soc_dapm_adc: case snd_soc_dapm_aif_out: @@ -1844,7 +1845,7 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) case snd_soc_dapm_pga: case snd_soc_dapm_out_drv: w->power_check = dapm_generic_check_power; - dapm_new_pga(w); + dapm_new_pga(dapm, w); break; case snd_soc_dapm_input: case snd_soc_dapm_output: diff --git a/trunk/sound/usb/6fire/firmware.c b/trunk/sound/usb/6fire/firmware.c index 1e3ae3327dd3..a91719d5918b 100644 --- a/trunk/sound/usb/6fire/firmware.c +++ b/trunk/sound/usb/6fire/firmware.c @@ -270,6 +270,7 @@ static int usb6fire_fw_ezusb_upload( data = 0x00; /* resume ezusb cpu */ ret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1); if (ret < 0) { + release_firmware(fw); snd_printk(KERN_ERR PREFIX "unable to upload ezusb " "firmware %s: end message.\n", fwname); return ret;