Commit dd4b42ac authored by Jaroslav Kysela's avatar Jaroslav Kysela Committed by Jaroslav Kysela

[PATCH] ALSA update [12/12] - 2002/10/01

  - deleted sound/pci/ice1712.c
  - fixed Makefile to point to sound/pci/ice1712 directory
  - added Ensoniq SoundScape header file and HWDEP IFACE
  - CS4231
    - added CS4231_HW_AD1845 and register definitions for AD1845
  - USB
    - added snd-rawmidi.o to the snd-usb-audio's dependency if sequencer is
  - PCI DMA allocation
    - fixed the wrapper again
  - AC'97 codec
    - added HSD11246 identification (Conexant), a bit improved proc contents
  - CMIPCI
    - changed the DMA configuration for period size
    - fixed compile with SOFT_AC3 option
    - added PCM_INFO_PAUSE to hw settings.  now pause should work properly
    - corrected the modem on/off bit (FLINK)
  - ICE1712
    - compilation fixes
  - intel8x0
    - use mmio for codec on nforce (pci resource 2)
    - clean up and fix ali5455 codes
  - RME32
    - enable 88.2/96kHz on capture with CS8414
  - VIA82xx
    - fixed the size of allocated bd array to be released
    - fixed the allocation size of idx_table
  - PPC Awacs
    - replaced one more mdelay() with schedule
    - try to touch mic boost on screamer at init
  - USB Audio
    - reset each interface at initialization
    - reset the old interface if a new interface is chosen
    - don't claim the interface which already claimed
parent cd5738dc
...@@ -103,9 +103,10 @@ enum sndrv_hwdep_iface { ...@@ -103,9 +103,10 @@ enum sndrv_hwdep_iface {
SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */ SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */
SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */ SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */
SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */ SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */
SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */
/* Don't forget to change the following: */ /* Don't forget to change the following: */
SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_ICS2115, SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SSCAPE,
}; };
struct sndrv_hwdep_info { struct sndrv_hwdep_info {
......
...@@ -54,22 +54,28 @@ ...@@ -54,22 +54,28 @@
#define CS4231_PLY_UPR_CNT 0x0e /* playback upper base count */ #define CS4231_PLY_UPR_CNT 0x0e /* playback upper base count */
#define CS4231_PLY_LWR_CNT 0x0f /* playback lower base count */ #define CS4231_PLY_LWR_CNT 0x0f /* playback lower base count */
#define CS4231_ALT_FEATURE_1 0x10 /* alternate #1 feature enable */ #define CS4231_ALT_FEATURE_1 0x10 /* alternate #1 feature enable */
#define AD1845_AF1_MIC_LEFT 0x10 /* alternate #1 feature + MIC left */
#define CS4231_ALT_FEATURE_2 0x11 /* alternate #2 feature enable */ #define CS4231_ALT_FEATURE_2 0x11 /* alternate #2 feature enable */
#define AD1845_AF2_MIC_RIGHT 0x11 /* alternate #2 feature + MIC right */
#define CS4231_LEFT_LINE_IN 0x12 /* left line input control */ #define CS4231_LEFT_LINE_IN 0x12 /* left line input control */
#define CS4231_RIGHT_LINE_IN 0x13 /* right line input control */ #define CS4231_RIGHT_LINE_IN 0x13 /* right line input control */
#define CS4231_TIMER_LOW 0x14 /* timer low byte */ #define CS4231_TIMER_LOW 0x14 /* timer low byte */
#define CS4231_TIMER_HIGH 0x15 /* timer high byte */ #define CS4231_TIMER_HIGH 0x15 /* timer high byte */
#define CS4231_LEFT_MIC_INPUT 0x16 /* left MIC input control register (InterWave only) */ #define CS4231_LEFT_MIC_INPUT 0x16 /* left MIC input control register (InterWave only) */
#define AD1845_UPR_FREQ_SEL 0x16 /* upper byte of frequency select */
#define CS4231_RIGHT_MIC_INPUT 0x17 /* right MIC input control register (InterWave only) */ #define CS4231_RIGHT_MIC_INPUT 0x17 /* right MIC input control register (InterWave only) */
#define AD1845_LWR_FREQ_SEL 0x17 /* lower byte of frequency select */
#define CS4236_EXT_REG 0x17 /* extended register access */ #define CS4236_EXT_REG 0x17 /* extended register access */
#define CS4231_IRQ_STATUS 0x18 /* irq status register */ #define CS4231_IRQ_STATUS 0x18 /* irq status register */
#define CS4231_LINE_LEFT_OUTPUT 0x19 /* left line output control register (InterWave only) */ #define CS4231_LINE_LEFT_OUTPUT 0x19 /* left line output control register (InterWave only) */
#define CS4231_VERSION 0x19 /* CS4231(A) - version values */ #define CS4231_VERSION 0x19 /* CS4231(A) - version values */
#define CS4231_MONO_CTRL 0x1a /* mono input/output control */ #define CS4231_MONO_CTRL 0x1a /* mono input/output control */
#define CS4231_LINE_RIGHT_OUTPUT 0x1b /* right line output control register (InterWave only) */ #define CS4231_LINE_RIGHT_OUTPUT 0x1b /* right line output control register (InterWave only) */
#define AD1845_PWR_DOWN 0x1b /* power down control */
#define CS4235_LEFT_MASTER 0x1b /* left master output control */ #define CS4235_LEFT_MASTER 0x1b /* left master output control */
#define CS4231_REC_FORMAT 0x1c /* clock and data format - record - bits 7-0 MCE */ #define CS4231_REC_FORMAT 0x1c /* clock and data format - record - bits 7-0 MCE */
#define CS4231_PLY_VAR_FREQ 0x1d /* playback variable frequency */ #define CS4231_PLY_VAR_FREQ 0x1d /* playback variable frequency */
#define AD1845_CLOCK 0x1d /* crystal clock select and total power down */
#define CS4235_RIGHT_MASTER 0x1d /* right master output control */ #define CS4235_RIGHT_MASTER 0x1d /* right master output control */
#define CS4231_REC_UPR_CNT 0x1e /* record upper count */ #define CS4231_REC_UPR_CNT 0x1e /* record upper count */
#define CS4231_REC_LWR_CNT 0x1f /* record lower count */ #define CS4231_REC_LWR_CNT 0x1f /* record lower count */
...@@ -191,6 +197,7 @@ ...@@ -191,6 +197,7 @@
#define CS4231_HW_CS4231_MASK 0x0100 /* CS4231 serie */ #define CS4231_HW_CS4231_MASK 0x0100 /* CS4231 serie */
#define CS4231_HW_CS4231 0x0100 /* CS4231 chip */ #define CS4231_HW_CS4231 0x0100 /* CS4231 chip */
#define CS4231_HW_CS4231A 0x0101 /* CS4231A chip */ #define CS4231_HW_CS4231A 0x0101 /* CS4231A chip */
#define CS4231_HW_AD1845 0x0102 /* AD1845 chip */
#define CS4231_HW_CS4232_MASK 0x0200 /* CS4232 serie (has control ports) */ #define CS4231_HW_CS4232_MASK 0x0200 /* CS4232 serie (has control ports) */
#define CS4231_HW_CS4232 0x0200 /* CS4232 */ #define CS4231_HW_CS4232 0x0200 /* CS4232 */
#define CS4231_HW_CS4232A 0x0201 /* CS4232A */ #define CS4231_HW_CS4232A 0x0201 /* CS4232A */
......
...@@ -288,7 +288,7 @@ struct snd_opl3 { ...@@ -288,7 +288,7 @@ struct snd_opl3 {
snd_midi_channel_set_t * chset; snd_midi_channel_set_t * chset;
#ifdef CONFIG_SND_SEQUENCER_OSS #ifdef CONFIG_SND_SEQUENCER_OSS
snd_seq_device_t *oss_seq_dev; /* OSS sequencer device, WIP */ snd_seq_device_t *oss_seq_dev; /* OSS sequencer device */
snd_midi_channel_set_t * oss_chset; snd_midi_channel_set_t * oss_chset;
#endif #endif
......
#ifndef SSCAPE_IOCTL_H
#define SSCAPE_IOCTL_H
struct sscape_bootblock
{
unsigned char code[256];
unsigned version;
};
struct sscape_microcode
{
unsigned char code[65536];
};
#define SND_SSCAPE_LOAD_BOOTB _IOWR('P', 100, struct sscape_bootblock)
#define SND_SSCAPE_LOAD_MCODE _IOW('P', 101, struct sscape_microcode)
#endif
/* include/version.h. Generated automatically by configure. */ /* include/version.h. Generated automatically by configure. */
#define CONFIG_SND_VERSION "0.9.0rc3" #define CONFIG_SND_VERSION "0.9.0rc3"
#define CONFIG_SND_DATE " (Tue Sep 17 13:46:32 2002 UTC)" #define CONFIG_SND_DATE " (Tue Oct 01 14:40:23 2002 UTC)"
...@@ -101,6 +101,9 @@ ifeq ($(CONFIG_SND_SB16_CSP),y) ...@@ -101,6 +101,9 @@ ifeq ($(CONFIG_SND_SB16_CSP),y)
obj-$(CONFIG_SND_SBAWE) += snd-hwdep.o obj-$(CONFIG_SND_SBAWE) += snd-hwdep.o
endif endif
obj-$(CONFIG_SND_USB_AUDIO) += snd-pcm.o snd-timer.o snd.o obj-$(CONFIG_SND_USB_AUDIO) += snd-pcm.o snd-timer.o snd.o
ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
obj-$(CONFIG_SND_USB_AUDIO) += snd-rawmidi.o
endif
obj-m := $(sort $(obj-m)) obj-m := $(sort $(obj-m))
......
...@@ -160,7 +160,7 @@ void snd_ctl_notify(snd_card_t *card, unsigned int mask, snd_ctl_elem_id_t *id) ...@@ -160,7 +160,7 @@ void snd_ctl_notify(snd_card_t *card, unsigned int mask, snd_ctl_elem_id_t *id)
goto _found; goto _found;
} }
} }
ev = snd_kcalloc(sizeof(*ev), in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); ev = snd_kcalloc(sizeof(*ev), GFP_ATOMIC);
if (ev) { if (ev) {
ev->id = *id; ev->id = *id;
ev->mask = mask; ev->mask = mask;
...@@ -486,12 +486,15 @@ static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_contr ...@@ -486,12 +486,15 @@ static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_contr
} }
read_unlock(&card->control_owner_lock); read_unlock(&card->control_owner_lock);
if (result > 0) { if (result > 0) {
result = 0; read_unlock(&card->control_rwlock);
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id); snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id);
result = 0;
goto __unlocked;
} }
} }
} }
read_unlock(&card->control_rwlock); read_unlock(&card->control_rwlock);
__unlocked:
if (result >= 0) if (result >= 0)
if (copy_to_user(_control, &control, sizeof(control))) if (copy_to_user(_control, &control, sizeof(control)))
return -EFAULT; return -EFAULT;
......
...@@ -338,12 +338,10 @@ static int snd_hwdep_dev_register(snd_device_t *device) ...@@ -338,12 +338,10 @@ static int snd_hwdep_dev_register(snd_device_t *device)
&snd_hwdep_reg, hwdep->oss_dev) < 0) { &snd_hwdep_reg, hwdep->oss_dev) < 0) {
snd_printk(KERN_ERR "unable to register OSS compatibility device %i:%i\n", snd_printk(KERN_ERR "unable to register OSS compatibility device %i:%i\n",
hwdep->card->number, hwdep->device); hwdep->card->number, hwdep->device);
} else { } else
snd_oss_info_register(SNDRV_OSS_INFO_DEV_SYNTH, hwdep->card->number, hwdep->name);
hwdep->ossreg = 1; hwdep->ossreg = 1;
} }
} }
}
#endif #endif
up(&register_mutex); up(&register_mutex);
return 0; return 0;
...@@ -362,10 +360,8 @@ static int snd_hwdep_dev_unregister(snd_device_t *device) ...@@ -362,10 +360,8 @@ static int snd_hwdep_dev_unregister(snd_device_t *device)
return -EINVAL; return -EINVAL;
} }
#ifdef CONFIG_SND_OSSEMUL #ifdef CONFIG_SND_OSSEMUL
if (hwdep->ossreg) { if (hwdep->ossreg)
snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device); snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device);
snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_SYNTH, hwdep->card->number);
}
#endif #endif
snd_unregister_device(SNDRV_DEVICE_TYPE_HWDEP, hwdep->card, hwdep->device); snd_unregister_device(SNDRV_DEVICE_TYPE_HWDEP, hwdep->card, hwdep->device);
snd_hwdep_devices[idx] = NULL; snd_hwdep_devices[idx] = NULL;
......
...@@ -179,7 +179,7 @@ snd_seq_oss_synth_unregister(snd_seq_device_t *dev) ...@@ -179,7 +179,7 @@ snd_seq_oss_synth_unregister(snd_seq_device_t *dev)
} }
spin_unlock_irqrestore(&register_lock, flags); spin_unlock_irqrestore(&register_lock, flags);
if (rec->seq_device < SNDRV_CARDS) if (rec->seq_device < SNDRV_CARDS)
snd_oss_info_register(SNDRV_OSS_INFO_DEV_SYNTH, rec->seq_device, NULL); snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_SYNTH, rec->seq_device);
snd_use_lock_sync(&rec->use_lock); snd_use_lock_sync(&rec->use_lock);
kfree(rec); kfree(rec);
......
...@@ -367,6 +367,9 @@ static void __exit alsa_sound_exit(void) ...@@ -367,6 +367,9 @@ static void __exit alsa_sound_exit(void)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
master = devfs_find_handle(NULL, controlname, strlen(controlname), 0, 0, DEVFS_SPECIAL_CHR, 0); master = devfs_find_handle(NULL, controlname, strlen(controlname), 0, 0, DEVFS_SPECIAL_CHR, 0);
devfs_unregister(master); devfs_unregister(master);
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
master = devfs_find_handle(NULL, controlname, 0, 0, DEVFS_SPECIAL_CHR, 0);
devfs_unregister(master);
#else #else
devfs_find_and_unregister(NULL, controlname, 0, 0, DEVFS_SPECIAL_CHR, 0); devfs_find_and_unregister(NULL, controlname, 0, 0, DEVFS_SPECIAL_CHR, 0);
#endif #endif
......
...@@ -67,6 +67,11 @@ void snd_wrapper_vfree(void *obj) ...@@ -67,6 +67,11 @@ void snd_wrapper_vfree(void *obj)
#include <linux/pci.h> #include <linux/pci.h>
/* to be sure... */
#ifdef HACK_PCI_ALLOC_CONSISTENT
#error pci_alloc_consistent hack is already defined!!
#endif
/* /*
* A dirty hack... when the kernel code is fixed this should be removed. * A dirty hack... when the kernel code is fixed this should be removed.
* *
...@@ -93,13 +98,19 @@ void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size, ...@@ -93,13 +98,19 @@ void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size,
rmask = ~((unsigned long)dma_mask); rmask = ~((unsigned long)dma_mask);
hwdev->dma_mask = 0xffffffff; /* do without masking */ hwdev->dma_mask = 0xffffffff; /* do without masking */
ret = pci_alloc_consistent(hwdev, size, dma_handle); ret = pci_alloc_consistent(hwdev, size, dma_handle);
if (ret && ((*dma_handle + size - 1) & rmask)) { hwdev->dma_mask = dma_mask; /* restore */
if (ret) {
/* obtained address is out of range? */
if (((unsigned long)*dma_handle + size - 1) & rmask) {
/* reallocate with the proper mask */
pci_free_consistent(hwdev, size, ret, *dma_handle); pci_free_consistent(hwdev, size, ret, *dma_handle);
ret = 0; ret = pci_alloc_consistent(hwdev, size, dma_handle);
} }
hwdev->dma_mask = dma_mask; /* restore */ } else {
if (! ret) /* wish to success now with the proper mask... */
if (dma_mask != 0xffffffff)
ret = pci_alloc_consistent(hwdev, size, dma_handle); ret = pci_alloc_consistent(hwdev, size, dma_handle);
}
return ret; return ret;
} }
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/init.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/ad1848.h> #include <sound/ad1848.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
......
...@@ -998,6 +998,11 @@ static int snd_cs4231_probe(cs4231_t *chip) ...@@ -998,6 +998,11 @@ static int snd_cs4231_probe(cs4231_t *chip)
rev = snd_cs4231_in(chip, CS4231_VERSION) & 0xe7; rev = snd_cs4231_in(chip, CS4231_VERSION) & 0xe7;
snd_printdd("CS4231: VERSION (I25) = 0x%x\n", rev); snd_printdd("CS4231: VERSION (I25) = 0x%x\n", rev);
if (rev == 0x80) { if (rev == 0x80) {
unsigned char tmp = snd_cs4231_in(chip, 23);
snd_cs4231_out(chip, 23, ~tmp);
if (snd_cs4231_in(chip, 23) != tmp)
chip->hardware = CS4231_HW_AD1845;
else
chip->hardware = CS4231_HW_CS4231; chip->hardware = CS4231_HW_CS4231;
} else if (rev == 0xa0) { } else if (rev == 0xa0) {
chip->hardware = CS4231_HW_CS4231A; chip->hardware = CS4231_HW_CS4231A;
...@@ -1382,6 +1387,7 @@ const char *snd_cs4231_chip_id(cs4231_t *chip) ...@@ -1382,6 +1387,7 @@ const char *snd_cs4231_chip_id(cs4231_t *chip)
case CS4231_HW_CS4239: return "CS4239"; case CS4231_HW_CS4239: return "CS4239";
case CS4231_HW_INTERWAVE: return "AMD InterWave"; case CS4231_HW_INTERWAVE: return "AMD InterWave";
case CS4231_HW_OPL3SA2: return chip->card->shortname; case CS4231_HW_OPL3SA2: return chip->card->shortname;
case CS4231_HW_AD1845: return "AD1845";
default: return "???"; default: return "???";
} }
} }
......
...@@ -11,7 +11,6 @@ snd-ens1371-objs := ens1371.o ...@@ -11,7 +11,6 @@ snd-ens1371-objs := ens1371.o
snd-es1938-objs := es1938.o snd-es1938-objs := es1938.o
snd-es1968-objs := es1968.o snd-es1968-objs := es1968.o
snd-fm801-objs := fm801.o snd-fm801-objs := fm801.o
snd-ice1712-objs := ice1712.o
snd-intel8x0-objs := intel8x0.o snd-intel8x0-objs := intel8x0.o
snd-maestro3-objs := maestro3.o snd-maestro3-objs := maestro3.o
snd-rme32-objs := rme32.o snd-rme32-objs := rme32.o
...@@ -28,7 +27,6 @@ obj-$(CONFIG_SND_ENS1371) += snd-ens1371.o ...@@ -28,7 +27,6 @@ obj-$(CONFIG_SND_ENS1371) += snd-ens1371.o
obj-$(CONFIG_SND_ES1938) += snd-es1938.o obj-$(CONFIG_SND_ES1938) += snd-es1938.o
obj-$(CONFIG_SND_ES1968) += snd-es1968.o obj-$(CONFIG_SND_ES1968) += snd-es1968.o
obj-$(CONFIG_SND_FM801) += snd-fm801.o obj-$(CONFIG_SND_FM801) += snd-fm801.o
obj-$(CONFIG_SND_ICE1712) += snd-ice1712.o
obj-$(CONFIG_SND_INTEL8X0) += snd-intel8x0.o obj-$(CONFIG_SND_INTEL8X0) += snd-intel8x0.o
obj-$(CONFIG_SND_MAESTRO3) += snd-maestro3.o obj-$(CONFIG_SND_MAESTRO3) += snd-maestro3.o
obj-$(CONFIG_SND_RME32) += snd-rme32.o obj-$(CONFIG_SND_RME32) += snd-rme32.o
...@@ -36,6 +34,6 @@ obj-$(CONFIG_SND_RME96) += snd-rme96.o ...@@ -36,6 +34,6 @@ obj-$(CONFIG_SND_RME96) += snd-rme96.o
obj-$(CONFIG_SND_SONICVIBES) += snd-sonicvibes.o obj-$(CONFIG_SND_SONICVIBES) += snd-sonicvibes.o
obj-$(CONFIG_SND_VIA82XX) += snd-via82xx.o obj-$(CONFIG_SND_VIA82XX) += snd-via82xx.o
obj-$(CONFIG_SND) += ac97/ ali5451/ cs46xx/ emu10k1/ korg1212/ nm256/ rme9652/ trident/ ymfpci/ obj-$(CONFIG_SND) += ac97/ ali5451/ cs46xx/ emu10k1/ korg1212/ nm256/ rme9652/ trident/ ymfpci/ ice1712/
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -119,7 +119,8 @@ static const ac97_codec_id_t snd_ac97_codec_ids[] = { ...@@ -119,7 +119,8 @@ static const ac97_codec_id_t snd_ac97_codec_ids[] = {
{ 0x43525948, 0xfffffff8, "CS4201", NULL }, { 0x43525948, 0xfffffff8, "CS4201", NULL },
{ 0x43525958, 0xfffffff8, "CS4205", patch_cirrus_spdif }, { 0x43525958, 0xfffffff8, "CS4205", patch_cirrus_spdif },
{ 0x43525960, 0xfffffff8, "CS4291", NULL }, { 0x43525960, 0xfffffff8, "CS4291", NULL },
{ 0x43585429, 0xffffffff, "Cx20468", patch_conexant }, { 0x43585421, 0xffffffff, "HSD11246", NULL }, // SmartMC II
{ 0x43585428, 0xfffffff8, "Cx20468", patch_conexant }, // SmartAMC fixme: the mask might be different
{ 0x454d4328, 0xffffffff, "28028", NULL }, // same as TR28028? { 0x454d4328, 0xffffffff, "28028", NULL }, // same as TR28028?
{ 0x45838308, 0xffffffff, "ESS1988", NULL }, { 0x45838308, 0xffffffff, "ESS1988", NULL },
{ 0x48525300, 0xffffff00, "HMP9701", NULL }, { 0x48525300, 0xffffff00, "HMP9701", NULL },
...@@ -1668,6 +1669,9 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in ...@@ -1668,6 +1669,9 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
id |= snd_ac97_read(ac97, AC97_VENDOR_ID2); id |= snd_ac97_read(ac97, AC97_VENDOR_ID2);
snd_ac97_get_name(NULL, id, name); snd_ac97_get_name(NULL, id, name);
snd_iprintf(buffer, "%d-%d/%d: %s\n\n", ac97->addr, ac97->num, subidx, name); snd_iprintf(buffer, "%d-%d/%d: %s\n\n", ac97->addr, ac97->num, subidx, name);
if ((ac97->scaps & AC97_SCAP_AUDIO) == 0)
goto __modem;
val = snd_ac97_read(ac97, AC97_RESET); val = snd_ac97_read(ac97, AC97_RESET);
snd_iprintf(buffer, "Capabilities :%s%s%s%s%s%s\n", snd_iprintf(buffer, "Capabilities :%s%s%s%s%s%s\n",
val & AC97_BC_DEDICATED_MIC ? " -dedicated MIC PCM IN channel-" : "", val & AC97_BC_DEDICATED_MIC ? " -dedicated MIC PCM IN channel-" : "",
...@@ -1788,7 +1792,7 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in ...@@ -1788,7 +1792,7 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
if (mext == 0) if (mext == 0)
return; return;
snd_iprintf(buffer, "Extended modem ID: codec=%i %s%s%s%s%s\n", snd_iprintf(buffer, "Extended modem ID: codec=%i%s%s%s%s%s\n",
(mext & AC97_MEI_ADDR_MASK) >> AC97_MEI_ADDR_SHIFT, (mext & AC97_MEI_ADDR_MASK) >> AC97_MEI_ADDR_SHIFT,
mext & AC97_MEI_CID2 ? " CID2" : "", mext & AC97_MEI_CID2 ? " CID2" : "",
mext & AC97_MEI_CID1 ? " CID1" : "", mext & AC97_MEI_CID1 ? " CID1" : "",
......
...@@ -205,9 +205,9 @@ MODULE_PARM_SYNTAX(snd_fm_port, SNDRV_ENABLED ",allows:{{-1},{0x388},{0x3c8},{0x ...@@ -205,9 +205,9 @@ MODULE_PARM_SYNTAX(snd_fm_port, SNDRV_ENABLED ",allows:{{-1},{0x388},{0x3c8},{0x
#define CM_SFILENB 0x00001000 #define CM_SFILENB 0x00001000
#define CM_MMODE_MASK 0x00000E00 #define CM_MMODE_MASK 0x00000E00
#define CM_SPDIF_SELECT2 0x00000100 /* for model > 039 ? */ #define CM_SPDIF_SELECT2 0x00000100 /* for model > 039 ? */
#define CM_ENCENTER 0x00000080 /* shared with FLINKON? */ #define CM_ENCENTER 0x00000080
#define CM_FLINKON 0x00000080 #define CM_FLINKON 0x00000040
#define CM_FLINKOFF 0x00000040 #define CM_FLINKOFF 0x00000020
#define CM_MIDSMP 0x00000010 #define CM_MIDSMP 0x00000010
#define CM_UPDDMA_MASK 0x0000000C #define CM_UPDDMA_MASK 0x0000000C
#define CM_TWAIT_MASK 0x00000003 #define CM_TWAIT_MASK 0x00000003
...@@ -625,7 +625,7 @@ static int snd_cmipci_pcm_prepare(cmipci_t *cm, cmipci_pcm_t *rec, ...@@ -625,7 +625,7 @@ static int snd_cmipci_pcm_prepare(cmipci_t *cm, cmipci_pcm_t *rec,
/* program sample counts */ /* program sample counts */
reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2; reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2;
snd_cmipci_write_w(cm, reg, rec->dma_size - 1); snd_cmipci_write_w(cm, reg, rec->dma_size - 1);
snd_cmipci_write_w(cm, reg + 2, rec->period_size - 1); snd_cmipci_write_w(cm, reg + 2, rec->period_size); /* FIXME: or period_size-1 ?? */
/* set adc/dac flag */ /* set adc/dac flag */
val = rec->ch ? CM_CHADC1 : CM_CHADC0; val = rec->ch ? CM_CHADC1 : CM_CHADC0;
...@@ -1088,7 +1088,7 @@ static void restore_mixer_state(cmipci_t *cm) ...@@ -1088,7 +1088,7 @@ static void restore_mixer_state(cmipci_t *cm)
} }
/* spinlock held! */ /* spinlock held! */
static void setup_ac3(cmipci_t *cm, int do_ac3, int rate) static void setup_ac3(cmipci_t *cm, snd_pcm_substream_t *subs, int do_ac3, int rate)
{ {
cm->channel[CM_CH_PLAY].ac3_shift = 0; cm->channel[CM_CH_PLAY].ac3_shift = 0;
cm->spdif_counter = 0; cm->spdif_counter = 0;
...@@ -1112,7 +1112,7 @@ static void setup_ac3(cmipci_t *cm, int do_ac3, int rate) ...@@ -1112,7 +1112,7 @@ static void setup_ac3(cmipci_t *cm, int do_ac3, int rate)
/* set 176K sample rate to fix 033 HW bug */ /* set 176K sample rate to fix 033 HW bug */
if (cm->chip_version == 33) { if (cm->chip_version == 33) {
if (rate >= 48000) { if (rate >= 48000) {
snd_cmipci_set_bit(cm, CM_REG_CHFORMAT, CM_PLAYBACK_176K); snd_cmipci_set_bit(cm, CM_REG_CHFORMAT, CM_PLAYBACK_SRATE_176K);
} else { } else {
snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_PLAYBACK_SRATE_176K); snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_PLAYBACK_SRATE_176K);
} }
...@@ -1153,7 +1153,7 @@ static void setup_spdif_playback(cmipci_t *cm, snd_pcm_substream_t *subs, int up ...@@ -1153,7 +1153,7 @@ static void setup_spdif_playback(cmipci_t *cm, snd_pcm_substream_t *subs, int up
/* snd_cmipci_set_bit(cm, CM_REG_FUNCTRL1, CM_SPDO2DAC); */ /* snd_cmipci_set_bit(cm, CM_REG_FUNCTRL1, CM_SPDO2DAC); */
if (cm->spdif_playback_enabled) if (cm->spdif_playback_enabled)
snd_cmipci_set_bit(cm, CM_REG_FUNCTRL1, CM_PLAYBACK_SPDF); snd_cmipci_set_bit(cm, CM_REG_FUNCTRL1, CM_PLAYBACK_SPDF);
setup_ac3(cm, do_ac3, rate); setup_ac3(cm, subs, do_ac3, rate);
if (rate == 48000) if (rate == 48000)
snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_SPDIF48K | CM_SPDF_AC97); snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_SPDIF48K | CM_SPDF_AC97);
...@@ -1165,7 +1165,7 @@ static void setup_spdif_playback(cmipci_t *cm, snd_pcm_substream_t *subs, int up ...@@ -1165,7 +1165,7 @@ static void setup_spdif_playback(cmipci_t *cm, snd_pcm_substream_t *subs, int up
/* snd_cmipci_clear_bit(cm, CM_REG_LEGACY_CTRL, CM_ENSPDOUT); */ /* snd_cmipci_clear_bit(cm, CM_REG_LEGACY_CTRL, CM_ENSPDOUT); */
/* snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_SPDO2DAC); */ /* snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_SPDO2DAC); */
snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_PLAYBACK_SPDF); snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_PLAYBACK_SPDF);
setup_ac3(cm, 0, 0); setup_ac3(cm, subs, 0, 0);
} }
spin_unlock_irqrestore(&cm->reg_lock, flags); spin_unlock_irqrestore(&cm->reg_lock, flags);
} }
...@@ -1286,7 +1286,7 @@ static void snd_cmipci_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1286,7 +1286,7 @@ static void snd_cmipci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static snd_pcm_hardware_t snd_cmipci_playback = static snd_pcm_hardware_t snd_cmipci_playback =
{ {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_MMAP_VALID), SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_5512 | SNDRV_PCM_RATE_8000_48000, .rates = SNDRV_PCM_RATE_5512 | SNDRV_PCM_RATE_8000_48000,
...@@ -1306,7 +1306,7 @@ static snd_pcm_hardware_t snd_cmipci_playback = ...@@ -1306,7 +1306,7 @@ static snd_pcm_hardware_t snd_cmipci_playback =
static snd_pcm_hardware_t snd_cmipci_capture = static snd_pcm_hardware_t snd_cmipci_capture =
{ {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_MMAP_VALID), SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_5512 | SNDRV_PCM_RATE_8000_48000, .rates = SNDRV_PCM_RATE_5512 | SNDRV_PCM_RATE_8000_48000,
...@@ -1326,7 +1326,7 @@ static snd_pcm_hardware_t snd_cmipci_capture = ...@@ -1326,7 +1326,7 @@ static snd_pcm_hardware_t snd_cmipci_capture =
static snd_pcm_hardware_t snd_cmipci_playback2 = static snd_pcm_hardware_t snd_cmipci_playback2 =
{ {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_MMAP_VALID), SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_S16_LE, .formats = SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_5512 | SNDRV_PCM_RATE_8000_48000, .rates = SNDRV_PCM_RATE_5512 | SNDRV_PCM_RATE_8000_48000,
...@@ -1346,7 +1346,7 @@ static snd_pcm_hardware_t snd_cmipci_playback2 = ...@@ -1346,7 +1346,7 @@ static snd_pcm_hardware_t snd_cmipci_playback2 =
static snd_pcm_hardware_t snd_cmipci_playback_spdif = static snd_pcm_hardware_t snd_cmipci_playback_spdif =
{ {
.info = (SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER), SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE),
.formats = SNDRV_PCM_FMTBIT_S16_LE /*| SNDRV_PCM_FMTBIT_S32_LE*/, .formats = SNDRV_PCM_FMTBIT_S16_LE /*| SNDRV_PCM_FMTBIT_S32_LE*/,
.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
.rate_min = 44100, .rate_min = 44100,
...@@ -1365,7 +1365,7 @@ static snd_pcm_hardware_t snd_cmipci_playback_spdif = ...@@ -1365,7 +1365,7 @@ static snd_pcm_hardware_t snd_cmipci_playback_spdif =
static snd_pcm_hardware_t snd_cmipci_capture_spdif = static snd_pcm_hardware_t snd_cmipci_capture_spdif =
{ {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_MMAP_VALID), SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_S16_LE, .formats = SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -325,6 +325,7 @@ static void ews88_setup_spdif(ice1712_t *ice, snd_pcm_substream_t * substream) ...@@ -325,6 +325,7 @@ static void ews88_setup_spdif(ice1712_t *ice, snd_pcm_substream_t * substream)
static int __devinit snd_ice1712_ews_init(ice1712_t *ice) static int __devinit snd_ice1712_ews_init(ice1712_t *ice)
{ {
int err; int err;
ak4524_t *ak;
/* set the analog DACs */ /* set the analog DACs */
switch (ice->eeprom.subvendor) { switch (ice->eeprom.subvendor) {
...@@ -400,7 +401,7 @@ static int __devinit snd_ice1712_ews_init(ice1712_t *ice) ...@@ -400,7 +401,7 @@ static int __devinit snd_ice1712_ews_init(ice1712_t *ice)
} }
/* analog section */ /* analog section */
ak4524_t *ak = &ice->ak4524; ak = &ice->ak4524;
switch (ice->eeprom.subvendor) { switch (ice->eeprom.subvendor) {
case ICE1712_SUBDEVICE_EWS88MT: case ICE1712_SUBDEVICE_EWS88MT:
ak->num_adcs = ak->num_dacs = 8; ak->num_adcs = ak->num_dacs = 8;
......
...@@ -1430,7 +1430,7 @@ static int __devinit snd_intel8x0_ali_ac97spdif(intel8x0_t *chip, int device, sn ...@@ -1430,7 +1430,7 @@ static int __devinit snd_intel8x0_ali_ac97spdif(intel8x0_t *chip, int device, sn
if (rpcm) if (rpcm)
*rpcm = NULL; *rpcm = NULL;
err = snd_pcm_new(chip->card, "ALI - AC97 IEC958", device, 0, 1, &pcm); err = snd_pcm_new(chip->card, "ALI - AC97 IEC958", device, 1, 0, &pcm);
if (err < 0) if (err < 0)
return err; return err;
...@@ -1550,6 +1550,16 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock) ...@@ -1550,6 +1550,16 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock)
ac97.read = snd_intel8x0_ali_codec_read; ac97.read = snd_intel8x0_ali_codec_read;
channels = 6; channels = 6;
codecs = 1; codecs = 1;
/* detect the secondary codec */
for (i = 0; i < 100; i++) {
unsigned int reg = igetdword(chip, ICHREG(ALI_RTSR));
if (reg & 0x40) {
codecs = 2;
break;
}
iputdword(chip, ICHREG(ALI_RTSR), reg | 0x40);
udelay(1);
}
} }
if ((err = snd_ac97_mixer(chip->card, &ac97, &x97)) < 0) if ((err = snd_ac97_mixer(chip->card, &ac97, &x97)) < 0)
return err; return err;
...@@ -1567,9 +1577,6 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock) ...@@ -1567,9 +1577,6 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock)
/* make sure, that we have DACs at right slot for rev2.2 */ /* make sure, that we have DACs at right slot for rev2.2 */
if (ac97_is_rev22(x97)) if (ac97_is_rev22(x97))
snd_ac97_update_bits(x97, AC97_EXTENDED_ID, AC97_EI_DACS_SLOT_MASK, 0); snd_ac97_update_bits(x97, AC97_EXTENDED_ID, AC97_EI_DACS_SLOT_MASK, 0);
/* can we have more AC'97 codecs with ALI chipset? */
if (chip->device_type == DEVICE_ALI)
goto __end;
/* AnalogDevices CNR boards uses special codec chaining */ /* AnalogDevices CNR boards uses special codec chaining */
/* skip standard test method for secondary codecs in this case */ /* skip standard test method for secondary codecs in this case */
if (x97->flags & AC97_AD_MULTI) { if (x97->flags & AC97_AD_MULTI) {
...@@ -1586,24 +1593,28 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock) ...@@ -1586,24 +1593,28 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock)
break; break;
} }
chip->ac97[i] = x97; chip->ac97[i] = x97;
if (chip->device_type == DEVICE_INTEL_ICH4 && chip->ichd[ICHD_PCM2IN].ac97 == NULL) switch (chip->device_type) {
case DEVICE_INTEL_ICH4:
if (chip->ichd[ICHD_PCM2IN].ac97 == NULL)
chip->ichd[ICHD_PCM2IN].ac97 = x97; chip->ichd[ICHD_PCM2IN].ac97 = x97;
if (x97->ext_id & AC97_EI_VRM) { if (x97->ext_id & AC97_EI_VRM) {
if (chip->ichd[ICHD_MIC].ac97 == NULL) if (chip->ichd[ICHD_MIC].ac97 == NULL)
chip->ichd[ICHD_MIC].ac97 = x97; chip->ichd[ICHD_MIC].ac97 = x97;
else if (chip->device_type == DEVICE_INTEL_ICH4 && else if (chip->ichd[ICHD_MIC2].ac97 == NULL &&
chip->ichd[ICHD_MIC2].ac97 == NULL &&
chip->ichd[ICHD_PCM2IN].ac97 == x97) chip->ichd[ICHD_PCM2IN].ac97 == x97)
chip->ichd[ICHD_MIC2].ac97 = x97; chip->ichd[ICHD_MIC2].ac97 = x97;
} }
if (x97->ext_id & AC97_EI_SPDIF) { if (x97->ext_id & AC97_EI_SPDIF) {
if (chip->device_type != DEVICE_ALI) {
if (chip->ichd[ICHD_SPBAR].ac97 == NULL) if (chip->ichd[ICHD_SPBAR].ac97 == NULL)
chip->ichd[ICHD_SPBAR].ac97 = x97; chip->ichd[ICHD_SPBAR].ac97 = x97;
} else {
if (chip->ichd[ALID_AC97SPDIFOUT].ac97 == NULL)
chip->ichd[ALID_AC97SPDIFOUT].ac97 = x97;
} }
break;
default:
if (x97->ext_id & AC97_EI_VRM) {
if (chip->ichd[ICHD_MIC].ac97 == NULL)
chip->ichd[ICHD_MIC].ac97 = x97;
}
break;
} }
} }
...@@ -1672,7 +1683,6 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock) ...@@ -1672,7 +1683,6 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock)
} }
} }
} }
__end:
chip->in_ac97_init = 0; chip->in_ac97_init = 0;
return 0; return 0;
} }
...@@ -2147,11 +2157,11 @@ static int __devinit snd_intel8x0_create(snd_card_t * card, ...@@ -2147,11 +2157,11 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
chip->pci = pci; chip->pci = pci;
chip->irq = -1; chip->irq = -1;
snd_intel8x0_proc_init(chip); snd_intel8x0_proc_init(chip);
if (chip->device_type == DEVICE_INTEL_ICH4 &&
(pci_resource_flags(pci, 2) & IORESOURCE_MEM)) { /* ICH4 and higher */
chip->mmio = chip->bm_mmio = 1;
chip->addr = pci_resource_start(pci, 2);
sprintf(chip->ac97_name, "%s - AC'97", card->shortname); sprintf(chip->ac97_name, "%s - AC'97", card->shortname);
sprintf(chip->ctrl_name, "%s - Controller", card->shortname);
if (pci_resource_flags(pci, 2) & IORESOURCE_MEM) { /* ICH4 and Nforce */
chip->mmio = 1;
chip->addr = pci_resource_start(pci, 2);
if ((chip->res = request_mem_region(chip->addr, 512, chip->ac97_name)) == NULL) { if ((chip->res = request_mem_region(chip->addr, 512, chip->ac97_name)) == NULL) {
snd_intel8x0_free(chip); snd_intel8x0_free(chip);
snd_printk("unable to grab I/O memory 0x%lx-0x%lx\n", chip->addr, chip->addr + 512 - 1); snd_printk("unable to grab I/O memory 0x%lx-0x%lx\n", chip->addr, chip->addr + 512 - 1);
...@@ -2163,7 +2173,16 @@ static int __devinit snd_intel8x0_create(snd_card_t * card, ...@@ -2163,7 +2173,16 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
snd_printk("AC'97 space ioremap problem\n"); snd_printk("AC'97 space ioremap problem\n");
return -EIO; return -EIO;
} }
sprintf(chip->ctrl_name, "%s - Controller", card->shortname); } else {
chip->addr = pci_resource_start(pci, 0);
if ((chip->res = request_region(chip->addr, 256, chip->ac97_name)) == NULL) {
snd_intel8x0_free(chip);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", chip->addr, chip->addr + 256 - 1);
return -EBUSY;
}
}
if (pci_resource_flags(pci, 3) & IORESOURCE_MEM) { /* ICH4 */
chip->bm_mmio = 1;
chip->bmaddr = pci_resource_start(pci, 3); chip->bmaddr = pci_resource_start(pci, 3);
if ((chip->res_bm = request_mem_region(chip->bmaddr, 256, chip->ctrl_name)) == NULL) { if ((chip->res_bm = request_mem_region(chip->bmaddr, 256, chip->ctrl_name)) == NULL) {
snd_intel8x0_free(chip); snd_intel8x0_free(chip);
...@@ -2177,14 +2196,6 @@ static int __devinit snd_intel8x0_create(snd_card_t * card, ...@@ -2177,14 +2196,6 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
return -EIO; return -EIO;
} }
} else { } else {
chip->addr = pci_resource_start(pci, 0);
sprintf(chip->ac97_name, "%s - AC'97", card->shortname);
if ((chip->res = request_region(chip->addr, 256, chip->ac97_name)) == NULL) {
snd_intel8x0_free(chip);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", chip->addr, chip->addr + 256 - 1);
return -EBUSY;
}
sprintf(chip->ctrl_name, "%s - Controller", card->shortname);
chip->bmaddr = pci_resource_start(pci, 1); chip->bmaddr = pci_resource_start(pci, 1);
if ((chip->res_bm = request_region(chip->bmaddr, 64, chip->ctrl_name)) == NULL) { if ((chip->res_bm = request_region(chip->bmaddr, 64, chip->ctrl_name)) == NULL) {
snd_intel8x0_free(chip); snd_intel8x0_free(chip);
......
...@@ -859,6 +859,10 @@ static int snd_rme32_capture_spdif_open(snd_pcm_substream_t * substream) ...@@ -859,6 +859,10 @@ static int snd_rme32_capture_spdif_open(snd_pcm_substream_t * substream)
spin_unlock_irqrestore(&rme32->lock, flags); spin_unlock_irqrestore(&rme32->lock, flags);
runtime->hw = snd_rme32_capture_spdif_info; runtime->hw = snd_rme32_capture_spdif_info;
if (RME32_PRO_WITH_8414(rme32)) {
runtime->hw.rates |= SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000;
runtime->hw.rate_max = 96000;
}
snd_pcm_hw_constraint_minmax(runtime, snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
......
...@@ -217,7 +217,7 @@ static int build_via_table(viadev_t *dev, snd_pcm_substream_t *substream, ...@@ -217,7 +217,7 @@ static int build_via_table(viadev_t *dev, snd_pcm_substream_t *substream,
return -ENOMEM; return -ENOMEM;
} }
if (! dev->idx_table) { if (! dev->idx_table) {
dev->idx_table = kmalloc(sizeof(unsigned int) * VIA_TABLE_SIZE, GFP_KERNEL); dev->idx_table = kmalloc(sizeof(*dev->idx_table) * VIA_TABLE_SIZE, GFP_KERNEL);
if (! dev->idx_table) if (! dev->idx_table)
return -ENOMEM; return -ENOMEM;
} }
...@@ -268,7 +268,7 @@ static void clean_via_table(viadev_t *dev, snd_pcm_substream_t *substream, ...@@ -268,7 +268,7 @@ static void clean_via_table(viadev_t *dev, snd_pcm_substream_t *substream,
struct pci_dev *pci) struct pci_dev *pci)
{ {
if (dev->table) { if (dev->table) {
snd_free_pci_pages(pci, PAGE_ALIGN(dev->tbl_entries * 8), dev->table, dev->table_addr); snd_free_pci_pages(pci, PAGE_ALIGN(VIA_TABLE_SIZE * 2 * 8), dev->table, dev->table_addr);
dev->table = NULL; dev->table = NULL;
} }
if (dev->idx_table) { if (dev->idx_table) {
......
...@@ -82,9 +82,18 @@ snd_pmac_awacs_write_noreg(pmac_t *chip, int reg, int val) ...@@ -82,9 +82,18 @@ snd_pmac_awacs_write_noreg(pmac_t *chip, int reg, int val)
snd_pmac_awacs_write(chip, val | (reg << 12)); snd_pmac_awacs_write(chip, val | (reg << 12));
} }
static void do_mdelay(int msec, int can_schedule)
{
if (can_schedule) {
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((msec * HZ + 999) / 1000);
} else
mdelay(msec);
}
#ifdef CONFIG_PMAC_PBOOK #ifdef CONFIG_PMAC_PBOOK
/* Recalibrate chip */ /* Recalibrate chip */
static void screamer_recalibrate(pmac_t *chip) static void screamer_recalibrate(pmac_t *chip, int can_schedule)
{ {
if (chip->model != PMAC_SCREAMER) if (chip->model != PMAC_SCREAMER)
return; return;
...@@ -92,15 +101,15 @@ static void screamer_recalibrate(pmac_t *chip) ...@@ -92,15 +101,15 @@ static void screamer_recalibrate(pmac_t *chip)
/* Sorry for the horrible delays... I hope to get that improved /* Sorry for the horrible delays... I hope to get that improved
* by making the whole PM process asynchronous in a future version * by making the whole PM process asynchronous in a future version
*/ */
mdelay(750); do_mdelay(750, can_schedule);
snd_pmac_awacs_write_noreg(chip, 1, snd_pmac_awacs_write_noreg(chip, 1,
chip->awacs_reg[1] | MASK_RECALIBRATE | MASK_CMUTE | MASK_AMUTE); chip->awacs_reg[1] | MASK_RECALIBRATE | MASK_CMUTE | MASK_AMUTE);
mdelay(1000); do_mdelay(1000, can_schedule);
snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]); snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]);
} }
#else #else
#define screamer_recalibrate(chip) /* NOP */ #define screamer_recalibrate(chip, can_schedule) /* NOP */
#endif #endif
...@@ -609,7 +618,7 @@ static int build_mixers(pmac_t *chip, int nums, snd_kcontrol_new_t *mixers) ...@@ -609,7 +618,7 @@ static int build_mixers(pmac_t *chip, int nums, snd_kcontrol_new_t *mixers)
/* /*
* restore all registers * restore all registers
*/ */
static void awacs_restore_all_regs(pmac_t *chip) static void awacs_restore_all_regs(pmac_t *chip, int can_schedule)
{ {
snd_pmac_awacs_write_noreg(chip, 0, chip->awacs_reg[0]); snd_pmac_awacs_write_noreg(chip, 0, chip->awacs_reg[0]);
snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]); snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]);
...@@ -617,7 +626,7 @@ static void awacs_restore_all_regs(pmac_t *chip) ...@@ -617,7 +626,7 @@ static void awacs_restore_all_regs(pmac_t *chip)
snd_pmac_awacs_write_noreg(chip, 4, chip->awacs_reg[4]); snd_pmac_awacs_write_noreg(chip, 4, chip->awacs_reg[4]);
if (chip->model == PMAC_SCREAMER) { if (chip->model == PMAC_SCREAMER) {
snd_pmac_awacs_write_noreg(chip, 5, chip->awacs_reg[5]); snd_pmac_awacs_write_noreg(chip, 5, chip->awacs_reg[5]);
mdelay(100); do_mdelay(100, can_schedule);
snd_pmac_awacs_write_noreg(chip, 6, chip->awacs_reg[6]); snd_pmac_awacs_write_noreg(chip, 6, chip->awacs_reg[6]);
mdelay(2); mdelay(2);
snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]); snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]);
...@@ -629,8 +638,8 @@ static void awacs_restore_all_regs(pmac_t *chip) ...@@ -629,8 +638,8 @@ static void awacs_restore_all_regs(pmac_t *chip)
#ifdef CONFIG_PMAC_PBOOK #ifdef CONFIG_PMAC_PBOOK
static void snd_pmac_awacs_resume(pmac_t *chip) static void snd_pmac_awacs_resume(pmac_t *chip)
{ {
awacs_restore_all_regs(chip); awacs_restore_all_regs(chip, 0);
screamer_recalibrate(chip); screamer_recalibrate(chip, 0);
#ifdef PMAC_AMP_AVAIL #ifdef PMAC_AMP_AVAIL
if (chip->mixer_data) { if (chip->mixer_data) {
awacs_amp_t *amp = chip->mixer_data; awacs_amp_t *amp = chip->mixer_data;
...@@ -738,8 +747,8 @@ snd_pmac_awacs_init(pmac_t *chip) ...@@ -738,8 +747,8 @@ snd_pmac_awacs_init(pmac_t *chip)
chip->awacs_reg[7] = 0; chip->awacs_reg[7] = 0;
} }
awacs_restore_all_regs(chip); awacs_restore_all_regs(chip, 1);
screamer_recalibrate(chip); screamer_recalibrate(chip, 1);
chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf; chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf;
#ifdef PMAC_AMP_AVAIL #ifdef PMAC_AMP_AVAIL
...@@ -849,6 +858,10 @@ snd_pmac_awacs_init(pmac_t *chip) ...@@ -849,6 +858,10 @@ snd_pmac_awacs_init(pmac_t *chip)
chip->update_automute = snd_pmac_awacs_update_automute; chip->update_automute = snd_pmac_awacs_update_automute;
snd_pmac_awacs_update_automute(chip, 0); /* update the status only */ snd_pmac_awacs_update_automute(chip, 0); /* update the status only */
#endif #endif
if (chip->model == PMAC_SCREAMER) {
snd_pmac_awacs_write_noreg(chip, 6, chip->awacs_reg[6]);
snd_pmac_awacs_write_noreg(chip, 0, chip->awacs_reg[0]);
}
return 0; return 0;
} }
...@@ -150,8 +150,8 @@ struct snd_usb_substream { ...@@ -150,8 +150,8 @@ struct snd_usb_substream {
unsigned int phase; /* phase accumulator */ unsigned int phase; /* phase accumulator */
unsigned int maxpacksize; /* max packet size in bytes */ unsigned int maxpacksize; /* max packet size in bytes */
unsigned int maxframesize; /* max packet size in frames */ unsigned int maxframesize; /* max packet size in frames */
unsigned int curpacksize; /* current packet size in bytes */ unsigned int curpacksize; /* current packet size in bytes (for capture) */
unsigned int curframesize; /* current packet size in frames */ unsigned int curframesize; /* current packet size in frames (for capture) */
unsigned int fill_max: 1; /* fill max packet size always */ unsigned int fill_max: 1; /* fill max packet size always */
unsigned int running: 1; /* running status */ unsigned int running: 1; /* running status */
...@@ -941,13 +941,18 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime) ...@@ -941,13 +941,18 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime)
alts = &iface->altsetting[fmt->altset_idx]; alts = &iface->altsetting[fmt->altset_idx];
snd_assert(alts->bAlternateSetting == fmt->altsetting, return -EINVAL); snd_assert(alts->bAlternateSetting == fmt->altsetting, return -EINVAL);
/* close the old interface */
if (subs->interface >= 0 && subs->interface != fmt->iface) {
usb_set_interface(subs->dev, subs->interface, 0);
subs->interface = -1;
}
/* create a data pipe */ /* create a data pipe */
ep = alts->endpoint[0].bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; ep = alts->endpoint[0].bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
if (is_playback) if (is_playback)
subs->datapipe = usb_sndisocpipe(dev, ep); subs->datapipe = usb_sndisocpipe(dev, ep);
else else
subs->datapipe = usb_rcvisocpipe(dev, ep); subs->datapipe = usb_rcvisocpipe(dev, ep);
subs->interface = fmt->iface;
subs->format = fmt->altset_idx; subs->format = fmt->altset_idx;
subs->syncpipe = subs->syncinterval = 0; subs->syncpipe = subs->syncinterval = 0;
subs->maxpacksize = alts->endpoint[0].wMaxPacketSize; subs->maxpacksize = alts->endpoint[0].wMaxPacketSize;
...@@ -963,14 +968,14 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime) ...@@ -963,14 +968,14 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime)
alts->endpoint[1].bmAttributes != 0x01 || alts->endpoint[1].bmAttributes != 0x01 ||
alts->endpoint[1].bSynchAddress != 0) { alts->endpoint[1].bSynchAddress != 0) {
snd_printk(KERN_ERR "%d:%d:%d : invalid synch pipe\n", snd_printk(KERN_ERR "%d:%d:%d : invalid synch pipe\n",
dev->devnum, subs->interface, fmt->altsetting); dev->devnum, fmt->iface, fmt->altsetting);
return -EINVAL; return -EINVAL;
} }
ep = alts->endpoint[1].bEndpointAddress; ep = alts->endpoint[1].bEndpointAddress;
if ((is_playback && ep != (alts->endpoint[0].bSynchAddress | USB_DIR_IN)) || if ((is_playback && ep != (alts->endpoint[0].bSynchAddress | USB_DIR_IN)) ||
(! is_playback && ep != (alts->endpoint[0].bSynchAddress & ~USB_DIR_IN))) { (! is_playback && ep != (alts->endpoint[0].bSynchAddress & ~USB_DIR_IN))) {
snd_printk(KERN_ERR "%d:%d:%d : invalid synch pipe\n", snd_printk(KERN_ERR "%d:%d:%d : invalid synch pipe\n",
dev->devnum, subs->interface, fmt->altsetting); dev->devnum, fmt->iface, fmt->altsetting);
return -EINVAL; return -EINVAL;
} }
ep &= USB_ENDPOINT_NUMBER_MASK; ep &= USB_ENDPOINT_NUMBER_MASK;
...@@ -982,13 +987,15 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime) ...@@ -982,13 +987,15 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime)
} }
/* set interface */ /* set interface */
if (usb_set_interface(dev, subs->interface, fmt->altset_idx) < 0) { if (usb_set_interface(dev, fmt->iface, fmt->altset_idx) < 0) {
snd_printk(KERN_ERR "%d:%d:%d: usb_set_interface failed\n", snd_printk(KERN_ERR "%d:%d:%d: usb_set_interface failed\n",
dev->devnum, subs->interface, fmt->altsetting); dev->devnum, fmt->iface, fmt->altsetting);
return -EIO; return -EIO;
} }
snd_printdd(KERN_INFO "setting usb interface %d:%d\n", fmt->iface, fmt->altset_idx);
subs->interface = fmt->iface;
ep = usb_pipeendpoint(subs->datapipe) | (subs->datapipe & USB_DIR_IN); ep = alts->endpoint[0].bEndpointAddress;
/* if endpoint has pitch control, enable it */ /* if endpoint has pitch control, enable it */
if (fmt->attributes & EP_CS_ATTR_PITCH_CONTROL) { if (fmt->attributes & EP_CS_ATTR_PITCH_CONTROL) {
data[0] = 1; data[0] = 1;
...@@ -1829,6 +1836,10 @@ static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif, ...@@ -1829,6 +1836,10 @@ static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif,
continue; continue;
} }
iface = &config->interface[j]; iface = &config->interface[j];
if (usb_interface_claimed(iface)) {
snd_printdd(KERN_INFO "%d:%d:%d: skipping, already claimed\n", dev->devnum, ctrlif, j);
continue;
}
if (iface->altsetting[0].bInterfaceClass == USB_CLASS_AUDIO && if (iface->altsetting[0].bInterfaceClass == USB_CLASS_AUDIO &&
iface->altsetting[0].bInterfaceSubClass == USB_SUBCLASS_MIDI_STREAMING) { iface->altsetting[0].bInterfaceSubClass == USB_SUBCLASS_MIDI_STREAMING) {
if (snd_usb_create_midi_interface(chip, j, NULL) < 0) { if (snd_usb_create_midi_interface(chip, j, NULL) < 0) {
...@@ -1845,6 +1856,7 @@ static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif, ...@@ -1845,6 +1856,7 @@ static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif,
continue; continue;
} }
parse_audio_endpoints(chip, buffer, buflen, j); parse_audio_endpoints(chip, buffer, buflen, j);
usb_set_interface(dev, j, 0); /* reset the current interface */
usb_driver_claim_interface(&usb_audio_driver, iface, (void *)-1); usb_driver_claim_interface(&usb_audio_driver, iface, (void *)-1);
} }
......
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