diff options
Diffstat (limited to 'sound')
138 files changed, 8346 insertions, 30859 deletions
diff --git a/sound/Kconfig b/sound/Kconfig index 9ea47382341..e48b9b37d22 100644 --- a/sound/Kconfig +++ b/sound/Kconfig @@ -65,6 +65,8 @@ source "sound/arm/Kconfig" source "sound/mips/Kconfig" +source "sound/sh/Kconfig" + # the following will depend on the order of config. # here assuming USB is defined before ALSA source "sound/usb/Kconfig" diff --git a/sound/Makefile b/sound/Makefile index b7c7fb7c24c..3ead922bd9c 100644 --- a/sound/Makefile +++ b/sound/Makefile @@ -5,7 +5,7 @@ obj-$(CONFIG_SOUND) += soundcore.o obj-$(CONFIG_SOUND_PRIME) += sound_firmware.o obj-$(CONFIG_SOUND_PRIME) += oss/ obj-$(CONFIG_DMASOUND) += oss/ -obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ synth/ usb/ sparc/ parisc/ pcmcia/ mips/ soc/ +obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ sh/ synth/ usb/ sparc/ parisc/ pcmcia/ mips/ soc/ obj-$(CONFIG_SND_AOA) += aoa/ # This one must be compilable even if sound is configured out diff --git a/sound/aoa/codecs/snd-aoa-codec-onyx.c b/sound/aoa/codecs/snd-aoa-codec-onyx.c index ded51671794..028852374f2 100644 --- a/sound/aoa/codecs/snd-aoa-codec-onyx.c +++ b/sound/aoa/codecs/snd-aoa-codec-onyx.c @@ -661,7 +661,7 @@ static struct transfer_info onyx_transfers[] = { .tag = 2, }, #ifdef SNDRV_PCM_FMTBIT_COMPRESSED_16BE -Once alsa gets supports for this kind of thing we can add it... + /* Once alsa gets supports for this kind of thing we can add it... */ { /* digital compressed output */ .formats = SNDRV_PCM_FMTBIT_COMPRESSED_16BE, @@ -713,7 +713,7 @@ static int onyx_prepare(struct codec_info_item *cii, if (substream->runtime->format == SNDRV_PCM_FMTBIT_COMPRESSED_16BE) { /* mute and lock analog output */ onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v); - if (onyx_write_register(onyx + if (onyx_write_register(onyx, ONYX_REG_DAC_CONTROL, v | ONYX_MUTE_RIGHT | ONYX_MUTE_LEFT)) goto out_unlock; diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index a96733a5beb..59b29cd482a 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1487,7 +1487,7 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream) snd_pcm_stream_lock_irq(substream); /* resume pause */ - if (runtime->status->state == SNDRV_PCM_STATE_PAUSED) + if (substream->runtime->status->state == SNDRV_PCM_STATE_PAUSED) snd_pcm_pause(substream, 0); /* pre-start/stop - all running streams are changed to DRAINING state */ diff --git a/sound/core/seq/seq_instr.c b/sound/core/seq/seq_instr.c index f30d171b6d9..5efe6523a58 100644 --- a/sound/core/seq/seq_instr.c +++ b/sound/core/seq/seq_instr.c @@ -109,7 +109,7 @@ void snd_seq_instr_list_free(struct snd_seq_kinstr_list **list_ptr) spin_lock_irqsave(&list->lock, flags); while (instr->use) { spin_unlock_irqrestore(&list->lock, flags); - schedule_timeout_interruptible(1); + schedule_timeout(1); spin_lock_irqsave(&list->lock, flags); } spin_unlock_irqrestore(&list->lock, flags); @@ -199,7 +199,7 @@ int snd_seq_instr_list_free_cond(struct snd_seq_kinstr_list *list, instr = flist; flist = instr->next; while (instr->use) - schedule_timeout_interruptible(1); + schedule_timeout(1); if (snd_seq_instr_free(instr, atomic)<0) snd_printk(KERN_WARNING "instrument free problem\n"); instr = next; @@ -555,7 +555,7 @@ static int instr_free(struct snd_seq_kinstr_ops *ops, SNDRV_SEQ_INSTR_NOTIFY_REMOVE); while (instr->use) { spin_unlock_irqrestore(&list->lock, flags); - schedule_timeout_interruptible(1); + schedule_timeout(1); spin_lock_irqsave(&list->lock, flags); } spin_unlock_irqrestore(&list->lock, flags); diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c index 061a7c61402..e11790f6deb 100644 --- a/sound/core/seq/seq_virmidi.c +++ b/sound/core/seq/seq_virmidi.c @@ -363,7 +363,7 @@ static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev) if (rdev->client >= 0) return 0; - pinfo = kmalloc(sizeof(*pinfo), GFP_KERNEL); + pinfo = kzalloc(sizeof(*pinfo), GFP_KERNEL); if (!pinfo) { err = -ENOMEM; goto __error; @@ -380,7 +380,6 @@ static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev) rdev->client = client; /* create a port */ - memset(pinfo, 0, sizeof(*pinfo)); pinfo->addr.client = client; sprintf(pinfo->name, "VirMIDI %d-%d", rdev->card->number, rdev->device); /* set all capabilities */ diff --git a/sound/core/sound.c b/sound/core/sound.c index 70600df94d6..8dc7a3b32b9 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c @@ -446,8 +446,7 @@ static void __exit alsa_sound_exit(void) { snd_info_minor_unregister(); snd_info_done(); - if (unregister_chrdev(major, "alsa") != 0) - snd_printk(KERN_ERR "unable to unregister major device number %d\n", major); + unregister_chrdev(major, "alsa"); } module_init(alsa_sound_init) diff --git a/sound/core/timer.c b/sound/core/timer.c index 67520b3c004..f2bbacedd56 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -1549,9 +1549,11 @@ static int snd_timer_user_info(struct file *file, int err = 0; tu = file->private_data; - snd_assert(tu->timeri != NULL, return -ENXIO); + if (!tu->timeri) + return -EBADFD; t = tu->timeri->timer; - snd_assert(t != NULL, return -ENXIO); + if (!t) + return -EBADFD; info = kzalloc(sizeof(*info), GFP_KERNEL); if (! info) @@ -1579,9 +1581,11 @@ static int snd_timer_user_params(struct file *file, int err; tu = file->private_data; - snd_assert(tu->timeri != NULL, return -ENXIO); + if (!tu->timeri) + return -EBADFD; t = tu->timeri->timer; - snd_assert(t != NULL, return -ENXIO); + if (!t) + return -EBADFD; if (copy_from_user(¶ms, _params, sizeof(params))) return -EFAULT; if (!(t->hw.flags & SNDRV_TIMER_HW_SLAVE) && params.ticks < 1) { @@ -1675,7 +1679,8 @@ static int snd_timer_user_status(struct file *file, struct snd_timer_status status; tu = file->private_data; - snd_assert(tu->timeri != NULL, return -ENXIO); + if (!tu->timeri) + return -EBADFD; memset(&status, 0, sizeof(status)); status.tstamp = tu->tstamp; status.resolution = snd_timer_resolution(tu->timeri); @@ -1695,7 +1700,8 @@ static int snd_timer_user_start(struct file *file) struct snd_timer_user *tu; tu = file->private_data; - snd_assert(tu->timeri != NULL, return -ENXIO); + if (!tu->timeri) + return -EBADFD; snd_timer_stop(tu->timeri); tu->timeri->lost = 0; tu->last_resolution = 0; @@ -1708,7 +1714,8 @@ static int snd_timer_user_stop(struct file *file) struct snd_timer_user *tu; tu = file->private_data; - snd_assert(tu->timeri != NULL, return -ENXIO); + if (!tu->timeri) + return -EBADFD; return (err = snd_timer_stop(tu->timeri)) < 0 ? err : 0; } @@ -1718,7 +1725,8 @@ static int snd_timer_user_continue(struct file *file) struct snd_timer_user *tu; tu = file->private_data; - snd_assert(tu->timeri != NULL, return -ENXIO); + if (!tu->timeri) + return -EBADFD; tu->timeri->lost = 0; return (err = snd_timer_continue(tu->timeri)) < 0 ? err : 0; } @@ -1729,7 +1737,8 @@ static int snd_timer_user_pause(struct file *file) struct snd_timer_user *tu; tu = file->private_data; - snd_assert(tu->timeri != NULL, return -ENXIO); + if (!tu->timeri) + return -EBADFD; return (err = snd_timer_pause(tu->timeri)) < 0 ? err : 0; } diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index a0f28f51fc7..4360ae9de19 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -659,7 +659,7 @@ static struct platform_driver snd_dummy_driver = { }, }; -static void __init_or_module snd_dummy_unregister_all(void) +static void snd_dummy_unregister_all(void) { int i; diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index 1d563e515c1..67c6e974541 100644 --- a/sound/drivers/mpu401/mpu401.c +++ b/sound/drivers/mpu401/mpu401.c @@ -228,7 +228,7 @@ static struct pnp_driver snd_mpu401_pnp_driver = { static struct pnp_driver snd_mpu401_pnp_driver; #endif -static void __init_or_module snd_mpu401_unregister_all(void) +static void snd_mpu401_unregister_all(void) { int i; diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c index 497cafb57d9..0eb9b5cebfc 100644 --- a/sound/drivers/portman2x4.c +++ b/sound/drivers/portman2x4.c @@ -833,7 +833,7 @@ static struct platform_driver snd_portman_driver = { /********************************************************************* * module init stuff *********************************************************************/ -static void __init_or_module snd_portman_unregister_all(void) +static void snd_portman_unregister_all(void) { int i; diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 838a4277929..d3e6a20edd3 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c @@ -998,7 +998,7 @@ static struct platform_driver snd_serial_driver = { }, }; -static void __init_or_module snd_serial_unregister_all(void) +static void snd_serial_unregister_all(void) { int i; diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c index 46f3d348606..915c86773c2 100644 --- a/sound/drivers/virmidi.c +++ b/sound/drivers/virmidi.c @@ -145,7 +145,7 @@ static struct platform_driver snd_virmidi_driver = { }, }; -static void __init_or_module snd_virmidi_unregister_all(void) +static void snd_virmidi_unregister_all(void) { int i; diff --git a/sound/i2c/other/ak4xxx-adda.c b/sound/i2c/other/ak4xxx-adda.c index 8805110017a..fd335159f84 100644 --- a/sound/i2c/other/ak4xxx-adda.c +++ b/sound/i2c/other/ak4xxx-adda.c @@ -481,8 +481,8 @@ static int ak4xxx_switch_get(struct snd_kcontrol *kcontrol, int addr = AK_GET_ADDR(kcontrol->private_value); int shift = AK_GET_SHIFT(kcontrol->private_value); int invert = AK_GET_INVERT(kcontrol->private_value); - unsigned char val = snd_akm4xxx_get(ak, chip, addr); - + /* we observe the (1<<shift) bit only */ + unsigned char val = snd_akm4xxx_get(ak, chip, addr) & (1<<shift); if (invert) val = ! val; ucontrol->value.integer.value[0] = (val & (1<<shift)) != 0; @@ -585,6 +585,26 @@ static int build_dac_controls(struct snd_akm4xxx *ak) mixer_ch = 0; for (idx = 0; idx < ak->num_dacs; ) { + /* mute control for Revolution 7.1 - AK4381 */ + if (ak->type == SND_AK4381 + && ak->dac_info[mixer_ch].switch_name) { + memset(&knew, 0, sizeof(knew)); + knew.iface = SNDRV_CTL_ELEM_IFACE_MIXER; + knew.count = 1; + knew.access = SNDRV_CTL_ELEM_ACCESS_READWRITE; + knew.name = ak->dac_info[mixer_ch].switch_name; + knew.info = ak4xxx_switch_info; + knew.get = ak4xxx_switch_get; + knew.put = ak4xxx_switch_put; + knew.access = 0; + /* register 1, bit 0 (SMUTE): 0 = normal operation, + 1 = mute */ + knew.private_value = + AK_COMPOSE(idx/2, 1, 0, 0) | AK_INVERT; + err = snd_ctl_add(ak->card, snd_ctl_new1(&knew, ak)); + if (err < 0) + return err; + } memset(&knew, 0, sizeof(knew)); if (! ak->dac_info || ! ak->dac_info[mixer_ch].name) { knew.name = "DAC Volume"; diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig index cf3803cd579..ea5084abe60 100644 --- a/sound/isa/Kconfig +++ b/sound/isa/Kconfig @@ -1,8 +1,5 @@ # ALSA ISA drivers -menu "ISA devices" - depends on SND!=n && ISA && ISA_DMA_API - config SND_AD1848_LIB tristate select SND_PCM @@ -11,6 +8,22 @@ config SND_CS4231_LIB tristate select SND_PCM +config SND_SB_COMMON + tristate + +config SND_SB8_DSP + tristate + select SND_PCM + select SND_SB_COMMON + +config SND_SB16_DSP + tristate + select SND_PCM + select SND_SB_COMMON + +menu "ISA devices" + depends on SND!=n && ISA && ISA_DMA_API + config SND_ADLIB tristate "AdLib FM card" depends on SND @@ -55,7 +68,7 @@ config SND_ALS100 select ISAPNP select SND_OPL3_LIB select SND_MPU401_UART - select SND_PCM + select SND_SB16_DSP help Say Y here to include support for soundcards based on Avance Logic ALS100, ALS110, ALS120 and ALS200 chips. @@ -81,6 +94,7 @@ config SND_CMI8330 tristate "C-Media CMI8330" depends on SND select SND_AD1848_LIB + select SND_SB16_DSP help Say Y here to include support for soundcards based on the C-Media CMI8330 chip. @@ -132,7 +146,7 @@ config SND_DT019X select ISAPNP select SND_OPL3_LIB select SND_MPU401_UART - select SND_PCM + select SND_SB16_DSP help Say Y here to include support for soundcards based on the Diamond Technologies DT-019X or Avance Logic ALS-007 chips. @@ -145,7 +159,7 @@ config SND_ES968 depends on SND && PNP && ISA select ISAPNP select SND_MPU401_UART - select SND_PCM + select SND_SB8_DSP help Say Y here to include support for ESS AudioDrive ES968 chips. @@ -321,7 +335,7 @@ config SND_SB8 depends on SND select SND_OPL3_LIB select SND_RAWMIDI - select SND_PCM + select SND_SB8_DSP help Say Y here to include support for Creative Sound Blaster 1.0/ 2.0/Pro (8-bit) or 100% compatible soundcards. @@ -334,7 +348,7 @@ config SND_SB16 depends on SND select SND_OPL3_LIB select SND_MPU401_UART - select SND_PCM + select SND_SB16_DSP help Say Y here to include support for Sound Blaster 16 soundcards (including the Plug and Play version). @@ -347,7 +361,7 @@ config SND_SBAWE depends on SND select SND_OPL3_LIB select SND_MPU401_UART - select SND_PCM + select SND_SB16_DSP help Say Y here to include support for Sound Blaster AWE soundcards (including the Plug and Play version). diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c index 8094282c2ae..1bc2e3fd572 100644 --- a/sound/isa/ad1848/ad1848_lib.c +++ b/sound/isa/ad1848/ad1848_lib.c @@ -245,7 +245,7 @@ static void snd_ad1848_mce_down(struct snd_ad1848 *chip) snd_printk(KERN_ERR "mce_down - auto calibration time out (2)\n"); return; } - time = schedule_timeout_interruptible(time); + time = schedule_timeout(time); spin_lock_irqsave(&chip->reg_lock, flags); } #if 0 @@ -258,7 +258,7 @@ static void snd_ad1848_mce_down(struct snd_ad1848 *chip) snd_printk(KERN_ERR "mce_down - auto calibration time out (3)\n"); return; } - time = schedule_timeout_interruptible(time); + time = schedule_timeout(time); spin_lock_irqsave(&chip->reg_lock, flags); } spin_unlock_irqrestore(&chip->reg_lock, flags); diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 4f6800b43b0..e70db32991d 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c @@ -164,6 +164,8 @@ static struct pnp_card_device_id snd_opl3sa2_pnpids[] = { { .id = "YMH0801", .devs = { { "YMH0021" } } }, /* NeoMagic MagicWave 3DX */ { .id = "NMX2200", .devs = { { "YMH2210" } } }, + /* NeoMagic MagicWave 3D */ + { .id = "NMX2200", .devs = { { "NMX2210" } } }, /* --- */ { .id = "" } /* end */ }; diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index 60c120ffb9d..049d479ce2b 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c @@ -1927,10 +1927,12 @@ static struct snd_card *snd_opti9xx_card_new(void) static int __devinit snd_opti9xx_isa_match(struct device *devptr, unsigned int dev) { +#ifdef CONFIG_PNP if (snd_opti9xx_pnp_is_probed) return 0; if (isapnp) return 0; +#endif return 1; } @@ -2096,6 +2098,7 @@ static int __init alsa_card_opti9xx_init(void) pnp_register_card_driver(&opti9xx_pnpc_driver); if (snd_opti9xx_pnp_is_probed) return 0; + pnp_unregister_card_driver(&opti9xx_pnpc_driver); #endif return isa_register_driver(&snd_opti9xx_driver, 1); } diff --git a/sound/isa/sb/Makefile b/sound/isa/sb/Makefile index fd9d9c5726f..556e6692802 100644 --- a/sound/isa/sb/Makefile +++ b/sound/isa/sb/Makefile @@ -22,14 +22,13 @@ snd-es968-objs := es968.o sequencer = $(if $(subst y,,$(CONFIG_SND_SEQUENCER)),$(if $(1),m),$(if $(CONFIG_SND_SEQUENCER),$(1))) # Toplevel Module Dependency -obj-$(CONFIG_SND_ALS100) += snd-sb16-dsp.o snd-sb-common.o -obj-$(CONFIG_SND_CMI8330) += snd-sb16-dsp.o snd-sb-common.o -obj-$(CONFIG_SND_DT019X) += snd-sb16-dsp.o snd-sb-common.o -obj-$(CONFIG_SND_SB8) += snd-sb8.o snd-sb8-dsp.o snd-sb-common.o -obj-$(CONFIG_SND_SB16) += snd-sb16.o snd-sb16-dsp.o snd-sb-common.o -obj-$(CONFIG_SND_SBAWE) += snd-sbawe.o snd-sb16-dsp.o snd-sb-common.o -obj-$(CONFIG_SND_ES968) += snd-es968.o snd-sb8-dsp.o snd-sb-common.o -obj-$(CONFIG_SND_ALS4000) += snd-sb-common.o +obj-$(CONFIG_SND_SB_COMMON) += snd-sb-common.o +obj-$(CONFIG_SND_SB16_DSP) += snd-sb16-dsp.o +obj-$(CONFIG_SND_SB8_DSP) += snd-sb8-dsp.o +obj-$(CONFIG_SND_SB8) += snd-sb8.o +obj-$(CONFIG_SND_SB16) += snd-sb16.o +obj-$(CONFIG_SND_SBAWE) += snd-sbawe.o +obj-$(CONFIG_SND_ES968) += snd-es968.o ifeq ($(CONFIG_SND_SB16_CSP),y) obj-$(CONFIG_SND_SB16) += snd-sb16-csp.o obj-$(CONFIG_SND_SBAWE) += snd-sb16-csp.o diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c index 383911b9e74..5d4d3aafe2d 100644 --- a/sound/isa/sb/sb16_main.c +++ b/sound/isa/sb/sb16_main.c @@ -563,6 +563,11 @@ static int snd_sb16_playback_open(struct snd_pcm_substream *substream) __open_ok: if (chip->hardware == SB_HW_ALS100) runtime->hw.rate_max = 48000; + if (chip->hardware == SB_HW_CS5530) { + runtime->hw.buffer_bytes_max = 32 * 1024; + runtime->hw.periods_min = 2; + runtime->hw.rate_min = 44100; + } if (chip->mode & SB_RATE_LOCK) runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; chip->playback_substream = substream; @@ -633,6 +638,11 @@ static int snd_sb16_capture_open(struct snd_pcm_substream *substream) __open_ok: if (chip->hardware == SB_HW_ALS100) runtime->hw.rate_max = 48000; + if (chip->hardware == SB_HW_CS5530) { + runtime->hw.buffer_bytes_max = 32 * 1024; + runtime->hw.periods_min = 2; + runtime->hw.rate_min = 44100; + } if (chip->mode & SB_RATE_LOCK) runtime->hw.rate_min = runtime->hw.rate_max = chip->locked_rate; chip->capture_substream = substream; diff --git a/sound/isa/sb/sb_common.c b/sound/isa/sb/sb_common.c index 3094f385216..efa9d5c2558 100644 --- a/sound/isa/sb/sb_common.c +++ b/sound/isa/sb/sb_common.c @@ -128,7 +128,7 @@ static int snd_sbdsp_probe(struct snd_sb * chip) minor = version & 0xff; snd_printdd("SB [0x%lx]: DSP chip found, version = %i.%i\n", chip->port, major, minor); - + switch (chip->hardware) { case SB_HW_AUTO: switch (major) { @@ -168,6 +168,9 @@ static int snd_sbdsp_probe(struct snd_sb * chip) case SB_HW_DT019X: str = "(DT019X/ALS007)"; break; + case SB_HW_CS5530: + str = "16 (CS5530)"; + break; default: return -ENODEV; } diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c index 490b1ca5cf5..3d4befcff28 100644 --- a/sound/isa/sb/sb_mixer.c +++ b/sound/isa/sb/sb_mixer.c @@ -821,6 +821,7 @@ int snd_sbmixer_new(struct snd_sb *chip) break; case SB_HW_16: case SB_HW_ALS100: + case SB_HW_CS5530: if ((err = snd_sbmixer_init(chip, snd_sb16_controls, ARRAY_SIZE(snd_sb16_controls), @@ -950,6 +951,7 @@ void snd_sbmixer_suspend(struct snd_sb *chip) break; case SB_HW_16: case SB_HW_ALS100: + case SB_HW_CS5530: save_mixer(chip, sb16_saved_regs, ARRAY_SIZE(sb16_saved_regs)); break; case SB_HW_ALS4000: @@ -975,6 +977,7 @@ void snd_sbmixer_resume(struct snd_sb *chip) break; case SB_HW_16: case SB_HW_ALS100: + case SB_HW_CS5530: restore_mixer(chip, sb16_saved_regs, ARRAY_SIZE(sb16_saved_regs)); break; case SB_HW_ALS4000: diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c index 9ea417bcf3e..cbad2a51cba 100644 --- a/sound/isa/sscape.c +++ b/sound/isa/sscape.c @@ -382,7 +382,7 @@ static int obp_startup_ack(struct soundscape *s, unsigned timeout) unsigned long flags; unsigned char x; - schedule_timeout_interruptible(1); + schedule_timeout(1); spin_lock_irqsave(&s->lock, flags); x = inb(HOST_DATA_IO(s->io_base)); @@ -409,7 +409,7 @@ static int host_startup_ack(struct soundscape *s, unsigned timeout) unsigned long flags; unsigned char x; - schedule_timeout_interruptible(1); + schedule_timeout(1); spin_lock_irqsave(&s->lock, flags); x = inb(HOST_DATA_IO(s->io_base)); diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c index 78020d832e0..bacc51c8658 100644 --- a/sound/isa/wavefront/wavefront_synth.c +++ b/sound/isa/wavefront/wavefront_synth.c @@ -1780,7 +1780,7 @@ wavefront_should_cause_interrupt (snd_wavefront_t *dev, outb (val,port); spin_unlock_irq(&dev->irq_lock); while (1) { - if ((timeout = schedule_timeout_interruptible(timeout)) == 0) + if ((timeout = schedule_timeout(timeout)) == 0) return; if (dev->irq_ok) return; diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig index 4b30ae6d8ba..866d4de8d4a 100644 --- a/sound/oss/Kconfig +++ b/sound/oss/Kconfig @@ -5,35 +5,6 @@ # # Prompt user for primary drivers. -config OSS_OBSOLETE - bool "Obsolete OSS drivers" - depends on SOUND_PRIME - help - This option enables support for obsolete OSS drivers that - are scheduled for removal in the near future. - - Please contact Adrian Bunk <bunk@stusta.de> if you had to - say Y here because your hardware is not properly supported - by ALSA. - - If unsure, say N. - -config SOUND_BT878 - tristate "BT878 audio dma" - depends on SOUND_PRIME && PCI && OSS_OBSOLETE - ---help--- - Audio DMA support for bt878 based grabber boards. As you might have - already noticed, bt878 is listed with two functions in /proc/pci. - Function 0 does the video stuff (bt848 compatible), function 1 does - the same for audio data. This is a driver for the audio part of - the chip. If you say 'Y' here you get a oss-compatible dsp device - where you can record from. If you want just watch TV you probably - don't need this driver as most TV cards handle sound with a short - cable from the TV card to your sound card's line-in. - - To compile this driver as a module, choose M here: the module will - be called btaudio. - config SOUND_BCM_CS4297A tristate "Crystal Sound CS4297a (for Swarm)" depends on SOUND_PRIME && SIBYTE_SWARM @@ -44,13 +15,6 @@ config SOUND_BCM_CS4297A note that CONFIG_KGDB should not be enabled at the same time, since it also attempts to use this UART port. -config SOUND_ICH - tristate "Intel ICH (i8xx) audio support" - depends on SOUND_PRIME && PCI && OSS_OBSOLETE - help - Support for integral audio in Intel's I/O Controller Hub (ICH) - chipset, as used on the 810/820/840 motherboards. - config SOUND_VWSND tristate "SGI Visual Workstation Sound" depends on SOUND_PRIME && X86_VISWS @@ -346,29 +310,9 @@ config MSND_FIFOSIZE and Pinnacle). Larger values reduce the chance of data overruns at the expense of overall latency. If unsure, use the default. -config SOUND_VIA82CXXX - tristate "VIA 82C686 Audio Codec" - depends on SOUND_PRIME && PCI && OSS_OBSOLETE - help - Say Y here to include support for the audio codec found on VIA - 82Cxxx-based chips. Typically these are built into a motherboard. - - DO NOT select Sound Blaster or Adlib with this driver, unless - you have a Sound Blaster or Adlib card in addition to your VIA - audio chip. - -config MIDI_VIA82CXXX - bool "VIA 82C686 MIDI" - depends on SOUND_VIA82CXXX && ISA_DMA_API - help - Answer Y to use the MIDI interface of the Via686. You may need to - enable this in the BIOS before it will work. This is for connection - to external MIDI hardware, and is not required for software playback - of MIDI files. - config SOUND_OSS tristate "OSS sound modules" - depends on SOUND_PRIME && ISA_DMA_API + depends on SOUND_PRIME && ISA_DMA_API && VIRT_TO_BUS help OSS is the Open Sound System suite of sound card drivers. They make sound programming easier since they provide a common API. Say Y or @@ -400,23 +344,10 @@ config SOUND_DMAP Say Y unless you have 16MB or more RAM or a PCI sound card. -config SOUND_CS4232 - tristate "Crystal CS4232 based (PnP) cards" - depends on SOUND_OSS && OSS_OBSOLETE - help - Say Y here if you have a card based on the Crystal CS4232 chip set, - which uses its own Plug and Play protocol. - - If you compile the driver into the kernel, you have to add - "cs4232=<io>,<irq>,<dma>,<dma2>,<mpuio>,<mpuirq>" to the kernel - command line. - - See <file:Documentation/sound/oss/CS4232> for more information on - configuring this card. - config SOUND_SSCAPE tristate "Ensoniq SoundScape support" depends on SOUND_OSS + depends on VIRT_TO_BUS help Answer Y if you have a sound card based on the Ensoniq SoundScape chipset. Such cards are being manufactured at least by Ensoniq, Spea @@ -719,13 +650,6 @@ config SOUND_WAVEARTIST Say Y here to include support for the Rockwell WaveArtist sound system. This driver is mainly for the NetWinder. -config SOUND_TVMIXER - tristate "TV card (bt848) mixer support" - depends on SOUND_PRIME && I2C && VIDEO_V4L1 && OSS_OBSOLETE - help - Support for audio mixer facilities on the BT848 TV frame-grabber - card. - config SOUND_KAHLUA tristate "XpressAudio Sound Blaster emulation" depends on SOUND_SB diff --git a/sound/oss/Makefile b/sound/oss/Makefile index 2489bd6bb08..7a2f9ae7b7c 100644 --- a/sound/oss/Makefile +++ b/sound/oss/Makefile @@ -18,20 +18,15 @@ obj-$(CONFIG_SOUND_TRIX) += trix.o ad1848.o sb_lib.o uart401.o obj-$(CONFIG_SOUND_SSCAPE) += sscape.o ad1848.o mpu401.o obj-$(CONFIG_SOUND_CS4232) += cs4232.o uart401.o obj-$(CONFIG_SOUND_MSS) += ad1848.o -obj-$(CONFIG_SOUND_OPL3SA2) += opl3sa2.o ad1848.o mpu401.o obj-$(CONFIG_SOUND_PAS) += pas2.o sb.o sb_lib.o uart401.o obj-$(CONFIG_SOUND_SB) += sb.o sb_lib.o uart401.o obj-$(CONFIG_SOUND_KAHLUA) += kahlua.o obj-$(CONFIG_SOUND_MPU401) += mpu401.o obj-$(CONFIG_SOUND_UART6850) += uart6850.o -obj-$(CONFIG_SOUND_ADLIB) += adlib_card.o opl3.o obj-$(CONFIG_SOUND_YM3812) += opl3.o obj-$(CONFIG_SOUND_VMIDI) += v_midi.o obj-$(CONFIG_SOUND_VIDC) += vidc_mod.o obj-$(CONFIG_SOUND_WAVEARTIST) += waveartist.o -obj-$(CONFIG_SOUND_AD1816) += ad1816.o -obj-$(CONFIG_SOUND_AD1889) += ad1889.o ac97_codec.o -obj-$(CONFIG_SOUND_ACI_MIXER) += aci.o obj-$(CONFIG_SOUND_VIA82CXXX) += via82cxxx_audio.o ac97_codec.o ifeq ($(CONFIG_MIDI_VIA82CXXX),y) @@ -40,24 +35,16 @@ endif obj-$(CONFIG_SOUND_MSNDCLAS) += msnd.o msnd_classic.o obj-$(CONFIG_SOUND_MSNDPIN) += msnd.o msnd_pinnacle.o obj-$(CONFIG_SOUND_VWSND) += vwsnd.o -obj-$(CONFIG_SOUND_NM256) += nm256_audio.o ac97.o obj-$(CONFIG_SOUND_ICH) += i810_audio.o ac97_codec.o obj-$(CONFIG_SOUND_ES1371) += es1371.o ac97_codec.o obj-$(CONFIG_SOUND_VRC5477) += nec_vrc5477.o ac97_codec.o obj-$(CONFIG_SOUND_AU1550_AC97) += au1550_ac97.o ac97_codec.o -obj-$(CONFIG_SOUND_FUSION) += cs46xx.o ac97_codec.o obj-$(CONFIG_SOUND_TRIDENT) += trident.o ac97_codec.o -obj-$(CONFIG_SOUND_EMU10K1) += ac97_codec.o obj-$(CONFIG_SOUND_BCM_CS4297A) += swarm_cs4297a.o obj-$(CONFIG_SOUND_BT878) += btaudio.o obj-$(CONFIG_SOUND_WM97XX) += ac97_plugin_wm97xx.o -ifeq ($(CONFIG_MIDI_EMU10K1),y) - obj-$(CONFIG_SOUND_EMU10K1) += sound.o -endif - -obj-$(CONFIG_SOUND_EMU10K1) += emu10k1/ obj-$(CONFIG_DMASOUND) += dmasound/ # Declare multi-part drivers. diff --git a/sound/oss/ac97.c b/sound/oss/ac97.c deleted file mode 100644 index 72cf4ed7793..00000000000 --- a/sound/oss/ac97.c +++ /dev/null @@ -1,432 +0,0 @@ -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/init.h> -#include "ac97.h" - -/* Flag for mono controls. */ -#define MO 0 -/* And for stereo. */ -#define ST 1 - -/* Whether or not the bits in the channel are inverted. */ -#define INV 1 -#define NINV 0 - -static struct ac97_chn_desc { - int ac97_regnum; - int oss_channel; - int maxval; - int is_stereo; - int oss_mask; - int recordNum; - u16 regmask; - int is_inverted; -} mixerRegs[] = { - { AC97_MASTER_VOL_STEREO, SOUND_MIXER_VOLUME, 0x3f, ST, SOUND_MASK_VOLUME, 5, 0x0000, INV }, - { AC97_MASTER_VOL_MONO, SOUND_MIXER_PHONEOUT, 0x3f, MO, SOUND_MASK_PHONEOUT, 6, 0x0000, INV }, - { AC97_MASTER_TONE, SOUND_MIXER_TREBLE, 0x0f, MO, SOUND_MASK_TREBLE, -1, 0x00ff, INV }, - { AC97_MASTER_TONE, SOUND_MIXER_BASS, 0x0f, MO, SOUND_MASK_BASS, -1, 0xff00, INV }, - { AC97_PCBEEP_VOL, SOUND_MIXER_SPEAKER, 0x0f, MO, SOUND_MASK_SPEAKER, -1, 0x001e, INV }, - { AC97_PHONE_VOL, SOUND_MIXER_PHONEIN, 0x1f, MO, SOUND_MASK_PHONEIN, 7, 0x0000, INV }, - { AC97_MIC_VOL, SOUND_MIXER_MIC, 0x1f, MO, SOUND_MASK_MIC, 0, 0x0000, INV }, - { AC97_LINEIN_VOL, SOUND_MIXER_LINE, 0x1f, ST, SOUND_MASK_LINE, 4, 0x0000, INV }, - { AC97_CD_VOL, SOUND_MIXER_CD, 0x1f, ST, SOUND_MASK_CD, 1, 0x0000, INV }, - { AC97_VIDEO_VOL, SOUND_MIXER_VIDEO, 0x1f, ST, SOUND_MASK_VIDEO, 2, 0x0000, INV }, - { AC97_AUX_VOL, SOUND_MIXER_LINE1, 0x1f, ST, SOUND_MASK_LINE1, 3, 0x0000, INV }, - { AC97_PCMOUT_VOL, SOUND_MIXER_PCM, 0x1f, ST, SOUND_MASK_PCM, -1, 0x0000, INV }, - { AC97_RECORD_GAIN, SOUND_MIXER_IGAIN, 0x0f, ST, SOUND_MASK_IGAIN, -1, 0x0000, NINV }, - { -1, -1, 0xff, 0, 0, -1, 0x0000, 0 }, -}; - -static struct ac97_chn_desc * -ac97_find_chndesc (struct ac97_hwint *dev, int oss_channel) -{ - int x; - - for (x = 0; mixerRegs[x].oss_channel != -1; x++) { - if (mixerRegs[x].oss_channel == oss_channel) - return mixerRegs + x; - } - - return NULL; -} - -static inline int -ac97_is_valid_channel (struct ac97_hwint *dev, struct ac97_chn_desc *chn) -{ - return (dev->last_written_mixer_values[chn->ac97_regnum / 2] - != AC97_REG_UNSUPPORTED); -} - -int -ac97_init (struct ac97_hwint *dev) -{ - int x; - int reg0; - - /* Clear out the arrays of cached values. */ - for (x = 0; x < AC97_REG_CNT; x++) - dev->last_written_mixer_values[x] = AC97_REGVAL_UNKNOWN; - - for (x = 0; x < SOUND_MIXER_NRDEVICES; x++) - dev->last_written_OSS_values[x] = AC97_REGVAL_UNKNOWN; - - /* Clear the device masks. */ - dev->mixer_devmask = 0; - dev->mixer_stereomask = 0; - dev->mixer_recmask = 0; - - /* ??? Do a "standard reset" via register 0? */ - - /* Hardware-dependent reset. */ - if (dev->reset_device (dev)) - return -1; - - /* Check the mixer device capabilities. */ - reg0 = dev->read_reg (dev, AC97_RESET); - - if (reg0 < 0) - return -1; - - /* Check for support for treble/bass controls. */ - if (! (reg0 & 4)) { - dev->last_written_mixer_values[AC97_MASTER_TONE / 2] - = AC97_REG_UNSUPPORTED; - } - - /* ??? There may be other tests here? */ - - /* Fill in the device masks. */ - for (x = 0; mixerRegs[x].ac97_regnum != -1; x++) { - if (ac97_is_valid_channel (dev, mixerRegs + x)) { - dev->mixer_devmask |= mixerRegs[x].oss_mask; - - if (mixerRegs[x].is_stereo) - dev->mixer_stereomask |= mixerRegs[x].oss_mask; - - if (mixerRegs[x].recordNum != -1) - dev->mixer_recmask |= mixerRegs[x].oss_mask; - } - } - - return 0; -} - -/* Return the contents of register REG; use the cache if the value in it - is valid. Returns a negative error code on failure. */ -static int -ac97_get_register (struct ac97_hwint *dev, u8 reg) -{ - if (reg > 127 || (reg & 1)) - return -EINVAL; - - /* See if it's in the cache, or if it's just plain invalid. */ - switch (dev->last_written_mixer_values[reg / 2]) { - case AC97_REG_UNSUPPORTED: - return -EINVAL; - break; - case AC97_REGVAL_UNKNOWN: - dev->last_written_mixer_values[reg / 2] = dev->read_reg (dev, reg); - break; - default: - break; - } - return dev->last_written_mixer_values[reg / 2]; -} - -/* Write VALUE to AC97 register REG, and cache its value in the last-written - cache. Returns a negative error code on failure, or 0 on success. */ -int -ac97_put_register (struct ac97_hwint *dev, u8 reg, u16 value) -{ - if (reg > 127 || (reg & 1)) - return -EINVAL; - - if (dev->last_written_mixer_values[reg / 2] == AC97_REG_UNSUPPORTED) - return -EINVAL; - else { - int res = dev->write_reg (dev, reg, value); - if (res >= 0) { - dev->last_written_mixer_values[reg / 2] = value; - return 0; - } - else - return res; - } -} - -/* Scale VALUE (a value fro 0 to MAXVAL) to a value from 0-100. If - IS_STEREO is set, VALUE is a stereo value; the left channel value - is in the lower 8 bits, and the right channel value is in the upper - 8 bits. - - A negative error code is returned on failure, or the unsigned - scaled value on success. */ - -static int -ac97_scale_to_oss_val (int value, int maxval, int is_stereo, int inv) -{ - /* Muted? */ - if (value & AC97_MUTE) - return 0; - - if (is_stereo) - return (ac97_scale_to_oss_val (value & 255, maxval, 0, inv) << 8) - | (ac97_scale_to_oss_val ((value >> 8) & 255, maxval, 0, inv) << 0); - else { - int i; - - /* Inverted. */ - if (inv) - value = maxval - value; - - i = (value * 100 + (maxval / 2)) / maxval; - if (i > 100) - i = 100; - if (i < 0) - i = 0; - return i; - } -} - -static int -ac97_scale_from_oss_val (int value, int maxval, int is_stereo, int inv) -{ - if (is_stereo) - return (ac97_scale_from_oss_val (value & 255, maxval, 0, inv) << 8) - | (ac97_scale_from_oss_val ((value >> 8) & 255, maxval, 0, inv) << 0); - else { - int i = ((value & 255) * maxval + 50) / 100; - if (inv) - i = maxval - i; - if (i < 0) - i = 0; - if (i > maxval) - i = maxval; - return i; - } -} - -static int -ac97_set_mixer (struct ac97_hwint *dev, int oss_channel, u16 oss_value) -{ - int scaled_value; - struct ac97_chn_desc *channel = ac97_find_chndesc (dev, oss_channel); - int result; - - if (channel == NULL) - return -ENODEV; - if (! ac97_is_valid_channel (dev, channel)) - return -ENODEV; - scaled_value = ac97_scale_from_oss_val (oss_value, channel->maxval, - channel->is_stereo, - channel->is_inverted); - if (scaled_value < 0) - return scaled_value; - - if (channel->regmask != 0) { - int mv; - - int oldval = ac97_get_register (dev, channel->ac97_regnum); - if (oldval < 0) - return oldval; - - for (mv = channel->regmask; ! (mv & 1); mv >>= 1) - scaled_value <<= 1; - - scaled_value &= channel->regmask; - scaled_value |= (oldval & ~channel->regmask); - } - result = ac97_put_register (dev, channel->ac97_regnum, scaled_value); - if (result == 0) - dev->last_written_OSS_values[oss_channel] = oss_value; - return result; -} - -static int -ac97_get_mixer_scaled (struct ac97_hwint *dev, int oss_channel) -{ - struct ac97_chn_desc *channel = ac97_find_chndesc (dev, oss_channel); - int regval; - - if (channel == NULL) - return -ENODEV; - - if (! ac97_is_valid_channel (dev, channel)) - return -ENODEV; - - regval = ac97_get_register (dev, channel->ac97_regnum); - - if (regval < 0) - return regval; - - if (channel->regmask != 0) { - int mv; - - regval &= channel->regmask; - - for (mv = channel->regmask; ! (mv & 1); mv >>= 1) - regval >>= 1; - } - return ac97_scale_to_oss_val (regval, channel->maxval, - channel->is_stereo, - channel->is_inverted); -} - -static int -ac97_get_recmask (struct ac97_hwint *dev) -{ - int recReg = ac97_get_register (dev, AC97_RECORD_SELECT); - - if (recReg < 0) - return recReg; - else { - int x; - for (x = 0; mixerRegs[x].ac97_regnum >= 0; x++) { - if (mixerRegs[x].recordNum == (recReg & 7)) - return mixerRegs[x].oss_mask; - } - return -ENODEV; - } -} - -static int -ac97_set_recmask (struct ac97_hwint *dev, int oss_recmask) -{ - int x; - - if (oss_recmask == 0) - oss_recmask = SOUND_MIXER_MIC; - - for (x = 0; mixerRegs[x].ac97_regnum >= 0; x++) { - if ((mixerRegs[x].recordNum >= 0) - && (oss_recmask & mixerRegs[x].oss_mask)) - break; - } - if (mixerRegs[x].ac97_regnum < 0) - return -ENODEV; - else { - int regval = (mixerRegs[x].recordNum << 8) | mixerRegs[x].recordNum; - int res = ac97_put_register (dev, AC97_RECORD_SELECT, regval); - if (res == 0) - return ac97_get_recmask (dev); - else - return res; - } -} - -/* Set the mixer DEV to the list of values in VALUE_LIST. Return 0 on - success, or a negative error code. */ -int -ac97_set_values (struct ac97_hwint *dev, - struct ac97_mixer_value_list *value_list) -{ - int x; - - for (x = 0; value_list[x].oss_channel != -1; x++) { - int chnum = value_list[x].oss_channel; - struct ac97_chn_desc *chent = ac97_find_chndesc (dev, chnum); - if (chent != NULL) { - u16 val; - int res; - - if (chent->is_stereo) - val = (value_list[x].value.stereo.right << 8) - | value_list[x].value.stereo.left; - else { - /* We do this so the returned value looks OK in the - mixer app. It's not necessary otherwise. */ - val = (value_list[x].value.mono << 8) - | value_list[x].value.mono; - } - res = ac97_set_mixer (dev, chnum, val); - if (res < 0) - return res; - } - else - return -ENODEV; - } - return 0; -} - -int -ac97_mixer_ioctl (struct ac97_hwint *dev, unsigned int cmd, void __user *arg) -{ - int ret; - - switch (cmd) { - case SOUND_MIXER_READ_RECSRC: - ret = ac97_get_recmask (dev); - break; - - case SOUND_MIXER_WRITE_RECSRC: - { - if (get_user (ret, (int __user *) arg)) - ret = -EFAULT; - else - ret = ac97_set_recmask (dev, ret); - } - break; - - case SOUND_MIXER_READ_CAPS: - ret = SOUND_CAP_EXCL_INPUT; - break; - - case SOUND_MIXER_READ_DEVMASK: - ret = dev->mixer_devmask; - break; - - case SOUND_MIXER_READ_RECMASK: - ret = dev->mixer_recmask; - break; - - case SOUND_MIXER_READ_STEREODEVS: - ret = dev->mixer_stereomask; - break; - - default: - /* Read or write request. */ - ret = -EINVAL; - if (_IOC_TYPE (cmd) == 'M') { - int dir = _SIOC_DIR (cmd); - int channel = _IOC_NR (cmd); - - if (channel >= 0 && channel < SOUND_MIXER_NRDEVICES) { - ret = 0; - if (dir & _SIOC_WRITE) { - int val; - if (get_user (val, (int __user *) arg) == 0) - ret = ac97_set_mixer (dev, channel, val); - else - ret = -EFAULT; - } - if (ret >= 0 && (dir & _SIOC_READ)) { - if (dev->last_written_OSS_values[channel] - == AC97_REGVAL_UNKNOWN) - dev->last_written_OSS_values[channel] - = ac97_get_mixer_scaled (dev, channel); - ret = dev->last_written_OSS_values[channel]; - } - } - } - break; - } - - if (ret < 0) - return ret; - else - return put_user(ret, (int __user *) arg); -} - -EXPORT_SYMBOL(ac97_init); -EXPORT_SYMBOL(ac97_set_values); -EXPORT_SYMBOL(ac97_put_register); -EXPORT_SYMBOL(ac97_mixer_ioctl); -MODULE_LICENSE("GPL"); - - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/sound/oss/ac97.h b/sound/oss/ac97.h deleted file mode 100644 index 01837a9d7d6..00000000000 --- a/sound/oss/ac97.h +++ /dev/null @@ -1,201 +0,0 @@ -/* - * ac97.h - * - * definitions for the AC97, Intel's Audio Codec 97 Spec - * also includes support for a generic AC97 interface - */ - -#ifndef _AC97_H_ -#define _AC97_H_ -#include "sound_config.h" -#include "sound_calls.h" - -#define AC97_RESET 0x0000 // -#define AC97_MASTER_VOL_STEREO 0x0002 // Line Out -#define AC97_HEADPHONE_VOL 0x0004 // -#define AC97_MASTER_VOL_MONO 0x0006 // TAD Output -#define AC97_MASTER_TONE 0x0008 // -#define AC97_PCBEEP_VOL 0x000a // none -#define AC97_PHONE_VOL 0x000c // TAD Input (mono) -#define AC97_MIC_VOL 0x000e // MIC Input (mono) -#define AC97_LINEIN_VOL 0x0010 // Line Input (stereo) -#define AC97_CD_VOL 0x0012 // CD Input (stereo) -#define AC97_VIDEO_VOL 0x0014 // none -#define AC97_AUX_VOL 0x0016 // Aux Input (stereo) -#define AC97_PCMOUT_VOL 0x0018 // Wave Output (stereo) -#define AC97_RECORD_SELECT 0x001a // -#define AC97_RECORD_GAIN 0x001c -#define AC97_RECORD_GAIN_MIC 0x001e -#define AC97_GENERAL_PURPOSE 0x0020 -#define AC97_3D_CONTROL 0x0022 -#define AC97_MODEM_RATE 0x0024 -#define AC97_POWER_CONTROL 0x0026 - -/* registers 0x0028 - 0x0058 are reserved */ - -/* AC'97 2.0 */ -#define AC97_EXTENDED_ID 0x0028 /* Extended Audio ID */ -#define AC97_EXTENDED_STATUS 0x002A /* Extended Audio Status */ -#define AC97_PCM_FRONT_DAC_RATE 0x002C /* PCM Front DAC Rate */ -#define AC97_PCM_SURR_DAC_RATE 0x002E /* PCM Surround DAC Rate */ -#define AC97_PCM_LFE_DAC_RATE 0x0030 /* PCM LFE DAC Rate */ -#define AC97_PCM_LR_ADC_RATE 0x0032 /* PCM LR DAC Rate */ -#define AC97_PCM_MIC_ADC_RATE 0x0034 /* PCM MIC ADC Rate */ -#define AC97_CENTER_LFE_MASTER 0x0036 /* Center + LFE Master Volume */ -#define AC97_SURROUND_MASTER 0x0038 /* Surround (Rear) Master Volume */ -#define AC97_RESERVED_3A 0x003A /* Reserved */ -/* range 0x3c-0x58 - MODEM */ - -/* registers 0x005a - 0x007a are vendor reserved */ - -#define AC97_VENDOR_ID1 0x007c -#define AC97_VENDOR_ID2 0x007e - -/* volume control bit defines */ - -#define AC97_MUTE 0x8000 -#define AC97_MICBOOST 0x0040 -#define AC97_LEFTVOL 0x3f00 -#define AC97_RIGHTVOL 0x003f - -/* record mux defines */ - -#define AC97_RECMUX_MIC 0x0000 -#define AC97_RECMUX_CD 0x0101 -#define AC97_RECMUX_VIDEO 0x0202 /* not used */ -#define AC97_RECMUX_AUX 0x0303 -#define AC97_RECMUX_LINE 0x0404 -#define AC97_RECMUX_STEREO_MIX 0x0505 -#define AC97_RECMUX_MONO_MIX 0x0606 -#define AC97_RECMUX_PHONE 0x0707 - - -/* general purpose register bit defines */ - -#define AC97_GP_LPBK 0x0080 /* Loopback mode */ -#define AC97_GP_MS 0x0100 /* Mic Select 0=Mic1, 1=Mic2 */ -#define AC97_GP_MIX 0x0200 /* Mono output select 0=Mix, 1=Mic */ -#define AC97_GP_RLBK 0x0400 /* Remote Loopback - Modem line codec */ -#define AC97_GP_LLBK 0x0800 /* Local Loopback - Modem Line codec */ -#define AC97_GP_LD 0x1000 /* Loudness 1=on */ -#define AC97_GP_3D 0x2000 /* 3D Enhancement 1=on */ -#define AC97_GP_ST 0x4000 /* Stereo Enhancement 1=on */ -#define AC97_GP_POP 0x8000 /* Pcm Out Path, 0=pre 3D, 1=post 3D */ - - -/* powerdown control and status bit defines */ - -/* status */ -#define AC97_PWR_MDM 0x0010 /* Modem section ready */ -#define AC97_PWR_REF 0x0008 /* Vref nominal */ -#define AC97_PWR_ANL 0x0004 /* Analog section ready */ -#define AC97_PWR_DAC 0x0002 /* DAC section ready */ -#define AC97_PWR_ADC 0x0001 /* ADC section ready */ - -/* control */ -#define AC97_PWR_PR0 0x0100 /* ADC and Mux powerdown */ -#define AC97_PWR_PR1 0x0200 /* DAC powerdown */ -#define AC97_PWR_PR2 0x0400 /* Output mixer powerdown (Vref on) */ -#define AC97_PWR_PR3 0x0800 /* Output mixer powerdown (Vref off) */ -#define AC97_PWR_PR4 0x1000 /* AC-link powerdown */ -#define AC97_PWR_PR5 0x2000 /* Internal Clk disable */ -#define AC97_PWR_PR6 0x4000 /* HP amp powerdown */ -#define AC97_PWR_PR7 0x8000 /* Modem off - if supported */ - -/* useful power states */ -#define AC97_PWR_D0 0x0000 /* everything on */ -#define AC97_PWR_D1 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR4 -#define AC97_PWR_D2 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4 -#define AC97_PWR_D3 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4 -#define AC97_PWR_ANLOFF AC97_PWR_PR2|AC97_PWR_PR3 /* analog section off */ - -/* Total number of defined registers. */ -#define AC97_REG_CNT 64 - -/* Generic AC97 mixer interface. */ - -/* Structure describing access to the hardware. */ -struct ac97_hwint -{ - /* Perform any hardware-specific reset and initialization. Returns - 0 on success, or a negative error code. */ - int (*reset_device) (struct ac97_hwint *dev); - - /* Returns the contents of the specified register REG. The caller - should check to see if the desired contents are available in - the cache first, if applicable. Returns a positive unsigned value - representing the contents of the register, or a negative error - code. */ - int (*read_reg) (struct ac97_hwint *dev, u8 reg); - - /* Writes VALUE to register REG. Returns 0 on success, or a - negative error code. */ - int (*write_reg) (struct ac97_hwint *dev, u8 reg, u16 value); - - /* Hardware-specific information. */ - void *driver_private; - - /* Three OSS masks. */ - int mixer_devmask; - int mixer_stereomask; - int mixer_recmask; - - /* The mixer cache. The indices correspond to the AC97 hardware register - number / 2, since the register numbers are always an even number. - - Unknown values are set to -1; unsupported registers contain a - -2. */ - int last_written_mixer_values[AC97_REG_CNT]; - - /* A cache of values written via OSS; we need these so we can return - the values originally written by the user. - - Why the original user values? Because the real-world hardware - has less precision, and some existing applications assume that - they will get back the exact value that they wrote (aumix). - - A -1 value indicates that no value has been written to this mixer - channel via OSS. */ - int last_written_OSS_values[SOUND_MIXER_NRDEVICES]; -}; - -/* Values stored in the register cache. */ -#define AC97_REGVAL_UNKNOWN -1 -#define AC97_REG_UNSUPPORTED -2 - -struct ac97_mixer_value_list -{ - /* Mixer channel to set. List is terminated by a value of -1. */ - int oss_channel; - /* The scaled value to set it to; values generally range from 0-100. */ - union { - struct { - u8 left, right; - } stereo; - u8 mono; - } value; -}; - -/* Initialize the ac97 mixer by resetting it. */ -extern int ac97_init (struct ac97_hwint *dev); - -/* Sets the mixer DEV to the values in VALUE_LIST. Returns 0 on success, - or a negative error code. */ -extern int ac97_set_values (struct ac97_hwint *dev, - struct ac97_mixer_value_list *value_list); - -/* Writes the specified VALUE to the AC97 register REG in the mixer. - Takes care of setting the last-written cache as well. */ -extern int ac97_put_register (struct ac97_hwint *dev, u8 reg, u16 value); - -/* Default ioctl. */ -extern int ac97_mixer_ioctl (struct ac97_hwint *dev, unsigned int cmd, - void __user * arg); - -#endif - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/sound/oss/aci.c b/sound/oss/aci.c deleted file mode 100644 index 3bfac375dbd..00000000000 --- a/sound/oss/aci.c +++ /dev/null @@ -1,712 +0,0 @@ -/* - * Audio Command Interface (ACI) driver (sound/aci.c) - * - * ACI is a protocol used to communicate with the microcontroller on - * some sound cards produced by miro, e.g. the miroSOUND PCM12 and - * PCM20. The ACI has been developed for miro by Norberto Pellicci - * <pellicci@home.com>. Special thanks to both him and miro for - * providing the ACI specification. - * - * The main function of the ACI is to control the mixer and to get a - * product identification. On the PCM20, ACI also controls the radio - * tuner on this card, this is supported in the Video for Linux - * miropcm20 driver. - * - - * This is a fullfeatured implementation. Unsupported features - * are bugs... (: - * - * It is not longer necessary to load the mad16 module first. The - * user is currently responsible to set the mad16 mixer correctly. - * - * To toggle the solo mode for full duplex operation just use the OSS - * record switch for the pcm ('wave') controller. Robert - * - - * - * Revision history: - * - * 1995-11-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de> - * First version written. - * 1995-12-31 Markus Kuhn - * Second revision, general code cleanup. - * 1996-05-16 Hannu Savolainen - * Integrated with other parts of the driver. - * 1996-05-28 Markus Kuhn - * Initialize CS4231A mixer, make ACI first mixer, - * use new private mixer API for solo mode. - * 1998-08-18 Ruurd Reitsma <R.A.Reitsma@wbmt.tudelft.nl> - * Small modification to export ACI functions and - * complete modularisation. - * 2000-06-20 Robert Siemer <Robert.Siemer@gmx.de> - * Don't initialize the CS4231A mixer anymore, so the code is - * working again, and other small changes to fit in todays - * kernels. - * 2000-08-26 Robert Siemer - * Clean up and rewrite for 2.4.x. Maybe it's SMP safe now... (: - * ioctl bugfix, and integration of solo-mode into OSS-API, - * added (OSS-limited) equalizer support, return value bugfix, - * changed param aci_reset to reset, new params: ide, wss. - * 2001-04-20 Robert Siemer - * even more cleanups... - * 2001-10-08 Arnaldo Carvalho de Melo <acme@conectiva.com.br> - * Get rid of check_region, .bss optimizations, use set_current_state - */ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/module.h> -#include <linux/proc_fs.h> -#include <linux/slab.h> -#include <linux/mutex.h> - -#include <asm/io.h> -#include <asm/uaccess.h> -#include "sound_config.h" - -int aci_port; /* as determined by bit 4 in the OPTi 929 MC4 register */ -static int aci_idcode[2]; /* manufacturer and product ID */ -int aci_version; /* ACI firmware version */ - -EXPORT_SYMBOL(aci_port); -EXPORT_SYMBOL(aci_version); - -#include "aci.h" - - -static int aci_solo; /* status bit of the card that can't be * - * checked with ACI versions prior to 0xb0 */ -static int aci_amp; /* status bit for power-amp/line-out level - but I have no docs about what is what... */ -static int aci_micpreamp=3; /* microphone preamp-level that can't be * - * checked with ACI versions prior to 0xb0 */ - -static int mixer_device; -static struct mutex aci_mutex; - -#ifdef MODULE -static int reset; -module_param(reset, bool, 0); -MODULE_PARM_DESC(reset,"When set to 1, reset aci mixer."); -#else -static int reset = 1; -#endif - -static int ide=-1; -module_param(ide, int, 0); -MODULE_PARM_DESC(ide,"1 enable, 0 disable ide-port - untested" - " default: do nothing"); -static int wss=-1; -module_param(wss, int, 0); -MODULE_PARM_DESC(wss,"change between ACI/WSS-mixer; use 0 and 1 - untested" - " default: do nothing; for PCM1-pro only"); - -#ifdef DEBUG -static void print_bits(unsigned char c) -{ - int j; - printk(KERN_DEBUG "aci: "); - - for (j=7; j>=0; j--) { - printk("%d", (c >> j) & 0x1); - } - - printk("\n"); -} -#endif - -/* - * This busy wait code normally requires less than 15 loops and - * practically always less than 100 loops on my i486/DX2 66 MHz. - * - * Warning: Waiting on the general status flag after reseting the MUTE - * function can take a VERY long time, because the PCM12 does some kind - * of fade-in effect. For this reason, access to the MUTE function has - * not been implemented at all. - * - * - The OSS interface has no mute option. It takes about 3 seconds to - * fade-in on my PCM20. busy_wait() handles it great now... Robert - */ - -static int busy_wait(void) -{ - #define MINTIME 500 - long timeout; - unsigned char byte; - - for (timeout = 1; timeout <= MINTIME+30; timeout++) { - if (((byte=inb(BUSY_REGISTER)) & 1) == 0) { - if (timeout >= MINTIME) - printk(KERN_DEBUG "aci: Got READYFLAG in round %ld.\n", timeout-MINTIME); - return byte; - } - if (timeout >= MINTIME) { - long out=10*HZ; - switch (timeout-MINTIME) { - case 0 ... 9: - out /= 10; - case 10 ... 19: - out /= 10; - case 20 ... 30: - out /= 10; - default: - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(out); - break; - } - } - } - printk(KERN_WARNING "aci: busy_wait() time out.\n"); - return -EBUSY; -} - -/* The four ACI command types are fucked up. [-: - * implied is: 1w - special case for INIT - * write is: 2w1r - * read is: x(1w1r) where x is 1 or 2 (1 CHECK_SIG, 1 CHECK_STER, - * 1 VERSION, 2 IDCODE) - * the command is only in the first write, rest is protocol overhead - * - * indexed is technically a write and used for STATUS - * and the special case for TUNE is: 3w1r - * - * Here the new general sheme: TUNE --> aci_rw_cmd(x, y, z) - * indexed and write --> aci_rw_cmd(x, y, -1) - * implied and read (x=1) --> aci_rw_cmd(x, -1, -1) - * - * Read (x>=2) is not implemented (only used during initialization). - * Use aci_idcode[2] and aci_version... Robert - */ - -/* Some notes for error detection: theoretically it is possible. - * But it doubles the I/O-traffic from ww(r) to wwwrw(r) in the normal - * case and doesn't seem to be designed for that... Robert - */ - -static inline int aci_rawwrite(unsigned char byte) -{ - if (busy_wait() >= 0) { -#ifdef DEBUG - printk(KERN_DEBUG "aci_rawwrite(%d)\n", byte); -#endif - outb(byte, COMMAND_REGISTER); - return 0; - } else - return -EBUSY; -} - -static inline int aci_rawread(void) -{ - unsigned char byte; - - if (busy_wait() >= 0) { - byte=inb(STATUS_REGISTER); -#ifdef DEBUG - printk(KERN_DEBUG "%d = aci_rawread()\n", byte); -#endif - return byte; - } else - return -EBUSY; -} - - -int aci_rw_cmd(int write1, int write2, int write3) -{ - int write[] = {write1, write2, write3}; - int read = -EINTR, i; - - if (mutex_lock_interruptible(&aci_mutex)) - goto out; - - for (i=0; i<3; i++) { - if (write[i]< 0 || write[i] > 255) - break; - else { - read = aci_rawwrite(write[i]); - if (read < 0) - goto out_up; - } - - } - - read = aci_rawread(); -out_up: mutex_unlock(&aci_mutex); -out: return read; -} - -EXPORT_SYMBOL(aci_rw_cmd); - -static int setvolume(int __user *arg, - unsigned char left_index, unsigned char right_index) -{ - int vol, ret, uservol, buf; - - __get_user(uservol, arg); - - /* left channel */ - vol = uservol & 0xff; - if (vol > 100) - vol = 100; - vol = SCALE(100, 0x20, vol); - if ((buf=aci_write_cmd(left_index, 0x20 - vol))<0) - return buf; - ret = SCALE(0x20, 100, vol); - - - /* right channel */ - vol = (uservol >> 8) & 0xff; - if (vol > 100) - vol = 100; - vol = SCALE(100, 0x20, vol); - if ((buf=aci_write_cmd(right_index, 0x20 - vol))<0) - return buf; - ret |= SCALE(0x20, 100, vol) << 8; - - __put_user(ret, arg); - - return 0; -} - -static int getvolume(int __user *arg, - unsigned char left_index, unsigned char right_index) -{ - int vol; - int buf; - - /* left channel */ - if ((buf=aci_indexed_cmd(ACI_STATUS, left_index))<0) - return buf; - vol = SCALE(0x20, 100, buf < 0x20 ? 0x20-buf : 0); - - /* right channel */ - if ((buf=aci_indexed_cmd(ACI_STATUS, right_index))<0) - return buf; - vol |= SCALE(0x20, 100, buf < 0x20 ? 0x20-buf : 0) << 8; - - __put_user(vol, arg); - - return 0; -} - - -/* The equalizer is somewhat strange on the ACI. From -12dB to +12dB - * write: 0xff..down.to..0x80==0x00..up.to..0x7f - */ - -static inline unsigned int eq_oss2aci(unsigned int vol) -{ - int boost=0; - unsigned int ret; - - if (vol > 100) - vol = 100; - if (vol > 50) { - vol -= 51; - boost=1; - } - if (boost) - ret=SCALE(49, 0x7e, vol)+1; - else - ret=0xff - SCALE(50, 0x7f, vol); - return ret; -} - -static inline unsigned int eq_aci2oss(unsigned int vol) -{ - if (vol < 0x80) - return SCALE(0x7f, 50, vol) + 50; - else - return SCALE(0x7f, 50, 0xff-vol); -} - - -static int setequalizer(int __user *arg, - unsigned char left_index, unsigned char right_index) -{ - int buf; - unsigned int vol; - - __get_user(vol, arg); - - /* left channel */ - if ((buf=aci_write_cmd(left_index, eq_oss2aci(vol & 0xff)))<0) - return buf; - - /* right channel */ - if ((buf=aci_write_cmd(right_index, eq_oss2aci((vol>>8) & 0xff)))<0) - return buf; - - /* the ACI equalizer is more precise */ - return 0; -} - -static int getequalizer(int __user *arg, - unsigned char left_index, unsigned char right_index) -{ - int buf; - unsigned int vol; - - /* left channel */ - if ((buf=aci_indexed_cmd(ACI_STATUS, left_index))<0) - return buf; - vol = eq_aci2oss(buf); - - /* right channel */ - if ((buf=aci_indexed_cmd(ACI_STATUS, right_index))<0) - return buf; - vol |= eq_aci2oss(buf) << 8; - - __put_user(vol, arg); - - return 0; -} - -static int aci_mixer_ioctl (int dev, unsigned int cmd, void __user * arg) -{ - int vol, buf; - int __user *p = arg; - - switch (cmd) { - case SOUND_MIXER_WRITE_VOLUME: - return setvolume(p, 0x01, 0x00); - case SOUND_MIXER_WRITE_CD: - return setvolume(p, 0x3c, 0x34); - case SOUND_MIXER_WRITE_MIC: - return setvolume(p, 0x38, 0x30); - case SOUND_MIXER_WRITE_LINE: - return setvolume(p, 0x39, 0x31); - case SOUND_MIXER_WRITE_SYNTH: - return setvolume(p, 0x3b, 0x33); - case SOUND_MIXER_WRITE_PCM: - return setvolume(p, 0x3a, 0x32); - case MIXER_WRITE(SOUND_MIXER_RADIO): /* fall through */ - case SOUND_MIXER_WRITE_LINE1: /* AUX1 or radio */ - return setvolume(p, 0x3d, 0x35); - case SOUND_MIXER_WRITE_LINE2: /* AUX2 */ - return setvolume(p, 0x3e, 0x36); - case SOUND_MIXER_WRITE_BASS: /* set band one and two */ - if (aci_idcode[1]=='C') { - if ((buf=setequalizer(p, 0x48, 0x40)) || - (buf=setequalizer(p, 0x49, 0x41))); - return buf; - } - break; - case SOUND_MIXER_WRITE_TREBLE: /* set band six and seven */ - if (aci_idcode[1]=='C') { - if ((buf=setequalizer(p, 0x4d, 0x45)) || - (buf=setequalizer(p, 0x4e, 0x46))); - return buf; - } - break; - case SOUND_MIXER_WRITE_IGAIN: /* MIC pre-amp */ - if (aci_idcode[1]=='B' || aci_idcode[1]=='C') { - __get_user(vol, p); - vol = vol & 0xff; - if (vol > 100) - vol = 100; - vol = SCALE(100, 3, vol); - if ((buf=aci_write_cmd(ACI_WRITE_IGAIN, vol))<0) - return buf; - aci_micpreamp = vol; - vol = SCALE(3, 100, vol); - vol |= (vol << 8); - __put_user(vol, p); - return 0; - } - break; - case SOUND_MIXER_WRITE_OGAIN: /* Power-amp/line-out level */ - if (aci_idcode[1]=='A' || aci_idcode[1]=='B') { - __get_user(buf, p); - buf = buf & 0xff; - if (buf > 50) - vol = 1; - else - vol = 0; - if ((buf=aci_write_cmd(ACI_SET_POWERAMP, vol))<0) - return buf; - aci_amp = vol; - if (aci_amp) - buf = (100 || 100<<8); - else - buf = 0; - __put_user(buf, p); - return 0; - } - break; - case SOUND_MIXER_WRITE_RECSRC: - /* handle solo mode control */ - __get_user(buf, p); - /* unset solo when RECSRC for PCM is requested */ - if (aci_idcode[1]=='B' || aci_idcode[1]=='C') { - vol = !(buf & SOUND_MASK_PCM); - if ((buf=aci_write_cmd(ACI_SET_SOLOMODE, vol))<0) - return buf; - aci_solo = vol; - } - buf = (SOUND_MASK_CD| SOUND_MASK_MIC| SOUND_MASK_LINE| - SOUND_MASK_SYNTH| SOUND_MASK_LINE2); - if (aci_idcode[1] == 'C') /* PCM20 radio */ - buf |= SOUND_MASK_RADIO; - else - buf |= SOUND_MASK_LINE1; - if (!aci_solo) - buf |= SOUND_MASK_PCM; - __put_user(buf, p); - return 0; - case SOUND_MIXER_READ_DEVMASK: - buf = (SOUND_MASK_VOLUME | SOUND_MASK_CD | - SOUND_MASK_MIC | SOUND_MASK_LINE | - SOUND_MASK_SYNTH | SOUND_MASK_PCM | - SOUND_MASK_LINE2); - switch (aci_idcode[1]) { - case 'C': /* PCM20 radio */ - buf |= (SOUND_MASK_RADIO | SOUND_MASK_IGAIN | - SOUND_MASK_BASS | SOUND_MASK_TREBLE); - break; - case 'B': /* PCM12 */ - buf |= (SOUND_MASK_LINE1 | SOUND_MASK_IGAIN | - SOUND_MASK_OGAIN); - break; - case 'A': /* PCM1-pro */ - buf |= (SOUND_MASK_LINE1 | SOUND_MASK_OGAIN); - break; - default: - buf |= SOUND_MASK_LINE1; - } - __put_user(buf, p); - return 0; - case SOUND_MIXER_READ_STEREODEVS: - buf = (SOUND_MASK_VOLUME | SOUND_MASK_CD | - SOUND_MASK_MIC | SOUND_MASK_LINE | - SOUND_MASK_SYNTH | SOUND_MASK_PCM | - SOUND_MASK_LINE2); - switch (aci_idcode[1]) { - case 'C': /* PCM20 radio */ - buf |= (SOUND_MASK_RADIO | - SOUND_MASK_BASS | SOUND_MASK_TREBLE); - break; - default: - buf |= SOUND_MASK_LINE1; - } - __put_user(buf, p); - return 0; - case SOUND_MIXER_READ_RECMASK: - buf = (SOUND_MASK_CD| SOUND_MASK_MIC| SOUND_MASK_LINE| - SOUND_MASK_SYNTH| SOUND_MASK_LINE2| SOUND_MASK_PCM); - if (aci_idcode[1] == 'C') /* PCM20 radio */ - buf |= SOUND_MASK_RADIO; - else - buf |= SOUND_MASK_LINE1; - - __put_user(buf, p); - return 0; - case SOUND_MIXER_READ_RECSRC: - buf = (SOUND_MASK_CD | SOUND_MASK_MIC | SOUND_MASK_LINE | - SOUND_MASK_SYNTH | SOUND_MASK_LINE2); - /* do we need aci_solo or can I get it from the ACI? */ - switch (aci_idcode[1]) { - case 'B': /* PCM12 */ - case 'C': /* PCM20 radio */ - if (aci_version >= 0xb0) { - if ((vol=aci_rw_cmd(ACI_STATUS, - ACI_S_GENERAL, -1))<0) - return vol; - if (vol & 0x20) - buf |= SOUND_MASK_PCM; - } - else - if (!aci_solo) - buf |= SOUND_MASK_PCM; - break; - default: - buf |= SOUND_MASK_PCM; - } - if (aci_idcode[1] == 'C') /* PCM20 radio */ - buf |= SOUND_MASK_RADIO; - else - buf |= SOUND_MASK_LINE1; - - __put_user(buf, p); - return 0; - case SOUND_MIXER_READ_CAPS: - __put_user(0, p); - return 0; - case SOUND_MIXER_READ_VOLUME: - return getvolume(p, 0x04, 0x03); - case SOUND_MIXER_READ_CD: - return getvolume(p, 0x0a, 0x09); - case SOUND_MIXER_READ_MIC: - return getvolume(p, 0x06, 0x05); - case SOUND_MIXER_READ_LINE: - return getvolume(p, 0x08, 0x07); - case SOUND_MIXER_READ_SYNTH: - return getvolume(p, 0x0c, 0x0b); - case SOUND_MIXER_READ_PCM: - return getvolume(p, 0x0e, 0x0d); - case MIXER_READ(SOUND_MIXER_RADIO): /* fall through */ - case SOUND_MIXER_READ_LINE1: /* AUX1 */ - return getvolume(p, 0x11, 0x10); - case SOUND_MIXER_READ_LINE2: /* AUX2 */ - return getvolume(p, 0x13, 0x12); - case SOUND_MIXER_READ_BASS: /* get band one */ - if (aci_idcode[1]=='C') { - return getequalizer(p, 0x23, 0x22); - } - break; - case SOUND_MIXER_READ_TREBLE: /* get band seven */ - if (aci_idcode[1]=='C') { - return getequalizer(p, 0x2f, 0x2e); - } - break; - case SOUND_MIXER_READ_IGAIN: /* MIC pre-amp */ - if (aci_idcode[1]=='B' || aci_idcode[1]=='C') { - /* aci_micpreamp or ACI? */ - if (aci_version >= 0xb0) { - if ((buf=aci_indexed_cmd(ACI_STATUS, - ACI_S_READ_IGAIN))<0) - return buf; - } - else - buf=aci_micpreamp; - vol = SCALE(3, 100, buf <= 3 ? buf : 3); - vol |= vol << 8; - __put_user(vol, p); - return 0; - } - break; - case SOUND_MIXER_READ_OGAIN: - if (aci_amp) - buf = (100 || 100<<8); - else - buf = 0; - __put_user(buf, p); - return 0; - } - return -EINVAL; -} - -static struct mixer_operations aci_mixer_operations = -{ - .owner = THIS_MODULE, - .id = "ACI", - .ioctl = aci_mixer_ioctl -}; - -/* - * There is also an internal mixer in the codec (CS4231A or AD1845), - * that deserves no purpose in an ACI based system which uses an - * external ACI controlled stereo mixer. Make sure that this codec - * mixer has the AUX1 input selected as the recording source, that the - * input gain is set near maximum and that the other channels going - * from the inputs to the codec output are muted. - */ - -static int __init attach_aci(void) -{ - char *boardname; - int i, rc = -EBUSY; - - mutex_init(&aci_mutex); - - outb(0xE3, 0xf8f); /* Write MAD16 password */ - aci_port = (inb(0xf90) & 0x10) ? - 0x344: 0x354; /* Get aci_port from MC4_PORT */ - - if (!request_region(aci_port, 3, "sound mixer (ACI)")) { - printk(KERN_NOTICE - "aci: I/O area 0x%03x-0x%03x already used.\n", - aci_port, aci_port+2); - goto out; - } - - /* force ACI into a known state */ - rc = -EFAULT; - for (i=0; i<3; i++) - if (aci_rw_cmd(ACI_ERROR_OP, -1, -1)<0) - goto out_release_region; - - /* official this is one aci read call: */ - rc = -EFAULT; - if ((aci_idcode[0]=aci_rw_cmd(ACI_READ_IDCODE, -1, -1))<0 || - (aci_idcode[1]=aci_rw_cmd(ACI_READ_IDCODE, -1, -1))<0) { - printk(KERN_ERR "aci: Failed to read idcode on 0x%03x.\n", - aci_port); - goto out_release_region; - } - - if ((aci_version=aci_rw_cmd(ACI_READ_VERSION, -1, -1))<0) { - printk(KERN_ERR "aci: Failed to read version on 0x%03x.\n", - aci_port); - goto out_release_region; - } - - if (aci_idcode[0] == 'm') { - /* It looks like a miro sound card. */ - switch (aci_idcode[1]) { - case 'A': - boardname = "PCM1 pro / early PCM12"; - break; - case 'B': - boardname = "PCM12"; - break; - case 'C': - boardname = "PCM20 radio"; - break; - default: - boardname = "unknown miro"; - } - } else { - printk(KERN_WARNING "aci: Warning: unsupported card! - " - "no hardware, no specs...\n"); - boardname = "unknown Cardinal Technologies"; - } - - printk(KERN_INFO "<ACI 0x%02x, id %02x/%02x \"%c/%c\", (%s)> at 0x%03x\n", - aci_version, - aci_idcode[0], aci_idcode[1], - aci_idcode[0], aci_idcode[1], - boardname, aci_port); - - rc = -EBUSY; - if (reset) { - /* first write()s after reset fail with my PCM20 */ - if (aci_rw_cmd(ACI_INIT, -1, -1)<0 || - aci_rw_cmd(ACI_ERROR_OP, ACI_ERROR_OP, ACI_ERROR_OP)<0 || - aci_rw_cmd(ACI_ERROR_OP, ACI_ERROR_OP, ACI_ERROR_OP)<0) - goto out_release_region; - } - - /* the PCM20 is muted after reset (and reboot) */ - if (aci_rw_cmd(ACI_SET_MUTE, 0x00, -1)<0) - goto out_release_region; - - if (ide>=0) - if (aci_rw_cmd(ACI_SET_IDE, !ide, -1)<0) - goto out_release_region; - - if (wss>=0 && aci_idcode[1]=='A') - if (aci_rw_cmd(ACI_SET_WSS, !!wss, -1)<0) - goto out_release_region; - - mixer_device = sound_install_mixer(MIXER_DRIVER_VERSION, boardname, - &aci_mixer_operations, - sizeof(aci_mixer_operations), NULL); - rc = 0; - if (mixer_device < 0) { - printk(KERN_ERR "aci: Failed to install mixer.\n"); - rc = mixer_device; - goto out_release_region; - } /* else Maybe initialize the CS4231A mixer here... */ -out: return rc; -out_release_region: - release_region(aci_port, 3); - goto out; -} - -static void __exit unload_aci(void) -{ - sound_unload_mixerdev(mixer_device); - release_region(aci_port, 3); -} - -module_init(attach_aci); -module_exit(unload_aci); -MODULE_LICENSE("GPL"); diff --git a/sound/oss/aci.h b/sound/oss/aci.h deleted file mode 100644 index 20102ee088e..00000000000 --- a/sound/oss/aci.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef _ACI_H_ -#define _ACI_H_ - -extern int aci_port; -extern int aci_version; /* ACI firmware version */ -extern int aci_rw_cmd(int write1, int write2, int write3); - -#define aci_indexed_cmd(a, b) aci_rw_cmd(a, b, -1) -#define aci_write_cmd(a, b) aci_rw_cmd(a, b, -1) -#define aci_read_cmd(a) aci_rw_cmd(a,-1, -1) - -#define COMMAND_REGISTER (aci_port) /* write register */ -#define STATUS_REGISTER (aci_port + 1) /* read register */ -#define BUSY_REGISTER (aci_port + 2) /* also used for rds */ - -#define RDS_REGISTER BUSY_REGISTER - -#define ACI_SET_MUTE 0x0d -#define ACI_SET_POWERAMP 0x0f -#define ACI_SET_TUNERMUTE 0xa3 -#define ACI_SET_TUNERMONO 0xa4 -#define ACI_SET_IDE 0xd0 -#define ACI_SET_WSS 0xd1 -#define ACI_SET_SOLOMODE 0xd2 -#define ACI_WRITE_IGAIN 0x03 -#define ACI_WRITE_TUNE 0xa7 -#define ACI_READ_TUNERSTEREO 0xa8 -#define ACI_READ_TUNERSTATION 0xa9 -#define ACI_READ_VERSION 0xf1 -#define ACI_READ_IDCODE 0xf2 -#define ACI_INIT 0xff -#define ACI_STATUS 0xf0 -#define ACI_S_GENERAL 0x00 -#define ACI_S_READ_IGAIN 0x21 -#define ACI_ERROR_OP 0xdf - -/* - * The following macro SCALE can be used to scale one integer volume - * value into another one using only integer arithmetic. If the input - * value x is in the range 0 <= x <= xmax, then the result will be in - * the range 0 <= SCALE(xmax,ymax,x) <= ymax. - * - * This macro has for all xmax, ymax > 0 and all 0 <= x <= xmax the - * following nice properties: - * - * - SCALE(xmax,ymax,xmax) = ymax - * - SCALE(xmax,ymax,0) = 0 - * - SCALE(xmax,ymax,SCALE(ymax,xmax,SCALE(xmax,ymax,x))) = SCALE(xmax,ymax,x) - * - * In addition, the rounding error is minimal and nicely distributed. - * The proofs are left as an exercise to the reader. - */ - -#define SCALE(xmax,ymax,x) (((x)*(ymax)+(xmax)/2)/(xmax)) - - -#endif /* _ACI_H_ */ diff --git a/sound/oss/ad1816.c b/sound/oss/ad1816.c deleted file mode 100644 index caabf31193f..00000000000 --- a/sound/oss/ad1816.c +++ /dev/null @@ -1,1368 +0,0 @@ -/* - * - * AD1816 lowlevel sound driver for Linux 2.6.0 and above - * - * Copyright (C) 1998-2003 by Thorsten Knabe <linux@thorsten-knabe.de> - * - * Based on the CS4232/AD1848 driver Copyright (C) by Hannu Savolainen 1993-1996 - * - * - * version: 1.5 - * status: beta - * date: 2003/07/15 - * - * Changes: - * Oleg Drokin: Some cleanup of load/unload functions. 1998/11/24 - * - * Thorsten Knabe: attach and unload rewritten, - * some argument checks added 1998/11/30 - * - * Thorsten Knabe: Buggy isa bridge workaround added 1999/01/16 - * - * David Moews/Thorsten Knabe: Introduced options - * parameter. Added slightly modified patch from - * David Moews to disable dsp audio sources by setting - * bit 0 of options parameter. This seems to be - * required by some Aztech/Newcom SC-16 cards. 1999/04/18 - * - * Christoph Hellwig: Adapted to module_init/module_exit. 2000/03/03 - * - * Christoph Hellwig: Added isapnp support 2000/03/15 - * - * Arnaldo Carvalho de Melo: get rid of check_region 2001/10/07 - * - * Thorsten Knabe: Compiling with CONFIG_PNP enabled - * works again. It is now possible to use more than one - * AD1816 sound card. Sample rate now may be changed during - * playback/capture. printk() uses log levels everywhere. - * SMP fixes. DMA handling fixes. - * Other minor code cleanup. 2003/07/15 - * - */ - - -#include <linux/module.h> -#include <linux/init.h> -#include <linux/interrupt.h> -#include <linux/isapnp.h> -#include <linux/stddef.h> -#include <linux/spinlock.h> -#include "sound_config.h" - -#define DEBUGNOISE(x) - -#define CHECK_FOR_POWER { int timeout=100; \ - while (timeout > 0 && (inb(devc->base)&0x80)!= 0x80) {\ - timeout--; \ - } \ - if (timeout==0) {\ - printk(KERN_WARNING "ad1816: Check for power failed in %s line: %d\n",__FILE__,__LINE__); \ - } \ -} - -/* structure to hold device specific information */ -typedef struct -{ - int base; /* set in attach */ - int irq; - int dma_playback; - int dma_capture; - - int opened; /* open */ - int speed; - int channels; - int audio_format; - int audio_mode; - - int recmask; /* setup */ - unsigned char format_bits; - int supported_devices; - int supported_rec_devices; - unsigned short levels[SOUND_MIXER_NRDEVICES]; - /* misc */ - struct pnp_dev *pnpdev; /* configured via pnp */ - int dev_no; /* this is the # in audio_devs and NOT - in ad1816_info */ - spinlock_t lock; -} ad1816_info; - -static int nr_ad1816_devs; -static int ad1816_clockfreq = 33000; -static int options; - -/* supported audio formats */ -static int ad_format_mask = -AFMT_U8 | AFMT_S16_LE | AFMT_S16_BE | AFMT_MU_LAW | AFMT_A_LAW; - -/* array of device info structures */ -static ad1816_info dev_info[MAX_AUDIO_DEV]; - - -/* ------------------------------------------------------------------- */ - -/* functions for easier access to inderect registers */ - -static int ad_read (ad1816_info * devc, int reg) -{ - int result; - - CHECK_FOR_POWER; - outb ((unsigned char) (reg & 0x3f), devc->base+0); - result = inb(devc->base+2); - result+= inb(devc->base+3)<<8; - return (result); -} - - -static void ad_write (ad1816_info * devc, int reg, int data) -{ - CHECK_FOR_POWER; - outb ((unsigned char) (reg & 0xff), devc->base+0); - outb ((unsigned char) (data & 0xff),devc->base+2); - outb ((unsigned char) ((data>>8)&0xff),devc->base+3); -} - -/* ------------------------------------------------------------------- */ - -/* function interface required by struct audio_driver */ - -static void ad1816_halt_input (int dev) -{ - unsigned long flags; - ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc; - unsigned char buffer; - - DEBUGNOISE(printk(KERN_DEBUG "ad1816: halt_input called\n")); - - spin_lock_irqsave(&devc->lock,flags); - - if(!isa_dma_bridge_buggy) { - disable_dma(audio_devs[dev]->dmap_in->dma); - } - - buffer=inb(devc->base+9); - if (buffer & 0x01) { - /* disable capture */ - outb(buffer & ~0x01,devc->base+9); - } - - if(!isa_dma_bridge_buggy) { - enable_dma(audio_devs[dev]->dmap_in->dma); - } - - /* Clear interrupt status */ - outb (~0x40, devc->base+1); - - devc->audio_mode &= ~PCM_ENABLE_INPUT; - spin_unlock_irqrestore(&devc->lock,flags); -} - -static void ad1816_halt_output (int dev) -{ - unsigned long flags; - ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc; - - unsigned char buffer; - - DEBUGNOISE(printk(KERN_DEBUG "ad1816: halt_output called!\n")); - - spin_lock_irqsave(&devc->lock,flags); - /* Mute pcm output */ - ad_write(devc, 4, ad_read(devc,4)|0x8080); - - if(!isa_dma_bridge_buggy) { - disable_dma(audio_devs[dev]->dmap_out->dma); - } - - buffer=inb(devc->base+8); - if (buffer & 0x01) { - /* disable capture */ - outb(buffer & ~0x01,devc->base+8); - } - - if(!isa_dma_bridge_buggy) { - enable_dma(audio_devs[dev]->dmap_out->dma); - } - - /* Clear interrupt status */ - outb ((unsigned char)~0x80, devc->base+1); - - devc->audio_mode &= ~PCM_ENABLE_OUTPUT; - spin_unlock_irqrestore(&devc->lock,flags); -} - -static void ad1816_output_block (int dev, unsigned long buf, - int count, int intrflag) -{ - unsigned long flags; - unsigned long cnt; - ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc; - - DEBUGNOISE(printk(KERN_DEBUG "ad1816: output_block called buf=%ld count=%d flags=%d\n",buf,count,intrflag)); - - cnt = count/4 - 1; - - spin_lock_irqsave(&devc->lock,flags); - - /* set transfer count */ - ad_write (devc, 8, cnt & 0xffff); - - devc->audio_mode |= PCM_ENABLE_OUTPUT; - spin_unlock_irqrestore(&devc->lock,flags); -} - - -static void ad1816_start_input (int dev, unsigned long buf, int count, - int intrflag) -{ - unsigned long flags; - unsigned long cnt; - ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc; - - DEBUGNOISE(printk(KERN_DEBUG "ad1816: start_input called buf=%ld count=%d flags=%d\n",buf,count,intrflag)); - - cnt = count/4 - 1; - - spin_lock_irqsave(&devc->lock,flags); - - /* set transfer count */ - ad_write (devc, 10, cnt & 0xffff); - devc->audio_mode |= PCM_ENABLE_INPUT; - spin_unlock_irqrestore(&devc->lock,flags); -} - -static int ad1816_prepare_for_input (int dev, int bsize, int bcount) -{ - unsigned long flags; - unsigned int freq; - ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc; - unsigned char fmt_bits; - - DEBUGNOISE(printk(KERN_DEBUG "ad1816: prepare_for_input called: bsize=%d bcount=%d\n",bsize,bcount)); - - spin_lock_irqsave(&devc->lock,flags); - fmt_bits= (devc->format_bits&0x7)<<3; - - /* set mono/stereo mode */ - if (devc->channels > 1) { - fmt_bits |=0x4; - } - /* set Mono/Stereo in playback/capture register */ - outb( (inb(devc->base+8) & ~0x3C)|fmt_bits, devc->base+8); - outb( (inb(devc->base+9) & ~0x3C)|fmt_bits, devc->base+9); - - freq=((unsigned int)devc->speed*33000)/ad1816_clockfreq; - - /* write playback/capture speeds */ - ad_write (devc, 2, freq & 0xffff); - ad_write (devc, 3, freq & 0xffff); - - spin_unlock_irqrestore(&devc->lock,flags); - - ad1816_halt_input(dev); - return 0; -} - -static int ad1816_prepare_for_output (int dev, int bsize, int bcount) -{ - unsigned long flags; - unsigned int freq; - ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc; - unsigned char fmt_bits; - - DEBUGNOISE(printk(KERN_DEBUG "ad1816: prepare_for_output called: bsize=%d bcount=%d\n",bsize,bcount)); - - spin_lock_irqsave(&devc->lock,flags); - - fmt_bits= (devc->format_bits&0x7)<<3; - /* set mono/stereo mode */ - if (devc->channels > 1) { - fmt_bits |=0x4; - } - - /* write format bits to playback/capture registers */ - outb( (inb(devc->base+8) & ~0x3C)|fmt_bits, devc->base+8); - outb( (inb(devc->base+9) & ~0x3C)|fmt_bits, devc->base+9); - - freq=((unsigned int)devc->speed*33000)/ad1816_clockfreq; - - /* write playback/capture speeds */ - ad_write (devc, 2, freq & 0xffff); - ad_write (devc, 3, freq & 0xffff); - - spin_unlock_irqrestore(&devc->lock,flags); - - ad1816_halt_output(dev); - return 0; - -} - -static void ad1816_trigger (int dev, int state) -{ - unsigned long flags; - ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc; - - DEBUGNOISE(printk(KERN_DEBUG "ad1816: trigger called! (devc=%d,devc->base=%d\n", devc, devc->base)); - - /* mode may have changed */ - - spin_lock_irqsave(&devc->lock,flags); - - /* mask out modes not specified on open call */ - state &= devc->audio_mode; - - /* setup soundchip to new io-mode */ - if (state & PCM_ENABLE_INPUT) { - /* enable capture */ - outb(inb(devc->base+9)|0x01, devc->base+9); - } else { - /* disable capture */ - outb(inb(devc->base+9)&~0x01, devc->base+9); - } - - if (state & PCM_ENABLE_OUTPUT) { - /* enable playback */ - outb(inb(devc->base+8)|0x01, devc->base+8); - /* unmute pcm output */ - ad_write(devc, 4, ad_read(devc,4)&~0x8080); - } else { - /* mute pcm output */ - ad_write(devc, 4, ad_read(devc,4)|0x8080); - /* disable capture */ - outb(inb(devc->base+8)&~0x01, devc->base+8); - } - spin_unlock_irqrestore(&devc->lock,flags); -} - - -/* halt input & output */ -static void ad1816_halt (int dev) -{ - ad1816_halt_input(dev); - ad1816_halt_output(dev); -} - -static void ad1816_reset (int dev) -{ - ad1816_halt (dev); -} - -/* set playback speed */ -static int ad1816_set_speed (int dev, int arg) -{ - unsigned long flags; - unsigned int freq; - int ret; - - ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc; - - spin_lock_irqsave(&devc->lock, flags); - if (arg == 0) { - ret = devc->speed; - spin_unlock_irqrestore(&devc->lock, flags); - return ret; - } - /* range checking */ - if (arg < 4000) { - arg = 4000; - } - if (arg > 55000) { - arg = 55000; - } - devc->speed = arg; - - /* change speed during playback */ - freq=((unsigned int)devc->speed*33000)/ad1816_clockfreq; - /* write playback/capture speeds */ - ad_write (devc, 2, freq & 0xffff); - ad_write (devc, 3, freq & 0xffff); - - ret = devc->speed; - spin_unlock_irqrestore(&devc->lock, flags); - return ret; - -} - -static unsigned int ad1816_set_bits (int dev, unsigned int arg) -{ - unsigned long flags; - ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc; - - static struct format_tbl { - int format; - unsigned char bits; - } format2bits[] = { - { 0, 0 }, - { AFMT_MU_LAW, 1 }, - { AFMT_A_LAW, 3 }, - { AFMT_IMA_ADPCM, 0 }, - { AFMT_U8, 0 }, - { AFMT_S16_LE, 2 }, - { AFMT_S16_BE, 6 }, - { AFMT_S8, 0 }, - { AFMT_U16_LE, 0 }, - { AFMT_U16_BE, 0 } - }; - - int i, n = sizeof (format2bits) / sizeof (struct format_tbl); - - spin_lock_irqsave(&devc->lock, flags); - /* return current format */ - if (arg == 0) { - arg = devc->audio_format; - spin_unlock_irqrestore(&devc->lock, flags); - return arg; - } - devc->audio_format = arg; - - /* search matching format bits */ - for (i = 0; i < n; i++) - if (format2bits[i].format == arg) { - devc->format_bits = format2bits[i].bits; - devc->audio_format = arg; - spin_unlock_irqrestore(&devc->lock, flags); - return arg; - } - - /* Still hanging here. Something must be terribly wrong */ - devc->format_bits = 0; - devc->audio_format = AFMT_U8; - spin_unlock_irqrestore(&devc->lock, flags); - return(AFMT_U8); -} - -static short ad1816_set_channels (int dev, short arg) -{ - ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc; - - if (arg != 1 && arg != 2) - return devc->channels; - - devc->channels = arg; - return arg; -} - -/* open device */ -static int ad1816_open (int dev, int mode) -{ - ad1816_info *devc = NULL; - unsigned long flags; - - /* is device number valid ? */ - if (dev < 0 || dev >= num_audiodevs) - return -(ENXIO); - - /* get device info of this dev */ - devc = (ad1816_info *) audio_devs[dev]->devc; - - /* make check if device already open atomic */ - spin_lock_irqsave(&devc->lock,flags); - - if (devc->opened) { - spin_unlock_irqrestore(&devc->lock,flags); - return -(EBUSY); - } - - /* mark device as open */ - devc->opened = 1; - - devc->audio_mode = 0; - devc->speed = 8000; - devc->audio_format=AFMT_U8; - devc->channels=1; - spin_unlock_irqrestore(&devc->lock,flags); - ad1816_reset(devc->dev_no); /* halt all pending output */ - return 0; -} - -static void ad1816_close (int dev) /* close device */ -{ - unsigned long flags; - ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc; - - /* halt all pending output */ - ad1816_reset(devc->dev_no); - - spin_lock_irqsave(&devc->lock,flags); - devc->opened = 0; - devc->audio_mode = 0; - devc->speed = 8000; - devc->audio_format=AFMT_U8; - devc->format_bits = 0; - spin_unlock_irqrestore(&devc->lock,flags); -} - - -/* ------------------------------------------------------------------- */ - -/* Audio driver structure */ - -static struct audio_driver ad1816_audio_driver = -{ - .owner = THIS_MODULE, - .open = ad1816_open, - .close = ad1816_close, - .output_block = ad1816_output_block, - .start_input = ad1816_start_input, - .prepare_for_input = ad1816_prepare_for_input, - .prepare_for_output = ad1816_prepare_for_output, - .halt_io = ad1816_halt, - .halt_input = ad1816_halt_input, - .halt_output = ad1816_halt_output, - .trigger = ad1816_trigger, - .set_speed = ad1816_set_speed, - .set_bits = ad1816_set_bits, - .set_channels = ad1816_set_channels, -}; - - -/* ------------------------------------------------------------------- */ - -/* Interrupt handler */ - - -static irqreturn_t ad1816_interrupt (int irq, void *dev_id) -{ - unsigned char status; - ad1816_info *devc = (ad1816_info *)dev_id; - - if (irq < 0 || irq > 15) { - printk(KERN_WARNING "ad1816: Got bogus interrupt %d\n", irq); - return IRQ_NONE; - } - - spin_lock(&devc->lock); - - /* read interrupt register */ - status = inb (devc->base+1); - /* Clear all interrupt */ - outb (~status, devc->base+1); - - DEBUGNOISE(printk(KERN_DEBUG "ad1816: Got interrupt subclass %d\n",status)); - - if (status == 0) { - DEBUGNOISE(printk(KERN_DEBUG "ad1816: interrupt: Got interrupt, but no source.\n")); - spin_unlock(&devc->lock); - return IRQ_NONE; - } - - if (devc->opened && (devc->audio_mode & PCM_ENABLE_INPUT) && (status&64)) - DMAbuf_inputintr (devc->dev_no); - - if (devc->opened && (devc->audio_mode & PCM_ENABLE_OUTPUT) && (status & 128)) - DMAbuf_outputintr (devc->dev_no, 1); - - spin_unlock(&devc->lock); - return IRQ_HANDLED; -} - -/* ------------------------------------------------------------------- */ - -/* Mixer stuff */ - -struct mixer_def { - unsigned int regno: 7; - unsigned int polarity:1; /* 0=normal, 1=reversed */ - unsigned int bitpos:4; - unsigned int nbits:4; -}; - -static char mix_cvt[101] = { - 0, 0, 3, 7,10,13,16,19,21,23,26,28,30,32,34,35,37,39,40,42, - 43,45,46,47,49,50,51,52,53,55,56,57,58,59,60,61,62,63,64,65, - 65,66,67,68,69,70,70,71,72,73,73,74,75,75,76,77,77,78,79,79, - 80,81,81,82,82,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90, - 91,91,92,92,93,93,94,94,95,95,96,96,96,97,97,98,98,98,99,99, - 100 -}; - -typedef struct mixer_def mixer_ent; - -/* - * Most of the mixer entries work in backwards. Setting the polarity field - * makes them to work correctly. - * - * The channel numbering used by individual soundcards is not fixed. Some - * cards have assigned different meanings for the AUX1, AUX2 and LINE inputs. - * The current version doesn't try to compensate this. - */ - -#define MIX_ENT(name, reg_l, pola_l, pos_l, len_l, reg_r, pola_r, pos_r, len_r) \ - {{reg_l, pola_l, pos_l, len_l}, {reg_r, pola_r, pos_r, len_r}} - - -static mixer_ent mix_devices[SOUND_MIXER_NRDEVICES][2] = { -MIX_ENT(SOUND_MIXER_VOLUME, 14, 1, 8, 5, 14, 1, 0, 5), -MIX_ENT(SOUND_MIXER_BASS, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_TREBLE, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_SYNTH, 5, 1, 8, 6, 5, 1, 0, 6), -MIX_ENT(SOUND_MIXER_PCM, 4, 1, 8, 6, 4, 1, 0, 6), -MIX_ENT(SOUND_MIXER_SPEAKER, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_LINE, 18, 1, 8, 5, 18, 1, 0, 5), -MIX_ENT(SOUND_MIXER_MIC, 19, 1, 8, 5, 19, 1, 0, 5), -MIX_ENT(SOUND_MIXER_CD, 15, 1, 8, 5, 15, 1, 0, 5), -MIX_ENT(SOUND_MIXER_IMIX, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_ALTPCM, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_RECLEV, 20, 0, 8, 4, 20, 0, 0, 4), -MIX_ENT(SOUND_MIXER_IGAIN, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_OGAIN, 0, 0, 0, 0, 0, 0, 0, 0), -MIX_ENT(SOUND_MIXER_LINE1, 17, 1, 8, 5, 17, 1, 0, 5), -MIX_ENT(SOUND_MIXER_LINE2, 16, 1, 8, 5, 16, 1, 0, 5), -MIX_ENT(SOUND_MIXER_LINE3, 39, 0, 9, 4, 39, 1, 0, 5) -}; - - -static unsigned short default_mixer_levels[SOUND_MIXER_NRDEVICES] = -{ - 0x4343, /* Master Volume */ - 0x3232, /* Bass */ - 0x3232, /* Treble */ - 0x0000, /* FM */ - 0x4343, /* PCM */ - 0x0000, /* PC Speaker */ - 0x0000, /* Ext Line */ - 0x0000, /* Mic */ - 0x0000, /* CD */ - 0x0000, /* Recording monitor */ - 0x0000, /* SB PCM */ - 0x0000, /* Recording level */ - 0x0000, /* Input gain */ - 0x0000, /* Output gain */ - 0x0000, /* Line1 */ - 0x0000, /* Line2 */ - 0x0000 /* Line3 (usually line in)*/ -}; - -#define LEFT_CHN 0 -#define RIGHT_CHN 1 - - - -static int -ad1816_set_recmask (ad1816_info * devc, int mask) -{ - unsigned long flags; - unsigned char recdev; - int i, n; - - spin_lock_irqsave(&devc->lock, flags); - mask &= devc->supported_rec_devices; - - n = 0; - /* Count selected device bits */ - for (i = 0; i < 32; i++) - if (mask & (1 << i)) - n++; - - if (n == 0) - mask = SOUND_MASK_MIC; - else if (n != 1) { /* Too many devices selected */ - /* Filter out active settings */ - mask &= ~devc->recmask; - - n = 0; - /* Count selected device bits */ - for (i = 0; i < 32; i++) - if (mask & (1 << i)) - n++; - - if (n != 1) - mask = SOUND_MASK_MIC; - } - - switch (mask) { - case SOUND_MASK_MIC: - recdev = 5; - break; - - case SOUND_MASK_LINE: - recdev = 0; - break; - - case SOUND_MASK_CD: - recdev = 2; - break; - - case SOUND_MASK_LINE1: - recdev = 4; - break; - - case SOUND_MASK_LINE2: - recdev = 3; - break; - - case SOUND_MASK_VOLUME: - recdev = 1; - break; - - default: - mask = SOUND_MASK_MIC; - recdev = 5; - } - - recdev <<= 4; - ad_write (devc, 20, - (ad_read (devc, 20) & 0x8f8f) | recdev | (recdev<<8)); - - devc->recmask = mask; - spin_unlock_irqrestore(&devc->lock, flags); - return mask; -} - -static void -change_bits (int *regval, int dev, int chn, int newval) -{ - unsigned char mask; - int shift; - - /* Reverse polarity*/ - - if (mix_devices[dev][chn].polarity == 1) - newval = 100 - newval; - - mask = (1 << mix_devices[dev][chn].nbits) - 1; - shift = mix_devices[dev][chn].bitpos; - /* Scale it */ - newval = (int) ((newval * mask) + 50) / 100; - /* Clear bits */ - *regval &= ~(mask << shift); - /* Set new value */ - *regval |= (newval & mask) << shift; -} - -static int -ad1816_mixer_get (ad1816_info * devc, int dev) -{ - DEBUGNOISE(printk(KERN_DEBUG "ad1816: mixer_get called!\n")); - - /* range check + supported mixer check */ - if (dev < 0 || dev >= SOUND_MIXER_NRDEVICES ) - return (-(EINVAL)); - if (!((1 << dev) & devc->supported_devices)) - return -(EINVAL); - - return devc->levels[dev]; -} - -static int -ad1816_mixer_set (ad1816_info * devc, int dev, int value) -{ - int left = value & 0x000000ff; - int right = (value & 0x0000ff00) >> 8; - int retvol; - - int regoffs; - int val; - int valmute; - unsigned long flags; - - DEBUGNOISE(printk(KERN_DEBUG "ad1816: mixer_set called!\n")); - - if (dev < 0 || dev >= SOUND_MIXER_NRDEVICES ) - return -(EINVAL); - - if (left > 100) - left = 100; - if (left < 0) - left = 0; - if (right > 100) - right = 100; - if (right < 0) - right = 0; - - /* Mono control */ - if (mix_devices[dev][RIGHT_CHN].nbits == 0) - right = left; - retvol = left | (right << 8); - - /* Scale it */ - - left = mix_cvt[left]; - right = mix_cvt[right]; - - /* reject all mixers that are not supported */ - if (!(devc->supported_devices & (1 << dev))) - return -(EINVAL); - - /* sanity check */ - if (mix_devices[dev][LEFT_CHN].nbits == 0) - return -(EINVAL); - spin_lock_irqsave(&devc->lock, flags); - - /* keep precise volume internal */ - devc->levels[dev] = retvol; - - /* Set the left channel */ - regoffs = mix_devices[dev][LEFT_CHN].regno; - val = ad_read (devc, regoffs); - change_bits (&val, dev, LEFT_CHN, left); - - valmute=val; - - /* Mute bit masking on some registers */ - if ( regoffs==5 || regoffs==14 || regoffs==15 || - regoffs==16 || regoffs==17 || regoffs==18 || - regoffs==19 || regoffs==39) { - if (left==0) - valmute |= 0x8000; - else - valmute &= ~0x8000; - } - ad_write (devc, regoffs, valmute); /* mute */ - - /* - * Set the right channel - */ - - /* Was just a mono channel */ - if (mix_devices[dev][RIGHT_CHN].nbits == 0) { - spin_unlock_irqrestore(&devc->lock, flags); - return retvol; - } - - regoffs = mix_devices[dev][RIGHT_CHN].regno; - val = ad_read (devc, regoffs); - change_bits (&val, dev, RIGHT_CHN, right); - - valmute=val; - if ( regoffs==5 || regoffs==14 || regoffs==15 || - regoffs==16 || regoffs==17 || regoffs==18 || - regoffs==19 || regoffs==39) { - if (right==0) - valmute |= 0x80; - else - valmute &= ~0x80; - } - ad_write (devc, regoffs, valmute); /* mute */ - spin_unlock_irqrestore(&devc->lock, flags); - return retvol; -} - -#define MIXER_DEVICES ( SOUND_MASK_VOLUME | \ - SOUND_MASK_SYNTH | \ - SOUND_MASK_PCM | \ - SOUND_MASK_LINE | \ - SOUND_MASK_LINE1 | \ - SOUND_MASK_LINE2 | \ - SOUND_MASK_LINE3 | \ - SOUND_MASK_MIC | \ - SOUND_MASK_CD | \ - SOUND_MASK_RECLEV \ - ) -#define REC_DEVICES ( SOUND_MASK_LINE2 |\ - SOUND_MASK_LINE |\ - SOUND_MASK_LINE1 |\ - SOUND_MASK_MIC |\ - SOUND_MASK_CD |\ - SOUND_MASK_VOLUME \ - ) - -static void -ad1816_mixer_reset (ad1816_info * devc) -{ - int i; - - devc->supported_devices = MIXER_DEVICES; - - devc->supported_rec_devices = REC_DEVICES; - - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) - if (devc->supported_devices & (1 << i)) - ad1816_mixer_set (devc, i, default_mixer_levels[i]); - ad1816_set_recmask (devc, SOUND_MASK_MIC); -} - -static int -ad1816_mixer_ioctl (int dev, unsigned int cmd, void __user * arg) -{ - ad1816_info *devc = mixer_devs[dev]->devc; - int val; - int __user *p = arg; - - DEBUGNOISE(printk(KERN_DEBUG "ad1816: mixer_ioctl called!\n")); - - /* Mixer ioctl */ - if (((cmd >> 8) & 0xff) == 'M') { - - /* set ioctl */ - if (_SIOC_DIR (cmd) & _SIOC_WRITE) { - switch (cmd & 0xff){ - case SOUND_MIXER_RECSRC: - - if (get_user(val, p)) - return -EFAULT; - val=ad1816_set_recmask (devc, val); - return put_user(val, p); - break; - - default: - if (get_user(val, p)) - return -EFAULT; - if ((val=ad1816_mixer_set (devc, cmd & 0xff, val))<0) - return val; - else - return put_user(val, p); - } - } else { - /* read ioctl */ - switch (cmd & 0xff) { - - case SOUND_MIXER_RECSRC: - val=devc->recmask; - return put_user(val, p); - break; - - case SOUND_MIXER_DEVMASK: - val=devc->supported_devices; - return put_user(val, p); - break; - - case SOUND_MIXER_STEREODEVS: - val=devc->supported_devices & ~(SOUND_MASK_SPEAKER | SOUND_MASK_IMIX); - return put_user(val, p); - break; - - case SOUND_MIXER_RECMASK: - val=devc->supported_rec_devices; - return put_user(val, p); - break; - - case SOUND_MIXER_CAPS: - val=SOUND_CAP_EXCL_INPUT; - return put_user(val, p); - break; - - default: - if ((val=ad1816_mixer_get (devc, cmd & 0xff))<0) - return val; - else - return put_user(val, p); - } - } - } else - /* not for mixer */ - return -(EINVAL); -} - -/* ------------------------------------------------------------------- */ - -/* Mixer structure */ - -static struct mixer_operations ad1816_mixer_operations = { - .owner = THIS_MODULE, - .id = "AD1816", - .name = "AD1816 Mixer", - .ioctl = ad1816_mixer_ioctl -}; - - -/* ------------------------------------------------------------------- */ - -/* stuff for card recognition, init and unloading PNP ...*/ - - -/* check if AD1816 present at specified hw_config and register device with OS - * return 1 if initialization was successful, 0 otherwise - */ -static int __init ad1816_init_card (struct address_info *hw_config, - struct pnp_dev *pnp) -{ - ad1816_info *devc = NULL; - int tmp; - int oss_devno = -1; - - printk(KERN_INFO "ad1816: initializing card: io=0x%x, irq=%d, dma=%d, " - "dma2=%d, clockfreq=%d, options=%d isadmabug=%d " - "%s\n", - hw_config->io_base, - hw_config->irq, - hw_config->dma, - hw_config->dma2, - ad1816_clockfreq, - options, - isa_dma_bridge_buggy, - pnp?"(PNP)":""); - - /* ad1816_info structure remaining ? */ - if (nr_ad1816_devs >= MAX_AUDIO_DEV) { - printk(KERN_WARNING "ad1816: no more ad1816_info structures " - "left\n"); - goto out; - } - - devc = &dev_info[nr_ad1816_devs]; - devc->base = hw_config->io_base; - devc->irq = hw_config->irq; - devc->dma_playback=hw_config->dma; - devc->dma_capture=hw_config->dma2; - devc->opened = 0; - devc->pnpdev = pnp; - spin_lock_init(&devc->lock); - - if (!request_region(devc->base, 16, "AD1816 Sound")) { - printk(KERN_WARNING "ad1816: I/O port 0x%03x not free\n", - devc->base); - goto out; - } - - printk(KERN_INFO "ad1816: Examining AD1816 at address 0x%03x.\n", - devc->base); - - - /* tests for ad1816 */ - /* base+0: bit 1 must be set but not 255 */ - tmp=inb(devc->base); - if ( (tmp&0x80)==0 || tmp==255 ) { - printk (KERN_INFO "ad1816: Chip is not an AD1816 or chip " - "is not active (Test 0)\n"); - goto out_release_region; - } - - /* writes to ireg 8 are copied to ireg 9 */ - ad_write(devc,8,12345); - if (ad_read(devc,9)!=12345) { - printk(KERN_INFO "ad1816: Chip is not an AD1816 (Test 1)\n"); - goto out_release_region; - } - - /* writes to ireg 8 are copied to ireg 9 */ - ad_write(devc,8,54321); - if (ad_read(devc,9)!=54321) { - printk(KERN_INFO "ad1816: Chip is not an AD1816 (Test 2)\n"); - goto out_release_region; - } - - /* writes to ireg 10 are copied to ireg 11 */ - ad_write(devc,10,54321); - if (ad_read(devc,11)!=54321) { - printk (KERN_INFO "ad1816: Chip is not an AD1816 (Test 3)\n"); - goto out_release_region; - } - - /* writes to ireg 10 are copied to ireg 11 */ - ad_write(devc,10,12345); - if (ad_read(devc,11)!=12345) { - printk (KERN_INFO "ad1816: Chip is not an AD1816 (Test 4)\n"); - goto out_release_region; - } - - /* bit in base +1 cannot be set to 1 */ - tmp=inb(devc->base+1); - outb(0xff,devc->base+1); - if (inb(devc->base+1)!=tmp) { - printk(KERN_INFO "ad1816: Chip is not an AD1816 (Test 5)\n"); - goto out_release_region; - } - - printk(KERN_INFO "ad1816: AD1816 (version %d) successfully detected!\n", - ad_read(devc,45)); - - /* disable all interrupts */ - ad_write(devc,1,0); - - /* Clear pending interrupts */ - outb (0, devc->base+1); - - /* allocate irq */ - if (devc->irq < 0 || devc->irq > 15) - goto out_release_region; - if (request_irq(devc->irq, ad1816_interrupt,0, - "SoundPort", devc) < 0) { - printk(KERN_WARNING "ad1816: IRQ in use\n"); - goto out_release_region; - } - - /* DMA stuff */ - if (sound_alloc_dma (devc->dma_playback, "Sound System")) { - printk(KERN_WARNING "ad1816: Can't allocate DMA%d\n", - devc->dma_playback); - goto out_free_irq; - } - - if ( devc->dma_capture >= 0 && - devc->dma_capture != devc->dma_playback) { - if (sound_alloc_dma(devc->dma_capture, - "Sound System (capture)")) { - printk(KERN_WARNING "ad1816: Can't allocate DMA%d\n", - devc->dma_capture); - goto out_free_dma; - } - devc->audio_mode=DMA_AUTOMODE|DMA_DUPLEX; - } else { - printk(KERN_WARNING "ad1816: Only one DMA channel " - "available/configured. No duplex operation possible\n"); - devc->audio_mode=DMA_AUTOMODE; - } - - conf_printf2 ("AD1816 audio driver", - devc->base, devc->irq, devc->dma_playback, - devc->dma_capture); - - /* register device */ - if ((oss_devno = sound_install_audiodrv (AUDIO_DRIVER_VERSION, - "AD1816 audio driver", - &ad1816_audio_driver, - sizeof (struct audio_driver), - devc->audio_mode, - ad_format_mask, - devc, - devc->dma_playback, - devc->dma_capture)) < 0) { - printk(KERN_WARNING "ad1816: Can't install sound driver\n"); - goto out_free_dma_2; - } - - - ad_write(devc,32,0x80f0); /* sound system mode */ - if (options&1) { - ad_write(devc,33,0); /* disable all audiosources for dsp */ - } else { - ad_write(devc,33,0x03f8); /* enable all audiosources for dsp */ - } - ad_write(devc,4,0x8080); /* default values for volumes (muted)*/ - ad_write(devc,5,0x8080); - ad_write(devc,6,0x8080); - ad_write(devc,7,0x8080); - ad_write(devc,15,0x8888); - ad_write(devc,16,0x8888); - ad_write(devc,17,0x8888); - ad_write(devc,18,0x8888); - ad_write(devc,19,0xc888); /* +20db mic active */ - ad_write(devc,14,0x0000); /* Master volume unmuted */ - ad_write(devc,39,0x009f); /* 3D effect on 0% phone out muted */ - ad_write(devc,44,0x0080); /* everything on power, 3d enabled for d/a */ - outb(0x10,devc->base+8); /* set dma mode */ - outb(0x10,devc->base+9); - - /* enable capture + playback interrupt */ - ad_write(devc,1,0xc000); - - /* set mixer defaults */ - ad1816_mixer_reset (devc); - - /* register mixer */ - if ((audio_devs[oss_devno]->mixer_dev=sound_install_mixer( - MIXER_DRIVER_VERSION, - "AD1816 audio driver", - &ad1816_mixer_operations, - sizeof (struct mixer_operations), - devc)) < 0) { - printk(KERN_WARNING "Can't install mixer\n"); - } - /* make ad1816_info active */ - nr_ad1816_devs++; - printk(KERN_INFO "ad1816: card successfully installed!\n"); - return 1; - /* error handling */ -out_free_dma_2: - if (devc->dma_capture >= 0 && devc->dma_capture != devc->dma_playback) - sound_free_dma(devc->dma_capture); -out_free_dma: - sound_free_dma(devc->dma_playback); -out_free_irq: - free_irq(devc->irq, devc); -out_release_region: - release_region(devc->base, 16); -out: - return 0; -} - -static void __exit unload_card(ad1816_info *devc) -{ - int mixer, dev = 0; - - if (devc != NULL) { - printk("ad1816: Unloading card at address 0x%03x\n",devc->base); - - dev = devc->dev_no; - mixer = audio_devs[dev]->mixer_dev; - - /* unreg mixer*/ - if(mixer>=0) { - sound_unload_mixerdev(mixer); - } - /* unreg audiodev */ - sound_unload_audiodev(dev); - - /* free dma channels */ - if (devc->dma_capture>=0 && - devc->dma_capture != devc->dma_playback) { - sound_free_dma(devc->dma_capture); - } - sound_free_dma (devc->dma_playback); - /* free irq */ - free_irq(devc->irq, devc); - /* free io */ - release_region (devc->base, 16); -#ifdef __ISAPNP__ - if (devc->pnpdev) { - pnp_disable_dev(devc->pnpdev); - pnp_device_detach(devc->pnpdev); - } -#endif - - } else - printk(KERN_WARNING "ad1816: no device/card specified\n"); -} - -static int __initdata io = -1; -static int __initdata irq = -1; -static int __initdata dma = -1; -static int __initdata dma2 = -1; - -#ifdef __ISAPNP__ -/* use isapnp for configuration */ -static int isapnp = 1; -static int isapnpjump; -module_param(isapnp, bool, 0); -module_param(isapnpjump, int, 0); -#endif - -module_param(io, int, 0); -module_param(irq, int, 0); -module_param(dma, int, 0); -module_param(dma2, int, 0); -module_param(ad1816_clockfreq, int, 0); -module_param(options, int, 0); - -#ifdef __ISAPNP__ -static struct { - unsigned short card_vendor, card_device; - unsigned short vendor; - unsigned short function; - struct ad1816_data *data; -} isapnp_ad1816_list[] __initdata = { - { ISAPNP_ANY_ID, ISAPNP_ANY_ID, - ISAPNP_VENDOR('A','D','S'), ISAPNP_FUNCTION(0x7150), - NULL }, - { ISAPNP_ANY_ID, ISAPNP_ANY_ID, - ISAPNP_VENDOR('A','D','S'), ISAPNP_FUNCTION(0x7180), - NULL }, - {0} -}; - -MODULE_DEVICE_TABLE(isapnp, isapnp_ad1816_list); - - -static void __init ad1816_config_pnp_card(struct pnp_card *card, - unsigned short vendor, - unsigned short function) -{ - struct address_info cfg; - struct pnp_dev *card_dev = pnp_find_dev(card, vendor, function, NULL); - if (!card_dev) return; - if (pnp_device_attach(card_dev) < 0) { - printk(KERN_WARNING "ad1816: Failed to attach PnP device\n"); - return; - } - if (pnp_activate_dev(card_dev) < 0) { - printk(KERN_WARNING "ad1816: Failed to activate PnP device\n"); - pnp_device_detach(card_dev); - return; - } - cfg.io_base = pnp_port_start(card_dev, 2); - cfg.irq = pnp_irq(card_dev, 0); - cfg.dma = pnp_irq(card_dev, 0); - cfg.dma2 = pnp_irq(card_dev, 1); - if (!ad1816_init_card(&cfg, card_dev)) { - pnp_disable_dev(card_dev); - pnp_device_detach(card_dev); - } -} - -static void __init ad1816_config_pnp_cards(void) -{ - int nr_pnp_cfg; - int i; - - /* Count entries in isapnp_ad1816_list */ - for (nr_pnp_cfg = 0; isapnp_ad1816_list[nr_pnp_cfg].card_vendor != 0; - nr_pnp_cfg++); - /* Check and adjust isapnpjump */ - if( isapnpjump < 0 || isapnpjump >= nr_pnp_cfg) { - printk(KERN_WARNING - "ad1816: Valid range for isapnpjump is 0-%d. " - "Adjusted to 0.\n", nr_pnp_cfg-1); - isapnpjump = 0; - } - for (i = isapnpjump; isapnp_ad1816_list[i].card_vendor != 0; i++) { - struct pnp_card *card = NULL; - /* iterate over all pnp cards */ - while ((card = pnp_find_card(isapnp_ad1816_list[i].card_vendor, - isapnp_ad1816_list[i].card_device, card))) - ad1816_config_pnp_card(card, - isapnp_ad1816_list[i].vendor, - isapnp_ad1816_list[i].function); - } -} -#endif - -/* module initialization */ -static int __init init_ad1816(void) -{ - printk(KERN_INFO "ad1816: AD1816 sounddriver " - "Copyright (C) 1998-2003 by Thorsten Knabe and " - "others\n"); -#ifdef AD1816_CLOCK - /* set ad1816_clockfreq if set during compilation */ - ad1816_clockfreq=AD1816_CLOCK; -#endif - if (ad1816_clockfreq<5000 || ad1816_clockfreq>100000) { - ad1816_clockfreq=33000; - } - -#ifdef __ISAPNP__ - /* configure PnP cards */ - if(isapnp) ad1816_config_pnp_cards(); -#endif - /* configure card by module params */ - if (io != -1 && irq != -1 && dma != -1) { - struct address_info cfg; - cfg.io_base = io; - cfg.irq = irq; - cfg.dma = dma; - cfg.dma2 = dma2; - ad1816_init_card(&cfg, NULL); - } - if (nr_ad1816_devs <= 0) - return -ENODEV; - return 0; -} - -/* module cleanup */ -static void __exit cleanup_ad1816 (void) -{ - int i; - ad1816_info *devc = NULL; - - /* remove any soundcard */ - for (i = 0; i < nr_ad1816_devs; i++) { - devc = &dev_info[i]; - unload_card(devc); - } - nr_ad1816_devs=0; - printk(KERN_INFO "ad1816: driver unloaded!\n"); -} - -module_init(init_ad1816); -module_exit(cleanup_ad1816); - -#ifndef MODULE -/* kernel command line parameter evaluation */ -static int __init setup_ad1816(char *str) -{ - /* io, irq, dma, dma2 */ - int ints[5]; - - str = get_options(str, ARRAY_SIZE(ints), ints); - - io = ints[1]; - irq = ints[2]; - dma = ints[3]; - dma2 = ints[4]; - return 1; -} - -__setup("ad1816=", setup_ad1816); -#endif -MODULE_LICENSE("GPL"); diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c deleted file mode 100644 index c0730a3563a..00000000000 --- a/sound/oss/ad1889.c +++ /dev/null @@ -1,1101 +0,0 @@ -/* - * Copyright 2001-2004 Randolph Chung <tausq@debian.org> - * - * Analog Devices 1889 PCI audio driver (AD1819 AC97-compatible codec) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Notes: - * 1. Only flat DMA is supported; s-g is not supported right now - * - * -<jsm> tausq: Anyway, to set up sample rates for D to A, you just use the sample rate on the codec. For A to D, you need to set the codec always to 48K (using the split sample rate feature on the codec) and then set the resampler on the AD1889 to the sample rate you want. -<jsm> Also, when changing the sample rate on the codec you need to power it down and re power it up for the change to take effect! - * - * $Id: ad1889.c,v 1.3 2002/10/19 21:31:44 grundler Exp $ - */ -#include <linux/module.h> -#include <linux/init.h> -#include <linux/ioport.h> -#include <linux/pci.h> -#include <linux/poll.h> -#include <linux/proc_fs.h> -#include <linux/slab.h> -#include <linux/soundcard.h> -#include <linux/ac97_codec.h> -#include <linux/sound.h> -#include <linux/interrupt.h> -#include <linux/mutex.h> - -#include <asm/delay.h> -#include <asm/io.h> -#include <asm/dma.h> -#include <asm/uaccess.h> - -#include "ad1889.h" - -#define DBG(fmt, arg...) printk(fmt, ##arg) -#define DEVNAME "ad1889" - -#define NR_HW_CH 4 -#define DAC_RUNNING 1 -#define ADC_RUNNING 2 - -#define UNDERRUN(dev) (0) - -#define AD1889_READW(dev,reg) readw(dev->regbase + reg) -#define AD1889_WRITEW(dev,reg,val) writew((val), dev->regbase + reg) -#define AD1889_READL(dev,reg) readl(dev->regbase + reg) -#define AD1889_WRITEL(dev,reg,val) writel((val), dev->regbase + reg) - -//now 100ms -/* #define WAIT_10MS() schedule_timeout(HZ/10) */ -#define WAIT_10MS() do { int __i; for (__i = 0; __i < 100; __i++) udelay(1000); } while(0) - -/* currently only support a single device */ -static ad1889_dev_t *ad1889_dev = NULL; - -/************************* helper routines ***************************** */ -static inline void ad1889_set_wav_rate(ad1889_dev_t *dev, int rate) -{ - struct ac97_codec *ac97_codec = dev->ac97_codec; - - DBG("Setting WAV rate to %d\n", rate); - dev->state[AD_WAV_STATE].dmabuf.rate = rate; - AD1889_WRITEW(dev, AD_DS_WAS, rate); - - /* Cycle the DAC to enable the new rate */ - ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200); - WAIT_10MS(); - ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0); -} - -static inline void ad1889_set_wav_fmt(ad1889_dev_t *dev, int fmt) -{ - u16 tmp; - - DBG("Setting WAV format to 0x%x\n", fmt); - - tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC); - if (fmt & AFMT_S16_LE) { - //tmp |= 0x0100; /* set WA16 */ - tmp |= 0x0300; /* set WA16 stereo */ - } else if (fmt & AFMT_U8) { - tmp &= ~0x0100; /* clear WA16 */ - } - AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp); -} - -static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt) -{ - u16 tmp; - - DBG("Setting ADC format to 0x%x\n", fmt); - - tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC); - if (fmt & AFMT_S16_LE) { - tmp |= 0x0100; /* set WA16 */ - } else if (fmt & AFMT_U8) { - tmp &= ~0x0100; /* clear WA16 */ - } - AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp); -} - -static void ad1889_start_wav(ad1889_state_t *state) -{ - unsigned long flags; - struct dmabuf *dmabuf = &state->dmabuf; - int cnt; - u16 tmp; - - spin_lock_irqsave(&state->card->lock, flags); - - if (dmabuf->dma_len) /* DMA already in flight */ - goto skip_dma; - - /* setup dma */ - cnt = dmabuf->wr_ptr - dmabuf->rd_ptr; - if (cnt == 0) /* done - don't need to do anything */ - goto skip_dma; - - /* If the wr_ptr has wrapped, only map to the end */ - if (cnt < 0) - cnt = DMA_SIZE - dmabuf->rd_ptr; - - dmabuf->dma_handle = pci_map_single(ad1889_dev->pci, - dmabuf->rawbuf + dmabuf->rd_ptr, - cnt, PCI_DMA_TODEVICE); - dmabuf->dma_len = cnt; - dmabuf->ready = 1; - - DBG("Starting playback at 0x%p for %ld bytes\n", dmabuf->rawbuf + - dmabuf->rd_ptr, dmabuf->dma_len); - - /* load up the current register set */ - AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCC, cnt); - AD1889_WRITEL(ad1889_dev, AD_DMA_WAVICC, cnt); - AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCA, dmabuf->dma_handle); - - /* TODO: for now we load the base registers with the same thing */ - AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBC, cnt); - AD1889_WRITEL(ad1889_dev, AD_DMA_WAVIBC, cnt); - AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBA, dmabuf->dma_handle); - - /* and we're off to the races... */ - AD1889_WRITEL(ad1889_dev, AD_DMA_CHSS, 0x8); - tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC); - tmp |= 0x0400; /* set WAEN */ - AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp); - (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */ - - dmabuf->enable |= DAC_RUNNING; - -skip_dma: - spin_unlock_irqrestore(&state->card->lock, flags); -} - - -static void ad1889_stop_wav(ad1889_state_t *state) -{ - unsigned long flags; - struct dmabuf *dmabuf = &state->dmabuf; - - spin_lock_irqsave(&state->card->lock, flags); - - if (dmabuf->enable & DAC_RUNNING) { - u16 tmp; - unsigned long cnt = dmabuf->dma_len; - - tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC); - tmp &= ~0x0400; /* clear WAEN */ - AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp); - (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */ - pci_unmap_single(ad1889_dev->pci, dmabuf->dma_handle, - cnt, PCI_DMA_TODEVICE); - - dmabuf->enable &= ~DAC_RUNNING; - - /* update dma pointers */ - dmabuf->rd_ptr += cnt; - dmabuf->rd_ptr &= (DMA_SIZE - 1); - - dmabuf->dma_handle = 0; - dmabuf->dma_len = 0; - dmabuf->ready = 0; - - wake_up(&dmabuf->wait); - } - - spin_unlock_irqrestore(&state->card->lock, flags); -} - - -#if 0 -static void ad1889_startstop_adc(ad1889_state_t *state, int start) -{ - u16 tmp; - unsigned long flags; - - spin_lock_irqsave(&state->card->lock, flags); - - tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC); - if (start) { - state->dmabuf.enable |= ADC_RUNNING; - tmp |= 0x0004; /* set ADEN */ - } else { - state->dmabuf.enable &= ~ADC_RUNNING; - tmp &= ~0x0004; /* clear ADEN */ - } - AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp); - - spin_unlock_irqrestore(&state->card->lock, flags); -} -#endif - -static ad1889_dev_t *ad1889_alloc_dev(struct pci_dev *pci) -{ - ad1889_dev_t *dev; - struct dmabuf *dmabuf; - int i; - - if ((dev = kzalloc(sizeof(ad1889_dev_t), GFP_KERNEL)) == NULL) - return NULL; - spin_lock_init(&dev->lock); - dev->pci = pci; - - for (i = 0; i < AD_MAX_STATES; i++) { - dev->state[i].card = dev; - mutex_init(&dev->state[i].mutex); - init_waitqueue_head(&dev->state[i].dmabuf.wait); - } - - /* allocate dma buffer */ - - for (i = 0; i < AD_MAX_STATES; i++) { - dmabuf = &dev->state[i].dmabuf; - dmabuf->rawbuf = kmalloc(DMA_SIZE, GFP_KERNEL|GFP_DMA); - if (!dmabuf->rawbuf) - goto err_free_dmabuf; - dmabuf->rawbuf_size = DMA_SIZE; - dmabuf->dma_handle = 0; - dmabuf->rd_ptr = dmabuf->wr_ptr = dmabuf->dma_len = 0UL; - dmabuf->ready = 0; - dmabuf->rate = 48000; - } - return dev; - -err_free_dmabuf: - while (--i >= 0) - kfree(dev->state[i].dmabuf.rawbuf); - kfree(dev); - return NULL; -} - -static void ad1889_free_dev(ad1889_dev_t *dev) -{ - int j; - struct dmabuf *dmabuf; - - if (dev == NULL) - return; - - if (dev->ac97_codec) - ac97_release_codec(dev->ac97_codec); - - for (j = 0; j < AD_MAX_STATES; j++) { - dmabuf = &dev->state[j].dmabuf; - kfree(dmabuf->rawbuf); - } - - kfree(dev); -} - -static inline void ad1889_trigger_playback(ad1889_dev_t *dev) -{ -#if 0 - u32 val; - struct dmabuf *dmabuf = &dev->state[AD_WAV_STATE].dmabuf; -#endif - - ad1889_start_wav(&dev->state[AD_WAV_STATE]); -} - -static int ad1889_read_proc (char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - char *out = page; - int len, i; - ad1889_dev_t *dev = data; - ad1889_reg_t regs[] = { - { "WSMC", AD_DS_WSMC, 16 }, - { "RAMC", AD_DS_RAMC, 16 }, - { "WADA", AD_DS_WADA, 16 }, - { "SYDA", AD_DS_SYDA, 16 }, - { "WAS", AD_DS_WAS, 16 }, - { "RES", AD_DS_RES, 16 }, - { "CCS", AD_DS_CCS, 16 }, - { "ADCBA", AD_DMA_ADCBA, 32 }, - { "ADCCA", AD_DMA_ADCCA, 32 }, - { "ADCBC", AD_DMA_ADCBC, 32 }, - { "ADCCC", AD_DMA_ADCCC, 32 }, - { "ADCIBC", AD_DMA_ADCIBC, 32 }, - { "ADCICC", AD_DMA_ADCICC, 32 }, - { "ADCCTRL", AD_DMA_ADCCTRL, 16 }, - { "WAVBA", AD_DMA_WAVBA, 32 }, - { "WAVCA", AD_DMA_WAVCA, 32 }, - { "WAVBC", AD_DMA_WAVBC, 32 }, - { "WAVCC", AD_DMA_WAVCC, 32 }, - { "WAVIBC", AD_DMA_WAVIBC, 32 }, - { "WAVICC", AD_DMA_WAVICC, 32 }, - { "WAVCTRL", AD_DMA_WAVCTRL, 16 }, - { "DISR", AD_DMA_DISR, 32 }, - { "CHSS", AD_DMA_CHSS, 32 }, - { "IPC", AD_GPIO_IPC, 16 }, - { "OP", AD_GPIO_OP, 16 }, - { "IP", AD_GPIO_IP, 16 }, - { "ACIC", AD_AC97_ACIC, 16 }, - { "AC97_RESET", AD_AC97_BASE + AC97_RESET, 16 }, - { "AC97_MASTER_VOL_STEREO", AD_AC97_BASE + AC97_MASTER_VOL_STEREO, 16 }, - { "AC97_HEADPHONE_VOL", AD_AC97_BASE + AC97_HEADPHONE_VOL, 16 }, - { "AC97_MASTER_VOL_MONO", AD_AC97_BASE + AC97_MASTER_VOL_MONO, 16 }, - { "AC97_MASTER_TONE", AD_AC97_BASE + AC97_MASTER_TONE, 16 }, - { "AC97_PCBEEP_VOL", AD_AC97_BASE + AC97_PCBEEP_VOL, 16 }, - { "AC97_PHONE_VOL", AD_AC97_BASE + AC97_PHONE_VOL, 16 }, - { "AC97_MIC_VOL", AD_AC97_BASE + AC97_MIC_VOL, 16 }, - { "AC97_LINEIN_VOL", AD_AC97_BASE + AC97_LINEIN_VOL, 16 }, - { "AC97_CD_VOL", AD_AC97_BASE + AC97_CD_VOL, 16 }, - { "AC97_VIDEO_VOL", AD_AC97_BASE + AC97_VIDEO_VOL, 16 }, - { "AC97_AUX_VOL", AD_AC97_BASE + AC97_AUX_VOL, 16 }, - { "AC97_PCMOUT_VOL", AD_AC97_BASE + AC97_PCMOUT_VOL, 16 }, - { "AC97_RECORD_SELECT", AD_AC97_BASE + AC97_RECORD_SELECT, 16 }, - { "AC97_RECORD_GAIN", AD_AC97_BASE + AC97_RECORD_GAIN, 16 }, - { "AC97_RECORD_GAIN_MIC", AD_AC97_BASE + AC97_RECORD_GAIN_MIC, 16 }, - { "AC97_GENERAL_PURPOSE", AD_AC97_BASE + AC97_GENERAL_PURPOSE, 16 }, - { "AC97_3D_CONTROL", AD_AC97_BASE + AC97_3D_CONTROL, 16 }, - { "AC97_MODEM_RATE", AD_AC97_BASE + AC97_MODEM_RATE, 16 }, - { "AC97_POWER_CONTROL", AD_AC97_BASE + AC97_POWER_CONTROL, 16 }, - { NULL } - }; - - if (dev == NULL) - return -ENODEV; - - for (i = 0; regs[i].name != 0; i++) - out += sprintf(out, "%s: 0x%0*x\n", regs[i].name, - regs[i].width >> 2, - (regs[i].width == 16 - ? AD1889_READW(dev, regs[i].offset) - : AD1889_READL(dev, regs[i].offset))); - - for (i = 0; i < AD_MAX_STATES; i++) { - out += sprintf(out, "DMA status for %s:\n", - (i == AD_WAV_STATE ? "WAV" : "ADC")); - out += sprintf(out, "\t\t0x%p (IOVA: 0x%llu)\n", - dev->state[i].dmabuf.rawbuf, - (unsigned long long)dev->state[i].dmabuf.dma_handle); - - out += sprintf(out, "\tread ptr: offset %u\n", - (unsigned int)dev->state[i].dmabuf.rd_ptr); - out += sprintf(out, "\twrite ptr: offset %u\n", - (unsigned int)dev->state[i].dmabuf.wr_ptr); - out += sprintf(out, "\tdma len: offset %u\n", - (unsigned int)dev->state[i].dmabuf.dma_len); - } - - len = out - page - off; - if (len < count) { - *eof = 1; - if (len <= 0) return 0; - } else { - len = count; - } - *start = page + off; - return len; -} - -/***************************** DMA interfaces ************************** */ -#if 0 -static inline unsigned long ad1889_get_dma_addr(ad1889_state_t *state) -{ - struct dmabuf *dmabuf = &state->dmabuf; - u32 offset; - - if (!(dmabuf->enable & (DAC_RUNNING | ADC_RUNNING))) { - printk(KERN_ERR DEVNAME ": get_dma_addr called without dma enabled\n"); - return 0; - } - - if (dmabuf->enable & DAC_RUNNING) - offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_WAVBA)); - else - offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_ADCBA)); - - return (unsigned long)bus_to_virt((unsigned long)offset) - (unsigned long)dmabuf->rawbuf; -} - -static void ad1889_update_ptr(ad1889_dev_t *dev, int wake) -{ - ad1889_state_t *state; - struct dmabuf *dmabuf; - unsigned long hwptr; - int diff; - - /* check ADC first */ - state = &dev->adc_state; - dmabuf = &state->dmabuf; - if (dmabuf->enable & ADC_RUNNING) { - hwptr = ad1889_get_dma_addr(state); - diff = (dmabuf->dmasize + hwptr - dmabuf->hwptr) % dmabuf->dmasize; - - dmabuf->hwptr = hwptr; - dmabuf->total_bytes += diff; - dmabuf->count += diff; - if (dmabuf->count > dmabuf->dmasize) - dmabuf->count = dmabuf->dmasize; - - if (dmabuf->mapped) { - if (wake & dmabuf->count >= dmabuf->fragsize) - wake_up(&dmabuf->wait); - } else { - if (wake & dmabuf->count > 0) - wake_up(&dmabuf->wait); - } - } - - /* check DAC */ - state = &dev->wav_state; - dmabuf = &state->dmabuf; - if (dmabuf->enable & DAC_RUNNING) { -XXX - -} -#endif - -/************************* /dev/dsp interfaces ************************* */ - -static ssize_t ad1889_read(struct file *file, char __user *buffer, size_t count, - loff_t *ppos) -{ - return 0; -} - -static ssize_t ad1889_write(struct file *file, const char __user *buffer, size_t count, - loff_t *ppos) -{ - ad1889_dev_t *dev = (ad1889_dev_t *)file->private_data; - ad1889_state_t *state = &dev->state[AD_WAV_STATE]; - volatile struct dmabuf *dmabuf = &state->dmabuf; - ssize_t ret = 0; - DECLARE_WAITQUEUE(wait, current); - - mutex_lock(&state->mutex); -#if 0 - if (dmabuf->mapped) { - ret = -ENXIO; - goto err1; - } -#endif - if (!access_ok(VERIFY_READ, buffer, count)) { - ret = -EFAULT; - goto err1; - } - - add_wait_queue(&state->dmabuf.wait, &wait); - - /* start filling dma buffer.... */ - while (count > 0) { - long rem; - long cnt = count; - unsigned long flags; - - for (;;) { - long used_bytes; - long timeout; /* max time for DMA in jiffies */ - - /* buffer is full if wr catches up to rd */ - spin_lock_irqsave(&state->card->lock, flags); - used_bytes = dmabuf->wr_ptr - dmabuf->rd_ptr; - timeout = (dmabuf->dma_len * HZ) / dmabuf->rate; - spin_unlock_irqrestore(&state->card->lock, flags); - - /* adjust for buffer wrap around */ - used_bytes = (used_bytes + DMA_SIZE) & (DMA_SIZE - 1); - - /* If at least one page unused */ - if (used_bytes < (DMA_SIZE - 0x1000)) - break; - - /* dma buffer full */ - - if (file->f_flags & O_NONBLOCK) { - ret = -EAGAIN; - goto err2; - } - - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(timeout + 1); - if (signal_pending(current)) { - ret = -ERESTARTSYS; - goto err2; - } - } - - /* watch out for wrapping around static buffer */ - spin_lock_irqsave(&state->card->lock, flags); - rem = DMA_SIZE - dmabuf->wr_ptr; - if (cnt > rem) - cnt = rem; - - rem = dmabuf->wr_ptr; - - /* update dma pointers */ - dmabuf->wr_ptr += cnt; - dmabuf->wr_ptr &= DMA_SIZE - 1; /* wrap ptr if necessary */ - spin_unlock_irqrestore(&state->card->lock, flags); - - /* transfer unwrapped chunk */ - if (copy_from_user(dmabuf->rawbuf + rem, buffer, cnt)) { - ret = -EFAULT; - goto err2; - } - - DBG("Writing 0x%lx bytes to +0x%lx\n", cnt, rem); - - /* update counters */ - count -= cnt; - buffer += cnt; - ret += cnt; - - /* we have something to play - go play it! */ - ad1889_trigger_playback(dev); - } - -err2: - remove_wait_queue(&state->dmabuf.wait, &wait); -err1: - mutex_unlock(&state->mutex); - return ret; -} - -static unsigned int ad1889_poll(struct file *file, struct poll_table_struct *wait) -{ - unsigned int mask = 0; -#if 0 - ad1889_dev_t *dev = (ad1889_dev_t *)file->private_data; - ad1889_state_t *state = NULL; - struct dmabuf *dmabuf; - unsigned long flags; - - if (!(file->f_mode & (FMODE_READ | FMODE_WRITE))) - return -EINVAL; - - if (file->f_mode & FMODE_WRITE) { - state = &dev->state[AD_WAV_STATE]; - if (!state) return 0; - dmabuf = &state->dmabuf; - poll_wait(file, &dmabuf->wait, wait); - } - - if (file->f_mode & FMODE_READ) { - state = &dev->state[AD_ADC_STATE]; - if (!state) return 0; - dmabuf = &state->dmabuf; - poll_wait(file, &dmabuf->wait, wait); - } - - spin_lock_irqsave(&dev->lock, flags); - ad1889_update_ptr(dev, 0); - - if (file->f_mode & FMODE_WRITE) { - state = &dev->state[WAV_STATE]; - dmabuf = &state->dmabuf; - if (dmabuf->mapped) { - if (dmabuf->count >= (int)dmabuf->fragsize) - mask |= POLLOUT | POLLWRNORM; - } else { - if ((int)dmabuf->dmasize >= dmabuf->count + - (int)dmabuf->fragsize) - mask |= POLLOUT | POLLWRNORM; - } - } - - if (file ->f_mode & FMODE_READ) { - state = &dev->state[AD_ADC_STATE]; - dmabuf = &state->dmabuf; - if (dmabuf->count >= (int)dmabuf->fragsize) - mask |= POLLIN | POLLRDNORM; - } - spin_unlock_irqrestore(&dev->lock, flags); - -#endif - return mask; -} - -static int ad1889_mmap(struct file *file, struct vm_area_struct *vma) -{ - return 0; -} - -static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd, - unsigned long arg) -{ - int val = 0; - ad1889_dev_t *dev = (ad1889_dev_t *)file->private_data; - struct dmabuf *dmabuf; - audio_buf_info abinfo; - int __user *p = (int __user *)arg; - - DBG("ad1889_ioctl cmd 0x%x arg %lu\n", cmd, arg); - - switch (cmd) - { - case OSS_GETVERSION: - return put_user(SOUND_VERSION, p); - - case SNDCTL_DSP_RESET: - break; - - case SNDCTL_DSP_SYNC: - break; - - case SNDCTL_DSP_SPEED: - /* set sampling rate */ - if (get_user(val, p)) - return -EFAULT; - if (val > 5400 && val < 48000) - { - if (file->f_mode & FMODE_WRITE) - AD1889_WRITEW(ad1889_dev, AD_DS_WAS, val); - if (file->f_mode & FMODE_READ) - AD1889_WRITEW(ad1889_dev, AD_DS_RES, val); - } - return 0; - - case SNDCTL_DSP_STEREO: /* undocumented? */ - if (get_user(val, p)) - return -EFAULT; - if (file->f_mode & FMODE_READ) { - val = AD1889_READW(ad1889_dev, AD_DS_WSMC); - if (val) { - val |= 0x0200; /* set WAST */ - } else { - val &= ~0x0200; /* clear WAST */ - } - AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, val); - } - if (file->f_mode & FMODE_WRITE) { - val = AD1889_READW(ad1889_dev, AD_DS_RAMC); - if (val) { - val |= 0x0002; /* set ADST */ - } else { - val &= ~0x0002; /* clear ADST */ - } - AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, val); - } - - return 0; - - case SNDCTL_DSP_GETBLKSIZE: - return put_user(DMA_SIZE, p); - - case SNDCTL_DSP_GETFMTS: - return put_user(AFMT_S16_LE|AFMT_U8, p); - - case SNDCTL_DSP_SETFMT: - if (get_user(val, p)) - return -EFAULT; - - if (val == 0) { - if (file->f_mode & FMODE_READ) - ad1889_set_adc_fmt(dev, val); - - if (file->f_mode & FMODE_WRITE) - ad1889_set_wav_fmt(dev, val); - } else { - val = AFMT_S16_LE | AFMT_U8; - } - - return put_user(val, p); - - case SNDCTL_DSP_CHANNELS: - break; - - case SNDCTL_DSP_POST: - /* send all data to device */ - break; - - case SNDCTL_DSP_SUBDIVIDE: - break; - - case SNDCTL_DSP_SETFRAGMENT: - /* not supported; uses fixed fragment sizes */ - return put_user(DMA_SIZE, p); - - case SNDCTL_DSP_GETOSPACE: - case SNDCTL_DSP_GETISPACE: - /* space left in dma buffers */ - if (cmd == SNDCTL_DSP_GETOSPACE) - dmabuf = &dev->state[AD_WAV_STATE].dmabuf; - else - dmabuf = &dev->state[AD_ADC_STATE].dmabuf; - abinfo.fragments = 1; - abinfo.fragstotal = 1; - abinfo.fragsize = DMA_SIZE; - abinfo.bytes = DMA_SIZE; - return copy_to_user(p, &abinfo, sizeof(abinfo)) ? -EFAULT : 0; - case SNDCTL_DSP_NONBLOCK: - file->f_flags |= O_NONBLOCK; - return 0; - - case SNDCTL_DSP_GETCAPS: - return put_user(0, p); - - case SNDCTL_DSP_GETTRIGGER: - case SNDCTL_DSP_SETTRIGGER: - break; - - case SNDCTL_DSP_GETIPTR: - case SNDCTL_DSP_GETOPTR: - break; - - case SNDCTL_DSP_SETDUPLEX: - break; - - case SNDCTL_DSP_GETODELAY: - break; - - case SOUND_PCM_READ_RATE: - return put_user(AD1889_READW(ad1889_dev, AD_DS_WAS), p); - - case SOUND_PCM_READ_CHANNELS: - case SOUND_PCM_READ_BITS: - break; - - case SNDCTL_DSP_MAPINBUF: - case SNDCTL_DSP_MAPOUTBUF: - case SNDCTL_DSP_SETSYNCRO: - case SOUND_PCM_WRITE_FILTER: - case SOUND_PCM_READ_FILTER: - break; - - default: - break; - } - - return -ENOTTY; -} - -static int ad1889_open(struct inode *inode, struct file *file) -{ - /* check minor; only support /dev/dsp atm */ - if (iminor(inode) != 3) - return -ENXIO; - - file->private_data = ad1889_dev; - - ad1889_set_wav_rate(ad1889_dev, 48000); - ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE); - AD1889_WRITEW(ad1889_dev, AD_DS_WADA, 0x0404); /* attenuation */ - return nonseekable_open(inode, file); -} - -static int ad1889_release(struct inode *inode, struct file *file) -{ - /* if we have state free it here */ - return 0; -} - -static const struct file_operations ad1889_fops = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .read = ad1889_read, - .write = ad1889_write, - .poll = ad1889_poll, - .ioctl = ad1889_ioctl, - .mmap = ad1889_mmap, - .open = ad1889_open, - .release = ad1889_release, -}; - -/************************* /dev/mixer interfaces ************************ */ -static int ad1889_mixer_open(struct inode *inode, struct file *file) -{ - if (ad1889_dev->ac97_codec->dev_mixer != iminor(inode)) - return -ENODEV; - - file->private_data = ad1889_dev->ac97_codec; - return 0; -} - -static int ad1889_mixer_release(struct inode *inode, struct file *file) -{ - return 0; -} - -static int ad1889_mixer_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct ac97_codec *codec = (struct ac97_codec *)file->private_data; - return codec->mixer_ioctl(codec, cmd, arg); -} - -static const struct file_operations ad1889_mixer_fops = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .ioctl = ad1889_mixer_ioctl, - .open = ad1889_mixer_open, - .release = ad1889_mixer_release, -}; - -/************************* AC97 interfaces ****************************** */ -static void ad1889_codec_write(struct ac97_codec *ac97, u8 reg, u16 val) -{ - ad1889_dev_t *dev = ac97->private_data; - - //DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + AD_AC97_BASE + reg); - AD1889_WRITEW(dev, AD_AC97_BASE + reg, val); -} - -static u16 ad1889_codec_read(struct ac97_codec *ac97, u8 reg) -{ - ad1889_dev_t *dev = ac97->private_data; - //DBG("Reading from 0x%lx\n", dev->regbase + AD_AC97_BASE + reg); - return AD1889_READW(dev, AD_AC97_BASE + reg); -} - -static int ad1889_ac97_init(ad1889_dev_t *dev, int id) -{ - struct ac97_codec *ac97; - u16 eid; - - if ((ac97 = ac97_alloc_codec()) == NULL) - return -ENOMEM; - - ac97->private_data = dev; - ac97->id = id; - - ac97->codec_read = ad1889_codec_read; - ac97->codec_write = ad1889_codec_write; - - if (ac97_probe_codec(ac97) == 0) { - printk(DEVNAME ": ac97_probe_codec failed\n"); - goto out_free; - } - - eid = ad1889_codec_read(ac97, AC97_EXTENDED_ID); - if (eid == 0xffff) { - printk(KERN_WARNING DEVNAME ": no codec attached?\n"); - goto out_free; - } - - dev->ac97_features = eid; - - if ((ac97->dev_mixer = register_sound_mixer(&ad1889_mixer_fops, -1)) < 0) { - printk(KERN_ERR DEVNAME ": cannot register mixer\n"); - goto out_free; - } - - dev->ac97_codec = ac97; - return 0; - -out_free: - ac97_release_codec(ac97); - return -ENODEV; -} - -static int ad1889_aclink_reset(struct pci_dev * pcidev) -{ - u16 stat; - int retry = 200; - ad1889_dev_t *dev = pci_get_drvdata(pcidev); - - AD1889_WRITEW(dev, AD_DS_CCS, 0x8000); /* turn on clock */ - AD1889_READW(dev, AD_DS_CCS); - - WAIT_10MS(); - - stat = AD1889_READW(dev, AD_AC97_ACIC); - stat |= 0x0002; /* Reset Disable */ - AD1889_WRITEW(dev, AD_AC97_ACIC, stat); - (void) AD1889_READW(dev, AD_AC97_ACIC); /* flush posted write */ - - udelay(10); - - stat = AD1889_READW(dev, AD_AC97_ACIC); - stat |= 0x0001; /* Interface Enable */ - AD1889_WRITEW(dev, AD_AC97_ACIC, stat); - - do { - if (AD1889_READW(dev, AD_AC97_ACIC) & 0x8000) /* Ready */ - break; - WAIT_10MS(); - retry--; - } while (retry > 0); - - if (!retry) { - printk(KERN_ERR "ad1889_aclink_reset: codec is not ready [0x%x]\n", - AD1889_READW(dev, AD_AC97_ACIC)); - return -EBUSY; - } - - /* TODO reset AC97 codec */ - /* TODO set wave/adc pci ctrl status */ - - stat = AD1889_READW(dev, AD_AC97_ACIC); - stat |= 0x0004; /* Audio Stream Output Enable */ - AD1889_WRITEW(dev, AD_AC97_ACIC, stat); - return 0; -} - -/************************* PCI interfaces ****************************** */ -/* PCI device table */ -static struct pci_device_id ad1889_id_tbl[] = { - { PCI_VENDOR_ID_ANALOG_DEVICES, PCI_DEVICE_ID_AD1889JS, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, (unsigned long)DEVNAME }, - { }, -}; -MODULE_DEVICE_TABLE(pci, ad1889_id_tbl); - -static irqreturn_t ad1889_interrupt(int irq, void *dev_id) -{ - u32 stat; - ad1889_dev_t *dev = (ad1889_dev_t *)dev_id; - - stat = AD1889_READL(dev, AD_DMA_DISR); - - /* clear ISR */ - AD1889_WRITEL(dev, AD_DMA_DISR, stat); - - if (stat & 0x8) { /* WAVI */ - DBG("WAV interrupt\n"); - dev->stats.wav_intrs++; - if (dev->state[AD_WAV_STATE].dmabuf.ready) { - ad1889_stop_wav(&dev->state[AD_WAV_STATE]); /* clean up */ - ad1889_start_wav(&dev->state[AD_WAV_STATE]); /* start new */ - } - } - - if ((stat & 0x2) && dev->state[AD_ADC_STATE].dmabuf.ready) { /* ADCI */ - DBG("ADC interrupt\n"); - dev->stats.adc_intrs++; - } - if(stat) - return IRQ_HANDLED; - return IRQ_NONE; -} - -static void ad1889_initcfg(ad1889_dev_t *dev) -{ - u16 tmp16; - u32 tmp32; - - /* make sure the interrupt bits are setup the way we want */ - tmp32 = AD1889_READL(dev, AD_DMA_WAVCTRL); - tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */ - tmp32 |= 0x6; /* intr on count, loop */ - AD1889_WRITEL(dev, AD_DMA_WAVCTRL, tmp32); - - /* unmute... */ - tmp16 = AD1889_READW(dev, AD_DS_WADA); - tmp16 &= ~0x8080; - AD1889_WRITEW(dev, AD_DS_WADA, tmp16); -} - -static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) -{ - int err; - ad1889_dev_t *dev; - unsigned long bar; - struct proc_dir_entry *proc_root = NULL; - - if ((err = pci_enable_device(pcidev)) != 0) { - printk(KERN_ERR DEVNAME ": pci_enable_device failed\n"); - return err; - } - - pci_set_master(pcidev); - if ((dev = ad1889_alloc_dev(pcidev)) == NULL) { - printk(KERN_ERR DEVNAME ": cannot allocate memory for device\n"); - return -ENOMEM; - } - pci_set_drvdata(pcidev, dev); - bar = pci_resource_start(pcidev, 0); - - if (!(pci_resource_flags(pcidev, 0) & IORESOURCE_MEM)) { - printk(KERN_ERR DEVNAME ": memory region not assigned\n"); - goto out1; - } - - if (pci_request_region(pcidev, 0, DEVNAME)) { - printk(KERN_ERR DEVNAME ": unable to request memory region\n"); - goto out1; - } - - dev->regbase = ioremap_nocache(bar, AD_DS_IOMEMSIZE); - if (!dev->regbase) { - printk(KERN_ERR DEVNAME ": unable to remap iomem\n"); - goto out2; - } - - if (request_irq(pcidev->irq, ad1889_interrupt, IRQF_SHARED, DEVNAME, dev) != 0) { - printk(KERN_ERR DEVNAME ": unable to request interrupt\n"); - goto out3; - } - - printk(KERN_INFO DEVNAME ": %s at %p IRQ %d\n", - (char *)ent->driver_data, dev->regbase, pcidev->irq); - - if (ad1889_aclink_reset(pcidev) != 0) - goto out4; - - /* register /dev/dsp */ - if ((dev->dev_audio = register_sound_dsp(&ad1889_fops, -1)) < 0) { - printk(KERN_ERR DEVNAME ": cannot register /dev/dsp\n"); - goto out4; - } - - if ((err = ad1889_ac97_init(dev, 0)) != 0) - goto out5; - - /* XXX: cleanups */ - if (((proc_root = proc_mkdir("driver/ad1889", NULL)) == NULL) || - create_proc_read_entry("ac97", S_IFREG|S_IRUGO, proc_root, ac97_read_proc, dev->ac97_codec) == NULL || - create_proc_read_entry("info", S_IFREG|S_IRUGO, proc_root, ad1889_read_proc, dev) == NULL) - goto out5; - - ad1889_initcfg(dev); - - //DBG(DEVNAME ": Driver initialization done!\n"); - - ad1889_dev = dev; - - return 0; - -out5: - unregister_sound_dsp(dev->dev_audio); -out4: - free_irq(pcidev->irq, dev); -out3: - iounmap(dev->regbase); -out2: - pci_release_region(pcidev, 0); -out1: - ad1889_free_dev(dev); - pci_set_drvdata(pcidev, NULL); - - return -ENODEV; -} - -static void __devexit ad1889_remove(struct pci_dev *pcidev) -{ - ad1889_dev_t *dev = pci_get_drvdata(pcidev); - - if (dev == NULL) return; - - unregister_sound_mixer(dev->ac97_codec->dev_mixer); - unregister_sound_dsp(dev->dev_audio); - free_irq(pcidev->irq, dev); - iounmap(dev->regbase); - pci_release_region(pcidev, 0); - - /* any hw programming needed? */ - ad1889_free_dev(dev); - pci_set_drvdata(pcidev, NULL); -} - -MODULE_AUTHOR("Randolph Chung"); -MODULE_DESCRIPTION("Analog Devices AD1889 PCI Audio"); -MODULE_LICENSE("GPL"); - -static struct pci_driver ad1889_driver = { - .name = DEVNAME, - .id_table = ad1889_id_tbl, - .probe = ad1889_probe, - .remove = __devexit_p(ad1889_remove), -}; - -static int __init ad1889_init_module(void) -{ - return pci_register_driver(&ad1889_driver); -} - -static void ad1889_exit_module(void) -{ - pci_unregister_driver(&ad1889_driver); - return; -} - -module_init(ad1889_init_module); -module_exit(ad1889_exit_module); diff --git a/sound/oss/ad1889.h b/sound/oss/ad1889.h deleted file mode 100644 index 09913765967..00000000000 --- a/sound/oss/ad1889.h +++ /dev/null @@ -1,135 +0,0 @@ -#ifndef _AD1889_H_ -#define _AD1889_H_ - -#define AD_DS_WSMC 0x00 /* DMA input wave/syn mixer control */ -#define AD_DS_RAMC 0x02 /* DMA output resamp/ADC mixer control */ -#define AD_DS_WADA 0x04 /* DMA input wave attenuation */ -#define AD_DS_SYDA 0x06 /* DMA input syn attentuation */ -#define AD_DS_WAS 0x08 /* wave input sample rate */ -#define AD_DS_RES 0x0a /* resampler output sample rate */ -#define AD_DS_CCS 0x0c /* chip control/status */ - -#define AD_DMA_RESBA 0x40 /* RES base addr */ -#define AD_DMA_RESCA 0x44 /* RES current addr */ -#define AD_DMA_RESBC 0x48 /* RES base cnt */ -#define AD_DMA_RESCC 0x4c /* RES current count */ -#define AD_DMA_ADCBA 0x50 /* ADC */ -#define AD_DMA_ADCCA 0x54 -#define AD_DMA_ADCBC 0x58 -#define AD_DMA_ADCCC 0x5c -#define AD_DMA_SYNBA 0x60 /* SYN */ -#define AD_DMA_SYNCA 0x64 -#define AD_DMA_SYNBC 0x68 -#define AD_DMA_SYNCC 0x6c -#define AD_DMA_WAVBA 0x70 /* WAV */ -#define AD_DMA_WAVCA 0x74 -#define AD_DMA_WAVBC 0x78 -#define AD_DMA_WAVCC 0x7c -#define AD_DMA_RESICC 0x80 /* RES interrupt current count */ -#define AD_DMA_RESIBC 0x84 /* RES interrupt base count */ -#define AD_DMA_ADCICC 0x88 /* ADC interrupt current count */ -#define AD_DMA_ADCIBC 0x8c /* ADC interrupt base count */ -#define AD_DMA_SYNICC 0x90 /* SYN interrupt current count */ -#define AD_DMA_SYNIBC 0x94 /* SYN interrupt base count */ -#define AD_DMA_WAVICC 0x98 /* WAV interrupt current count */ -#define AD_DMA_WAVIBC 0x9c /* WAV interrupt base count */ -#define AD_DMA_RESCTRL 0xa0 /* RES PCI control/status */ -#define AD_DMA_ADCCTRL 0xa8 /* ADC PCI control/status */ -#define AD_DMA_SYNCTRL 0xb0 /* SYN PCI control/status */ -#define AD_DMA_WAVCTRL 0xb8 /* WAV PCI control/status */ -#define AD_DMA_DISR 0xc0 /* PCI DMA intr status */ -#define AD_DMA_CHSS 0xc4 /* PCI DMA channel stop status */ - -#define AD_GPIO_IPC 0xc8 /* IO port ctrl */ -#define AD_GPIO_OP 0xca /* IO output status */ -#define AD_GPIO_IP 0xcc /* IO input status */ - -/* AC97 registers, 0x100 - 0x17f; see ac97.h */ -#define AD_AC97_BASE 0x100 /* ac97 base register */ -#define AD_AC97_ACIC 0x180 /* AC Link interface ctrl */ - -/* OPL3; BAR1 */ -#define AD_OPL_M0AS 0x00 /* Music0 address/status */ -#define AD_OPL_M0DATA 0x01 /* Music0 data */ -#define AD_OPL_M1A 0x02 /* Music1 address */ -#define AD_OPL_M1DATA 0x03 /* Music1 data */ -/* 0x04-0x0f reserved */ - -/* MIDI; BAR2 */ -#define AD_MIDA 0x00 /* MIDI data */ -#define AD_MISC 0x01 /* MIDI status/cmd */ -/* 0x02-0xff reserved */ - -#define AD_DS_IOMEMSIZE 512 -#define AD_OPL_MEMSIZE 16 -#define AD_MIDI_MEMSIZE 16 - -#define AD_WAV_STATE 0 -#define AD_ADC_STATE 1 -#define AD_MAX_STATES 2 - -#define DMA_SIZE (128*1024) - -#define DMA_FLAG_MAPPED 1 - -struct ad1889_dev; - -typedef struct ad1889_state { - struct ad1889_dev *card; - - mode_t open_mode; - struct dmabuf { - unsigned int rate; - unsigned char fmt, enable; - - /* buf management */ - size_t rawbuf_size; - void *rawbuf; - dma_addr_t dma_handle; /* mapped address */ - unsigned long dma_len; /* number of bytes mapped */ - - /* indexes into rawbuf for setting up DMA engine */ - volatile unsigned long rd_ptr, wr_ptr; - - wait_queue_head_t wait; /* to wait for buf servicing */ - - /* OSS bits */ - unsigned int mapped:1; - unsigned int ready:1; - unsigned int ossfragshift; - int ossmaxfrags; - unsigned int subdivision; - } dmabuf; - - struct mutex mutex; -} ad1889_state_t; - -typedef struct ad1889_dev { - void __iomem *regbase; - struct pci_dev *pci; - - spinlock_t lock; - - int dev_audio; - - /* states; one per channel; right now only WAV and ADC */ - struct ad1889_state state[AD_MAX_STATES]; - - /* AC97 codec */ - struct ac97_codec *ac97_codec; - u16 ac97_features; - - /* debugging stuff */ - struct stats { - unsigned int wav_intrs, adc_intrs; - unsigned int blocks, underrun, error; - } stats; -} ad1889_dev_t; - -typedef struct ad1889_reg { - const char *name; - int offset; - int width; -} ad1889_reg_t; - -#endif diff --git a/sound/oss/adlib_card.c b/sound/oss/adlib_card.c deleted file mode 100644 index c9a7c9b470d..00000000000 --- a/sound/oss/adlib_card.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * sound/oss/adlib_card.c - * - * Detection routine for the AdLib card. - * - * Copyright (C) by Hannu Savolainen 1993-1997 - * - * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL) - * Version 2 (June 1991). See the "COPYING" file distributed with this software - * for more info. - */ - -#include <linux/module.h> -#include <linux/init.h> - -#include "sound_config.h" - -#include "opl3.h" - -static void __init attach_adlib_card(struct address_info *hw_config) -{ - hw_config->slots[0] = opl3_init(hw_config->io_base, hw_config->osp, THIS_MODULE); -} - -static int __init probe_adlib(struct address_info *hw_config) -{ - return opl3_detect(hw_config->io_base, hw_config->osp); -} - -static struct address_info cfg; - -static int __initdata io = -1; - -module_param(io, int, 0); - -static int __init init_adlib(void) -{ - cfg.io_base = io; - - if (cfg.io_base == -1) { - printk(KERN_ERR "adlib: must specify I/O address.\n"); - return -EINVAL; - } - if (probe_adlib(&cfg) == 0) - return -ENODEV; - attach_adlib_card(&cfg); - - return 0; -} - -static void __exit cleanup_adlib(void) -{ - sound_unload_synthdev(cfg.slots[0]); - -} - -module_init(init_adlib); -module_exit(cleanup_adlib); - -#ifndef MODULE -static int __init setup_adlib(char *str) -{ - /* io */ - int ints[2]; - str = get_options(str, ARRAY_SIZE(ints), ints); - - io = ints[1]; - - return 1; -} -__setup("adlib=", setup_adlib); -#endif -MODULE_LICENSE("GPL"); diff --git a/sound/oss/cs461x.h b/sound/oss/cs461x.h deleted file mode 100644 index 0ce41338e6d..00000000000 --- a/sound/oss/cs461x.h +++ /dev/null @@ -1,1691 +0,0 @@ -#ifndef __CS461X_H -#define __CS461X_H - -/* - * Copyright (c) by Cirrus Logic Corporation <pcaudio@crystal.cirrus.com> - * Copyright (c) by Jaroslav Kysela <perex@suse.cz> - * Definitions for Cirrus Logic CS461x chips - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#ifndef PCI_VENDOR_ID_CIRRUS -#define PCI_VENDOR_ID_CIRRUS 0x1013 -#endif -#ifndef PCI_DEVICE_ID_CIRRUS_4610 -#define PCI_DEVICE_ID_CIRRUS_4610 0x6001 -#endif -#ifndef PCI_DEVICE_ID_CIRRUS_4612 -#define PCI_DEVICE_ID_CIRRUS_4612 0x6003 -#endif -#ifndef PCI_DEVICE_ID_CIRRUS_4615 -#define PCI_DEVICE_ID_CIRRUS_4615 0x6004 -#endif - -/* - * Direct registers - */ - -/* - * The following define the offsets of the registers accessed via base address - * register zero on the CS461x part. - */ -#define BA0_HISR 0x00000000 -#define BA0_HSR0 0x00000004 -#define BA0_HICR 0x00000008 -#define BA0_DMSR 0x00000100 -#define BA0_HSAR 0x00000110 -#define BA0_HDAR 0x00000114 -#define BA0_HDMR 0x00000118 -#define BA0_HDCR 0x0000011C -#define BA0_PFMC 0x00000200 -#define BA0_PFCV1 0x00000204 -#define BA0_PFCV2 0x00000208 -#define BA0_PCICFG00 0x00000300 -#define BA0_PCICFG04 0x00000304 -#define BA0_PCICFG08 0x00000308 -#define BA0_PCICFG0C 0x0000030C -#define BA0_PCICFG10 0x00000310 -#define BA0_PCICFG14 0x00000314 -#define BA0_PCICFG18 0x00000318 -#define BA0_PCICFG1C 0x0000031C -#define BA0_PCICFG20 0x00000320 -#define BA0_PCICFG24 0x00000324 -#define BA0_PCICFG28 0x00000328 -#define BA0_PCICFG2C 0x0000032C -#define BA0_PCICFG30 0x00000330 -#define BA0_PCICFG34 0x00000334 -#define BA0_PCICFG38 0x00000338 -#define BA0_PCICFG3C 0x0000033C -#define BA0_CLKCR1 0x00000400 -#define BA0_CLKCR2 0x00000404 -#define BA0_PLLM 0x00000408 -#define BA0_PLLCC 0x0000040C -#define BA0_FRR 0x00000410 -#define BA0_CFL1 0x00000414 -#define BA0_CFL2 0x00000418 -#define BA0_SERMC1 0x00000420 -#define BA0_SERMC2 0x00000424 -#define BA0_SERC1 0x00000428 -#define BA0_SERC2 0x0000042C -#define BA0_SERC3 0x00000430 -#define BA0_SERC4 0x00000434 -#define BA0_SERC5 0x00000438 -#define BA0_SERBSP 0x0000043C -#define BA0_SERBST 0x00000440 -#define BA0_SERBCM 0x00000444 -#define BA0_SERBAD 0x00000448 -#define BA0_SERBCF 0x0000044C -#define BA0_SERBWP 0x00000450 -#define BA0_SERBRP 0x00000454 -#ifndef NO_CS4612 -#define BA0_ASER_FADDR 0x00000458 -#endif -#define BA0_ACCTL 0x00000460 -#define BA0_ACSTS 0x00000464 -#define BA0_ACOSV 0x00000468 -#define BA0_ACCAD 0x0000046C -#define BA0_ACCDA 0x00000470 -#define BA0_ACISV 0x00000474 -#define BA0_ACSAD 0x00000478 -#define BA0_ACSDA 0x0000047C -#define BA0_JSPT 0x00000480 -#define BA0_JSCTL 0x00000484 -#define BA0_JSC1 0x00000488 -#define BA0_JSC2 0x0000048C -#define BA0_MIDCR 0x00000490 -#define BA0_MIDSR 0x00000494 -#define BA0_MIDWP 0x00000498 -#define BA0_MIDRP 0x0000049C -#define BA0_JSIO 0x000004A0 -#ifndef NO_CS4612 -#define BA0_ASER_MASTER 0x000004A4 -#endif -#define BA0_CFGI 0x000004B0 -#define BA0_SSVID 0x000004B4 -#define BA0_GPIOR 0x000004B8 -#ifndef NO_CS4612 -#define BA0_EGPIODR 0x000004BC -#define BA0_EGPIOPTR 0x000004C0 -#define BA0_EGPIOTR 0x000004C4 -#define BA0_EGPIOWR 0x000004C8 -#define BA0_EGPIOSR 0x000004CC -#define BA0_SERC6 0x000004D0 -#define BA0_SERC7 0x000004D4 -#define BA0_SERACC 0x000004D8 -#define BA0_ACCTL2 0x000004E0 -#define BA0_ACSTS2 0x000004E4 -#define BA0_ACOSV2 0x000004E8 -#define BA0_ACCAD2 0x000004EC -#define BA0_ACCDA2 0x000004F0 -#define BA0_ACISV2 0x000004F4 -#define BA0_ACSAD2 0x000004F8 -#define BA0_ACSDA2 0x000004FC -#define BA0_IOTAC0 0x00000500 -#define BA0_IOTAC1 0x00000504 -#define BA0_IOTAC2 0x00000508 -#define BA0_IOTAC3 0x0000050C -#define BA0_IOTAC4 0x00000510 -#define BA0_IOTAC5 0x00000514 -#define BA0_IOTAC6 0x00000518 -#define BA0_IOTAC7 0x0000051C -#define BA0_IOTAC8 0x00000520 -#define BA0_IOTAC9 0x00000524 -#define BA0_IOTAC10 0x00000528 -#define BA0_IOTAC11 0x0000052C -#define BA0_IOTFR0 0x00000540 -#define BA0_IOTFR1 0x00000544 -#define BA0_IOTFR2 0x00000548 -#define BA0_IOTFR3 0x0000054C -#define BA0_IOTFR4 0x00000550 -#define BA0_IOTFR5 0x00000554 -#define BA0_IOTFR6 0x00000558 -#define BA0_IOTFR7 0x0000055C -#define BA0_IOTFIFO 0x00000580 -#define BA0_IOTRRD 0x00000584 -#define BA0_IOTFP 0x00000588 -#define BA0_IOTCR 0x0000058C -#define BA0_DPCID 0x00000590 -#define BA0_DPCIA 0x00000594 -#define BA0_DPCIC 0x00000598 -#define BA0_PCPCIR 0x00000600 -#define BA0_PCPCIG 0x00000604 -#define BA0_PCPCIEN 0x00000608 -#define BA0_EPCIPMC 0x00000610 -#endif - -/* - * The following define the offsets of the registers and memories accessed via - * base address register one on the CS461x part. - */ -#define BA1_SP_DMEM0 0x00000000 -#define BA1_SP_DMEM1 0x00010000 -#define BA1_SP_PMEM 0x00020000 -#define BA1_SP_REG 0x00030000 -#define BA1_SPCR 0x00030000 -#define BA1_DREG 0x00030004 -#define BA1_DSRWP 0x00030008 -#define BA1_TWPR 0x0003000C -#define BA1_SPWR 0x00030010 -#define BA1_SPIR 0x00030014 -#define BA1_FGR1 0x00030020 -#define BA1_SPCS 0x00030028 -#define BA1_SDSR 0x0003002C -#define BA1_FRMT 0x00030030 -#define BA1_FRCC 0x00030034 -#define BA1_FRSC 0x00030038 -#define BA1_OMNI_MEM 0x000E0000 - -/* - * The following defines are for the flags in the host interrupt status - * register. - */ -#define HISR_VC_MASK 0x0000FFFF -#define HISR_VC0 0x00000001 -#define HISR_VC1 0x00000002 -#define HISR_VC2 0x00000004 -#define HISR_VC3 0x00000008 -#define HISR_VC4 0x00000010 -#define HISR_VC5 0x00000020 -#define HISR_VC6 0x00000040 -#define HISR_VC7 0x00000080 -#define HISR_VC8 0x00000100 -#define HISR_VC9 0x00000200 -#define HISR_VC10 0x00000400 -#define HISR_VC11 0x00000800 -#define HISR_VC12 0x00001000 -#define HISR_VC13 0x00002000 -#define HISR_VC14 0x00004000 -#define HISR_VC15 0x00008000 -#define HISR_INT0 0x00010000 -#define HISR_INT1 0x00020000 -#define HISR_DMAI 0x00040000 -#define HISR_FROVR 0x00080000 -#define HISR_MIDI 0x00100000 -#ifdef NO_CS4612 -#define HISR_RESERVED 0x0FE00000 -#else -#define HISR_SBINT 0x00200000 -#define HISR_RESERVED 0x0FC00000 -#endif -#define HISR_H0P 0x40000000 -#define HISR_INTENA 0x80000000 - -/* - * The following defines are for the flags in the host signal register 0. - */ -#define HSR0_VC_MASK 0xFFFFFFFF -#define HSR0_VC16 0x00000001 -#define HSR0_VC17 0x00000002 -#define HSR0_VC18 0x00000004 -#define HSR0_VC19 0x00000008 -#define HSR0_VC20 0x00000010 -#define HSR0_VC21 0x00000020 -#define HSR0_VC22 0x00000040 -#define HSR0_VC23 0x00000080 -#define HSR0_VC24 0x00000100 -#define HSR0_VC25 0x00000200 -#define HSR0_VC26 0x00000400 -#define HSR0_VC27 0x00000800 -#define HSR0_VC28 0x00001000 -#define HSR0_VC29 0x00002000 -#define HSR0_VC30 0x00004000 -#define HSR0_VC31 0x00008000 -#define HSR0_VC32 0x00010000 -#define HSR0_VC33 0x00020000 -#define HSR0_VC34 0x00040000 -#define HSR0_VC35 0x00080000 -#define HSR0_VC36 0x00100000 -#define HSR0_VC37 0x00200000 -#define HSR0_VC38 0x00400000 -#define HSR0_VC39 0x00800000 -#define HSR0_VC40 0x01000000 -#define HSR0_VC41 0x02000000 -#define HSR0_VC42 0x04000000 -#define HSR0_VC43 0x08000000 -#define HSR0_VC44 0x10000000 -#define HSR0_VC45 0x20000000 -#define HSR0_VC46 0x40000000 -#define HSR0_VC47 0x80000000 - -/* - * The following defines are for the flags in the host interrupt control - * register. - */ -#define HICR_IEV 0x00000001 -#define HICR_CHGM 0x00000002 - -/* - * The following defines are for the flags in the DMA status register. - */ -#define DMSR_HP 0x00000001 -#define DMSR_HR 0x00000002 -#define DMSR_SP 0x00000004 -#define DMSR_SR 0x00000008 - -/* - * The following defines are for the flags in the host DMA source address - * register. - */ -#define HSAR_HOST_ADDR_MASK 0xFFFFFFFF -#define HSAR_DSP_ADDR_MASK 0x0000FFFF -#define HSAR_MEMID_MASK 0x000F0000 -#define HSAR_MEMID_SP_DMEM0 0x00000000 -#define HSAR_MEMID_SP_DMEM1 0x00010000 -#define HSAR_MEMID_SP_PMEM 0x00020000 -#define HSAR_MEMID_SP_DEBUG 0x00030000 -#define HSAR_MEMID_OMNI_MEM 0x000E0000 -#define HSAR_END 0x40000000 -#define HSAR_ERR 0x80000000 - -/* - * The following defines are for the flags in the host DMA destination address - * register. - */ -#define HDAR_HOST_ADDR_MASK 0xFFFFFFFF -#define HDAR_DSP_ADDR_MASK 0x0000FFFF -#define HDAR_MEMID_MASK 0x000F0000 -#define HDAR_MEMID_SP_DMEM0 0x00000000 -#define HDAR_MEMID_SP_DMEM1 0x00010000 -#define HDAR_MEMID_SP_PMEM 0x00020000 -#define HDAR_MEMID_SP_DEBUG 0x00030000 -#define HDAR_MEMID_OMNI_MEM 0x000E0000 -#define HDAR_END 0x40000000 -#define HDAR_ERR 0x80000000 - -/* - * The following defines are for the flags in the host DMA control register. - */ -#define HDMR_AC_MASK 0x0000F000 -#define HDMR_AC_8_16 0x00001000 -#define HDMR_AC_M_S 0x00002000 -#define HDMR_AC_B_L 0x00004000 -#define HDMR_AC_S_U 0x00008000 - -/* - * The following defines are for the flags in the host DMA control register. - */ -#define HDCR_COUNT_MASK 0x000003FF -#define HDCR_DONE 0x00004000 -#define HDCR_OPT 0x00008000 -#define HDCR_WBD 0x00400000 -#define HDCR_WBS 0x00800000 -#define HDCR_DMS_MASK 0x07000000 -#define HDCR_DMS_LINEAR 0x00000000 -#define HDCR_DMS_16_DWORDS 0x01000000 -#define HDCR_DMS_32_DWORDS 0x02000000 -#define HDCR_DMS_64_DWORDS 0x03000000 -#define HDCR_DMS_128_DWORDS 0x04000000 -#define HDCR_DMS_256_DWORDS 0x05000000 -#define HDCR_DMS_512_DWORDS 0x06000000 -#define HDCR_DMS_1024_DWORDS 0x07000000 -#define HDCR_DH 0x08000000 -#define HDCR_SMS_MASK 0x70000000 -#define HDCR_SMS_LINEAR 0x00000000 -#define HDCR_SMS_16_DWORDS 0x10000000 -#define HDCR_SMS_32_DWORDS 0x20000000 -#define HDCR_SMS_64_DWORDS 0x30000000 -#define HDCR_SMS_128_DWORDS 0x40000000 -#define HDCR_SMS_256_DWORDS 0x50000000 -#define HDCR_SMS_512_DWORDS 0x60000000 -#define HDCR_SMS_1024_DWORDS 0x70000000 -#define HDCR_SH 0x80000000 -#define HDCR_COUNT_SHIFT 0 - -/* - * The following defines are for the flags in the performance monitor control - * register. - */ -#define PFMC_C1SS_MASK 0x0000001F -#define PFMC_C1EV 0x00000020 -#define PFMC_C1RS 0x00008000 -#define PFMC_C2SS_MASK 0x001F0000 -#define PFMC_C2EV 0x00200000 -#define PFMC_C2RS 0x80000000 -#define PFMC_C1SS_SHIFT 0 -#define PFMC_C2SS_SHIFT 16 -#define PFMC_BUS_GRANT 0 -#define PFMC_GRANT_AFTER_REQ 1 -#define PFMC_TRANSACTION 2 -#define PFMC_DWORD_TRANSFER 3 -#define PFMC_SLAVE_READ 4 -#define PFMC_SLAVE_WRITE 5 -#define PFMC_PREEMPTION 6 -#define PFMC_DISCONNECT_RETRY 7 -#define PFMC_INTERRUPT 8 -#define PFMC_BUS_OWNERSHIP 9 -#define PFMC_TRANSACTION_LAG 10 -#define PFMC_PCI_CLOCK 11 -#define PFMC_SERIAL_CLOCK 12 -#define PFMC_SP_CLOCK 13 - -/* - * The following defines are for the flags in the performance counter value 1 - * register. - */ -#define PFCV1_PC1V_MASK 0xFFFFFFFF -#define PFCV1_PC1V_SHIFT 0 - -/* - * The following defines are for the flags in the performance counter value 2 - * register. - */ -#define PFCV2_PC2V_MASK 0xFFFFFFFF -#define PFCV2_PC2V_SHIFT 0 - -/* - * The following defines are for the flags in the clock control register 1. - */ -#define CLKCR1_OSCS 0x00000001 -#define CLKCR1_OSCP 0x00000002 -#define CLKCR1_PLLSS_MASK 0x0000000C -#define CLKCR1_PLLSS_SERIAL 0x00000000 -#define CLKCR1_PLLSS_CRYSTAL 0x00000004 -#define CLKCR1_PLLSS_PCI 0x00000008 -#define CLKCR1_PLLSS_RESERVED 0x0000000C -#define CLKCR1_PLLP 0x00000010 -#define CLKCR1_SWCE 0x00000020 -#define CLKCR1_PLLOS 0x00000040 - -/* - * The following defines are for the flags in the clock control register 2. - */ -#define CLKCR2_PDIVS_MASK 0x0000000F -#define CLKCR2_PDIVS_1 0x00000001 -#define CLKCR2_PDIVS_2 0x00000002 -#define CLKCR2_PDIVS_4 0x00000004 -#define CLKCR2_PDIVS_7 0x00000007 -#define CLKCR2_PDIVS_8 0x00000008 -#define CLKCR2_PDIVS_16 0x00000000 - -/* - * The following defines are for the flags in the PLL multiplier register. - */ -#define PLLM_MASK 0x000000FF -#define PLLM_SHIFT 0 - -/* - * The following defines are for the flags in the PLL capacitor coefficient - * register. - */ -#define PLLCC_CDR_MASK 0x00000007 -#ifndef NO_CS4610 -#define PLLCC_CDR_240_350_MHZ 0x00000000 -#define PLLCC_CDR_184_265_MHZ 0x00000001 -#define PLLCC_CDR_144_205_MHZ 0x00000002 -#define PLLCC_CDR_111_160_MHZ 0x00000003 -#define PLLCC_CDR_87_123_MHZ 0x00000004 -#define PLLCC_CDR_67_96_MHZ 0x00000005 -#define PLLCC_CDR_52_74_MHZ 0x00000006 -#define PLLCC_CDR_45_58_MHZ 0x00000007 -#endif -#ifndef NO_CS4612 -#define PLLCC_CDR_271_398_MHZ 0x00000000 -#define PLLCC_CDR_227_330_MHZ 0x00000001 -#define PLLCC_CDR_167_239_MHZ 0x00000002 -#define PLLCC_CDR_150_215_MHZ 0x00000003 -#define PLLCC_CDR_107_154_MHZ 0x00000004 -#define PLLCC_CDR_98_140_MHZ 0x00000005 -#define PLLCC_CDR_73_104_MHZ 0x00000006 -#define PLLCC_CDR_63_90_MHZ 0x00000007 -#endif -#define PLLCC_LPF_MASK 0x000000F8 -#ifndef NO_CS4610 -#define PLLCC_LPF_23850_60000_KHZ 0x00000000 -#define PLLCC_LPF_7960_26290_KHZ 0x00000008 -#define PLLCC_LPF_4160_10980_KHZ 0x00000018 -#define PLLCC_LPF_1740_4580_KHZ 0x00000038 -#define PLLCC_LPF_724_1910_KHZ 0x00000078 -#define PLLCC_LPF_317_798_KHZ 0x000000F8 -#endif -#ifndef NO_CS4612 -#define PLLCC_LPF_25580_64530_KHZ 0x00000000 -#define PLLCC_LPF_14360_37270_KHZ 0x00000008 -#define PLLCC_LPF_6100_16020_KHZ 0x00000018 -#define PLLCC_LPF_2540_6690_KHZ 0x00000038 -#define PLLCC_LPF_1050_2780_KHZ 0x00000078 -#define PLLCC_LPF_450_1160_KHZ 0x000000F8 -#endif - -/* - * The following defines are for the flags in the feature reporting register. - */ -#define FRR_FAB_MASK 0x00000003 -#define FRR_MASK_MASK 0x0000001C -#ifdef NO_CS4612 -#define FRR_CFOP_MASK 0x000000E0 -#else -#define FRR_CFOP_MASK 0x00000FE0 -#endif -#define FRR_CFOP_NOT_DVD 0x00000020 -#define FRR_CFOP_A3D 0x00000040 -#define FRR_CFOP_128_PIN 0x00000080 -#ifndef NO_CS4612 -#define FRR_CFOP_CS4280 0x00000800 -#endif -#define FRR_FAB_SHIFT 0 -#define FRR_MASK_SHIFT 2 -#define FRR_CFOP_SHIFT 5 - -/* - * The following defines are for the flags in the configuration load 1 - * register. - */ -#define CFL1_CLOCK_SOURCE_MASK 0x00000003 -#define CFL1_CLOCK_SOURCE_CS423X 0x00000000 -#define CFL1_CLOCK_SOURCE_AC97 0x00000001 -#define CFL1_CLOCK_SOURCE_CRYSTAL 0x00000002 -#define CFL1_CLOCK_SOURCE_DUAL_AC97 0x00000003 -#define CFL1_VALID_DATA_MASK 0x000000FF - -/* - * The following defines are for the flags in the configuration load 2 - * register. - */ -#define CFL2_VALID_DATA_MASK 0x000000FF - -/* - * The following defines are for the flags in the serial port master control - * register 1. - */ -#define SERMC1_MSPE 0x00000001 -#define SERMC1_PTC_MASK 0x0000000E -#define SERMC1_PTC_CS423X 0x00000000 -#define SERMC1_PTC_AC97 0x00000002 -#define SERMC1_PTC_DAC 0x00000004 -#define SERMC1_PLB 0x00000010 -#define SERMC1_XLB 0x00000020 - -/* - * The following defines are for the flags in the serial port master control - * register 2. - */ -#define SERMC2_LROE 0x00000001 -#define SERMC2_MCOE 0x00000002 -#define SERMC2_MCDIV 0x00000004 - -/* - * The following defines are for the flags in the serial port 1 configuration - * register. - */ -#define SERC1_SO1EN 0x00000001 -#define SERC1_SO1F_MASK 0x0000000E -#define SERC1_SO1F_CS423X 0x00000000 -#define SERC1_SO1F_AC97 0x00000002 -#define SERC1_SO1F_DAC 0x00000004 -#define SERC1_SO1F_SPDIF 0x00000006 - -/* - * The following defines are for the flags in the serial port 2 configuration - * register. - */ -#define SERC2_SI1EN 0x00000001 -#define SERC2_SI1F_MASK 0x0000000E -#define SERC2_SI1F_CS423X 0x00000000 -#define SERC2_SI1F_AC97 0x00000002 -#define SERC2_SI1F_ADC 0x00000004 -#define SERC2_SI1F_SPDIF 0x00000006 - -/* - * The following defines are for the flags in the serial port 3 configuration - * register. - */ -#define SERC3_SO2EN 0x00000001 -#define SERC3_SO2F_MASK 0x00000006 -#define SERC3_SO2F_DAC 0x00000000 -#define SERC3_SO2F_SPDIF 0x00000002 - -/* - * The following defines are for the flags in the serial port 4 configuration - * register. - */ -#define SERC4_SO3EN 0x00000001 -#define SERC4_SO3F_MASK 0x00000006 -#define SERC4_SO3F_DAC 0x00000000 -#define SERC4_SO3F_SPDIF 0x00000002 - -/* - * The following defines are for the flags in the serial port 5 configuration - * register. - */ -#define SERC5_SI2EN 0x00000001 -#define SERC5_SI2F_MASK 0x00000006 -#define SERC5_SI2F_ADC 0x00000000 -#define SERC5_SI2F_SPDIF 0x00000002 - -/* - * The following defines are for the flags in the serial port backdoor sample - * pointer register. - */ -#define SERBSP_FSP_MASK 0x0000000F -#define SERBSP_FSP_SHIFT 0 - -/* - * The following defines are for the flags in the serial port backdoor status - * register. - */ -#define SERBST_RRDY 0x00000001 -#define SERBST_WBSY 0x00000002 - -/* - * The following defines are for the flags in the serial port backdoor command - * register. - */ -#define SERBCM_RDC 0x00000001 -#define SERBCM_WRC 0x00000002 - -/* - * The following defines are for the flags in the serial port backdoor address - * register. - */ -#ifdef NO_CS4612 -#define SERBAD_FAD_MASK 0x000000FF -#else -#define SERBAD_FAD_MASK 0x000001FF -#endif -#define SERBAD_FAD_SHIFT 0 - -/* - * The following defines are for the flags in the serial port backdoor - * configuration register. - */ -#define SERBCF_HBP 0x00000001 - -/* - * The following defines are for the flags in the serial port backdoor write - * port register. - */ -#define SERBWP_FWD_MASK 0x000FFFFF -#define SERBWP_FWD_SHIFT 0 - -/* - * The following defines are for the flags in the serial port backdoor read - * port register. - */ -#define SERBRP_FRD_MASK 0x000FFFFF -#define SERBRP_FRD_SHIFT 0 - -/* - * The following defines are for the flags in the async FIFO address register. - */ -#ifndef NO_CS4612 -#define ASER_FADDR_A1_MASK 0x000001FF -#define ASER_FADDR_EN1 0x00008000 -#define ASER_FADDR_A2_MASK 0x01FF0000 -#define ASER_FADDR_EN2 0x80000000 -#define ASER_FADDR_A1_SHIFT 0 -#define ASER_FADDR_A2_SHIFT 16 -#endif - -/* - * The following defines are for the flags in the AC97 control register. - */ -#define ACCTL_RSTN 0x00000001 -#define ACCTL_ESYN 0x00000002 -#define ACCTL_VFRM 0x00000004 -#define ACCTL_DCV 0x00000008 -#define ACCTL_CRW 0x00000010 -#define ACCTL_ASYN 0x00000020 -#ifndef NO_CS4612 -#define ACCTL_TC 0x00000040 -#endif - -/* - * The following defines are for the flags in the AC97 status register. - */ -#define ACSTS_CRDY 0x00000001 -#define ACSTS_VSTS 0x00000002 -#ifndef NO_CS4612 -#define ACSTS_WKUP 0x00000004 -#endif - -/* - * The following defines are for the flags in the AC97 output slot valid - * register. - */ -#define ACOSV_SLV3 0x00000001 -#define ACOSV_SLV4 0x00000002 -#define ACOSV_SLV5 0x00000004 -#define ACOSV_SLV6 0x00000008 -#define ACOSV_SLV7 0x00000010 -#define ACOSV_SLV8 0x00000020 -#define ACOSV_SLV9 0x00000040 -#define ACOSV_SLV10 0x00000080 -#define ACOSV_SLV11 0x00000100 -#define ACOSV_SLV12 0x00000200 - -/* - * The following defines are for the flags in the AC97 command address - * register. - */ -#define ACCAD_CI_MASK 0x0000007F -#define ACCAD_CI_SHIFT 0 - -/* - * The following defines are for the flags in the AC97 command data register. - */ -#define ACCDA_CD_MASK 0x0000FFFF -#define ACCDA_CD_SHIFT 0 - -/* - * The following defines are for the flags in the AC97 input slot valid - * register. - */ -#define ACISV_ISV3 0x00000001 -#define ACISV_ISV4 0x00000002 -#define ACISV_ISV5 0x00000004 -#define ACISV_ISV6 0x00000008 -#define ACISV_ISV7 0x00000010 -#define ACISV_ISV8 0x00000020 -#define ACISV_ISV9 0x00000040 -#define ACISV_ISV10 0x00000080 -#define ACISV_ISV11 0x00000100 -#define ACISV_ISV12 0x00000200 - -/* - * The following defines are for the flags in the AC97 status address - * register. - */ -#define ACSAD_SI_MASK 0x0000007F -#define ACSAD_SI_SHIFT 0 - -/* - * The following defines are for the flags in the AC97 status data register. - */ -#define ACSDA_SD_MASK 0x0000FFFF -#define ACSDA_SD_SHIFT 0 - -/* - * The following defines are for the flags in the joystick poll/trigger - * register. - */ -#define JSPT_CAX 0x00000001 -#define JSPT_CAY 0x00000002 -#define JSPT_CBX 0x00000004 -#define JSPT_CBY 0x00000008 -#define JSPT_BA1 0x00000010 -#define JSPT_BA2 0x00000020 -#define JSPT_BB1 0x00000040 -#define JSPT_BB2 0x00000080 - -/* - * The following defines are for the flags in the joystick control register. - */ -#define JSCTL_SP_MASK 0x00000003 -#define JSCTL_SP_SLOW 0x00000000 -#define JSCTL_SP_MEDIUM_SLOW 0x00000001 -#define JSCTL_SP_MEDIUM_FAST 0x00000002 -#define JSCTL_SP_FAST 0x00000003 -#define JSCTL_ARE 0x00000004 - -/* - * The following defines are for the flags in the joystick coordinate pair 1 - * readback register. - */ -#define JSC1_Y1V_MASK 0x0000FFFF -#define JSC1_X1V_MASK 0xFFFF0000 -#define JSC1_Y1V_SHIFT 0 -#define JSC1_X1V_SHIFT 16 - -/* - * The following defines are for the flags in the joystick coordinate pair 2 - * readback register. - */ -#define JSC2_Y2V_MASK 0x0000FFFF -#define JSC2_X2V_MASK 0xFFFF0000 -#define JSC2_Y2V_SHIFT 0 -#define JSC2_X2V_SHIFT 16 - -/* - * The following defines are for the flags in the MIDI control register. - */ -#define MIDCR_TXE 0x00000001 /* Enable transmitting. */ -#define MIDCR_RXE 0x00000002 /* Enable receiving. */ -#define MIDCR_RIE 0x00000004 /* Interrupt upon tx ready. */ -#define MIDCR_TIE 0x00000008 /* Interrupt upon rx ready. */ -#define MIDCR_MLB 0x00000010 /* Enable midi loopback. */ -#define MIDCR_MRST 0x00000020 /* Reset interface. */ - -/* - * The following defines are for the flags in the MIDI status register. - */ -#define MIDSR_TBF 0x00000001 /* Tx FIFO is full. */ -#define MIDSR_RBE 0x00000002 /* Rx FIFO is empty. */ - -/* - * The following defines are for the flags in the MIDI write port register. - */ -#define MIDWP_MWD_MASK 0x000000FF -#define MIDWP_MWD_SHIFT 0 - -/* - * The following defines are for the flags in the MIDI read port register. - */ -#define MIDRP_MRD_MASK 0x000000FF -#define MIDRP_MRD_SHIFT 0 - -/* - * The following defines are for the flags in the joystick GPIO register. - */ -#define JSIO_DAX 0x00000001 -#define JSIO_DAY 0x00000002 -#define JSIO_DBX 0x00000004 -#define JSIO_DBY 0x00000008 -#define JSIO_AXOE 0x00000010 -#define JSIO_AYOE 0x00000020 -#define JSIO_BXOE 0x00000040 -#define JSIO_BYOE 0x00000080 - -/* - * The following defines are for the flags in the master async/sync serial - * port enable register. - */ -#ifndef NO_CS4612 -#define ASER_MASTER_ME 0x00000001 -#endif - -/* - * The following defines are for the flags in the configuration interface - * register. - */ -#define CFGI_CLK 0x00000001 -#define CFGI_DOUT 0x00000002 -#define CFGI_DIN_EEN 0x00000004 -#define CFGI_EELD 0x00000008 - -/* - * The following defines are for the flags in the subsystem ID and vendor ID - * register. - */ -#define SSVID_VID_MASK 0x0000FFFF -#define SSVID_SID_MASK 0xFFFF0000 -#define SSVID_VID_SHIFT 0 -#define SSVID_SID_SHIFT 16 - -/* - * The following defines are for the flags in the GPIO pin interface register. - */ -#define GPIOR_VOLDN 0x00000001 -#define GPIOR_VOLUP 0x00000002 -#define GPIOR_SI2D 0x00000004 -#define GPIOR_SI2OE 0x00000008 - -/* - * The following defines are for the flags in the extended GPIO pin direction - * register. - */ -#ifndef NO_CS4612 -#define EGPIODR_GPOE0 0x00000001 -#define EGPIODR_GPOE1 0x00000002 -#define EGPIODR_GPOE2 0x00000004 -#define EGPIODR_GPOE3 0x00000008 -#define EGPIODR_GPOE4 0x00000010 -#define EGPIODR_GPOE5 0x00000020 -#define EGPIODR_GPOE6 0x00000040 -#define EGPIODR_GPOE7 0x00000080 -#define EGPIODR_GPOE8 0x00000100 -#endif - -/* - * The following defines are for the flags in the extended GPIO pin polarity/ - * type register. - */ -#ifndef NO_CS4612 -#define EGPIOPTR_GPPT0 0x00000001 -#define EGPIOPTR_GPPT1 0x00000002 -#define EGPIOPTR_GPPT2 0x00000004 -#define EGPIOPTR_GPPT3 0x00000008 -#define EGPIOPTR_GPPT4 0x00000010 -#define EGPIOPTR_GPPT5 0x00000020 -#define EGPIOPTR_GPPT6 0x00000040 -#define EGPIOPTR_GPPT7 0x00000080 -#define EGPIOPTR_GPPT8 0x00000100 -#endif - -/* - * The following defines are for the flags in the extended GPIO pin sticky - * register. - */ -#ifndef NO_CS4612 -#define EGPIOTR_GPS0 0x00000001 -#define EGPIOTR_GPS1 0x00000002 -#define EGPIOTR_GPS2 0x00000004 -#define EGPIOTR_GPS3 0x00000008 -#define EGPIOTR_GPS4 0x00000010 -#define EGPIOTR_GPS5 0x00000020 -#define EGPIOTR_GPS6 0x00000040 -#define EGPIOTR_GPS7 0x00000080 -#define EGPIOTR_GPS8 0x00000100 -#endif - -/* - * The following defines are for the flags in the extended GPIO ping wakeup - * register. - */ -#ifndef NO_CS4612 -#define EGPIOWR_GPW0 0x00000001 -#define EGPIOWR_GPW1 0x00000002 -#define EGPIOWR_GPW2 0x00000004 -#define EGPIOWR_GPW3 0x00000008 -#define EGPIOWR_GPW4 0x00000010 -#define EGPIOWR_GPW5 0x00000020 -#define EGPIOWR_GPW6 0x00000040 -#define EGPIOWR_GPW7 0x00000080 -#define EGPIOWR_GPW8 0x00000100 -#endif - -/* - * The following defines are for the flags in the extended GPIO pin status - * register. - */ -#ifndef NO_CS4612 -#define EGPIOSR_GPS0 0x00000001 -#define EGPIOSR_GPS1 0x00000002 -#define EGPIOSR_GPS2 0x00000004 -#define EGPIOSR_GPS3 0x00000008 -#define EGPIOSR_GPS4 0x00000010 -#define EGPIOSR_GPS5 0x00000020 -#define EGPIOSR_GPS6 0x00000040 -#define EGPIOSR_GPS7 0x00000080 -#define EGPIOSR_GPS8 0x00000100 -#endif - -/* - * The following defines are for the flags in the serial port 6 configuration - * register. - */ -#ifndef NO_CS4612 -#define SERC6_ASDO2EN 0x00000001 -#endif - -/* - * The following defines are for the flags in the serial port 7 configuration - * register. - */ -#ifndef NO_CS4612 -#define SERC7_ASDI2EN 0x00000001 -#define SERC7_POSILB 0x00000002 -#define SERC7_SIPOLB 0x00000004 -#define SERC7_SOSILB 0x00000008 -#define SERC7_SISOLB 0x00000010 -#endif - -/* - * The following defines are for the flags in the serial port AC link - * configuration register. - */ -#ifndef NO_CS4612 -#define SERACC_CODEC_TYPE_MASK 0x00000001 -#define SERACC_CODEC_TYPE_1_03 0x00000000 -#define SERACC_CODEC_TYPE_2_0 0x00000001 -#define SERACC_TWO_CODECS 0x00000002 -#define SERACC_MDM 0x00000004 -#define SERACC_HSP 0x00000008 -#endif - -/* - * The following defines are for the flags in the AC97 control register 2. - */ -#ifndef NO_CS4612 -#define ACCTL2_RSTN 0x00000001 -#define ACCTL2_ESYN 0x00000002 -#define ACCTL2_VFRM 0x00000004 -#define ACCTL2_DCV 0x00000008 -#define ACCTL2_CRW 0x00000010 -#define ACCTL2_ASYN 0x00000020 -#endif - -/* - * The following defines are for the flags in the AC97 status register 2. - */ -#ifndef NO_CS4612 -#define ACSTS2_CRDY 0x00000001 -#define ACSTS2_VSTS 0x00000002 -#endif - -/* - * The following defines are for the flags in the AC97 output slot valid - * register 2. - */ -#ifndef NO_CS4612 -#define ACOSV2_SLV3 0x00000001 -#define ACOSV2_SLV4 0x00000002 -#define ACOSV2_SLV5 0x00000004 -#define ACOSV2_SLV6 0x00000008 -#define ACOSV2_SLV7 0x00000010 -#define ACOSV2_SLV8 0x00000020 -#define ACOSV2_SLV9 0x00000040 -#define ACOSV2_SLV10 0x00000080 -#define ACOSV2_SLV11 0x00000100 -#define ACOSV2_SLV12 0x00000200 -#endif - -/* - * The following defines are for the flags in the AC97 command address - * register 2. - */ -#ifndef NO_CS4612 -#define ACCAD2_CI_MASK 0x0000007F -#define ACCAD2_CI_SHIFT 0 -#endif - -/* - * The following defines are for the flags in the AC97 command data register - * 2. - */ -#ifndef NO_CS4612 -#define ACCDA2_CD_MASK 0x0000FFFF -#define ACCDA2_CD_SHIFT 0 -#endif - -/* - * The following defines are for the flags in the AC97 input slot valid - * register 2. - */ -#ifndef NO_CS4612 -#define ACISV2_ISV3 0x00000001 -#define ACISV2_ISV4 0x00000002 -#define ACISV2_ISV5 0x00000004 -#define ACISV2_ISV6 0x00000008 -#define ACISV2_ISV7 0x00000010 -#define ACISV2_ISV8 0x00000020 -#define ACISV2_ISV9 0x00000040 -#define ACISV2_ISV10 0x00000080 -#define ACISV2_ISV11 0x00000100 -#define ACISV2_ISV12 0x00000200 -#endif - -/* - * The following defines are for the flags in the AC97 status address - * register 2. - */ -#ifndef NO_CS4612 -#define ACSAD2_SI_MASK 0x0000007F -#define ACSAD2_SI_SHIFT 0 -#endif - -/* - * The following defines are for the flags in the AC97 status data register 2. - */ -#ifndef NO_CS4612 -#define ACSDA2_SD_MASK 0x0000FFFF -#define ACSDA2_SD_SHIFT 0 -#endif - -/* - * The following defines are for the flags in the I/O trap address and control - * registers (all 12). - */ -#ifndef NO_CS4612 -#define IOTAC_SA_MASK 0x0000FFFF -#define IOTAC_MSK_MASK 0x000F0000 -#define IOTAC_IODC_MASK 0x06000000 -#define IOTAC_IODC_16_BIT 0x00000000 -#define IOTAC_IODC_10_BIT 0x02000000 -#define IOTAC_IODC_12_BIT 0x04000000 -#define IOTAC_WSPI 0x08000000 -#define IOTAC_RSPI 0x10000000 -#define IOTAC_WSE 0x20000000 -#define IOTAC_WE 0x40000000 -#define IOTAC_RE 0x80000000 -#define IOTAC_SA_SHIFT 0 -#define IOTAC_MSK_SHIFT 16 -#endif - -/* - * The following defines are for the flags in the I/O trap fast read registers - * (all 8). - */ -#ifndef NO_CS4612 -#define IOTFR_D_MASK 0x0000FFFF -#define IOTFR_A_MASK 0x000F0000 -#define IOTFR_R_MASK 0x0F000000 -#define IOTFR_ALL 0x40000000 -#define IOTFR_VL 0x80000000 -#define IOTFR_D_SHIFT 0 -#define IOTFR_A_SHIFT 16 -#define IOTFR_R_SHIFT 24 -#endif - -/* - * The following defines are for the flags in the I/O trap FIFO register. - */ -#ifndef NO_CS4612 -#define IOTFIFO_BA_MASK 0x00003FFF -#define IOTFIFO_S_MASK 0x00FF0000 -#define IOTFIFO_OF 0x40000000 -#define IOTFIFO_SPIOF 0x80000000 -#define IOTFIFO_BA_SHIFT 0 -#define IOTFIFO_S_SHIFT 16 -#endif - -/* - * The following defines are for the flags in the I/O trap retry read data - * register. - */ -#ifndef NO_CS4612 -#define IOTRRD_D_MASK 0x0000FFFF -#define IOTRRD_RDV 0x80000000 -#define IOTRRD_D_SHIFT 0 -#endif - -/* - * The following defines are for the flags in the I/O trap FIFO pointer - * register. - */ -#ifndef NO_CS4612 -#define IOTFP_CA_MASK 0x00003FFF -#define IOTFP_PA_MASK 0x3FFF0000 -#define IOTFP_CA_SHIFT 0 -#define IOTFP_PA_SHIFT 16 -#endif - -/* - * The following defines are for the flags in the I/O trap control register. - */ -#ifndef NO_CS4612 -#define IOTCR_ITD 0x00000001 -#define IOTCR_HRV 0x00000002 -#define IOTCR_SRV 0x00000004 -#define IOTCR_DTI 0x00000008 -#define IOTCR_DFI 0x00000010 -#define IOTCR_DDP 0x00000020 -#define IOTCR_JTE 0x00000040 -#define IOTCR_PPE 0x00000080 -#endif - -/* - * The following defines are for the flags in the direct PCI data register. - */ -#ifndef NO_CS4612 -#define DPCID_D_MASK 0xFFFFFFFF -#define DPCID_D_SHIFT 0 -#endif - -/* - * The following defines are for the flags in the direct PCI address register. - */ -#ifndef NO_CS4612 -#define DPCIA_A_MASK 0xFFFFFFFF -#define DPCIA_A_SHIFT 0 -#endif - -/* - * The following defines are for the flags in the direct PCI command register. - */ -#ifndef NO_CS4612 -#define DPCIC_C_MASK 0x0000000F -#define DPCIC_C_IOREAD 0x00000002 -#define DPCIC_C_IOWRITE 0x00000003 -#define DPCIC_BE_MASK 0x000000F0 -#endif - -/* - * The following defines are for the flags in the PC/PCI request register. - */ -#ifndef NO_CS4612 -#define PCPCIR_RDC_MASK 0x00000007 -#define PCPCIR_C_MASK 0x00007000 -#define PCPCIR_REQ 0x00008000 -#define PCPCIR_RDC_SHIFT 0 -#define PCPCIR_C_SHIFT 12 -#endif - -/* - * The following defines are for the flags in the PC/PCI grant register. - */ -#ifndef NO_CS4612 -#define PCPCIG_GDC_MASK 0x00000007 -#define PCPCIG_VL 0x00008000 -#define PCPCIG_GDC_SHIFT 0 -#endif - -/* - * The following defines are for the flags in the PC/PCI master enable - * register. - */ -#ifndef NO_CS4612 -#define PCPCIEN_EN 0x00000001 -#endif - -/* - * The following defines are for the flags in the extended PCI power - * management control register. - */ -#ifndef NO_CS4612 -#define EPCIPMC_GWU 0x00000001 -#define EPCIPMC_FSPC 0x00000002 -#endif - -/* - * The following defines are for the flags in the SP control register. - */ -#define SPCR_RUN 0x00000001 -#define SPCR_STPFR 0x00000002 -#define SPCR_RUNFR 0x00000004 -#define SPCR_TICK 0x00000008 -#define SPCR_DRQEN 0x00000020 -#define SPCR_RSTSP 0x00000040 -#define SPCR_OREN 0x00000080 -#ifndef NO_CS4612 -#define SPCR_PCIINT 0x00000100 -#define SPCR_OINTD 0x00000200 -#define SPCR_CRE 0x00008000 -#endif - -/* - * The following defines are for the flags in the debug index register. - */ -#define DREG_REGID_MASK 0x0000007F -#define DREG_DEBUG 0x00000080 -#define DREG_RGBK_MASK 0x00000700 -#define DREG_TRAP 0x00000800 -#if !defined(NO_CS4612) -#if !defined(NO_CS4615) -#define DREG_TRAPX 0x00001000 -#endif -#endif -#define DREG_REGID_SHIFT 0 -#define DREG_RGBK_SHIFT 8 -#define DREG_RGBK_REGID_MASK 0x0000077F -#define DREG_REGID_R0 0x00000010 -#define DREG_REGID_R1 0x00000011 -#define DREG_REGID_R2 0x00000012 -#define DREG_REGID_R3 0x00000013 -#define DREG_REGID_R4 0x00000014 -#define DREG_REGID_R5 0x00000015 -#define DREG_REGID_R6 0x00000016 -#define DREG_REGID_R7 0x00000017 -#define DREG_REGID_R8 0x00000018 -#define DREG_REGID_R9 0x00000019 -#define DREG_REGID_RA 0x0000001A -#define DREG_REGID_RB 0x0000001B -#define DREG_REGID_RC 0x0000001C -#define DREG_REGID_RD 0x0000001D -#define DREG_REGID_RE 0x0000001E -#define DREG_REGID_RF 0x0000001F -#define DREG_REGID_RA_BUS_LOW 0x00000020 -#define DREG_REGID_RA_BUS_HIGH 0x00000038 -#define DREG_REGID_YBUS_LOW 0x00000050 -#define DREG_REGID_YBUS_HIGH 0x00000058 -#define DREG_REGID_TRAP_0 0x00000100 -#define DREG_REGID_TRAP_1 0x00000101 -#define DREG_REGID_TRAP_2 0x00000102 -#define DREG_REGID_TRAP_3 0x00000103 -#define DREG_REGID_TRAP_4 0x00000104 -#define DREG_REGID_TRAP_5 0x00000105 -#define DREG_REGID_TRAP_6 0x00000106 -#define DREG_REGID_TRAP_7 0x00000107 -#define DREG_REGID_INDIRECT_ADDRESS 0x0000010E -#define DREG_REGID_TOP_OF_STACK 0x0000010F -#if !defined(NO_CS4612) -#if !defined(NO_CS4615) -#define DREG_REGID_TRAP_8 0x00000110 -#define DREG_REGID_TRAP_9 0x00000111 -#define DREG_REGID_TRAP_10 0x00000112 -#define DREG_REGID_TRAP_11 0x00000113 -#define DREG_REGID_TRAP_12 0x00000114 -#define DREG_REGID_TRAP_13 0x00000115 -#define DREG_REGID_TRAP_14 0x00000116 -#define DREG_REGID_TRAP_15 0x00000117 -#define DREG_REGID_TRAP_16 0x00000118 -#define DREG_REGID_TRAP_17 0x00000119 -#define DREG_REGID_TRAP_18 0x0000011A -#define DREG_REGID_TRAP_19 0x0000011B -#define DREG_REGID_TRAP_20 0x0000011C -#define DREG_REGID_TRAP_21 0x0000011D -#define DREG_REGID_TRAP_22 0x0000011E -#define DREG_REGID_TRAP_23 0x0000011F -#endif -#endif -#define DREG_REGID_RSA0_LOW 0x00000200 -#define DREG_REGID_RSA0_HIGH 0x00000201 -#define DREG_REGID_RSA1_LOW 0x00000202 -#define DREG_REGID_RSA1_HIGH 0x00000203 -#define DREG_REGID_RSA2 0x00000204 -#define DREG_REGID_RSA3 0x00000205 -#define DREG_REGID_RSI0_LOW 0x00000206 -#define DREG_REGID_RSI0_HIGH 0x00000207 -#define DREG_REGID_RSI1 0x00000208 -#define DREG_REGID_RSI2 0x00000209 -#define DREG_REGID_SAGUSTATUS 0x0000020A -#define DREG_REGID_RSCONFIG01_LOW 0x0000020B -#define DREG_REGID_RSCONFIG01_HIGH 0x0000020C -#define DREG_REGID_RSCONFIG23_LOW 0x0000020D -#define DREG_REGID_RSCONFIG23_HIGH 0x0000020E -#define DREG_REGID_RSDMA01E 0x0000020F -#define DREG_REGID_RSDMA23E 0x00000210 -#define DREG_REGID_RSD0_LOW 0x00000211 -#define DREG_REGID_RSD0_HIGH 0x00000212 -#define DREG_REGID_RSD1_LOW 0x00000213 -#define DREG_REGID_RSD1_HIGH 0x00000214 -#define DREG_REGID_RSD2_LOW 0x00000215 -#define DREG_REGID_RSD2_HIGH 0x00000216 -#define DREG_REGID_RSD3_LOW 0x00000217 -#define DREG_REGID_RSD3_HIGH 0x00000218 -#define DREG_REGID_SRAR_HIGH 0x0000021A -#define DREG_REGID_SRAR_LOW 0x0000021B -#define DREG_REGID_DMA_STATE 0x0000021C -#define DREG_REGID_CURRENT_DMA_STREAM 0x0000021D -#define DREG_REGID_NEXT_DMA_STREAM 0x0000021E -#define DREG_REGID_CPU_STATUS 0x00000300 -#define DREG_REGID_MAC_MODE 0x00000301 -#define DREG_REGID_STACK_AND_REPEAT 0x00000302 -#define DREG_REGID_INDEX0 0x00000304 -#define DREG_REGID_INDEX1 0x00000305 -#define DREG_REGID_DMA_STATE_0_3 0x00000400 -#define DREG_REGID_DMA_STATE_4_7 0x00000404 -#define DREG_REGID_DMA_STATE_8_11 0x00000408 -#define DREG_REGID_DMA_STATE_12_15 0x0000040C -#define DREG_REGID_DMA_STATE_16_19 0x00000410 -#define DREG_REGID_DMA_STATE_20_23 0x00000414 -#define DREG_REGID_DMA_STATE_24_27 0x00000418 -#define DREG_REGID_DMA_STATE_28_31 0x0000041C -#define DREG_REGID_DMA_STATE_32_35 0x00000420 -#define DREG_REGID_DMA_STATE_36_39 0x00000424 -#define DREG_REGID_DMA_STATE_40_43 0x00000428 -#define DREG_REGID_DMA_STATE_44_47 0x0000042C -#define DREG_REGID_DMA_STATE_48_51 0x00000430 -#define DREG_REGID_DMA_STATE_52_55 0x00000434 -#define DREG_REGID_DMA_STATE_56_59 0x00000438 -#define DREG_REGID_DMA_STATE_60_63 0x0000043C -#define DREG_REGID_DMA_STATE_64_67 0x00000440 -#define DREG_REGID_DMA_STATE_68_71 0x00000444 -#define DREG_REGID_DMA_STATE_72_75 0x00000448 -#define DREG_REGID_DMA_STATE_76_79 0x0000044C -#define DREG_REGID_DMA_STATE_80_83 0x00000450 -#define DREG_REGID_DMA_STATE_84_87 0x00000454 -#define DREG_REGID_DMA_STATE_88_91 0x00000458 -#define DREG_REGID_DMA_STATE_92_95 0x0000045C -#define DREG_REGID_TRAP_SELECT 0x00000500 -#define DREG_REGID_TRAP_WRITE_0 0x00000500 -#define DREG_REGID_TRAP_WRITE_1 0x00000501 -#define DREG_REGID_TRAP_WRITE_2 0x00000502 -#define DREG_REGID_TRAP_WRITE_3 0x00000503 -#define DREG_REGID_TRAP_WRITE_4 0x00000504 -#define DREG_REGID_TRAP_WRITE_5 0x00000505 -#define DREG_REGID_TRAP_WRITE_6 0x00000506 -#define DREG_REGID_TRAP_WRITE_7 0x00000507 -#if !defined(NO_CS4612) -#if !defined(NO_CS4615) -#define DREG_REGID_TRAP_WRITE_8 0x00000510 -#define DREG_REGID_TRAP_WRITE_9 0x00000511 -#define DREG_REGID_TRAP_WRITE_10 0x00000512 -#define DREG_REGID_TRAP_WRITE_11 0x00000513 -#define DREG_REGID_TRAP_WRITE_12 0x00000514 -#define DREG_REGID_TRAP_WRITE_13 0x00000515 -#define DREG_REGID_TRAP_WRITE_14 0x00000516 -#define DREG_REGID_TRAP_WRITE_15 0x00000517 -#define DREG_REGID_TRAP_WRITE_16 0x00000518 -#define DREG_REGID_TRAP_WRITE_17 0x00000519 -#define DREG_REGID_TRAP_WRITE_18 0x0000051A -#define DREG_REGID_TRAP_WRITE_19 0x0000051B -#define DREG_REGID_TRAP_WRITE_20 0x0000051C -#define DREG_REGID_TRAP_WRITE_21 0x0000051D -#define DREG_REGID_TRAP_WRITE_22 0x0000051E -#define DREG_REGID_TRAP_WRITE_23 0x0000051F -#endif -#endif -#define DREG_REGID_MAC0_ACC0_LOW 0x00000600 -#define DREG_REGID_MAC0_ACC1_LOW 0x00000601 -#define DREG_REGID_MAC0_ACC2_LOW 0x00000602 -#define DREG_REGID_MAC0_ACC3_LOW 0x00000603 -#define DREG_REGID_MAC1_ACC0_LOW 0x00000604 -#define DREG_REGID_MAC1_ACC1_LOW 0x00000605 -#define DREG_REGID_MAC1_ACC2_LOW 0x00000606 -#define DREG_REGID_MAC1_ACC3_LOW 0x00000607 -#define DREG_REGID_MAC0_ACC0_MID 0x00000608 -#define DREG_REGID_MAC0_ACC1_MID 0x00000609 -#define DREG_REGID_MAC0_ACC2_MID 0x0000060A -#define DREG_REGID_MAC0_ACC3_MID 0x0000060B -#define DREG_REGID_MAC1_ACC0_MID 0x0000060C -#define DREG_REGID_MAC1_ACC1_MID 0x0000060D -#define DREG_REGID_MAC1_ACC2_MID 0x0000060E -#define DREG_REGID_MAC1_ACC3_MID 0x0000060F -#define DREG_REGID_MAC0_ACC0_HIGH 0x00000610 -#define DREG_REGID_MAC0_ACC1_HIGH 0x00000611 -#define DREG_REGID_MAC0_ACC2_HIGH 0x00000612 -#define DREG_REGID_MAC0_ACC3_HIGH 0x00000613 -#define DREG_REGID_MAC1_ACC0_HIGH 0x00000614 -#define DREG_REGID_MAC1_ACC1_HIGH 0x00000615 -#define DREG_REGID_MAC1_ACC2_HIGH 0x00000616 -#define DREG_REGID_MAC1_ACC3_HIGH 0x00000617 -#define DREG_REGID_RSHOUT_LOW 0x00000620 -#define DREG_REGID_RSHOUT_MID 0x00000628 -#define DREG_REGID_RSHOUT_HIGH 0x00000630 - -/* - * The following defines are for the flags in the DMA stream requestor write - */ -#define DSRWP_DSR_MASK 0x0000000F -#define DSRWP_DSR_BG_RQ 0x00000001 -#define DSRWP_DSR_PRIORITY_MASK 0x00000006 -#define DSRWP_DSR_PRIORITY_0 0x00000000 -#define DSRWP_DSR_PRIORITY_1 0x00000002 -#define DSRWP_DSR_PRIORITY_2 0x00000004 -#define DSRWP_DSR_PRIORITY_3 0x00000006 -#define DSRWP_DSR_RQ_PENDING 0x00000008 - -/* - * The following defines are for the flags in the trap write port register. - */ -#define TWPR_TW_MASK 0x0000FFFF -#define TWPR_TW_SHIFT 0 - -/* - * The following defines are for the flags in the stack pointer write - * register. - */ -#define SPWR_STKP_MASK 0x0000000F -#define SPWR_STKP_SHIFT 0 - -/* - * The following defines are for the flags in the SP interrupt register. - */ -#define SPIR_FRI 0x00000001 -#define SPIR_DOI 0x00000002 -#define SPIR_GPI2 0x00000004 -#define SPIR_GPI3 0x00000008 -#define SPIR_IP0 0x00000010 -#define SPIR_IP1 0x00000020 -#define SPIR_IP2 0x00000040 -#define SPIR_IP3 0x00000080 - -/* - * The following defines are for the flags in the functional group 1 register. - */ -#define FGR1_F1S_MASK 0x0000FFFF -#define FGR1_F1S_SHIFT 0 - -/* - * The following defines are for the flags in the SP clock status register. - */ -#define SPCS_FRI 0x00000001 -#define SPCS_DOI 0x00000002 -#define SPCS_GPI2 0x00000004 -#define SPCS_GPI3 0x00000008 -#define SPCS_IP0 0x00000010 -#define SPCS_IP1 0x00000020 -#define SPCS_IP2 0x00000040 -#define SPCS_IP3 0x00000080 -#define SPCS_SPRUN 0x00000100 -#define SPCS_SLEEP 0x00000200 -#define SPCS_FG 0x00000400 -#define SPCS_ORUN 0x00000800 -#define SPCS_IRQ 0x00001000 -#define SPCS_FGN_MASK 0x0000E000 -#define SPCS_FGN_SHIFT 13 - -/* - * The following defines are for the flags in the SP DMA requestor status - * register. - */ -#define SDSR_DCS_MASK 0x000000FF -#define SDSR_DCS_SHIFT 0 -#define SDSR_DCS_NONE 0x00000007 - -/* - * The following defines are for the flags in the frame timer register. - */ -#define FRMT_FTV_MASK 0x0000FFFF -#define FRMT_FTV_SHIFT 0 - -/* - * The following defines are for the flags in the frame timer current count - * register. - */ -#define FRCC_FCC_MASK 0x0000FFFF -#define FRCC_FCC_SHIFT 0 - -/* - * The following defines are for the flags in the frame timer save count - * register. - */ -#define FRSC_FCS_MASK 0x0000FFFF -#define FRSC_FCS_SHIFT 0 - -/* - * The following define the various flags stored in the scatter/gather - * descriptors. - */ -#define DMA_SG_NEXT_ENTRY_MASK 0x00000FF8 -#define DMA_SG_SAMPLE_END_MASK 0x0FFF0000 -#define DMA_SG_SAMPLE_END_FLAG 0x10000000 -#define DMA_SG_LOOP_END_FLAG 0x20000000 -#define DMA_SG_SIGNAL_END_FLAG 0x40000000 -#define DMA_SG_SIGNAL_PAGE_FLAG 0x80000000 -#define DMA_SG_NEXT_ENTRY_SHIFT 3 -#define DMA_SG_SAMPLE_END_SHIFT 16 - -/* - * The following define the offsets of the fields within the on-chip generic - * DMA requestor. - */ -#define DMA_RQ_CONTROL1 0x00000000 -#define DMA_RQ_CONTROL2 0x00000004 -#define DMA_RQ_SOURCE_ADDR 0x00000008 -#define DMA_RQ_DESTINATION_ADDR 0x0000000C -#define DMA_RQ_NEXT_PAGE_ADDR 0x00000010 -#define DMA_RQ_NEXT_PAGE_SGDESC 0x00000014 -#define DMA_RQ_LOOP_START_ADDR 0x00000018 -#define DMA_RQ_POST_LOOP_ADDR 0x0000001C -#define DMA_RQ_PAGE_MAP_ADDR 0x00000020 - -/* - * The following defines are for the flags in the first control word of the - * on-chip generic DMA requestor. - */ -#define DMA_RQ_C1_COUNT_MASK 0x000003FF -#define DMA_RQ_C1_DESTINATION_SCATTER 0x00001000 -#define DMA_RQ_C1_SOURCE_GATHER 0x00002000 -#define DMA_RQ_C1_DONE_FLAG 0x00004000 -#define DMA_RQ_C1_OPTIMIZE_STATE 0x00008000 -#define DMA_RQ_C1_SAMPLE_END_STATE_MASK 0x00030000 -#define DMA_RQ_C1_FULL_PAGE 0x00000000 -#define DMA_RQ_C1_BEFORE_SAMPLE_END 0x00010000 -#define DMA_RQ_C1_PAGE_MAP_ERROR 0x00020000 -#define DMA_RQ_C1_AT_SAMPLE_END 0x00030000 -#define DMA_RQ_C1_LOOP_END_STATE_MASK 0x000C0000 -#define DMA_RQ_C1_NOT_LOOP_END 0x00000000 -#define DMA_RQ_C1_BEFORE_LOOP_END 0x00040000 -#define DMA_RQ_C1_2PAGE_LOOP_BEGIN 0x00080000 -#define DMA_RQ_C1_LOOP_BEGIN 0x000C0000 -#define DMA_RQ_C1_PAGE_MAP_MASK 0x00300000 -#define DMA_RQ_C1_PM_NONE_PENDING 0x00000000 -#define DMA_RQ_C1_PM_NEXT_PENDING 0x00100000 -#define DMA_RQ_C1_PM_RESERVED 0x00200000 -#define DMA_RQ_C1_PM_LOOP_NEXT_PENDING 0x00300000 -#define DMA_RQ_C1_WRITEBACK_DEST_FLAG 0x00400000 -#define DMA_RQ_C1_WRITEBACK_SRC_FLAG 0x00800000 -#define DMA_RQ_C1_DEST_SIZE_MASK 0x07000000 -#define DMA_RQ_C1_DEST_LINEAR 0x00000000 -#define DMA_RQ_C1_DEST_MOD16 0x01000000 -#define DMA_RQ_C1_DEST_MOD32 0x02000000 -#define DMA_RQ_C1_DEST_MOD64 0x03000000 -#define DMA_RQ_C1_DEST_MOD128 0x04000000 -#define DMA_RQ_C1_DEST_MOD256 0x05000000 -#define DMA_RQ_C1_DEST_MOD512 0x06000000 -#define DMA_RQ_C1_DEST_MOD1024 0x07000000 -#define DMA_RQ_C1_DEST_ON_HOST 0x08000000 -#define DMA_RQ_C1_SOURCE_SIZE_MASK 0x70000000 -#define DMA_RQ_C1_SOURCE_LINEAR 0x00000000 -#define DMA_RQ_C1_SOURCE_MOD16 0x10000000 -#define DMA_RQ_C1_SOURCE_MOD32 0x20000000 -#define DMA_RQ_C1_SOURCE_MOD64 0x30000000 -#define DMA_RQ_C1_SOURCE_MOD128 0x40000000 -#define DMA_RQ_C1_SOURCE_MOD256 0x50000000 -#define DMA_RQ_C1_SOURCE_MOD512 0x60000000 -#define DMA_RQ_C1_SOURCE_MOD1024 0x70000000 -#define DMA_RQ_C1_SOURCE_ON_HOST 0x80000000 -#define DMA_RQ_C1_COUNT_SHIFT 0 - -/* - * The following defines are for the flags in the second control word of the - * on-chip generic DMA requestor. - */ -#define DMA_RQ_C2_VIRTUAL_CHANNEL_MASK 0x0000003F -#define DMA_RQ_C2_VIRTUAL_SIGNAL_MASK 0x00000300 -#define DMA_RQ_C2_NO_VIRTUAL_SIGNAL 0x00000000 -#define DMA_RQ_C2_SIGNAL_EVERY_DMA 0x00000100 -#define DMA_RQ_C2_SIGNAL_SOURCE_PINGPONG 0x00000200 -#define DMA_RQ_C2_SIGNAL_DEST_PINGPONG 0x00000300 -#define DMA_RQ_C2_AUDIO_CONVERT_MASK 0x0000F000 -#define DMA_RQ_C2_AC_NONE 0x00000000 -#define DMA_RQ_C2_AC_8_TO_16_BIT 0x00001000 -#define DMA_RQ_C2_AC_MONO_TO_STEREO 0x00002000 -#define DMA_RQ_C2_AC_ENDIAN_CONVERT 0x00004000 -#define DMA_RQ_C2_AC_SIGNED_CONVERT 0x00008000 -#define DMA_RQ_C2_LOOP_END_MASK 0x0FFF0000 -#define DMA_RQ_C2_LOOP_MASK 0x30000000 -#define DMA_RQ_C2_NO_LOOP 0x00000000 -#define DMA_RQ_C2_ONE_PAGE_LOOP 0x10000000 -#define DMA_RQ_C2_TWO_PAGE_LOOP 0x20000000 -#define DMA_RQ_C2_MULTI_PAGE_LOOP 0x30000000 -#define DMA_RQ_C2_SIGNAL_LOOP_BACK 0x40000000 -#define DMA_RQ_C2_SIGNAL_POST_BEGIN_PAGE 0x80000000 -#define DMA_RQ_C2_VIRTUAL_CHANNEL_SHIFT 0 -#define DMA_RQ_C2_LOOP_END_SHIFT 16 - -/* - * The following defines are for the flags in the source and destination words - * of the on-chip generic DMA requestor. - */ -#define DMA_RQ_SD_ADDRESS_MASK 0x0000FFFF -#define DMA_RQ_SD_MEMORY_ID_MASK 0x000F0000 -#define DMA_RQ_SD_SP_PARAM_ADDR 0x00000000 -#define DMA_RQ_SD_SP_SAMPLE_ADDR 0x00010000 -#define DMA_RQ_SD_SP_PROGRAM_ADDR 0x00020000 -#define DMA_RQ_SD_SP_DEBUG_ADDR 0x00030000 -#define DMA_RQ_SD_OMNIMEM_ADDR 0x000E0000 -#define DMA_RQ_SD_END_FLAG 0x40000000 -#define DMA_RQ_SD_ERROR_FLAG 0x80000000 -#define DMA_RQ_SD_ADDRESS_SHIFT 0 - -/* - * The following defines are for the flags in the page map address word of the - * on-chip generic DMA requestor. - */ -#define DMA_RQ_PMA_LOOP_THIRD_PAGE_ENTRY_MASK 0x00000FF8 -#define DMA_RQ_PMA_PAGE_TABLE_MASK 0xFFFFF000 -#define DMA_RQ_PMA_LOOP_THIRD_PAGE_ENTRY_SHIFT 3 -#define DMA_RQ_PMA_PAGE_TABLE_SHIFT 12 - -#define BA1_VARIDEC_BUF_1 0x000 - -#define BA1_PDTC 0x0c0 /* BA1_PLAY_DMA_TRANSACTION_COUNT_REG */ -#define BA1_PFIE 0x0c4 /* BA1_PLAY_FORMAT_&_INTERRUPT_ENABLE_REG */ -#define BA1_PBA 0x0c8 /* BA1_PLAY_BUFFER_ADDRESS */ -#define BA1_PVOL 0x0f8 /* BA1_PLAY_VOLUME_REG */ -#define BA1_PSRC 0x288 /* BA1_PLAY_SAMPLE_RATE_CORRECTION_REG */ -#define BA1_PCTL 0x2a4 /* BA1_PLAY_CONTROL_REG */ -#define BA1_PPI 0x2b4 /* BA1_PLAY_PHASE_INCREMENT_REG */ - -#define BA1_CCTL 0x064 /* BA1_CAPTURE_CONTROL_REG */ -#define BA1_CIE 0x104 /* BA1_CAPTURE_INTERRUPT_ENABLE_REG */ -#define BA1_CBA 0x10c /* BA1_CAPTURE_BUFFER_ADDRESS */ -#define BA1_CSRC 0x2c8 /* BA1_CAPTURE_SAMPLE_RATE_CORRECTION_REG */ -#define BA1_CCI 0x2d8 /* BA1_CAPTURE_COEFFICIENT_INCREMENT_REG */ -#define BA1_CD 0x2e0 /* BA1_CAPTURE_DELAY_REG */ -#define BA1_CPI 0x2f4 /* BA1_CAPTURE_PHASE_INCREMENT_REG */ -#define BA1_CVOL 0x2f8 /* BA1_CAPTURE_VOLUME_REG */ - -#define BA1_CFG1 0x134 /* BA1_CAPTURE_FRAME_GROUP_1_REG */ -#define BA1_CFG2 0x138 /* BA1_CAPTURE_FRAME_GROUP_2_REG */ -#define BA1_CCST 0x13c /* BA1_CAPTURE_CONSTANT_REG */ -#define BA1_CSPB 0x340 /* BA1_CAPTURE_SPB_ADDRESS */ - -/* - * - */ - -#define CS461X_MODE_OUTPUT (1<<0) /* MIDI UART - output */ -#define CS461X_MODE_INPUT (1<<1) /* MIDI UART - input */ - -//**************************************************************************** -// -// The following define the offsets of the AC97 shadow registers, which appear -// as a virtual extension to the base address register zero memory range. -// -//**************************************************************************** -#define AC97_REG_OFFSET_MASK 0x0000007EL -#define AC97_CODEC_NUMBER_MASK 0x00003000L - -#define BA0_AC97_RESET 0x00001000L -#define BA0_AC97_MASTER_VOLUME 0x00001002L -#define BA0_AC97_HEADPHONE_VOLUME 0x00001004L -#define BA0_AC97_MASTER_VOLUME_MONO 0x00001006L -#define BA0_AC97_MASTER_TONE 0x00001008L -#define BA0_AC97_PC_BEEP_VOLUME 0x0000100AL -#define BA0_AC97_PHONE_VOLUME 0x0000100CL -#define BA0_AC97_MIC_VOLUME 0x0000100EL -#define BA0_AC97_LINE_IN_VOLUME 0x00001010L -#define BA0_AC97_CD_VOLUME 0x00001012L -#define BA0_AC97_VIDEO_VOLUME 0x00001014L -#define BA0_AC97_AUX_VOLUME 0x00001016L -#define BA0_AC97_PCM_OUT_VOLUME 0x00001018L -#define BA0_AC97_RECORD_SELECT 0x0000101AL -#define BA0_AC97_RECORD_GAIN 0x0000101CL -#define BA0_AC97_RECORD_GAIN_MIC 0x0000101EL -#define BA0_AC97_GENERAL_PURPOSE 0x00001020L -#define BA0_AC97_3D_CONTROL 0x00001022L -#define BA0_AC97_MODEM_RATE 0x00001024L -#define BA0_AC97_POWERDOWN 0x00001026L -#define BA0_AC97_EXT_AUDIO_ID 0x00001028L -#define BA0_AC97_EXT_AUDIO_POWER 0x0000102AL -#define BA0_AC97_PCM_FRONT_DAC_RATE 0x0000102CL -#define BA0_AC97_PCM_SURR_DAC_RATE 0x0000102EL -#define BA0_AC97_PCM_LFE_DAC_RATE 0x00001030L -#define BA0_AC97_PCM_LR_ADC_RATE 0x00001032L -#define BA0_AC97_MIC_ADC_RATE 0x00001034L -#define BA0_AC97_6CH_VOL_C_LFE 0x00001036L -#define BA0_AC97_6CH_VOL_SURROUND 0x00001038L -#define BA0_AC97_RESERVED_3A 0x0000103AL -#define BA0_AC97_EXT_MODEM_ID 0x0000103CL -#define BA0_AC97_EXT_MODEM_POWER 0x0000103EL -#define BA0_AC97_LINE1_CODEC_RATE 0x00001040L -#define BA0_AC97_LINE2_CODEC_RATE 0x00001042L -#define BA0_AC97_HANDSET_CODEC_RATE 0x00001044L -#define BA0_AC97_LINE1_CODEC_LEVEL 0x00001046L -#define BA0_AC97_LINE2_CODEC_LEVEL 0x00001048L -#define BA0_AC97_HANDSET_CODEC_LEVEL 0x0000104AL -#define BA0_AC97_GPIO_PIN_CONFIG 0x0000104CL -#define BA0_AC97_GPIO_PIN_TYPE 0x0000104EL -#define BA0_AC97_GPIO_PIN_STICKY 0x00001050L -#define BA0_AC97_GPIO_PIN_WAKEUP 0x00001052L -#define BA0_AC97_GPIO_PIN_STATUS 0x00001054L -#define BA0_AC97_MISC_MODEM_AFE_STAT 0x00001056L -#define BA0_AC97_RESERVED_58 0x00001058L -#define BA0_AC97_CRYSTAL_REV_N_FAB_ID 0x0000105AL -#define BA0_AC97_TEST_AND_MISC_CTRL 0x0000105CL -#define BA0_AC97_AC_MODE 0x0000105EL -#define BA0_AC97_MISC_CRYSTAL_CONTROL 0x00001060L -#define BA0_AC97_LINE1_HYPRID_CTRL 0x00001062L -#define BA0_AC97_VENDOR_RESERVED_64 0x00001064L -#define BA0_AC97_VENDOR_RESERVED_66 0x00001066L -#define BA0_AC97_SPDIF_CONTROL 0x00001068L -#define BA0_AC97_VENDOR_RESERVED_6A 0x0000106AL -#define BA0_AC97_VENDOR_RESERVED_6C 0x0000106CL -#define BA0_AC97_VENDOR_RESERVED_6E 0x0000106EL -#define BA0_AC97_VENDOR_RESERVED_70 0x00001070L -#define BA0_AC97_VENDOR_RESERVED_72 0x00001072L -#define BA0_AC97_VENDOR_RESERVED_74 0x00001074L -#define BA0_AC97_CAL_ADDRESS 0x00001076L -#define BA0_AC97_CAL_DATA 0x00001078L -#define BA0_AC97_VENDOR_RESERVED_7A 0x0000107AL -#define BA0_AC97_VENDOR_ID1 0x0000107CL -#define BA0_AC97_VENDOR_ID2 0x0000107EL -#endif /* __CS461X_H */ diff --git a/sound/oss/cs461x_image.h b/sound/oss/cs461x_image.h deleted file mode 100644 index b5c5a46d342..00000000000 --- a/sound/oss/cs461x_image.h +++ /dev/null @@ -1,322 +0,0 @@ -/**************************************************************************** - * "CWCIMAGE.H"-- For CS46XX. Ver 1.04 - * Copyright 1998-2001 (c) Cirrus Logic Corp. - * Version 1.04 - **************************************************************************** - */ -#ifndef __CS_IMAGE_H -#define __CS_IMAGE_H - -#define CLEAR__COUNT 3 -#define FILL__COUNT 4 -#define BA1__DWORD_SIZE 13*1024+512 - -static struct -{ - unsigned BA1__DestByteOffset; - unsigned BA1__SourceSize; -} ClrStat[CLEAR__COUNT] ={ {0x00000000, 0x00003000 }, - {0x00010000, 0x00003800 }, - {0x00020000, 0x00007000 } }; - -static u32 FillArray1[]={ -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000163,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00200040,0x00008010,0x00000000, -0x00000000,0x80000001,0x00000001,0x00060000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00900080,0x00000173,0x00000000, -0x00000000,0x00000010,0x00800000,0x00900000, -0xf2c0000f,0x00000200,0x00000000,0x00010600, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000163,0x330300c2, -0x06000000,0x00000000,0x80008000,0x80008000, -0x3fc0000f,0x00000301,0x00010400,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00b00000,0x00d0806d,0x330480c3, -0x04800000,0x00000001,0x00800001,0x0000ffff, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x066a0600,0x06350070,0x0000929d,0x929d929d, -0x00000000,0x0000735a,0x00000600,0x00000000, -0x929d735a,0x00000000,0x00010000,0x735a735a, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x0000804f,0x000000c3, -0x05000000,0x00a00010,0x00000000,0x80008000, -0x00000000,0x00000000,0x00000700,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000080,0x00a00000,0x0000809a,0x000000c2, -0x07400000,0x00000000,0x80008000,0xffffffff, -0x00c80028,0x00005555,0x00000000,0x000107a0, -0x00c80028,0x000000c2,0x06800000,0x00000000, -0x06e00080,0x00300000,0x000080bb,0x000000c9, -0x07a00000,0x04000000,0x80008000,0xffffffff, -0x00c80028,0x00005555,0x00000000,0x00000780, -0x00c80028,0x000000c5,0xff800000,0x00000000, -0x00640080,0x00c00000,0x00008197,0x000000c9, -0x07800000,0x04000000,0x80008000,0xffffffff, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x0000805e,0x000000c1, -0x00000000,0x00800000,0x80008000,0x80008000, -0x00020000,0x0000ffff,0x00000000,0x00000000}; - -static u32 FillArray2[]={ -0x929d0600,0x929d929d,0x929d929d,0x929d0000, -0x929d929d,0x929d929d,0x929d929d,0x929d929d, -0x929d929d,0x00100635,0x060b013f,0x00000004, -0x00000001,0x007a0002,0x00000000,0x066e0610, -0x0105929d,0x929d929d,0x929d929d,0x929d929d, -0x929d929d,0xa431ac75,0x0001735a,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0x735a0051, -0x00000000,0x929d929d,0x929d929d,0x929d929d, -0x929d929d,0x929d929d,0x929d929d,0x929d929d, -0x929d929d,0x929d929d,0x00000000,0x06400136, -0x0000270f,0x00010000,0x007a0000,0x00000000, -0x068e0645,0x0105929d,0x929d929d,0x929d929d, -0x929d929d,0x929d929d,0xa431ac75,0x0001735a, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75, -0x735a0100,0x00000000,0x00000000,0x00000000}; - -static u32 FillArray3[]={ -0x00000000,0x00000000,0x00000000,0x00010004}; - -static u32 FillArray4[]={ -0x00040730,0x00001002,0x000f619e,0x00001003, -0x00001705,0x00001400,0x000a411e,0x00001003, -0x00040730,0x00001002,0x000f619e,0x00001003, -0x00009705,0x00001400,0x000a411e,0x00001003, -0x00040730,0x00001002,0x000f619e,0x00001003, -0x00011705,0x00001400,0x000a411e,0x00001003, -0x00040730,0x00001002,0x000f619e,0x00001003, -0x00019705,0x00001400,0x000a411e,0x00001003, -0x00040730,0x00001002,0x000f619e,0x00001003, -0x00021705,0x00001400,0x000a411e,0x00001003, -0x00040730,0x00001002,0x000f619e,0x00001003, -0x00029705,0x00001400,0x000a411e,0x00001003, -0x00040730,0x00001002,0x000f619e,0x00001003, -0x00031705,0x00001400,0x000a411e,0x00001003, -0x00040730,0x00001002,0x000f619e,0x00001003, -0x00039705,0x00001400,0x000a411e,0x00001003, -0x000fe19e,0x00001003,0x0009c730,0x00001003, -0x0008e19c,0x00001003,0x000083c1,0x00093040, -0x00098730,0x00001002,0x000ee19e,0x00001003, -0x00009705,0x00001400,0x000a211e,0x00001003, -0x00098730,0x00001002,0x000ee19e,0x00001003, -0x00011705,0x00001400,0x000a211e,0x00001003, -0x00098730,0x00001002,0x000ee19e,0x00001003, -0x00019705,0x00001400,0x000a211e,0x00001003, -0x00098730,0x00001002,0x000ee19e,0x00001003, -0x00021705,0x00001400,0x000a211e,0x00001003, -0x00098730,0x00001002,0x000ee19e,0x00001003, -0x00029705,0x00001400,0x000a211e,0x00001003, -0x00098730,0x00001002,0x000ee19e,0x00001003, -0x00031705,0x00001400,0x000a211e,0x00001003, -0x00098730,0x00001002,0x000ee19e,0x00001003, -0x00039705,0x00001400,0x000a211e,0x00001003, -0x0000a730,0x00001008,0x000e2730,0x00001002, -0x0000a731,0x00001002,0x0000a731,0x00001002, -0x0000a731,0x00001002,0x0000a731,0x00001002, -0x0000a731,0x00001002,0x0000a731,0x00001002, -0x00000000,0x00000000,0x000f619c,0x00001003, -0x0007f801,0x000c0000,0x00000037,0x00001000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x000c0000,0x00000000,0x00000000, -0x0000373c,0x00001000,0x00000000,0x00000000, -0x000ee19c,0x00001003,0x0007f801,0x000c0000, -0x00000037,0x00001000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x0000273c,0x00001000, -0x00000033,0x00001000,0x000e679e,0x00001003, -0x00007705,0x00001400,0x000ac71e,0x00001003, -0x00087fc1,0x000c3be0,0x0007f801,0x000c0000, -0x00000037,0x00001000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x0000a730,0x00001003, -0x00000033,0x00001000,0x0007f801,0x000c0000, -0x00000037,0x00001000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x000c0000, -0x00000032,0x00001000,0x0000273d,0x00001000, -0x0004a730,0x00001003,0x00000f41,0x00097140, -0x0000a841,0x0009b240,0x0000a0c1,0x0009f040, -0x0001c641,0x00093540,0x0001cec1,0x0009b5c0, -0x00000000,0x00000000,0x0001bf05,0x0003fc40, -0x00002725,0x000aa400,0x00013705,0x00093a00, -0x0000002e,0x0009d6c0,0x00038630,0x00001004, -0x0004ef0a,0x000eb785,0x0003fc8a,0x00000000, -0x00000000,0x000c70e0,0x0007d182,0x0002c640, -0x00000630,0x00001004,0x000799b8,0x0002c6c0, -0x00031705,0x00092240,0x00039f05,0x000932c0, -0x0003520a,0x00000000,0x00040731,0x0000100b, -0x00010705,0x000b20c0,0x00000000,0x000eba44, -0x00032108,0x000c60c4,0x00065208,0x000c2917, -0x000406b0,0x00001007,0x00012f05,0x00036880, -0x0002818e,0x000c0000,0x0004410a,0x00000000, -0x00040630,0x00001007,0x00029705,0x000c0000, -0x00000000,0x00000000,0x00003fc1,0x0003fc40, -0x000037c1,0x00091b40,0x00003fc1,0x000911c0, -0x000037c1,0x000957c0,0x00003fc1,0x000951c0, -0x000037c1,0x00000000,0x00003fc1,0x000991c0, -0x000037c1,0x00000000,0x00003fc1,0x0009d1c0, -0x000037c1,0x00000000,0x0001ccc1,0x000915c0, -0x0001c441,0x0009d800,0x0009cdc1,0x00091240, -0x0001c541,0x00091d00,0x0009cfc1,0x00095240, -0x0001c741,0x00095c80,0x000e8ca9,0x00099240, -0x000e85ad,0x00095640,0x00069ca9,0x00099d80, -0x000e952d,0x00099640,0x000eaca9,0x0009d6c0, -0x000ea5ad,0x00091a40,0x0006bca9,0x0009de80, -0x000eb52d,0x00095a40,0x000ecca9,0x00099ac0, -0x000ec5ad,0x0009da40,0x000edca9,0x0009d300, -0x000a6e0a,0x00001000,0x000ed52d,0x00091e40, -0x000eeca9,0x00095ec0,0x000ee5ad,0x00099e40, -0x0006fca9,0x00002500,0x000fb208,0x000c59a0, -0x000ef52d,0x0009de40,0x00068ca9,0x000912c1, -0x000683ad,0x00095241,0x00020f05,0x000991c1, -0x00000000,0x00000000,0x00086f88,0x00001000, -0x0009cf81,0x000b5340,0x0009c701,0x000b92c0, -0x0009de81,0x000bd300,0x0009d601,0x000b1700, -0x0001fd81,0x000b9d80,0x0009f501,0x000b57c0, -0x000a0f81,0x000bd740,0x00020701,0x000b5c80, -0x000a1681,0x000b97c0,0x00021601,0x00002500, -0x000a0701,0x000b9b40,0x000a0f81,0x000b1bc0, -0x00021681,0x00002d00,0x00020f81,0x000bd800, -0x000a0701,0x000b5bc0,0x00021601,0x00003500, -0x000a0f81,0x000b5f40,0x000a0701,0x000bdbc0, -0x00021681,0x00003d00,0x00020f81,0x000b1d00, -0x000a0701,0x000b1fc0,0x00021601,0x00020500, -0x00020f81,0x000b1341,0x000a0701,0x000b9fc0, -0x00021681,0x00020d00,0x00020f81,0x000bde80, -0x000a0701,0x000bdfc0,0x00021601,0x00021500, -0x00020f81,0x000b9341,0x00020701,0x000b53c1, -0x00021681,0x00021d00,0x000a0f81,0x000d0380, -0x0000b601,0x000b15c0,0x00007b01,0x00000000, -0x00007b81,0x000bd1c0,0x00007b01,0x00000000, -0x00007b81,0x000b91c0,0x00007b01,0x000b57c0, -0x00007b81,0x000b51c0,0x00007b01,0x000b1b40, -0x00007b81,0x000b11c0,0x00087b01,0x000c3dc0, -0x0007e488,0x000d7e45,0x00000000,0x000d7a44, -0x0007e48a,0x00000000,0x00011f05,0x00084080, -0x00000000,0x00000000,0x00001705,0x000b3540, -0x00008a01,0x000bf040,0x00007081,0x000bb5c0, -0x00055488,0x00000000,0x0000d482,0x0003fc40, -0x0003fc88,0x00000000,0x0001e401,0x000b3a00, -0x0001ec81,0x000bd6c0,0x0004ef08,0x000eb784, -0x000c86b0,0x00001007,0x00008281,0x000bb240, -0x0000b801,0x000b7140,0x00007888,0x00000000, -0x0000073c,0x00001000,0x0007f188,0x000c0000, -0x00000000,0x00000000,0x00055288,0x000c555c, -0x0005528a,0x000c0000,0x0009fa88,0x000c5d00, -0x0000fa88,0x00000000,0x00000032,0x00001000, -0x0000073d,0x00001000,0x0007f188,0x000c0000, -0x00000000,0x00000000,0x0008c01c,0x00001003, -0x00002705,0x00001008,0x0008b201,0x000c1392, -0x0000ba01,0x00000000,0x00008731,0x00001400, -0x0004c108,0x000fe0c4,0x00057488,0x00000000, -0x000a6388,0x00001001,0x0008b334,0x000bc141, -0x0003020e,0x00000000,0x000886b0,0x00001008, -0x00003625,0x000c5dfa,0x000a638a,0x00001001, -0x0008020e,0x00001002,0x0008a6b0,0x00001008, -0x0007f301,0x00000000,0x00000000,0x00000000, -0x00002725,0x000a8c40,0x000000ae,0x00000000, -0x000d8630,0x00001008,0x00000000,0x000c74e0, -0x0007d182,0x0002d640,0x000a8630,0x00001008, -0x000799b8,0x0002d6c0,0x0000748a,0x000c3ec5, -0x0007420a,0x000c0000,0x00062208,0x000c4117, -0x00070630,0x00001009,0x00000000,0x000c0000, -0x0001022e,0x00000000,0x0003a630,0x00001009, -0x00000000,0x000c0000,0x00000036,0x00001000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x0002a730,0x00001008,0x0007f801,0x000c0000, -0x00000037,0x00001000,0x00000000,0x00000000, -0x00000000,0x00000000,0x00000000,0x00000000, -0x00000000,0x00000000,0x0002a730,0x00001008, -0x00000033,0x00001000,0x0002a705,0x00001008, -0x00007a01,0x000c0000,0x000e6288,0x000d550a, -0x0006428a,0x00000000,0x00060730,0x0000100a, -0x00000000,0x000c0000,0x00000000,0x00000000, -0x0007aab0,0x00034880,0x00078fb0,0x0000100b, -0x00057488,0x00000000,0x00033b94,0x00081140, -0x000183ae,0x00000000,0x000786b0,0x0000100b, -0x00022f05,0x000c3545,0x0000eb8a,0x00000000, -0x00042731,0x00001003,0x0007aab0,0x00034880, -0x00048fb0,0x0000100a,0x00057488,0x00000000, -0x00033b94,0x00081140,0x000183ae,0x00000000, -0x000806b0,0x0000100b,0x00022f05,0x00000000, -0x00007401,0x00091140,0x00048f05,0x000951c0, -0x00042731,0x00001003,0x0000473d,0x00001000, -0x000f19b0,0x000bbc47,0x00080000,0x000bffc7, -0x000fe19e,0x00001003,0x00000000,0x00000000, -0x0008e19c,0x00001003,0x000083c1,0x00093040, -0x00000f41,0x00097140,0x0000a841,0x0009b240, -0x0000a0c1,0x0009f040,0x0001c641,0x00093540, -0x0001cec1,0x0009b5c0,0x00000000,0x000fdc44, -0x00055208,0x00000000,0x00010705,0x000a2880, -0x0000a23a,0x00093a00,0x0003fc8a,0x000df6c5, -0x0004ef0a,0x000c0000,0x00012f05,0x00036880, -0x00065308,0x000c2997,0x000d86b0,0x0000100a, -0x0004410a,0x000d40c7,0x00000000,0x00000000, -0x00080730,0x00001004,0x00056f0a,0x000ea105, -0x00000000,0x00000000,0x0000473d,0x00001000, -0x000f19b0,0x000bbc47,0x00080000,0x000bffc7, -0x0000273d,0x00001000,0x00000000,0x000eba44, -0x00048f05,0x0000f440,0x00007401,0x0000f7c0, -0x00000734,0x00001000,0x00010705,0x000a6880, -0x00006a88,0x000c75c4,0x00000000,0x000e5084, -0x00000000,0x000eba44,0x00087401,0x000e4782, -0x00000734,0x00001000,0x00010705,0x000a6880, -0x00006a88,0x000c75c4,0x0007c108,0x000c0000, -0x0007e721,0x000bed40,0x00005f25,0x000badc0, -0x0003ba97,0x000beb80,0x00065590,0x000b2e00, -0x00033217,0x00003ec0,0x00065590,0x000b8e40, -0x0003ed80,0x000491c0,0x00073fb0,0x00074c80, -0x000283a0,0x0000100c,0x000ee388,0x00042970, -0x00008301,0x00021ef2,0x000b8f14,0x0000000f, -0x000c4d8d,0x0000001b,0x000d6dc2,0x000e06c6, -0x000032ac,0x000c3916,0x0004edc2,0x00074c80, -0x00078898,0x00001000,0x00038894,0x00000032, -0x000c4d8d,0x00092e1b,0x000d6dc2,0x000e06c6, -0x0004edc2,0x000c1956,0x0000722c,0x00034a00, -0x00041705,0x0009ed40,0x00058730,0x00001400, -0x000d7488,0x000c3a00,0x00048f05,0x00000000}; - -static struct -{ u32 Offset; - u32 Size; - u32 *pFill; -} FillStat[FILL__COUNT] = { - {0x00000000, sizeof(FillArray1), FillArray1}, - {0x00001800, sizeof(FillArray2), FillArray2}, - {0x000137f0, sizeof(FillArray3), FillArray3}, - {0x00020000, sizeof(FillArray4), FillArray4} - }; - - -#endif diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c deleted file mode 100644 index 2a1f0d9ac96..00000000000 --- a/sound/oss/cs46xx.c +++ /dev/null @@ -1,5444 +0,0 @@ -/* - * Crystal SoundFusion CS46xx driver - * - * Copyright 1998-2001 Cirrus Logic Corporation <pcaudio@crystal.cirrus.com> - * <twoller@crystal.cirrus.com> - * Copyright 1999-2000 Jaroslav Kysela <perex@suse.cz> - * Copyright 2000 Alan Cox <alan@redhat.com> - * - * The core of this code is taken from the ALSA project driver by - * Jaroslav. Please send Jaroslav the credit for the driver and - * report bugs in this port to <alan@redhat.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * Current maintainers: - * Cirrus Logic Corporation, Thomas Woller (tw) - * <twoller@crystal.cirrus.com> - * Nils Faerber (nf) - * <nils@kernelconcepts.de> - * Thanks to David Pollard for testing. - * - * Changes: - * 20000909-nf Changed cs_read, cs_write and drain_dac - * 20001025-tw Separate Playback/Capture structs and buffers. - * Added Scatter/Gather support for Playback. - * Added Capture. - * 20001027-nf Port to kernel 2.4.0-test9, some clean-ups - * Start of powermanagement support (CS46XX_PM). - * 20001128-tw Add module parm for default buffer order. - * added DMA_GFP flag to kmalloc dma buffer allocs. - * backfill silence to eliminate stuttering on - * underruns. - * 20001201-tw add resyncing of swptr on underruns. - * 20001205-tw-nf fixed GETOSPACE ioctl() after open() - * 20010113-tw patch from Hans Grobler general cleanup. - * 20010117-tw 2.4.0 pci cleanup, wrapper code for 2.2.16-2.4.0 - * 20010118-tw basic PM support for 2.2.16+ and 2.4.0/2.4.2. - * 20010228-dh patch from David Huggins - cs_update_ptr recursion. - * 20010409-tw add hercules game theatre XP amp code. - * 20010420-tw cleanup powerdown/up code. - * 20010521-tw eliminate pops, and fixes for powerdown. - * 20010525-tw added fixes for thinkpads with powerdown logic. - * 20010723-sh patch from Horms (Simon Horman) - - * SOUND_PCM_READ_BITS returns bits as set in driver - * rather than a logical or of the possible values. - * Various ioctls handle the case where the device - * is open for reading or writing but not both better. - * - * Status: - * Playback/Capture supported from 8k-48k. - * 16Bit Signed LE & 8Bit Unsigned, with Mono or Stereo supported. - * - * APM/PM - 2.2.x APM is enabled and functioning fine. APM can also - * be enabled for 2.4.x by modifying the CS46XX_ACPI_SUPPORT macro - * definition. - * - * Hercules Game Theatre XP - the EGPIO2 pin controls the external Amp, - * so, use the drain/polarity to enable. - * hercules_egpio_disable set to 1, will force a 0 to EGPIODR. - * - * VTB Santa Cruz - the GPIO7/GPIO8 on the Secondary Codec control - * the external amplifier for the "back" speakers, since we do not - * support the secondary codec then this external amp is also not - * turned on. - */ - -#include <linux/interrupt.h> -#include <linux/list.h> -#include <linux/module.h> -#include <linux/string.h> -#include <linux/ioport.h> -#include <linux/sched.h> -#include <linux/delay.h> -#include <linux/sound.h> -#include <linux/slab.h> -#include <linux/soundcard.h> -#include <linux/pci.h> -#include <linux/bitops.h> -#include <linux/init.h> -#include <linux/poll.h> -#include <linux/ac97_codec.h> -#include <linux/mutex.h> -#include <linux/mm.h> - -#include <asm/io.h> -#include <asm/dma.h> -#include <asm/uaccess.h> - -#include "cs46xxpm.h" -#include "cs46xx_wrapper-24.h" -#include "cs461x.h" - -/* MIDI buffer sizes */ -#define CS_MIDIINBUF 500 -#define CS_MIDIOUTBUF 500 - -#define ADC_RUNNING 1 -#define DAC_RUNNING 2 - -#define CS_FMT_16BIT 1 /* These are fixed in fact */ -#define CS_FMT_STEREO 2 -#define CS_FMT_MASK 3 - -#define CS_TYPE_ADC 1 -#define CS_TYPE_DAC 2 - -#define CS_TRUE 1 -#define CS_FALSE 0 - -#define CS_INC_USE_COUNT(m) (atomic_inc(m)) -#define CS_DEC_USE_COUNT(m) (atomic_dec(m)) -#define CS_DEC_AND_TEST(m) (atomic_dec_and_test(m)) -#define CS_IN_USE(m) (atomic_read(m) != 0) - -#define CS_DBGBREAKPOINT {__asm__("INT $3");} -/* - * CS461x definitions - */ - -#define CS461X_BA0_SIZE 0x2000 -#define CS461X_BA1_DATA0_SIZE 0x3000 -#define CS461X_BA1_DATA1_SIZE 0x3800 -#define CS461X_BA1_PRG_SIZE 0x7000 -#define CS461X_BA1_REG_SIZE 0x0100 - -#define GOF_PER_SEC 200 - -#define CSDEBUG_INTERFACE 1 -#define CSDEBUG 1 -/* - * Turn on/off debugging compilation by using 1/0 respectively for CSDEBUG - * - * - * CSDEBUG is usual mode is set to 1, then use the - * cs_debuglevel and cs_debugmask to turn on or off debugging. - * Debug level of 1 has been defined to be kernel errors and info - * that should be printed on any released driver. - */ -#if CSDEBUG -#define CS_DBGOUT(mask,level,x) if ((cs_debuglevel >= (level)) && ((mask) & cs_debugmask)) {x;} -#else -#define CS_DBGOUT(mask,level,x) -#endif -/* - * cs_debugmask areas - */ -#define CS_INIT 0x00000001 /* initialization and probe functions */ -#define CS_ERROR 0x00000002 /* tmp debugging bit placeholder */ -#define CS_INTERRUPT 0x00000004 /* interrupt handler (separate from all other) */ -#define CS_FUNCTION 0x00000008 /* enter/leave functions */ -#define CS_WAVE_WRITE 0x00000010 /* write information for wave */ -#define CS_WAVE_READ 0x00000020 /* read information for wave */ -#define CS_MIDI_WRITE 0x00000040 /* write information for midi */ -#define CS_MIDI_READ 0x00000080 /* read information for midi */ -#define CS_MPU401_WRITE 0x00000100 /* write information for mpu401 */ -#define CS_MPU401_READ 0x00000200 /* read information for mpu401 */ -#define CS_OPEN 0x00000400 /* all open functions in the driver */ -#define CS_RELEASE 0x00000800 /* all release functions in the driver */ -#define CS_PARMS 0x00001000 /* functional and operational parameters */ -#define CS_IOCTL 0x00002000 /* ioctl (non-mixer) */ -#define CS_PM 0x00004000 /* PM */ -#define CS_TMP 0x10000000 /* tmp debug mask bit */ - -#define CS_IOCTL_CMD_SUSPEND 0x1 // suspend -#define CS_IOCTL_CMD_RESUME 0x2 // resume - -#if CSDEBUG -static unsigned long cs_debuglevel = 1; /* levels range from 1-9 */ -module_param(cs_debuglevel, ulong, 0644); -static unsigned long cs_debugmask = CS_INIT | CS_ERROR; /* use CS_DBGOUT with various mask values */ -module_param(cs_debugmask, ulong, 0644); -#endif -static unsigned long hercules_egpio_disable; /* if non-zero set all EGPIO to 0 */ -module_param(hercules_egpio_disable, ulong, 0); -static unsigned long initdelay = 700; /* PM delay in millisecs */ -module_param(initdelay, ulong, 0); -static unsigned long powerdown = -1; /* turn on/off powerdown processing in driver */ -module_param(powerdown, ulong, 0); -#define DMABUF_DEFAULTORDER 3 -static unsigned long defaultorder = DMABUF_DEFAULTORDER; -module_param(defaultorder, ulong, 0); - -static int external_amp; -module_param(external_amp, bool, 0); -static int thinkpad; -module_param(thinkpad, bool, 0); - -/* -* set the powerdown module parm to 0 to disable all -* powerdown. also set thinkpad to 1 to disable powerdown, -* but also to enable the clkrun functionality. -*/ -static unsigned cs_powerdown = 1; -static unsigned cs_laptop_wait = 1; - -/* An instance of the 4610 channel */ -struct cs_channel -{ - int used; - int num; - void *state; -}; - -#define CS46XX_MAJOR_VERSION "1" -#define CS46XX_MINOR_VERSION "28" - -#ifdef __ia64__ -#define CS46XX_ARCH "64" //architecture key -#else -#define CS46XX_ARCH "32" //architecture key -#endif - -static struct list_head cs46xx_devs = { &cs46xx_devs, &cs46xx_devs }; - -/* magic numbers to protect our data structures */ -#define CS_CARD_MAGIC 0x43525553 /* "CRUS" */ -#define CS_STATE_MAGIC 0x4c4f4749 /* "LOGI" */ -#define NR_HW_CH 3 - -/* maxinum number of AC97 codecs connected, AC97 2.0 defined 4 */ -#define NR_AC97 2 - -static const unsigned sample_size[] = { 1, 2, 2, 4 }; -static const unsigned sample_shift[] = { 0, 1, 1, 2 }; - -/* "software" or virtual channel, an instance of opened /dev/dsp */ -struct cs_state { - unsigned int magic; - struct cs_card *card; /* Card info */ - - /* single open lock mechanism, only used for recording */ - struct mutex open_mutex; - wait_queue_head_t open_wait; - - /* file mode */ - mode_t open_mode; - - /* virtual channel number */ - int virt; - - struct dmabuf { - /* wave sample stuff */ - unsigned int rate; - unsigned char fmt, enable; - - /* hardware channel */ - struct cs_channel *channel; - int pringbuf; /* Software ring slot */ - void *pbuf; /* 4K hardware DMA buffer */ - - /* OSS buffer management stuff */ - void *rawbuf; - dma_addr_t dma_handle; - unsigned buforder; - unsigned numfrag; - unsigned fragshift; - unsigned divisor; - unsigned type; - void *tmpbuff; /* tmp buffer for sample conversions */ - dma_addr_t dmaaddr; - dma_addr_t dmaaddr_tmpbuff; - unsigned buforder_tmpbuff; /* Log base 2 of size in bytes.. */ - - /* our buffer acts like a circular ring */ - unsigned hwptr; /* where dma last started, updated by update_ptr */ - unsigned swptr; /* where driver last clear/filled, updated by read/write */ - int count; /* bytes to be comsumed or been generated by dma machine */ - unsigned total_bytes; /* total bytes dmaed by hardware */ - unsigned blocks; /* total blocks */ - - unsigned error; /* number of over/underruns */ - unsigned underrun; /* underrun pending before next write has occurred */ - wait_queue_head_t wait; /* put process on wait queue when no more space in buffer */ - - /* redundant, but makes calculations easier */ - unsigned fragsize; - unsigned dmasize; - unsigned fragsamples; - - /* OSS stuff */ - unsigned mapped:1; - unsigned ready:1; - unsigned endcleared:1; - unsigned SGok:1; - unsigned update_flag; - unsigned ossfragshift; - int ossmaxfrags; - unsigned subdivision; - } dmabuf; - /* Guard against mmap/write/read races */ - struct mutex sem; -}; - -struct cs_card { - struct cs_channel channel[2]; - unsigned int magic; - - /* We keep cs461x cards in a linked list */ - struct cs_card *next; - - /* The cs461x has a certain amount of cross channel interaction - so we use a single per card lock */ - spinlock_t lock; - - /* Keep AC97 sane */ - spinlock_t ac97_lock; - - /* mixer use count */ - atomic_t mixer_use_cnt; - - /* PCI device stuff */ - struct pci_dev *pci_dev; - struct list_head list; - - unsigned int pctl, cctl; /* Hardware DMA flag sets */ - - /* soundcore stuff */ - int dev_audio; - int dev_midi; - - /* structures for abstraction of hardware facilities, codecs, banks and channels*/ - struct ac97_codec *ac97_codec[NR_AC97]; - struct cs_state *states[2]; - - u16 ac97_features; - - int amplifier; /* Amplifier control */ - void (*amplifier_ctrl)(struct cs_card *, int); - void (*amp_init)(struct cs_card *); - - int active; /* Active clocking */ - void (*active_ctrl)(struct cs_card *, int); - - /* hardware resources */ - unsigned long ba0_addr; - unsigned long ba1_addr; - u32 irq; - - /* mappings */ - void __iomem *ba0; - union - { - struct - { - u8 __iomem *data0; - u8 __iomem *data1; - u8 __iomem *pmem; - u8 __iomem *reg; - } name; - u8 __iomem *idx[4]; - } ba1; - - /* Function support */ - struct cs_channel *(*alloc_pcm_channel)(struct cs_card *); - struct cs_channel *(*alloc_rec_pcm_channel)(struct cs_card *); - void (*free_pcm_channel)(struct cs_card *, int chan); - - /* /dev/midi stuff */ - struct { - unsigned ird, iwr, icnt; - unsigned ord, owr, ocnt; - wait_queue_head_t open_wait; - wait_queue_head_t iwait; - wait_queue_head_t owait; - spinlock_t lock; - unsigned char ibuf[CS_MIDIINBUF]; - unsigned char obuf[CS_MIDIOUTBUF]; - mode_t open_mode; - struct mutex open_mutex; - } midi; - struct cs46xx_pm pm; -}; - -static int cs_open_mixdev(struct inode *inode, struct file *file); -static int cs_release_mixdev(struct inode *inode, struct file *file); -static int cs_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, - unsigned long arg); -static int cs_hardware_init(struct cs_card *card); -static int cs46xx_powerup(struct cs_card *card, unsigned int type); -static int cs461x_powerdown(struct cs_card *card, unsigned int type, int suspendflag); -static void cs461x_clear_serial_FIFOs(struct cs_card *card, int type); -#ifdef CONFIG_PM -static int cs46xx_suspend_tbl(struct pci_dev *pcidev, pm_message_t state); -static int cs46xx_resume_tbl(struct pci_dev *pcidev); -#endif - -#if CSDEBUG - -/* DEBUG ROUTINES */ - -#define SOUND_MIXER_CS_GETDBGLEVEL _SIOWR('M',120, int) -#define SOUND_MIXER_CS_SETDBGLEVEL _SIOWR('M',121, int) -#define SOUND_MIXER_CS_GETDBGMASK _SIOWR('M',122, int) -#define SOUND_MIXER_CS_SETDBGMASK _SIOWR('M',123, int) -#define SOUND_MIXER_CS_APM _SIOWR('M',124, int) - -static void printioctl(unsigned int x) -{ - unsigned int i; - unsigned char vidx; - /* these values are incorrect for the ac97 driver, fix. - * Index of mixtable1[] member is Device ID - * and must be <= SOUND_MIXER_NRDEVICES. - * Value of array member is index into s->mix.vol[] - */ - static const unsigned char mixtable1[SOUND_MIXER_NRDEVICES] = { - [SOUND_MIXER_PCM] = 1, /* voice */ - [SOUND_MIXER_LINE1] = 2, /* AUX */ - [SOUND_MIXER_CD] = 3, /* CD */ - [SOUND_MIXER_LINE] = 4, /* Line */ - [SOUND_MIXER_SYNTH] = 5, /* FM */ - [SOUND_MIXER_MIC] = 6, /* Mic */ - [SOUND_MIXER_SPEAKER] = 7, /* Speaker */ - [SOUND_MIXER_RECLEV] = 8, /* Recording level */ - [SOUND_MIXER_VOLUME] = 9 /* Master Volume */ - }; - - switch (x) { - case SOUND_MIXER_CS_GETDBGMASK: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_CS_GETDBGMASK: ") ); - break; - case SOUND_MIXER_CS_GETDBGLEVEL: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_CS_GETDBGLEVEL: ") ); - break; - case SOUND_MIXER_CS_SETDBGMASK: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_CS_SETDBGMASK: ") ); - break; - case SOUND_MIXER_CS_SETDBGLEVEL: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_CS_SETDBGLEVEL: ") ); - break; - case OSS_GETVERSION: - CS_DBGOUT(CS_IOCTL, 4, printk("OSS_GETVERSION: ") ); - break; - case SNDCTL_DSP_SYNC: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SYNC: ") ); - break; - case SNDCTL_DSP_SETDUPLEX: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SETDUPLEX: ") ); - break; - case SNDCTL_DSP_GETCAPS: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETCAPS: ") ); - break; - case SNDCTL_DSP_RESET: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_RESET: ") ); - break; - case SNDCTL_DSP_SPEED: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SPEED: ") ); - break; - case SNDCTL_DSP_STEREO: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_STEREO: ") ); - break; - case SNDCTL_DSP_CHANNELS: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_CHANNELS: ") ); - break; - case SNDCTL_DSP_GETFMTS: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETFMTS: ") ); - break; - case SNDCTL_DSP_SETFMT: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SETFMT: ") ); - break; - case SNDCTL_DSP_POST: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_POST: ") ); - break; - case SNDCTL_DSP_GETTRIGGER: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETTRIGGER: ") ); - break; - case SNDCTL_DSP_SETTRIGGER: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SETTRIGGER: ") ); - break; - case SNDCTL_DSP_GETOSPACE: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETOSPACE: ") ); - break; - case SNDCTL_DSP_GETISPACE: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETISPACE: ") ); - break; - case SNDCTL_DSP_NONBLOCK: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_NONBLOCK: ") ); - break; - case SNDCTL_DSP_GETODELAY: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETODELAY: ") ); - break; - case SNDCTL_DSP_GETIPTR: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETIPTR: ") ); - break; - case SNDCTL_DSP_GETOPTR: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETOPTR: ") ); - break; - case SNDCTL_DSP_GETBLKSIZE: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETBLKSIZE: ") ); - break; - case SNDCTL_DSP_SETFRAGMENT: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SETFRAGMENT: ") ); - break; - case SNDCTL_DSP_SUBDIVIDE: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SUBDIVIDE: ") ); - break; - case SOUND_PCM_READ_RATE: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_PCM_READ_RATE: ") ); - break; - case SOUND_PCM_READ_CHANNELS: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_PCM_READ_CHANNELS: ") ); - break; - case SOUND_PCM_READ_BITS: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_PCM_READ_BITS: ") ); - break; - case SOUND_PCM_WRITE_FILTER: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_PCM_WRITE_FILTER: ") ); - break; - case SNDCTL_DSP_SETSYNCRO: - CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SETSYNCRO: ") ); - break; - case SOUND_PCM_READ_FILTER: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_PCM_READ_FILTER: ") ); - break; - case SOUND_MIXER_PRIVATE1: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_PRIVATE1: ") ); - break; - case SOUND_MIXER_PRIVATE2: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_PRIVATE2: ") ); - break; - case SOUND_MIXER_PRIVATE3: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_PRIVATE3: ") ); - break; - case SOUND_MIXER_PRIVATE4: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_PRIVATE4: ") ); - break; - case SOUND_MIXER_PRIVATE5: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_PRIVATE5: ") ); - break; - case SOUND_MIXER_INFO: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_INFO: ") ); - break; - case SOUND_OLD_MIXER_INFO: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_OLD_MIXER_INFO: ") ); - break; - default: - switch (_IOC_NR(x)) { - case SOUND_MIXER_VOLUME: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_VOLUME: ") ); - break; - case SOUND_MIXER_SPEAKER: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_SPEAKER: ") ); - break; - case SOUND_MIXER_RECLEV: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_RECLEV: ") ); - break; - case SOUND_MIXER_MIC: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_MIC: ") ); - break; - case SOUND_MIXER_SYNTH: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_SYNTH: ") ); - break; - case SOUND_MIXER_RECSRC: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_RECSRC: ") ); - break; - case SOUND_MIXER_DEVMASK: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_DEVMASK: ") ); - break; - case SOUND_MIXER_RECMASK: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_RECMASK: ") ); - break; - case SOUND_MIXER_STEREODEVS: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_STEREODEVS: ") ); - break; - case SOUND_MIXER_CAPS: - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_CAPS:") ); - break; - default: - i = _IOC_NR(x); - if (i >= SOUND_MIXER_NRDEVICES || !(vidx = mixtable1[i])) { - CS_DBGOUT(CS_IOCTL, 4, printk("UNKNOWN IOCTL: 0x%.8x NR=%d ",x,i) ); - } else { - CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_IOCTL AC9x: 0x%.8x NR=%d ", - x,i)); - } - break; - } - } - CS_DBGOUT(CS_IOCTL, 4, printk("command = 0x%x IOC_NR=%d\n",x, _IOC_NR(x)) ); -} -#endif - -/* - * common I/O routines - */ - -static void cs461x_poke(struct cs_card *codec, unsigned long reg, unsigned int val) -{ - writel(val, codec->ba1.idx[(reg >> 16) & 3] + (reg & 0xffff)); -} - -static unsigned int cs461x_peek(struct cs_card *codec, unsigned long reg) -{ - return readl(codec->ba1.idx[(reg >> 16) & 3] + (reg & 0xffff)); -} - -static void cs461x_pokeBA0(struct cs_card *codec, unsigned long reg, unsigned int val) -{ - writel(val, codec->ba0 + reg); -} - -static unsigned int cs461x_peekBA0(struct cs_card *codec, unsigned long reg) -{ - return readl(codec->ba0 + reg); -} - - -static u16 cs_ac97_get(struct ac97_codec *dev, u8 reg); -static void cs_ac97_set(struct ac97_codec *dev, u8 reg, u16 data); - -static struct cs_channel *cs_alloc_pcm_channel(struct cs_card *card) -{ - if (card->channel[1].used == 1) - return NULL; - card->channel[1].used = 1; - card->channel[1].num = 1; - return &card->channel[1]; -} - -static struct cs_channel *cs_alloc_rec_pcm_channel(struct cs_card *card) -{ - if (card->channel[0].used == 1) - return NULL; - card->channel[0].used = 1; - card->channel[0].num = 0; - return &card->channel[0]; -} - -static void cs_free_pcm_channel(struct cs_card *card, int channel) -{ - card->channel[channel].state = NULL; - card->channel[channel].used = 0; -} - -/* - * setup a divisor value to help with conversion from - * 16bit Stereo, down to 8bit stereo/mono or 16bit mono. - * assign a divisor of 1 if using 16bit Stereo as that is - * the only format that the static image will capture. - */ -static void cs_set_divisor(struct dmabuf *dmabuf) -{ - if (dmabuf->type == CS_TYPE_DAC) - dmabuf->divisor = 1; - else if (!(dmabuf->fmt & CS_FMT_STEREO) && - (dmabuf->fmt & CS_FMT_16BIT)) - dmabuf->divisor = 2; - else if ((dmabuf->fmt & CS_FMT_STEREO) && - !(dmabuf->fmt & CS_FMT_16BIT)) - dmabuf->divisor = 2; - else if (!(dmabuf->fmt & CS_FMT_STEREO) && - !(dmabuf->fmt & CS_FMT_16BIT)) - dmabuf->divisor = 4; - else - dmabuf->divisor = 1; - - CS_DBGOUT(CS_PARMS | CS_FUNCTION, 8, printk( - "cs46xx: cs_set_divisor()- %s %d\n", - (dmabuf->type == CS_TYPE_ADC) ? "ADC" : "DAC", - dmabuf->divisor) ); -} - -/* -* mute some of the more prevalent registers to avoid popping. -*/ -static void cs_mute(struct cs_card *card, int state) -{ - struct ac97_codec *dev = card->ac97_codec[0]; - - CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_INFO "cs46xx: cs_mute()+ %s\n", - (state == CS_TRUE) ? "Muting" : "UnMuting")); - - if (state == CS_TRUE) { - /* - * fix pops when powering up on thinkpads - */ - card->pm.u32AC97_master_volume = (u32)cs_ac97_get( dev, - (u8)BA0_AC97_MASTER_VOLUME); - card->pm.u32AC97_headphone_volume = (u32)cs_ac97_get(dev, - (u8)BA0_AC97_HEADPHONE_VOLUME); - card->pm.u32AC97_master_volume_mono = (u32)cs_ac97_get(dev, - (u8)BA0_AC97_MASTER_VOLUME_MONO); - card->pm.u32AC97_pcm_out_volume = (u32)cs_ac97_get(dev, - (u8)BA0_AC97_PCM_OUT_VOLUME); - - cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME, 0x8000); - cs_ac97_set(dev, (u8)BA0_AC97_HEADPHONE_VOLUME, 0x8000); - cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME_MONO, 0x8000); - cs_ac97_set(dev, (u8)BA0_AC97_PCM_OUT_VOLUME, 0x8000); - } else { - cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME, card->pm.u32AC97_master_volume); - cs_ac97_set(dev, (u8)BA0_AC97_HEADPHONE_VOLUME, card->pm.u32AC97_headphone_volume); - cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME_MONO, card->pm.u32AC97_master_volume_mono); - cs_ac97_set(dev, (u8)BA0_AC97_PCM_OUT_VOLUME, card->pm.u32AC97_pcm_out_volume); - } - CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_INFO "cs46xx: cs_mute()-\n")); -} - -/* set playback sample rate */ -static unsigned int cs_set_dac_rate(struct cs_state * state, unsigned int rate) -{ - struct dmabuf *dmabuf = &state->dmabuf; - unsigned int tmp1, tmp2; - unsigned int phiIncr; - unsigned int correctionPerGOF, correctionPerSec; - unsigned long flags; - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_set_dac_rate()+ %d\n",rate) ); - - /* - * Compute the values used to drive the actual sample rate conversion. - * The following formulas are being computed, using inline assembly - * since we need to use 64 bit arithmetic to compute the values: - * - * phiIncr = floor((Fs,in * 2^26) / Fs,out) - * correctionPerGOF = floor((Fs,in * 2^26 - Fs,out * phiIncr) / - * GOF_PER_SEC) - * ulCorrectionPerSec = Fs,in * 2^26 - Fs,out * phiIncr -M - * GOF_PER_SEC * correctionPerGOF - * - * i.e. - * - * phiIncr:other = dividend:remainder((Fs,in * 2^26) / Fs,out) - * correctionPerGOF:correctionPerSec = - * dividend:remainder(ulOther / GOF_PER_SEC) - */ - tmp1 = rate << 16; - phiIncr = tmp1 / 48000; - tmp1 -= phiIncr * 48000; - tmp1 <<= 10; - phiIncr <<= 10; - tmp2 = tmp1 / 48000; - phiIncr += tmp2; - tmp1 -= tmp2 * 48000; - correctionPerGOF = tmp1 / GOF_PER_SEC; - tmp1 -= correctionPerGOF * GOF_PER_SEC; - correctionPerSec = tmp1; - - /* - * Fill in the SampleRateConverter control block. - */ - spin_lock_irqsave(&state->card->lock, flags); - cs461x_poke(state->card, BA1_PSRC, - ((correctionPerSec << 16) & 0xFFFF0000) | (correctionPerGOF & 0xFFFF)); - cs461x_poke(state->card, BA1_PPI, phiIncr); - spin_unlock_irqrestore(&state->card->lock, flags); - dmabuf->rate = rate; - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_set_dac_rate()- %d\n",rate) ); - return rate; -} - -/* set recording sample rate */ -static unsigned int cs_set_adc_rate(struct cs_state *state, unsigned int rate) -{ - struct dmabuf *dmabuf = &state->dmabuf; - struct cs_card *card = state->card; - unsigned int phiIncr, coeffIncr, tmp1, tmp2; - unsigned int correctionPerGOF, correctionPerSec, initialDelay; - unsigned int frameGroupLength, cnt; - unsigned long flags; - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_set_adc_rate()+ %d\n",rate) ); - - /* - * We can only decimate by up to a factor of 1/9th the hardware rate. - * Correct the value if an attempt is made to stray outside that limit. - */ - if ((rate * 9) < 48000) - rate = 48000 / 9; - - /* - * We cannot capture at at rate greater than the Input Rate (48000). - * Return an error if an attempt is made to stray outside that limit. - */ - if (rate > 48000) - rate = 48000; - - /* - * Compute the values used to drive the actual sample rate conversion. - * The following formulas are being computed, using inline assembly - * since we need to use 64 bit arithmetic to compute the values: - * - * coeffIncr = -floor((Fs,out * 2^23) / Fs,in) - * phiIncr = floor((Fs,in * 2^26) / Fs,out) - * correctionPerGOF = floor((Fs,in * 2^26 - Fs,out * phiIncr) / - * GOF_PER_SEC) - * correctionPerSec = Fs,in * 2^26 - Fs,out * phiIncr - - * GOF_PER_SEC * correctionPerGOF - * initialDelay = ceil((24 * Fs,in) / Fs,out) - * - * i.e. - * - * coeffIncr = neg(dividend((Fs,out * 2^23) / Fs,in)) - * phiIncr:ulOther = dividend:remainder((Fs,in * 2^26) / Fs,out) - * correctionPerGOF:correctionPerSec = - * dividend:remainder(ulOther / GOF_PER_SEC) - * initialDelay = dividend(((24 * Fs,in) + Fs,out - 1) / Fs,out) - */ - tmp1 = rate << 16; - coeffIncr = tmp1 / 48000; - tmp1 -= coeffIncr * 48000; - tmp1 <<= 7; - coeffIncr <<= 7; - coeffIncr += tmp1 / 48000; - coeffIncr ^= 0xFFFFFFFF; - coeffIncr++; - tmp1 = 48000 << 16; - phiIncr = tmp1 / rate; - tmp1 -= phiIncr * rate; - tmp1 <<= 10; - phiIncr <<= 10; - tmp2 = tmp1 / rate; - phiIncr += tmp2; - tmp1 -= tmp2 * rate; - correctionPerGOF = tmp1 / GOF_PER_SEC; - tmp1 -= correctionPerGOF * GOF_PER_SEC; - correctionPerSec = tmp1; - initialDelay = ((48000 * 24) + rate - 1) / rate; - - /* - * Fill in the VariDecimate control block. - */ - spin_lock_irqsave(&card->lock, flags); - cs461x_poke(card, BA1_CSRC, - ((correctionPerSec << 16) & 0xFFFF0000) | (correctionPerGOF & 0xFFFF)); - cs461x_poke(card, BA1_CCI, coeffIncr); - cs461x_poke(card, BA1_CD, - (((BA1_VARIDEC_BUF_1 + (initialDelay << 2)) << 16) & 0xFFFF0000) | 0x80); - cs461x_poke(card, BA1_CPI, phiIncr); - spin_unlock_irqrestore(&card->lock, flags); - - /* - * Figure out the frame group length for the write back task. Basically, - * this is just the factors of 24000 (2^6*3*5^3) that are not present in - * the output sample rate. - */ - frameGroupLength = 1; - for (cnt = 2; cnt <= 64; cnt *= 2) { - if (((rate / cnt) * cnt) != rate) - frameGroupLength *= 2; - } - if (((rate / 3) * 3) != rate) { - frameGroupLength *= 3; - } - for (cnt = 5; cnt <= 125; cnt *= 5) { - if (((rate / cnt) * cnt) != rate) - frameGroupLength *= 5; - } - - /* - * Fill in the WriteBack control block. - */ - spin_lock_irqsave(&card->lock, flags); - cs461x_poke(card, BA1_CFG1, frameGroupLength); - cs461x_poke(card, BA1_CFG2, (0x00800000 | frameGroupLength)); - cs461x_poke(card, BA1_CCST, 0x0000FFFF); - cs461x_poke(card, BA1_CSPB, ((65536 * rate) / 24000)); - cs461x_poke(card, (BA1_CSPB + 4), 0x0000FFFF); - spin_unlock_irqrestore(&card->lock, flags); - dmabuf->rate = rate; - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_set_adc_rate()- %d\n",rate) ); - return rate; -} - -/* prepare channel attributes for playback */ -static void cs_play_setup(struct cs_state *state) -{ - struct dmabuf *dmabuf = &state->dmabuf; - struct cs_card *card = state->card; - unsigned int tmp, Count, playFormat; - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_play_setup()+\n") ); - cs461x_poke(card, BA1_PVOL, 0x80008000); - if (!dmabuf->SGok) - cs461x_poke(card, BA1_PBA, virt_to_bus(dmabuf->pbuf)); - - Count = 4; - playFormat=cs461x_peek(card, BA1_PFIE); - if ((dmabuf->fmt & CS_FMT_STEREO)) { - playFormat &= ~DMA_RQ_C2_AC_MONO_TO_STEREO; - Count *= 2; - } else - playFormat |= DMA_RQ_C2_AC_MONO_TO_STEREO; - - if ((dmabuf->fmt & CS_FMT_16BIT)) { - playFormat &= ~(DMA_RQ_C2_AC_8_TO_16_BIT - | DMA_RQ_C2_AC_SIGNED_CONVERT); - Count *= 2; - } else - playFormat |= (DMA_RQ_C2_AC_8_TO_16_BIT - | DMA_RQ_C2_AC_SIGNED_CONVERT); - - cs461x_poke(card, BA1_PFIE, playFormat); - - tmp = cs461x_peek(card, BA1_PDTC); - tmp &= 0xfffffe00; - cs461x_poke(card, BA1_PDTC, tmp | --Count); - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_play_setup()-\n") ); -} - -static struct InitStruct -{ - u32 off; - u32 val; -} InitArray[] = { {0x00000040, 0x3fc0000f}, - {0x0000004c, 0x04800000}, - - {0x000000b3, 0x00000780}, - {0x000000b7, 0x00000000}, - {0x000000bc, 0x07800000}, - - {0x000000cd, 0x00800000}, - }; - -/* - * "SetCaptureSPValues()" -- Initialize record task values before each - * capture startup. - */ -static void SetCaptureSPValues(struct cs_card *card) -{ - unsigned i, offset; - CS_DBGOUT(CS_FUNCTION, 8, printk("cs46xx: SetCaptureSPValues()+\n") ); - for (i = 0; i < sizeof(InitArray) / sizeof(struct InitStruct); i++) { - offset = InitArray[i].off*4; /* 8bit to 32bit offset value */ - cs461x_poke(card, offset, InitArray[i].val ); - } - CS_DBGOUT(CS_FUNCTION, 8, printk("cs46xx: SetCaptureSPValues()-\n") ); -} - -/* prepare channel attributes for recording */ -static void cs_rec_setup(struct cs_state *state) -{ - struct cs_card *card = state->card; - struct dmabuf *dmabuf = &state->dmabuf; - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_rec_setup()+\n")); - SetCaptureSPValues(card); - - /* - * set the attenuation to 0dB - */ - cs461x_poke(card, BA1_CVOL, 0x80008000); - - /* - * set the physical address of the capture buffer into the SP - */ - cs461x_poke(card, BA1_CBA, virt_to_bus(dmabuf->rawbuf)); - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_rec_setup()-\n") ); -} - - -/* get current playback/recording dma buffer pointer (byte offset from LBA), - called with spinlock held! */ - -static inline unsigned cs_get_dma_addr(struct cs_state *state) -{ - struct dmabuf *dmabuf = &state->dmabuf; - u32 offset; - - if ( (!(dmabuf->enable & DAC_RUNNING)) && - (!(dmabuf->enable & ADC_RUNNING) ) ) - { - CS_DBGOUT(CS_ERROR, 2, printk( - "cs46xx: ERROR cs_get_dma_addr(): not enabled \n") ); - return 0; - } - - /* - * granularity is byte boundary, good part. - */ - if (dmabuf->enable & DAC_RUNNING) - offset = cs461x_peek(state->card, BA1_PBA); - else /* ADC_RUNNING must be set */ - offset = cs461x_peek(state->card, BA1_CBA); - - CS_DBGOUT(CS_PARMS | CS_FUNCTION, 9, - printk("cs46xx: cs_get_dma_addr() %d\n",offset) ); - offset = (u32)bus_to_virt((unsigned long)offset) - (u32)dmabuf->rawbuf; - CS_DBGOUT(CS_PARMS | CS_FUNCTION, 8, - printk("cs46xx: cs_get_dma_addr()- %d\n",offset) ); - return offset; -} - -static void resync_dma_ptrs(struct cs_state *state) -{ - struct dmabuf *dmabuf; - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: resync_dma_ptrs()+ \n") ); - if (state) { - dmabuf = &state->dmabuf; - dmabuf->hwptr=dmabuf->swptr = 0; - dmabuf->pringbuf = 0; - } - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: resync_dma_ptrs()- \n") ); -} - -/* Stop recording (lock held) */ -static inline void __stop_adc(struct cs_state *state) -{ - struct dmabuf *dmabuf = &state->dmabuf; - struct cs_card *card = state->card; - unsigned int tmp; - - dmabuf->enable &= ~ADC_RUNNING; - - tmp = cs461x_peek(card, BA1_CCTL); - tmp &= 0xFFFF0000; - cs461x_poke(card, BA1_CCTL, tmp ); -} - -static void stop_adc(struct cs_state *state) -{ - unsigned long flags; - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: stop_adc()+ \n") ); - spin_lock_irqsave(&state->card->lock, flags); - __stop_adc(state); - spin_unlock_irqrestore(&state->card->lock, flags); - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: stop_adc()- \n") ); -} - -static void start_adc(struct cs_state *state) -{ - struct dmabuf *dmabuf = &state->dmabuf; - struct cs_card *card = state->card; - unsigned long flags; - unsigned int tmp; - - spin_lock_irqsave(&card->lock, flags); - if (!(dmabuf->enable & ADC_RUNNING) && - ((dmabuf->mapped || dmabuf->count < (signed)dmabuf->dmasize) - && dmabuf->ready) && - ((card->pm.flags & CS46XX_PM_IDLE) || - (card->pm.flags & CS46XX_PM_RESUMED)) ) - { - dmabuf->enable |= ADC_RUNNING; - cs_set_divisor(dmabuf); - tmp = cs461x_peek(card, BA1_CCTL); - tmp &= 0xFFFF0000; - tmp |= card->cctl; - CS_DBGOUT(CS_FUNCTION, 2, printk( - "cs46xx: start_adc() poke 0x%x \n",tmp) ); - cs461x_poke(card, BA1_CCTL, tmp); - } - spin_unlock_irqrestore(&card->lock, flags); -} - -/* stop playback (lock held) */ -static inline void __stop_dac(struct cs_state *state) -{ - struct dmabuf *dmabuf = &state->dmabuf; - struct cs_card *card = state->card; - unsigned int tmp; - - dmabuf->enable &= ~DAC_RUNNING; - - tmp=cs461x_peek(card, BA1_PCTL); - tmp&=0xFFFF; - cs461x_poke(card, BA1_PCTL, tmp); -} - -static void stop_dac(struct cs_state *state) -{ - unsigned long flags; - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: stop_dac()+ \n") ); - spin_lock_irqsave(&state->card->lock, flags); - __stop_dac(state); - spin_unlock_irqrestore(&state->card->lock, flags); - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: stop_dac()- \n") ); -} - -static void start_dac(struct cs_state *state) -{ - struct dmabuf *dmabuf = &state->dmabuf; - struct cs_card *card = state->card; - unsigned long flags; - int tmp; - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: start_dac()+ \n") ); - spin_lock_irqsave(&card->lock, flags); - if (!(dmabuf->enable & DAC_RUNNING) && - ((dmabuf->mapped || dmabuf->count > 0) && dmabuf->ready) && - ((card->pm.flags & CS46XX_PM_IDLE) || - (card->pm.flags & CS46XX_PM_RESUMED)) ) - { - dmabuf->enable |= DAC_RUNNING; - tmp = cs461x_peek(card, BA1_PCTL); - tmp &= 0xFFFF; - tmp |= card->pctl; - CS_DBGOUT(CS_PARMS, 6, printk( - "cs46xx: start_dac() poke card=%p tmp=0x%.08x addr=%p \n", - card, (unsigned)tmp, - card->ba1.idx[(BA1_PCTL >> 16) & 3]+(BA1_PCTL&0xffff) ) ); - cs461x_poke(card, BA1_PCTL, tmp); - } - spin_unlock_irqrestore(&card->lock, flags); - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: start_dac()- \n") ); -} - -#define DMABUF_MINORDER 1 - -/* - * allocate DMA buffer, playback and recording buffers are separate. - */ -static int alloc_dmabuf(struct cs_state *state) -{ - - struct cs_card *card=state->card; - struct dmabuf *dmabuf = &state->dmabuf; - void *rawbuf = NULL; - void *tmpbuff = NULL; - int order; - struct page *map, *mapend; - unsigned long df; - - dmabuf->ready = dmabuf->mapped = 0; - dmabuf->SGok = 0; -/* -* check for order within limits, but do not overwrite value. -*/ - if ((defaultorder > 1) && (defaultorder < 12)) - df = defaultorder; - else - df = 2; - - for (order = df; order >= DMABUF_MINORDER; order--) - if ((rawbuf = (void *)pci_alloc_consistent( - card->pci_dev, PAGE_SIZE << order, &dmabuf->dmaaddr))) - break; - if (!rawbuf) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_ERR - "cs46xx: alloc_dmabuf(): unable to allocate rawbuf\n")); - return -ENOMEM; - } - dmabuf->buforder = order; - dmabuf->rawbuf = rawbuf; - // Now mark the pages as reserved; otherwise the - // remap_pfn_range() in cs46xx_mmap doesn't work. - // 1. get index to last page in mem_map array for rawbuf. - mapend = virt_to_page(dmabuf->rawbuf + - (PAGE_SIZE << dmabuf->buforder) - 1); - - // 2. mark each physical page in range as 'reserved'. - for (map = virt_to_page(dmabuf->rawbuf); map <= mapend; map++) - cs4x_mem_map_reserve(map); - - CS_DBGOUT(CS_PARMS, 9, printk("cs46xx: alloc_dmabuf(): allocated %ld (order = %d) bytes at %p\n", - PAGE_SIZE << order, order, rawbuf) ); - -/* -* only allocate the conversion buffer for the ADC -*/ - if (dmabuf->type == CS_TYPE_DAC) { - dmabuf->tmpbuff = NULL; - dmabuf->buforder_tmpbuff = 0; - return 0; - } -/* - * now the temp buffer for 16/8 conversions - */ - - tmpbuff = (void *) pci_alloc_consistent( - card->pci_dev, PAGE_SIZE << order, &dmabuf->dmaaddr_tmpbuff); - - if (!tmpbuff) - return -ENOMEM; - CS_DBGOUT(CS_PARMS, 9, printk("cs46xx: allocated %ld (order = %d) bytes at %p\n", - PAGE_SIZE << order, order, tmpbuff) ); - - dmabuf->tmpbuff = tmpbuff; - dmabuf->buforder_tmpbuff = order; - - // Now mark the pages as reserved; otherwise the - // remap_pfn_range() in cs46xx_mmap doesn't work. - // 1. get index to last page in mem_map array for rawbuf. - mapend = virt_to_page(dmabuf->tmpbuff + - (PAGE_SIZE << dmabuf->buforder_tmpbuff) - 1); - - // 2. mark each physical page in range as 'reserved'. - for (map = virt_to_page(dmabuf->tmpbuff); map <= mapend; map++) - cs4x_mem_map_reserve(map); - return 0; -} - -/* free DMA buffer */ -static void dealloc_dmabuf(struct cs_state *state) -{ - struct dmabuf *dmabuf = &state->dmabuf; - struct page *map, *mapend; - - if (dmabuf->rawbuf) { - // Undo prog_dmabuf()'s marking the pages as reserved - mapend = virt_to_page(dmabuf->rawbuf + - (PAGE_SIZE << dmabuf->buforder) - 1); - for (map = virt_to_page(dmabuf->rawbuf); map <= mapend; map++) - cs4x_mem_map_unreserve(map); - free_dmabuf(state->card, dmabuf); - } - - if (dmabuf->tmpbuff) { - // Undo prog_dmabuf()'s marking the pages as reserved - mapend = virt_to_page(dmabuf->tmpbuff + - (PAGE_SIZE << dmabuf->buforder_tmpbuff) - 1); - for (map = virt_to_page(dmabuf->tmpbuff); map <= mapend; map++) - cs4x_mem_map_unreserve(map); - free_dmabuf2(state->card, dmabuf); - } - - dmabuf->rawbuf = NULL; - dmabuf->tmpbuff = NULL; - dmabuf->mapped = dmabuf->ready = 0; - dmabuf->SGok = 0; -} - -static int __prog_dmabuf(struct cs_state *state) -{ - struct dmabuf *dmabuf = &state->dmabuf; - unsigned long flags; - unsigned long allocated_pages, allocated_bytes; - unsigned long tmp1, tmp2, fmt=0; - unsigned long *ptmp = (unsigned long *) dmabuf->pbuf; - unsigned long SGarray[9], nSGpages=0; - int ret; - - CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf()+ \n")); -/* - * check for CAPTURE and use only non-sg for initial release - */ - if (dmabuf->type == CS_TYPE_ADC) { - CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf() ADC\n")); - /* - * add in non-sg support for capture. - */ - spin_lock_irqsave(&state->card->lock, flags); - /* add code to reset the rawbuf memory. TRW */ - resync_dma_ptrs(state); - dmabuf->total_bytes = dmabuf->blocks = 0; - dmabuf->count = dmabuf->error = dmabuf->underrun = 0; - - dmabuf->SGok = 0; - - spin_unlock_irqrestore(&state->card->lock, flags); - - /* allocate DMA buffer if not allocated yet */ - if (!dmabuf->rawbuf || !dmabuf->tmpbuff) - if ((ret = alloc_dmabuf(state))) - return ret; - /* - * static image only supports 16Bit signed, stereo - hard code fmt - */ - fmt = CS_FMT_16BIT | CS_FMT_STEREO; - - dmabuf->numfrag = 2; - dmabuf->fragsize = 2048; - dmabuf->fragsamples = 2048 >> sample_shift[fmt]; - dmabuf->dmasize = 4096; - dmabuf->fragshift = 11; - - memset(dmabuf->rawbuf, (fmt & CS_FMT_16BIT) ? 0 : 0x80, - dmabuf->dmasize); - memset(dmabuf->tmpbuff, (fmt & CS_FMT_16BIT) ? 0 : 0x80, - PAGE_SIZE<<dmabuf->buforder_tmpbuff); - - /* - * Now set up the ring - */ - - spin_lock_irqsave(&state->card->lock, flags); - cs_rec_setup(state); - spin_unlock_irqrestore(&state->card->lock, flags); - - /* set the ready flag for the dma buffer */ - dmabuf->ready = 1; - - CS_DBGOUT(CS_PARMS, 4, printk( - "cs46xx: prog_dmabuf(): CAPTURE rate=%d fmt=0x%x numfrag=%d " - "fragsize=%d dmasize=%d\n", - dmabuf->rate, dmabuf->fmt, dmabuf->numfrag, - dmabuf->fragsize, dmabuf->dmasize) ); - - CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf()- 0 \n")); - return 0; - } else if (dmabuf->type == CS_TYPE_DAC) { - /* - * Must be DAC - */ - CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf() DAC\n")); - spin_lock_irqsave(&state->card->lock, flags); - resync_dma_ptrs(state); - dmabuf->total_bytes = dmabuf->blocks = 0; - dmabuf->count = dmabuf->error = dmabuf->underrun = 0; - - dmabuf->SGok = 0; - - spin_unlock_irqrestore(&state->card->lock, flags); - - /* allocate DMA buffer if not allocated yet */ - if (!dmabuf->rawbuf) - if ((ret = alloc_dmabuf(state))) - return ret; - - allocated_pages = 1 << dmabuf->buforder; - allocated_bytes = allocated_pages*PAGE_SIZE; - - if (allocated_pages < 2) { - CS_DBGOUT(CS_FUNCTION, 4, printk( - "cs46xx: prog_dmabuf() Error: allocated_pages too small (%d)\n", - (unsigned)allocated_pages)); - return -ENOMEM; - } - - /* Use all the pages allocated, fragsize 4k. */ - /* Use 'pbuf' for S/G page map table. */ - dmabuf->SGok = 1; /* Use S/G. */ - - nSGpages = allocated_bytes/4096; /* S/G pages always 4k. */ - - /* Set up S/G variables. */ - *ptmp = virt_to_bus(dmabuf->rawbuf); - *(ptmp + 1) = 0x00000008; - for (tmp1 = 1; tmp1 < nSGpages; tmp1++) { - *(ptmp + 2 * tmp1) = virt_to_bus((dmabuf->rawbuf) + 4096 * tmp1); - if (tmp1 == nSGpages - 1) - tmp2 = 0xbfff0000; - else - tmp2 = 0x80000000 + 8 * (tmp1 + 1); - *(ptmp + 2 * tmp1 + 1) = tmp2; - } - SGarray[0] = 0x82c0200d; - SGarray[1] = 0xffff0000; - SGarray[2] = *ptmp; - SGarray[3] = 0x00010600; - SGarray[4] = *(ptmp+2); - SGarray[5] = 0x80000010; - SGarray[6] = *ptmp; - SGarray[7] = *(ptmp+2); - SGarray[8] = (virt_to_bus(dmabuf->pbuf) & 0xffff000) | 0x10; - - if (dmabuf->SGok) { - dmabuf->numfrag = nSGpages; - dmabuf->fragsize = 4096; - dmabuf->fragsamples = 4096 >> sample_shift[dmabuf->fmt]; - dmabuf->fragshift = 12; - dmabuf->dmasize = dmabuf->numfrag * 4096; - } else { - SGarray[0] = 0xf2c0000f; - SGarray[1] = 0x00000200; - SGarray[2] = 0; - SGarray[3] = 0x00010600; - SGarray[4]=SGarray[5]=SGarray[6]=SGarray[7]=SGarray[8] = 0; - dmabuf->numfrag = 2; - dmabuf->fragsize = 2048; - dmabuf->fragsamples = 2048 >> sample_shift[dmabuf->fmt]; - dmabuf->dmasize = 4096; - dmabuf->fragshift = 11; - } - for (tmp1 = 0; tmp1 < sizeof(SGarray) / 4; tmp1++) - cs461x_poke(state->card, BA1_PDTC+tmp1 * 4, SGarray[tmp1]); - - memset(dmabuf->rawbuf, (dmabuf->fmt & CS_FMT_16BIT) ? 0 : 0x80, - dmabuf->dmasize); - - /* - * Now set up the ring - */ - - spin_lock_irqsave(&state->card->lock, flags); - cs_play_setup(state); - spin_unlock_irqrestore(&state->card->lock, flags); - - /* set the ready flag for the dma buffer */ - dmabuf->ready = 1; - - CS_DBGOUT(CS_PARMS, 4, printk( - "cs46xx: prog_dmabuf(): PLAYBACK rate=%d fmt=0x%x numfrag=%d " - "fragsize=%d dmasize=%d\n", - dmabuf->rate, dmabuf->fmt, dmabuf->numfrag, - dmabuf->fragsize, dmabuf->dmasize) ); - - CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf()- \n")); - return 0; - } else { - CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf()- Invalid Type %d\n", - dmabuf->type)); - } - return 1; -} - -static int prog_dmabuf(struct cs_state *state) -{ - int ret; - - mutex_lock(&state->sem); - ret = __prog_dmabuf(state); - mutex_unlock(&state->sem); - - return ret; -} - -static void cs_clear_tail(struct cs_state *state) -{ -} - -static int drain_dac(struct cs_state *state, int nonblock) -{ - DECLARE_WAITQUEUE(wait, current); - struct dmabuf *dmabuf = &state->dmabuf; - struct cs_card *card=state->card; - unsigned long flags; - unsigned long tmo; - int count; - - CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: drain_dac()+ \n")); - if (dmabuf->mapped || !dmabuf->ready) - { - CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: drain_dac()- 0, not ready\n")); - return 0; - } - - add_wait_queue(&dmabuf->wait, &wait); - for (;;) { - /* It seems that we have to set the current state to TASK_INTERRUPTIBLE - every time to make the process really go to sleep */ - current->state = TASK_INTERRUPTIBLE; - - spin_lock_irqsave(&state->card->lock, flags); - count = dmabuf->count; - spin_unlock_irqrestore(&state->card->lock, flags); - - if (count <= 0) - break; - - if (signal_pending(current)) - break; - - if (nonblock) { - remove_wait_queue(&dmabuf->wait, &wait); - current->state = TASK_RUNNING; - return -EBUSY; - } - - tmo = (dmabuf->dmasize * HZ) / dmabuf->rate; - tmo >>= sample_shift[dmabuf->fmt]; - tmo += (2048*HZ)/dmabuf->rate; - - if (!schedule_timeout(tmo ? tmo : 1) && tmo){ - printk(KERN_ERR "cs46xx: drain_dac, dma timeout? %d\n", count); - break; - } - } - remove_wait_queue(&dmabuf->wait, &wait); - current->state = TASK_RUNNING; - if (signal_pending(current)) { - CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: drain_dac()- -ERESTARTSYS\n")); - /* - * set to silence and let that clear the fifos. - */ - cs461x_clear_serial_FIFOs(card, CS_TYPE_DAC); - return -ERESTARTSYS; - } - - CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: drain_dac()- 0\n")); - return 0; -} - - -/* update buffer manangement pointers, especially, dmabuf->count and dmabuf->hwptr */ -static void cs_update_ptr(struct cs_card *card, int wake) -{ - struct cs_state *state; - struct dmabuf *dmabuf; - unsigned hwptr; - int diff; - - /* error handling and process wake up for ADC */ - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - if (dmabuf->enable & ADC_RUNNING) { - /* update hardware pointer */ - hwptr = cs_get_dma_addr(state); - - diff = (dmabuf->dmasize + hwptr - dmabuf->hwptr) % dmabuf->dmasize; - CS_DBGOUT(CS_PARMS, 9, printk( - "cs46xx: cs_update_ptr()+ ADC hwptr=%d diff=%d\n", - hwptr,diff) ); - dmabuf->hwptr = hwptr; - dmabuf->total_bytes += diff; - dmabuf->count += diff; - if (dmabuf->count > dmabuf->dmasize) - dmabuf->count = dmabuf->dmasize; - - if (dmabuf->mapped) { - if (wake && dmabuf->count >= (signed)dmabuf->fragsize) - wake_up(&dmabuf->wait); - } else { - if (wake && dmabuf->count > 0) - wake_up(&dmabuf->wait); - } - } - } - -/* - * Now the DAC - */ - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - /* error handling and process wake up for DAC */ - if (dmabuf->enable & DAC_RUNNING) { - /* update hardware pointer */ - hwptr = cs_get_dma_addr(state); - - diff = (dmabuf->dmasize + hwptr - dmabuf->hwptr) % dmabuf->dmasize; - CS_DBGOUT(CS_PARMS, 9, printk( - "cs46xx: cs_update_ptr()+ DAC hwptr=%d diff=%d\n", - hwptr,diff) ); - dmabuf->hwptr = hwptr; - dmabuf->total_bytes += diff; - if (dmabuf->mapped) { - dmabuf->count += diff; - if (wake && dmabuf->count >= (signed)dmabuf->fragsize) - wake_up(&dmabuf->wait); - /* - * other drivers use fragsize, but don't see any sense - * in that, since dmasize is the buffer asked for - * via mmap. - */ - if (dmabuf->count > dmabuf->dmasize) - dmabuf->count &= dmabuf->dmasize-1; - } else { - dmabuf->count -= diff; - /* - * backfill with silence and clear out the last - * "diff" number of bytes. - */ - if (hwptr >= diff) { - memset(dmabuf->rawbuf + hwptr - diff, - (dmabuf->fmt & CS_FMT_16BIT) ? 0 : 0x80, diff); - } else { - memset(dmabuf->rawbuf, - (dmabuf->fmt & CS_FMT_16BIT) ? 0 : 0x80, - (unsigned)hwptr); - memset((char *)dmabuf->rawbuf + - dmabuf->dmasize + hwptr - diff, - (dmabuf->fmt & CS_FMT_16BIT) ? 0 : 0x80, - diff - hwptr); - } - - if (dmabuf->count < 0 || dmabuf->count > dmabuf->dmasize) { - CS_DBGOUT(CS_ERROR, 2, printk(KERN_INFO - "cs46xx: ERROR DAC count<0 or count > dmasize (%d)\n", - dmabuf->count)); - /* - * buffer underrun or buffer overrun, reset the - * count of bytes written back to 0. - */ - if (dmabuf->count < 0) - dmabuf->underrun = 1; - dmabuf->count = 0; - dmabuf->error++; - } - if (wake && dmabuf->count < (signed)dmabuf->dmasize / 2) - wake_up(&dmabuf->wait); - } - } - } -} - - -/* hold spinlock for the following! */ -static void cs_handle_midi(struct cs_card *card) -{ - unsigned char ch; - int wake; - unsigned temp1; - - wake = 0; - while (!(cs461x_peekBA0(card, BA0_MIDSR) & MIDSR_RBE)) { - ch = cs461x_peekBA0(card, BA0_MIDRP); - if (card->midi.icnt < CS_MIDIINBUF) { - card->midi.ibuf[card->midi.iwr] = ch; - card->midi.iwr = (card->midi.iwr + 1) % CS_MIDIINBUF; - card->midi.icnt++; - } - wake = 1; - } - if (wake) - wake_up(&card->midi.iwait); - wake = 0; - while (!(cs461x_peekBA0(card, BA0_MIDSR) & MIDSR_TBF) && card->midi.ocnt > 0) { - temp1 = ( card->midi.obuf[card->midi.ord] ) & 0x000000ff; - cs461x_pokeBA0(card, BA0_MIDWP,temp1); - card->midi.ord = (card->midi.ord + 1) % CS_MIDIOUTBUF; - card->midi.ocnt--; - if (card->midi.ocnt < CS_MIDIOUTBUF-16) - wake = 1; - } - if (wake) - wake_up(&card->midi.owait); -} - -static irqreturn_t cs_interrupt(int irq, void *dev_id) -{ - struct cs_card *card = (struct cs_card *)dev_id; - /* Single channel card */ - struct cs_state *recstate = card->channel[0].state; - struct cs_state *playstate = card->channel[1].state; - u32 status; - - CS_DBGOUT(CS_INTERRUPT, 9, printk("cs46xx: cs_interrupt()+ \n")); - - spin_lock(&card->lock); - - status = cs461x_peekBA0(card, BA0_HISR); - - if ((status & 0x7fffffff) == 0) { - cs461x_pokeBA0(card, BA0_HICR, HICR_CHGM|HICR_IEV); - spin_unlock(&card->lock); - return IRQ_HANDLED; /* Might be IRQ_NONE.. */ - } - - /* - * check for playback or capture interrupt only - */ - if (((status & HISR_VC0) && playstate && playstate->dmabuf.ready) || - (((status & HISR_VC1) && recstate && recstate->dmabuf.ready))) { - CS_DBGOUT(CS_INTERRUPT, 8, printk( - "cs46xx: cs_interrupt() interrupt bit(s) set (0x%x)\n",status)); - cs_update_ptr(card, CS_TRUE); - } - - if (status & HISR_MIDI) - cs_handle_midi(card); - - /* clear 'em */ - cs461x_pokeBA0(card, BA0_HICR, HICR_CHGM|HICR_IEV); - spin_unlock(&card->lock); - CS_DBGOUT(CS_INTERRUPT, 9, printk("cs46xx: cs_interrupt()- \n")); - return IRQ_HANDLED; -} - - -/**********************************************************************/ - -static ssize_t cs_midi_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) -{ - struct cs_card *card = file->private_data; - ssize_t ret; - unsigned long flags; - unsigned ptr; - int cnt; - - if (!access_ok(VERIFY_WRITE, buffer, count)) - return -EFAULT; - ret = 0; - while (count > 0) { - spin_lock_irqsave(&card->lock, flags); - ptr = card->midi.ird; - cnt = CS_MIDIINBUF - ptr; - if (card->midi.icnt < cnt) - cnt = card->midi.icnt; - spin_unlock_irqrestore(&card->lock, flags); - if (cnt > count) - cnt = count; - if (cnt <= 0) { - if (file->f_flags & O_NONBLOCK) - return ret ? ret : -EAGAIN; - interruptible_sleep_on(&card->midi.iwait); - if (signal_pending(current)) - return ret ? ret : -ERESTARTSYS; - continue; - } - if (copy_to_user(buffer, card->midi.ibuf + ptr, cnt)) - return ret ? ret : -EFAULT; - ptr = (ptr + cnt) % CS_MIDIINBUF; - spin_lock_irqsave(&card->lock, flags); - card->midi.ird = ptr; - card->midi.icnt -= cnt; - spin_unlock_irqrestore(&card->lock, flags); - count -= cnt; - buffer += cnt; - ret += cnt; - } - return ret; -} - - -static ssize_t cs_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) -{ - struct cs_card *card = file->private_data; - ssize_t ret; - unsigned long flags; - unsigned ptr; - int cnt; - - if (!access_ok(VERIFY_READ, buffer, count)) - return -EFAULT; - ret = 0; - while (count > 0) { - spin_lock_irqsave(&card->lock, flags); - ptr = card->midi.owr; - cnt = CS_MIDIOUTBUF - ptr; - if (card->midi.ocnt + cnt > CS_MIDIOUTBUF) - cnt = CS_MIDIOUTBUF - card->midi.ocnt; - if (cnt <= 0) - cs_handle_midi(card); - spin_unlock_irqrestore(&card->lock, flags); - if (cnt > count) - cnt = count; - if (cnt <= 0) { - if (file->f_flags & O_NONBLOCK) - return ret ? ret : -EAGAIN; - interruptible_sleep_on(&card->midi.owait); - if (signal_pending(current)) - return ret ? ret : -ERESTARTSYS; - continue; - } - if (copy_from_user(card->midi.obuf + ptr, buffer, cnt)) - return ret ? ret : -EFAULT; - ptr = (ptr + cnt) % CS_MIDIOUTBUF; - spin_lock_irqsave(&card->lock, flags); - card->midi.owr = ptr; - card->midi.ocnt += cnt; - spin_unlock_irqrestore(&card->lock, flags); - count -= cnt; - buffer += cnt; - ret += cnt; - spin_lock_irqsave(&card->lock, flags); - cs_handle_midi(card); - spin_unlock_irqrestore(&card->lock, flags); - } - return ret; -} - - -static unsigned int cs_midi_poll(struct file *file, struct poll_table_struct *wait) -{ - struct cs_card *card = file->private_data; - unsigned long flags; - unsigned int mask = 0; - - if (file->f_flags & FMODE_WRITE) - poll_wait(file, &card->midi.owait, wait); - if (file->f_flags & FMODE_READ) - poll_wait(file, &card->midi.iwait, wait); - spin_lock_irqsave(&card->lock, flags); - if (file->f_flags & FMODE_READ) { - if (card->midi.icnt > 0) - mask |= POLLIN | POLLRDNORM; - } - if (file->f_flags & FMODE_WRITE) { - if (card->midi.ocnt < CS_MIDIOUTBUF) - mask |= POLLOUT | POLLWRNORM; - } - spin_unlock_irqrestore(&card->lock, flags); - return mask; -} - - -static int cs_midi_open(struct inode *inode, struct file *file) -{ - unsigned int minor = iminor(inode); - struct cs_card *card = NULL; - unsigned long flags; - struct list_head *entry; - - list_for_each(entry, &cs46xx_devs) { - card = list_entry(entry, struct cs_card, list); - if (card->dev_midi == minor) - break; - } - - if (entry == &cs46xx_devs) - return -ENODEV; - if (!card) { - CS_DBGOUT(CS_FUNCTION | CS_OPEN, 2, printk(KERN_INFO - "cs46xx: cs46xx_midi_open(): Error - unable to find card struct\n")); - return -ENODEV; - } - - file->private_data = card; - /* wait for device to become free */ - mutex_lock(&card->midi.open_mutex); - while (card->midi.open_mode & file->f_mode) { - if (file->f_flags & O_NONBLOCK) { - mutex_unlock(&card->midi.open_mutex); - return -EBUSY; - } - mutex_unlock(&card->midi.open_mutex); - interruptible_sleep_on(&card->midi.open_wait); - if (signal_pending(current)) - return -ERESTARTSYS; - mutex_lock(&card->midi.open_mutex); - } - spin_lock_irqsave(&card->midi.lock, flags); - if (!(card->midi.open_mode & (FMODE_READ | FMODE_WRITE))) { - card->midi.ird = card->midi.iwr = card->midi.icnt = 0; - card->midi.ord = card->midi.owr = card->midi.ocnt = 0; - card->midi.ird = card->midi.iwr = card->midi.icnt = 0; - cs461x_pokeBA0(card, BA0_MIDCR, 0x0000000f); /* Enable xmit, rcv. */ - cs461x_pokeBA0(card, BA0_HICR, HICR_IEV | HICR_CHGM); /* Enable interrupts */ - } - if (file->f_mode & FMODE_READ) - card->midi.ird = card->midi.iwr = card->midi.icnt = 0; - if (file->f_mode & FMODE_WRITE) - card->midi.ord = card->midi.owr = card->midi.ocnt = 0; - spin_unlock_irqrestore(&card->midi.lock, flags); - card->midi.open_mode |= (file->f_mode & (FMODE_READ | FMODE_WRITE)); - mutex_unlock(&card->midi.open_mutex); - return 0; -} - - -static int cs_midi_release(struct inode *inode, struct file *file) -{ - struct cs_card *card = file->private_data; - DECLARE_WAITQUEUE(wait, current); - unsigned long flags; - unsigned count, tmo; - - if (file->f_mode & FMODE_WRITE) { - current->state = TASK_INTERRUPTIBLE; - add_wait_queue(&card->midi.owait, &wait); - for (;;) { - spin_lock_irqsave(&card->midi.lock, flags); - count = card->midi.ocnt; - spin_unlock_irqrestore(&card->midi.lock, flags); - if (count <= 0) - break; - if (signal_pending(current)) - break; - if (file->f_flags & O_NONBLOCK) - break; - tmo = (count * HZ) / 3100; - if (!schedule_timeout(tmo ? : 1) && tmo) - printk(KERN_DEBUG "cs46xx: midi timed out??\n"); - } - remove_wait_queue(&card->midi.owait, &wait); - current->state = TASK_RUNNING; - } - mutex_lock(&card->midi.open_mutex); - card->midi.open_mode &= (~(file->f_mode & (FMODE_READ | FMODE_WRITE))); - mutex_unlock(&card->midi.open_mutex); - wake_up(&card->midi.open_wait); - return 0; -} - -/* - * Midi file operations struct. - */ -static /*const*/ struct file_operations cs_midi_fops = { - CS_OWNER CS_THIS_MODULE - .llseek = no_llseek, - .read = cs_midi_read, - .write = cs_midi_write, - .poll = cs_midi_poll, - .open = cs_midi_open, - .release = cs_midi_release, -}; - -/* - * - * CopySamples copies 16-bit stereo signed samples from the source to the - * destination, possibly converting down to unsigned 8-bit and/or mono. - * count specifies the number of output bytes to write. - * - * Arguments: - * - * dst - Pointer to a destination buffer. - * src - Pointer to a source buffer - * count - The number of bytes to copy into the destination buffer. - * fmt - CS_FMT_16BIT and/or CS_FMT_STEREO bits - * dmabuf - pointer to the dma buffer structure - * - * NOTES: only call this routine if the output desired is not 16 Signed Stereo - * - * - */ -static void CopySamples(char *dst, char *src, int count, unsigned fmt, - struct dmabuf *dmabuf) -{ - s32 s32AudioSample; - s16 *psSrc = (s16 *)src; - s16 *psDst = (s16 *)dst; - u8 *pucDst = (u8 *)dst; - - CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_INFO "cs46xx: CopySamples()+ ") ); - CS_DBGOUT(CS_WAVE_READ, 8, printk(KERN_INFO - " dst=%p src=%p count=%d fmt=0x%x\n", - dst,src,count,fmt) ); - - /* - * See if the data should be output as 8-bit unsigned stereo. - */ - if ((fmt & CS_FMT_STEREO) && !(fmt & CS_FMT_16BIT)) { - /* - * Convert each 16-bit signed stereo sample to 8-bit unsigned - * stereo using rounding. - */ - psSrc = (s16 *)src; - count = count / 2; - while (count--) - *(pucDst++) = (u8)(((s16)(*psSrc++) + (s16)0x8000) >> 8); - } - /* - * See if the data should be output at 8-bit unsigned mono. - */ - else if (!(fmt & CS_FMT_STEREO) && !(fmt & CS_FMT_16BIT)) { - /* - * Convert each 16-bit signed stereo sample to 8-bit unsigned - * mono using averaging and rounding. - */ - psSrc = (s16 *)src; - count = count / 2; - while (count--) { - s32AudioSample = ((*psSrc) + (*(psSrc + 1))) / 2 + (s32)0x80; - if (s32AudioSample > 0x7fff) - s32AudioSample = 0x7fff; - *(pucDst++) = (u8)(((s16)s32AudioSample + (s16)0x8000) >> 8); - psSrc += 2; - } - } - /* - * See if the data should be output at 16-bit signed mono. - */ - else if (!(fmt & CS_FMT_STEREO) && (fmt & CS_FMT_16BIT)) { - /* - * Convert each 16-bit signed stereo sample to 16-bit signed - * mono using averaging. - */ - psSrc = (s16 *)src; - count = count / 2; - while (count--) { - *(psDst++) = (s16)((*psSrc) + (*(psSrc + 1))) / 2; - psSrc += 2; - } - } -} - -/* - * cs_copy_to_user() - * replacement for the standard copy_to_user, to allow for a conversion from - * 16 bit to 8 bit and from stereo to mono, if the record conversion is active. - * The current CS46xx/CS4280 static image only records in 16bit unsigned Stereo, - * so we convert from any of the other format combinations. - */ -static unsigned cs_copy_to_user( - struct cs_state *s, - void __user *dest, - void *hwsrc, - unsigned cnt, - unsigned *copied) -{ - struct dmabuf *dmabuf = &s->dmabuf; - void *src = hwsrc; /* default to the standard destination buffer addr */ - - CS_DBGOUT(CS_FUNCTION, 6, printk(KERN_INFO - "cs_copy_to_user()+ fmt=0x%x cnt=%d dest=%p\n", - dmabuf->fmt,(unsigned)cnt,dest) ); - - if (cnt > dmabuf->dmasize) - cnt = dmabuf->dmasize; - if (!cnt) { - *copied = 0; - return 0; - } - if (dmabuf->divisor != 1) { - if (!dmabuf->tmpbuff) { - *copied = cnt / dmabuf->divisor; - return 0; - } - - CopySamples((char *)dmabuf->tmpbuff, (char *)hwsrc, cnt, - dmabuf->fmt, dmabuf); - src = dmabuf->tmpbuff; - cnt = cnt/dmabuf->divisor; - } - if (copy_to_user(dest, src, cnt)) { - CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_ERR - "cs46xx: cs_copy_to_user()- fault dest=%p src=%p cnt=%d\n", - dest,src,cnt)); - *copied = 0; - return -EFAULT; - } - *copied = cnt; - CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_INFO - "cs46xx: cs_copy_to_user()- copied bytes is %d \n",cnt)); - return 0; -} - -/* in this loop, dmabuf.count signifies the amount of data that is waiting to be copied to - the user's buffer. it is filled by the dma machine and drained by this loop. */ -static ssize_t cs_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) -{ - struct cs_card *card = file->private_data; - struct cs_state *state; - DECLARE_WAITQUEUE(wait, current); - struct dmabuf *dmabuf; - ssize_t ret = 0; - unsigned long flags; - unsigned swptr; - int cnt; - unsigned copied = 0; - - CS_DBGOUT(CS_WAVE_READ | CS_FUNCTION, 4, - printk("cs46xx: cs_read()+ %zd\n",count) ); - state = card->states[0]; - if (!state) - return -ENODEV; - dmabuf = &state->dmabuf; - - if (dmabuf->mapped) - return -ENXIO; - if (!access_ok(VERIFY_WRITE, buffer, count)) - return -EFAULT; - - mutex_lock(&state->sem); - if (!dmabuf->ready && (ret = __prog_dmabuf(state))) - goto out2; - - add_wait_queue(&state->dmabuf.wait, &wait); - while (count > 0) { - while (!(card->pm.flags & CS46XX_PM_IDLE)) { - schedule(); - if (signal_pending(current)) { - if (!ret) - ret = -ERESTARTSYS; - goto out; - } - } - spin_lock_irqsave(&state->card->lock, flags); - swptr = dmabuf->swptr; - cnt = dmabuf->dmasize - swptr; - if (dmabuf->count < cnt) - cnt = dmabuf->count; - if (cnt <= 0) - __set_current_state(TASK_INTERRUPTIBLE); - spin_unlock_irqrestore(&state->card->lock, flags); - - if (cnt > (count * dmabuf->divisor)) - cnt = count * dmabuf->divisor; - if (cnt <= 0) { - /* buffer is empty, start the dma machine and wait for data to be - recorded */ - start_adc(state); - if (file->f_flags & O_NONBLOCK) { - if (!ret) - ret = -EAGAIN; - goto out; - } - mutex_unlock(&state->sem); - schedule(); - if (signal_pending(current)) { - if (!ret) - ret = -ERESTARTSYS; - goto out; - } - mutex_lock(&state->sem); - if (dmabuf->mapped) { - if (!ret) - ret = -ENXIO; - goto out; - } - continue; - } - - CS_DBGOUT(CS_WAVE_READ, 2, printk(KERN_INFO - "_read() copy_to cnt=%d count=%zd ", cnt,count) ); - CS_DBGOUT(CS_WAVE_READ, 8, printk(KERN_INFO - " .dmasize=%d .count=%d buffer=%p ret=%zd\n", - dmabuf->dmasize,dmabuf->count,buffer,ret)); - - if (cs_copy_to_user(state, buffer, - (char *)dmabuf->rawbuf + swptr, cnt, &copied)) { - if (!ret) - ret = -EFAULT; - goto out; - } - swptr = (swptr + cnt) % dmabuf->dmasize; - spin_lock_irqsave(&card->lock, flags); - dmabuf->swptr = swptr; - dmabuf->count -= cnt; - spin_unlock_irqrestore(&card->lock, flags); - count -= copied; - buffer += copied; - ret += copied; - start_adc(state); - } -out: - remove_wait_queue(&state->dmabuf.wait, &wait); -out2: - mutex_unlock(&state->sem); - set_current_state(TASK_RUNNING); - CS_DBGOUT(CS_WAVE_READ | CS_FUNCTION, 4, - printk("cs46xx: cs_read()- %zd\n",ret) ); - return ret; -} - -/* in this loop, dmabuf.count signifies the amount of data that is waiting to be dma to - the soundcard. it is drained by the dma machine and filled by this loop. */ -static ssize_t cs_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) -{ - struct cs_card *card = file->private_data; - struct cs_state *state; - DECLARE_WAITQUEUE(wait, current); - struct dmabuf *dmabuf; - ssize_t ret; - unsigned long flags; - unsigned swptr; - int cnt; - - CS_DBGOUT(CS_WAVE_WRITE | CS_FUNCTION, 4, - printk("cs46xx: cs_write called, count = %zd\n", count) ); - state = card->states[1]; - if (!state) - return -ENODEV; - if (!access_ok(VERIFY_READ, buffer, count)) - return -EFAULT; - dmabuf = &state->dmabuf; - - mutex_lock(&state->sem); - if (dmabuf->mapped) { - ret = -ENXIO; - goto out; - } - - if (!dmabuf->ready && (ret = __prog_dmabuf(state))) - goto out; - add_wait_queue(&state->dmabuf.wait, &wait); - ret = 0; -/* -* Start the loop to read from the user's buffer and write to the dma buffer. -* check for PM events and underrun/overrun in the loop. -*/ - while (count > 0) { - while (!(card->pm.flags & CS46XX_PM_IDLE)) { - schedule(); - if (signal_pending(current)) { - if (!ret) - ret = -ERESTARTSYS; - goto out; - } - } - spin_lock_irqsave(&state->card->lock, flags); - if (dmabuf->count < 0) { - /* buffer underrun, we are recovering from sleep_on_timeout, - resync hwptr and swptr */ - dmabuf->count = 0; - dmabuf->swptr = dmabuf->hwptr; - } - if (dmabuf->underrun) { - dmabuf->underrun = 0; - dmabuf->hwptr = cs_get_dma_addr(state); - dmabuf->swptr = dmabuf->hwptr; - } - - swptr = dmabuf->swptr; - cnt = dmabuf->dmasize - swptr; - if (dmabuf->count + cnt > dmabuf->dmasize) - cnt = dmabuf->dmasize - dmabuf->count; - if (cnt <= 0) - __set_current_state(TASK_INTERRUPTIBLE); - spin_unlock_irqrestore(&state->card->lock, flags); - - if (cnt > count) - cnt = count; - if (cnt <= 0) { - /* buffer is full, start the dma machine and wait for data to be - played */ - start_dac(state); - if (file->f_flags & O_NONBLOCK) { - if (!ret) - ret = -EAGAIN; - goto out; - } - mutex_unlock(&state->sem); - schedule(); - if (signal_pending(current)) { - if (!ret) - ret = -ERESTARTSYS; - goto out; - } - mutex_lock(&state->sem); - if (dmabuf->mapped) { - if (!ret) - ret = -ENXIO; - goto out; - } - continue; - } - if (copy_from_user(dmabuf->rawbuf + swptr, buffer, cnt)) { - if (!ret) - ret = -EFAULT; - goto out; - } - spin_lock_irqsave(&state->card->lock, flags); - swptr = (swptr + cnt) % dmabuf->dmasize; - dmabuf->swptr = swptr; - dmabuf->count += cnt; - if (dmabuf->count > dmabuf->dmasize) { - CS_DBGOUT(CS_WAVE_WRITE | CS_ERROR, 2, printk( - "cs46xx: cs_write() d->count > dmasize - resetting\n")); - dmabuf->count = dmabuf->dmasize; - } - dmabuf->endcleared = 0; - spin_unlock_irqrestore(&state->card->lock, flags); - - count -= cnt; - buffer += cnt; - ret += cnt; - start_dac(state); - } -out: - mutex_unlock(&state->sem); - remove_wait_queue(&state->dmabuf.wait, &wait); - set_current_state(TASK_RUNNING); - - CS_DBGOUT(CS_WAVE_WRITE | CS_FUNCTION, 2, - printk("cs46xx: cs_write()- ret=%zd\n", ret)); - return ret; -} - -static unsigned int cs_poll(struct file *file, struct poll_table_struct *wait) -{ - struct cs_card *card = file->private_data; - struct dmabuf *dmabuf; - struct cs_state *state; - unsigned long flags; - unsigned int mask = 0; - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_poll()+ \n")); - if (!(file->f_mode & (FMODE_WRITE | FMODE_READ))) { - return -EINVAL; - } - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - poll_wait(file, &dmabuf->wait, wait); - } - } - if (file->f_mode & FMODE_READ) { - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - poll_wait(file, &dmabuf->wait, wait); - } - } - - spin_lock_irqsave(&card->lock, flags); - cs_update_ptr(card, CS_FALSE); - if (file->f_mode & FMODE_READ) { - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - if (dmabuf->count >= (signed)dmabuf->fragsize) - mask |= POLLIN | POLLRDNORM; - } - } - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - if (dmabuf->mapped) { - if (dmabuf->count >= (signed)dmabuf->fragsize) - mask |= POLLOUT | POLLWRNORM; - } else { - if ((signed)dmabuf->dmasize >= dmabuf->count - + (signed)dmabuf->fragsize) - mask |= POLLOUT | POLLWRNORM; - } - } - } - spin_unlock_irqrestore(&card->lock, flags); - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_poll()- (0x%x) \n", - mask)); - return mask; -} - -/* - * We let users mmap the ring buffer. Its not the real DMA buffer but - * that side of the code is hidden in the IRQ handling. We do a software - * emulation of DMA from a 64K or so buffer into a 2K FIFO. - * (the hardware probably deserves a moan here but Crystal send me nice - * toys ;)). - */ - -static int cs_mmap(struct file *file, struct vm_area_struct *vma) -{ - struct cs_card *card = file->private_data; - struct cs_state *state; - struct dmabuf *dmabuf; - int ret = 0; - unsigned long size; - - CS_DBGOUT(CS_FUNCTION | CS_PARMS, 2, printk("cs46xx: cs_mmap()+ file=%p %s %s\n", - file, vma->vm_flags & VM_WRITE ? "VM_WRITE" : "", - vma->vm_flags & VM_READ ? "VM_READ" : "") ); - - if (vma->vm_flags & VM_WRITE) { - state = card->states[1]; - if (state) { - CS_DBGOUT(CS_OPEN, 2, printk( - "cs46xx: cs_mmap() VM_WRITE - state TRUE prog_dmabuf DAC\n") ); - if ((ret = prog_dmabuf(state)) != 0) - return ret; - } - } else if (vma->vm_flags & VM_READ) { - state = card->states[0]; - if (state) { - CS_DBGOUT(CS_OPEN, 2, printk( - "cs46xx: cs_mmap() VM_READ - state TRUE prog_dmabuf ADC\n") ); - if ((ret = prog_dmabuf(state)) != 0) - return ret; - } - } else { - CS_DBGOUT(CS_ERROR, 2, printk( - "cs46xx: cs_mmap() return -EINVAL\n") ); - return -EINVAL; - } - -/* - * For now ONLY support playback, but seems like the only way to use - * mmap() is to open an FD with RDWR, just read or just write access - * does not function, get an error back from the kernel. - * Also, QuakeIII opens with RDWR! So, there must be something - * to needing read/write access mapping. So, allow read/write but - * use the DAC only. - */ - state = card->states[1]; - if (!state) { - ret = -EINVAL; - goto out; - } - - mutex_lock(&state->sem); - dmabuf = &state->dmabuf; - if (cs4x_pgoff(vma) != 0) { - ret = -EINVAL; - goto out; - } - size = vma->vm_end - vma->vm_start; - - CS_DBGOUT(CS_PARMS, 2, printk("cs46xx: cs_mmap(): size=%d\n",(unsigned)size) ); - - if (size > (PAGE_SIZE << dmabuf->buforder)) { - ret = -EINVAL; - goto out; - } - if (remap_pfn_range(vma, vma->vm_start, - virt_to_phys(dmabuf->rawbuf) >> PAGE_SHIFT, - size, vma->vm_page_prot)) { - ret = -EAGAIN; - goto out; - } - dmabuf->mapped = 1; - - CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_mmap()-\n") ); -out: - mutex_unlock(&state->sem); - return ret; -} - -static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) -{ - struct cs_card *card = file->private_data; - struct cs_state *state; - struct dmabuf *dmabuf = NULL; - unsigned long flags; - audio_buf_info abinfo; - count_info cinfo; - int val, valsave, ret; - int mapped = 0; - void __user *argp = (void __user *)arg; - int __user *p = argp; - - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - mapped = (file->f_mode & FMODE_READ) && dmabuf->mapped; - } - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - mapped |= (file->f_mode & FMODE_WRITE) && dmabuf->mapped; - } - -#if CSDEBUG - printioctl(cmd); -#endif - - switch (cmd) { - case OSS_GETVERSION: - return put_user(SOUND_VERSION, p); - case SNDCTL_DSP_RESET: - /* FIXME: spin_lock ? */ - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - stop_dac(state); - synchronize_irq(card->irq); - dmabuf->ready = 0; - resync_dma_ptrs(state); - dmabuf->swptr = dmabuf->hwptr = 0; - dmabuf->count = dmabuf->total_bytes = 0; - dmabuf->blocks = 0; - dmabuf->SGok = 0; - } - } - if (file->f_mode & FMODE_READ) { - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - stop_adc(state); - synchronize_irq(card->irq); - resync_dma_ptrs(state); - dmabuf->ready = 0; - dmabuf->swptr = dmabuf->hwptr = 0; - dmabuf->count = dmabuf->total_bytes = 0; - dmabuf->blocks = 0; - dmabuf->SGok = 0; - } - } - CS_DBGOUT(CS_IOCTL, 2, printk("cs46xx: DSP_RESET()-\n") ); - return 0; - case SNDCTL_DSP_SYNC: - if (file->f_mode & FMODE_WRITE) - return drain_dac(state, file->f_flags & O_NONBLOCK); - return 0; - case SNDCTL_DSP_SPEED: /* set sample rate */ - if (get_user(val, p)) - return -EFAULT; - if (val >= 0) { - if (file->f_mode & FMODE_READ) { - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - stop_adc(state); - dmabuf->ready = 0; - dmabuf->SGok = 0; - cs_set_adc_rate(state, val); - cs_set_divisor(dmabuf); - } - } - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - stop_dac(state); - dmabuf->ready = 0; - dmabuf->SGok = 0; - cs_set_dac_rate(state, val); - cs_set_divisor(dmabuf); - } - } - CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk( - "cs46xx: cs_ioctl() DSP_SPEED %s %s %d\n", - file->f_mode & FMODE_WRITE ? "DAC" : "", - file->f_mode & FMODE_READ ? "ADC" : "", - dmabuf->rate ) ); - return put_user(dmabuf->rate, p); - } - return put_user(0, p); - case SNDCTL_DSP_STEREO: /* set stereo or mono channel */ - if (get_user(val, p)) - return -EFAULT; - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - stop_dac(state); - dmabuf->ready = 0; - dmabuf->SGok = 0; - if (val) - dmabuf->fmt |= CS_FMT_STEREO; - else - dmabuf->fmt &= ~CS_FMT_STEREO; - cs_set_divisor(dmabuf); - CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk( - "cs46xx: DSP_STEREO() DAC %s\n", - (dmabuf->fmt & CS_FMT_STEREO) ? - "STEREO":"MONO") ); - } - } - if (file->f_mode & FMODE_READ) { - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - stop_adc(state); - dmabuf->ready = 0; - dmabuf->SGok = 0; - if (val) - dmabuf->fmt |= CS_FMT_STEREO; - else - dmabuf->fmt &= ~CS_FMT_STEREO; - cs_set_divisor(dmabuf); - CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk( - "cs46xx: DSP_STEREO() ADC %s\n", - (dmabuf->fmt & CS_FMT_STEREO) ? - "STEREO":"MONO") ); - } - } - return 0; - case SNDCTL_DSP_GETBLKSIZE: - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - if ((val = prog_dmabuf(state))) - return val; - return put_user(dmabuf->fragsize, p); - } - } - if (file->f_mode & FMODE_READ) { - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - if ((val = prog_dmabuf(state))) - return val; - return put_user(dmabuf->fragsize/dmabuf->divisor, - p); - } - } - return put_user(0, p); - case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format*/ - return put_user(AFMT_S16_LE | AFMT_U8, p); - case SNDCTL_DSP_SETFMT: /* Select sample format */ - if (get_user(val, p)) - return -EFAULT; - CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk( - "cs46xx: cs_ioctl() DSP_SETFMT %s %s %s %s\n", - file->f_mode & FMODE_WRITE ? "DAC" : "", - file->f_mode & FMODE_READ ? "ADC" : "", - val == AFMT_S16_LE ? "16Bit Signed" : "", - val == AFMT_U8 ? "8Bit Unsigned" : "") ); - valsave = val; - if (val != AFMT_QUERY) { - if (val==AFMT_S16_LE || val==AFMT_U8) { - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - stop_dac(state); - dmabuf->ready = 0; - dmabuf->SGok = 0; - if (val == AFMT_S16_LE) - dmabuf->fmt |= CS_FMT_16BIT; - else - dmabuf->fmt &= ~CS_FMT_16BIT; - cs_set_divisor(dmabuf); - if ((ret = prog_dmabuf(state))) - return ret; - } - } - if (file->f_mode & FMODE_READ) { - val = valsave; - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - stop_adc(state); - dmabuf->ready = 0; - dmabuf->SGok = 0; - if (val == AFMT_S16_LE) - dmabuf->fmt |= CS_FMT_16BIT; - else - dmabuf->fmt &= ~CS_FMT_16BIT; - cs_set_divisor(dmabuf); - if ((ret = prog_dmabuf(state))) - return ret; - } - } - } else { - CS_DBGOUT(CS_IOCTL | CS_ERROR, 2, printk( - "cs46xx: DSP_SETFMT() Unsupported format (0x%x)\n", - valsave) ); - } - } else { - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) - dmabuf = &state->dmabuf; - } else if (file->f_mode & FMODE_READ) { - state = card->states[0]; - if (state) - dmabuf = &state->dmabuf; - } - } - if (dmabuf) { - if (dmabuf->fmt & CS_FMT_16BIT) - return put_user(AFMT_S16_LE, p); - else - return put_user(AFMT_U8, p); - } - return put_user(0, p); - case SNDCTL_DSP_CHANNELS: - if (get_user(val, p)) - return -EFAULT; - if (val != 0) { - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - stop_dac(state); - dmabuf->ready = 0; - dmabuf->SGok = 0; - if (val > 1) - dmabuf->fmt |= CS_FMT_STEREO; - else - dmabuf->fmt &= ~CS_FMT_STEREO; - cs_set_divisor(dmabuf); - if (prog_dmabuf(state)) - return 0; - } - } - if (file->f_mode & FMODE_READ) { - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - stop_adc(state); - dmabuf->ready = 0; - dmabuf->SGok = 0; - if (val > 1) - dmabuf->fmt |= CS_FMT_STEREO; - else - dmabuf->fmt &= ~CS_FMT_STEREO; - cs_set_divisor(dmabuf); - if (prog_dmabuf(state)) - return 0; - } - } - } - return put_user((dmabuf->fmt & CS_FMT_STEREO) ? 2 : 1, - p); - case SNDCTL_DSP_POST: - /* - * There will be a longer than normal pause in the data. - * so... do nothing, because there is nothing that we can do. - */ - return 0; - case SNDCTL_DSP_SUBDIVIDE: - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - if (dmabuf->subdivision) - return -EINVAL; - if (get_user(val, p)) - return -EFAULT; - if (val != 1 && val != 2) - return -EINVAL; - dmabuf->subdivision = val; - } - } - if (file->f_mode & FMODE_READ) { - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - if (dmabuf->subdivision) - return -EINVAL; - if (get_user(val, p)) - return -EFAULT; - if (val != 1 && val != 2) - return -EINVAL; - dmabuf->subdivision = val; - } - } - return 0; - case SNDCTL_DSP_SETFRAGMENT: - if (get_user(val, p)) - return -EFAULT; - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - dmabuf->ossfragshift = val & 0xffff; - dmabuf->ossmaxfrags = (val >> 16) & 0xffff; - } - } - if (file->f_mode & FMODE_READ) { - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - dmabuf->ossfragshift = val & 0xffff; - dmabuf->ossmaxfrags = (val >> 16) & 0xffff; - } - } - return 0; - case SNDCTL_DSP_GETOSPACE: - if (!(file->f_mode & FMODE_WRITE)) - return -EINVAL; - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - spin_lock_irqsave(&state->card->lock, flags); - cs_update_ptr(card, CS_TRUE); - abinfo.fragsize = dmabuf->fragsize; - abinfo.fragstotal = dmabuf->numfrag; - /* - * for mmap we always have total space available - */ - if (dmabuf->mapped) - abinfo.bytes = dmabuf->dmasize; - else - abinfo.bytes = dmabuf->dmasize - dmabuf->count; - - abinfo.fragments = abinfo.bytes >> dmabuf->fragshift; - spin_unlock_irqrestore(&state->card->lock, flags); - return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0; - } - return -ENODEV; - case SNDCTL_DSP_GETISPACE: - if (!(file->f_mode & FMODE_READ)) - return -EINVAL; - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - spin_lock_irqsave(&state->card->lock, flags); - cs_update_ptr(card, CS_TRUE); - abinfo.fragsize = dmabuf->fragsize/dmabuf->divisor; - abinfo.bytes = dmabuf->count/dmabuf->divisor; - abinfo.fragstotal = dmabuf->numfrag; - abinfo.fragments = abinfo.bytes >> dmabuf->fragshift; - spin_unlock_irqrestore(&state->card->lock, flags); - return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0; - } - return -ENODEV; - case SNDCTL_DSP_NONBLOCK: - file->f_flags |= O_NONBLOCK; - return 0; - case SNDCTL_DSP_GETCAPS: - return put_user(DSP_CAP_REALTIME|DSP_CAP_TRIGGER|DSP_CAP_MMAP, - p); - case SNDCTL_DSP_GETTRIGGER: - val = 0; - CS_DBGOUT(CS_IOCTL, 2, printk("cs46xx: DSP_GETTRIGGER()+\n") ); - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - if (dmabuf->enable & DAC_RUNNING) - val |= PCM_ENABLE_INPUT; - } - } - if (file->f_mode & FMODE_READ) { - if (state) { - state = card->states[0]; - dmabuf = &state->dmabuf; - if (dmabuf->enable & ADC_RUNNING) - val |= PCM_ENABLE_OUTPUT; - } - } - CS_DBGOUT(CS_IOCTL, 2, printk("cs46xx: DSP_GETTRIGGER()- val=0x%x\n",val) ); - return put_user(val, p); - case SNDCTL_DSP_SETTRIGGER: - if (get_user(val, p)) - return -EFAULT; - if (file->f_mode & FMODE_READ) { - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - if (val & PCM_ENABLE_INPUT) { - if (!dmabuf->ready && (ret = prog_dmabuf(state))) - return ret; - start_adc(state); - } else - stop_adc(state); - } - } - if (file->f_mode & FMODE_WRITE) { - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - if (val & PCM_ENABLE_OUTPUT) { - if (!dmabuf->ready && (ret = prog_dmabuf(state))) - return ret; - start_dac(state); - } else - stop_dac(state); - } - } - return 0; - case SNDCTL_DSP_GETIPTR: - if (!(file->f_mode & FMODE_READ)) - return -EINVAL; - state = card->states[0]; - if (state) { - dmabuf = &state->dmabuf; - spin_lock_irqsave(&state->card->lock, flags); - cs_update_ptr(card, CS_TRUE); - cinfo.bytes = dmabuf->total_bytes/dmabuf->divisor; - cinfo.blocks = dmabuf->count/dmabuf->divisor >> dmabuf->fragshift; - cinfo.ptr = dmabuf->hwptr/dmabuf->divisor; - spin_unlock_irqrestore(&state->card->lock, flags); - if (copy_to_user(argp, &cinfo, sizeof(cinfo))) - return -EFAULT; - return 0; - } - return -ENODEV; - case SNDCTL_DSP_GETOPTR: - if (!(file->f_mode & FMODE_WRITE)) - return -EINVAL; - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - spin_lock_irqsave(&state->card->lock, flags); - cs_update_ptr(card, CS_TRUE); - cinfo.bytes = dmabuf->total_bytes; - if (dmabuf->mapped) { - cinfo.blocks = (cinfo.bytes >> dmabuf->fragshift) - - dmabuf->blocks; - CS_DBGOUT(CS_PARMS, 8, - printk("total_bytes=%d blocks=%d dmabuf->blocks=%d\n", - cinfo.bytes,cinfo.blocks,dmabuf->blocks) ); - dmabuf->blocks = cinfo.bytes >> dmabuf->fragshift; - } else { - cinfo.blocks = dmabuf->count >> dmabuf->fragshift; - } - cinfo.ptr = dmabuf->hwptr; - - CS_DBGOUT(CS_PARMS, 4, printk( - "cs46xx: GETOPTR bytes=%d blocks=%d ptr=%d\n", - cinfo.bytes,cinfo.blocks,cinfo.ptr) ); - spin_unlock_irqrestore(&state->card->lock, flags); - if (copy_to_user(argp, &cinfo, sizeof(cinfo))) - return -EFAULT; - return 0; - } - return -ENODEV; - case SNDCTL_DSP_SETDUPLEX: - return 0; - case SNDCTL_DSP_GETODELAY: - if (!(file->f_mode & FMODE_WRITE)) - return -EINVAL; - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - spin_lock_irqsave(&state->card->lock, flags); - cs_update_ptr(card, CS_TRUE); - val = dmabuf->count; - spin_unlock_irqrestore(&state->card->lock, flags); - } else - val = 0; - return put_user(val, p); - case SOUND_PCM_READ_RATE: - if (file->f_mode & FMODE_READ) - state = card->states[0]; - else - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - return put_user(dmabuf->rate, p); - } - return put_user(0, p); - case SOUND_PCM_READ_CHANNELS: - if (file->f_mode & FMODE_READ) - state = card->states[0]; - else - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - return put_user((dmabuf->fmt & CS_FMT_STEREO) ? 2 : 1, - p); - } - return put_user(0, p); - case SOUND_PCM_READ_BITS: - if (file->f_mode & FMODE_READ) - state = card->states[0]; - else - state = card->states[1]; - if (state) { - dmabuf = &state->dmabuf; - return put_user((dmabuf->fmt & CS_FMT_16BIT) ? - AFMT_S16_LE : AFMT_U8, p); - - } - return put_user(0, p); - case SNDCTL_DSP_MAPINBUF: - case SNDCTL_DSP_MAPOUTBUF: - case SNDCTL_DSP_SETSYNCRO: - case SOUND_PCM_WRITE_FILTER: - case SOUND_PCM_READ_FILTER: - return -EINVAL; - } - return -EINVAL; -} - - -/* - * AMP control - null AMP - */ - -static void amp_none(struct cs_card *card, int change) -{ -} - -/* - * Crystal EAPD mode - */ - -static void amp_voyetra(struct cs_card *card, int change) -{ - /* Manage the EAPD bit on the Crystal 4297 - and the Analog AD1885 */ - - int old = card->amplifier; - - card->amplifier+=change; - if (card->amplifier && !old) { - /* Turn the EAPD amp on */ - cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, - cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) | - 0x8000); - } else if(old && !card->amplifier) { - /* Turn the EAPD amp off */ - cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, - cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - ~0x8000); - } -} - - -/* - * Game Theatre XP card - EGPIO[2] is used to enable the external amp. - */ - -static void amp_hercules(struct cs_card *card, int change) -{ - int old = card->amplifier; - if (!card) { - CS_DBGOUT(CS_ERROR, 2, printk(KERN_INFO - "cs46xx: amp_hercules() called before initialized.\n")); - return; - } - card->amplifier+=change; - if ((card->amplifier && !old) && !(hercules_egpio_disable)) { - CS_DBGOUT(CS_PARMS, 4, printk(KERN_INFO - "cs46xx: amp_hercules() external amp enabled\n")); - cs461x_pokeBA0(card, BA0_EGPIODR, - EGPIODR_GPOE2); /* enable EGPIO2 output */ - cs461x_pokeBA0(card, BA0_EGPIOPTR, - EGPIOPTR_GPPT2); /* open-drain on output */ - } else if (old && !card->amplifier) { - CS_DBGOUT(CS_PARMS, 4, printk(KERN_INFO - "cs46xx: amp_hercules() external amp disabled\n")); - cs461x_pokeBA0(card, BA0_EGPIODR, 0); /* disable */ - cs461x_pokeBA0(card, BA0_EGPIOPTR, 0); /* disable */ - } -} - -/* - * Handle the CLKRUN on a thinkpad. We must disable CLKRUN support - * whenever we need to beat on the chip. - * - * The original idea and code for this hack comes from David Kaiser at - * Linuxcare. Perhaps one day Crystal will document their chips well - * enough to make them useful. - */ - -static void clkrun_hack(struct cs_card *card, int change) -{ - struct pci_dev *acpi_dev; - u16 control; - u8 pp; - unsigned long port; - int old = card->active; - - card->active+=change; - - acpi_dev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, NULL); - if (acpi_dev == NULL) - return; /* Not a thinkpad thats for sure */ - - /* Find the control port */ - pci_read_config_byte(acpi_dev, 0x41, &pp); - port = pp << 8; - - /* Read ACPI port */ - control = inw(port + 0x10); - - /* Flip CLKRUN off while running */ - if (!card->active && old) { - CS_DBGOUT(CS_PARMS , 9, printk( KERN_INFO - "cs46xx: clkrun() enable clkrun - change=%d active=%d\n", - change,card->active)); - outw(control|0x2000, port+0x10); - } else { - /* - * sometimes on a resume the bit is set, so always reset the bit. - */ - CS_DBGOUT(CS_PARMS , 9, printk( KERN_INFO - "cs46xx: clkrun() disable clkrun - change=%d active=%d\n", - change,card->active)); - outw(control&~0x2000, port+0x10); - } - pci_dev_put(acpi_dev); -} - - -static int cs_open(struct inode *inode, struct file *file) -{ - struct cs_card *card = file->private_data; - struct cs_state *state = NULL; - struct dmabuf *dmabuf = NULL; - struct list_head *entry; - unsigned int minor = iminor(inode); - int ret = 0; - unsigned int tmp; - - CS_DBGOUT(CS_OPEN | CS_FUNCTION, 2, printk("cs46xx: cs_open()+ file=%p %s %s\n", - file, file->f_mode & FMODE_WRITE ? "FMODE_WRITE" : "", - file->f_mode & FMODE_READ ? "FMODE_READ" : "") ); - - list_for_each(entry, &cs46xx_devs) { - card = list_entry(entry, struct cs_card, list); - - if (!((card->dev_audio ^ minor) & ~0xf)) - break; - } - if (entry == &cs46xx_devs) - return -ENODEV; - if (!card) { - CS_DBGOUT(CS_FUNCTION | CS_OPEN, 2, printk(KERN_INFO - "cs46xx: cs_open(): Error - unable to find audio card struct\n")); - return -ENODEV; - } - - /* - * hardcode state[0] for capture, [1] for playback - */ - if (file->f_mode & FMODE_READ) { - CS_DBGOUT(CS_WAVE_READ, 2, printk("cs46xx: cs_open() FMODE_READ\n") ); - if (card->states[0] == NULL) { - state = card->states[0] = - kzalloc(sizeof(struct cs_state), GFP_KERNEL); - if (state == NULL) - return -ENOMEM; - mutex_init(&state->sem); - dmabuf = &state->dmabuf; - dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); - if (dmabuf->pbuf == NULL) { - kfree(state); - card->states[0] = NULL; - return -ENOMEM; - } - } else { - state = card->states[0]; - if (state->open_mode & FMODE_READ) - return -EBUSY; - } - dmabuf->channel = card->alloc_rec_pcm_channel(card); - - if (dmabuf->channel == NULL) { - kfree(card->states[0]); - card->states[0] = NULL; - return -ENODEV; - } - - /* Now turn on external AMP if needed */ - state->card = card; - state->card->active_ctrl(state->card, 1); - state->card->amplifier_ctrl(state->card, 1); - - if ((tmp = cs46xx_powerup(card, CS_POWER_ADC))) { - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO - "cs46xx: cs46xx_powerup of ADC failed (0x%x)\n", tmp)); - return -EIO; - } - - dmabuf->channel->state = state; - /* initialize the virtual channel */ - state->virt = 0; - state->magic = CS_STATE_MAGIC; - init_waitqueue_head(&dmabuf->wait); - mutex_init(&state->open_mutex); - file->private_data = card; - - mutex_lock(&state->open_mutex); - - /* set default sample format. According to OSS Programmer's Guide /dev/dsp - should be default to unsigned 8-bits, mono, with sample rate 8kHz and - /dev/dspW will accept 16-bits sample */ - - /* Default input is 8bit mono */ - dmabuf->fmt &= ~CS_FMT_MASK; - dmabuf->type = CS_TYPE_ADC; - dmabuf->ossfragshift = 0; - dmabuf->ossmaxfrags = 0; - dmabuf->subdivision = 0; - cs_set_adc_rate(state, 8000); - cs_set_divisor(dmabuf); - - state->open_mode |= FMODE_READ; - mutex_unlock(&state->open_mutex); - } - if (file->f_mode & FMODE_WRITE) { - CS_DBGOUT(CS_OPEN, 2, printk("cs46xx: cs_open() FMODE_WRITE\n") ); - if (card->states[1] == NULL) { - state = card->states[1] = - kzalloc(sizeof(struct cs_state), GFP_KERNEL); - if (state == NULL) - return -ENOMEM; - mutex_init(&state->sem); - dmabuf = &state->dmabuf; - dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); - if (dmabuf->pbuf == NULL) { - kfree(state); - card->states[1] = NULL; - return -ENOMEM; - } - } else { - state = card->states[1]; - if (state->open_mode & FMODE_WRITE) - return -EBUSY; - } - dmabuf->channel = card->alloc_pcm_channel(card); - - if (dmabuf->channel == NULL) { - kfree(card->states[1]); - card->states[1] = NULL; - return -ENODEV; - } - - /* Now turn on external AMP if needed */ - state->card = card; - state->card->active_ctrl(state->card, 1); - state->card->amplifier_ctrl(state->card, 1); - - if ((tmp = cs46xx_powerup(card, CS_POWER_DAC))) { - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO - "cs46xx: cs46xx_powerup of DAC failed (0x%x)\n", tmp)); - return -EIO; - } - - dmabuf->channel->state = state; - /* initialize the virtual channel */ - state->virt = 1; - state->magic = CS_STATE_MAGIC; - init_waitqueue_head(&dmabuf->wait); - mutex_init(&state->open_mutex); - file->private_data = card; - - mutex_lock(&state->open_mutex); - - /* set default sample format. According to OSS Programmer's Guide /dev/dsp - should be default to unsigned 8-bits, mono, with sample rate 8kHz and - /dev/dspW will accept 16-bits sample */ - - /* Default output is 8bit mono. */ - dmabuf->fmt &= ~CS_FMT_MASK; - dmabuf->type = CS_TYPE_DAC; - dmabuf->ossfragshift = 0; - dmabuf->ossmaxfrags = 0; - dmabuf->subdivision = 0; - cs_set_dac_rate(state, 8000); - cs_set_divisor(dmabuf); - - state->open_mode |= FMODE_WRITE; - mutex_unlock(&state->open_mutex); - if ((ret = prog_dmabuf(state))) - return ret; - } - CS_DBGOUT(CS_OPEN | CS_FUNCTION, 2, printk("cs46xx: cs_open()- 0\n")); - return nonseekable_open(inode, file); -} - -static int cs_release(struct inode *inode, struct file *file) -{ - struct cs_card *card = file->private_data; - struct dmabuf *dmabuf; - struct cs_state *state; - unsigned int tmp; - CS_DBGOUT(CS_RELEASE | CS_FUNCTION, 2, printk("cs46xx: cs_release()+ file=%p %s %s\n", - file, file->f_mode & FMODE_WRITE ? "FMODE_WRITE" : "", - file->f_mode & FMODE_READ ? "FMODE_READ" : "")); - - if (!(file->f_mode & (FMODE_WRITE | FMODE_READ))) - return -EINVAL; - state = card->states[1]; - if (state) { - if ((state->open_mode & FMODE_WRITE) & (file->f_mode & FMODE_WRITE)) { - CS_DBGOUT(CS_RELEASE, 2, printk("cs46xx: cs_release() FMODE_WRITE\n")); - dmabuf = &state->dmabuf; - cs_clear_tail(state); - drain_dac(state, file->f_flags & O_NONBLOCK); - /* stop DMA state machine and free DMA buffers/channels */ - mutex_lock(&state->open_mutex); - stop_dac(state); - dealloc_dmabuf(state); - state->card->free_pcm_channel(state->card, dmabuf->channel->num); - free_page((unsigned long)state->dmabuf.pbuf); - - /* we're covered by the open_mutex */ - mutex_unlock(&state->open_mutex); - state->card->states[state->virt] = NULL; - state->open_mode &= (~file->f_mode) & (FMODE_READ|FMODE_WRITE); - - if ((tmp = cs461x_powerdown(card, CS_POWER_DAC, CS_FALSE))) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_INFO - "cs46xx: cs_release_mixdev() powerdown DAC failure (0x%x)\n",tmp) ); - } - - /* Now turn off external AMP if needed */ - state->card->amplifier_ctrl(state->card, -1); - state->card->active_ctrl(state->card, -1); - kfree(state); - } - } - - state = card->states[0]; - if (state) { - if ((state->open_mode & FMODE_READ) & (file->f_mode & FMODE_READ)) { - CS_DBGOUT(CS_RELEASE, 2, printk("cs46xx: cs_release() FMODE_READ\n")); - dmabuf = &state->dmabuf; - mutex_lock(&state->open_mutex); - stop_adc(state); - dealloc_dmabuf(state); - state->card->free_pcm_channel(state->card, dmabuf->channel->num); - free_page((unsigned long)state->dmabuf.pbuf); - - /* we're covered by the open_mutex */ - mutex_unlock(&state->open_mutex); - state->card->states[state->virt] = NULL; - state->open_mode &= (~file->f_mode) & (FMODE_READ|FMODE_WRITE); - - if ((tmp = cs461x_powerdown(card, CS_POWER_ADC, CS_FALSE))) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_INFO - "cs46xx: cs_release_mixdev() powerdown ADC failure (0x%x)\n",tmp) ); - } - - /* Now turn off external AMP if needed */ - state->card->amplifier_ctrl(state->card, -1); - state->card->active_ctrl(state->card, -1); - kfree(state); - } - } - - CS_DBGOUT(CS_FUNCTION | CS_RELEASE, 2, printk("cs46xx: cs_release()- 0\n")); - return 0; -} - -static void printpm(struct cs_card *s) -{ - CS_DBGOUT(CS_PM, 9, printk("pm struct:\n")); - CS_DBGOUT(CS_PM, 9, printk("flags:0x%x u32CLKCR1_SAVE: 0%x u32SSPMValue: 0x%x\n", - (unsigned)s->pm.flags,s->pm.u32CLKCR1_SAVE,s->pm.u32SSPMValue)); - CS_DBGOUT(CS_PM, 9, printk("u32PPLVCvalue: 0x%x u32PPRVCvalue: 0x%x\n", - s->pm.u32PPLVCvalue,s->pm.u32PPRVCvalue)); - CS_DBGOUT(CS_PM, 9, printk("u32FMLVCvalue: 0x%x u32FMRVCvalue: 0x%x\n", - s->pm.u32FMLVCvalue,s->pm.u32FMRVCvalue)); - CS_DBGOUT(CS_PM, 9, printk("u32GPIORvalue: 0x%x u32JSCTLvalue: 0x%x\n", - s->pm.u32GPIORvalue,s->pm.u32JSCTLvalue)); - CS_DBGOUT(CS_PM, 9, printk("u32SSCR: 0x%x u32SRCSA: 0x%x\n", - s->pm.u32SSCR,s->pm.u32SRCSA)); - CS_DBGOUT(CS_PM, 9, printk("u32DacASR: 0x%x u32AdcASR: 0x%x\n", - s->pm.u32DacASR,s->pm.u32AdcASR)); - CS_DBGOUT(CS_PM, 9, printk("u32DacSR: 0x%x u32AdcSR: 0x%x\n", - s->pm.u32DacSR,s->pm.u32AdcSR)); - CS_DBGOUT(CS_PM, 9, printk("u32MIDCR_Save: 0x%x\n", - s->pm.u32MIDCR_Save)); - CS_DBGOUT(CS_PM, 9, printk("u32AC97_powerdown: 0x%x _general_purpose 0x%x\n", - s->pm.u32AC97_powerdown,s->pm.u32AC97_general_purpose)); - CS_DBGOUT(CS_PM, 9, printk("u32AC97_master_volume: 0x%x\n", - s->pm.u32AC97_master_volume)); - CS_DBGOUT(CS_PM, 9, printk("u32AC97_headphone_volume: 0x%x\n", - s->pm.u32AC97_headphone_volume)); - CS_DBGOUT(CS_PM, 9, printk("u32AC97_master_volume_mono: 0x%x\n", - s->pm.u32AC97_master_volume_mono)); - CS_DBGOUT(CS_PM, 9, printk("u32AC97_pcm_out_volume: 0x%x\n", - s->pm.u32AC97_pcm_out_volume)); - CS_DBGOUT(CS_PM, 9, printk("dmabuf_swptr_play: 0x%x dmabuf_count_play: %d\n", - s->pm.dmabuf_swptr_play,s->pm.dmabuf_count_play)); - CS_DBGOUT(CS_PM, 9, printk("dmabuf_swptr_capture: 0x%x dmabuf_count_capture: %d\n", - s->pm.dmabuf_swptr_capture,s->pm.dmabuf_count_capture)); - -} - -/**************************************************************************** -* -* Suspend - save the ac97 regs, mute the outputs and power down the part. -* -****************************************************************************/ -static void cs46xx_ac97_suspend(struct cs_card *card) -{ - int Count,i; - struct ac97_codec *dev=card->ac97_codec[0]; - unsigned int tmp; - - CS_DBGOUT(CS_PM, 9, printk("cs46xx: cs46xx_ac97_suspend()+\n")); - - if (card->states[1]) { - stop_dac(card->states[1]); - resync_dma_ptrs(card->states[1]); - } - if (card->states[0]) { - stop_adc(card->states[0]); - resync_dma_ptrs(card->states[0]); - } - - for (Count = 0x2, i = 0; (Count <= CS46XX_AC97_HIGHESTREGTORESTORE) - && (i < CS46XX_AC97_NUMBER_RESTORE_REGS); - Count += 2, i++) { - card->pm.ac97[i] = cs_ac97_get(dev, BA0_AC97_RESET + Count); - } -/* -* Save the ac97 volume registers as well as the current powerdown state. -* Now, mute the all the outputs (master, headphone, and mono), as well -* as the PCM volume, in preparation for powering down the entire part. - card->pm.u32AC97_master_volume = (u32)cs_ac97_get( dev, - (u8)BA0_AC97_MASTER_VOLUME); - card->pm.u32AC97_headphone_volume = (u32)cs_ac97_get(dev, - (u8)BA0_AC97_HEADPHONE_VOLUME); - card->pm.u32AC97_master_volume_mono = (u32)cs_ac97_get(dev, - (u8)BA0_AC97_MASTER_VOLUME_MONO); - card->pm.u32AC97_pcm_out_volume = (u32)cs_ac97_get(dev, - (u8)BA0_AC97_PCM_OUT_VOLUME); -*/ -/* -* mute the outputs -*/ - cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME, 0x8000); - cs_ac97_set(dev, (u8)BA0_AC97_HEADPHONE_VOLUME, 0x8000); - cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME_MONO, 0x8000); - cs_ac97_set(dev, (u8)BA0_AC97_PCM_OUT_VOLUME, 0x8000); - -/* -* save the registers that cause pops -*/ - card->pm.u32AC97_powerdown = (u32)cs_ac97_get(dev, (u8)AC97_POWER_CONTROL); - card->pm.u32AC97_general_purpose = (u32)cs_ac97_get(dev, (u8)BA0_AC97_GENERAL_PURPOSE); -/* -* And power down everything on the AC97 codec. -* well, for now, only power down the DAC/ADC and MIXER VREFON components. -* trouble with removing VREF. -*/ - if ((tmp = cs461x_powerdown(card, CS_POWER_DAC | CS_POWER_ADC | - CS_POWER_MIXVON, CS_TRUE))) { - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO - "cs46xx: cs46xx_ac97_suspend() failure (0x%x)\n",tmp)); - } - - CS_DBGOUT(CS_PM, 9, printk("cs46xx: cs46xx_ac97_suspend()-\n")); -} - -/**************************************************************************** -* -* Resume - power up the part and restore its registers.. -* -****************************************************************************/ -static void cs46xx_ac97_resume(struct cs_card *card) -{ - int Count,i; - struct ac97_codec *dev=card->ac97_codec[0]; - - CS_DBGOUT(CS_PM, 9, printk("cs46xx: cs46xx_ac97_resume()+\n")); - -/* -* First, we restore the state of the general purpose register. This -* contains the mic select (mic1 or mic2) and if we restore this after -* we restore the mic volume/boost state and mic2 was selected at -* suspend time, we will end up with a brief period of time where mic1 -* is selected with the volume/boost settings for mic2, causing -* acoustic feedback. So we restore the general purpose register -* first, thereby getting the correct mic selected before we restore -* the mic volume/boost. -*/ - cs_ac97_set(dev, (u8)BA0_AC97_GENERAL_PURPOSE, - (u16)card->pm.u32AC97_general_purpose); -/* -* Now, while the outputs are still muted, restore the state of power -* on the AC97 part. -*/ - cs_ac97_set(dev, (u8)BA0_AC97_POWERDOWN, (u16)card->pm.u32AC97_powerdown); - mdelay(5 * cs_laptop_wait); -/* -* Restore just the first set of registers, from register number -* 0x02 to the register number that ulHighestRegToRestore specifies. -*/ - for (Count = 0x2, i=0; (Count <= CS46XX_AC97_HIGHESTREGTORESTORE) && - (i < CS46XX_AC97_NUMBER_RESTORE_REGS); Count += 2, i++) { - cs_ac97_set(dev, (u8)(BA0_AC97_RESET + Count), (u16)card->pm.ac97[i]); - } - - /* Check if we have to init the amplifier */ - if (card->amp_init) - card->amp_init(card); - - CS_DBGOUT(CS_PM, 9, printk("cs46xx: cs46xx_ac97_resume()-\n")); -} - - -static int cs46xx_restart_part(struct cs_card *card) -{ - struct dmabuf *dmabuf; - - CS_DBGOUT(CS_PM | CS_FUNCTION, 4, - printk( "cs46xx: cs46xx_restart_part()+\n")); - if (card->states[1]) { - dmabuf = &card->states[1]->dmabuf; - dmabuf->ready = 0; - resync_dma_ptrs(card->states[1]); - cs_set_divisor(dmabuf); - if (__prog_dmabuf(card->states[1])) { - CS_DBGOUT(CS_PM | CS_ERROR, 1, - printk("cs46xx: cs46xx_restart_part()- (-1) prog_dmabuf() dac error\n")); - return -1; - } - cs_set_dac_rate(card->states[1], dmabuf->rate); - } - if (card->states[0]) { - dmabuf = &card->states[0]->dmabuf; - dmabuf->ready = 0; - resync_dma_ptrs(card->states[0]); - cs_set_divisor(dmabuf); - if (__prog_dmabuf(card->states[0])) { - CS_DBGOUT(CS_PM | CS_ERROR, 1, - printk("cs46xx: cs46xx_restart_part()- (-1) prog_dmabuf() adc error\n")); - return -1; - } - cs_set_adc_rate(card->states[0], dmabuf->rate); - } - card->pm.flags |= CS46XX_PM_RESUMED; - if (card->states[0]) - start_adc(card->states[0]); - if (card->states[1]) - start_dac(card->states[1]); - - card->pm.flags |= CS46XX_PM_IDLE; - card->pm.flags &= ~(CS46XX_PM_SUSPENDING | CS46XX_PM_SUSPENDED - | CS46XX_PM_RESUMING | CS46XX_PM_RESUMED); - if (card->states[0]) - wake_up(&card->states[0]->dmabuf.wait); - if (card->states[1]) - wake_up(&card->states[1]->dmabuf.wait); - - CS_DBGOUT(CS_PM | CS_FUNCTION, 4, - printk( "cs46xx: cs46xx_restart_part()-\n")); - return 0; -} - -static void cs461x_reset(struct cs_card *card); -static void cs461x_proc_stop(struct cs_card *card); -static int cs46xx_suspend(struct cs_card *card, pm_message_t state) -{ - unsigned int tmp; - - CS_DBGOUT(CS_PM | CS_FUNCTION, 4, - printk("cs46xx: cs46xx_suspend()+ flags=0x%x s=%p\n", - (unsigned)card->pm.flags,card)); -/* -* check the current state, only suspend if IDLE -*/ - if (!(card->pm.flags & CS46XX_PM_IDLE)) { - CS_DBGOUT(CS_PM | CS_ERROR, 2, - printk("cs46xx: cs46xx_suspend() unable to suspend, not IDLE\n")); - return 1; - } - card->pm.flags &= ~CS46XX_PM_IDLE; - card->pm.flags |= CS46XX_PM_SUSPENDING; - - card->active_ctrl(card,1); - - tmp = cs461x_peek(card, BA1_PFIE); - tmp &= ~0x0000f03f; - tmp |= 0x00000010; - cs461x_poke(card, BA1_PFIE, tmp); /* playback interrupt disable */ - - tmp = cs461x_peek(card, BA1_CIE); - tmp &= ~0x0000003f; - tmp |= 0x00000011; - cs461x_poke(card, BA1_CIE, tmp); /* capture interrupt disable */ - - /* - * Stop playback DMA. - */ - tmp = cs461x_peek(card, BA1_PCTL); - cs461x_poke(card, BA1_PCTL, tmp & 0x0000ffff); - - /* - * Stop capture DMA. - */ - tmp = cs461x_peek(card, BA1_CCTL); - cs461x_poke(card, BA1_CCTL, tmp & 0xffff0000); - - if (card->states[1]) { - card->pm.dmabuf_swptr_play = card->states[1]->dmabuf.swptr; - card->pm.dmabuf_count_play = card->states[1]->dmabuf.count; - } - if (card->states[0]) { - card->pm.dmabuf_swptr_capture = card->states[0]->dmabuf.swptr; - card->pm.dmabuf_count_capture = card->states[0]->dmabuf.count; - } - - cs46xx_ac97_suspend(card); - - /* - * Reset the processor. - */ - cs461x_reset(card); - - cs461x_proc_stop(card); - - /* - * Power down the DAC and ADC. For now leave the other areas on. - */ - cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, 0x0300); - - /* - * Power down the PLL. - */ - cs461x_pokeBA0(card, BA0_CLKCR1, 0); - - /* - * Turn off the Processor by turning off the software clock enable flag in - * the clock control register. - */ - tmp = cs461x_peekBA0(card, BA0_CLKCR1) & ~CLKCR1_SWCE; - cs461x_pokeBA0(card, BA0_CLKCR1, tmp); - - card->active_ctrl(card,-1); - - card->pm.flags &= ~CS46XX_PM_SUSPENDING; - card->pm.flags |= CS46XX_PM_SUSPENDED; - - printpm(card); - - CS_DBGOUT(CS_PM | CS_FUNCTION, 4, - printk("cs46xx: cs46xx_suspend()- flags=0x%x\n", - (unsigned)card->pm.flags)); - return 0; -} - -static int cs46xx_resume(struct cs_card *card) -{ - int i; - - CS_DBGOUT(CS_PM | CS_FUNCTION, 4, - printk( "cs46xx: cs46xx_resume()+ flags=0x%x\n", - (unsigned)card->pm.flags)); - if (!(card->pm.flags & CS46XX_PM_SUSPENDED)) { - CS_DBGOUT(CS_PM | CS_ERROR, 2, - printk("cs46xx: cs46xx_resume() unable to resume, not SUSPENDED\n")); - return 1; - } - card->pm.flags |= CS46XX_PM_RESUMING; - card->pm.flags &= ~CS46XX_PM_SUSPENDED; - printpm(card); - card->active_ctrl(card, 1); - - for (i = 0; i < 5; i++) { - if (cs_hardware_init(card) != 0) { - CS_DBGOUT(CS_PM | CS_ERROR, 4, printk( - "cs46xx: cs46xx_resume()- ERROR in cs_hardware_init()\n")); - mdelay(10 * cs_laptop_wait); - cs461x_reset(card); - continue; - } - break; - } - if (i >= 4) { - CS_DBGOUT(CS_PM | CS_ERROR, 1, printk( - "cs46xx: cs46xx_resume()- cs_hardware_init() failed, retried %d times.\n",i)); - return 0; - } - - if (cs46xx_restart_part(card)) { - CS_DBGOUT(CS_PM | CS_ERROR, 4, printk( - "cs46xx: cs46xx_resume(): cs46xx_restart_part() returned error\n")); - } - - card->active_ctrl(card, -1); - - CS_DBGOUT(CS_PM | CS_FUNCTION, 4, printk("cs46xx: cs46xx_resume()- flags=0x%x\n", - (unsigned)card->pm.flags)); - return 0; -} - -static /*const*/ struct file_operations cs461x_fops = { - CS_OWNER CS_THIS_MODULE - .llseek = no_llseek, - .read = cs_read, - .write = cs_write, - .poll = cs_poll, - .ioctl = cs_ioctl, - .mmap = cs_mmap, - .open = cs_open, - .release = cs_release, -}; - -/* Write AC97 codec registers */ - - -static u16 _cs_ac97_get(struct ac97_codec *dev, u8 reg) -{ - struct cs_card *card = dev->private_data; - int count,loopcnt; - unsigned int tmp; - u16 ret; - - /* - * 1. Write ACCAD = Command Address Register = 46Ch for AC97 register address - * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97 - * 3. Write ACCTL = Control Register = 460h for initiating the write - * 4. Read ACCTL = 460h, DCV should be reset by now and 460h = 17h - * 5. if DCV not cleared, break and return error - * 6. Read ACSTS = Status Register = 464h, check VSTS bit - */ - - cs461x_peekBA0(card, BA0_ACSDA); - - /* - * Setup the AC97 control registers on the CS461x to send the - * appropriate command to the AC97 to perform the read. - * ACCAD = Command Address Register = 46Ch - * ACCDA = Command Data Register = 470h - * ACCTL = Control Register = 460h - * set DCV - will clear when process completed - * set CRW - Read command - * set VFRM - valid frame enabled - * set ESYN - ASYNC generation enabled - * set RSTN - ARST# inactive, AC97 codec not reset - */ - - cs461x_pokeBA0(card, BA0_ACCAD, reg); - cs461x_pokeBA0(card, BA0_ACCDA, 0); - cs461x_pokeBA0(card, BA0_ACCTL, ACCTL_DCV | ACCTL_CRW | - ACCTL_VFRM | ACCTL_ESYN | - ACCTL_RSTN); - - - /* - * Wait for the read to occur. - */ - if (!(card->pm.flags & CS46XX_PM_IDLE)) - loopcnt = 2000; - else - loopcnt = 500 * cs_laptop_wait; - loopcnt *= cs_laptop_wait; - for (count = 0; count < loopcnt; count++) { - /* - * First, we want to wait for a short time. - */ - udelay(10 * cs_laptop_wait); - /* - * Now, check to see if the read has completed. - * ACCTL = 460h, DCV should be reset by now and 460h = 17h - */ - if (!(cs461x_peekBA0(card, BA0_ACCTL) & ACCTL_DCV)) - break; - } - - /* - * Make sure the read completed. - */ - if (cs461x_peekBA0(card, BA0_ACCTL) & ACCTL_DCV) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING - "cs46xx: AC'97 read problem (ACCTL_DCV), reg = 0x%x returning 0xffff\n", reg)); - return 0xffff; - } - - /* - * Wait for the valid status bit to go active. - */ - - if (!(card->pm.flags & CS46XX_PM_IDLE)) - loopcnt = 2000; - else - loopcnt = 1000; - loopcnt *= cs_laptop_wait; - for (count = 0; count < loopcnt; count++) { - /* - * Read the AC97 status register. - * ACSTS = Status Register = 464h - * VSTS - Valid Status - */ - if (cs461x_peekBA0(card, BA0_ACSTS) & ACSTS_VSTS) - break; - udelay(10 * cs_laptop_wait); - } - - /* - * Make sure we got valid status. - */ - if (!((tmp = cs461x_peekBA0(card, BA0_ACSTS)) & ACSTS_VSTS)) { - CS_DBGOUT(CS_ERROR, 2, printk(KERN_WARNING - "cs46xx: AC'97 read problem (ACSTS_VSTS), reg = 0x%x val=0x%x 0xffff \n", - reg, tmp)); - return 0xffff; - } - - /* - * Read the data returned from the AC97 register. - * ACSDA = Status Data Register = 474h - */ - CS_DBGOUT(CS_FUNCTION, 9, printk(KERN_INFO - "cs46xx: cs_ac97_get() reg = 0x%x, val = 0x%x, BA0_ACCAD = 0x%x\n", - reg, cs461x_peekBA0(card, BA0_ACSDA), - cs461x_peekBA0(card, BA0_ACCAD))); - ret = cs461x_peekBA0(card, BA0_ACSDA); - return ret; -} - -static u16 cs_ac97_get(struct ac97_codec *dev, u8 reg) -{ - u16 ret; - struct cs_card *card = dev->private_data; - - spin_lock(&card->ac97_lock); - ret = _cs_ac97_get(dev, reg); - spin_unlock(&card->ac97_lock); - return ret; -} - -static void cs_ac97_set(struct ac97_codec *dev, u8 reg, u16 val) -{ - struct cs_card *card = dev->private_data; - int count; - int val2 = 0; - - spin_lock(&card->ac97_lock); - - if (reg == AC97_CD_VOL) - val2 = _cs_ac97_get(dev, AC97_CD_VOL); - - /* - * 1. Write ACCAD = Command Address Register = 46Ch for AC97 register address - * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97 - * 3. Write ACCTL = Control Register = 460h for initiating the write - * 4. Read ACCTL = 460h, DCV should be reset by now and 460h = 07h - * 5. if DCV not cleared, break and return error - */ - - /* - * Setup the AC97 control registers on the CS461x to send the - * appropriate command to the AC97 to perform the read. - * ACCAD = Command Address Register = 46Ch - * ACCDA = Command Data Register = 470h - * ACCTL = Control Register = 460h - * set DCV - will clear when process completed - * reset CRW - Write command - * set VFRM - valid frame enabled - * set ESYN - ASYNC generation enabled - * set RSTN - ARST# inactive, AC97 codec not reset - */ - cs461x_pokeBA0(card, BA0_ACCAD, reg); - cs461x_pokeBA0(card, BA0_ACCDA, val); - cs461x_peekBA0(card, BA0_ACCTL); - cs461x_pokeBA0(card, BA0_ACCTL, 0 | ACCTL_VFRM | ACCTL_ESYN | ACCTL_RSTN); - cs461x_pokeBA0(card, BA0_ACCTL, ACCTL_DCV | ACCTL_VFRM | - ACCTL_ESYN | ACCTL_RSTN); - for (count = 0; count < 1000; count++) { - /* - * First, we want to wait for a short time. - */ - udelay(10 * cs_laptop_wait); - /* - * Now, check to see if the write has completed. - * ACCTL = 460h, DCV should be reset by now and 460h = 07h - */ - if (!(cs461x_peekBA0(card, BA0_ACCTL) & ACCTL_DCV)) - break; - } - /* - * Make sure the write completed. - */ - if (cs461x_peekBA0(card, BA0_ACCTL) & ACCTL_DCV) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING - "cs46xx: AC'97 write problem, reg = 0x%x, val = 0x%x\n", reg, val)); - } - - spin_unlock(&card->ac97_lock); - - /* - * Adjust power if the mixer is selected/deselected according - * to the CD. - * - * IF the CD is a valid input source (mixer or direct) AND - * the CD is not muted THEN power is needed - * - * We do two things. When record select changes the input to - * add/remove the CD we adjust the power count if the CD is - * unmuted. - * - * When the CD mute changes we adjust the power level if the - * CD was a valid input. - * - * We also check for CD volume != 0, as the CD mute isn't - * normally tweaked from userspace. - */ - - /* CD mute change ? */ - - if (reg == AC97_CD_VOL) { - /* Mute bit change ? */ - if ((val2^val) & 0x8000 || - ((val2 == 0x1f1f || val == 0x1f1f) && val2 != val)) { - /* This is a hack but its cleaner than the alternatives. - Right now card->ac97_codec[0] might be NULL as we are - still doing codec setup. This does an early assignment - to avoid the problem if it occurs */ - - if (card->ac97_codec[0] == NULL) - card->ac97_codec[0] = dev; - - /* Mute on */ - if (val & 0x8000 || val == 0x1f1f) - card->amplifier_ctrl(card, -1); - else { /* Mute off power on */ - if (card->amp_init) - card->amp_init(card); - card->amplifier_ctrl(card, 1); - } - } - } -} - -/* OSS /dev/mixer file operation methods */ - -static int cs_open_mixdev(struct inode *inode, struct file *file) -{ - int i = 0; - unsigned int minor = iminor(inode); - struct cs_card *card = NULL; - struct list_head *entry; - unsigned int tmp; - - CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4, - printk(KERN_INFO "cs46xx: cs_open_mixdev()+\n")); - - list_for_each(entry, &cs46xx_devs) { - card = list_entry(entry, struct cs_card, list); - for (i = 0; i < NR_AC97; i++) - if (card->ac97_codec[i] != NULL && - card->ac97_codec[i]->dev_mixer == minor) - goto match; - } - if (!card) { - CS_DBGOUT(CS_FUNCTION | CS_OPEN | CS_ERROR, 2, - printk(KERN_INFO "cs46xx: cs46xx_open_mixdev()- -ENODEV\n")); - return -ENODEV; - } - match: - if (!card->ac97_codec[i]) - return -ENODEV; - file->private_data = card->ac97_codec[i]; - - card->active_ctrl(card,1); - if (!CS_IN_USE(&card->mixer_use_cnt)) { - if ((tmp = cs46xx_powerup(card, CS_POWER_MIXVON))) { - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO - "cs46xx: cs_open_mixdev() powerup failure (0x%x)\n", tmp)); - return -EIO; - } - } - card->amplifier_ctrl(card, 1); - CS_INC_USE_COUNT(&card->mixer_use_cnt); - CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4, - printk(KERN_INFO "cs46xx: cs_open_mixdev()- 0\n")); - return nonseekable_open(inode, file); -} - -static int cs_release_mixdev(struct inode *inode, struct file *file) -{ - unsigned int minor = iminor(inode); - struct cs_card *card = NULL; - struct list_head *entry; - int i; - unsigned int tmp; - - CS_DBGOUT(CS_FUNCTION | CS_RELEASE, 4, - printk(KERN_INFO "cs46xx: cs_release_mixdev()+\n")); - list_for_each(entry, &cs46xx_devs) - { - card = list_entry(entry, struct cs_card, list); - for (i = 0; i < NR_AC97; i++) - if (card->ac97_codec[i] != NULL && - card->ac97_codec[i]->dev_mixer == minor) - goto match; - } - if (!card) { - CS_DBGOUT(CS_FUNCTION | CS_OPEN | CS_ERROR, 2, - printk(KERN_INFO "cs46xx: cs46xx_open_mixdev()- -ENODEV\n")); - return -ENODEV; - } -match: - if (!CS_DEC_AND_TEST(&card->mixer_use_cnt)) { - CS_DBGOUT(CS_FUNCTION | CS_RELEASE, 4, - printk(KERN_INFO "cs46xx: cs_release_mixdev()- no powerdown, usecnt>0\n")); - card->active_ctrl(card, -1); - card->amplifier_ctrl(card, -1); - return 0; - } -/* -* ok, no outstanding mixer opens, so powerdown. -*/ - if ((tmp = cs461x_powerdown(card, CS_POWER_MIXVON, CS_FALSE))) { - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO - "cs46xx: cs_release_mixdev() powerdown MIXVON failure (0x%x)\n", tmp)); - card->active_ctrl(card, -1); - card->amplifier_ctrl(card, -1); - return -EIO; - } - card->active_ctrl(card, -1); - card->amplifier_ctrl(card, -1); - CS_DBGOUT(CS_FUNCTION | CS_RELEASE, 4, - printk(KERN_INFO "cs46xx: cs_release_mixdev()- 0\n")); - return 0; -} - -static int cs_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, - unsigned long arg) -{ - struct ac97_codec *codec = file->private_data; - struct cs_card *card = NULL; - struct list_head *entry; - unsigned long __user *p = (long __user *)arg; -#if CSDEBUG_INTERFACE - int val; - - if ( (cmd == SOUND_MIXER_CS_GETDBGMASK) || - (cmd == SOUND_MIXER_CS_SETDBGMASK) || - (cmd == SOUND_MIXER_CS_GETDBGLEVEL) || - (cmd == SOUND_MIXER_CS_SETDBGLEVEL) || - (cmd == SOUND_MIXER_CS_APM)) { - switch (cmd) { - case SOUND_MIXER_CS_GETDBGMASK: - return put_user(cs_debugmask, p); - case SOUND_MIXER_CS_GETDBGLEVEL: - return put_user(cs_debuglevel, p); - case SOUND_MIXER_CS_SETDBGMASK: - if (get_user(val, p)) - return -EFAULT; - cs_debugmask = val; - return 0; - case SOUND_MIXER_CS_SETDBGLEVEL: - if (get_user(val, p)) - return -EFAULT; - cs_debuglevel = val; - return 0; - case SOUND_MIXER_CS_APM: - if (get_user(val, p)) - return -EFAULT; - if (val == CS_IOCTL_CMD_SUSPEND) { - list_for_each(entry, &cs46xx_devs) { - card = list_entry(entry, struct cs_card, list); - cs46xx_suspend(card, PMSG_ON); - } - - } else if (val == CS_IOCTL_CMD_RESUME) { - list_for_each(entry, &cs46xx_devs) { - card = list_entry(entry, struct cs_card, list); - cs46xx_resume(card); - } - } else { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_INFO - "cs46xx: mixer_ioctl(): invalid APM cmd (%d)\n", - val)); - } - return 0; - default: - CS_DBGOUT(CS_ERROR, 1, printk(KERN_INFO - "cs46xx: mixer_ioctl(): ERROR unknown debug cmd\n")); - return 0; - } - } -#endif - return codec->mixer_ioctl(codec, cmd, arg); -} - -static /*const*/ struct file_operations cs_mixer_fops = { - CS_OWNER CS_THIS_MODULE - .llseek = no_llseek, - .ioctl = cs_ioctl_mixdev, - .open = cs_open_mixdev, - .release = cs_release_mixdev, -}; - -/* AC97 codec initialisation. */ -static int __init cs_ac97_init(struct cs_card *card) -{ - int num_ac97 = 0; - int ready_2nd = 0; - struct ac97_codec *codec; - u16 eid; - - CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO - "cs46xx: cs_ac97_init()+\n") ); - - for (num_ac97 = 0; num_ac97 < NR_AC97; num_ac97++) { - if ((codec = ac97_alloc_codec()) == NULL) - return -ENOMEM; - - /* initialize some basic codec information, other fields will be filled - in ac97_probe_codec */ - codec->private_data = card; - codec->id = num_ac97; - - codec->codec_read = cs_ac97_get; - codec->codec_write = cs_ac97_set; - - if (ac97_probe_codec(codec) == 0) { - CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO - "cs46xx: cs_ac97_init()- codec number %d not found\n", - num_ac97) ); - card->ac97_codec[num_ac97] = NULL; - break; - } - CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO - "cs46xx: cs_ac97_init() found codec %d\n",num_ac97)); - - eid = cs_ac97_get(codec, AC97_EXTENDED_ID); - - if (eid == 0xFFFF) { - printk(KERN_WARNING "cs46xx: codec %d not present\n",num_ac97); - ac97_release_codec(codec); - break; - } - - card->ac97_features = eid; - - if ((codec->dev_mixer = register_sound_mixer(&cs_mixer_fops, -1)) < 0) { - printk(KERN_ERR "cs46xx: couldn't register mixer!\n"); - ac97_release_codec(codec); - break; - } - card->ac97_codec[num_ac97] = codec; - - CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO - "cs46xx: cs_ac97_init() ac97_codec[%d] set to %p\n", - (unsigned int)num_ac97, - codec)); - /* if there is no secondary codec at all, don't probe any more */ - if (!ready_2nd) - { - num_ac97 += 1; - break; - } - } - CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO - "cs46xx: cs_ac97_init()- %d\n", (unsigned int)num_ac97)); - return num_ac97; -} - -/* - * load the static image into the DSP - */ -#include "cs461x_image.h" -static void cs461x_download_image(struct cs_card *card) -{ - unsigned i, j, temp1, temp2, offset, count; - unsigned char __iomem *pBA1 = ioremap(card->ba1_addr, 0x40000); - for (i = 0; i < CLEAR__COUNT; i++) { - offset = ClrStat[i].BA1__DestByteOffset; - count = ClrStat[i].BA1__SourceSize; - for (temp1 = offset; temp1 < (offset + count); temp1 += 4) - writel(0, pBA1+temp1); - } - - for (i = 0; i < FILL__COUNT; i++) { - temp2 = FillStat[i].Offset; - for (j = 0; j < (FillStat[i].Size) / 4; j++) { - temp1 = (FillStat[i]).pFill[j]; - writel(temp1, pBA1+temp2 + j * 4); - } - } - iounmap(pBA1); -} - -/* - * Chip reset - */ - -static void cs461x_reset(struct cs_card *card) -{ - int idx; - - /* - * Write the reset bit of the SP control register. - */ - cs461x_poke(card, BA1_SPCR, SPCR_RSTSP); - - /* - * Write the control register. - */ - cs461x_poke(card, BA1_SPCR, SPCR_DRQEN); - - /* - * Clear the trap registers. - */ - for (idx = 0; idx < 8; idx++) { - cs461x_poke(card, BA1_DREG, DREG_REGID_TRAP_SELECT + idx); - cs461x_poke(card, BA1_TWPR, 0xFFFF); - } - cs461x_poke(card, BA1_DREG, 0); - - /* - * Set the frame timer to reflect the number of cycles per frame. - */ - cs461x_poke(card, BA1_FRMT, 0xadf); -} - -static void cs461x_clear_serial_FIFOs(struct cs_card *card, int type) -{ - int idx, loop, startfifo=0, endfifo=0, powerdown1 = 0; - unsigned int tmp; - - /* - * See if the devices are powered down. If so, we must power them up first - * or they will not respond. - */ - if (!((tmp = cs461x_peekBA0(card, BA0_CLKCR1)) & CLKCR1_SWCE)) { - cs461x_pokeBA0(card, BA0_CLKCR1, tmp | CLKCR1_SWCE); - powerdown1 = 1; - } - - /* - * We want to clear out the serial port FIFOs so we don't end up playing - * whatever random garbage happens to be in them. We fill the sample FIFOS - * with zero (silence). - */ - cs461x_pokeBA0(card, BA0_SERBWP, 0); - - /* - * Check for which FIFO locations to clear, if we are currently - * playing or capturing then we don't want to put in 128 bytes of - * "noise". - */ - if (type & CS_TYPE_DAC) { - startfifo = 128; - endfifo = 256; - } - if (type & CS_TYPE_ADC) { - startfifo = 0; - if (!endfifo) - endfifo = 128; - } - /* - * Fill sample FIFO locations (256 locations total). - */ - for (idx = startfifo; idx < endfifo; idx++) { - /* - * Make sure the previous FIFO write operation has completed. - */ - for (loop = 0; loop < 5; loop++) { - udelay(50); - if (!(cs461x_peekBA0(card, BA0_SERBST) & SERBST_WBSY)) - break; - } - if (cs461x_peekBA0(card, BA0_SERBST) & SERBST_WBSY) { - if (powerdown1) - cs461x_pokeBA0(card, BA0_CLKCR1, tmp); - } - /* - * Write the serial port FIFO index. - */ - cs461x_pokeBA0(card, BA0_SERBAD, idx); - /* - * Tell the serial port to load the new value into the FIFO location. - */ - cs461x_pokeBA0(card, BA0_SERBCM, SERBCM_WRC); - } - /* - * Now, if we powered up the devices, then power them back down again. - * This is kinda ugly, but should never happen. - */ - if (powerdown1) - cs461x_pokeBA0(card, BA0_CLKCR1, tmp); -} - - -static int cs461x_powerdown(struct cs_card *card, unsigned int type, int suspendflag) -{ - int count; - unsigned int tmp=0,muted=0; - - CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO - "cs46xx: cs461x_powerdown()+ type=0x%x\n",type)); - if (!cs_powerdown && !suspendflag) { - CS_DBGOUT(CS_FUNCTION, 8, printk(KERN_INFO - "cs46xx: cs461x_powerdown() DISABLED exiting\n")); - return 0; - } - tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL); - CS_DBGOUT(CS_FUNCTION, 8, printk(KERN_INFO - "cs46xx: cs461x_powerdown() powerdown reg=0x%x\n",tmp)); -/* -* if powering down only the VREF, and not powering down the DAC/ADC, -* then do not power down the VREF, UNLESS both the DAC and ADC are not -* currently powered down. If powering down DAC and ADC, then -* it is possible to power down the VREF (ON). -*/ - if (((type & CS_POWER_MIXVON) && - (!(type & CS_POWER_ADC) || (!(type & CS_POWER_DAC)))) - && - ((tmp & CS_AC97_POWER_CONTROL_ADC_ON) || - (tmp & CS_AC97_POWER_CONTROL_DAC_ON))) { - CS_DBGOUT(CS_FUNCTION, 8, printk(KERN_INFO - "cs46xx: cs461x_powerdown()- 0 unable to powerdown. tmp=0x%x\n",tmp)); - return 0; - } -/* -* for now, always keep power to the mixer block. -* not sure why it's a problem but it seems to be if we power off. -*/ - type &= ~CS_POWER_MIXVON; - type &= ~CS_POWER_MIXVOFF; - - /* - * Power down indicated areas. - */ - if (type & CS_POWER_MIXVOFF) { - - CS_DBGOUT(CS_FUNCTION, 4, - printk(KERN_INFO "cs46xx: cs461x_powerdown()+ MIXVOFF\n")); - /* - * Power down the MIXER (VREF ON) on the AC97 card. - */ - tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL); - if (tmp & CS_AC97_POWER_CONTROL_MIXVOFF_ON) { - if (!muted) { - cs_mute(card, CS_TRUE); - muted = 1; - } - tmp |= CS_AC97_POWER_CONTROL_MIXVOFF; - cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp ); - /* - * Now, we wait until we sample a ready state. - */ - for (count = 0; count < 32; count++) { - /* - * First, lets wait a short while to let things settle out a - * bit, and to prevent retrying the read too quickly. - */ - udelay(500); - - /* - * Read the current state of the power control register. - */ - if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_MIXVOFF_ON)) - break; - } - - /* - * Check the status.. - */ - if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_MIXVOFF_ON) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING - "cs46xx: powerdown MIXVOFF failed\n")); - return 1; - } - } - } - if (type & CS_POWER_MIXVON) { - - CS_DBGOUT(CS_FUNCTION, 4, - printk(KERN_INFO "cs46xx: cs461x_powerdown()+ MIXVON\n")); - /* - * Power down the MIXER (VREF ON) on the AC97 card. - */ - tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL); - if (tmp & CS_AC97_POWER_CONTROL_MIXVON_ON) { - if (!muted) { - cs_mute(card, CS_TRUE); - muted = 1; - } - tmp |= CS_AC97_POWER_CONTROL_MIXVON; - cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp); - /* - * Now, we wait until we sample a ready state. - */ - for (count = 0; count < 32; count++) { - /* - * First, lets wait a short while to let things settle out a - * bit, and to prevent retrying the read too quickly. - */ - udelay(500); - - /* - * Read the current state of the power control register. - */ - if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_MIXVON_ON)) - break; - } - - /* - * Check the status.. - */ - if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_MIXVON_ON) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING - "cs46xx: powerdown MIXVON failed\n")); - return 1; - } - } - } - if (type & CS_POWER_ADC) { - /* - * Power down the ADC on the AC97 card. - */ - CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO "cs46xx: cs461x_powerdown()+ ADC\n")); - tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL); - if (tmp & CS_AC97_POWER_CONTROL_ADC_ON) { - if (!muted) { - cs_mute(card, CS_TRUE); - muted = 1; - } - tmp |= CS_AC97_POWER_CONTROL_ADC; - cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp); - - /* - * Now, we wait until we sample a ready state. - */ - for (count = 0; count < 32; count++) { - /* - * First, lets wait a short while to let things settle out a - * bit, and to prevent retrying the read too quickly. - */ - udelay(500); - - /* - * Read the current state of the power control register. - */ - if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_ADC_ON)) - break; - } - - /* - * Check the status.. - */ - if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_ADC_ON) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING - "cs46xx: powerdown ADC failed\n")); - return 1; - } - } - } - if (type & CS_POWER_DAC) { - /* - * Power down the DAC on the AC97 card. - */ - - CS_DBGOUT(CS_FUNCTION, 4, - printk(KERN_INFO "cs46xx: cs461x_powerdown()+ DAC\n")); - tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL); - if (tmp & CS_AC97_POWER_CONTROL_DAC_ON) { - if (!muted) { - cs_mute(card, CS_TRUE); - muted = 1; - } - tmp |= CS_AC97_POWER_CONTROL_DAC; - cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp); - /* - * Now, we wait until we sample a ready state. - */ - for (count = 0; count < 32; count++) { - /* - * First, lets wait a short while to let things settle out a - * bit, and to prevent retrying the read too quickly. - */ - udelay(500); - - /* - * Read the current state of the power control register. - */ - if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_DAC_ON)) - break; - } - - /* - * Check the status.. - */ - if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_DAC_ON) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING - "cs46xx: powerdown DAC failed\n")); - return 1; - } - } - } - tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL); - if (muted) - cs_mute(card, CS_FALSE); - CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO - "cs46xx: cs461x_powerdown()- 0 tmp=0x%x\n",tmp)); - return 0; -} - -static int cs46xx_powerup(struct cs_card *card, unsigned int type) -{ - int count; - unsigned int tmp = 0, muted = 0; - - CS_DBGOUT(CS_FUNCTION, 8, printk(KERN_INFO - "cs46xx: cs46xx_powerup()+ type=0x%x\n",type)); - /* - * check for VREF and powerup if need to. - */ - if (type & CS_POWER_MIXVON) - type |= CS_POWER_MIXVOFF; - if (type & (CS_POWER_DAC | CS_POWER_ADC)) - type |= CS_POWER_MIXVON | CS_POWER_MIXVOFF; - - /* - * Power up indicated areas. - */ - if (type & CS_POWER_MIXVOFF) { - - CS_DBGOUT(CS_FUNCTION, 4, - printk(KERN_INFO "cs46xx: cs46xx_powerup()+ MIXVOFF\n")); - /* - * Power up the MIXER (VREF ON) on the AC97 card. - */ - tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL); - if (!(tmp & CS_AC97_POWER_CONTROL_MIXVOFF_ON)) { - if (!muted) { - cs_mute(card, CS_TRUE); - muted = 1; - } - tmp &= ~CS_AC97_POWER_CONTROL_MIXVOFF; - cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp ); - /* - * Now, we wait until we sample a ready state. - */ - for (count = 0; count < 32; count++) { - /* - * First, lets wait a short while to let things settle out a - * bit, and to prevent retrying the read too quickly. - */ - udelay(500); - - /* - * Read the current state of the power control register. - */ - if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_MIXVOFF_ON) - break; - } - - /* - * Check the status.. - */ - if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_MIXVOFF_ON)) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING - "cs46xx: powerup MIXVOFF failed\n")); - return 1; - } - } - } - if(type & CS_POWER_MIXVON) { - - CS_DBGOUT(CS_FUNCTION, 4, - printk(KERN_INFO "cs46xx: cs46xx_powerup()+ MIXVON\n")); - /* - * Power up the MIXER (VREF ON) on the AC97 card. - */ - tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL); - if (!(tmp & CS_AC97_POWER_CONTROL_MIXVON_ON)) { - if (!muted) { - cs_mute(card, CS_TRUE); - muted = 1; - } - tmp &= ~CS_AC97_POWER_CONTROL_MIXVON; - cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp ); - /* - * Now, we wait until we sample a ready state. - */ - for (count = 0; count < 32; count++) { - /* - * First, lets wait a short while to let things settle out a - * bit, and to prevent retrying the read too quickly. - */ - udelay(500); - - /* - * Read the current state of the power control register. - */ - if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_MIXVON_ON) - break; - } - - /* - * Check the status.. - */ - if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_MIXVON_ON)) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING - "cs46xx: powerup MIXVON failed\n")); - return 1; - } - } - } - if (type & CS_POWER_ADC) { - /* - * Power up the ADC on the AC97 card. - */ - CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO "cs46xx: cs46xx_powerup()+ ADC\n")); - tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL); - if (!(tmp & CS_AC97_POWER_CONTROL_ADC_ON)) { - if (!muted) { - cs_mute(card, CS_TRUE); - muted = 1; - } - tmp &= ~CS_AC97_POWER_CONTROL_ADC; - cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp ); - - /* - * Now, we wait until we sample a ready state. - */ - for (count = 0; count < 32; count++) { - /* - * First, lets wait a short while to let things settle out a - * bit, and to prevent retrying the read too quickly. - */ - udelay(500); - - /* - * Read the current state of the power control register. - */ - if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_ADC_ON) - break; - } - - /* - * Check the status.. - */ - if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_ADC_ON)) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING - "cs46xx: powerup ADC failed\n")); - return 1; - } - } - } - if (type & CS_POWER_DAC) { - /* - * Power up the DAC on the AC97 card. - */ - - CS_DBGOUT(CS_FUNCTION, 4, - printk(KERN_INFO "cs46xx: cs46xx_powerup()+ DAC\n")); - tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL); - if (!(tmp & CS_AC97_POWER_CONTROL_DAC_ON)) { - if (!muted) { - cs_mute(card, CS_TRUE); - muted = 1; - } - tmp &= ~CS_AC97_POWER_CONTROL_DAC; - cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp ); - /* - * Now, we wait until we sample a ready state. - */ - for (count = 0; count < 32; count++) { - /* - * First, lets wait a short while to let things settle out a - * bit, and to prevent retrying the read too quickly. - */ - udelay(500); - - /* - * Read the current state of the power control register. - */ - if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_DAC_ON) - break; - } - - /* - * Check the status.. - */ - if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) & - CS_AC97_POWER_CONTROL_DAC_ON)) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING - "cs46xx: powerup DAC failed\n")); - return 1; - } - } - } - tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL); - if (muted) - cs_mute(card, CS_FALSE); - CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO - "cs46xx: cs46xx_powerup()- 0 tmp=0x%x\n",tmp)); - return 0; -} - -static void cs461x_proc_start(struct cs_card *card) -{ - int cnt; - - /* - * Set the frame timer to reflect the number of cycles per frame. - */ - cs461x_poke(card, BA1_FRMT, 0xadf); - /* - * Turn on the run, run at frame, and DMA enable bits in the local copy of - * the SP control register. - */ - cs461x_poke(card, BA1_SPCR, SPCR_RUN | SPCR_RUNFR | SPCR_DRQEN); - /* - * Wait until the run at frame bit resets itself in the SP control - * register. - */ - for (cnt = 0; cnt < 25; cnt++) { - udelay(50); - if (!(cs461x_peek(card, BA1_SPCR) & SPCR_RUNFR)) - break; - } - - if (cs461x_peek(card, BA1_SPCR) & SPCR_RUNFR) - printk(KERN_WARNING "cs46xx: SPCR_RUNFR never reset\n"); -} - -static void cs461x_proc_stop(struct cs_card *card) -{ - /* - * Turn off the run, run at frame, and DMA enable bits in the local copy of - * the SP control register. - */ - cs461x_poke(card, BA1_SPCR, 0); -} - -static int cs_hardware_init(struct cs_card *card) -{ - unsigned long end_time; - unsigned int tmp,count; - - CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO - "cs46xx: cs_hardware_init()+\n") ); - /* - * First, blast the clock control register to zero so that the PLL starts - * out in a known state, and blast the master serial port control register - * to zero so that the serial ports also start out in a known state. - */ - cs461x_pokeBA0(card, BA0_CLKCR1, 0); - cs461x_pokeBA0(card, BA0_SERMC1, 0); - - /* - * If we are in AC97 mode, then we must set the part to a host controlled - * AC-link. Otherwise, we won't be able to bring up the link. - */ - cs461x_pokeBA0(card, BA0_SERACC, SERACC_HSP | SERACC_CODEC_TYPE_1_03); /* 1.03 card */ - /* cs461x_pokeBA0(card, BA0_SERACC, SERACC_HSP | SERACC_CODEC_TYPE_2_0); */ /* 2.00 card */ - - /* - * Drive the ARST# pin low for a minimum of 1uS (as defined in the AC97 - * spec) and then drive it high. This is done for non AC97 modes since - * there might be logic external to the CS461x that uses the ARST# line - * for a reset. - */ - cs461x_pokeBA0(card, BA0_ACCTL, 1); - udelay(50); - cs461x_pokeBA0(card, BA0_ACCTL, 0); - udelay(50); - cs461x_pokeBA0(card, BA0_ACCTL, ACCTL_RSTN); - - /* - * The first thing we do here is to enable sync generation. As soon - * as we start receiving bit clock, we'll start producing the SYNC - * signal. - */ - cs461x_pokeBA0(card, BA0_ACCTL, ACCTL_ESYN | ACCTL_RSTN); - - /* - * Now wait for a short while to allow the AC97 part to start - * generating bit clock (so we don't try to start the PLL without an - * input clock). - */ - mdelay(5 * cs_laptop_wait); /* 1 should be enough ?? (and pigs might fly) */ - - /* - * Set the serial port timing configuration, so that - * the clock control circuit gets its clock from the correct place. - */ - cs461x_pokeBA0(card, BA0_SERMC1, SERMC1_PTC_AC97); - - /* - * The part seems to not be ready for a while after a resume. - * so, if we are resuming, then wait for 700 mils. Note that 600 mils - * is not enough for some platforms! tested on an IBM Thinkpads and - * reference cards. - */ - if (!(card->pm.flags & CS46XX_PM_IDLE)) - mdelay(initdelay); - /* - * Write the selected clock control setup to the hardware. Do not turn on - * SWCE yet (if requested), so that the devices clocked by the output of - * PLL are not clocked until the PLL is stable. - */ - cs461x_pokeBA0(card, BA0_PLLCC, PLLCC_LPF_1050_2780_KHZ | PLLCC_CDR_73_104_MHZ); - cs461x_pokeBA0(card, BA0_PLLM, 0x3a); - cs461x_pokeBA0(card, BA0_CLKCR2, CLKCR2_PDIVS_8); - - /* - * Power up the PLL. - */ - cs461x_pokeBA0(card, BA0_CLKCR1, CLKCR1_PLLP); - - /* - * Wait until the PLL has stabilized. - */ - mdelay(5 * cs_laptop_wait); /* Again 1 should be enough ?? */ - - /* - * Turn on clocking of the core so that we can setup the serial ports. - */ - tmp = cs461x_peekBA0(card, BA0_CLKCR1) | CLKCR1_SWCE; - cs461x_pokeBA0(card, BA0_CLKCR1, tmp); - - /* - * Fill the serial port FIFOs with silence. - */ - cs461x_clear_serial_FIFOs(card,CS_TYPE_DAC | CS_TYPE_ADC); - - /* - * Set the serial port FIFO pointer to the first sample in the FIFO. - */ - /* cs461x_pokeBA0(card, BA0_SERBSP, 0); */ - - /* - * Write the serial port configuration to the part. The master - * enable bit is not set until all other values have been written. - */ - cs461x_pokeBA0(card, BA0_SERC1, SERC1_SO1F_AC97 | SERC1_SO1EN); - cs461x_pokeBA0(card, BA0_SERC2, SERC2_SI1F_AC97 | SERC1_SO1EN); - cs461x_pokeBA0(card, BA0_SERMC1, SERMC1_PTC_AC97 | SERMC1_MSPE); - - - mdelay(5 * cs_laptop_wait); /* Shouldnt be needed ?? */ - -/* -* If we are resuming under 2.2.x then we cannot schedule a timeout, -* so just spin the CPU. -*/ - if (card->pm.flags & CS46XX_PM_IDLE) { - /* - * Wait for the card ready signal from the AC97 card. - */ - end_time = jiffies + 3 * (HZ >> 2); - do { - /* - * Read the AC97 status register to see if we've seen a CODEC READY - * signal from the AC97 card. - */ - if (cs461x_peekBA0(card, BA0_ACSTS) & ACSTS_CRDY) - break; - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(1); - } while (time_before(jiffies, end_time)); - } else { - for (count = 0; count < 100; count++) { - // First, we want to wait for a short time. - udelay(25 * cs_laptop_wait); - - if (cs461x_peekBA0(card, BA0_ACSTS) & ACSTS_CRDY) - break; - } - } - - /* - * Make sure CODEC is READY. - */ - if (!(cs461x_peekBA0(card, BA0_ACSTS) & ACSTS_CRDY)) { - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_WARNING - "cs46xx: create - never read card ready from AC'97\n")); - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_WARNING - "cs46xx: probably not a bug, try using the CS4232 driver,\n")); - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_WARNING - "cs46xx: or turn off any automatic Power Management support in the BIOS.\n")); - return -EIO; - } - - /* - * Assert the vaid frame signal so that we can start sending commands - * to the AC97 card. - */ - cs461x_pokeBA0(card, BA0_ACCTL, ACCTL_VFRM | ACCTL_ESYN | ACCTL_RSTN); - - if (card->pm.flags & CS46XX_PM_IDLE) { - /* - * Wait until we've sampled input slots 3 and 4 as valid, meaning that - * the card is pumping ADC data across the AC-link. - */ - end_time = jiffies + 3 * (HZ >> 2); - do { - /* - * Read the input slot valid register and see if input slots 3 and - * 4 are valid yet. - */ - if ((cs461x_peekBA0(card, BA0_ACISV) & (ACISV_ISV3 | ACISV_ISV4)) == (ACISV_ISV3 | ACISV_ISV4)) - break; - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(1); - } while (time_before(jiffies, end_time)); - } else { - for (count = 0; count < 100; count++) { - // First, we want to wait for a short time. - udelay(25 * cs_laptop_wait); - - if ((cs461x_peekBA0(card, BA0_ACISV) & (ACISV_ISV3 | ACISV_ISV4)) == (ACISV_ISV3 | ACISV_ISV4)) - break; - } - } - /* - * Make sure input slots 3 and 4 are valid. If not, then return - * an error. - */ - if ((cs461x_peekBA0(card, BA0_ACISV) & (ACISV_ISV3 | ACISV_ISV4)) != (ACISV_ISV3 | ACISV_ISV4)) { - printk(KERN_WARNING "cs46xx: create - never read ISV3 & ISV4 from AC'97\n"); - return -EIO; - } - - /* - * Now, assert valid frame and the slot 3 and 4 valid bits. This will - * commense the transfer of digital audio data to the AC97 card. - */ - cs461x_pokeBA0(card, BA0_ACOSV, ACOSV_SLV3 | ACOSV_SLV4); - - /* - * Turn off the Processor by turning off the software clock enable flag in - * the clock control register. - */ - /* tmp = cs461x_peekBA0(card, BA0_CLKCR1) & ~CLKCR1_SWCE; */ - /* cs461x_pokeBA0(card, BA0_CLKCR1, tmp); */ - - /* - * Reset the processor. - */ - cs461x_reset(card); - - /* - * Download the image to the processor. - */ - - cs461x_download_image(card); - - /* - * Stop playback DMA. - */ - tmp = cs461x_peek(card, BA1_PCTL); - card->pctl = tmp & 0xffff0000; - cs461x_poke(card, BA1_PCTL, tmp & 0x0000ffff); - - /* - * Stop capture DMA. - */ - tmp = cs461x_peek(card, BA1_CCTL); - card->cctl = tmp & 0x0000ffff; - cs461x_poke(card, BA1_CCTL, tmp & 0xffff0000); - - /* initialize AC97 codec and register /dev/mixer */ - if (card->pm.flags & CS46XX_PM_IDLE) { - if (cs_ac97_init(card) <= 0) { - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO - "cs46xx: cs_ac97_init() failure\n")); - return -EIO; - } - } else { - cs46xx_ac97_resume(card); - } - - cs461x_proc_start(card); - - /* - * Enable interrupts on the part. - */ - cs461x_pokeBA0(card, BA0_HICR, HICR_IEV | HICR_CHGM); - - tmp = cs461x_peek(card, BA1_PFIE); - tmp &= ~0x0000f03f; - cs461x_poke(card, BA1_PFIE, tmp); /* playback interrupt enable */ - - tmp = cs461x_peek(card, BA1_CIE); - tmp &= ~0x0000003f; - tmp |= 0x00000001; - cs461x_poke(card, BA1_CIE, tmp); /* capture interrupt enable */ - - /* - * If IDLE then Power down the part. We will power components up - * when we need them. - */ - if (card->pm.flags & CS46XX_PM_IDLE) { - if (!cs_powerdown) { - if ((tmp = cs46xx_powerup(card, CS_POWER_DAC | CS_POWER_ADC | - CS_POWER_MIXVON))) { - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO - "cs46xx: cs461x_powerup() failure (0x%x)\n",tmp) ); - return -EIO; - } - } else { - if ((tmp = cs461x_powerdown(card, CS_POWER_DAC | CS_POWER_ADC | - CS_POWER_MIXVON, CS_FALSE))) { - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO - "cs46xx: cs461x_powerdown() failure (0x%x)\n",tmp) ); - return -EIO; - } - } - } - CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO - "cs46xx: cs_hardware_init()- 0\n")); - return 0; -} - -/* install the driver, we do not allocate hardware channel nor DMA buffer now, they are defered - until "ACCESS" time (in prog_dmabuf called by open/read/write/ioctl/mmap) */ - -/* - * Card subid table - */ - -struct cs_card_type -{ - u16 vendor; - u16 id; - char *name; - void (*amp)(struct cs_card *, int); - void (*amp_init)(struct cs_card *); - void (*active)(struct cs_card *, int); -}; - -static struct cs_card_type cards[] = { - { - .vendor = 0x1489, - .id = 0x7001, - .name = "Genius Soundmaker 128 value", - .amp = amp_none, - }, - { - .vendor = 0x5053, - .id = 0x3357, - .name = "Voyetra", - .amp = amp_voyetra, - }, - { - .vendor = 0x1071, - .id = 0x6003, - .name = "Mitac MI6020/21", - .amp = amp_voyetra, - }, - { - .vendor = 0x14AF, - .id = 0x0050, - .name = "Hercules Game Theatre XP", - .amp = amp_hercules, - }, - { - .vendor = 0x1681, - .id = 0x0050, - .name = "Hercules Game Theatre XP", - .amp = amp_hercules, - }, - { - .vendor = 0x1681, - .id = 0x0051, - .name = "Hercules Game Theatre XP", - .amp = amp_hercules, - }, - { - .vendor = 0x1681, - .id = 0x0052, - .name = "Hercules Game Theatre XP", - .amp = amp_hercules, - }, - { - .vendor = 0x1681, - .id = 0x0053, - .name = "Hercules Game Theatre XP", - .amp = amp_hercules, - }, - { - .vendor = 0x1681, - .id = 0x0054, - .name = "Hercules Game Theatre XP", - .amp = amp_hercules, - }, - { - .vendor = 0x1681, - .id = 0xa010, - .name = "Hercules Fortissimo II", - .amp = amp_none, - }, - /* Not sure if the 570 needs the clkrun hack */ - { - .vendor = PCI_VENDOR_ID_IBM, - .id = 0x0132, - .name = "Thinkpad 570", - .amp = amp_none, - .active = clkrun_hack, - }, - { - .vendor = PCI_VENDOR_ID_IBM, - .id = 0x0153, - .name = "Thinkpad 600X/A20/T20", - .amp = amp_none, - .active = clkrun_hack, - }, - { - .vendor = PCI_VENDOR_ID_IBM, - .id = 0x1010, - .name = "Thinkpad 600E (unsupported)", - }, - { - .name = "Card without SSID set", - }, - { 0, }, -}; - -MODULE_AUTHOR("Alan Cox <alan@redhat.com>, Jaroslav Kysela, <pcaudio@crystal.cirrus.com>"); -MODULE_DESCRIPTION("Crystal SoundFusion Audio Support"); -MODULE_LICENSE("GPL"); - -static const char cs46xx_banner[] = KERN_INFO "Crystal 4280/46xx + AC97 Audio, version " CS46XX_MAJOR_VERSION "." CS46XX_MINOR_VERSION "." CS46XX_ARCH ", " __TIME__ " " __DATE__ "\n"; -static const char fndmsg[] = KERN_INFO "cs46xx: Found %d audio device(s).\n"; - -static int __devinit cs46xx_probe(struct pci_dev *pci_dev, - const struct pci_device_id *pciid) -{ - int i, j; - u16 ss_card, ss_vendor; - struct cs_card *card; - dma_addr_t dma_mask; - struct cs_card_type *cp = &cards[0]; - - CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, - printk(KERN_INFO "cs46xx: probe()+\n")); - - dma_mask = 0xffffffff; /* this enables playback and recording */ - if (pci_enable_device(pci_dev)) { - CS_DBGOUT(CS_INIT | CS_ERROR, 1, printk(KERN_ERR - "cs46xx: pci_enable_device() failed\n")); - return -1; - } - if (!RSRCISMEMORYREGION(pci_dev, 0) || - !RSRCISMEMORYREGION(pci_dev, 1)) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_ERR - "cs46xx: probe()- Memory region not assigned\n")); - return -1; - } - if (pci_dev->irq == 0) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_ERR - "cs46xx: probe() IRQ not assigned\n")); - return -1; - } - if (!pci_dma_supported(pci_dev, 0xffffffff)) { - CS_DBGOUT(CS_ERROR, 1, printk(KERN_ERR - "cs46xx: probe() architecture does not support 32bit PCI busmaster DMA\n")); - return -1; - } - pci_read_config_word(pci_dev, PCI_SUBSYSTEM_VENDOR_ID, &ss_vendor); - pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &ss_card); - - if ((card = kzalloc(sizeof(struct cs_card), GFP_KERNEL)) == NULL) { - printk(KERN_ERR "cs46xx: out of memory\n"); - return -ENOMEM; - } - card->ba0_addr = RSRCADDRESS(pci_dev, 0); - card->ba1_addr = RSRCADDRESS(pci_dev, 1); - card->pci_dev = pci_dev; - card->irq = pci_dev->irq; - card->magic = CS_CARD_MAGIC; - spin_lock_init(&card->lock); - spin_lock_init(&card->ac97_lock); - - pci_set_master(pci_dev); - - printk(cs46xx_banner); - printk(KERN_INFO "cs46xx: Card found at 0x%08lx and 0x%08lx, IRQ %d\n", - card->ba0_addr, card->ba1_addr, card->irq); - - card->alloc_pcm_channel = cs_alloc_pcm_channel; - card->alloc_rec_pcm_channel = cs_alloc_rec_pcm_channel; - card->free_pcm_channel = cs_free_pcm_channel; - card->amplifier_ctrl = amp_none; - card->active_ctrl = amp_none; - - while (cp->name) - { - if (cp->vendor == ss_vendor && cp->id == ss_card) { - card->amplifier_ctrl = cp->amp; - if (cp->active) - card->active_ctrl = cp->active; - if (cp->amp_init) - card->amp_init = cp->amp_init; - break; - } - cp++; - } - if (cp->name == NULL) { - printk(KERN_INFO "cs46xx: Unknown card (%04X:%04X) at 0x%08lx/0x%08lx, IRQ %d\n", - ss_vendor, ss_card, card->ba0_addr, card->ba1_addr, card->irq); - } else { - printk(KERN_INFO "cs46xx: %s (%04X:%04X) at 0x%08lx/0x%08lx, IRQ %d\n", - cp->name, ss_vendor, ss_card, card->ba0_addr, card->ba1_addr, card->irq); - } - - if (card->amplifier_ctrl == NULL) { - card->amplifier_ctrl = amp_none; - card->active_ctrl = clkrun_hack; - } - - if (external_amp == 1) { - printk(KERN_INFO "cs46xx: Crystal EAPD support forced on.\n"); - card->amplifier_ctrl = amp_voyetra; - } - - if (thinkpad == 1) { - printk(KERN_INFO "cs46xx: Activating CLKRUN hack for Thinkpad.\n"); - card->active_ctrl = clkrun_hack; - } -/* -* The thinkpads don't work well without runtime updating on their kernel -* delay values (or any laptop with variable CPU speeds really). -* so, just to be safe set the init delay to 2100. Eliminates -* failures on T21 Thinkpads. remove this code when the udelay -* and mdelay kernel code is replaced by a pm timer, or the delays -* work well for battery and/or AC power both. -*/ - if (card->active_ctrl == clkrun_hack) { - initdelay = 2100; - cs_laptop_wait = 5; - } - if ((card->active_ctrl == clkrun_hack) && !(powerdown == 1)) { -/* -* for some currently unknown reason, powering down the DAC and ADC component -* blocks on thinkpads causes some funky behavior... distoorrrtion and ac97 -* codec access problems. probably the serial clock becomes unsynced. -* added code to sync the chips back up, but only helped about 70% the time. -*/ - cs_powerdown = 0; - } - if (powerdown == 0) - cs_powerdown = 0; - card->active_ctrl(card, 1); - - /* claim our iospace and irq */ - - card->ba0 = ioremap_nocache(card->ba0_addr, CS461X_BA0_SIZE); - card->ba1.name.data0 = ioremap_nocache(card->ba1_addr + BA1_SP_DMEM0, CS461X_BA1_DATA0_SIZE); - card->ba1.name.data1 = ioremap_nocache(card->ba1_addr + BA1_SP_DMEM1, CS461X_BA1_DATA1_SIZE); - card->ba1.name.pmem = ioremap_nocache(card->ba1_addr + BA1_SP_PMEM, CS461X_BA1_PRG_SIZE); - card->ba1.name.reg = ioremap_nocache(card->ba1_addr + BA1_SP_REG, CS461X_BA1_REG_SIZE); - - CS_DBGOUT(CS_INIT, 4, printk(KERN_INFO - "cs46xx: card=%p card->ba0=%p\n",card,card->ba0) ); - CS_DBGOUT(CS_INIT, 4, printk(KERN_INFO - "cs46xx: card->ba1=%p %p %p %p\n", - card->ba1.name.data0, - card->ba1.name.data1, - card->ba1.name.pmem, - card->ba1.name.reg) ); - - if (card->ba0 == 0 || card->ba1.name.data0 == 0 || - card->ba1.name.data1 == 0 || card->ba1.name.pmem == 0 || - card->ba1.name.reg == 0) - goto fail2; - - if (request_irq(card->irq, &cs_interrupt, IRQF_SHARED, "cs46xx", card)) { - printk(KERN_ERR "cs46xx: unable to allocate irq %d\n", card->irq); - goto fail2; - } - /* register /dev/dsp */ - if ((card->dev_audio = register_sound_dsp(&cs461x_fops, -1)) < 0) { - printk(KERN_ERR "cs46xx: unable to register dsp\n"); - goto fail; - } - - /* register /dev/midi */ - if ((card->dev_midi = register_sound_midi(&cs_midi_fops, -1)) < 0) - printk(KERN_ERR "cs46xx: unable to register midi\n"); - - card->pm.flags |= CS46XX_PM_IDLE; - for (i = 0; i < 5; i++) { - if (cs_hardware_init(card) != 0) { - CS_DBGOUT(CS_ERROR, 4, printk( - "cs46xx: ERROR in cs_hardware_init()... retrying\n")); - for (j = 0; j < NR_AC97; j++) - if (card->ac97_codec[j] != NULL) { - unregister_sound_mixer(card->ac97_codec[j]->dev_mixer); - ac97_release_codec(card->ac97_codec[j]); - } - mdelay(10 * cs_laptop_wait); - continue; - } - break; - } - if(i >= 4) { - CS_DBGOUT(CS_PM | CS_ERROR, 1, printk( - "cs46xx: cs46xx_probe()- cs_hardware_init() failed, retried %d times.\n",i)); - unregister_sound_dsp(card->dev_audio); - if (card->dev_midi) - unregister_sound_midi(card->dev_midi); - goto fail; - } - - init_waitqueue_head(&card->midi.open_wait); - mutex_init(&card->midi.open_mutex); - init_waitqueue_head(&card->midi.iwait); - init_waitqueue_head(&card->midi.owait); - cs461x_pokeBA0(card, BA0_MIDCR, MIDCR_MRST); - cs461x_pokeBA0(card, BA0_MIDCR, 0); - - /* - * Check if we have to init the amplifier, but probably already done - * since the CD logic in the ac97 init code will turn on the ext amp. - */ - if (cp->amp_init) - cp->amp_init(card); - card->active_ctrl(card, -1); - - PCI_SET_DRIVER_DATA(pci_dev, card); - PCI_SET_DMA_MASK(pci_dev, dma_mask); - list_add(&card->list, &cs46xx_devs); - - CS_DBGOUT(CS_PM, 9, printk(KERN_INFO "cs46xx: pm.flags=0x%x card=%p\n", - (unsigned)card->pm.flags,card)); - - CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO - "cs46xx: probe()- device allocated successfully\n")); - return 0; - -fail: - free_irq(card->irq, card); -fail2: - if (card->ba0) - iounmap(card->ba0); - if (card->ba1.name.data0) - iounmap(card->ba1.name.data0); - if (card->ba1.name.data1) - iounmap(card->ba1.name.data1); - if (card->ba1.name.pmem) - iounmap(card->ba1.name.pmem); - if (card->ba1.name.reg) - iounmap(card->ba1.name.reg); - kfree(card); - CS_DBGOUT(CS_INIT | CS_ERROR, 1, printk(KERN_INFO - "cs46xx: probe()- no device allocated\n")); - return -ENODEV; -} // probe_cs46xx - -// --------------------------------------------------------------------- - -static void __devexit cs46xx_remove(struct pci_dev *pci_dev) -{ - struct cs_card *card = PCI_GET_DRIVER_DATA(pci_dev); - int i; - unsigned int tmp; - - CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO - "cs46xx: cs46xx_remove()+\n")); - - card->active_ctrl(card,1); - - tmp = cs461x_peek(card, BA1_PFIE); - tmp &= ~0x0000f03f; - tmp |= 0x00000010; - cs461x_poke(card, BA1_PFIE, tmp); /* playback interrupt disable */ - - tmp = cs461x_peek(card, BA1_CIE); - tmp &= ~0x0000003f; - tmp |= 0x00000011; - cs461x_poke(card, BA1_CIE, tmp); /* capture interrupt disable */ - - /* - * Stop playback DMA. - */ - tmp = cs461x_peek(card, BA1_PCTL); - cs461x_poke(card, BA1_PCTL, tmp & 0x0000ffff); - - /* - * Stop capture DMA. - */ - tmp = cs461x_peek(card, BA1_CCTL); - cs461x_poke(card, BA1_CCTL, tmp & 0xffff0000); - - /* - * Reset the processor. - */ - cs461x_reset(card); - - cs461x_proc_stop(card); - - /* - * Power down the DAC and ADC. We will power them up (if) when we need - * them. - */ - if ((tmp = cs461x_powerdown(card, CS_POWER_DAC | CS_POWER_ADC | - CS_POWER_MIXVON, CS_TRUE))) { - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO - "cs46xx: cs461x_powerdown() failure (0x%x)\n",tmp) ); - } - - /* - * Power down the PLL. - */ - cs461x_pokeBA0(card, BA0_CLKCR1, 0); - - /* - * Turn off the Processor by turning off the software clock enable flag in - * the clock control register. - */ - tmp = cs461x_peekBA0(card, BA0_CLKCR1) & ~CLKCR1_SWCE; - cs461x_pokeBA0(card, BA0_CLKCR1, tmp); - - card->active_ctrl(card,-1); - - /* free hardware resources */ - free_irq(card->irq, card); - iounmap(card->ba0); - iounmap(card->ba1.name.data0); - iounmap(card->ba1.name.data1); - iounmap(card->ba1.name.pmem); - iounmap(card->ba1.name.reg); - - /* unregister audio devices */ - for (i = 0; i < NR_AC97; i++) - if (card->ac97_codec[i] != NULL) { - unregister_sound_mixer(card->ac97_codec[i]->dev_mixer); - ac97_release_codec(card->ac97_codec[i]); - } - unregister_sound_dsp(card->dev_audio); - if (card->dev_midi) - unregister_sound_midi(card->dev_midi); - list_del(&card->list); - kfree(card); - PCI_SET_DRIVER_DATA(pci_dev,NULL); - - CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO - "cs46xx: cs46xx_remove()-: remove successful\n")); -} - -enum { - CS46XX_4610 = 0, - CS46XX_4612, /* same as 4630 */ - CS46XX_4615, /* same as 4624 */ -}; - -static struct pci_device_id cs46xx_pci_tbl[] = { - { - .vendor = PCI_VENDOR_ID_CIRRUS, - .device = PCI_DEVICE_ID_CIRRUS_4610, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, - .driver_data = CS46XX_4610, - }, - { - .vendor = PCI_VENDOR_ID_CIRRUS, - .device = PCI_DEVICE_ID_CIRRUS_4612, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, - .driver_data = CS46XX_4612, - }, - { - .vendor = PCI_VENDOR_ID_CIRRUS, - .device = PCI_DEVICE_ID_CIRRUS_4615, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, - .driver_data = CS46XX_4615, - }, - { 0, }, -}; - -MODULE_DEVICE_TABLE(pci, cs46xx_pci_tbl); - -static struct pci_driver cs46xx_pci_driver = { - .name = "cs46xx", - .id_table = cs46xx_pci_tbl, - .probe = cs46xx_probe, - .remove = __devexit_p(cs46xx_remove), -#ifdef CONFIG_PM - .suspend = cs46xx_suspend_tbl, - .resume = cs46xx_resume_tbl, -#endif -}; - -static int __init cs46xx_init_module(void) -{ - int rtn = 0; - CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO - "cs46xx: cs46xx_init_module()+ \n")); - rtn = pci_register_driver(&cs46xx_pci_driver); - - if (rtn == -ENODEV) { - CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk( - "cs46xx: Unable to detect valid cs46xx device\n")); - } - - CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, - printk(KERN_INFO "cs46xx: cs46xx_init_module()- (%d)\n",rtn)); - return rtn; -} - -static void __exit cs46xx_cleanup_module(void) -{ - pci_unregister_driver(&cs46xx_pci_driver); - CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, - printk(KERN_INFO "cs46xx: cleanup_cs46xx() finished\n")); -} - -module_init(cs46xx_init_module); -module_exit(cs46xx_cleanup_module); - -#ifdef CONFIG_PM -static int cs46xx_suspend_tbl(struct pci_dev *pcidev, pm_message_t state) -{ - struct cs_card *s = PCI_GET_DRIVER_DATA(pcidev); - CS_DBGOUT(CS_PM | CS_FUNCTION, 2, - printk(KERN_INFO "cs46xx: cs46xx_suspend_tbl request\n")); - cs46xx_suspend(s, state); - return 0; -} - -static int cs46xx_resume_tbl(struct pci_dev *pcidev) -{ - struct cs_card *s = PCI_GET_DRIVER_DATA(pcidev); - CS_DBGOUT(CS_PM | CS_FUNCTION, 2, - printk(KERN_INFO "cs46xx: cs46xx_resume_tbl request\n")); - cs46xx_resume(s); - return 0; -} -#endif diff --git a/sound/oss/cs46xx_wrapper-24.h b/sound/oss/cs46xx_wrapper-24.h deleted file mode 100644 index f68e01181a7..00000000000 --- a/sound/oss/cs46xx_wrapper-24.h +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* -* -* "cs46xx_wrapper.c" -- Cirrus Logic-Crystal CS46XX linux audio driver. -* -* Copyright (C) 2000,2001 Cirrus Logic Corp. -* -- tom woller (twoller@crystal.cirrus.com) or -* (pcaudio@crystal.cirrus.com). -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -* -* 01/11/2001 trw - new file from cs4281 wrapper code. -* -*******************************************************************************/ -#ifndef __CS46XX_WRAPPER24_H -#define __CS46XX_WRAPPER24_H - -#include <linux/spinlock.h> - -#define CS_OWNER .owner = -#define CS_THIS_MODULE THIS_MODULE, -static inline void cs46xx_null(struct pci_dev *pcidev) { return; } -#define cs4x_mem_map_reserve(page) SetPageReserved(page) -#define cs4x_mem_map_unreserve(page) ClearPageReserved(page) - -#define free_dmabuf(card, dmabuf) \ - pci_free_consistent((card)->pci_dev, \ - PAGE_SIZE << (dmabuf)->buforder, \ - (dmabuf)->rawbuf, (dmabuf)->dmaaddr); -#define free_dmabuf2(card, dmabuf) \ - pci_free_consistent((card)->pci_dev, \ - PAGE_SIZE << (dmabuf)->buforder_tmpbuff, \ - (dmabuf)->tmpbuff, (dmabuf)->dmaaddr_tmpbuff); -#define cs4x_pgoff(vma) ((vma)->vm_pgoff) - -#define RSRCISIOREGION(dev,num) ((dev)->resource[(num)].start != 0 && \ - ((dev)->resource[(num)].flags & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO) -#define RSRCISMEMORYREGION(dev,num) ((dev)->resource[(num)].start != 0 && \ - ((dev)->resource[(num)].flags & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_MEMORY) -#define RSRCADDRESS(dev,num) ((dev)->resource[(num)].start) -#define PCI_GET_DRIVER_DATA pci_get_drvdata -#define PCI_SET_DRIVER_DATA pci_set_drvdata -#define PCI_SET_DMA_MASK(pcidev,mask) pcidev->dma_mask = mask - -#endif diff --git a/sound/oss/cs46xxpm.h b/sound/oss/cs46xxpm.h deleted file mode 100644 index 2932b6e0e0b..00000000000 --- a/sound/oss/cs46xxpm.h +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* -* -* "cs46xxpm.h" -- Cirrus Logic-Crystal CS46XX linux audio driver. -* -* Copyright (C) 2000,2001 Cirrus Logic Corp. -* -- tom woller (twoller@crystal.cirrus.com) or -* (pcaudio@crystal.cirrus.com). -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -* -* 12/22/00 trw - new file. -* -*******************************************************************************/ -#ifndef __CS46XXPM_H -#define __CS46XXPM_H - -#define CS46XX_AC97_HIGHESTREGTORESTORE 0x26 -#define CS46XX_AC97_NUMBER_RESTORE_REGS (CS46XX_AC97_HIGHESTREGTORESTORE/2-1) - -/* PM state defintions */ -#define CS46XX_PM_NOT_REGISTERED 0x1000 -#define CS46XX_PM_IDLE 0x0001 -#define CS46XX_PM_SUSPENDING 0x0002 -#define CS46XX_PM_SUSPENDED 0x0004 -#define CS46XX_PM_RESUMING 0x0008 -#define CS46XX_PM_RESUMED 0x0010 - -#define CS_POWER_DAC 0x0001 -#define CS_POWER_ADC 0x0002 -#define CS_POWER_MIXVON 0x0004 -#define CS_POWER_MIXVOFF 0x0008 -#define CS_AC97_POWER_CONTROL_ON 0xf000 /* always on bits (inverted) */ -#define CS_AC97_POWER_CONTROL_ADC 0x0100 -#define CS_AC97_POWER_CONTROL_DAC 0x0200 -#define CS_AC97_POWER_CONTROL_MIXVON 0x0400 -#define CS_AC97_POWER_CONTROL_MIXVOFF 0x0800 -#define CS_AC97_POWER_CONTROL_ADC_ON 0x0001 -#define CS_AC97_POWER_CONTROL_DAC_ON 0x0002 -#define CS_AC97_POWER_CONTROL_MIXVON_ON 0x0004 -#define CS_AC97_POWER_CONTROL_MIXVOFF_ON 0x0008 - -struct cs46xx_pm { - unsigned long flags; - u32 u32CLKCR1_SAVE,u32SSPMValue,u32PPLVCvalue,u32PPRVCvalue; - u32 u32FMLVCvalue,u32FMRVCvalue,u32GPIORvalue,u32JSCTLvalue,u32SSCR; - u32 u32SRCSA,u32DacASR,u32AdcASR,u32DacSR,u32AdcSR,u32MIDCR_Save; - u32 u32SSPM_BITS; - u32 ac97[CS46XX_AC97_NUMBER_RESTORE_REGS]; - u32 u32AC97_master_volume, u32AC97_headphone_volume, u32AC97_master_volume_mono; - u32 u32AC97_pcm_out_volume, u32AC97_powerdown, u32AC97_general_purpose; - u32 u32hwptr_playback,u32hwptr_capture; - unsigned dmabuf_swptr_play; - int dmabuf_count_play; - unsigned dmabuf_swptr_capture; - int dmabuf_count_capture; -}; - -#endif diff --git a/sound/oss/emu10k1/8010.h b/sound/oss/emu10k1/8010.h deleted file mode 100644 index 61c6c42bbc3..00000000000 --- a/sound/oss/emu10k1/8010.h +++ /dev/null @@ -1,737 +0,0 @@ -/* - ********************************************************************** - * 8010.h - * Copyright 1999-2001 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * November 2, 1999 Alan Cox Cleaned of 8bit chars, DOS - * line endings - * December 8, 1999 Jon Taylor Added lots of new register info - * May 16, 2001 Daniel Bertrand Added unofficial DBG register info - * Oct-Nov 2001 D.B. Added unofficial Audigy registers - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - * - ********************************************************************** - */ - - -#ifndef _8010_H -#define _8010_H - -#include <linux/types.h> - -// Driver version: -#define MAJOR_VER 0 -#define MINOR_VER 20 -#define DRIVER_VERSION "0.20a" - - -// Audigy specify registers are prefixed with 'A_' - -/************************************************************************************************/ -/* PCI function 0 registers, address = <val> + PCIBASE0 */ -/************************************************************************************************/ - -#define PTR 0x00 /* Indexed register set pointer register */ - /* NOTE: The CHANNELNUM and ADDRESS words can */ - /* be modified independently of each other. */ -#define PTR_CHANNELNUM_MASK 0x0000003f /* For each per-channel register, indicates the */ - /* channel number of the register to be */ - /* accessed. For non per-channel registers the */ - /* value should be set to zero. */ -#define PTR_ADDRESS_MASK 0x07ff0000 /* Register index */ - -#define DATA 0x04 /* Indexed register set data register */ - -#define IPR 0x08 /* Global interrupt pending register */ - /* Clear pending interrupts by writing a 1 to */ - /* the relevant bits and zero to the other bits */ - -/* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1) */ -#define A_IPR_MIDITRANSBUFEMPTY2 0x10000000 /* MIDI UART transmit buffer empty */ -#define A_IPR_MIDIRECVBUFEMPTY2 0x08000000 /* MIDI UART receive buffer empty */ - -#define IPR_SAMPLERATETRACKER 0x01000000 /* Sample rate tracker lock status change */ -#define IPR_FXDSP 0x00800000 /* Enable FX DSP interrupts */ -#define IPR_FORCEINT 0x00400000 /* Force Sound Blaster interrupt */ -#define IPR_PCIERROR 0x00200000 /* PCI bus error */ -#define IPR_VOLINCR 0x00100000 /* Volume increment button pressed */ -#define IPR_VOLDECR 0x00080000 /* Volume decrement button pressed */ -#define IPR_MUTE 0x00040000 /* Mute button pressed */ -#define IPR_MICBUFFULL 0x00020000 /* Microphone buffer full */ -#define IPR_MICBUFHALFFULL 0x00010000 /* Microphone buffer half full */ -#define IPR_ADCBUFFULL 0x00008000 /* ADC buffer full */ -#define IPR_ADCBUFHALFFULL 0x00004000 /* ADC buffer half full */ -#define IPR_EFXBUFFULL 0x00002000 /* Effects buffer full */ -#define IPR_EFXBUFHALFFULL 0x00001000 /* Effects buffer half full */ -#define IPR_GPSPDIFSTATUSCHANGE 0x00000800 /* GPSPDIF channel status change */ -#define IPR_CDROMSTATUSCHANGE 0x00000400 /* CD-ROM channel status change */ -#define IPR_INTERVALTIMER 0x00000200 /* Interval timer terminal count */ -#define IPR_MIDITRANSBUFEMPTY 0x00000100 /* MIDI UART transmit buffer empty */ -#define IPR_MIDIRECVBUFEMPTY 0x00000080 /* MIDI UART receive buffer empty */ -#define IPR_CHANNELLOOP 0x00000040 /* One or more channel loop interrupts pending */ -#define IPR_CHANNELNUMBERMASK 0x0000003f /* When IPR_CHANNELLOOP is set, indicates the */ - /* Highest set channel in CLIPL or CLIPH. When */ - /* IP is written with CL set, the bit in CLIPL */ - /* or CLIPH corresponding to the CIN value */ - /* written will be cleared. */ -#define A_IPR_MIDITRANSBUFEMPTY1 IPR_MIDITRANSBUFEMPTY /* MIDI UART transmit buffer empty */ -#define A_IPR_MIDIRECVBUFEMPTY1 IPR_MIDIRECVBUFEMPTY /* MIDI UART receive buffer empty */ - - - -#define INTE 0x0c /* Interrupt enable register */ -#define INTE_VIRTUALSB_MASK 0xc0000000 /* Virtual Soundblaster I/O port capture */ -#define INTE_VIRTUALSB_220 0x00000000 /* Capture at I/O base address 0x220-0x22f */ -#define INTE_VIRTUALSB_240 0x40000000 /* Capture at I/O base address 0x240 */ -#define INTE_VIRTUALSB_260 0x80000000 /* Capture at I/O base address 0x260 */ -#define INTE_VIRTUALSB_280 0xc0000000 /* Capture at I/O base address 0x280 */ -#define INTE_VIRTUALMPU_MASK 0x30000000 /* Virtual MPU I/O port capture */ -#define INTE_VIRTUALMPU_300 0x00000000 /* Capture at I/O base address 0x300-0x301 */ -#define INTE_VIRTUALMPU_310 0x10000000 /* Capture at I/O base address 0x310 */ -#define INTE_VIRTUALMPU_320 0x20000000 /* Capture at I/O base address 0x320 */ -#define INTE_VIRTUALMPU_330 0x30000000 /* Capture at I/O base address 0x330 */ -#define INTE_MASTERDMAENABLE 0x08000000 /* Master DMA emulation at 0x000-0x00f */ -#define INTE_SLAVEDMAENABLE 0x04000000 /* Slave DMA emulation at 0x0c0-0x0df */ -#define INTE_MASTERPICENABLE 0x02000000 /* Master PIC emulation at 0x020-0x021 */ -#define INTE_SLAVEPICENABLE 0x01000000 /* Slave PIC emulation at 0x0a0-0x0a1 */ -#define INTE_VSBENABLE 0x00800000 /* Enable virtual Soundblaster */ -#define INTE_ADLIBENABLE 0x00400000 /* Enable AdLib emulation at 0x388-0x38b */ -#define INTE_MPUENABLE 0x00200000 /* Enable virtual MPU */ -#define INTE_FORCEINT 0x00100000 /* Continuously assert INTAN */ - -#define INTE_MRHANDENABLE 0x00080000 /* Enable the "Mr. Hand" logic */ - /* NOTE: There is no reason to use this under */ - /* Linux, and it will cause odd hardware */ - /* behavior and possibly random segfaults and */ - /* lockups if enabled. */ - -/* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1) */ -#define A_INTE_MIDITXENABLE2 0x00020000 /* Enable MIDI transmit-buffer-empty interrupts */ -#define A_INTE_MIDIRXENABLE2 0x00010000 /* Enable MIDI receive-buffer-empty interrupts */ - - -#define INTE_SAMPLERATETRACKER 0x00002000 /* Enable sample rate tracker interrupts */ - /* NOTE: This bit must always be enabled */ -#define INTE_FXDSPENABLE 0x00001000 /* Enable FX DSP interrupts */ -#define INTE_PCIERRORENABLE 0x00000800 /* Enable PCI bus error interrupts */ -#define INTE_VOLINCRENABLE 0x00000400 /* Enable volume increment button interrupts */ -#define INTE_VOLDECRENABLE 0x00000200 /* Enable volume decrement button interrupts */ -#define INTE_MUTEENABLE 0x00000100 /* Enable mute button interrupts */ -#define INTE_MICBUFENABLE 0x00000080 /* Enable microphone buffer interrupts */ -#define INTE_ADCBUFENABLE 0x00000040 /* Enable ADC buffer interrupts */ -#define INTE_EFXBUFENABLE 0x00000020 /* Enable Effects buffer interrupts */ -#define INTE_GPSPDIFENABLE 0x00000010 /* Enable GPSPDIF status interrupts */ -#define INTE_CDSPDIFENABLE 0x00000008 /* Enable CDSPDIF status interrupts */ -#define INTE_INTERVALTIMERENB 0x00000004 /* Enable interval timer interrupts */ -#define INTE_MIDITXENABLE 0x00000002 /* Enable MIDI transmit-buffer-empty interrupts */ -#define INTE_MIDIRXENABLE 0x00000001 /* Enable MIDI receive-buffer-empty interrupts */ - -/* The next two interrupts are for the midi port on the Audigy (A_MPU2) */ -#define A_INTE_MIDITXENABLE1 INTE_MIDITXENABLE -#define A_INTE_MIDIRXENABLE1 INTE_MIDIRXENABLE - -#define WC 0x10 /* Wall Clock register */ -#define WC_SAMPLECOUNTER_MASK 0x03FFFFC0 /* Sample periods elapsed since reset */ -#define WC_SAMPLECOUNTER 0x14060010 -#define WC_CURRENTCHANNEL 0x0000003F /* Channel [0..63] currently being serviced */ - /* NOTE: Each channel takes 1/64th of a sample */ - /* period to be serviced. */ - -#define HCFG 0x14 /* Hardware config register */ - /* NOTE: There is no reason to use the legacy */ - /* SoundBlaster emulation stuff described below */ - /* under Linux, and all kinds of weird hardware */ - /* behavior can result if you try. Don't. */ -#define HCFG_LEGACYFUNC_MASK 0xe0000000 /* Legacy function number */ -#define HCFG_LEGACYFUNC_MPU 0x00000000 /* Legacy MPU */ -#define HCFG_LEGACYFUNC_SB 0x40000000 /* Legacy SB */ -#define HCFG_LEGACYFUNC_AD 0x60000000 /* Legacy AD */ -#define HCFG_LEGACYFUNC_MPIC 0x80000000 /* Legacy MPIC */ -#define HCFG_LEGACYFUNC_MDMA 0xa0000000 /* Legacy MDMA */ -#define HCFG_LEGACYFUNC_SPCI 0xc0000000 /* Legacy SPCI */ -#define HCFG_LEGACYFUNC_SDMA 0xe0000000 /* Legacy SDMA */ -#define HCFG_IOCAPTUREADDR 0x1f000000 /* The 4 LSBs of the captured I/O address. */ -#define HCFG_LEGACYWRITE 0x00800000 /* 1 = write, 0 = read */ -#define HCFG_LEGACYWORD 0x00400000 /* 1 = word, 0 = byte */ -#define HCFG_LEGACYINT 0x00200000 /* 1 = legacy event captured. Write 1 to clear. */ - /* NOTE: The rest of the bits in this register */ - /* _are_ relevant under Linux. */ -#define HCFG_CODECFORMAT_MASK 0x00070000 /* CODEC format */ -#define HCFG_CODECFORMAT_AC97 0x00000000 /* AC97 CODEC format -- Primary Output */ -#define HCFG_CODECFORMAT_I2S 0x00010000 /* I2S CODEC format -- Secondary (Rear) Output */ -#define HCFG_GPINPUT0 0x00004000 /* External pin112 */ -#define HCFG_GPINPUT1 0x00002000 /* External pin110 */ - -#define HCFG_GPOUTPUT_MASK 0x00001c00 /* External pins which may be controlled */ -#define HCFG_GPOUT0 0x00001000 /* set to enable digital out on 5.1 cards */ - -#define HCFG_JOYENABLE 0x00000200 /* Internal joystick enable */ -#define HCFG_PHASETRACKENABLE 0x00000100 /* Phase tracking enable */ - /* 1 = Force all 3 async digital inputs to use */ - /* the same async sample rate tracker (ZVIDEO) */ -#define HCFG_AC3ENABLE_MASK 0x0x0000e0 /* AC3 async input control - Not implemented */ -#define HCFG_AC3ENABLE_ZVIDEO 0x00000080 /* Channels 0 and 1 replace ZVIDEO */ -#define HCFG_AC3ENABLE_CDSPDIF 0x00000040 /* Channels 0 and 1 replace CDSPDIF */ -#define HCFG_AC3ENABLE_GPSPDIF 0x00000020 /* Channels 0 and 1 replace GPSPDIF */ -#define HCFG_AUTOMUTE 0x00000010 /* When set, the async sample rate convertors */ - /* will automatically mute their output when */ - /* they are not rate-locked to the external */ - /* async audio source */ -#define HCFG_LOCKSOUNDCACHE 0x00000008 /* 1 = Cancel bustmaster accesses to soundcache */ - /* NOTE: This should generally never be used. */ -#define HCFG_LOCKTANKCACHE_MASK 0x00000004 /* 1 = Cancel bustmaster accesses to tankcache */ - /* NOTE: This should generally never be used. */ -#define HCFG_LOCKTANKCACHE 0x01020014 -#define HCFG_MUTEBUTTONENABLE 0x00000002 /* 1 = Master mute button sets AUDIOENABLE = 0. */ - /* NOTE: This is a 'cheap' way to implement a */ - /* master mute function on the mute button, and */ - /* in general should not be used unless a more */ - /* sophisticated master mute function has not */ - /* been written. */ -#define HCFG_AUDIOENABLE 0x00000001 /* 0 = CODECs transmit zero-valued samples */ - /* Should be set to 1 when the EMU10K1 is */ - /* completely initialized. */ - -//For Audigy, MPU port move to 0x70-0x74 ptr register - -#define MUDATA 0x18 /* MPU401 data register (8 bits) */ - -#define MUCMD 0x19 /* MPU401 command register (8 bits) */ -#define MUCMD_RESET 0xff /* RESET command */ -#define MUCMD_ENTERUARTMODE 0x3f /* Enter_UART_mode command */ - /* NOTE: All other commands are ignored */ - -#define MUSTAT MUCMD /* MPU401 status register (8 bits) */ -#define MUSTAT_IRDYN 0x80 /* 0 = MIDI data or command ACK */ -#define MUSTAT_ORDYN 0x40 /* 0 = MUDATA can accept a command or data */ - -#define A_IOCFG 0x18 /* GPIO on Audigy card (16bits) */ -#define A_GPINPUT_MASK 0xff00 -#define A_GPOUTPUT_MASK 0x00ff - -#define TIMER 0x1a /* Timer terminal count register (16-bit) */ - /* NOTE: After the rate is changed, a maximum */ - /* of 1024 sample periods should be allowed */ - /* before the new rate is guaranteed accurate. */ -#define TIMER_RATE_MASK 0x03ff /* Timer interrupt rate in sample periods */ - /* 0 == 1024 periods, [1..4] are not useful */ - -#define AC97DATA 0x1c /* AC97 register set data register (16 bit) */ - -#define AC97ADDRESS 0x1e /* AC97 register set address register (8 bit) */ -#define AC97ADDRESS_READY 0x80 /* Read-only bit, reflects CODEC READY signal */ -#define AC97ADDRESS_ADDRESS 0x7f /* Address of indexed AC97 register */ - -/********************************************************************************************************/ -/* Emu10k1 pointer-offset register set, accessed through the PTR and DATA registers */ -/********************************************************************************************************/ - -#define CPF 0x00 /* Current pitch and fraction register */ -#define CPF_CURRENTPITCH_MASK 0xffff0000 /* Current pitch (linear, 0x4000 == unity pitch shift) */ -#define CPF_CURRENTPITCH 0x10100000 -#define CPF_STEREO_MASK 0x00008000 /* 1 = Even channel interleave, odd channel locked */ -#define CPF_STOP_MASK 0x00004000 /* 1 = Current pitch forced to 0 */ -#define CPF_FRACADDRESS_MASK 0x00003fff /* Linear fractional address of the current channel */ - -#define PTRX 0x01 /* Pitch target and send A/B amounts register */ -#define PTRX_PITCHTARGET_MASK 0xffff0000 /* Pitch target of specified channel */ -#define PTRX_PITCHTARGET 0x10100001 -#define PTRX_FXSENDAMOUNT_A_MASK 0x0000ff00 /* Linear level of channel output sent to FX send bus A */ -#define PTRX_FXSENDAMOUNT_A 0x08080001 -#define PTRX_FXSENDAMOUNT_B_MASK 0x000000ff /* Linear level of channel output sent to FX send bus B */ -#define PTRX_FXSENDAMOUNT_B 0x08000001 - -#define CVCF 0x02 /* Current volume and filter cutoff register */ -#define CVCF_CURRENTVOL_MASK 0xffff0000 /* Current linear volume of specified channel */ -#define CVCF_CURRENTVOL 0x10100002 -#define CVCF_CURRENTFILTER_MASK 0x0000ffff /* Current filter cutoff frequency of specified channel */ -#define CVCF_CURRENTFILTER 0x10000002 - -#define VTFT 0x03 /* Volume target and filter cutoff target register */ -#define VTFT_VOLUMETARGET_MASK 0xffff0000 /* Volume target of specified channel */ -#define VTFT_FILTERTARGET_MASK 0x0000ffff /* Filter cutoff target of specified channel */ - -#define Z1 0x05 /* Filter delay memory 1 register */ - -#define Z2 0x04 /* Filter delay memory 2 register */ - -#define PSST 0x06 /* Send C amount and loop start address register */ -#define PSST_FXSENDAMOUNT_C_MASK 0xff000000 /* Linear level of channel output sent to FX send bus C */ - -#define PSST_FXSENDAMOUNT_C 0x08180006 - -#define PSST_LOOPSTARTADDR_MASK 0x00ffffff /* Loop start address of the specified channel */ -#define PSST_LOOPSTARTADDR 0x18000006 - -#define DSL 0x07 /* Send D amount and loop start address register */ -#define DSL_FXSENDAMOUNT_D_MASK 0xff000000 /* Linear level of channel output sent to FX send bus D */ - -#define DSL_FXSENDAMOUNT_D 0x08180007 - -#define DSL_LOOPENDADDR_MASK 0x00ffffff /* Loop end address of the specified channel */ -#define DSL_LOOPENDADDR 0x18000007 - -#define CCCA 0x08 /* Filter Q, interp. ROM, byte size, cur. addr register */ -#define CCCA_RESONANCE 0xf0000000 /* Lowpass filter resonance (Q) height */ -#define CCCA_INTERPROMMASK 0x0e000000 /* Selects passband of interpolation ROM */ - /* 1 == full band, 7 == lowpass */ - /* ROM 0 is used when pitch shifting downward or less */ - /* then 3 semitones upward. Increasingly higher ROM */ - /* numbers are used, typically in steps of 3 semitones, */ - /* as upward pitch shifting is performed. */ -#define CCCA_INTERPROM_0 0x00000000 /* Select interpolation ROM 0 */ -#define CCCA_INTERPROM_1 0x02000000 /* Select interpolation ROM 1 */ -#define CCCA_INTERPROM_2 0x04000000 /* Select interpolation ROM 2 */ -#define CCCA_INTERPROM_3 0x06000000 /* Select interpolation ROM 3 */ -#define CCCA_INTERPROM_4 0x08000000 /* Select interpolation ROM 4 */ -#define CCCA_INTERPROM_5 0x0a000000 /* Select interpolation ROM 5 */ -#define CCCA_INTERPROM_6 0x0c000000 /* Select interpolation ROM 6 */ -#define CCCA_INTERPROM_7 0x0e000000 /* Select interpolation ROM 7 */ -#define CCCA_8BITSELECT 0x01000000 /* 1 = Sound memory for this channel uses 8-bit samples */ -#define CCCA_CURRADDR_MASK 0x00ffffff /* Current address of the selected channel */ -#define CCCA_CURRADDR 0x18000008 - -#define CCR 0x09 /* Cache control register */ -#define CCR_CACHEINVALIDSIZE 0x07190009 -#define CCR_CACHEINVALIDSIZE_MASK 0xfe000000 /* Number of invalid samples cache for this channel */ -#define CCR_CACHELOOPFLAG 0x01000000 /* 1 = Cache has a loop service pending */ -#define CCR_INTERLEAVEDSAMPLES 0x00800000 /* 1 = A cache service will fetch interleaved samples */ -#define CCR_WORDSIZEDSAMPLES 0x00400000 /* 1 = A cache service will fetch word sized samples */ -#define CCR_READADDRESS 0x06100009 -#define CCR_READADDRESS_MASK 0x003f0000 /* Location of cache just beyond current cache service */ -#define CCR_LOOPINVALSIZE 0x0000fe00 /* Number of invalid samples in cache prior to loop */ - /* NOTE: This is valid only if CACHELOOPFLAG is set */ -#define CCR_LOOPFLAG 0x00000100 /* Set for a single sample period when a loop occurs */ -#define CCR_CACHELOOPADDRHI 0x000000ff /* DSL_LOOPSTARTADDR's hi byte if CACHELOOPFLAG is set */ - -#define CLP 0x0a /* Cache loop register (valid if CCR_CACHELOOPFLAG = 1) */ - /* NOTE: This register is normally not used */ -#define CLP_CACHELOOPADDR 0x0000ffff /* Cache loop address (DSL_LOOPSTARTADDR [0..15]) */ - -#define FXRT 0x0b /* Effects send routing register */ - /* NOTE: It is illegal to assign the same routing to */ - /* two effects sends. */ -#define FXRT_CHANNELA 0x000f0000 /* Effects send bus number for channel's effects send A */ -#define FXRT_CHANNELB 0x00f00000 /* Effects send bus number for channel's effects send B */ -#define FXRT_CHANNELC 0x0f000000 /* Effects send bus number for channel's effects send C */ -#define FXRT_CHANNELD 0xf0000000 /* Effects send bus number for channel's effects send D */ - -#define MAPA 0x0c /* Cache map A */ - -#define MAPB 0x0d /* Cache map B */ - -#define MAP_PTE_MASK 0xffffe000 /* The 19 MSBs of the PTE indexed by the PTI */ -#define MAP_PTI_MASK 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */ - -#define ENVVOL 0x10 /* Volume envelope register */ -#define ENVVOL_MASK 0x0000ffff /* Current value of volume envelope state variable */ - /* 0x8000-n == 666*n usec delay */ - -#define ATKHLDV 0x11 /* Volume envelope hold and attack register */ -#define ATKHLDV_PHASE0 0x00008000 /* 0 = Begin attack phase */ -#define ATKHLDV_HOLDTIME_MASK 0x00007f00 /* Envelope hold time (127-n == n*88.2msec) */ -#define ATKHLDV_ATTACKTIME_MASK 0x0000007f /* Envelope attack time, log encoded */ - /* 0 = infinite, 1 = 10.9msec, ... 0x7f = 5.5msec */ - -#define DCYSUSV 0x12 /* Volume envelope sustain and decay register */ -#define DCYSUSV_PHASE1_MASK 0x00008000 /* 0 = Begin attack phase, 1 = begin release phase */ -#define DCYSUSV_SUSTAINLEVEL_MASK 0x00007f00 /* 127 = full, 0 = off, 0.75dB increments */ -#define DCYSUSV_CHANNELENABLE_MASK 0x00000080 /* 1 = Inhibit envelope engine from writing values in */ - /* this channel and from writing to pitch, filter and */ - /* volume targets. */ -#define DCYSUSV_DECAYTIME_MASK 0x0000007f /* Volume envelope decay time, log encoded */ - /* 0 = 43.7msec, 1 = 21.8msec, 0x7f = 22msec */ - -#define LFOVAL1 0x13 /* Modulation LFO value */ -#define LFOVAL_MASK 0x0000ffff /* Current value of modulation LFO state variable */ - /* 0x8000-n == 666*n usec delay */ - -#define ENVVAL 0x14 /* Modulation envelope register */ -#define ENVVAL_MASK 0x0000ffff /* Current value of modulation envelope state variable */ - /* 0x8000-n == 666*n usec delay */ - -#define ATKHLDM 0x15 /* Modulation envelope hold and attack register */ -#define ATKHLDM_PHASE0 0x00008000 /* 0 = Begin attack phase */ -#define ATKHLDM_HOLDTIME 0x00007f00 /* Envelope hold time (127-n == n*42msec) */ -#define ATKHLDM_ATTACKTIME 0x0000007f /* Envelope attack time, log encoded */ - /* 0 = infinite, 1 = 11msec, ... 0x7f = 5.5msec */ - -#define DCYSUSM 0x16 /* Modulation envelope decay and sustain register */ -#define DCYSUSM_PHASE1_MASK 0x00008000 /* 0 = Begin attack phase, 1 = begin release phase */ -#define DCYSUSM_SUSTAINLEVEL_MASK 0x00007f00 /* 127 = full, 0 = off, 0.75dB increments */ -#define DCYSUSM_DECAYTIME_MASK 0x0000007f /* Envelope decay time, log encoded */ - /* 0 = 43.7msec, 1 = 21.8msec, 0x7f = 22msec */ - -#define LFOVAL2 0x17 /* Vibrato LFO register */ -#define LFOVAL2_MASK 0x0000ffff /* Current value of vibrato LFO state variable */ - /* 0x8000-n == 666*n usec delay */ - -#define IP 0x18 /* Initial pitch register */ -#define IP_MASK 0x0000ffff /* Exponential initial pitch shift */ - /* 4 bits of octave, 12 bits of fractional octave */ -#define IP_UNITY 0x0000e000 /* Unity pitch shift */ - -#define IFATN 0x19 /* Initial filter cutoff and attenuation register */ -#define IFATN_FILTERCUTOFF_MASK 0x0000ff00 /* Initial filter cutoff frequency in exponential units */ - /* 6 most significant bits are semitones */ - /* 2 least significant bits are fractions */ -#define IFATN_FILTERCUTOFF 0x08080019 -#define IFATN_ATTENUATION_MASK 0x000000ff /* Initial attenuation in 0.375dB steps */ -#define IFATN_ATTENUATION 0x08000019 - - -#define PEFE 0x1a /* Pitch envelope and filter envelope amount register */ -#define PEFE_PITCHAMOUNT_MASK 0x0000ff00 /* Pitch envlope amount */ - /* Signed 2's complement, +/- one octave peak extremes */ -#define PEFE_PITCHAMOUNT 0x0808001a -#define PEFE_FILTERAMOUNT_MASK 0x000000ff /* Filter envlope amount */ - /* Signed 2's complement, +/- six octaves peak extremes */ -#define PEFE_FILTERAMOUNT 0x0800001a -#define FMMOD 0x1b /* Vibrato/filter modulation from LFO register */ -#define FMMOD_MODVIBRATO 0x0000ff00 /* Vibrato LFO modulation depth */ - /* Signed 2's complement, +/- one octave extremes */ -#define FMMOD_MOFILTER 0x000000ff /* Filter LFO modulation depth */ - /* Signed 2's complement, +/- three octave extremes */ - - -#define TREMFRQ 0x1c /* Tremolo amount and modulation LFO frequency register */ -#define TREMFRQ_DEPTH 0x0000ff00 /* Tremolo depth */ - /* Signed 2's complement, with +/- 12dB extremes */ -#define TREMFRQ_FREQUENCY 0x000000ff /* Tremolo LFO frequency */ - /* ??Hz steps, maximum of ?? Hz. */ - -#define FM2FRQ2 0x1d /* Vibrato amount and vibrato LFO frequency register */ -#define FM2FRQ2_DEPTH 0x0000ff00 /* Vibrato LFO vibrato depth */ - /* Signed 2's complement, +/- one octave extremes */ -#define FM2FRQ2_FREQUENCY 0x000000ff /* Vibrato LFO frequency */ - /* 0.039Hz steps, maximum of 9.85 Hz. */ - -#define TEMPENV 0x1e /* Tempory envelope register */ -#define TEMPENV_MASK 0x0000ffff /* 16-bit value */ - /* NOTE: All channels contain internal variables; do */ - /* not write to these locations. */ - -#define CD0 0x20 /* Cache data 0 register */ -#define CD1 0x21 /* Cache data 1 register */ -#define CD2 0x22 /* Cache data 2 register */ -#define CD3 0x23 /* Cache data 3 register */ -#define CD4 0x24 /* Cache data 4 register */ -#define CD5 0x25 /* Cache data 5 register */ -#define CD6 0x26 /* Cache data 6 register */ -#define CD7 0x27 /* Cache data 7 register */ -#define CD8 0x28 /* Cache data 8 register */ -#define CD9 0x29 /* Cache data 9 register */ -#define CDA 0x2a /* Cache data A register */ -#define CDB 0x2b /* Cache data B register */ -#define CDC 0x2c /* Cache data C register */ -#define CDD 0x2d /* Cache data D register */ -#define CDE 0x2e /* Cache data E register */ -#define CDF 0x2f /* Cache data F register */ - -#define PTB 0x40 /* Page table base register */ -#define PTB_MASK 0xfffff000 /* Physical address of the page table in host memory */ - -#define TCB 0x41 /* Tank cache base register */ -#define TCB_MASK 0xfffff000 /* Physical address of the bottom of host based TRAM */ - -#define ADCCR 0x42 /* ADC sample rate/stereo control register */ -#define ADCCR_RCHANENABLE 0x00000010 /* Enables right channel for writing to the host */ -#define ADCCR_LCHANENABLE 0x00000008 /* Enables left channel for writing to the host */ - /* NOTE: To guarantee phase coherency, both channels */ - /* must be disabled prior to enabling both channels. */ -#define A_ADCCR_RCHANENABLE 0x00000020 -#define A_ADCCR_LCHANENABLE 0x00000010 - -#define A_ADCCR_SAMPLERATE_MASK 0x0000000F /* Audigy sample rate convertor output rate */ -#define ADCCR_SAMPLERATE_MASK 0x00000007 /* Sample rate convertor output rate */ - -#define ADCCR_SAMPLERATE_48 0x00000000 /* 48kHz sample rate */ -#define ADCCR_SAMPLERATE_44 0x00000001 /* 44.1kHz sample rate */ -#define ADCCR_SAMPLERATE_32 0x00000002 /* 32kHz sample rate */ -#define ADCCR_SAMPLERATE_24 0x00000003 /* 24kHz sample rate */ -#define ADCCR_SAMPLERATE_22 0x00000004 /* 22.05kHz sample rate */ -#define ADCCR_SAMPLERATE_16 0x00000005 /* 16kHz sample rate */ -#define ADCCR_SAMPLERATE_11 0x00000006 /* 11.025kHz sample rate */ -#define ADCCR_SAMPLERATE_8 0x00000007 /* 8kHz sample rate */ - -#define A_ADCCR_SAMPLERATE_12 0x00000006 /* 12kHz sample rate */ -#define A_ADCCR_SAMPLERATE_11 0x00000007 /* 11.025kHz sample rate */ -#define A_ADCCR_SAMPLERATE_8 0x00000008 /* 8kHz sample rate */ - -#define FXWC 0x43 /* FX output write channels register */ - /* When set, each bit enables the writing of the */ - /* corresponding FX output channel (internal registers */ - /* 0x20-0x3f) into host memory. This mode of recording */ - /* is 16bit, 48KHz only. All 32 channels can be enabled */ - /* simultaneously. */ -#define TCBS 0x44 /* Tank cache buffer size register */ -#define TCBS_MASK 0x00000007 /* Tank cache buffer size field */ -#define TCBS_BUFFSIZE_16K 0x00000000 -#define TCBS_BUFFSIZE_32K 0x00000001 -#define TCBS_BUFFSIZE_64K 0x00000002 -#define TCBS_BUFFSIZE_128K 0x00000003 -#define TCBS_BUFFSIZE_256K 0x00000004 -#define TCBS_BUFFSIZE_512K 0x00000005 -#define TCBS_BUFFSIZE_1024K 0x00000006 -#define TCBS_BUFFSIZE_2048K 0x00000007 - -#define MICBA 0x45 /* AC97 microphone buffer address register */ -#define MICBA_MASK 0xfffff000 /* 20 bit base address */ - -#define ADCBA 0x46 /* ADC buffer address register */ -#define ADCBA_MASK 0xfffff000 /* 20 bit base address */ - -#define FXBA 0x47 /* FX Buffer Address */ -#define FXBA_MASK 0xfffff000 /* 20 bit base address */ - -#define MICBS 0x49 /* Microphone buffer size register */ - -#define ADCBS 0x4a /* ADC buffer size register */ - -#define FXBS 0x4b /* FX buffer size register */ - -/* The following mask values define the size of the ADC, MIX and FX buffers in bytes */ -#define ADCBS_BUFSIZE_NONE 0x00000000 -#define ADCBS_BUFSIZE_384 0x00000001 -#define ADCBS_BUFSIZE_448 0x00000002 -#define ADCBS_BUFSIZE_512 0x00000003 -#define ADCBS_BUFSIZE_640 0x00000004 -#define ADCBS_BUFSIZE_768 0x00000005 -#define ADCBS_BUFSIZE_896 0x00000006 -#define ADCBS_BUFSIZE_1024 0x00000007 -#define ADCBS_BUFSIZE_1280 0x00000008 -#define ADCBS_BUFSIZE_1536 0x00000009 -#define ADCBS_BUFSIZE_1792 0x0000000a -#define ADCBS_BUFSIZE_2048 0x0000000b -#define ADCBS_BUFSIZE_2560 0x0000000c -#define ADCBS_BUFSIZE_3072 0x0000000d -#define ADCBS_BUFSIZE_3584 0x0000000e -#define ADCBS_BUFSIZE_4096 0x0000000f -#define ADCBS_BUFSIZE_5120 0x00000010 -#define ADCBS_BUFSIZE_6144 0x00000011 -#define ADCBS_BUFSIZE_7168 0x00000012 -#define ADCBS_BUFSIZE_8192 0x00000013 -#define ADCBS_BUFSIZE_10240 0x00000014 -#define ADCBS_BUFSIZE_12288 0x00000015 -#define ADCBS_BUFSIZE_14366 0x00000016 -#define ADCBS_BUFSIZE_16384 0x00000017 -#define ADCBS_BUFSIZE_20480 0x00000018 -#define ADCBS_BUFSIZE_24576 0x00000019 -#define ADCBS_BUFSIZE_28672 0x0000001a -#define ADCBS_BUFSIZE_32768 0x0000001b -#define ADCBS_BUFSIZE_40960 0x0000001c -#define ADCBS_BUFSIZE_49152 0x0000001d -#define ADCBS_BUFSIZE_57344 0x0000001e -#define ADCBS_BUFSIZE_65536 0x0000001f - - -#define CDCS 0x50 /* CD-ROM digital channel status register */ - -#define GPSCS 0x51 /* General Purpose SPDIF channel status register*/ - -#define DBG 0x52 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ - -/* definitions for debug register - taken from the alsa drivers */ -#define DBG_ZC 0x80000000 /* zero tram counter */ -#define DBG_SATURATION_OCCURED 0x02000000 /* saturation control */ -#define DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */ -#define DBG_SINGLE_STEP 0x00008000 /* single step mode */ -#define DBG_STEP 0x00004000 /* start single step */ -#define DBG_CONDITION_CODE 0x00003e00 /* condition code */ -#define DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */ - - -#define REG53 0x53 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ - -#define A_DBG 0x53 -#define A_DBG_SINGLE_STEP 0x00020000 /* Set to zero to start dsp */ -#define A_DBG_ZC 0x40000000 /* zero tram counter */ -#define A_DBG_STEP_ADDR 0x000003ff -#define A_DBG_SATURATION_OCCURED 0x20000000 -#define A_DBG_SATURATION_ADDR 0x0ffc0000 - -#define SPCS0 0x54 /* SPDIF output Channel Status 0 register */ - -#define SPCS1 0x55 /* SPDIF output Channel Status 1 register */ - -#define SPCS2 0x56 /* SPDIF output Channel Status 2 register */ - -#define SPCS_CLKACCYMASK 0x30000000 /* Clock accuracy */ -#define SPCS_CLKACCY_1000PPM 0x00000000 /* 1000 parts per million */ -#define SPCS_CLKACCY_50PPM 0x10000000 /* 50 parts per million */ -#define SPCS_CLKACCY_VARIABLE 0x20000000 /* Variable accuracy */ -#define SPCS_SAMPLERATEMASK 0x0f000000 /* Sample rate */ -#define SPCS_SAMPLERATE_44 0x00000000 /* 44.1kHz sample rate */ -#define SPCS_SAMPLERATE_48 0x02000000 /* 48kHz sample rate */ -#define SPCS_SAMPLERATE_32 0x03000000 /* 32kHz sample rate */ -#define SPCS_CHANNELNUMMASK 0x00f00000 /* Channel number */ -#define SPCS_CHANNELNUM_UNSPEC 0x00000000 /* Unspecified channel number */ -#define SPCS_CHANNELNUM_LEFT 0x00100000 /* Left channel */ -#define SPCS_CHANNELNUM_RIGHT 0x00200000 /* Right channel */ -#define SPCS_SOURCENUMMASK 0x000f0000 /* Source number */ -#define SPCS_SOURCENUM_UNSPEC 0x00000000 /* Unspecified source number */ -#define SPCS_GENERATIONSTATUS 0x00008000 /* Originality flag (see IEC-958 spec) */ -#define SPCS_CATEGORYCODEMASK 0x00007f00 /* Category code (see IEC-958 spec) */ -#define SPCS_MODEMASK 0x000000c0 /* Mode (see IEC-958 spec) */ -#define SPCS_EMPHASISMASK 0x00000038 /* Emphasis */ -#define SPCS_EMPHASIS_NONE 0x00000000 /* No emphasis */ -#define SPCS_EMPHASIS_50_15 0x00000008 /* 50/15 usec 2 channel */ -#define SPCS_COPYRIGHT 0x00000004 /* Copyright asserted flag -- do not modify */ -#define SPCS_NOTAUDIODATA 0x00000002 /* 0 = Digital audio, 1 = not audio */ -#define SPCS_PROFESSIONAL 0x00000001 /* 0 = Consumer (IEC-958), 1 = pro (AES3-1992) */ - -/* The 32-bit CLIx and SOLx registers all have one bit per channel control/status */ -#define CLIEL 0x58 /* Channel loop interrupt enable low register */ - -#define CLIEH 0x59 /* Channel loop interrupt enable high register */ - -#define CLIPL 0x5a /* Channel loop interrupt pending low register */ - -#define CLIPH 0x5b /* Channel loop interrupt pending high register */ - -#define SOLEL 0x5c /* Stop on loop enable low register */ - -#define SOLEH 0x5d /* Stop on loop enable high register */ - -#define SPBYPASS 0x5e /* SPDIF BYPASS mode register */ -#define SPBYPASS_ENABLE 0x00000001 /* Enable SPDIF bypass mode */ - -#define AC97SLOT 0x5f /* additional AC97 slots enable bits */ -#define AC97SLOT_CNTR 0x10 /* Center enable */ -#define AC97SLOT_LFE 0x20 /* LFE enable */ - -#define CDSRCS 0x60 /* CD-ROM Sample Rate Converter status register */ - -#define GPSRCS 0x61 /* General Purpose SPDIF sample rate cvt status */ - -#define ZVSRCS 0x62 /* ZVideo sample rate converter status */ - /* NOTE: This one has no SPDIFLOCKED field */ - /* Assumes sample lock */ - -/* These three bitfields apply to CDSRCS, GPSRCS, and (except as noted) ZVSRCS. */ -#define SRCS_SPDIFLOCKED 0x02000000 /* SPDIF stream locked */ -#define SRCS_RATELOCKED 0x01000000 /* Sample rate locked */ -#define SRCS_ESTSAMPLERATE 0x0007ffff /* Do not modify this field. */ - - -/* Note that these values can vary +/- by a small amount */ -#define SRCS_SPDIFRATE_44 0x0003acd9 -#define SRCS_SPDIFRATE_48 0x00040000 -#define SRCS_SPDIFRATE_96 0x00080000 - -#define MICIDX 0x63 /* Microphone recording buffer index register */ -#define MICIDX_MASK 0x0000ffff /* 16-bit value */ -#define MICIDX_IDX 0x10000063 - -#define A_ADCIDX 0x63 -#define A_ADCIDX_IDX 0x10000063 - -#define ADCIDX 0x64 /* ADC recording buffer index register */ -#define ADCIDX_MASK 0x0000ffff /* 16 bit index field */ -#define ADCIDX_IDX 0x10000064 - -#define FXIDX 0x65 /* FX recording buffer index register */ -#define FXIDX_MASK 0x0000ffff /* 16-bit value */ -#define FXIDX_IDX 0x10000065 - -/* This is the MPU port on the card (via the game port) */ -#define A_MUDATA1 0x70 -#define A_MUCMD1 0x71 -#define A_MUSTAT1 A_MUCMD1 - -/* This is the MPU port on the Audigy Drive */ -#define A_MUDATA2 0x72 -#define A_MUCMD2 0x73 -#define A_MUSTAT2 A_MUCMD2 - -/* The next two are the Audigy equivalent of FXWC */ -/* the Audigy can record any output (16bit, 48kHz, up to 64 channel simultaneously) */ -/* Each bit selects a channel for recording */ -#define A_FXWC1 0x74 /* Selects 0x7f-0x60 for FX recording */ -#define A_FXWC2 0x75 /* Selects 0x9f-0x80 for FX recording */ - -#define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */ -#define A_SPDIF_48000 0x00000080 -#define A_SPDIF_44100 0x00000000 -#define A_SPDIF_96000 0x00000040 - -#define A_FXRT2 0x7c -#define A_FXRT_CHANNELE 0x0000003f /* Effects send bus number for channel's effects send E */ -#define A_FXRT_CHANNELF 0x00003f00 /* Effects send bus number for channel's effects send F */ -#define A_FXRT_CHANNELG 0x003f0000 /* Effects send bus number for channel's effects send G */ -#define A_FXRT_CHANNELH 0x3f000000 /* Effects send bus number for channel's effects send H */ - -#define A_SENDAMOUNTS 0x7d -#define A_FXSENDAMOUNT_E_MASK 0xff000000 -#define A_FXSENDAMOUNT_F_MASK 0x00ff0000 -#define A_FXSENDAMOUNT_G_MASK 0x0000ff00 -#define A_FXSENDAMOUNT_H_MASK 0x000000ff - -/* The send amounts for this one are the same as used with the emu10k1 */ -#define A_FXRT1 0x7e -#define A_FXRT_CHANNELA 0x0000003f -#define A_FXRT_CHANNELB 0x00003f00 -#define A_FXRT_CHANNELC 0x003f0000 -#define A_FXRT_CHANNELD 0x3f000000 - - -/* Each FX general purpose register is 32 bits in length, all bits are used */ -#define FXGPREGBASE 0x100 /* FX general purpose registers base */ -#define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */ -/* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is */ -/* decompressed back to 20 bits on a read. There are a total of 160 locations, the last 32 */ -/* locations are for external TRAM. */ -#define TANKMEMDATAREGBASE 0x200 /* Tank memory data registers base */ -#define TANKMEMDATAREG_MASK 0x000fffff /* 20 bit tank audio data field */ - -/* Combined address field and memory opcode or flag field. 160 locations, last 32 are external */ -#define TANKMEMADDRREGBASE 0x300 /* Tank memory address registers base */ -#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */ -#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */ -#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */ -#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */ -#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */ - -#define MICROCODEBASE 0x400 /* Microcode data base address */ - -/* Each DSP microcode instruction is mapped into 2 doublewords */ -/* NOTE: When writing, always write the LO doubleword first. Reads can be in either order. */ -#define LOWORD_OPX_MASK 0x000ffc00 /* Instruction operand X */ -#define LOWORD_OPY_MASK 0x000003ff /* Instruction operand Y */ -#define HIWORD_OPCODE_MASK 0x00f00000 /* Instruction opcode */ -#define HIWORD_RESULT_MASK 0x000ffc00 /* Instruction result */ -#define HIWORD_OPA_MASK 0x000003ff /* Instruction operand A */ - - -/* Audigy Soundcard have a different instruction format */ -#define AUDIGY_CODEBASE 0x600 -#define A_LOWORD_OPY_MASK 0x000007ff -#define A_LOWORD_OPX_MASK 0x007ff000 -#define A_HIWORD_OPCODE_MASK 0x0f000000 -#define A_HIWORD_RESULT_MASK 0x007ff000 -#define A_HIWORD_OPA_MASK 0x000007ff - - -#endif /* _8010_H */ diff --git a/sound/oss/emu10k1/Makefile b/sound/oss/emu10k1/Makefile deleted file mode 100644 index b3af9ccb057..00000000000 --- a/sound/oss/emu10k1/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Makefile for Creative Labs EMU10K1 -# -# 12 Apr 2000 Rui Sousa - -obj-$(CONFIG_SOUND_EMU10K1) += emu10k1.o - -emu10k1-objs := audio.o cardmi.o cardmo.o cardwi.o cardwo.o ecard.o \ - efxmgr.o emuadxmg.o hwaccess.o irqmgr.o main.o midi.o \ - mixer.o passthrough.o recmgr.o timer.o voicemgr.o - -ifdef DEBUG - EXTRA_CFLAGS += -DEMU10K1_DEBUG -endif - -ifdef CONFIG_MIDI_EMU10K1 - EXTRA_CFLAGS += -DEMU10K1_SEQUENCER -endif diff --git a/sound/oss/emu10k1/audio.c b/sound/oss/emu10k1/audio.c deleted file mode 100644 index e75ea21eb81..00000000000 --- a/sound/oss/emu10k1/audio.c +++ /dev/null @@ -1,1595 +0,0 @@ -/* - ********************************************************************** - * audio.c -- /dev/dsp interface for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * November 2, 1999 Alan Cox cleaned up types/leaks - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include <linux/module.h> -#include <linux/poll.h> -#include <linux/slab.h> -#include <linux/bitops.h> -#include <asm/io.h> -#include <linux/sched.h> -#include <linux/mm.h> -#include <linux/smp_lock.h> - -#include "hwaccess.h" -#include "cardwo.h" -#include "cardwi.h" -#include "recmgr.h" -#include "irqmgr.h" -#include "audio.h" -#include "8010.h" - -static void calculate_ofrag(struct woinst *); -static void calculate_ifrag(struct wiinst *); - -static void emu10k1_waveout_bh(unsigned long refdata); -static void emu10k1_wavein_bh(unsigned long refdata); - -/* Audio file operations */ -static ssize_t emu10k1_audio_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos) -{ - struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data; - struct wiinst *wiinst = wave_dev->wiinst; - ssize_t ret = 0; - unsigned long flags; - - DPD(3, "emu10k1_audio_read(), buffer=%p, count=%d\n", buffer, (u32) count); - - if (!access_ok(VERIFY_WRITE, buffer, count)) - return -EFAULT; - - spin_lock_irqsave(&wiinst->lock, flags); - - if (wiinst->mmapped) { - spin_unlock_irqrestore(&wiinst->lock, flags); - return -ENXIO; - } - - if (wiinst->state == WAVE_STATE_CLOSED) { - calculate_ifrag(wiinst); - - while (emu10k1_wavein_open(wave_dev) < 0) { - spin_unlock_irqrestore(&wiinst->lock, flags); - - if (file->f_flags & O_NONBLOCK) - return -EAGAIN; - - interruptible_sleep_on(&wave_dev->card->open_wait); - - if (signal_pending(current)) - return -ERESTARTSYS; - - spin_lock_irqsave(&wiinst->lock, flags); - } - } - - spin_unlock_irqrestore(&wiinst->lock, flags); - - while (count > 0) { - u32 bytestocopy; - - spin_lock_irqsave(&wiinst->lock, flags); - - if (!(wiinst->state & WAVE_STATE_STARTED) - && (wave_dev->enablebits & PCM_ENABLE_INPUT)) - emu10k1_wavein_start(wave_dev); - - emu10k1_wavein_update(wave_dev->card, wiinst); - emu10k1_wavein_getxfersize(wiinst, &bytestocopy); - - spin_unlock_irqrestore(&wiinst->lock, flags); - - DPD(3, "bytestocopy --> %d\n", bytestocopy); - - if ((bytestocopy >= wiinst->buffer.fragment_size) - || (bytestocopy >= count)) { - int rc; - - bytestocopy = min_t(u32, bytestocopy, count); - - rc = emu10k1_wavein_xferdata(wiinst, - (u8 __user *)buffer, - &bytestocopy); - if (rc) - return rc; - - count -= bytestocopy; - buffer += bytestocopy; - ret += bytestocopy; - } - - if (count > 0) { - if ((file->f_flags & O_NONBLOCK) - || (!(wave_dev->enablebits & PCM_ENABLE_INPUT))) - return (ret ? ret : -EAGAIN); - - interruptible_sleep_on(&wiinst->wait_queue); - - if (signal_pending(current)) - return (ret ? ret : -ERESTARTSYS); - - } - } - - DPD(3, "bytes copied -> %d\n", (u32) ret); - - return ret; -} - -static ssize_t emu10k1_audio_write(struct file *file, const char __user *buffer, size_t count, loff_t * ppos) -{ - struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data; - struct woinst *woinst = wave_dev->woinst; - ssize_t ret; - unsigned long flags; - - DPD(3, "emu10k1_audio_write(), buffer=%p, count=%d\n", buffer, (u32) count); - - if (!access_ok(VERIFY_READ, buffer, count)) - return -EFAULT; - - spin_lock_irqsave(&woinst->lock, flags); - - if (woinst->mmapped) { - spin_unlock_irqrestore(&woinst->lock, flags); - return -ENXIO; - } - // This is for emu10k1 revs less than 7, we need to go through tram - if (woinst->format.passthrough == 1) { - int r; - - woinst->buffer.ossfragshift = PT_BLOCKSIZE_LOG2; - woinst->buffer.numfrags = PT_BLOCKCOUNT; - calculate_ofrag(woinst); - - r = emu10k1_pt_write(file, buffer, count); - spin_unlock_irqrestore(&woinst->lock, flags); - return r; - } - - if (woinst->state == WAVE_STATE_CLOSED) { - calculate_ofrag(woinst); - - while (emu10k1_waveout_open(wave_dev) < 0) { - spin_unlock_irqrestore(&woinst->lock, flags); - - if (file->f_flags & O_NONBLOCK) - return -EAGAIN; - - interruptible_sleep_on(&wave_dev->card->open_wait); - - if (signal_pending(current)) - return -ERESTARTSYS; - - spin_lock_irqsave(&woinst->lock, flags); - } - } - - spin_unlock_irqrestore(&woinst->lock, flags); - - ret = 0; - if (count % woinst->format.bytespersample) - return -EINVAL; - - count /= woinst->num_voices; - - while (count > 0) { - u32 bytestocopy; - - spin_lock_irqsave(&woinst->lock, flags); - emu10k1_waveout_update(woinst); - emu10k1_waveout_getxfersize(woinst, &bytestocopy); - spin_unlock_irqrestore(&woinst->lock, flags); - - DPD(3, "bytestocopy --> %d\n", bytestocopy); - - if ((bytestocopy >= woinst->buffer.fragment_size) - || (bytestocopy >= count)) { - - bytestocopy = min_t(u32, bytestocopy, count); - - emu10k1_waveout_xferdata(woinst, (u8 __user *) buffer, &bytestocopy); - - count -= bytestocopy; - buffer += bytestocopy * woinst->num_voices; - ret += bytestocopy * woinst->num_voices; - - spin_lock_irqsave(&woinst->lock, flags); - woinst->total_copied += bytestocopy; - - if (!(woinst->state & WAVE_STATE_STARTED) - && (wave_dev->enablebits & PCM_ENABLE_OUTPUT) - && (woinst->total_copied >= woinst->buffer.fragment_size)) - emu10k1_waveout_start(wave_dev); - - spin_unlock_irqrestore(&woinst->lock, flags); - } - - if (count > 0) { - if ((file->f_flags & O_NONBLOCK) - || (!(wave_dev->enablebits & PCM_ENABLE_OUTPUT))) - return (ret ? ret : -EAGAIN); - - interruptible_sleep_on(&woinst->wait_queue); - - if (signal_pending(current)) - return (ret ? ret : -ERESTARTSYS); - } - } - - DPD(3, "bytes copied -> %d\n", (u32) ret); - - return ret; -} - -static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) -{ - struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data; - struct woinst *woinst = NULL; - struct wiinst *wiinst = NULL; - int val = 0; - u32 bytestocopy; - unsigned long flags; - int __user *p = (int __user *)arg; - - DPF(4, "emu10k1_audio_ioctl()\n"); - - if (file->f_mode & FMODE_WRITE) - woinst = wave_dev->woinst; - - if (file->f_mode & FMODE_READ) - wiinst = wave_dev->wiinst; - - switch (cmd) { - case OSS_GETVERSION: - DPF(2, "OSS_GETVERSION:\n"); - return put_user(SOUND_VERSION, p); - - case SNDCTL_DSP_RESET: - DPF(2, "SNDCTL_DSP_RESET:\n"); - wave_dev->enablebits = PCM_ENABLE_OUTPUT | PCM_ENABLE_INPUT; - - if (file->f_mode & FMODE_WRITE) { - spin_lock_irqsave(&woinst->lock, flags); - - if (woinst->state & WAVE_STATE_OPEN) { - emu10k1_waveout_close(wave_dev); - } - - woinst->mmapped = 0; - woinst->total_copied = 0; - woinst->total_played = 0; - woinst->blocks = 0; - - spin_unlock_irqrestore(&woinst->lock, flags); - } - - if (file->f_mode & FMODE_READ) { - spin_lock_irqsave(&wiinst->lock, flags); - - if (wiinst->state & WAVE_STATE_OPEN) { - emu10k1_wavein_close(wave_dev); - } - - wiinst->mmapped = 0; - wiinst->total_recorded = 0; - wiinst->blocks = 0; - spin_unlock_irqrestore(&wiinst->lock, flags); - } - - break; - - case SNDCTL_DSP_SYNC: - DPF(2, "SNDCTL_DSP_SYNC:\n"); - - if (file->f_mode & FMODE_WRITE) { - - spin_lock_irqsave(&woinst->lock, flags); - - if (woinst->state & WAVE_STATE_OPEN) { - - if (woinst->state & WAVE_STATE_STARTED) - while ((woinst->total_played < woinst->total_copied) - && !signal_pending(current)) { - spin_unlock_irqrestore(&woinst->lock, flags); - interruptible_sleep_on(&woinst->wait_queue); - spin_lock_irqsave(&woinst->lock, flags); - } - emu10k1_waveout_close(wave_dev); - } - - woinst->mmapped = 0; - woinst->total_copied = 0; - woinst->total_played = 0; - woinst->blocks = 0; - - spin_unlock_irqrestore(&woinst->lock, flags); - } - - if (file->f_mode & FMODE_READ) { - spin_lock_irqsave(&wiinst->lock, flags); - - if (wiinst->state & WAVE_STATE_OPEN) { - emu10k1_wavein_close(wave_dev); - } - - wiinst->mmapped = 0; - wiinst->total_recorded = 0; - wiinst->blocks = 0; - spin_unlock_irqrestore(&wiinst->lock, flags); - } - - break; - - case SNDCTL_DSP_SETDUPLEX: - DPF(2, "SNDCTL_DSP_SETDUPLEX:\n"); - break; - - case SNDCTL_DSP_GETCAPS: - DPF(2, "SNDCTL_DSP_GETCAPS:\n"); - return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | - DSP_CAP_TRIGGER | DSP_CAP_MMAP | - DSP_CAP_COPROC| DSP_CAP_MULTI, p); - case SNDCTL_DSP_SPEED: - DPF(2, "SNDCTL_DSP_SPEED:\n"); - - if (get_user(val, p)) - return -EFAULT; - - DPD(2, "val is %d\n", val); - - if (val > 0) { - if (file->f_mode & FMODE_READ) { - struct wave_format format; - - spin_lock_irqsave(&wiinst->lock, flags); - - format = wiinst->format; - format.samplingrate = val; - - if (emu10k1_wavein_setformat(wave_dev, &format) < 0) { - spin_unlock_irqrestore(&wiinst->lock, flags); - return -EINVAL; - } - - val = wiinst->format.samplingrate; - - spin_unlock_irqrestore(&wiinst->lock, flags); - - DPD(2, "set recording sampling rate -> %d\n", val); - } - - if (file->f_mode & FMODE_WRITE) { - struct wave_format format; - - spin_lock_irqsave(&woinst->lock, flags); - - format = woinst->format; - format.samplingrate = val; - - if (emu10k1_waveout_setformat(wave_dev, &format) < 0) { - spin_unlock_irqrestore(&woinst->lock, flags); - return -EINVAL; - } - - val = woinst->format.samplingrate; - - spin_unlock_irqrestore(&woinst->lock, flags); - - DPD(2, "set playback sampling rate -> %d\n", val); - } - - return put_user(val, p); - } else { - if (file->f_mode & FMODE_READ) - val = wiinst->format.samplingrate; - else if (file->f_mode & FMODE_WRITE) - val = woinst->format.samplingrate; - - return put_user(val, p); - } - break; - - case SNDCTL_DSP_STEREO: - DPF(2, "SNDCTL_DSP_STEREO:\n"); - - if (get_user(val, p)) - return -EFAULT; - - DPD(2, " val is %d\n", val); - - if (file->f_mode & FMODE_READ) { - struct wave_format format; - - spin_lock_irqsave(&wiinst->lock, flags); - - format = wiinst->format; - format.channels = val ? 2 : 1; - - if (emu10k1_wavein_setformat(wave_dev, &format) < 0) { - spin_unlock_irqrestore(&wiinst->lock, flags); - return -EINVAL; - } - - val = wiinst->format.channels - 1; - - spin_unlock_irqrestore(&wiinst->lock, flags); - DPD(2, "set recording stereo -> %d\n", val); - } - - if (file->f_mode & FMODE_WRITE) { - struct wave_format format; - - spin_lock_irqsave(&woinst->lock, flags); - - format = woinst->format; - format.channels = val ? 2 : 1; - - if (emu10k1_waveout_setformat(wave_dev, &format) < 0) { - spin_unlock_irqrestore(&woinst->lock, flags); - return -EINVAL; - } - - val = woinst->format.channels - 1; - - spin_unlock_irqrestore(&woinst->lock, flags); - - DPD(2, "set playback stereo -> %d\n", val); - } - - return put_user(val, p); - - break; - - case SNDCTL_DSP_CHANNELS: - DPF(2, "SNDCTL_DSP_CHANNELS:\n"); - - if (get_user(val, p)) - return -EFAULT; - - DPD(2, " val is %d\n", val); - - if (val > 0) { - if (file->f_mode & FMODE_READ) { - struct wave_format format; - - spin_lock_irqsave(&wiinst->lock, flags); - - format = wiinst->format; - format.channels = val; - - if (emu10k1_wavein_setformat(wave_dev, &format) < 0) { - spin_unlock_irqrestore(&wiinst->lock, flags); - return -EINVAL; - } - val = wiinst->format.channels; - - spin_unlock_irqrestore(&wiinst->lock, flags); - DPD(2, "set recording number of channels -> %d\n", val); - } - - if (file->f_mode & FMODE_WRITE) { - struct wave_format format; - - spin_lock_irqsave(&woinst->lock, flags); - - format = woinst->format; - format.channels = val; - - if (emu10k1_waveout_setformat(wave_dev, &format) < 0) { - spin_unlock_irqrestore(&woinst->lock, flags); - return -EINVAL; - } - - val = woinst->format.channels; - - spin_unlock_irqrestore(&woinst->lock, flags); - DPD(2, "set playback number of channels -> %d\n", val); - } - - return put_user(val, p); - } else { - if (file->f_mode & FMODE_READ) - val = wiinst->format.channels; - else if (file->f_mode & FMODE_WRITE) - val = woinst->format.channels; - - return put_user(val, p); - } - break; - - case SNDCTL_DSP_GETFMTS: - DPF(2, "SNDCTL_DSP_GETFMTS:\n"); - - if (file->f_mode & FMODE_READ) - val = AFMT_S16_LE; - else if (file->f_mode & FMODE_WRITE) { - val = AFMT_S16_LE | AFMT_U8; - if (emu10k1_find_control_gpr(&wave_dev->card->mgr, - wave_dev->card->pt.patch_name, - wave_dev->card->pt.enable_gpr_name) >= 0) - val |= AFMT_AC3; - } - return put_user(val, p); - - case SNDCTL_DSP_SETFMT: /* Same as SNDCTL_DSP_SAMPLESIZE */ - DPF(2, "SNDCTL_DSP_SETFMT:\n"); - - if (get_user(val, p)) - return -EFAULT; - - DPD(2, " val is %d\n", val); - - if (val != AFMT_QUERY) { - if (file->f_mode & FMODE_READ) { - struct wave_format format; - - spin_lock_irqsave(&wiinst->lock, flags); - - format = wiinst->format; - format.id = val; - - if (emu10k1_wavein_setformat(wave_dev, &format) < 0) { - spin_unlock_irqrestore(&wiinst->lock, flags); - return -EINVAL; - } - - val = wiinst->format.id; - - spin_unlock_irqrestore(&wiinst->lock, flags); - DPD(2, "set recording format -> %d\n", val); - } - - if (file->f_mode & FMODE_WRITE) { - struct wave_format format; - - spin_lock_irqsave(&woinst->lock, flags); - - format = woinst->format; - format.id = val; - - if (emu10k1_waveout_setformat(wave_dev, &format) < 0) { - spin_unlock_irqrestore(&woinst->lock, flags); - return -EINVAL; - } - - val = woinst->format.id; - - spin_unlock_irqrestore(&woinst->lock, flags); - DPD(2, "set playback format -> %d\n", val); - } - - return put_user(val, p); - } else { - if (file->f_mode & FMODE_READ) - val = wiinst->format.id; - else if (file->f_mode & FMODE_WRITE) - val = woinst->format.id; - - return put_user(val, p); - } - break; - - case SOUND_PCM_READ_BITS: - - if (file->f_mode & FMODE_READ) - val = wiinst->format.bitsperchannel; - else if (file->f_mode & FMODE_WRITE) - val = woinst->format.bitsperchannel; - - return put_user(val, p); - - case SOUND_PCM_READ_RATE: - - if (file->f_mode & FMODE_READ) - val = wiinst->format.samplingrate; - else if (file->f_mode & FMODE_WRITE) - val = woinst->format.samplingrate; - - return put_user(val, p); - - case SOUND_PCM_READ_CHANNELS: - - if (file->f_mode & FMODE_READ) - val = wiinst->format.channels; - else if (file->f_mode & FMODE_WRITE) - val = woinst->format.channels; - - return put_user(val, p); - - case SOUND_PCM_WRITE_FILTER: - DPF(2, "SOUND_PCM_WRITE_FILTER: not implemented\n"); - break; - - case SOUND_PCM_READ_FILTER: - DPF(2, "SOUND_PCM_READ_FILTER: not implemented\n"); - break; - - case SNDCTL_DSP_SETSYNCRO: - DPF(2, "SNDCTL_DSP_SETSYNCRO: not implemented\n"); - break; - - case SNDCTL_DSP_GETTRIGGER: - DPF(2, "SNDCTL_DSP_GETTRIGGER:\n"); - - if (file->f_mode & FMODE_WRITE && (wave_dev->enablebits & PCM_ENABLE_OUTPUT)) - val |= PCM_ENABLE_OUTPUT; - - if (file->f_mode & FMODE_READ && (wave_dev->enablebits & PCM_ENABLE_INPUT)) - val |= PCM_ENABLE_INPUT; - - return put_user(val, p); - - case SNDCTL_DSP_SETTRIGGER: - DPF(2, "SNDCTL_DSP_SETTRIGGER:\n"); - - if (get_user(val, p)) - return -EFAULT; - - if (file->f_mode & FMODE_WRITE) { - spin_lock_irqsave(&woinst->lock, flags); - - if (val & PCM_ENABLE_OUTPUT) { - wave_dev->enablebits |= PCM_ENABLE_OUTPUT; - if (woinst->state & WAVE_STATE_OPEN) - emu10k1_waveout_start(wave_dev); - } else { - wave_dev->enablebits &= ~PCM_ENABLE_OUTPUT; - if (woinst->state & WAVE_STATE_STARTED) - emu10k1_waveout_stop(wave_dev); - } - - spin_unlock_irqrestore(&woinst->lock, flags); - } - - if (file->f_mode & FMODE_READ) { - spin_lock_irqsave(&wiinst->lock, flags); - - if (val & PCM_ENABLE_INPUT) { - wave_dev->enablebits |= PCM_ENABLE_INPUT; - if (wiinst->state & WAVE_STATE_OPEN) - emu10k1_wavein_start(wave_dev); - } else { - wave_dev->enablebits &= ~PCM_ENABLE_INPUT; - if (wiinst->state & WAVE_STATE_STARTED) - emu10k1_wavein_stop(wave_dev); - } - - spin_unlock_irqrestore(&wiinst->lock, flags); - } - break; - - case SNDCTL_DSP_GETOSPACE: - { - audio_buf_info info; - - DPF(4, "SNDCTL_DSP_GETOSPACE:\n"); - - if (!(file->f_mode & FMODE_WRITE)) - return -EINVAL; - - spin_lock_irqsave(&woinst->lock, flags); - - if (woinst->state & WAVE_STATE_OPEN) { - emu10k1_waveout_update(woinst); - emu10k1_waveout_getxfersize(woinst, &bytestocopy); - info.bytes = bytestocopy; - } else { - calculate_ofrag(woinst); - info.bytes = woinst->buffer.size; - } - spin_unlock_irqrestore(&woinst->lock, flags); - - info.bytes *= woinst->num_voices; - info.fragsize = woinst->buffer.fragment_size * woinst->num_voices; - info.fragstotal = woinst->buffer.numfrags * woinst->num_voices; - info.fragments = info.bytes / info.fragsize; - - if (copy_to_user(p, &info, sizeof(info))) - return -EFAULT; - } - break; - - case SNDCTL_DSP_GETISPACE: - { - audio_buf_info info; - - DPF(4, "SNDCTL_DSP_GETISPACE:\n"); - - if (!(file->f_mode & FMODE_READ)) - return -EINVAL; - - spin_lock_irqsave(&wiinst->lock, flags); - if (wiinst->state & WAVE_STATE_OPEN) { - emu10k1_wavein_update(wave_dev->card, wiinst); - emu10k1_wavein_getxfersize(wiinst, &bytestocopy); - info.bytes = bytestocopy; - } else { - calculate_ifrag(wiinst); - info.bytes = 0; - } - spin_unlock_irqrestore(&wiinst->lock, flags); - - info.fragstotal = wiinst->buffer.numfrags; - info.fragments = info.bytes / wiinst->buffer.fragment_size; - info.fragsize = wiinst->buffer.fragment_size; - - if (copy_to_user(p, &info, sizeof(info))) - return -EFAULT; - } - break; - - case SNDCTL_DSP_NONBLOCK: - DPF(2, "SNDCTL_DSP_NONBLOCK:\n"); - - file->f_flags |= O_NONBLOCK; - break; - - case SNDCTL_DSP_GETODELAY: - DPF(4, "SNDCTL_DSP_GETODELAY:\n"); - - if (!(file->f_mode & FMODE_WRITE)) - return -EINVAL; - - spin_lock_irqsave(&woinst->lock, flags); - if (woinst->state & WAVE_STATE_OPEN) { - emu10k1_waveout_update(woinst); - emu10k1_waveout_getxfersize(woinst, &bytestocopy); - val = woinst->buffer.size - bytestocopy; - } else - val = 0; - - val *= woinst->num_voices; - spin_unlock_irqrestore(&woinst->lock, flags); - - return put_user(val, p); - - case SNDCTL_DSP_GETIPTR: - { - count_info cinfo; - - DPF(4, "SNDCTL_DSP_GETIPTR: \n"); - - if (!(file->f_mode & FMODE_READ)) - return -EINVAL; - - spin_lock_irqsave(&wiinst->lock, flags); - - if (wiinst->state & WAVE_STATE_OPEN) { - emu10k1_wavein_update(wave_dev->card, wiinst); - cinfo.ptr = wiinst->buffer.hw_pos; - cinfo.bytes = cinfo.ptr + wiinst->total_recorded - wiinst->total_recorded % wiinst->buffer.size; - cinfo.blocks = cinfo.bytes / wiinst->buffer.fragment_size - wiinst->blocks; - wiinst->blocks = cinfo.bytes / wiinst->buffer.fragment_size; - } else { - cinfo.ptr = 0; - cinfo.bytes = 0; - cinfo.blocks = 0; - } - - if (wiinst->mmapped) - wiinst->buffer.bytestocopy %= wiinst->buffer.fragment_size; - - spin_unlock_irqrestore(&wiinst->lock, flags); - - if (copy_to_user(p, &cinfo, sizeof(cinfo))) - return -EFAULT; - } - break; - - case SNDCTL_DSP_GETOPTR: - { - count_info cinfo; - - DPF(4, "SNDCTL_DSP_GETOPTR:\n"); - - if (!(file->f_mode & FMODE_WRITE)) - return -EINVAL; - - spin_lock_irqsave(&woinst->lock, flags); - - if (woinst->state & WAVE_STATE_OPEN || - ((woinst->format.passthrough == 1) && wave_dev->card->pt.state)) { - int num_fragments; - - if (woinst->format.passthrough == 1) { - emu10k1_pt_waveout_update(wave_dev); - cinfo.bytes = woinst->total_played; - } else { - emu10k1_waveout_update(woinst); - cinfo.bytes = woinst->total_played; - } - - cinfo.ptr = woinst->buffer.hw_pos; - num_fragments = cinfo.bytes / woinst->buffer.fragment_size; - cinfo.blocks = num_fragments - woinst->blocks; - woinst->blocks = num_fragments; - - cinfo.bytes *= woinst->num_voices; - cinfo.ptr *= woinst->num_voices; - } else { - cinfo.ptr = 0; - cinfo.bytes = 0; - cinfo.blocks = 0; - } - - if (woinst->mmapped) - woinst->buffer.free_bytes %= woinst->buffer.fragment_size; - - spin_unlock_irqrestore(&woinst->lock, flags); - - if (copy_to_user(p, &cinfo, sizeof(cinfo))) - return -EFAULT; - } - break; - - case SNDCTL_DSP_GETBLKSIZE: - DPF(2, "SNDCTL_DSP_GETBLKSIZE:\n"); - - if (file->f_mode & FMODE_WRITE) { - spin_lock_irqsave(&woinst->lock, flags); - - calculate_ofrag(woinst); - val = woinst->buffer.fragment_size * woinst->num_voices; - - spin_unlock_irqrestore(&woinst->lock, flags); - } - - if (file->f_mode & FMODE_READ) { - spin_lock_irqsave(&wiinst->lock, flags); - - calculate_ifrag(wiinst); - val = wiinst->buffer.fragment_size; - - spin_unlock_irqrestore(&wiinst->lock, flags); - } - - return put_user(val, p); - - break; - - case SNDCTL_DSP_POST: - if (file->f_mode & FMODE_WRITE) { - spin_lock_irqsave(&woinst->lock, flags); - - if (!(woinst->state & WAVE_STATE_STARTED) - && (wave_dev->enablebits & PCM_ENABLE_OUTPUT) - && (woinst->total_copied > 0)) - emu10k1_waveout_start(wave_dev); - - spin_unlock_irqrestore(&woinst->lock, flags); - } - - break; - - case SNDCTL_DSP_SUBDIVIDE: - DPF(2, "SNDCTL_DSP_SUBDIVIDE: not implemented\n"); - break; - - case SNDCTL_DSP_SETFRAGMENT: - DPF(2, "SNDCTL_DSP_SETFRAGMENT:\n"); - - if (get_user(val, p)) - return -EFAULT; - - DPD(2, "val is %#x\n", val); - - if (val == 0) - return -EIO; - - if (file->f_mode & FMODE_WRITE) { - /* digital pass-through fragment count and size are fixed values */ - if (woinst->state & WAVE_STATE_OPEN || (woinst->format.passthrough == 1)) - return -EINVAL; /* too late to change */ - - woinst->buffer.ossfragshift = val & 0xffff; - woinst->buffer.numfrags = (val >> 16) & 0xffff; - } - - if (file->f_mode & FMODE_READ) { - if (wiinst->state & WAVE_STATE_OPEN) - return -EINVAL; /* too late to change */ - - wiinst->buffer.ossfragshift = val & 0xffff; - wiinst->buffer.numfrags = (val >> 16) & 0xffff; - } - - break; - - case SNDCTL_COPR_LOAD: - { - copr_buffer *buf; - u32 i; - - DPF(4, "SNDCTL_COPR_LOAD:\n"); - - buf = kmalloc(sizeof(copr_buffer), GFP_KERNEL); - if (!buf) - return -ENOMEM; - - if (copy_from_user(buf, p, sizeof(copr_buffer))) { - kfree (buf); - return -EFAULT; - } - - if ((buf->command != CMD_READ) && (buf->command != CMD_WRITE)) { - kfree (buf); - return -EINVAL; - } - - if (buf->command == CMD_WRITE) { - -#ifdef DBGEMU - if ((buf->offs < 0) || (buf->offs + buf->len > 0xe00) || (buf->len > 1000)) { -#else - if (((buf->offs < 0x100) || (buf->offs + buf->len > (wave_dev->card->is_audigy ? 0xe00 : 0x800)) || (buf->len > 1000) - ) && !( - //any register allowed raw access to users goes here: - (buf->offs == DBG || - buf->offs == A_DBG) - && (buf->len == 1))) { -#endif - kfree(buf); - return -EINVAL; - } - } else { - if ((buf->offs < 0) || (buf->offs + buf->len > 0xe00) || (buf->len > 1000)) { - kfree(buf); - return -EINVAL; - } - } - - if (((unsigned)buf->flags) > 0x3f) - buf->flags = 0; - - if (buf->command == CMD_READ) { - for (i = 0; i < buf->len; i++) - ((u32 *) buf->data)[i] = sblive_readptr(wave_dev->card, buf->offs + i, buf->flags); - - if (copy_to_user(p, buf, sizeof(copr_buffer))) { - kfree(buf); - return -EFAULT; - } - } else { - for (i = 0; i < buf->len; i++) - sblive_writeptr(wave_dev->card, buf->offs + i, buf->flags, ((u32 *) buf->data)[i]); - } - - kfree (buf); - break; - } - - default: /* Default is unrecognized command */ - DPD(2, "default: %#x\n", cmd); - return -EINVAL; - } - return 0; -} - -static struct page *emu10k1_mm_nopage (struct vm_area_struct * vma, unsigned long address, int *type) -{ - struct emu10k1_wavedevice *wave_dev = vma->vm_private_data; - struct woinst *woinst = wave_dev->woinst; - struct wiinst *wiinst = wave_dev->wiinst; - struct page *dmapage; - unsigned long pgoff; - int rd, wr; - - DPF(3, "emu10k1_mm_nopage()\n"); - DPD(3, "addr: %#lx\n", address); - - if (address > vma->vm_end) { - DPF(1, "EXIT, returning NOPAGE_SIGBUS\n"); - return NOPAGE_SIGBUS; /* Disallow mremap */ - } - - pgoff = vma->vm_pgoff + ((address - vma->vm_start) >> PAGE_SHIFT); - if (woinst != NULL) - wr = woinst->mmapped; - else - wr = 0; - - if (wiinst != NULL) - rd = wiinst->mmapped; - else - rd = 0; - - /* if full-duplex (read+write) and we have two sets of bufs, - * then the playback buffers come first, sez soundcard.c */ - if (wr) { - if (pgoff >= woinst->buffer.pages) { - pgoff -= woinst->buffer.pages; - dmapage = virt_to_page ((u8 *) wiinst->buffer.addr + pgoff * PAGE_SIZE); - } else - dmapage = virt_to_page (woinst->voice[0].mem.addr[pgoff]); - } else { - dmapage = virt_to_page ((u8 *) wiinst->buffer.addr + pgoff * PAGE_SIZE); - } - - get_page (dmapage); - - DPD(3, "page: %#lx\n", (unsigned long) dmapage); - if (type) - *type = VM_FAULT_MINOR; - return dmapage; -} - -static struct vm_operations_struct emu10k1_mm_ops = { - .nopage = emu10k1_mm_nopage, -}; - -static int emu10k1_audio_mmap(struct file *file, struct vm_area_struct *vma) -{ - struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data; - unsigned long max_pages, n_pages, pgoffset; - struct woinst *woinst = NULL; - struct wiinst *wiinst = NULL; - unsigned long flags; - - DPF(2, "emu10k1_audio_mmap()\n"); - - max_pages = 0; - if (vma->vm_flags & VM_WRITE) { - woinst = wave_dev->woinst; - - spin_lock_irqsave(&woinst->lock, flags); - - /* No m'mapping possible for multichannel */ - if (woinst->num_voices > 1) { - spin_unlock_irqrestore(&woinst->lock, flags); - return -EINVAL; - } - - if (woinst->state == WAVE_STATE_CLOSED) { - calculate_ofrag(woinst); - - if (emu10k1_waveout_open(wave_dev) < 0) { - spin_unlock_irqrestore(&woinst->lock, flags); - ERROR(); - return -EINVAL; - } - } - - woinst->mmapped = 1; - max_pages += woinst->buffer.pages; - spin_unlock_irqrestore(&woinst->lock, flags); - } - - if (vma->vm_flags & VM_READ) { - wiinst = wave_dev->wiinst; - - spin_lock_irqsave(&wiinst->lock, flags); - if (wiinst->state == WAVE_STATE_CLOSED) { - calculate_ifrag(wiinst); - - if (emu10k1_wavein_open(wave_dev) < 0) { - spin_unlock_irqrestore(&wiinst->lock, flags); - ERROR(); - return -EINVAL; - } - } - - wiinst->mmapped = 1; - max_pages += wiinst->buffer.pages; - spin_unlock_irqrestore(&wiinst->lock, flags); - } - - n_pages = ((vma->vm_end - vma->vm_start) + PAGE_SIZE - 1) >> PAGE_SHIFT; - pgoffset = vma->vm_pgoff; - - DPD(2, "vma_start: %#lx, vma_end: %#lx, vma_offset: %ld\n", vma->vm_start, vma->vm_end, pgoffset); - DPD(2, "n_pages: %ld, max_pages: %ld\n", n_pages, max_pages); - - if (pgoffset + n_pages > max_pages) - return -EINVAL; - - vma->vm_flags |= VM_RESERVED; - vma->vm_ops = &emu10k1_mm_ops; - vma->vm_private_data = wave_dev; - return 0; -} - -static int emu10k1_audio_open(struct inode *inode, struct file *file) -{ - int minor = iminor(inode); - struct emu10k1_card *card = NULL; - struct list_head *entry; - struct emu10k1_wavedevice *wave_dev; - - DPF(2, "emu10k1_audio_open()\n"); - - /* Check for correct device to open */ - - list_for_each(entry, &emu10k1_devs) { - card = list_entry(entry, struct emu10k1_card, list); - - if (!((card->audio_dev ^ minor) & ~0xf) || !((card->audio_dev1 ^ minor) & ~0xf)) - goto match; - } - - return -ENODEV; - -match: - - wave_dev = kmalloc(sizeof(struct emu10k1_wavedevice), GFP_KERNEL); - - if (wave_dev == NULL) { - ERROR(); - return -ENOMEM; - } - - wave_dev->card = card; - wave_dev->wiinst = NULL; - wave_dev->woinst = NULL; - wave_dev->enablebits = PCM_ENABLE_OUTPUT | PCM_ENABLE_INPUT; /* Default */ - - if (file->f_mode & FMODE_READ) { - /* Recording */ - struct wiinst *wiinst; - - if ((wiinst = kmalloc(sizeof(struct wiinst), GFP_KERNEL)) == NULL) { - ERROR(); - kfree(wave_dev); - return -ENOMEM; - } - - wiinst->recsrc = card->wavein.recsrc; - wiinst->fxwc = card->wavein.fxwc; - - switch (wiinst->recsrc) { - case WAVERECORD_AC97: - wiinst->format.id = AFMT_S16_LE; - wiinst->format.samplingrate = 8000; - wiinst->format.bitsperchannel = 16; - wiinst->format.channels = 1; - break; - case WAVERECORD_MIC: - wiinst->format.id = AFMT_S16_LE; - wiinst->format.samplingrate = 8000; - wiinst->format.bitsperchannel = 16; - wiinst->format.channels = 1; - break; - case WAVERECORD_FX: - wiinst->format.id = AFMT_S16_LE; - wiinst->format.samplingrate = 48000; - wiinst->format.bitsperchannel = 16; - wiinst->format.channels = hweight32(wiinst->fxwc); - break; - default: - kfree(wave_dev); - kfree(wiinst); - BUG(); - break; - } - - wiinst->state = WAVE_STATE_CLOSED; - - wiinst->buffer.ossfragshift = 0; - wiinst->buffer.fragment_size = 0; - wiinst->buffer.numfrags = 0; - - init_waitqueue_head(&wiinst->wait_queue); - - wiinst->mmapped = 0; - wiinst->total_recorded = 0; - wiinst->blocks = 0; - spin_lock_init(&wiinst->lock); - tasklet_init(&wiinst->timer.tasklet, emu10k1_wavein_bh, (unsigned long) wave_dev); - wave_dev->wiinst = wiinst; - emu10k1_wavein_setformat(wave_dev, &wiinst->format); - } - - if (file->f_mode & FMODE_WRITE) { - struct woinst *woinst; - int i; - - if ((woinst = kmalloc(sizeof(struct woinst), GFP_KERNEL)) == NULL) { - ERROR(); - kfree(wave_dev); - return -ENOMEM; - } - - if (wave_dev->wiinst != NULL) { - woinst->format = wave_dev->wiinst->format; - } else { - woinst->format.id = AFMT_U8; - woinst->format.samplingrate = 8000; - woinst->format.bitsperchannel = 8; - woinst->format.channels = 1; - } - - woinst->state = WAVE_STATE_CLOSED; - - woinst->buffer.fragment_size = 0; - woinst->buffer.ossfragshift = 0; - woinst->buffer.numfrags = 0; - woinst->device = (card->audio_dev1 == minor); - woinst->timer.state = TIMER_STATE_UNINSTALLED; - woinst->num_voices = 1; - for (i = 0; i < WAVEOUT_MAXVOICES; i++) { - woinst->voice[i].usage = VOICE_USAGE_FREE; - woinst->voice[i].mem.emupageindex = -1; - } - - init_waitqueue_head(&woinst->wait_queue); - - woinst->mmapped = 0; - woinst->total_copied = 0; - woinst->total_played = 0; - woinst->blocks = 0; - spin_lock_init(&woinst->lock); - tasklet_init(&woinst->timer.tasklet, emu10k1_waveout_bh, (unsigned long) wave_dev); - wave_dev->woinst = woinst; - emu10k1_waveout_setformat(wave_dev, &woinst->format); - } - - file->private_data = (void *) wave_dev; - - return nonseekable_open(inode, file); -} - -static int emu10k1_audio_release(struct inode *inode, struct file *file) -{ - struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data; - struct emu10k1_card *card; - unsigned long flags; - - card = wave_dev->card; - - DPF(2, "emu10k1_audio_release()\n"); - - if (file->f_mode & FMODE_WRITE) { - struct woinst *woinst = wave_dev->woinst; - - spin_lock_irqsave(&woinst->lock, flags); - if(woinst->format.passthrough==2) - card->pt.state=PT_STATE_PLAYING; - if (woinst->format.passthrough && card->pt.state != PT_STATE_INACTIVE){ - spin_lock(&card->pt.lock); - emu10k1_pt_stop(card); - spin_unlock(&card->pt.lock); - } - if (woinst->state & WAVE_STATE_OPEN) { - if (woinst->state & WAVE_STATE_STARTED) { - if (!(file->f_flags & O_NONBLOCK)) { - while (!signal_pending(current) - && (woinst->total_played < woinst->total_copied)) { - DPF(4, "Buffer hasn't been totally played, sleep....\n"); - spin_unlock_irqrestore(&woinst->lock, flags); - interruptible_sleep_on(&woinst->wait_queue); - spin_lock_irqsave(&woinst->lock, flags); - } - } - } - emu10k1_waveout_close(wave_dev); - } - - spin_unlock_irqrestore(&woinst->lock, flags); - /* remove the tasklet */ - tasklet_kill(&woinst->timer.tasklet); - kfree(wave_dev->woinst); - } - - if (file->f_mode & FMODE_READ) { - struct wiinst *wiinst = wave_dev->wiinst; - - spin_lock_irqsave(&wiinst->lock, flags); - - if (wiinst->state & WAVE_STATE_OPEN) { - emu10k1_wavein_close(wave_dev); - } - - spin_unlock_irqrestore(&wiinst->lock, flags); - tasklet_kill(&wiinst->timer.tasklet); - kfree(wave_dev->wiinst); - } - - kfree(wave_dev); - - if (waitqueue_active(&card->open_wait)) - wake_up_interruptible(&card->open_wait); - - return 0; -} - -/* FIXME sort out poll() + mmap() */ -static unsigned int emu10k1_audio_poll(struct file *file, struct poll_table_struct *wait) -{ - struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data; - struct woinst *woinst = wave_dev->woinst; - struct wiinst *wiinst = wave_dev->wiinst; - unsigned int mask = 0; - u32 bytestocopy; - unsigned long flags; - - DPF(4, "emu10k1_audio_poll()\n"); - - if (file->f_mode & FMODE_WRITE) - poll_wait(file, &woinst->wait_queue, wait); - - if (file->f_mode & FMODE_READ) - poll_wait(file, &wiinst->wait_queue, wait); - - if (file->f_mode & FMODE_WRITE) { - spin_lock_irqsave(&woinst->lock, flags); - - if (woinst->state & WAVE_STATE_OPEN) { - emu10k1_waveout_update(woinst); - emu10k1_waveout_getxfersize(woinst, &bytestocopy); - - if (bytestocopy >= woinst->buffer.fragment_size) - mask |= POLLOUT | POLLWRNORM; - } else - mask |= POLLOUT | POLLWRNORM; - - spin_unlock_irqrestore(&woinst->lock, flags); - } - - if (file->f_mode & FMODE_READ) { - spin_lock_irqsave(&wiinst->lock, flags); - - if (wiinst->state & WAVE_STATE_OPEN) { - emu10k1_wavein_update(wave_dev->card, wiinst); - emu10k1_wavein_getxfersize(wiinst, &bytestocopy); - - if (bytestocopy >= wiinst->buffer.fragment_size) - mask |= POLLIN | POLLRDNORM; - } - - spin_unlock_irqrestore(&wiinst->lock, flags); - } - - return mask; -} - -static void calculate_ofrag(struct woinst *woinst) -{ - struct waveout_buffer *buffer = &woinst->buffer; - u32 fragsize; - - if (buffer->fragment_size) - return; - - if (!buffer->ossfragshift) { - fragsize = (woinst->format.bytespervoicesample * woinst->format.samplingrate * WAVEOUT_DEFAULTFRAGLEN) / 1000 - 1; - - while (fragsize) { - fragsize >>= 1; - buffer->ossfragshift++; - } - } - - if (buffer->ossfragshift < WAVEOUT_MINFRAGSHIFT) - buffer->ossfragshift = WAVEOUT_MINFRAGSHIFT; - - buffer->fragment_size = 1 << buffer->ossfragshift; - - while (buffer->fragment_size * WAVEOUT_MINFRAGS > WAVEOUT_MAXBUFSIZE) - buffer->fragment_size >>= 1; - - /* now we are sure that: - (2^WAVEOUT_MINFRAGSHIFT) <= (fragment_size = 2^n) <= (WAVEOUT_MAXBUFSIZE / WAVEOUT_MINFRAGS) - */ - - if (!buffer->numfrags) { - u32 numfrags; - - numfrags = (woinst->format.bytespervoicesample * woinst->format.samplingrate * WAVEOUT_DEFAULTBUFLEN) / - (buffer->fragment_size * 1000) - 1; - - buffer->numfrags = 1; - - while (numfrags) { - numfrags >>= 1; - buffer->numfrags <<= 1; - } - } - - if (buffer->numfrags < WAVEOUT_MINFRAGS) - buffer->numfrags = WAVEOUT_MINFRAGS; - - if (buffer->numfrags * buffer->fragment_size > WAVEOUT_MAXBUFSIZE) - buffer->numfrags = WAVEOUT_MAXBUFSIZE / buffer->fragment_size; - - if (buffer->numfrags < WAVEOUT_MINFRAGS) - BUG(); - - buffer->size = buffer->fragment_size * buffer->numfrags; - buffer->pages = buffer->size / PAGE_SIZE + ((buffer->size % PAGE_SIZE) ? 1 : 0); - - DPD(2, " calculated playback fragment_size -> %d\n", buffer->fragment_size); - DPD(2, " calculated playback numfrags -> %d\n", buffer->numfrags); - - return; -} - -static void calculate_ifrag(struct wiinst *wiinst) -{ - struct wavein_buffer *buffer = &wiinst->buffer; - u32 fragsize, bufsize, size[4]; - int i, j; - - if (buffer->fragment_size) - return; - - if (!buffer->ossfragshift) { - fragsize = (wiinst->format.bytespersec * WAVEIN_DEFAULTFRAGLEN) / 1000 - 1; - - while (fragsize) { - fragsize >>= 1; - buffer->ossfragshift++; - } - } - - if (buffer->ossfragshift < WAVEIN_MINFRAGSHIFT) - buffer->ossfragshift = WAVEIN_MINFRAGSHIFT; - - buffer->fragment_size = 1 << buffer->ossfragshift; - - while (buffer->fragment_size * WAVEIN_MINFRAGS > WAVEIN_MAXBUFSIZE) - buffer->fragment_size >>= 1; - - /* now we are sure that: - (2^WAVEIN_MINFRAGSHIFT) <= (fragment_size = 2^n) <= (WAVEIN_MAXBUFSIZE / WAVEIN_MINFRAGS) - */ - - - if (!buffer->numfrags) - buffer->numfrags = (wiinst->format.bytespersec * WAVEIN_DEFAULTBUFLEN) / (buffer->fragment_size * 1000) - 1; - - if (buffer->numfrags < WAVEIN_MINFRAGS) - buffer->numfrags = WAVEIN_MINFRAGS; - - if (buffer->numfrags * buffer->fragment_size > WAVEIN_MAXBUFSIZE) - buffer->numfrags = WAVEIN_MAXBUFSIZE / buffer->fragment_size; - - if (buffer->numfrags < WAVEIN_MINFRAGS) - BUG(); - - bufsize = buffer->fragment_size * buffer->numfrags; - - /* the buffer size for recording is restricted to certain values, adjust it now */ - if (bufsize >= 0x10000) { - buffer->size = 0x10000; - buffer->sizeregval = 0x1f; - } else { - buffer->size = 0; - size[0] = 384; - size[1] = 448; - size[2] = 512; - size[3] = 640; - - for (i = 0; i < 8; i++) - for (j = 0; j < 4; j++) - if (bufsize >= size[j]) { - buffer->size = size[j]; - size[j] *= 2; - buffer->sizeregval = i * 4 + j + 1; - } else - goto exitloop; - exitloop: - if (buffer->size == 0) { - buffer->size = 384; - buffer->sizeregval = 0x01; - } - } - - /* adjust the fragment size so that buffer size is an integer multiple */ - while (buffer->size % buffer->fragment_size) - buffer->fragment_size >>= 1; - - buffer->numfrags = buffer->size / buffer->fragment_size; - buffer->pages = buffer->size / PAGE_SIZE + ((buffer->size % PAGE_SIZE) ? 1 : 0); - - DPD(2, " calculated recording fragment_size -> %d\n", buffer->fragment_size); - DPD(2, " calculated recording numfrags -> %d\n", buffer->numfrags); - DPD(2, " buffer size register -> %#04x\n", buffer->sizeregval); - - return; -} - -static void emu10k1_wavein_bh(unsigned long refdata) -{ - struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) refdata; - struct wiinst *wiinst = wave_dev->wiinst; - u32 bytestocopy; - unsigned long flags; - - if (!wiinst) - return; - - spin_lock_irqsave(&wiinst->lock, flags); - - if (!(wiinst->state & WAVE_STATE_STARTED)) { - spin_unlock_irqrestore(&wiinst->lock, flags); - return; - } - - emu10k1_wavein_update(wave_dev->card, wiinst); - emu10k1_wavein_getxfersize(wiinst, &bytestocopy); - - spin_unlock_irqrestore(&wiinst->lock, flags); - - if (bytestocopy >= wiinst->buffer.fragment_size) { - if (waitqueue_active(&wiinst->wait_queue)) - wake_up_interruptible(&wiinst->wait_queue); - } else - DPD(3, "Not enough transfer size, %d\n", bytestocopy); - - return; -} - -static void emu10k1_waveout_bh(unsigned long refdata) -{ - struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) refdata; - struct woinst *woinst = wave_dev->woinst; - u32 bytestocopy; - unsigned long flags; - - if (!woinst) - return; - - spin_lock_irqsave(&woinst->lock, flags); - - if (!(woinst->state & WAVE_STATE_STARTED)) { - spin_unlock_irqrestore(&woinst->lock, flags); - return; - } - - emu10k1_waveout_update(woinst); - emu10k1_waveout_getxfersize(woinst, &bytestocopy); - - if (woinst->buffer.fill_silence) { - spin_unlock_irqrestore(&woinst->lock, flags); - emu10k1_waveout_fillsilence(woinst); - } else - spin_unlock_irqrestore(&woinst->lock, flags); - - if (bytestocopy >= woinst->buffer.fragment_size) { - if (waitqueue_active(&woinst->wait_queue)) - wake_up_interruptible(&woinst->wait_queue); - } else - DPD(3, "Not enough transfer size -> %d\n", bytestocopy); - - return; -} - -const struct file_operations emu10k1_audio_fops = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .read = emu10k1_audio_read, - .write = emu10k1_audio_write, - .poll = emu10k1_audio_poll, - .ioctl = emu10k1_audio_ioctl, - .mmap = emu10k1_audio_mmap, - .open = emu10k1_audio_open, - .release = emu10k1_audio_release, -}; diff --git a/sound/oss/emu10k1/audio.h b/sound/oss/emu10k1/audio.h deleted file mode 100644 index 26ee81bbd6c..00000000000 --- a/sound/oss/emu10k1/audio.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - ********************************************************************** - * audio.c -- /dev/dsp interface for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * November 2, 1999 Alan Cox cleaned up types/leaks - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _AUDIO_H -#define _AUDIO_H - -struct emu10k1_wavedevice -{ - struct emu10k1_card *card; - struct wiinst *wiinst; - struct woinst *woinst; - u16 enablebits; -}; - -#endif /* _AUDIO_H */ diff --git a/sound/oss/emu10k1/cardmi.c b/sound/oss/emu10k1/cardmi.c deleted file mode 100644 index 57674f8c8a2..00000000000 --- a/sound/oss/emu10k1/cardmi.c +++ /dev/null @@ -1,832 +0,0 @@ -/* - ********************************************************************** - * sblive_mi.c - MIDI UART input HAL for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * November 2, 1999 Alan Cox clean up - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include <linux/slab.h> -#include <linux/jiffies.h> - -#include "hwaccess.h" -#include "8010.h" -#include "cardmi.h" -#include "irqmgr.h" - - -static int emu10k1_mpuin_callback(struct emu10k1_mpuin *card_mpuin, u32 msg, unsigned long data, u32 bytesvalid); - -static int sblive_miStateInit(struct emu10k1_mpuin *); -static int sblive_miStateEntry(struct emu10k1_mpuin *, u8); -static int sblive_miStateParse(struct emu10k1_mpuin *, u8); -static int sblive_miState3Byte(struct emu10k1_mpuin *, u8); -static int sblive_miState3ByteKey(struct emu10k1_mpuin *, u8); -static int sblive_miState3ByteVel(struct emu10k1_mpuin *, u8); -static int sblive_miState2Byte(struct emu10k1_mpuin *, u8); -static int sblive_miState2ByteKey(struct emu10k1_mpuin *, u8); -static int sblive_miStateSysCommon2(struct emu10k1_mpuin *, u8); -static int sblive_miStateSysCommon2Key(struct emu10k1_mpuin *, u8); -static int sblive_miStateSysCommon3(struct emu10k1_mpuin *, u8); -static int sblive_miStateSysCommon3Key(struct emu10k1_mpuin *, u8); -static int sblive_miStateSysCommon3Vel(struct emu10k1_mpuin *, u8); -static int sblive_miStateSysExNorm(struct emu10k1_mpuin *, u8); -static int sblive_miStateSysReal(struct emu10k1_mpuin *, u8); - - -static struct { - int (*Fn) (struct emu10k1_mpuin *, u8); -} midistatefn[] = { - - { - sblive_miStateParse}, { - sblive_miState3Byte}, /* 0x8n, 0x9n, 0xAn, 0xBn, 0xEn */ - { - sblive_miState3ByteKey}, /* Byte 1 */ - { - sblive_miState3ByteVel}, /* Byte 2 */ - { - sblive_miState2Byte}, /* 0xCn, 0xDn */ - { - sblive_miState2ByteKey}, /* Byte 1 */ - { - sblive_miStateSysCommon2}, /* 0xF1 , 0xF3 */ - { - sblive_miStateSysCommon2Key}, /* 0xF1 , 0xF3, Byte 1 */ - { - sblive_miStateSysCommon3}, /* 0xF2 */ - { - sblive_miStateSysCommon3Key}, /* 0xF2 , Byte 1 */ - { - sblive_miStateSysCommon3Vel}, /* 0xF2 , Byte 2 */ - { - sblive_miStateSysExNorm}, /* 0xF0, 0xF7, Normal mode */ - { - sblive_miStateSysReal} /* 0xF4 - 0xF6 ,0xF8 - 0xFF */ -}; - - -/* Installs the IRQ handler for the MPU in port */ - -/* and initialize parameters */ - -int emu10k1_mpuin_open(struct emu10k1_card *card, struct midi_openinfo *openinfo) -{ - struct emu10k1_mpuin *card_mpuin = card->mpuin; - - DPF(2, "emu10k1_mpuin_open\n"); - - if (!(card_mpuin->status & FLAGS_AVAILABLE)) - return -1; - - /* Copy open info and mark channel as in use */ - card_mpuin->openinfo = *openinfo; - card_mpuin->status &= ~FLAGS_AVAILABLE; /* clear */ - card_mpuin->status |= FLAGS_READY; /* set */ - card_mpuin->status &= ~FLAGS_MIDM_STARTED; /* clear */ - card_mpuin->firstmidiq = NULL; - card_mpuin->lastmidiq = NULL; - card_mpuin->qhead = 0; - card_mpuin->qtail = 0; - - sblive_miStateInit(card_mpuin); - - emu10k1_mpu_reset(card); - emu10k1_mpu_acquire(card); - - return 0; -} - -int emu10k1_mpuin_close(struct emu10k1_card *card) -{ - struct emu10k1_mpuin *card_mpuin = card->mpuin; - - DPF(2, "emu10k1_mpuin_close()\n"); - - /* Check if there are pending input SysEx buffers */ - if (card_mpuin->firstmidiq != NULL) { - ERROR(); - return -1; - } - - /* Disable RX interrupt */ - emu10k1_irq_disable(card, card->is_audigy ? A_INTE_MIDIRXENABLE : INTE_MIDIRXENABLE); - - emu10k1_mpu_release(card); - - card_mpuin->status |= FLAGS_AVAILABLE; /* set */ - card_mpuin->status &= ~FLAGS_MIDM_STARTED; /* clear */ - - return 0; -} - -/* Adds MIDI buffer to local queue list */ - -int emu10k1_mpuin_add_buffer(struct emu10k1_mpuin *card_mpuin, struct midi_hdr *midihdr) -{ - struct midi_queue *midiq; - unsigned long flags; - - DPF(2, "emu10k1_mpuin_add_buffer()\n"); - - /* Update MIDI buffer flags */ - midihdr->flags |= MIDIBUF_INQUEUE; /* set */ - midihdr->flags &= ~MIDIBUF_DONE; /* clear */ - - if ((midiq = kmalloc(sizeof(struct midi_queue), GFP_ATOMIC)) == NULL) { - /* Message lost */ - return -1; - } - - midiq->next = NULL; - midiq->qtype = 1; - midiq->length = midihdr->bufferlength; - midiq->sizeLeft = midihdr->bufferlength; - midiq->midibyte = midihdr->data; - midiq->refdata = (unsigned long) midihdr; - - spin_lock_irqsave(&card_mpuin->lock, flags); - - if (card_mpuin->firstmidiq == NULL) { - card_mpuin->firstmidiq = midiq; - card_mpuin->lastmidiq = midiq; - } else { - (card_mpuin->lastmidiq)->next = midiq; - card_mpuin->lastmidiq = midiq; - } - - spin_unlock_irqrestore(&card_mpuin->lock, flags); - - return 0; -} - -/* First set the Time Stamp if MIDI IN has not started. */ - -/* Then enable RX Irq. */ - -int emu10k1_mpuin_start(struct emu10k1_card *card) -{ - struct emu10k1_mpuin *card_mpuin = card->mpuin; - u8 dummy; - - DPF(2, "emu10k1_mpuin_start()\n"); - - /* Set timestamp if not set */ - if (card_mpuin->status & FLAGS_MIDM_STARTED) { - DPF(2, "Time Stamp not changed\n"); - } else { - while (!emu10k1_mpu_read_data(card, &dummy)); - - card_mpuin->status |= FLAGS_MIDM_STARTED; /* set */ - - /* Set new time stamp */ - card_mpuin->timestart = (jiffies * 1000) / HZ; - DPD(2, "New Time Stamp = %d\n", card_mpuin->timestart); - - card_mpuin->qhead = 0; - card_mpuin->qtail = 0; - - emu10k1_irq_enable(card, card->is_audigy ? A_INTE_MIDIRXENABLE : INTE_MIDIRXENABLE); - } - - return 0; -} - -/* Disable the RX Irq. If a partial recorded buffer */ - -/* exist, send it up to IMIDI level. */ - -int emu10k1_mpuin_stop(struct emu10k1_card *card) -{ - struct emu10k1_mpuin *card_mpuin = card->mpuin; - struct midi_queue *midiq; - unsigned long flags; - - DPF(2, "emu10k1_mpuin_stop()\n"); - - emu10k1_irq_disable(card, card->is_audigy ? A_INTE_MIDIRXENABLE : INTE_MIDIRXENABLE); - - card_mpuin->status &= ~FLAGS_MIDM_STARTED; /* clear */ - - if (card_mpuin->firstmidiq) { - spin_lock_irqsave(&card_mpuin->lock, flags); - - midiq = card_mpuin->firstmidiq; - if (midiq != NULL) { - if (midiq->sizeLeft == midiq->length) - midiq = NULL; - else { - card_mpuin->firstmidiq = midiq->next; - if (card_mpuin->firstmidiq == NULL) - card_mpuin->lastmidiq = NULL; - } - } - - spin_unlock_irqrestore(&card_mpuin->lock, flags); - - if (midiq) { - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGERROR, (unsigned long) midiq, 0); - kfree(midiq); - } - } - - return 0; -} - -/* Disable the RX Irq. If any buffer */ - -/* exist, send it up to IMIDI level. */ -int emu10k1_mpuin_reset(struct emu10k1_card *card) -{ - struct emu10k1_mpuin *card_mpuin = card->mpuin; - struct midi_queue *midiq; - - DPF(2, "emu10k1_mpuin_reset()\n"); - - emu10k1_irq_disable(card, card->is_audigy ? A_INTE_MIDIRXENABLE : INTE_MIDIRXENABLE); - - while (card_mpuin->firstmidiq) { - midiq = card_mpuin->firstmidiq; - card_mpuin->firstmidiq = midiq->next; - - if (midiq->sizeLeft == midiq->length) - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGDATA, (unsigned long) midiq, 0); - else - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGERROR, (unsigned long) midiq, 0); - - kfree(midiq); - } - - card_mpuin->lastmidiq = NULL; - card_mpuin->status &= ~FLAGS_MIDM_STARTED; - - return 0; -} - -/* Passes the message with the data back to the client */ - -/* via IRQ & DPC callbacks to Ring 3 */ -static int emu10k1_mpuin_callback(struct emu10k1_mpuin *card_mpuin, u32 msg, unsigned long data, u32 bytesvalid) -{ - unsigned long timein; - struct midi_queue *midiq; - unsigned long callback_msg[3]; - struct midi_hdr *midihdr; - - /* Called during ISR. The data & code touched are: - * 1. card_mpuin - * 2. The function to be called - */ - - timein = card_mpuin->timein; - if (card_mpuin->timestart <= timein) - callback_msg[0] = timein - card_mpuin->timestart; - else - callback_msg[0] = (~0x0L - card_mpuin->timestart) + timein; - - if (msg == ICARDMIDI_INDATA || msg == ICARDMIDI_INDATAERROR) { - callback_msg[1] = data; - callback_msg[2] = bytesvalid; - DPD(2, "emu10k1_mpuin_callback: midimsg = %#lx\n", data); - } else { - midiq = (struct midi_queue *) data; - midihdr = (struct midi_hdr *) midiq->refdata; - - callback_msg[1] = midiq->length - midiq->sizeLeft; - callback_msg[2] = midiq->refdata; - midihdr->flags &= ~MIDIBUF_INQUEUE; - midihdr->flags |= MIDIBUF_DONE; - - midihdr->bytesrecorded = midiq->length - midiq->sizeLeft; - } - - /* Notify client that Sysex buffer has been sent */ - emu10k1_midi_callback(msg, card_mpuin->openinfo.refdata, callback_msg); - - return 0; -} - -void emu10k1_mpuin_bh(unsigned long refdata) -{ - u8 data; - unsigned idx; - struct emu10k1_mpuin *card_mpuin = (struct emu10k1_mpuin *) refdata; - unsigned long flags; - - while (card_mpuin->qhead != card_mpuin->qtail) { - spin_lock_irqsave(&card_mpuin->lock, flags); - idx = card_mpuin->qhead; - data = card_mpuin->midiq[idx].data; - card_mpuin->timein = card_mpuin->midiq[idx].timein; - idx = (idx + 1) % MIDIIN_MAX_BUFFER_SIZE; - card_mpuin->qhead = idx; - spin_unlock_irqrestore(&card_mpuin->lock, flags); - - sblive_miStateEntry(card_mpuin, data); - } - - return; -} - -/* IRQ callback handler routine for the MPU in port */ - -int emu10k1_mpuin_irqhandler(struct emu10k1_card *card) -{ - unsigned idx; - unsigned count; - u8 MPUIvalue; - struct emu10k1_mpuin *card_mpuin = card->mpuin; - - /* IRQ service routine. The data and code touched are: - * 1. card_mpuin - */ - - count = 0; - idx = card_mpuin->qtail; - - while (1) { - if (emu10k1_mpu_read_data(card, &MPUIvalue) < 0) { - break; - } else { - ++count; - card_mpuin->midiq[idx].data = MPUIvalue; - card_mpuin->midiq[idx].timein = (jiffies * 1000) / HZ; - idx = (idx + 1) % MIDIIN_MAX_BUFFER_SIZE; - } - } - - if (count) { - card_mpuin->qtail = idx; - - tasklet_hi_schedule(&card_mpuin->tasklet); - } - - return 0; -} - -/*****************************************************************************/ - -/* Supporting functions for Midi-In Interpretation State Machine */ - -/*****************************************************************************/ - -/* FIXME: This should be a macro */ -static int sblive_miStateInit(struct emu10k1_mpuin *card_mpuin) -{ - card_mpuin->status = 0; /* For MIDI running status */ - card_mpuin->fstatus = 0; /* For 0xFn status only */ - card_mpuin->curstate = STIN_PARSE; - card_mpuin->laststate = STIN_PARSE; - card_mpuin->data = 0; - card_mpuin->timestart = 0; - card_mpuin->timein = 0; - - return 0; -} - -/* FIXME: This should be a macro */ -static int sblive_miStateEntry(struct emu10k1_mpuin *card_mpuin, u8 data) -{ - return midistatefn[card_mpuin->curstate].Fn(card_mpuin, data); -} - -static int sblive_miStateParse(struct emu10k1_mpuin *card_mpuin, u8 data) -{ - switch (data & 0xf0) { - case 0x80: - case 0x90: - case 0xA0: - case 0xB0: - case 0xE0: - card_mpuin->curstate = STIN_3BYTE; - break; - - case 0xC0: - case 0xD0: - card_mpuin->curstate = STIN_2BYTE; - break; - - case 0xF0: - /* System messages do not affect the previous running status! */ - switch (data & 0x0f) { - case 0x0: - card_mpuin->laststate = card_mpuin->curstate; - card_mpuin->curstate = STIN_SYS_EX_NORM; - - if (card_mpuin->firstmidiq) { - struct midi_queue *midiq; - - midiq = card_mpuin->firstmidiq; - *midiq->midibyte = data; - --midiq->sizeLeft; - ++midiq->midibyte; - } - - return CTSTATUS_NEXT_BYTE; - - case 0x7: - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, 0xf7, 0); - return -1; - - case 0x2: - card_mpuin->laststate = card_mpuin->curstate; - card_mpuin->curstate = STIN_SYS_COMMON_3; - break; - - case 0x1: - case 0x3: - card_mpuin->laststate = card_mpuin->curstate; - card_mpuin->curstate = STIN_SYS_COMMON_2; - break; - - default: - /* includes 0xF4 - 0xF6, 0xF8 - 0xFF */ - return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data); - } - - break; - - default: - DPF(2, "BUG: default case hit\n"); - return -1; - } - - return midistatefn[card_mpuin->curstate].Fn(card_mpuin, data); -} - -static int sblive_miState3Byte(struct emu10k1_mpuin *card_mpuin, u8 data) -{ - u8 temp = data & 0xf0; - - if (temp < 0x80) { - return midistatefn[STIN_3BYTE_KEY].Fn(card_mpuin, data); - } else if (temp <= 0xe0 && temp != 0xc0 && temp != 0xd0) { - card_mpuin->status = data; - card_mpuin->curstate = STIN_3BYTE_KEY; - - return CTSTATUS_NEXT_BYTE; - } - - return midistatefn[STIN_PARSE].Fn(card_mpuin, data); -} - -static int sblive_miState3ByteKey(struct emu10k1_mpuin *card_mpuin, u8 data) -/* byte 1 */ -{ - unsigned long tmp; - - if (data > 0x7f) { - /* Real-time messages check */ - if (data > 0xf7) - return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data); - - /* Invalid data! */ - DPF(2, "Invalid data!\n"); - - card_mpuin->curstate = STIN_PARSE; - tmp = ((unsigned long) data) << 8; - tmp |= (unsigned long) card_mpuin->status; - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0); - - return -1; - } - - card_mpuin->data = data; - card_mpuin->curstate = STIN_3BYTE_VEL; - - return CTSTATUS_NEXT_BYTE; -} - -static int sblive_miState3ByteVel(struct emu10k1_mpuin *card_mpuin, u8 data) -/* byte 2 */ -{ - unsigned long tmp; - - if (data > 0x7f) { - /* Real-time messages check */ - if (data > 0xf7) - return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data); - - /* Invalid data! */ - DPF(2, "Invalid data!\n"); - - card_mpuin->curstate = STIN_PARSE; - tmp = ((unsigned long) data) << 8; - tmp |= card_mpuin->data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->status; - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0); - - return -1; - } - - card_mpuin->curstate = STIN_3BYTE; - tmp = (unsigned long) data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->status; - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATA, tmp, 3); - - return 0; -} - -static int sblive_miState2Byte(struct emu10k1_mpuin *card_mpuin, u8 data) -{ - u8 temp = data & 0xf0; - - if ((temp == 0xc0) || (temp == 0xd0)) { - card_mpuin->status = data; - card_mpuin->curstate = STIN_2BYTE_KEY; - - return CTSTATUS_NEXT_BYTE; - } - - if (temp < 0x80) - return midistatefn[STIN_2BYTE_KEY].Fn(card_mpuin, data); - - return midistatefn[STIN_PARSE].Fn(card_mpuin, data); -} - -static int sblive_miState2ByteKey(struct emu10k1_mpuin *card_mpuin, u8 data) -/* byte 1 */ -{ - unsigned long tmp; - - if (data > 0x7f) { - /* Real-time messages check */ - if (data > 0xf7) - return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data); - - /* Invalid data! */ - DPF(2, "Invalid data!\n"); - - card_mpuin->curstate = STIN_PARSE; - tmp = (unsigned long) data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->status; - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0); - - return -1; - } - - card_mpuin->curstate = STIN_2BYTE; - tmp = (unsigned long) data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->status; - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATA, tmp, 2); - - return 0; -} - -static int sblive_miStateSysCommon2(struct emu10k1_mpuin *card_mpuin, u8 data) -{ - card_mpuin->fstatus = data; - card_mpuin->curstate = STIN_SYS_COMMON_2_KEY; - - return CTSTATUS_NEXT_BYTE; -} - -static int sblive_miStateSysCommon2Key(struct emu10k1_mpuin *card_mpuin, u8 data) -/* byte 1 */ -{ - unsigned long tmp; - - if (data > 0x7f) { - /* Real-time messages check */ - if (data > 0xf7) - return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data); - - /* Invalid data! */ - DPF(2, "Invalid data!\n"); - - card_mpuin->curstate = card_mpuin->laststate; - tmp = (unsigned long) data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->fstatus; - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0); - - return -1; - } - - card_mpuin->curstate = card_mpuin->laststate; - tmp = (unsigned long) data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->fstatus; - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATA, tmp, 2); - - return 0; -} - -static int sblive_miStateSysCommon3(struct emu10k1_mpuin *card_mpuin, u8 data) -{ - card_mpuin->fstatus = data; - card_mpuin->curstate = STIN_SYS_COMMON_3_KEY; - - return CTSTATUS_NEXT_BYTE; -} - -static int sblive_miStateSysCommon3Key(struct emu10k1_mpuin *card_mpuin, u8 data) -/* byte 1 */ -{ - unsigned long tmp; - - if (data > 0x7f) { - /* Real-time messages check */ - if (data > 0xf7) - return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data); - - /* Invalid data! */ - DPF(2, "Invalid data!\n"); - - card_mpuin->curstate = card_mpuin->laststate; - tmp = (unsigned long) data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->fstatus; - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0); - - return -1; - } - - card_mpuin->data = data; - card_mpuin->curstate = STIN_SYS_COMMON_3_VEL; - - return CTSTATUS_NEXT_BYTE; -} - -static int sblive_miStateSysCommon3Vel(struct emu10k1_mpuin *card_mpuin, u8 data) -/* byte 2 */ -{ - unsigned long tmp; - - if (data > 0x7f) { - /* Real-time messages check */ - if (data > 0xf7) - return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data); - - /* Invalid data! */ - DPF(2, "Invalid data!\n"); - - card_mpuin->curstate = card_mpuin->laststate; - tmp = (unsigned long) data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->fstatus; - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0); - - return -1; - } - - card_mpuin->curstate = card_mpuin->laststate; - tmp = (unsigned long) data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->data; - tmp = tmp << 8; - tmp |= (unsigned long) card_mpuin->fstatus; - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATA, tmp, 3); - - return 0; -} - -static int sblive_miStateSysExNorm(struct emu10k1_mpuin *card_mpuin, u8 data) -{ - unsigned long flags; - - if ((data > 0x7f) && (data != 0xf7)) { - /* Real-time messages check */ - if (data > 0xf7) - return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data); - - /* Invalid Data! */ - DPF(2, "Invalid data!\n"); - - card_mpuin->curstate = card_mpuin->laststate; - - if (card_mpuin->firstmidiq) { - struct midi_queue *midiq; - - midiq = card_mpuin->firstmidiq; - *midiq->midibyte = data; - --midiq->sizeLeft; - ++midiq->midibyte; - - spin_lock_irqsave(&card_mpuin->lock, flags); - - card_mpuin->firstmidiq = midiq->next; - if (card_mpuin->firstmidiq == NULL) - card_mpuin->lastmidiq = NULL; - - spin_unlock_irqrestore(&card_mpuin->lock, flags); - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGERROR, (unsigned long) midiq, 0); - - kfree(midiq); - } - - return -1; - } - - if (card_mpuin->firstmidiq) { - struct midi_queue *midiq; - - midiq = card_mpuin->firstmidiq; - *midiq->midibyte = data; - --midiq->sizeLeft; - ++midiq->midibyte; - } - - if (data == 0xf7) { - /* End of Sysex buffer */ - /* Send down the buffer */ - - card_mpuin->curstate = card_mpuin->laststate; - - if (card_mpuin->firstmidiq) { - struct midi_queue *midiq; - - midiq = card_mpuin->firstmidiq; - - spin_lock_irqsave(&card_mpuin->lock, flags); - - card_mpuin->firstmidiq = midiq->next; - if (card_mpuin->firstmidiq == NULL) - card_mpuin->lastmidiq = NULL; - - spin_unlock_irqrestore(&card_mpuin->lock, flags); - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGDATA, (unsigned long) midiq, 0); - - kfree(midiq); - } - - return 0; - } - - if (card_mpuin->firstmidiq) { - struct midi_queue *midiq; - - midiq = card_mpuin->firstmidiq; - - if (midiq->sizeLeft == 0) { - /* Special case */ - - spin_lock_irqsave(&card_mpuin->lock, flags); - - card_mpuin->firstmidiq = midiq->next; - if (card_mpuin->firstmidiq == NULL) - card_mpuin->lastmidiq = NULL; - - spin_unlock_irqrestore(&card_mpuin->lock, flags); - - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGDATA, (unsigned long) midiq, 0); - - kfree(midiq); - - return CTSTATUS_NEXT_BYTE; - } - } - - return CTSTATUS_NEXT_BYTE; -} - -static int sblive_miStateSysReal(struct emu10k1_mpuin *card_mpuin, u8 data) -{ - emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATA, data, 1); - - return CTSTATUS_NEXT_BYTE; -} diff --git a/sound/oss/emu10k1/cardmi.h b/sound/oss/emu10k1/cardmi.h deleted file mode 100644 index d12c2411630..00000000000 --- a/sound/oss/emu10k1/cardmi.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - ********************************************************************** - * sblive_mi.h - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * November 2, 1999 Alan Cox cleaned up - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _CARDMI_H -#define _CARDMI_H - -#include "icardmid.h" -#include <linux/interrupt.h> - -typedef enum -{ - STIN_PARSE = 0, - STIN_3BYTE, /* 0x80, 0x90, 0xA0, 0xB0, 0xE0 */ - STIN_3BYTE_KEY, /* Byte 1 */ - STIN_3BYTE_VEL, /* Byte 1 */ - STIN_2BYTE, /* 0xC0, 0xD0 */ - STIN_2BYTE_KEY, /* Byte 1 */ - STIN_SYS_COMMON_2, /* 0xF1, 0xF3 */ - STIN_SYS_COMMON_2_KEY, - STIN_SYS_COMMON_3, /* 0xF2 */ - STIN_SYS_COMMON_3_KEY, - STIN_SYS_COMMON_3_VEL, - STIN_SYS_EX_NORM, /* 0xF0, Normal mode */ - STIN_SYS_REAL -} midi_in_state; - - -/* flags for card MIDI in object */ -#define FLAGS_MIDM_STARTED 0x00001000 // Data has started to come in after Midm Start -#define MIDIIN_MAX_BUFFER_SIZE 200 // Definition for struct emu10k1_mpuin - -struct midi_data -{ - u8 data; - u32 timein; -}; - -struct emu10k1_mpuin -{ - spinlock_t lock; - struct midi_queue *firstmidiq; - struct midi_queue *lastmidiq; - unsigned qhead, qtail; - struct midi_data midiq[MIDIIN_MAX_BUFFER_SIZE]; - struct tasklet_struct tasklet; - struct midi_openinfo openinfo; - - /* For MIDI state machine */ - u8 status; /* For MIDI running status */ - u8 fstatus; /* For 0xFn status only */ - midi_in_state curstate; - midi_in_state laststate; - u32 timestart; - u32 timein; - u8 data; -}; - -int emu10k1_mpuin_open(struct emu10k1_card *, struct midi_openinfo *); -int emu10k1_mpuin_close(struct emu10k1_card *); -int emu10k1_mpuin_add_buffer(struct emu10k1_mpuin *, struct midi_hdr *); -int emu10k1_mpuin_start(struct emu10k1_card *); -int emu10k1_mpuin_stop(struct emu10k1_card *); -int emu10k1_mpuin_reset(struct emu10k1_card *); - -int emu10k1_mpuin_irqhandler(struct emu10k1_card *); -void emu10k1_mpuin_bh(unsigned long); - -#endif /* _CARDMI_H */ diff --git a/sound/oss/emu10k1/cardmo.c b/sound/oss/emu10k1/cardmo.c deleted file mode 100644 index a8cc75db3e4..00000000000 --- a/sound/oss/emu10k1/cardmo.c +++ /dev/null @@ -1,229 +0,0 @@ -/* - ********************************************************************** - * cardmo.c - MIDI UART output HAL for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * November 2, 1999 Alan Cox cleaned up - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include <linux/slab.h> - -#include "hwaccess.h" -#include "8010.h" -#include "cardmo.h" -#include "irqmgr.h" - -/* Installs the IRQ handler for the MPU out port * - * and initialize parameters */ - -int emu10k1_mpuout_open(struct emu10k1_card *card, struct midi_openinfo *openinfo) -{ - struct emu10k1_mpuout *card_mpuout = card->mpuout; - - DPF(2, "emu10k1_mpuout_open()\n"); - - if (!(card_mpuout->status & FLAGS_AVAILABLE)) - return -1; - - /* Copy open info and mark channel as in use */ - card_mpuout->intr = 0; - card_mpuout->openinfo = *openinfo; - card_mpuout->status &= ~FLAGS_AVAILABLE; - card_mpuout->laststatus = 0x80; - card_mpuout->firstmidiq = NULL; - card_mpuout->lastmidiq = NULL; - - emu10k1_mpu_reset(card); - emu10k1_mpu_acquire(card); - - return 0; -} - -int emu10k1_mpuout_close(struct emu10k1_card *card) -{ - struct emu10k1_mpuout *card_mpuout = card->mpuout; - struct midi_queue *midiq; - struct midi_hdr *midihdr; - unsigned long flags; - - DPF(2, "emu10k1_mpuout_close()\n"); - - emu10k1_irq_disable(card, card->is_audigy ? A_INTE_MIDITXENABLE : INTE_MIDITXENABLE); - - spin_lock_irqsave(&card_mpuout->lock, flags); - - while (card_mpuout->firstmidiq != NULL) { - midiq = card_mpuout->firstmidiq; - midihdr = (struct midi_hdr *) midiq->refdata; - - card_mpuout->firstmidiq = midiq->next; - - kfree(midihdr->data); - kfree(midihdr); - kfree(midiq); - } - - card_mpuout->lastmidiq = NULL; - - emu10k1_mpu_release(card); - - card_mpuout->status |= FLAGS_AVAILABLE; - - spin_unlock_irqrestore(&card_mpuout->lock, flags); - - return 0; -} - -/* If there isn't enough buffer space, reject Midi Buffer. * -* Otherwise, disable TX, create object to hold Midi * -* uffer, update buffer flags and other parameters * -* before enabling TX again. */ - -int emu10k1_mpuout_add_buffer(struct emu10k1_card *card, struct midi_hdr *midihdr) -{ - struct emu10k1_mpuout *card_mpuout = card->mpuout; - struct midi_queue *midiq; - unsigned long flags; - - DPF(2, "emu10k1_mpuout_add_buffer()\n"); - - if (card_mpuout->state == CARDMIDIOUT_STATE_SUSPEND) - return 0; - - midihdr->flags |= MIDIBUF_INQUEUE; - midihdr->flags &= ~MIDIBUF_DONE; - - if ((midiq = kmalloc(sizeof(struct midi_queue), GFP_KERNEL)) == NULL) { - /* Message lost */ - return -1; - } - - midiq->next = NULL; - midiq->qtype = 1; - midiq->length = midihdr->bufferlength; - midiq->sizeLeft = midihdr->bufferlength; - midiq->midibyte = midihdr->data; - - midiq->refdata = (unsigned long) midihdr; - - spin_lock_irqsave(&card_mpuout->lock, flags); - - if (card_mpuout->firstmidiq == NULL) { - card_mpuout->firstmidiq = midiq; - card_mpuout->lastmidiq = midiq; - } else { - (card_mpuout->lastmidiq)->next = midiq; - card_mpuout->lastmidiq = midiq; - } - - card_mpuout->intr = 0; - - emu10k1_irq_enable(card, card->is_audigy ? A_INTE_MIDITXENABLE : INTE_MIDITXENABLE); - - spin_unlock_irqrestore(&card_mpuout->lock, flags); - - return 0; -} - -void emu10k1_mpuout_bh(unsigned long refdata) -{ - struct emu10k1_card *card = (struct emu10k1_card *) refdata; - struct emu10k1_mpuout *card_mpuout = card->mpuout; - int cByteSent = 0; - struct midi_queue *midiq; - struct midi_queue *doneq = NULL; - unsigned long flags; - - spin_lock_irqsave(&card_mpuout->lock, flags); - - while (card_mpuout->firstmidiq != NULL) { - midiq = card_mpuout->firstmidiq; - - while (cByteSent < 4 && midiq->sizeLeft) { - if (emu10k1_mpu_write_data(card, *midiq->midibyte) < 0) { - DPF(2, "emu10k1_mpuoutDpcCallback error!!\n"); - } else { - ++cByteSent; - --midiq->sizeLeft; - ++midiq->midibyte; - } - } - - if (midiq->sizeLeft == 0) { - if (doneq == NULL) - doneq = midiq; - card_mpuout->firstmidiq = midiq->next; - } else - break; - } - - if (card_mpuout->firstmidiq == NULL) - card_mpuout->lastmidiq = NULL; - - if (doneq != NULL) { - while (doneq != card_mpuout->firstmidiq) { - unsigned long callback_msg[3]; - - midiq = doneq; - doneq = midiq->next; - - if (midiq->qtype) { - callback_msg[0] = 0; - callback_msg[1] = midiq->length; - callback_msg[2] = midiq->refdata; - - emu10k1_midi_callback(ICARDMIDI_OUTLONGDATA, card_mpuout->openinfo.refdata, callback_msg); - } else if (((u8) midiq->refdata) < 0xF0 && ((u8) midiq->refdata) > 0x7F) - card_mpuout->laststatus = (u8) midiq->refdata; - - kfree(midiq); - } - } - - if ((card_mpuout->firstmidiq != NULL) || cByteSent) { - card_mpuout->intr = 0; - emu10k1_irq_enable(card, card->is_audigy ? A_INTE_MIDITXENABLE : INTE_MIDITXENABLE); - } - - spin_unlock_irqrestore(&card_mpuout->lock, flags); - - return; -} - -int emu10k1_mpuout_irqhandler(struct emu10k1_card *card) -{ - struct emu10k1_mpuout *card_mpuout = card->mpuout; - - DPF(4, "emu10k1_mpuout_irqhandler\n"); - - card_mpuout->intr = 1; - emu10k1_irq_disable(card, card->is_audigy ? A_INTE_MIDITXENABLE : INTE_MIDITXENABLE); - - tasklet_hi_schedule(&card_mpuout->tasklet); - - return 0; -} diff --git a/sound/oss/emu10k1/cardmo.h b/sound/oss/emu10k1/cardmo.h deleted file mode 100644 index 7026eb3a85a..00000000000 --- a/sound/oss/emu10k1/cardmo.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - ********************************************************************** - * cardmo.h - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * November 2, 1999 Alan Cox cleaned up - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _CARDMO_H -#define _CARDMO_H - -#include "icardmid.h" -#include <linux/interrupt.h> - -#define CARDMIDIOUT_STATE_DEFAULT 0x00000000 -#define CARDMIDIOUT_STATE_SUSPEND 0x00000001 - -struct emu10k1_mpuout -{ - u32 status; - u32 state; - volatile int intr; - struct midi_queue *firstmidiq; - struct midi_queue *lastmidiq; - u8 laststatus; - struct tasklet_struct tasklet; - spinlock_t lock; - struct midi_openinfo openinfo; -}; - -int emu10k1_mpuout_open(struct emu10k1_card *, struct midi_openinfo *); -int emu10k1_mpuout_close(struct emu10k1_card *); -int emu10k1_mpuout_add_buffer(struct emu10k1_card *, struct midi_hdr *); - -int emu10k1_mpuout_irqhandler(struct emu10k1_card *); -void emu10k1_mpuout_bh(unsigned long); - -#endif /* _CARDMO_H */ diff --git a/sound/oss/emu10k1/cardwi.c b/sound/oss/emu10k1/cardwi.c deleted file mode 100644 index 060d1be94d3..00000000000 --- a/sound/oss/emu10k1/cardwi.c +++ /dev/null @@ -1,384 +0,0 @@ -/* - ********************************************************************** - * cardwi.c - PCM input HAL for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include <linux/poll.h> -#include "hwaccess.h" -#include "timer.h" -#include "recmgr.h" -#include "audio.h" -#include "cardwi.h" - -/** - * query_format - returns a valid sound format - * - * This function will return a valid sound format as close - * to the requested one as possible. - */ -static void query_format(int recsrc, struct wave_format *wave_fmt) -{ - - switch (recsrc) { - case WAVERECORD_AC97: - - if ((wave_fmt->channels != 1) && (wave_fmt->channels != 2)) - wave_fmt->channels = 2; - - if (wave_fmt->samplingrate >= (0xBB80 + 0xAC44) / 2) - wave_fmt->samplingrate = 0xBB80; - else if (wave_fmt->samplingrate >= (0xAC44 + 0x7D00) / 2) - wave_fmt->samplingrate = 0xAC44; - else if (wave_fmt->samplingrate >= (0x7D00 + 0x5DC0) / 2) - wave_fmt->samplingrate = 0x7D00; - else if (wave_fmt->samplingrate >= (0x5DC0 + 0x5622) / 2) - wave_fmt->samplingrate = 0x5DC0; - else if (wave_fmt->samplingrate >= (0x5622 + 0x3E80) / 2) - wave_fmt->samplingrate = 0x5622; - else if (wave_fmt->samplingrate >= (0x3E80 + 0x2B11) / 2) - wave_fmt->samplingrate = 0x3E80; - else if (wave_fmt->samplingrate >= (0x2B11 + 0x1F40) / 2) - wave_fmt->samplingrate = 0x2B11; - else - wave_fmt->samplingrate = 0x1F40; - - switch (wave_fmt->id) { - case AFMT_S16_LE: - wave_fmt->bitsperchannel = 16; - break; - case AFMT_U8: - wave_fmt->bitsperchannel = 8; - break; - default: - wave_fmt->id = AFMT_S16_LE; - wave_fmt->bitsperchannel = 16; - break; - } - - break; - - /* these can't be changed from the original values */ - case WAVERECORD_MIC: - case WAVERECORD_FX: - break; - - default: - BUG(); - break; - } - - wave_fmt->bytesperchannel = wave_fmt->bitsperchannel >> 3; - wave_fmt->bytespersample = wave_fmt->channels * wave_fmt->bytesperchannel; - wave_fmt->bytespersec = wave_fmt->bytespersample * wave_fmt->samplingrate; - wave_fmt->bytespervoicesample = wave_fmt->bytespersample; -} - -static int alloc_buffer(struct emu10k1_card *card, struct wavein_buffer *buffer) -{ - buffer->addr = pci_alloc_consistent(card->pci_dev, buffer->size * buffer->cov, - &buffer->dma_handle); - if (buffer->addr == NULL) - return -1; - - return 0; -} - -static void free_buffer(struct emu10k1_card *card, struct wavein_buffer *buffer) -{ - if (buffer->addr != NULL) - pci_free_consistent(card->pci_dev, buffer->size * buffer->cov, - buffer->addr, buffer->dma_handle); -} - -int emu10k1_wavein_open(struct emu10k1_wavedevice *wave_dev) -{ - struct emu10k1_card *card = wave_dev->card; - struct wiinst *wiinst = wave_dev->wiinst; - struct wiinst **wiinst_tmp = NULL; - u16 delay; - unsigned long flags; - - DPF(2, "emu10k1_wavein_open()\n"); - - switch (wiinst->recsrc) { - case WAVERECORD_AC97: - wiinst_tmp = &card->wavein.ac97; - break; - case WAVERECORD_MIC: - wiinst_tmp = &card->wavein.mic; - break; - case WAVERECORD_FX: - wiinst_tmp = &card->wavein.fx; - break; - default: - BUG(); - break; - } - - spin_lock_irqsave(&card->lock, flags); - if (*wiinst_tmp != NULL) { - spin_unlock_irqrestore(&card->lock, flags); - return -1; - } - - *wiinst_tmp = wiinst; - spin_unlock_irqrestore(&card->lock, flags); - - /* handle 8 bit recording */ - if (wiinst->format.bytesperchannel == 1) { - if (wiinst->buffer.size > 0x8000) { - wiinst->buffer.size = 0x8000; - wiinst->buffer.sizeregval = 0x1f; - } else - wiinst->buffer.sizeregval += 4; - - wiinst->buffer.cov = 2; - } else - wiinst->buffer.cov = 1; - - if (alloc_buffer(card, &wiinst->buffer) < 0) { - ERROR(); - return -1; - } - - emu10k1_set_record_src(card, wiinst); - - emu10k1_reset_record(card, &wiinst->buffer); - - wiinst->buffer.hw_pos = 0; - wiinst->buffer.pos = 0; - wiinst->buffer.bytestocopy = 0; - - delay = (48000 * wiinst->buffer.fragment_size) / wiinst->format.bytespersec; - - emu10k1_timer_install(card, &wiinst->timer, delay / 2); - - wiinst->state = WAVE_STATE_OPEN; - - return 0; -} - -void emu10k1_wavein_close(struct emu10k1_wavedevice *wave_dev) -{ - struct emu10k1_card *card = wave_dev->card; - struct wiinst *wiinst = wave_dev->wiinst; - unsigned long flags; - - DPF(2, "emu10k1_wavein_close()\n"); - - emu10k1_wavein_stop(wave_dev); - - emu10k1_timer_uninstall(card, &wiinst->timer); - - free_buffer(card, &wiinst->buffer); - - spin_lock_irqsave(&card->lock, flags); - switch (wave_dev->wiinst->recsrc) { - case WAVERECORD_AC97: - card->wavein.ac97 = NULL; - break; - case WAVERECORD_MIC: - card->wavein.mic = NULL; - break; - case WAVERECORD_FX: - card->wavein.fx = NULL; - break; - default: - BUG(); - break; - } - spin_unlock_irqrestore(&card->lock, flags); - - wiinst->state = WAVE_STATE_CLOSED; -} - -void emu10k1_wavein_start(struct emu10k1_wavedevice *wave_dev) -{ - struct emu10k1_card *card = wave_dev->card; - struct wiinst *wiinst = wave_dev->wiinst; - - DPF(2, "emu10k1_wavein_start()\n"); - - emu10k1_start_record(card, &wiinst->buffer); - emu10k1_timer_enable(wave_dev->card, &wiinst->timer); - - wiinst->state |= WAVE_STATE_STARTED; -} - -void emu10k1_wavein_stop(struct emu10k1_wavedevice *wave_dev) -{ - struct emu10k1_card *card = wave_dev->card; - struct wiinst *wiinst = wave_dev->wiinst; - - DPF(2, "emu10k1_wavein_stop()\n"); - - if (!(wiinst->state & WAVE_STATE_STARTED)) - return; - - emu10k1_timer_disable(card, &wiinst->timer); - emu10k1_stop_record(card, &wiinst->buffer); - - wiinst->state &= ~WAVE_STATE_STARTED; -} - -int emu10k1_wavein_setformat(struct emu10k1_wavedevice *wave_dev, struct wave_format *format) -{ - struct emu10k1_card *card = wave_dev->card; - struct wiinst *wiinst = wave_dev->wiinst; - u16 delay; - - DPF(2, "emu10k1_wavein_setformat()\n"); - - if (wiinst->state & WAVE_STATE_STARTED) - return -1; - - query_format(wiinst->recsrc, format); - - if ((wiinst->format.samplingrate != format->samplingrate) - || (wiinst->format.bitsperchannel != format->bitsperchannel) - || (wiinst->format.channels != format->channels)) { - - wiinst->format = *format; - - if (wiinst->state == WAVE_STATE_CLOSED) - return 0; - - wiinst->buffer.size *= wiinst->buffer.cov; - - if (wiinst->format.bytesperchannel == 1) { - wiinst->buffer.cov = 2; - wiinst->buffer.size /= wiinst->buffer.cov; - } else - wiinst->buffer.cov = 1; - - emu10k1_timer_uninstall(card, &wiinst->timer); - - delay = (48000 * wiinst->buffer.fragment_size) / wiinst->format.bytespersec; - - emu10k1_timer_install(card, &wiinst->timer, delay / 2); - } - - return 0; -} - -void emu10k1_wavein_getxfersize(struct wiinst *wiinst, u32 * size) -{ - struct wavein_buffer *buffer = &wiinst->buffer; - - *size = buffer->bytestocopy; - - if (wiinst->mmapped) - return; - - if (*size > buffer->size) { - *size = buffer->size; - buffer->pos = buffer->hw_pos; - buffer->bytestocopy = buffer->size; - DPF(1, "buffer overrun\n"); - } -} - -static int copy_block(u8 __user *dst, u8 * src, u32 str, u32 len, u8 cov) -{ - if (cov == 1) { - if (__copy_to_user(dst, src + str, len)) - return -EFAULT; - } else { - u8 byte; - u32 i; - - src += 1 + 2 * str; - - for (i = 0; i < len; i++) { - byte = src[2 * i] ^ 0x80; - if (__copy_to_user(dst + i, &byte, 1)) - return -EFAULT; - } - } - - return 0; -} - -int emu10k1_wavein_xferdata(struct wiinst *wiinst, u8 __user *data, u32 * size) -{ - struct wavein_buffer *buffer = &wiinst->buffer; - u32 sizetocopy, sizetocopy_now, start; - unsigned long flags; - int ret; - - sizetocopy = min_t(u32, buffer->size, *size); - *size = sizetocopy; - - if (!sizetocopy) - return 0; - - spin_lock_irqsave(&wiinst->lock, flags); - start = buffer->pos; - buffer->pos += sizetocopy; - buffer->pos %= buffer->size; - buffer->bytestocopy -= sizetocopy; - sizetocopy_now = buffer->size - start; - - spin_unlock_irqrestore(&wiinst->lock, flags); - - if (sizetocopy > sizetocopy_now) { - sizetocopy -= sizetocopy_now; - - ret = copy_block(data, buffer->addr, start, sizetocopy_now, - buffer->cov); - if (ret == 0) - ret = copy_block(data + sizetocopy_now, buffer->addr, 0, - sizetocopy, buffer->cov); - } else { - ret = copy_block(data, buffer->addr, start, sizetocopy, - buffer->cov); - } - - return ret; -} - -void emu10k1_wavein_update(struct emu10k1_card *card, struct wiinst *wiinst) -{ - u32 hw_pos; - u32 diff; - - /* There is no actual start yet */ - if (!(wiinst->state & WAVE_STATE_STARTED)) { - hw_pos = wiinst->buffer.hw_pos; - } else { - /* hw_pos in byte units */ - hw_pos = sblive_readptr(card, wiinst->buffer.idxreg, 0) / wiinst->buffer.cov; - } - - diff = (wiinst->buffer.size + hw_pos - wiinst->buffer.hw_pos) % wiinst->buffer.size; - wiinst->total_recorded += diff; - wiinst->buffer.bytestocopy += diff; - - wiinst->buffer.hw_pos = hw_pos; -} diff --git a/sound/oss/emu10k1/cardwi.h b/sound/oss/emu10k1/cardwi.h deleted file mode 100644 index e82029b46ad..00000000000 --- a/sound/oss/emu10k1/cardwi.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - ********************************************************************** - * cardwi.h -- header file for card wave input functions - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ -#ifndef _CARDWI_H -#define _CARDWI_H - -#include "icardwav.h" -#include "audio.h" -#include "timer.h" - -struct wavein_buffer { - u16 ossfragshift; - u32 fragment_size; - u32 numfrags; - u32 hw_pos; /* hardware cursor position */ - u32 pos; /* software cursor position */ - u32 bytestocopy; /* bytes of recorded data available */ - u32 size; - u32 pages; - u32 sizereg; - u32 sizeregval; - u32 addrreg; - u32 idxreg; - u32 adcctl; - void *addr; - u8 cov; - dma_addr_t dma_handle; -}; - -struct wiinst -{ - u8 state; - struct emu_timer timer; - struct wave_format format; - struct wavein_buffer buffer; - wait_queue_head_t wait_queue; - u8 mmapped; - u32 total_recorded; /* total bytes read() from device */ - u32 blocks; - spinlock_t lock; - u8 recsrc; - u16 fxwc; -}; - -#define WAVEIN_MAXBUFSIZE 65536 -#define WAVEIN_MINBUFSIZE 368 - -#define WAVEIN_DEFAULTFRAGLEN 100 -#define WAVEIN_DEFAULTBUFLEN 1000 - -#define WAVEIN_MINFRAGSHIFT 8 -#define WAVEIN_MINFRAGS 2 - -int emu10k1_wavein_open(struct emu10k1_wavedevice *); -void emu10k1_wavein_close(struct emu10k1_wavedevice *); -void emu10k1_wavein_start(struct emu10k1_wavedevice *); -void emu10k1_wavein_stop(struct emu10k1_wavedevice *); -void emu10k1_wavein_getxfersize(struct wiinst *, u32 *); -int emu10k1_wavein_xferdata(struct wiinst *, u8 __user *, u32 *); -int emu10k1_wavein_setformat(struct emu10k1_wavedevice *, struct wave_format *); -void emu10k1_wavein_update(struct emu10k1_card *, struct wiinst *); - - -#endif /* _CARDWI_H */ diff --git a/sound/oss/emu10k1/cardwo.c b/sound/oss/emu10k1/cardwo.c deleted file mode 100644 index 54daca4f57b..00000000000 --- a/sound/oss/emu10k1/cardwo.c +++ /dev/null @@ -1,643 +0,0 @@ -/* - ********************************************************************** - * cardwo.c - PCM output HAL for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include <linux/poll.h> -#include "hwaccess.h" -#include "8010.h" -#include "voicemgr.h" -#include "cardwo.h" -#include "audio.h" - -static u32 samplerate_to_linearpitch(u32 samplingrate) -{ - samplingrate = (samplingrate << 8) / 375; - return (samplingrate >> 1) + (samplingrate & 1); -} - -static void query_format(struct emu10k1_wavedevice *wave_dev, struct wave_format *wave_fmt) -{ - int i, j, do_passthrough = 0, is_ac3 = 0; - struct emu10k1_card *card = wave_dev->card; - struct woinst *woinst = wave_dev->woinst; - - if ((wave_fmt->channels > 2) && (wave_fmt->id != AFMT_S16_LE) && (wave_fmt->id != AFMT_U8)) - wave_fmt->channels = 2; - - if ((wave_fmt->channels < 1) || (wave_fmt->channels > WAVEOUT_MAXVOICES)) - wave_fmt->channels = 2; - - if (wave_fmt->channels == 2) - woinst->num_voices = 1; - else - woinst->num_voices = wave_fmt->channels; - - if (wave_fmt->samplingrate >= 0x2ee00) - wave_fmt->samplingrate = 0x2ee00; - - wave_fmt->passthrough = 0; - do_passthrough = is_ac3 = 0; - - if (card->pt.selected) - do_passthrough = 1; - - switch (wave_fmt->id) { - case AFMT_S16_LE: - wave_fmt->bitsperchannel = 16; - break; - case AFMT_U8: - wave_fmt->bitsperchannel = 8; - break; - case AFMT_AC3: - do_passthrough = 1; - is_ac3 = 1; - break; - default: - wave_fmt->id = AFMT_S16_LE; - wave_fmt->bitsperchannel = 16; - break; - } - if (do_passthrough) { - /* currently only one waveout instance may use pass-through */ - if (woinst->state != WAVE_STATE_CLOSED || - card->pt.state != PT_STATE_INACTIVE || - (wave_fmt->samplingrate != 48000 && !is_ac3)) { - DPF(2, "unable to set pass-through mode\n"); - } else if (USE_PT_METHOD1) { - i = emu10k1_find_control_gpr(&card->mgr, card->pt.patch_name, card->pt.intr_gpr_name); - j = emu10k1_find_control_gpr(&card->mgr, card->pt.patch_name, card->pt.enable_gpr_name); - if (i < 0 || j < 0) - DPF(2, "unable to set pass-through mode\n"); - else { - wave_fmt->samplingrate = 48000; - wave_fmt->channels = 2; - card->pt.pos_gpr = emu10k1_find_control_gpr(&card->mgr, card->pt.patch_name, - card->pt.pos_gpr_name); - wave_fmt->passthrough = 1; - card->pt.intr_gpr = i; - card->pt.enable_gpr = j; - card->pt.state = PT_STATE_INACTIVE; - - DPD(2, "is_ac3 is %d\n", is_ac3); - card->pt.ac3data = is_ac3; - wave_fmt->bitsperchannel = 16; - } - }else{ - DPF(2, "Using Passthrough Method 2\n"); - card->pt.enable_gpr = emu10k1_find_control_gpr(&card->mgr, card->pt.patch_name, - card->pt.enable_gpr_name); - wave_fmt->passthrough = 2; - wave_fmt->bitsperchannel = 16; - } - } - - wave_fmt->bytesperchannel = wave_fmt->bitsperchannel >> 3; - wave_fmt->bytespersample = wave_fmt->channels * wave_fmt->bytesperchannel; - wave_fmt->bytespersec = wave_fmt->bytespersample * wave_fmt->samplingrate; - - if (wave_fmt->channels == 2) - wave_fmt->bytespervoicesample = wave_fmt->channels * wave_fmt->bytesperchannel; - else - wave_fmt->bytespervoicesample = wave_fmt->bytesperchannel; -} - -static int get_voice(struct emu10k1_card *card, struct woinst *woinst, unsigned int voicenum) -{ - struct emu_voice *voice = &woinst->voice[voicenum]; - - /* Allocate voices here, if no voices available, return error. */ - - voice->usage = VOICE_USAGE_PLAYBACK; - - voice->flags = 0; - - if (woinst->format.channels == 2) - voice->flags |= VOICE_FLAGS_STEREO; - - if (woinst->format.bitsperchannel == 16) - voice->flags |= VOICE_FLAGS_16BIT; - - if (emu10k1_voice_alloc(card, voice) < 0) { - voice->usage = VOICE_USAGE_FREE; - return -1; - } - - /* Calculate pitch */ - voice->initial_pitch = (u16) (srToPitch(woinst->format.samplingrate) >> 8); - voice->pitch_target = samplerate_to_linearpitch(woinst->format.samplingrate); - - DPD(2, "Initial pitch --> %#x\n", voice->initial_pitch); - - voice->startloop = (voice->mem.emupageindex << 12) / - woinst->format.bytespervoicesample; - voice->endloop = voice->startloop + woinst->buffer.size / woinst->format.bytespervoicesample; - voice->start = voice->startloop; - - - voice->params[0].volume_target = 0xffff; - voice->params[0].initial_fc = 0xff; - voice->params[0].initial_attn = 0x00; - voice->params[0].byampl_env_sustain = 0x7f; - voice->params[0].byampl_env_decay = 0x7f; - - - if (voice->flags & VOICE_FLAGS_STEREO) { - if (woinst->format.passthrough == 2) { - voice->params[0].send_routing = voice->params[1].send_routing = card->waveout.send_routing[ROUTE_PT]; - voice->params[0].send_routing2 = voice->params[1].send_routing2 = card->waveout.send_routing2[ROUTE_PT]; - voice->params[0].send_dcba = 0xff; - voice->params[1].send_dcba = 0xff00; - voice->params[0].send_hgfe = voice->params[1].send_hgfe=0; - } else { - voice->params[0].send_dcba = card->waveout.send_dcba[SEND_LEFT]; - voice->params[0].send_hgfe = card->waveout.send_hgfe[SEND_LEFT]; - voice->params[1].send_dcba = card->waveout.send_dcba[SEND_RIGHT]; - voice->params[1].send_hgfe = card->waveout.send_hgfe[SEND_RIGHT]; - - if (woinst->device) { - // /dev/dps1 - voice->params[0].send_routing = voice->params[1].send_routing = card->waveout.send_routing[ROUTE_PCM1]; - voice->params[0].send_routing2 = voice->params[1].send_routing2 = card->waveout.send_routing2[ROUTE_PCM1]; - } else { - voice->params[0].send_routing = voice->params[1].send_routing = card->waveout.send_routing[ROUTE_PCM]; - voice->params[0].send_routing2 = voice->params[1].send_routing2 = card->waveout.send_routing2[ROUTE_PCM]; - } - } - - voice->params[1].volume_target = 0xffff; - voice->params[1].initial_fc = 0xff; - voice->params[1].initial_attn = 0x00; - voice->params[1].byampl_env_sustain = 0x7f; - voice->params[1].byampl_env_decay = 0x7f; - } else { - if (woinst->num_voices > 1) { - // Multichannel pcm - voice->params[0].send_dcba=0xff; - voice->params[0].send_hgfe=0; - if (card->is_audigy) { - voice->params[0].send_routing = 0x3f3f3f00 + card->mchannel_fx + voicenum; - voice->params[0].send_routing2 = 0x3f3f3f3f; - } else { - voice->params[0].send_routing = 0xfff0 + card->mchannel_fx + voicenum; - } - - } else { - voice->params[0].send_dcba = card->waveout.send_dcba[SEND_MONO]; - voice->params[0].send_hgfe = card->waveout.send_hgfe[SEND_MONO]; - - if (woinst->device) { - voice->params[0].send_routing = card->waveout.send_routing[ROUTE_PCM1]; - voice->params[0].send_routing2 = card->waveout.send_routing2[ROUTE_PCM1]; - } else { - voice->params[0].send_routing = card->waveout.send_routing[ROUTE_PCM]; - voice->params[0].send_routing2 = card->waveout.send_routing2[ROUTE_PCM]; - } - } - } - - DPD(2, "voice: startloop=%#x, endloop=%#x\n", voice->startloop, voice->endloop); - - emu10k1_voice_playback_setup(voice); - - return 0; -} - -int emu10k1_waveout_open(struct emu10k1_wavedevice *wave_dev) -{ - struct emu10k1_card *card = wave_dev->card; - struct woinst *woinst = wave_dev->woinst; - struct waveout_buffer *buffer = &woinst->buffer; - unsigned int voicenum; - u16 delay; - - DPF(2, "emu10k1_waveout_open()\n"); - - for (voicenum = 0; voicenum < woinst->num_voices; voicenum++) { - if (emu10k1_voice_alloc_buffer(card, &woinst->voice[voicenum].mem, woinst->buffer.pages) < 0) { - ERROR(); - emu10k1_waveout_close(wave_dev); - return -1; - } - - if (get_voice(card, woinst, voicenum) < 0) { - ERROR(); - emu10k1_waveout_close(wave_dev); - return -1; - } - } - - buffer->fill_silence = 0; - buffer->silence_bytes = 0; - buffer->silence_pos = 0; - buffer->hw_pos = 0; - buffer->free_bytes = woinst->buffer.size; - - delay = (48000 * woinst->buffer.fragment_size) / - (woinst->format.samplingrate * woinst->format.bytespervoicesample); - - emu10k1_timer_install(card, &woinst->timer, delay); - - woinst->state = WAVE_STATE_OPEN; - - return 0; -} - -void emu10k1_waveout_close(struct emu10k1_wavedevice *wave_dev) -{ - struct emu10k1_card *card = wave_dev->card; - struct woinst *woinst = wave_dev->woinst; - unsigned int voicenum; - - DPF(2, "emu10k1_waveout_close()\n"); - - emu10k1_waveout_stop(wave_dev); - - emu10k1_timer_uninstall(card, &woinst->timer); - - for (voicenum = 0; voicenum < woinst->num_voices; voicenum++) { - emu10k1_voice_free(&woinst->voice[voicenum]); - emu10k1_voice_free_buffer(card, &woinst->voice[voicenum].mem); - } - - woinst->state = WAVE_STATE_CLOSED; -} - -void emu10k1_waveout_start(struct emu10k1_wavedevice *wave_dev) -{ - struct emu10k1_card *card = wave_dev->card; - struct woinst *woinst = wave_dev->woinst; - struct pt_data *pt = &card->pt; - - DPF(2, "emu10k1_waveout_start()\n"); - - if (woinst->format.passthrough == 2) { - emu10k1_pt_setup(wave_dev); - sblive_writeptr(card, (card->is_audigy ? A_GPR_BASE : GPR_BASE) + pt->enable_gpr, 0, 1); - pt->state = PT_STATE_PLAYING; - } - - /* Actual start */ - emu10k1_voices_start(woinst->voice, woinst->num_voices, woinst->total_played); - - emu10k1_timer_enable(card, &woinst->timer); - - woinst->state |= WAVE_STATE_STARTED; -} - -int emu10k1_waveout_setformat(struct emu10k1_wavedevice *wave_dev, struct wave_format *format) -{ - struct emu10k1_card *card = wave_dev->card; - struct woinst *woinst = wave_dev->woinst; - unsigned int voicenum; - u16 delay; - - DPF(2, "emu10k1_waveout_setformat()\n"); - - if (woinst->state & WAVE_STATE_STARTED) - return -1; - - query_format(wave_dev, format); - - if (woinst->format.samplingrate != format->samplingrate || - woinst->format.channels != format->channels || - woinst->format.bitsperchannel != format->bitsperchannel) { - - woinst->format = *format; - - if (woinst->state == WAVE_STATE_CLOSED) - return 0; - - emu10k1_timer_uninstall(card, &woinst->timer); - - for (voicenum = 0; voicenum < woinst->num_voices; voicenum++) { - emu10k1_voice_free(&woinst->voice[voicenum]); - - if (get_voice(card, woinst, voicenum) < 0) { - ERROR(); - emu10k1_waveout_close(wave_dev); - return -1; - } - } - - delay = (48000 * woinst->buffer.fragment_size) / - (woinst->format.samplingrate * woinst->format.bytespervoicesample); - - emu10k1_timer_install(card, &woinst->timer, delay); - } - - return 0; -} - -void emu10k1_waveout_stop(struct emu10k1_wavedevice *wave_dev) -{ - struct emu10k1_card *card = wave_dev->card; - struct woinst *woinst = wave_dev->woinst; - - DPF(2, "emu10k1_waveout_stop()\n"); - - if (!(woinst->state & WAVE_STATE_STARTED)) - return; - - emu10k1_timer_disable(card, &woinst->timer); - - /* Stop actual voices */ - emu10k1_voices_stop(woinst->voice, woinst->num_voices); - - emu10k1_waveout_update(woinst); - - woinst->state &= ~WAVE_STATE_STARTED; -} - -/** - * emu10k1_waveout_getxfersize - - * - * gives the total free bytes on the voice buffer, including silence bytes - * (basically: total_free_bytes = free_bytes + silence_bytes). - * - */ -void emu10k1_waveout_getxfersize(struct woinst *woinst, u32 *total_free_bytes) -{ - struct waveout_buffer *buffer = &woinst->buffer; - int pending_bytes; - - if (woinst->mmapped) { - *total_free_bytes = buffer->free_bytes; - return; - } - - pending_bytes = buffer->size - buffer->free_bytes; - - buffer->fill_silence = (pending_bytes < (signed) buffer->fragment_size * 2) ? 1 : 0; - - if (pending_bytes > (signed) buffer->silence_bytes) { - *total_free_bytes = (buffer->free_bytes + buffer->silence_bytes); - } else { - *total_free_bytes = buffer->size; - buffer->silence_bytes = pending_bytes; - if (pending_bytes < 0) { - buffer->silence_pos = buffer->hw_pos; - buffer->silence_bytes = 0; - buffer->free_bytes = buffer->size; - DPF(1, "buffer underrun\n"); - } - } -} - -/** - * copy_block - - * - * copies a block of pcm data to a voice buffer. - * Notice that the voice buffer is actually a set of disjointed memory pages. - * - */ -static void copy_block(void **dst, u32 str, u8 __user *src, u32 len) -{ - unsigned int pg; - unsigned int pgoff; - unsigned int k; - - pg = str / PAGE_SIZE; - pgoff = str % PAGE_SIZE; - - if (len > PAGE_SIZE - pgoff) { - k = PAGE_SIZE - pgoff; - if (__copy_from_user((u8 *)dst[pg] + pgoff, src, k)) - return; - len -= k; - while (len > PAGE_SIZE) { - if (__copy_from_user(dst[++pg], src + k, PAGE_SIZE)) - return; - k += PAGE_SIZE; - len -= PAGE_SIZE; - } - if (__copy_from_user(dst[++pg], src + k, len)) - return; - - } else - __copy_from_user((u8 *)dst[pg] + pgoff, src, len); -} - -/** - * copy_ilv_block - - * - * copies a block of pcm data containing n interleaved channels to n mono voice buffers. - * Notice that the voice buffer is actually a set of disjointed memory pages. - * - */ -static void copy_ilv_block(struct woinst *woinst, u32 str, u8 __user *src, u32 len) -{ - unsigned int pg; - unsigned int pgoff; - unsigned int voice_num; - struct emu_voice *voice = woinst->voice; - - pg = str / PAGE_SIZE; - pgoff = str % PAGE_SIZE; - - while (len) { - for (voice_num = 0; voice_num < woinst->num_voices; voice_num++) { - if (__copy_from_user((u8 *)(voice[voice_num].mem.addr[pg]) + pgoff, src, woinst->format.bytespervoicesample)) - return; - src += woinst->format.bytespervoicesample; - } - - len -= woinst->format.bytespervoicesample; - - pgoff += woinst->format.bytespervoicesample; - if (pgoff >= PAGE_SIZE) { - pgoff = 0; - pg++; - } - } -} - -/** - * fill_block - - * - * fills a set voice buffers with a block of a given sample. - * - */ -static void fill_block(struct woinst *woinst, u32 str, u8 data, u32 len) -{ - unsigned int pg; - unsigned int pgoff; - unsigned int voice_num; - struct emu_voice *voice = woinst->voice; - unsigned int k; - - pg = str / PAGE_SIZE; - pgoff = str % PAGE_SIZE; - - if (len > PAGE_SIZE - pgoff) { - k = PAGE_SIZE - pgoff; - for (voice_num = 0; voice_num < woinst->num_voices; voice_num++) - memset((u8 *)voice[voice_num].mem.addr[pg] + pgoff, data, k); - len -= k; - while (len > PAGE_SIZE) { - pg++; - for (voice_num = 0; voice_num < woinst->num_voices; voice_num++) - memset(voice[voice_num].mem.addr[pg], data, PAGE_SIZE); - - len -= PAGE_SIZE; - } - pg++; - for (voice_num = 0; voice_num < woinst->num_voices; voice_num++) - memset(voice[voice_num].mem.addr[pg], data, len); - - } else { - for (voice_num = 0; voice_num < woinst->num_voices; voice_num++) - memset((u8 *)voice[voice_num].mem.addr[pg] + pgoff, data, len); - } -} - -/** - * emu10k1_waveout_xferdata - - * - * copies pcm data to the voice buffer. Silence samples - * previously added to the buffer are overwritten. - * - */ -void emu10k1_waveout_xferdata(struct woinst *woinst, u8 __user *data, u32 *size) -{ - struct waveout_buffer *buffer = &woinst->buffer; - struct voice_mem *mem = &woinst->voice[0].mem; - u32 sizetocopy, sizetocopy_now, start; - unsigned long flags; - - sizetocopy = min_t(u32, buffer->size, *size); - *size = sizetocopy; - - if (!sizetocopy) - return; - - spin_lock_irqsave(&woinst->lock, flags); - start = (buffer->size + buffer->silence_pos - buffer->silence_bytes) % buffer->size; - - if (sizetocopy > buffer->silence_bytes) { - buffer->silence_pos += sizetocopy - buffer->silence_bytes; - buffer->free_bytes -= sizetocopy - buffer->silence_bytes; - buffer->silence_bytes = 0; - } else - buffer->silence_bytes -= sizetocopy; - - spin_unlock_irqrestore(&woinst->lock, flags); - - sizetocopy_now = buffer->size - start; - if (sizetocopy > sizetocopy_now) { - sizetocopy -= sizetocopy_now; - if (woinst->num_voices > 1) { - copy_ilv_block(woinst, start, data, sizetocopy_now); - copy_ilv_block(woinst, 0, data + sizetocopy_now * woinst->num_voices, sizetocopy); - } else { - copy_block(mem->addr, start, data, sizetocopy_now); - copy_block(mem->addr, 0, data + sizetocopy_now, sizetocopy); - } - } else { - if (woinst->num_voices > 1) - copy_ilv_block(woinst, start, data, sizetocopy); - else - copy_block(mem->addr, start, data, sizetocopy); - } -} - -/** - * emu10k1_waveout_fillsilence - - * - * adds samples of silence to the voice buffer so that we - * don't loop over stale pcm data. - * - */ -void emu10k1_waveout_fillsilence(struct woinst *woinst) -{ - struct waveout_buffer *buffer = &woinst->buffer; - u32 sizetocopy, sizetocopy_now, start; - u8 filldata; - unsigned long flags; - - sizetocopy = buffer->fragment_size; - - if (woinst->format.bitsperchannel == 16) - filldata = 0x00; - else - filldata = 0x80; - - spin_lock_irqsave(&woinst->lock, flags); - buffer->silence_bytes += sizetocopy; - buffer->free_bytes -= sizetocopy; - buffer->silence_pos %= buffer->size; - start = buffer->silence_pos; - buffer->silence_pos += sizetocopy; - spin_unlock_irqrestore(&woinst->lock, flags); - - sizetocopy_now = buffer->size - start; - - if (sizetocopy > sizetocopy_now) { - sizetocopy -= sizetocopy_now; - fill_block(woinst, start, filldata, sizetocopy_now); - fill_block(woinst, 0, filldata, sizetocopy); - } else { - fill_block(woinst, start, filldata, sizetocopy); - } -} - -/** - * emu10k1_waveout_update - - * - * updates the position of the voice buffer hardware pointer (hw_pos) - * and the number of free bytes on the buffer (free_bytes). - * The free bytes _don't_ include silence bytes that may have been - * added to the buffer. - * - */ -void emu10k1_waveout_update(struct woinst *woinst) -{ - u32 hw_pos; - u32 diff; - - /* There is no actual start yet */ - if (!(woinst->state & WAVE_STATE_STARTED)) { - hw_pos = woinst->buffer.hw_pos; - } else { - /* hw_pos in sample units */ - hw_pos = sblive_readptr(woinst->voice[0].card, CCCA_CURRADDR, woinst->voice[0].num); - - if(hw_pos < woinst->voice[0].start) - hw_pos += woinst->buffer.size / woinst->format.bytespervoicesample - woinst->voice[0].start; - else - hw_pos -= woinst->voice[0].start; - - hw_pos *= woinst->format.bytespervoicesample; - } - - diff = (woinst->buffer.size + hw_pos - woinst->buffer.hw_pos) % woinst->buffer.size; - woinst->total_played += diff; - woinst->buffer.free_bytes += diff; - woinst->buffer.hw_pos = hw_pos; -} diff --git a/sound/oss/emu10k1/cardwo.h b/sound/oss/emu10k1/cardwo.h deleted file mode 100644 index 1dece8853e5..00000000000 --- a/sound/oss/emu10k1/cardwo.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - ********************************************************************** - * cardwo.h -- header file for card wave out functions - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _CARDWO_H -#define _CARDWO_H - -#include "icardwav.h" -#include "audio.h" -#include "voicemgr.h" -#include "timer.h" - -/* setting this to other than a power of two may break some applications */ -#define WAVEOUT_MAXBUFSIZE MAXBUFSIZE - -#define WAVEOUT_DEFAULTFRAGLEN 20 /* Time to play a fragment in ms (latency) */ -#define WAVEOUT_DEFAULTBUFLEN 500 /* Time to play the entire buffer in ms */ - -#define WAVEOUT_MINFRAGSHIFT 6 /* Minimum fragment size in bytes is 2^6 */ -#define WAVEOUT_MINFRAGS 3 /* _don't_ go bellow 3, it would break silence filling */ -#define WAVEOUT_MAXVOICES 6 - -struct waveout_buffer { - u16 ossfragshift; - u32 numfrags; - u32 fragment_size; /* in bytes units */ - u32 size; /* in bytes units */ - u32 pages; /* buffer size in page units*/ - u32 silence_pos; /* software cursor position (including silence bytes) */ - u32 hw_pos; /* hardware cursor position */ - u32 free_bytes; /* free bytes available on the buffer (not including silence bytes) */ - u8 fill_silence; - u32 silence_bytes; /* silence bytes on the buffer */ -}; - -struct woinst -{ - u8 state; - u8 num_voices; - struct emu_voice voice[WAVEOUT_MAXVOICES]; - struct emu_timer timer; - struct wave_format format; - struct waveout_buffer buffer; - wait_queue_head_t wait_queue; - u8 mmapped; - u32 total_copied; /* total number of bytes written() to the buffer (excluding silence) */ - u32 total_played; /* total number of bytes played including silence */ - u32 blocks; - u8 device; - spinlock_t lock; -}; - -int emu10k1_waveout_open(struct emu10k1_wavedevice *); -void emu10k1_waveout_close(struct emu10k1_wavedevice *); -void emu10k1_waveout_start(struct emu10k1_wavedevice *); -void emu10k1_waveout_stop(struct emu10k1_wavedevice *); -void emu10k1_waveout_getxfersize(struct woinst*, u32 *); -void emu10k1_waveout_xferdata(struct woinst*, u8 __user *, u32 *); -void emu10k1_waveout_fillsilence(struct woinst*); -int emu10k1_waveout_setformat(struct emu10k1_wavedevice*, struct wave_format*); -void emu10k1_waveout_update(struct woinst*); - -#endif /* _CARDWO_H */ diff --git a/sound/oss/emu10k1/ecard.c b/sound/oss/emu10k1/ecard.c deleted file mode 100644 index 4ae635fe140..00000000000 --- a/sound/oss/emu10k1/ecard.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - ********************************************************************** - * ecard.c - E-card initialization code - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include "ecard.h" -#include "hwaccess.h" - -/* Private routines */ -static void ecard_setadcgain(struct emu10k1_card *, struct ecard_state *, u16); -static void ecard_write(struct emu10k1_card *, u32); - -/************************************************************************** - * @func Set the gain of the ECARD's CS3310 Trim/gain controller. The - * trim value consists of a 16bit value which is composed of two - * 8 bit gain/trim values, one for the left channel and one for the - * right channel. The following table maps from the Gain/Attenuation - * value in decibels into the corresponding bit pattern for a single - * channel. - */ - -static void ecard_setadcgain(struct emu10k1_card *card, struct ecard_state *ecard, u16 gain) -{ - u32 currbit; - ecard->adc_gain = gain; - - /* Enable writing to the TRIM registers */ - ecard_write(card, ecard->control_bits & ~EC_TRIM_CSN); - - /* Do it again to insure that we meet hold time requirements */ - ecard_write(card, ecard->control_bits & ~EC_TRIM_CSN); - - for (currbit = (1L << 15); currbit; currbit >>= 1) { - - u32 value = ecard->control_bits & ~(EC_TRIM_CSN|EC_TRIM_SDATA); - - if (gain & currbit) - value |= EC_TRIM_SDATA; - - /* Clock the bit */ - ecard_write(card, value); - ecard_write(card, value | EC_TRIM_SCLK); - ecard_write(card, value); - } - - ecard_write(card, ecard->control_bits); -} - -/************************************************************************** - * @func Clock bits into the Ecard's control latch. The Ecard uses a - * control latch will is loaded bit-serially by toggling the Modem control - * lines from function 2 on the E8010. This function hides these details - * and presents the illusion that we are actually writing to a distinct - * register. - */ -static void ecard_write(struct emu10k1_card *card, u32 value) -{ - u16 count; - u32 data, hcvalue; - unsigned long flags; - - spin_lock_irqsave(&card->lock, flags); - - hcvalue = inl(card->iobase + HCFG) & ~(HOOKN_BIT|HANDN_BIT|PULSEN_BIT); - - outl(card->iobase + HCFG, hcvalue); - - for (count = 0 ; count < EC_NUM_CONTROL_BITS; count++) { - - /* Set up the value */ - data = ((value & 0x1) ? PULSEN_BIT : 0); - value >>= 1; - - outl(card->iobase + HCFG, hcvalue | data); - - /* Clock the shift register */ - outl(card->iobase + HCFG, hcvalue | data | HANDN_BIT); - outl(card->iobase + HCFG, hcvalue | data); - } - - /* Latch the bits */ - outl(card->iobase + HCFG, hcvalue | HOOKN_BIT); - outl(card->iobase + HCFG, hcvalue); - - spin_unlock_irqrestore(&card->lock, flags); -} - -void __devinit emu10k1_ecard_init(struct emu10k1_card *card) -{ - u32 hcvalue; - struct ecard_state ecard; - - /* Set up the initial settings */ - ecard.mux0_setting = EC_DEFAULT_SPDIF0_SEL; - ecard.mux1_setting = EC_DEFAULT_SPDIF1_SEL; - ecard.mux2_setting = 0; - ecard.adc_gain = EC_DEFAULT_ADC_GAIN; - ecard.control_bits = EC_RAW_RUN_MODE | - EC_SPDIF0_SELECT(ecard.mux0_setting) | - EC_SPDIF1_SELECT(ecard.mux1_setting); - - - /* Step 0: Set the codec type in the hardware control register - * and enable audio output */ - hcvalue = emu10k1_readfn0(card, HCFG); - emu10k1_writefn0(card, HCFG, hcvalue | HCFG_AUDIOENABLE | HCFG_CODECFORMAT_I2S); - - /* Step 1: Turn off the led and deassert TRIM_CS */ - ecard_write(card, EC_ADCCAL | EC_LEDN | EC_TRIM_CSN); - - /* Step 2: Calibrate the ADC and DAC */ - ecard_write(card, EC_DACCAL | EC_LEDN | EC_TRIM_CSN); - - /* Step 3: Wait for awhile; FIXME: Is this correct? */ - - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ); - - /* Step 4: Switch off the DAC and ADC calibration. Note - * That ADC_CAL is actually an inverted signal, so we assert - * it here to stop calibration. */ - ecard_write(card, EC_ADCCAL | EC_LEDN | EC_TRIM_CSN); - - /* Step 4: Switch into run mode */ - ecard_write(card, ecard.control_bits); - - /* Step 5: Set the analog input gain */ - ecard_setadcgain(card, &ecard, ecard.adc_gain); -} - - diff --git a/sound/oss/emu10k1/ecard.h b/sound/oss/emu10k1/ecard.h deleted file mode 100644 index 67aead16e8e..00000000000 --- a/sound/oss/emu10k1/ecard.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - ********************************************************************** - * ecard.h - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _ECARD_H -#define _ECARD_H - -#include "8010.h" -#include "hwaccess.h" -#include <linux/init.h> - -/* In A1 Silicon, these bits are in the HC register */ -#define HOOKN_BIT (1L << 12) -#define HANDN_BIT (1L << 11) -#define PULSEN_BIT (1L << 10) - -#define EC_GDI1 (1 << 13) -#define EC_GDI0 (1 << 14) - -#define EC_NUM_CONTROL_BITS 20 - -#define EC_AC3_DATA_SELN 0x0001L -#define EC_EE_DATA_SEL 0x0002L -#define EC_EE_CNTRL_SELN 0x0004L -#define EC_EECLK 0x0008L -#define EC_EECS 0x0010L -#define EC_EESDO 0x0020L -#define EC_TRIM_CSN 0x0040L -#define EC_TRIM_SCLK 0x0080L -#define EC_TRIM_SDATA 0x0100L -#define EC_TRIM_MUTEN 0x0200L -#define EC_ADCCAL 0x0400L -#define EC_ADCRSTN 0x0800L -#define EC_DACCAL 0x1000L -#define EC_DACMUTEN 0x2000L -#define EC_LEDN 0x4000L - -#define EC_SPDIF0_SEL_SHIFT 15 -#define EC_SPDIF1_SEL_SHIFT 17 -#define EC_SPDIF0_SEL_MASK (0x3L << EC_SPDIF0_SEL_SHIFT) -#define EC_SPDIF1_SEL_MASK (0x7L << EC_SPDIF1_SEL_SHIFT) -#define EC_SPDIF0_SELECT(_x) (((_x) << EC_SPDIF0_SEL_SHIFT) & EC_SPDIF0_SEL_MASK) -#define EC_SPDIF1_SELECT(_x) (((_x) << EC_SPDIF1_SEL_SHIFT) & EC_SPDIF1_SEL_MASK) -#define EC_CURRENT_PROM_VERSION 0x01 /* Self-explanatory. This should - * be incremented any time the EEPROM's - * format is changed. */ - -#define EC_EEPROM_SIZE 0x40 /* ECARD EEPROM has 64 16-bit words */ - -/* Addresses for special values stored in to EEPROM */ -#define EC_PROM_VERSION_ADDR 0x20 /* Address of the current prom version */ -#define EC_BOARDREV0_ADDR 0x21 /* LSW of board rev */ -#define EC_BOARDREV1_ADDR 0x22 /* MSW of board rev */ - -#define EC_LAST_PROMFILE_ADDR 0x2f - -#define EC_SERIALNUM_ADD 0x30 /* First word of serial number. The number - * can be up to 30 characters in length - * and is stored as a NULL-terminated - * ASCII string. Any unused bytes must be - * filled with zeros */ -#define EC_CHECKSUM_ADDR 0x3f /* Location at which checksum is stored */ - - - -/* Most of this stuff is pretty self-evident. According to the hardware - * dudes, we need to leave the ADCCAL bit low in order to avoid a DC - * offset problem. Weird. - */ -#define EC_RAW_RUN_MODE (EC_DACMUTEN | EC_ADCRSTN | EC_TRIM_MUTEN | EC_TRIM_CSN) - - -#define EC_DEFAULT_ADC_GAIN 0xC4C4 -#define EC_DEFAULT_SPDIF0_SEL 0x0 -#define EC_DEFAULT_SPDIF1_SEL 0x4 - -#define HC_EA 0x01L - -/* ECARD state structure. This structure maintains the state - * for various portions of the ECARD's onboard hardware. - */ -struct ecard_state { - u32 control_bits; - u16 adc_gain; - u16 mux0_setting; - u16 mux1_setting; - u16 mux2_setting; -}; - -void emu10k1_ecard_init(struct emu10k1_card *) __devinit; - -#endif /* _ECARD_H */ diff --git a/sound/oss/emu10k1/efxmgr.c b/sound/oss/emu10k1/efxmgr.c deleted file mode 100644 index 7d5865de4c2..00000000000 --- a/sound/oss/emu10k1/efxmgr.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - ********************************************************************** - * efxmgr.c - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include <linux/bitops.h> -#include "hwaccess.h" -#include "efxmgr.h" - -int emu10k1_find_control_gpr(struct patch_manager *mgr, const char *patch_name, const char *gpr_name) -{ - struct dsp_patch *patch; - struct dsp_rpatch *rpatch; - char s[PATCH_NAME_SIZE + 4]; - unsigned long *gpr_used; - int i; - - DPD(2, "emu10k1_find_control_gpr(): %s %s\n", patch_name, gpr_name); - - rpatch = &mgr->rpatch; - if (!strcmp(rpatch->name, patch_name)) { - gpr_used = rpatch->gpr_used; - goto match; - } - - for (i = 0; i < mgr->current_pages * PATCHES_PER_PAGE; i++) { - patch = PATCH(mgr, i); - sprintf(s,"%s", patch->name); - - if (!strcmp(s, patch_name)) { - gpr_used = patch->gpr_used; - goto match; - } - } - - return -1; - - match: - for (i = 0; i < NUM_GPRS; i++) - if (mgr->gpr[i].type == GPR_TYPE_CONTROL && - test_bit(i, gpr_used) && - !strcmp(mgr->gpr[i].name, gpr_name)) - return i; - - return -1; -} - -void emu10k1_set_control_gpr(struct emu10k1_card *card, int addr, s32 val, int flag) -{ - struct patch_manager *mgr = &card->mgr; - - DPD(2, "emu10k1_set_control_gpr(): %d %x\n", addr, val); - - if (addr < 0 || addr >= NUM_GPRS) - return; - - //fixme: once patch manager is up, remember to fix this for the audigy - if (card->is_audigy) { - sblive_writeptr(card, A_GPR_BASE + addr, 0, val); - } else { - if (flag) - val += sblive_readptr(card, GPR_BASE + addr, 0); - if (val > mgr->gpr[addr].max) - val = mgr->gpr[addr].max; - else if (val < mgr->gpr[addr].min) - val = mgr->gpr[addr].min; - sblive_writeptr(card, GPR_BASE + addr, 0, val); - } - - -} - -//TODO: make this configurable: -#define VOLCTRL_CHANNEL SOUND_MIXER_VOLUME -#define VOLCTRL_STEP_SIZE 5 - -//An internal function for setting OSS mixer controls. -static void emu10k1_set_oss_vol(struct emu10k1_card *card, int oss_mixer, - unsigned int left, unsigned int right) -{ - extern char volume_params[SOUND_MIXER_NRDEVICES]; - - card->ac97->mixer_state[oss_mixer] = (right << 8) | left; - - if (!card->is_aps) - card->ac97->write_mixer(card->ac97, oss_mixer, left, right); - - emu10k1_set_volume_gpr(card, card->mgr.ctrl_gpr[oss_mixer][0], left, - volume_params[oss_mixer]); - - emu10k1_set_volume_gpr(card, card->mgr.ctrl_gpr[oss_mixer][1], right, - volume_params[oss_mixer]); -} - -//FIXME: mute should unmute when pressed a second time -void emu10k1_mute_irqhandler(struct emu10k1_card *card) -{ - int oss_channel = VOLCTRL_CHANNEL; - int left, right; - static int val; - - if (val) { - left = val & 0xff; - right = (val >> 8) & 0xff; - val = 0; - } else { - val = card->ac97->mixer_state[oss_channel]; - left = 0; - right = 0; - } - - emu10k1_set_oss_vol(card, oss_channel, left, right); -} - -void emu10k1_volincr_irqhandler(struct emu10k1_card *card) -{ - int oss_channel = VOLCTRL_CHANNEL; - int left, right; - - left = card->ac97->mixer_state[oss_channel] & 0xff; - right = (card->ac97->mixer_state[oss_channel] >> 8) & 0xff; - - if ((left += VOLCTRL_STEP_SIZE) > 100) - left = 100; - - if ((right += VOLCTRL_STEP_SIZE) > 100) - right = 100; - - emu10k1_set_oss_vol(card, oss_channel, left, right); -} - -void emu10k1_voldecr_irqhandler(struct emu10k1_card *card) -{ - int oss_channel = VOLCTRL_CHANNEL; - int left, right; - - left = card->ac97->mixer_state[oss_channel] & 0xff; - right = (card->ac97->mixer_state[oss_channel] >> 8) & 0xff; - - if ((left -= VOLCTRL_STEP_SIZE) < 0) - left = 0; - - if ((right -= VOLCTRL_STEP_SIZE) < 0) - right = 0; - - emu10k1_set_oss_vol(card, oss_channel, left, right); -} - -void emu10k1_set_volume_gpr(struct emu10k1_card *card, int addr, s32 vol, int scale) -{ - struct patch_manager *mgr = &card->mgr; - unsigned long flags; - - static const s32 log2lin[4] ={ // attenuation (dB) - 0x7fffffff, // 0.0 - 0x7fffffff * 0.840896415253715 , // 1.5 - 0x7fffffff * 0.707106781186548, // 3.0 - 0x7fffffff * 0.594603557501361 , // 4.5 - }; - - if (addr < 0) - return; - - vol = (100 - vol ) * scale / 100; - - // Thanks to the comp.dsp newsgroup for this neat trick: - vol = (vol >= scale) ? 0 : (log2lin[vol & 3] >> (vol >> 2)); - - spin_lock_irqsave(&mgr->lock, flags); - emu10k1_set_control_gpr(card, addr, vol, 0); - spin_unlock_irqrestore(&mgr->lock, flags); -} - -void emu10k1_dsp_irqhandler(struct emu10k1_card *card) -{ - unsigned long flags; - - if (card->pt.state != PT_STATE_INACTIVE) { - u32 bc; - bc = sblive_readptr(card, GPR_BASE + card->pt.intr_gpr, 0); - if (bc != 0) { - DPD(3, "pt interrupt, bc = %d\n", bc); - spin_lock_irqsave(&card->pt.lock, flags); - card->pt.blocks_played = bc; - if (card->pt.blocks_played >= card->pt.blocks_copied) { - DPF(1, "buffer underrun in passthrough playback\n"); - emu10k1_pt_stop(card); - } - wake_up_interruptible(&card->pt.wait); - spin_unlock_irqrestore(&card->pt.lock, flags); - } - } -} - diff --git a/sound/oss/emu10k1/efxmgr.h b/sound/oss/emu10k1/efxmgr.h deleted file mode 100644 index ef48e5c70d1..00000000000 --- a/sound/oss/emu10k1/efxmgr.h +++ /dev/null @@ -1,270 +0,0 @@ -/* - ********************************************************************** - * sblive_fx.h - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _EFXMGR_H -#define _EFXMGR_H - -struct emu_efx_info_t{ - int opcode_shift; - int high_operand_shift; - int instruction_start; - int gpr_base; - int output_base; -}; - - -#define WRITE_EFX(a, b, c) sblive_writeptr((a), emu_efx_info[card->is_audigy].instruction_start + (b), 0, (c)) - -#define OP(op, z, w, x, y) \ - do { WRITE_EFX(card, (pc) * 2, ((x) << emu_efx_info[card->is_audigy].high_operand_shift) | (y)); \ - WRITE_EFX(card, (pc) * 2 + 1, ((op) << emu_efx_info[card->is_audigy].opcode_shift ) | ((z) << emu_efx_info[card->is_audigy].high_operand_shift) | (w)); \ - ++pc; } while (0) - -#define NUM_INPUTS 0x20 -#define NUM_OUTPUTS 0x20 -#define NUM_GPRS 0x100 - -#define A_NUM_INPUTS 0x60 -#define A_NUM_OUTPUTS 0x60 //fixme: this may or may not be true -#define A_NUM_GPRS 0x200 - -#define GPR_NAME_SIZE 32 -#define PATCH_NAME_SIZE 32 - -struct dsp_rpatch { - char name[PATCH_NAME_SIZE]; - u16 code_start; - u16 code_size; - - unsigned long gpr_used[NUM_GPRS / (sizeof(unsigned long) * 8) + 1]; - unsigned long gpr_input[NUM_GPRS / (sizeof(unsigned long) * 8) + 1]; - unsigned long route[NUM_OUTPUTS]; - unsigned long route_v[NUM_OUTPUTS]; -}; - -struct dsp_patch { - char name[PATCH_NAME_SIZE]; - u8 id; - unsigned long input; /* bitmap of the lines used as inputs */ - unsigned long output; /* bitmap of the lines used as outputs */ - u16 code_start; - u16 code_size; - - unsigned long gpr_used[NUM_GPRS / (sizeof(unsigned long) * 8) + 1]; /* bitmap of used gprs */ - unsigned long gpr_input[NUM_GPRS / (sizeof(unsigned long) * 8) + 1]; - u8 traml_istart; /* starting address of the internal tram lines used */ - u8 traml_isize; /* number of internal tram lines used */ - - u8 traml_estart; - u8 traml_esize; - - u16 tramb_istart; /* starting address of the internal tram memory used */ - u16 tramb_isize; /* amount of internal memory used */ - u32 tramb_estart; - u32 tramb_esize; -}; - -struct dsp_gpr { - u8 type; /* gpr type, STATIC, DYNAMIC, INPUT, OUTPUT, CONTROL */ - char name[GPR_NAME_SIZE]; /* gpr value, only valid for control gprs */ - s32 min, max; /* value range for this gpr, only valid for control gprs */ - u8 line; /* which input/output line is the gpr attached, only valid for input/output gprs */ - u8 usage; -}; - -enum { - GPR_TYPE_NULL = 0, - GPR_TYPE_IO, - GPR_TYPE_STATIC, - GPR_TYPE_DYNAMIC, - GPR_TYPE_CONTROL, - GPR_TYPE_CONSTANT -}; - -#define GPR_BASE 0x100 -#define OUTPUT_BASE 0x20 - -#define A_GPR_BASE 0x400 -#define A_OUTPUT_BASE 0x60 - -#define MAX_PATCHES_PAGES 32 - -struct patch_manager { - void *patch[MAX_PATCHES_PAGES]; - int current_pages; - struct dsp_rpatch rpatch; - struct dsp_gpr gpr[NUM_GPRS]; /* gpr usage table */ - spinlock_t lock; - s16 ctrl_gpr[SOUND_MIXER_NRDEVICES][2]; -}; - -#define PATCHES_PER_PAGE (PAGE_SIZE / sizeof(struct dsp_patch)) - -#define PATCH(mgr, i) ((struct dsp_patch *) (mgr)->patch[(i) / PATCHES_PER_PAGE] + (i) % PATCHES_PER_PAGE) - -/* PCM volume control */ -#define TMP_PCM_L 0x100 //temp PCM L (after the vol control) -#define TMP_PCM_R 0x101 -#define VOL_PCM_L 0x102 //vol PCM -#define VOL_PCM_R 0x103 - -/* Routing patch */ -#define TMP_AC_L 0x104 //tmp ac97 out -#define TMP_AC_R 0x105 -#define TMP_REAR_L 0x106 //output - Temp Rear -#define TMP_REAR_R 0x107 -#define TMP_DIGI_L 0x108 //output - Temp digital -#define TMP_DIGI_R 0x109 -#define DSP_VOL_L 0x10a // main dsp volume -#define DSP_VOL_R 0x10b - -/* hw inputs */ -#define PCM_IN_L 0x00 -#define PCM_IN_R 0x01 - -#define PCM1_IN_L 0x04 -#define PCM1_IN_R 0x05 -//mutilchannel playback stream appear here: - -#define MULTI_FRONT_L 0x08 -#define MULTI_FRONT_R 0x09 -#define MULTI_REAR_L 0x0a -#define MULTI_REAR_R 0x0b -#define MULTI_CENTER 0x0c -#define MULTI_LFE 0x0d - -#define AC97_IN_L 0x10 -#define AC97_IN_R 0x11 -#define SPDIF_CD_L 0x12 -#define SPDIF_CD_R 0x13 - -/* hw outputs */ -#define AC97_FRONT_L 0x20 -#define AC97_FRONT_R 0x21 -#define DIGITAL_OUT_L 0x22 -#define DIGITAL_OUT_R 0x23 -#define DIGITAL_CENTER 0x24 -#define DIGITAL_LFE 0x25 - -#define ANALOG_REAR_L 0x28 -#define ANALOG_REAR_R 0x29 -#define ADC_REC_L 0x2a -#define ADC_REC_R 0x2b - -#define ANALOG_CENTER 0x31 -#define ANALOG_LFE 0x32 - - -#define INPUT_PATCH_START(patch, nm, ln, i) \ -do { \ - patch = PATCH(mgr, patch_n); \ - strcpy(patch->name, nm); \ - patch->code_start = pc * 2; \ - patch->input = (1<<(0x1f&ln)); \ - patch->output= (1<<(0x1f&ln)); \ - patch->id = i; \ -} while(0) - -#define INPUT_PATCH_END(patch) \ -do { \ - patch->code_size = pc * 2 - patch->code_start; \ - patch_n++; \ -} while(0) - - -#define ROUTING_PATCH_START(patch, nm) \ -do { \ - patch = &mgr->rpatch; \ - strcpy(patch->name, nm); \ - patch->code_start = pc * 2; \ -} while(0) - -#define ROUTING_PATCH_END(patch) \ -do { \ - patch->code_size = pc * 2 - patch->code_start; \ -} while(0) - -#define CONNECT(input, output) set_bit(input, &rpatch->route[(output) - OUTPUT_BASE]); - -#define CONNECT_V(input, output) set_bit(input, &rpatch->route_v[(output) - OUTPUT_BASE]); - -#define OUTPUT_PATCH_START(patch, nm, ln, i) \ -do { \ - patch = PATCH(mgr, patch_n); \ - strcpy(patch->name, nm); \ - patch->code_start = pc * 2; \ - patch->input = (1<<(0x1f&ln)); \ - patch->output= (1<<(0x1f&ln)); \ - patch->id = i; \ -} while(0) - -#define OUTPUT_PATCH_END(patch) \ -do { \ - patch->code_size = pc * 2 - patch->code_start; \ - patch_n++; \ -} while(0) - -#define GET_OUTPUT_GPR(patch, g, ln) \ -do { \ - mgr->gpr[(g) - GPR_BASE].type = GPR_TYPE_IO; \ - mgr->gpr[(g) - GPR_BASE].usage++; \ - mgr->gpr[(g) - GPR_BASE].line = ln; \ - set_bit((g) - GPR_BASE, patch->gpr_used); \ -} while(0) - -#define GET_INPUT_GPR(patch, g, ln) \ -do { \ - mgr->gpr[(g) - GPR_BASE].type = GPR_TYPE_IO; \ - mgr->gpr[(g) - GPR_BASE].usage++; \ - mgr->gpr[(g) - GPR_BASE].line = ln; \ - set_bit((g) - GPR_BASE, patch->gpr_used); \ - set_bit((g) - GPR_BASE, patch->gpr_input); \ -} while(0) - -#define GET_DYNAMIC_GPR(patch, g) \ -do { \ - mgr->gpr[(g) - GPR_BASE].type = GPR_TYPE_DYNAMIC; \ - mgr->gpr[(g) - GPR_BASE].usage++; \ - set_bit((g) - GPR_BASE, patch->gpr_used); \ -} while(0) - -#define GET_CONTROL_GPR(patch, g, nm, a, b) \ -do { \ - strcpy(mgr->gpr[(g) - GPR_BASE].name, nm); \ - mgr->gpr[(g) - GPR_BASE].type = GPR_TYPE_CONTROL; \ - mgr->gpr[(g) - GPR_BASE].usage++; \ - mgr->gpr[(g) - GPR_BASE].min = a; \ - mgr->gpr[(g) - GPR_BASE].max = b; \ - sblive_writeptr(card, g, 0, b); \ - set_bit((g) - GPR_BASE, patch->gpr_used); \ -} while(0) - -#endif /* _EFXMGR_H */ diff --git a/sound/oss/emu10k1/emuadxmg.c b/sound/oss/emu10k1/emuadxmg.c deleted file mode 100644 index d7d2d4caf7b..00000000000 --- a/sound/oss/emu10k1/emuadxmg.c +++ /dev/null @@ -1,104 +0,0 @@ - -/* - ********************************************************************** - * emuadxmg.c - Address space manager for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include "hwaccess.h" - -/* Allocates emu address space */ - -int emu10k1_addxmgr_alloc(u32 size, struct emu10k1_card *card) -{ - u16 *pagetable = card->emupagetable; - u16 index = 0; - u16 numpages; - unsigned long flags; - - /* Convert bytes to pages */ - numpages = (size / EMUPAGESIZE) + ((size % EMUPAGESIZE) ? 1 : 0); - - spin_lock_irqsave(&card->lock, flags); - - while (index < (MAXPAGES - 1)) { - if (pagetable[index] & 0x8000) { - /* This block of pages is in use, jump to the start of the next block. */ - index += (pagetable[index] & 0x7fff); - } else { - /* Found free block */ - if (pagetable[index] >= numpages) { - - /* Block is large enough */ - - /* If free block is larger than the block requested - * then adjust the size of the block remaining */ - if (pagetable[index] > numpages) - pagetable[index + numpages] = pagetable[index] - numpages; - - pagetable[index] = (numpages | 0x8000); /* Mark block as used */ - - spin_unlock_irqrestore(&card->lock, flags); - - return index; - } else { - /* Block too small, jump to the start of the next block */ - index += pagetable[index]; - } - } - } - - spin_unlock_irqrestore(&card->lock, flags); - - return -1; -} - -/* Frees a previously allocated emu address space. */ - -void emu10k1_addxmgr_free(struct emu10k1_card *card, int index) -{ - u16 *pagetable = card->emupagetable; - u16 origsize = 0; - unsigned long flags; - - spin_lock_irqsave(&card->lock, flags); - - if (pagetable[index] & 0x8000) { - /* Block is allocated - mark block as free */ - origsize = pagetable[index] & 0x7fff; - pagetable[index] = origsize; - - /* If next block is free, we concat both blocks */ - if (!(pagetable[index + origsize] & 0x8000)) - pagetable[index] += pagetable[index + origsize] & 0x7fff; - } - - spin_unlock_irqrestore(&card->lock, flags); - - return; -} diff --git a/sound/oss/emu10k1/hwaccess.c b/sound/oss/emu10k1/hwaccess.c deleted file mode 100644 index 2dc16a841fa..00000000000 --- a/sound/oss/emu10k1/hwaccess.c +++ /dev/null @@ -1,507 +0,0 @@ -/* - ********************************************************************** - * hwaccess.c -- Hardware access layer - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * December 9, 1999 Jon Taylor rewrote the I/O subsystem - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include <asm/io.h> - -#include "hwaccess.h" -#include "8010.h" -#include "icardmid.h" - -/************************************************************************* -* Function : srToPitch * -* Input : sampleRate - sampling rate * -* Return : pitch value * -* About : convert sampling rate to pitch * -* Note : for 8010, sampling rate is at 48kHz, this function should * -* be changed. * -*************************************************************************/ -u32 srToPitch(u32 sampleRate) -{ - int i; - - /* FIXME: These tables should be defined in a headerfile */ - static u32 logMagTable[128] = { - 0x00000, 0x02dfc, 0x05b9e, 0x088e6, 0x0b5d6, 0x0e26f, 0x10eb3, 0x13aa2, - 0x1663f, 0x1918a, 0x1bc84, 0x1e72e, 0x2118b, 0x23b9a, 0x2655d, 0x28ed5, - 0x2b803, 0x2e0e8, 0x30985, 0x331db, 0x359eb, 0x381b6, 0x3a93d, 0x3d081, - 0x3f782, 0x41e42, 0x444c1, 0x46b01, 0x49101, 0x4b6c4, 0x4dc49, 0x50191, - 0x5269e, 0x54b6f, 0x57006, 0x59463, 0x5b888, 0x5dc74, 0x60029, 0x623a7, - 0x646ee, 0x66a00, 0x68cdd, 0x6af86, 0x6d1fa, 0x6f43c, 0x7164b, 0x73829, - 0x759d4, 0x77b4f, 0x79c9a, 0x7bdb5, 0x7dea1, 0x7ff5e, 0x81fed, 0x8404e, - 0x86082, 0x88089, 0x8a064, 0x8c014, 0x8df98, 0x8fef1, 0x91e20, 0x93d26, - 0x95c01, 0x97ab4, 0x9993e, 0x9b79f, 0x9d5d9, 0x9f3ec, 0xa11d8, 0xa2f9d, - 0xa4d3c, 0xa6ab5, 0xa8808, 0xaa537, 0xac241, 0xadf26, 0xafbe7, 0xb1885, - 0xb3500, 0xb5157, 0xb6d8c, 0xb899f, 0xba58f, 0xbc15e, 0xbdd0c, 0xbf899, - 0xc1404, 0xc2f50, 0xc4a7b, 0xc6587, 0xc8073, 0xc9b3f, 0xcb5ed, 0xcd07c, - 0xceaec, 0xd053f, 0xd1f73, 0xd398a, 0xd5384, 0xd6d60, 0xd8720, 0xda0c3, - 0xdba4a, 0xdd3b4, 0xded03, 0xe0636, 0xe1f4e, 0xe384a, 0xe512c, 0xe69f3, - 0xe829f, 0xe9b31, 0xeb3a9, 0xecc08, 0xee44c, 0xefc78, 0xf148a, 0xf2c83, - 0xf4463, 0xf5c2a, 0xf73da, 0xf8b71, 0xfa2f0, 0xfba57, 0xfd1a7, 0xfe8df - }; - - static char logSlopeTable[128] = { - 0x5c, 0x5c, 0x5b, 0x5a, 0x5a, 0x59, 0x58, 0x58, - 0x57, 0x56, 0x56, 0x55, 0x55, 0x54, 0x53, 0x53, - 0x52, 0x52, 0x51, 0x51, 0x50, 0x50, 0x4f, 0x4f, - 0x4e, 0x4d, 0x4d, 0x4d, 0x4c, 0x4c, 0x4b, 0x4b, - 0x4a, 0x4a, 0x49, 0x49, 0x48, 0x48, 0x47, 0x47, - 0x47, 0x46, 0x46, 0x45, 0x45, 0x45, 0x44, 0x44, - 0x43, 0x43, 0x43, 0x42, 0x42, 0x42, 0x41, 0x41, - 0x41, 0x40, 0x40, 0x40, 0x3f, 0x3f, 0x3f, 0x3e, - 0x3e, 0x3e, 0x3d, 0x3d, 0x3d, 0x3c, 0x3c, 0x3c, - 0x3b, 0x3b, 0x3b, 0x3b, 0x3a, 0x3a, 0x3a, 0x39, - 0x39, 0x39, 0x39, 0x38, 0x38, 0x38, 0x38, 0x37, - 0x37, 0x37, 0x37, 0x36, 0x36, 0x36, 0x36, 0x35, - 0x35, 0x35, 0x35, 0x34, 0x34, 0x34, 0x34, 0x34, - 0x33, 0x33, 0x33, 0x33, 0x32, 0x32, 0x32, 0x32, - 0x32, 0x31, 0x31, 0x31, 0x31, 0x31, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f - }; - - if (sampleRate == 0) - return 0; /* Bail out if no leading "1" */ - - sampleRate *= 11185; /* Scale 48000 to 0x20002380 */ - - for (i = 31; i > 0; i--) { - if (sampleRate & 0x80000000) { /* Detect leading "1" */ - return (u32) (((s32) (i - 15) << 20) + - logMagTable[0x7f & (sampleRate >> 24)] + - (0x7f & (sampleRate >> 17)) * logSlopeTable[0x7f & (sampleRate >> 24)]); - } - sampleRate = sampleRate << 1; - } - - DPF(2, "srToPitch: BUG!\n"); - return 0; /* Should never reach this point */ -} - -/******************************************* -* write/read PCI function 0 registers * -********************************************/ -void emu10k1_writefn0(struct emu10k1_card *card, u32 reg, u32 data) -{ - unsigned long flags; - - if (reg & 0xff000000) { - u32 mask; - u8 size, offset; - - size = (reg >> 24) & 0x3f; - offset = (reg >> 16) & 0x1f; - mask = ((1 << size) - 1) << offset; - data = (data << offset) & mask; - reg &= 0x7f; - - spin_lock_irqsave(&card->lock, flags); - data |= inl(card->iobase + reg) & ~mask; - outl(data, card->iobase + reg); - spin_unlock_irqrestore(&card->lock, flags); - } else { - spin_lock_irqsave(&card->lock, flags); - outl(data, card->iobase + reg); - spin_unlock_irqrestore(&card->lock, flags); - } - - return; -} - -#ifdef DBGEMU -void emu10k1_writefn0_2(struct emu10k1_card *card, u32 reg, u32 data, int size) -{ - unsigned long flags; - - spin_lock_irqsave(&card->lock, flags); - - if (size == 32) - outl(data, card->iobase + (reg & 0x1F)); - else if (size == 16) - outw(data, card->iobase + (reg & 0x1F)); - else - outb(data, card->iobase + (reg & 0x1F)); - - spin_unlock_irqrestore(&card->lock, flags); - - return; -} -#endif /* DBGEMU */ - -u32 emu10k1_readfn0(struct emu10k1_card * card, u32 reg) -{ - u32 val; - unsigned long flags; - - if (reg & 0xff000000) { - u32 mask; - u8 size, offset; - - size = (reg >> 24) & 0x3f; - offset = (reg >> 16) & 0x1f; - mask = ((1 << size) - 1) << offset; - reg &= 0x7f; - - spin_lock_irqsave(&card->lock, flags); - val = inl(card->iobase + reg); - spin_unlock_irqrestore(&card->lock, flags); - - return (val & mask) >> offset; - } else { - spin_lock_irqsave(&card->lock, flags); - val = inl(card->iobase + reg); - spin_unlock_irqrestore(&card->lock, flags); - return val; - } -} - -void emu10k1_timer_set(struct emu10k1_card * card, u16 data) -{ - unsigned long flags; - - spin_lock_irqsave(&card->lock, flags); - outw(data & TIMER_RATE_MASK, card->iobase + TIMER); - spin_unlock_irqrestore(&card->lock, flags); -} - -/************************************************************************ -* write/read Emu10k1 pointer-offset register set, accessed through * -* the PTR and DATA registers * -*************************************************************************/ -#define A_PTR_ADDRESS_MASK 0x0fff0000 -void sblive_writeptr(struct emu10k1_card *card, u32 reg, u32 channel, u32 data) -{ - u32 regptr; - unsigned long flags; - - regptr = ((reg << 16) & A_PTR_ADDRESS_MASK) | (channel & PTR_CHANNELNUM_MASK); - - if (reg & 0xff000000) { - u32 mask; - u8 size, offset; - - size = (reg >> 24) & 0x3f; - offset = (reg >> 16) & 0x1f; - mask = ((1 << size) - 1) << offset; - data = (data << offset) & mask; - - spin_lock_irqsave(&card->lock, flags); - outl(regptr, card->iobase + PTR); - data |= inl(card->iobase + DATA) & ~mask; - outl(data, card->iobase + DATA); - spin_unlock_irqrestore(&card->lock, flags); - } else { - spin_lock_irqsave(&card->lock, flags); - outl(regptr, card->iobase + PTR); - outl(data, card->iobase + DATA); - spin_unlock_irqrestore(&card->lock, flags); - } -} - -/* ... : data, reg, ... , TAGLIST_END */ -void sblive_writeptr_tag(struct emu10k1_card *card, u32 channel, ...) -{ - va_list args; - - unsigned long flags; - u32 reg; - - va_start(args, channel); - - spin_lock_irqsave(&card->lock, flags); - while ((reg = va_arg(args, u32)) != TAGLIST_END) { - u32 data = va_arg(args, u32); - u32 regptr = (((reg << 16) & A_PTR_ADDRESS_MASK) - | (channel & PTR_CHANNELNUM_MASK)); - outl(regptr, card->iobase + PTR); - if (reg & 0xff000000) { - int size = (reg >> 24) & 0x3f; - int offset = (reg >> 16) & 0x1f; - u32 mask = ((1 << size) - 1) << offset; - data = (data << offset) & mask; - - data |= inl(card->iobase + DATA) & ~mask; - } - outl(data, card->iobase + DATA); - } - spin_unlock_irqrestore(&card->lock, flags); - - va_end(args); - - return; -} - -u32 sblive_readptr(struct emu10k1_card * card, u32 reg, u32 channel) -{ - u32 regptr, val; - unsigned long flags; - - regptr = ((reg << 16) & A_PTR_ADDRESS_MASK) | (channel & PTR_CHANNELNUM_MASK); - - if (reg & 0xff000000) { - u32 mask; - u8 size, offset; - - size = (reg >> 24) & 0x3f; - offset = (reg >> 16) & 0x1f; - mask = ((1 << size) - 1) << offset; - - spin_lock_irqsave(&card->lock, flags); - outl(regptr, card->iobase + PTR); - val = inl(card->iobase + DATA); - spin_unlock_irqrestore(&card->lock, flags); - - return (val & mask) >> offset; - } else { - spin_lock_irqsave(&card->lock, flags); - outl(regptr, card->iobase + PTR); - val = inl(card->iobase + DATA); - spin_unlock_irqrestore(&card->lock, flags); - - return val; - } -} - -void emu10k1_irq_enable(struct emu10k1_card *card, u32 irq_mask) -{ - u32 val; - unsigned long flags; - - DPF(2,"emu10k1_irq_enable()\n"); - - spin_lock_irqsave(&card->lock, flags); - val = inl(card->iobase + INTE) | irq_mask; - outl(val, card->iobase + INTE); - spin_unlock_irqrestore(&card->lock, flags); - return; -} - -void emu10k1_irq_disable(struct emu10k1_card *card, u32 irq_mask) -{ - u32 val; - unsigned long flags; - - DPF(2,"emu10k1_irq_disable()\n"); - - spin_lock_irqsave(&card->lock, flags); - val = inl(card->iobase + INTE) & ~irq_mask; - outl(val, card->iobase + INTE); - spin_unlock_irqrestore(&card->lock, flags); - return; -} - -void emu10k1_clear_stop_on_loop(struct emu10k1_card *card, u32 voicenum) -{ - /* Voice interrupt */ - if (voicenum >= 32) - sblive_writeptr(card, SOLEH | ((0x0100 | (voicenum - 32)) << 16), 0, 0); - else - sblive_writeptr(card, SOLEL | ((0x0100 | voicenum) << 16), 0, 0); - - return; -} - -static void sblive_wcwait(struct emu10k1_card *card, u32 wait) -{ - volatile unsigned uCount; - u32 newtime = 0, curtime; - - curtime = emu10k1_readfn0(card, WC_SAMPLECOUNTER); - while (wait--) { - uCount = 0; - while (uCount++ < TIMEOUT) { - newtime = emu10k1_readfn0(card, WC_SAMPLECOUNTER); - if (newtime != curtime) - break; - } - - if (uCount >= TIMEOUT) - break; - - curtime = newtime; - } -} - -u16 emu10k1_ac97_read(struct ac97_codec *codec, u8 reg) -{ - struct emu10k1_card *card = codec->private_data; - u16 data; - unsigned long flags; - - spin_lock_irqsave(&card->lock, flags); - - outb(reg, card->iobase + AC97ADDRESS); - data = inw(card->iobase + AC97DATA); - - spin_unlock_irqrestore(&card->lock, flags); - - return data; -} - -void emu10k1_ac97_write(struct ac97_codec *codec, u8 reg, u16 value) -{ - struct emu10k1_card *card = codec->private_data; - unsigned long flags; - - spin_lock_irqsave(&card->lock, flags); - - outb(reg, card->iobase + AC97ADDRESS); - outw(value, card->iobase + AC97DATA); - outb( AC97_EXTENDED_ID, card->iobase + AC97ADDRESS); - spin_unlock_irqrestore(&card->lock, flags); -} - -/********************************************************* -* MPU access functions * -**********************************************************/ - -int emu10k1_mpu_write_data(struct emu10k1_card *card, u8 data) -{ - unsigned long flags; - int ret; - - if (card->is_audigy) { - if ((sblive_readptr(card, A_MUSTAT,0) & MUSTAT_ORDYN) == 0) { - sblive_writeptr(card, A_MUDATA, 0, data); - ret = 0; - } else - ret = -1; - } else { - spin_lock_irqsave(&card->lock, flags); - - if ((inb(card->iobase + MUSTAT) & MUSTAT_ORDYN) == 0) { - outb(data, card->iobase + MUDATA); - ret = 0; - } else - ret = -1; - - spin_unlock_irqrestore(&card->lock, flags); - } - - return ret; -} - -int emu10k1_mpu_read_data(struct emu10k1_card *card, u8 * data) -{ - unsigned long flags; - int ret; - - if (card->is_audigy) { - if ((sblive_readptr(card, A_MUSTAT,0) & MUSTAT_IRDYN) == 0) { - *data = sblive_readptr(card, A_MUDATA,0); - ret = 0; - } else - ret = -1; - } else { - spin_lock_irqsave(&card->lock, flags); - - if ((inb(card->iobase + MUSTAT) & MUSTAT_IRDYN) == 0) { - *data = inb(card->iobase + MUDATA); - ret = 0; - } else - ret = -1; - - spin_unlock_irqrestore(&card->lock, flags); - } - - return ret; -} - -int emu10k1_mpu_reset(struct emu10k1_card *card) -{ - u8 status; - unsigned long flags; - - DPF(2, "emu10k1_mpu_reset()\n"); - if (card->is_audigy) { - if (card->mpuacqcount == 0) { - sblive_writeptr(card, A_MUCMD, 0, MUCMD_RESET); - sblive_wcwait(card, 8); - sblive_writeptr(card, A_MUCMD, 0, MUCMD_RESET); - sblive_wcwait(card, 8); - sblive_writeptr(card, A_MUCMD, 0, MUCMD_ENTERUARTMODE); - sblive_wcwait(card, 8); - status = sblive_readptr(card, A_MUDATA, 0); - if (status == 0xfe) - return 0; - else - return -1; - } - - return 0; - } else { - if (card->mpuacqcount == 0) { - spin_lock_irqsave(&card->lock, flags); - outb(MUCMD_RESET, card->iobase + MUCMD); - spin_unlock_irqrestore(&card->lock, flags); - - sblive_wcwait(card, 8); - - spin_lock_irqsave(&card->lock, flags); - outb(MUCMD_RESET, card->iobase + MUCMD); - spin_unlock_irqrestore(&card->lock, flags); - - sblive_wcwait(card, 8); - - spin_lock_irqsave(&card->lock, flags); - outb(MUCMD_ENTERUARTMODE, card->iobase + MUCMD); - spin_unlock_irqrestore(&card->lock, flags); - - sblive_wcwait(card, 8); - - spin_lock_irqsave(&card->lock, flags); - status = inb(card->iobase + MUDATA); - spin_unlock_irqrestore(&card->lock, flags); - - if (status == 0xfe) - return 0; - else - return -1; - } - - return 0; - } -} - -int emu10k1_mpu_acquire(struct emu10k1_card *card) -{ - /* FIXME: This should be a macro */ - ++card->mpuacqcount; - - return 0; -} - -int emu10k1_mpu_release(struct emu10k1_card *card) -{ - /* FIXME: this should be a macro */ - --card->mpuacqcount; - - return 0; -} diff --git a/sound/oss/emu10k1/hwaccess.h b/sound/oss/emu10k1/hwaccess.h deleted file mode 100644 index 85e27bda694..00000000000 --- a/sound/oss/emu10k1/hwaccess.h +++ /dev/null @@ -1,247 +0,0 @@ -/* - ********************************************************************** - * hwaccess.h - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _HWACCESS_H -#define _HWACCESS_H - -#include <linux/fs.h> -#include <linux/sound.h> -#include <linux/soundcard.h> -#include <linux/ac97_codec.h> -#include <linux/pci.h> -#include <linux/slab.h> -#include <linux/sched.h> -#include <asm/io.h> - -#include "efxmgr.h" -#include "passthrough.h" -#include "midi.h" - -#define EMUPAGESIZE 4096 /* don't change */ -#define NUM_G 64 /* use all channels */ -#define NUM_FXSENDS 4 /* don't change */ -/* setting this to other than a power of two may break some applications */ -#define MAXBUFSIZE 65536 -#define MAXPAGES 8192 -#define BUFMAXPAGES (MAXBUFSIZE / PAGE_SIZE) - -#define FLAGS_AVAILABLE 0x0001 -#define FLAGS_READY 0x0002 - -struct memhandle -{ - dma_addr_t dma_handle; - void *addr; - u32 size; -}; - -#define DEBUG_LEVEL 2 - -#ifdef EMU10K1_DEBUG -# define DPD(level,x,y...) do {if(level <= DEBUG_LEVEL) printk( KERN_NOTICE "emu10k1: %s: %d: " x , __FILE__ , __LINE__ , y );} while(0) -# define DPF(level,x) do {if(level <= DEBUG_LEVEL) printk( KERN_NOTICE "emu10k1: %s: %d: " x , __FILE__ , __LINE__ );} while(0) -#else -# define DPD(level,x,y...) do { } while (0) /* not debugging: nothing */ -# define DPF(level,x) do { } while (0) -#endif /* EMU10K1_DEBUG */ - -#define ERROR() DPF(1,"error\n") - -/* DATA STRUCTURES */ - -struct emu10k1_waveout -{ - u32 send_routing[3]; - // audigy only: - u32 send_routing2[3]; - - u32 send_dcba[3]; - // audigy only: - u32 send_hgfe[3]; -}; -#define ROUTE_PCM 0 -#define ROUTE_PT 1 -#define ROUTE_PCM1 2 - -#define SEND_MONO 0 -#define SEND_LEFT 1 -#define SEND_RIGHT 2 - -struct emu10k1_wavein -{ - struct wiinst *ac97; - struct wiinst *mic; - struct wiinst *fx; - - u8 recsrc; - u32 fxwc; -}; - -#define CMD_READ 1 -#define CMD_WRITE 2 - -struct mixer_private_ioctl { - u32 cmd; - u32 val[90]; -}; - -/* bogus ioctls numbers to escape from OSS mixer limitations */ -#define CMD_WRITEFN0 _IOW('D', 0, struct mixer_private_ioctl) -#define CMD_READFN0 _IOR('D', 1, struct mixer_private_ioctl) -#define CMD_WRITEPTR _IOW('D', 2, struct mixer_private_ioctl) -#define CMD_READPTR _IOR('D', 3, struct mixer_private_ioctl) -#define CMD_SETRECSRC _IOW('D', 4, struct mixer_private_ioctl) -#define CMD_GETRECSRC _IOR('D', 5, struct mixer_private_ioctl) -#define CMD_GETVOICEPARAM _IOR('D', 6, struct mixer_private_ioctl) -#define CMD_SETVOICEPARAM _IOW('D', 7, struct mixer_private_ioctl) -#define CMD_GETPATCH _IOR('D', 8, struct mixer_private_ioctl) -#define CMD_GETGPR _IOR('D', 9, struct mixer_private_ioctl) -#define CMD_GETCTLGPR _IOR('D', 10, struct mixer_private_ioctl) -#define CMD_SETPATCH _IOW('D', 11, struct mixer_private_ioctl) -#define CMD_SETGPR _IOW('D', 12, struct mixer_private_ioctl) -#define CMD_SETCTLGPR _IOW('D', 13, struct mixer_private_ioctl) -#define CMD_SETGPOUT _IOW('D', 14, struct mixer_private_ioctl) -#define CMD_GETGPR2OSS _IOR('D', 15, struct mixer_private_ioctl) -#define CMD_SETGPR2OSS _IOW('D', 16, struct mixer_private_ioctl) -#define CMD_SETMCH_FX _IOW('D', 17, struct mixer_private_ioctl) -#define CMD_SETPASSTHROUGH _IOW('D', 18, struct mixer_private_ioctl) -#define CMD_PRIVATE3_VERSION _IOW('D', 19, struct mixer_private_ioctl) -#define CMD_AC97_BOOST _IOW('D', 20, struct mixer_private_ioctl) - -//up this number when breaking compatibility -#define PRIVATE3_VERSION 2 - -struct emu10k1_card -{ - struct list_head list; - - struct memhandle virtualpagetable; - struct memhandle tankmem; - struct memhandle silentpage; - - spinlock_t lock; - - u8 voicetable[NUM_G]; - u16 emupagetable[MAXPAGES]; - - struct list_head timers; - u16 timer_delay; - spinlock_t timer_lock; - - struct pci_dev *pci_dev; - unsigned long iobase; - unsigned long length; - unsigned short model; - unsigned int irq; - - int audio_dev; - int audio_dev1; - int midi_dev; -#ifdef EMU10K1_SEQUENCER - int seq_dev; - struct emu10k1_mididevice *seq_mididev; -#endif - - struct ac97_codec *ac97; - int ac97_supported_mixers; - int ac97_stereo_mixers; - - /* Number of first fx voice for multichannel output */ - u8 mchannel_fx; - struct emu10k1_waveout waveout; - struct emu10k1_wavein wavein; - struct emu10k1_mpuout *mpuout; - struct emu10k1_mpuin *mpuin; - - struct mutex open_sem; - mode_t open_mode; - wait_queue_head_t open_wait; - - u32 mpuacqcount; // Mpu acquire count - u32 has_toslink; // TOSLink detection - - u8 chiprev; /* Chip revision */ - u8 is_audigy; - u8 is_aps; - - struct patch_manager mgr; - struct pt_data pt; -}; - -int emu10k1_addxmgr_alloc(u32, struct emu10k1_card *); -void emu10k1_addxmgr_free(struct emu10k1_card *, int); - -int emu10k1_find_control_gpr(struct patch_manager *, const char *, const char *); -void emu10k1_set_control_gpr(struct emu10k1_card *, int , s32, int ); - -void emu10k1_set_volume_gpr(struct emu10k1_card *, int, s32, int); - - -#define VOL_6BIT 0x40 -#define VOL_5BIT 0x20 -#define VOL_4BIT 0x10 - -#define TIMEOUT 16384 - -u32 srToPitch(u32); - -extern struct list_head emu10k1_devs; - -/* Hardware Abstraction Layer access functions */ - -void emu10k1_writefn0(struct emu10k1_card *, u32, u32); -void emu10k1_writefn0_2(struct emu10k1_card *, u32, u32, int); -u32 emu10k1_readfn0(struct emu10k1_card *, u32); - -void emu10k1_timer_set(struct emu10k1_card *, u16); - -void sblive_writeptr(struct emu10k1_card *, u32, u32, u32); -void sblive_writeptr_tag(struct emu10k1_card *, u32, ...); -#define TAGLIST_END 0 - -u32 sblive_readptr(struct emu10k1_card *, u32 , u32 ); - -void emu10k1_irq_enable(struct emu10k1_card *, u32); -void emu10k1_irq_disable(struct emu10k1_card *, u32); -void emu10k1_clear_stop_on_loop(struct emu10k1_card *, u32); - -/* AC97 Codec register access function */ -u16 emu10k1_ac97_read(struct ac97_codec *, u8); -void emu10k1_ac97_write(struct ac97_codec *, u8, u16); - -/* MPU access function*/ -int emu10k1_mpu_write_data(struct emu10k1_card *, u8); -int emu10k1_mpu_read_data(struct emu10k1_card *, u8 *); -int emu10k1_mpu_reset(struct emu10k1_card *); -int emu10k1_mpu_acquire(struct emu10k1_card *); -int emu10k1_mpu_release(struct emu10k1_card *); - -#endif /* _HWACCESS_H */ diff --git a/sound/oss/emu10k1/icardmid.h b/sound/oss/emu10k1/icardmid.h deleted file mode 100644 index 6a6ef419401..00000000000 --- a/sound/oss/emu10k1/icardmid.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - ********************************************************************** - * isblive_mid.h - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _ICARDMIDI_H -#define _ICARDMIDI_H - -/* MIDI defines */ -#define MIDI_DATA_FIRST 0x00 -#define MIDI_DATA_LAST 0x7F -#define MIDI_STATUS_FIRST 0x80 -#define MIDI_STATUS_LAST 0xFF - -/* Channel status bytes */ -#define MIDI_STATUS_CHANNEL_FIRST 0x80 -#define MIDI_STATUS_CHANNEL_LAST 0xE0 -#define MIDI_STATUS_CHANNEL_MASK 0xF0 - -/* Channel voice messages */ -#define MIDI_VOICE_NOTE_OFF 0x80 -#define MIDI_VOICE_NOTE_ON 0x90 -#define MIDI_VOICE_POLY_PRESSURE 0xA0 -#define MIDI_VOICE_CONTROL_CHANGE 0xB0 -#define MIDI_VOICE_PROGRAM_CHANGE 0xC0 -#define MIDI_VOICE_CHANNEL_PRESSURE 0xD0 -#define MIDI_VOICE_PITCH_BEND 0xE0 - -/* Channel mode messages */ -#define MIDI_MODE_CHANNEL MIDI_VOICE_CONTROL_CHANGE - -/* System status bytes */ -#define MIDI_STATUS_SYSTEM_FIRST 0xF0 -#define MIDI_STATUS_SYSTEM_LAST 0xFF - -/* System exclusive messages */ -#define MIDI_SYSEX_BEGIN 0xF0 -#define MIDI_SYSEX_EOX 0xF7 - -/* System common messages */ -#define MIDI_COMMON_TCQF 0xF1 /* Time code quarter frame */ -#define MIDI_COMMON_SONG_POSITION 0xF2 -#define MIDI_COMMON_SONG_SELECT 0xF3 -#define MIDI_COMMON_UNDEFINED_F4 0xF4 -#define MIDI_COMMON_UNDEFINED_F5 0xF5 -#define MIDI_COMMON_TUNE_REQUEST 0xF6 - -/* System real-time messages */ -#define MIDI_RTIME_TIMING_CLOCK 0xF8 -#define MIDI_RTIME_UNDEFINED_F9 0xF9 -#define MIDI_RTIME_START 0xFA -#define MIDI_RTIME_CONTINUE 0xFB -#define MIDI_RTIME_STOP 0xFC -#define MIDI_RTIME_UNDEFINED_FD 0xFD -#define MIDI_RTIME_ACTIVE_SENSING 0xFE -#define MIDI_RTIME_SYSTEM_RESET 0xFF - -/* Flags for flags parm of midiOutCachePatches(), midiOutCacheDrumPatches() */ -#define MIDI_CACHE_ALL 1 -#define MIDI_CACHE_BESTFIT 2 -#define MIDI_CACHE_QUERY 3 -#define MIDI_UNCACHE 4 - -/* Event declarations for MPU IRQ Callbacks */ -#define ICARDMIDI_INLONGDATA 0x00000001 /* MIM_LONGDATA */ -#define ICARDMIDI_INLONGERROR 0x00000002 /* MIM_LONGERROR */ -#define ICARDMIDI_OUTLONGDATA 0x00000004 /* MOM_DONE for MPU OUT buffer */ -#define ICARDMIDI_INDATA 0x00000010 /* MIM_DATA */ -#define ICARDMIDI_INDATAERROR 0x00000020 /* MIM_ERROR */ - -/* Declaration for flags in CARDMIDIBUFFERHDR */ -/* Make it the same as MHDR_DONE, MHDR_INQUEUE in mmsystem.h */ -#define MIDIBUF_DONE 0x00000001 -#define MIDIBUF_INQUEUE 0x00000004 - -/* Declaration for msg parameter in midiCallbackFn */ -#define ICARDMIDI_OUTBUFFEROK 0x00000001 -#define ICARDMIDI_INMIDIOK 0x00000002 - -/* Declaration for technology in struct midi_caps */ -#define MT_MIDIPORT 0x00000001 /* In original MIDIOUTCAPS structure */ -#define MT_FMSYNTH 0x00000004 /* In original MIDIOUTCAPS structure */ -#define MT_AWESYNTH 0x00001000 -#define MT_PCISYNTH 0x00002000 -#define MT_PCISYNTH64 0x00004000 -#define CARDMIDI_AWEMASK 0x0000F000 - -enum LocalErrorCode -{ - CTSTATUS_NOTENABLED = 0x7000, - CTSTATUS_READY, - CTSTATUS_BUSY, - CTSTATUS_DATAAVAIL, - CTSTATUS_NODATA, - CTSTATUS_NEXT_BYTE -}; - -/* MIDI data block header */ -struct midi_hdr -{ - u8 *reserved; /* Pointer to original locked data block */ - u32 bufferlength; /* Length of data in data block */ - u32 bytesrecorded; /* Used for input only */ - u32 user; /* For client's use */ - u32 flags; /* Assorted flags (see defines) */ - struct list_head list; /* Reserved for driver */ - u8 *data; /* Second copy of first pointer */ -}; - -/* Enumeration for SetControl */ -enum -{ - MIDIOBJVOLUME = 0x1, - MIDIQUERYACTIVEINST -}; - -struct midi_queue -{ - struct midi_queue *next; - u32 qtype; /* 0 = short message, 1 = long data */ - u32 length; - u32 sizeLeft; - u8 *midibyte; - unsigned long refdata; -}; - -struct midi_openinfo -{ - u32 cbsize; - u32 flags; - unsigned long refdata; - u32 streamid; -}; - -int emu10k1_midi_callback(unsigned long , unsigned long, unsigned long *); - -#endif /* _ICARDMIDI_H */ diff --git a/sound/oss/emu10k1/icardwav.h b/sound/oss/emu10k1/icardwav.h deleted file mode 100644 index 25be40928b4..00000000000 --- a/sound/oss/emu10k1/icardwav.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - ********************************************************************** - * icardwav.h - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _ICARDWAV_H -#define _ICARDWAV_H - -struct wave_format -{ - int id; - int samplingrate; - u8 bitsperchannel; - u8 channels; /* 1 = Mono, 2 = Stereo, 3, ... = Multichannel */ - u8 bytesperchannel; - u8 bytespervoicesample; - u8 bytespersample; - int bytespersec; - u8 passthrough; -}; - -/* emu10k1_wave states */ -#define WAVE_STATE_OPEN 0x01 -#define WAVE_STATE_STARTED 0x02 -#define WAVE_STATE_CLOSED 0x04 - -#endif /* _ICARDWAV_H */ diff --git a/sound/oss/emu10k1/irqmgr.c b/sound/oss/emu10k1/irqmgr.c deleted file mode 100644 index fb2ce638f01..00000000000 --- a/sound/oss/emu10k1/irqmgr.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - ********************************************************************** - * irqmgr.c - IRQ manager for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include "hwaccess.h" -#include "8010.h" -#include "cardmi.h" -#include "cardmo.h" -#include "irqmgr.h" - -/* Interrupt handler */ - -irqreturn_t emu10k1_interrupt(int irq, void *dev_id) -{ - struct emu10k1_card *card = (struct emu10k1_card *) dev_id; - u32 irqstatus, irqstatus_tmp; - int handled = 0; - - DPD(4, "emu10k1_interrupt called, irq = %u\n", irq); - - /* - ** NOTE : - ** We do a 'while loop' here cos on certain machines, with both - ** playback and recording going on at the same time, IRQs will - ** stop coming in after a while. Checking IPND indeed shows that - ** there are interrupts pending but the PIC says no IRQs pending. - ** I suspect that some boards need edge-triggered IRQs but are not - ** getting that condition if we don't completely clear the IPND - ** (make sure no more interrupts are pending). - ** - Eric - */ - - while ((irqstatus = inl(card->iobase + IPR))) { - DPD(4, "irq status %#x\n", irqstatus); - - irqstatus_tmp = irqstatus; - - if (irqstatus & IRQTYPE_TIMER) { - emu10k1_timer_irqhandler(card); - irqstatus &= ~IRQTYPE_TIMER; - } - - if (irqstatus & IRQTYPE_DSP) { - emu10k1_dsp_irqhandler(card); - irqstatus &= ~IRQTYPE_DSP; - } - - if (irqstatus & IRQTYPE_MPUIN) { - emu10k1_mpuin_irqhandler(card); - irqstatus &= ~IRQTYPE_MPUIN; - } - - if (irqstatus & IRQTYPE_MPUOUT) { - emu10k1_mpuout_irqhandler(card); - irqstatus &= ~IRQTYPE_MPUOUT; - } - - if (irqstatus & IPR_MUTE) { - emu10k1_mute_irqhandler(card); - irqstatus &=~IPR_MUTE; - } - - if (irqstatus & IPR_VOLINCR) { - emu10k1_volincr_irqhandler(card); - irqstatus &=~IPR_VOLINCR; - } - - if (irqstatus & IPR_VOLDECR) { - emu10k1_voldecr_irqhandler(card); - irqstatus &=~IPR_VOLDECR; - } - - if (irqstatus){ - printk(KERN_ERR "emu10k1: Warning, unhandled interrupt: %#08x\n", irqstatus); - //make sure any interrupts we don't handle are disabled: - emu10k1_irq_disable(card, ~(INTE_MIDIRXENABLE | INTE_MIDITXENABLE | INTE_INTERVALTIMERENB | - INTE_VOLDECRENABLE | INTE_VOLINCRENABLE | INTE_MUTEENABLE | - INTE_FXDSPENABLE)); - } - - /* acknowledge interrupt */ - outl(irqstatus_tmp, card->iobase + IPR); - handled = 1; - } - return IRQ_RETVAL(handled); -} diff --git a/sound/oss/emu10k1/irqmgr.h b/sound/oss/emu10k1/irqmgr.h deleted file mode 100644 index 7e7c9ca1098..00000000000 --- a/sound/oss/emu10k1/irqmgr.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - ********************************************************************** - * irq.h - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _IRQ_H -#define _IRQ_H - -/* EMU Irq Types */ -#define IRQTYPE_PCIBUSERROR IPR_PCIERROR -#define IRQTYPE_MIXERBUTTON (IPR_VOLINCR | IPR_VOLDECR | IPR_MUTE) -#define IRQTYPE_VOICE (IPR_CHANNELLOOP | IPR_CHANNELNUMBERMASK) -#define IRQTYPE_RECORD (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL | IPR_MICBUFFULL | IPR_MICBUFHALFFULL | IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL) -#define IRQTYPE_MPUOUT (IPR_MIDITRANSBUFEMPTY | A_IPR_MIDITRANSBUFEMPTY2) -#define IRQTYPE_MPUIN (IPR_MIDIRECVBUFEMPTY | A_IPR_MIDIRECVBUFEMPTY2) -#define IRQTYPE_TIMER IPR_INTERVALTIMER -#define IRQTYPE_SPDIF (IPR_GPSPDIFSTATUSCHANGE | IPR_CDROMSTATUSCHANGE) -#define IRQTYPE_DSP IPR_FXDSP - -void emu10k1_timer_irqhandler(struct emu10k1_card *); -void emu10k1_dsp_irqhandler(struct emu10k1_card *); -void emu10k1_mute_irqhandler(struct emu10k1_card *); -void emu10k1_volincr_irqhandler(struct emu10k1_card *); -void emu10k1_voldecr_irqhandler(struct emu10k1_card *); - -#endif /* _IRQ_H */ diff --git a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c deleted file mode 100644 index 5058411b752..00000000000 --- a/sound/oss/emu10k1/main.c +++ /dev/null @@ -1,1471 +0,0 @@ - /* - ********************************************************************** - * main.c - Creative EMU10K1 audio driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * November 2, 1999 Alan Cox cleaned up stuff - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - * - * Supported devices: - * /dev/dsp: Standard /dev/dsp device, OSS-compatible - * /dev/dsp1: Routes to rear speakers only - * /dev/mixer: Standard /dev/mixer device, OSS-compatible - * /dev/midi: Raw MIDI UART device, mostly OSS-compatible - * /dev/sequencer: Sequencer Interface (requires sound.o) - * - * Revision history: - * 0.1 beta Initial release - * 0.2 Lowered initial mixer vol. Improved on stuttering wave playback. Added MIDI UART support. - * 0.3 Fixed mixer routing bug, added APS, joystick support. - * 0.4 Added rear-channel, SPDIF support. - * 0.5 Source cleanup, SMP fixes, multiopen support, 64 bit arch fixes, - * moved bh's to tasklets, moved to the new PCI driver initialization style. - * 0.6 Make use of pci_alloc_consistent, improve compatibility layer for 2.2 kernels, - * code reorganization and cleanup. - * 0.7 Support for the Emu-APS. Bug fixes for voice cache setup, mmaped sound + poll(). - * Support for setting external TRAM size. - * 0.8 Make use of the kernel ac97 interface. Support for a dsp patch manager. - * 0.9 Re-enables rear speakers volume controls - * 0.10 Initializes rear speaker volume. - * Dynamic patch storage allocation. - * New private ioctls to change control gpr values. - * Enable volume control interrupts. - * By default enable dsp routes to digital out. - * 0.11 Fixed fx / 4 problem. - * 0.12 Implemented mmaped for recording. - * Fixed bug: not unreserving mmaped buffer pages. - * IRQ handler cleanup. - * 0.13 Fixed problem with dsp1 - * Simplified dsp patch writing (inside the driver) - * Fixed several bugs found by the Stanford tools - * 0.14 New control gpr to oss mixer mapping feature (Chris Purnell) - * Added AC3 Passthrough Support (Juha Yrjola) - * Added Support for 5.1 cards (digital out and the third analog out) - * 0.15 Added Sequencer Support (Daniel Mack) - * Support for multichannel pcm playback (Eduard Hasenleithner) - * 0.16 Mixer improvements, added old treble/bass support (Daniel Bertrand) - * Small code format cleanup. - * Deadlock bug fix for emu10k1_volxxx_irqhandler(). - * 0.17 Fix for mixer SOUND_MIXER_INFO ioctl. - * Fix for HIGHMEM machines (emu10k1 can only do 31 bit bus master) - * midi poll initial implementation. - * Small mixer fixes/cleanups. - * Improved support for 5.1 cards. - * 0.18 Fix for possible leak in pci_alloc_consistent() - * Cleaned up poll() functions (audio and midi). Don't start input. - * Restrict DMA pages used to 512Mib range. - * New AC97_BOOST mixer ioctl. - * 0.19a Added Support for Audigy Cards - * Real fix for kernel with highmem support (cast dma_handle to u32). - * Fix recording buffering parameters calculation. - * Use unsigned long for variables in bit ops. - * 0.20a Fixed recording startup - * Fixed timer rate setting (it's a 16-bit register) - * 0.21 Converted code to use pci_name() instead of accessing slot_name - * directly (Eugene Teo) - *********************************************************************/ - -/* These are only included once per module */ -#include <linux/module.h> -#include <linux/slab.h> -#include <linux/init.h> -#include <linux/delay.h> -#include <linux/proc_fs.h> -#include <linux/dma-mapping.h> - -#include "hwaccess.h" -#include "8010.h" -#include "efxmgr.h" -#include "cardwo.h" -#include "cardwi.h" -#include "cardmo.h" -#include "cardmi.h" -#include "recmgr.h" -#include "ecard.h" - - -#ifdef EMU10K1_SEQUENCER -#define MIDI_SYNTH_NAME "EMU10K1 MIDI" -#define MIDI_SYNTH_CAPS SYNTH_CAP_INPUT - -#include "../sound_config.h" -#include "../midi_synth.h" - -/* this should be in dev_table.h */ -#define SNDCARD_EMU10K1 46 -#endif - - -/* the emu10k1 _seems_ to only supports 29 bit (512MiB) bit bus master */ -#define EMU10K1_DMA_MASK DMA_29BIT_MASK /* DMA buffer mask for pci_alloc_consist */ - -#ifndef PCI_VENDOR_ID_CREATIVE -#define PCI_VENDOR_ID_CREATIVE 0x1102 -#endif - -#ifndef PCI_DEVICE_ID_CREATIVE_EMU10K1 -#define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002 -#endif -#ifndef PCI_DEVICE_ID_CREATIVE_AUDIGY -#define PCI_DEVICE_ID_CREATIVE_AUDIGY 0x0004 -#endif - -#define EMU_APS_SUBID 0x40011102 - -enum { - EMU10K1 = 0, - AUDIGY, -}; - -static char *card_names[] __devinitdata = { - "EMU10K1", - "Audigy", -}; - -static struct pci_device_id emu10k1_pci_tbl[] = { - {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_EMU10K1, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, EMU10K1}, - {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_AUDIGY, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, AUDIGY}, - {0,} -}; - -MODULE_DEVICE_TABLE(pci, emu10k1_pci_tbl); - -/* Global var instantiation */ - -LIST_HEAD(emu10k1_devs); - -extern struct file_operations emu10k1_audio_fops; -extern struct file_operations emu10k1_mixer_fops; -extern struct file_operations emu10k1_midi_fops; - -#ifdef EMU10K1_SEQUENCER -static struct midi_operations emu10k1_midi_operations; -#endif - -extern irqreturn_t emu10k1_interrupt(int, void *); - -static int __devinit emu10k1_audio_init(struct emu10k1_card *card) -{ - /* Assign default playback voice parameters */ - if (card->is_audigy) - card->mchannel_fx = 0; - else - card->mchannel_fx = 8; - - - if (card->is_audigy) { - /* mono voice */ - card->waveout.send_dcba[SEND_MONO] = 0xffffffff; - card->waveout.send_hgfe[SEND_MONO] = 0x0000ffff; - - /* stereo voice */ - /* left */ - card->waveout.send_dcba[SEND_LEFT] = 0x00ff00ff; - card->waveout.send_hgfe[SEND_LEFT] = 0x00007f7f; - /* right */ - card->waveout.send_dcba[SEND_RIGHT] = 0xff00ff00; - card->waveout.send_hgfe[SEND_RIGHT] = 0x00007f7f; - - card->waveout.send_routing[ROUTE_PCM] = 0x03020100; // Regular pcm - card->waveout.send_routing2[ROUTE_PCM] = 0x07060504; - - card->waveout.send_routing[ROUTE_PT] = 0x3f3f3d3c; // Passthrough - card->waveout.send_routing2[ROUTE_PT] = 0x3f3f3f3f; - - card->waveout.send_routing[ROUTE_PCM1] = 0x03020100; // Spare - card->waveout.send_routing2[ROUTE_PCM1] = 0x07060404; - - } else { - /* mono voice */ - card->waveout.send_dcba[SEND_MONO] = 0x0000ffff; - - /* stereo voice */ - /* left */ - card->waveout.send_dcba[SEND_LEFT] = 0x000000ff; - /* right */ - card->waveout.send_dcba[SEND_RIGHT] = 0x0000ff00; - - card->waveout.send_routing[ROUTE_PCM] = 0x3210; // pcm - card->waveout.send_routing[ROUTE_PT] = 0x3210; // passthrough - card->waveout.send_routing[ROUTE_PCM1] = 0x7654; // /dev/dsp1 - } - - /* Assign default recording parameters */ - /* FIXME */ - if (card->is_aps) - card->wavein.recsrc = WAVERECORD_FX; - else - card->wavein.recsrc = WAVERECORD_AC97; - - card->wavein.fxwc = 0x0003; - return 0; -} - -static void emu10k1_audio_cleanup(struct emu10k1_card *card) -{ -} - -static int __devinit emu10k1_register_devices(struct emu10k1_card *card) -{ - card->audio_dev = register_sound_dsp(&emu10k1_audio_fops, -1); - if (card->audio_dev < 0) { - printk(KERN_ERR "emu10k1: cannot register first audio device!\n"); - goto err_dev; - } - - card->audio_dev1 = register_sound_dsp(&emu10k1_audio_fops, -1); - if (card->audio_dev1 < 0) { - printk(KERN_ERR "emu10k1: cannot register second audio device!\n"); - goto err_dev1; - } - - card->ac97->dev_mixer = register_sound_mixer(&emu10k1_mixer_fops, -1); - if (card->ac97->dev_mixer < 0) { - printk(KERN_ERR "emu10k1: cannot register mixer device\n"); - goto err_mixer; - } - - card->midi_dev = register_sound_midi(&emu10k1_midi_fops, -1); - if (card->midi_dev < 0) { - printk(KERN_ERR "emu10k1: cannot register midi device!\n"); - goto err_midi; - } - -#ifdef EMU10K1_SEQUENCER - card->seq_dev = sound_alloc_mididev(); - if (card->seq_dev == -1) - printk(KERN_WARNING "emu10k1: unable to register sequencer device!"); - else { - std_midi_synth.midi_dev = card->seq_dev; - midi_devs[card->seq_dev] = - (struct midi_operations *) - kmalloc(sizeof(struct midi_operations), GFP_KERNEL); - - if (midi_devs[card->seq_dev] == NULL) { - printk(KERN_ERR "emu10k1: unable to allocate memory!"); - sound_unload_mididev(card->seq_dev); - card->seq_dev = -1; - /* return without error */ - } else { - memcpy((char *)midi_devs[card->seq_dev], - (char *)&emu10k1_midi_operations, - sizeof(struct midi_operations)); - midi_devs[card->seq_dev]->devc = card; - sequencer_init(); - card->seq_mididev = NULL; - } - } -#endif - return 0; - -err_midi: - unregister_sound_mixer(card->ac97->dev_mixer); -err_mixer: - unregister_sound_dsp(card->audio_dev); -err_dev1: - unregister_sound_dsp(card->audio_dev); -err_dev: - return -ENODEV; -} - -static void emu10k1_unregister_devices(struct emu10k1_card *card) -{ -#ifdef EMU10K1_SEQUENCER - if (card->seq_dev > -1) { - kfree(midi_devs[card->seq_dev]); - midi_devs[card->seq_dev] = NULL; - sound_unload_mididev(card->seq_dev); - card->seq_dev = -1; - } -#endif - - unregister_sound_midi(card->midi_dev); - unregister_sound_mixer(card->ac97->dev_mixer); - unregister_sound_dsp(card->audio_dev1); - unregister_sound_dsp(card->audio_dev); -} - -static int emu10k1_info_proc (char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - struct emu10k1_card *card = data; - int len = 0; - - if (card == NULL) - return -ENODEV; - - len += sprintf (page + len, "Driver Version : %s\n", DRIVER_VERSION); - len += sprintf (page + len, "Card type : %s\n", card->is_aps ? "Aps" : (card->is_audigy ? "Audigy" : "Emu10k1")); - len += sprintf (page + len, "Revision : %d\n", card->chiprev); - len += sprintf (page + len, "Model : %#06x\n", card->model); - len += sprintf (page + len, "IO : %#06lx-%#06lx\n", card->iobase, card->iobase + card->length - 1); - len += sprintf (page + len, "IRQ : %d\n\n", card->irq); - - len += sprintf (page + len, "Registered /dev Entries:\n"); - len += sprintf (page + len, "/dev/dsp%d\n", card->audio_dev / 16); - len += sprintf (page + len, "/dev/dsp%d\n", card->audio_dev1 / 16); - len += sprintf (page + len, "/dev/mixer%d\n", card->ac97->dev_mixer / 16); - len += sprintf (page + len, "/dev/midi%d\n", card->midi_dev / 16); - -#ifdef EMU10K1_SEQUENCER - len += sprintf (page + len, "/dev/sequencer\n"); -#endif - - return len; -} - -static int __devinit emu10k1_proc_init(struct emu10k1_card *card) -{ - char s[48]; - - if (!proc_mkdir ("driver/emu10k1", NULL)) { - printk(KERN_ERR "emu10k1: unable to create proc directory driver/emu10k1\n"); - goto err_out; - } - - sprintf(s, "driver/emu10k1/%s", pci_name(card->pci_dev)); - if (!proc_mkdir (s, NULL)) { - printk(KERN_ERR "emu10k1: unable to create proc directory %s\n", s); - goto err_emu10k1_proc; - } - - sprintf(s, "driver/emu10k1/%s/info", pci_name(card->pci_dev)); - if (!create_proc_read_entry (s, 0, NULL, emu10k1_info_proc, card)) { - printk(KERN_ERR "emu10k1: unable to create proc entry %s\n", s); - goto err_dev_proc; - } - - if (!card->is_aps) { - sprintf(s, "driver/emu10k1/%s/ac97", pci_name(card->pci_dev)); - if (!create_proc_read_entry (s, 0, NULL, ac97_read_proc, card->ac97)) { - printk(KERN_ERR "emu10k1: unable to create proc entry %s\n", s); - goto err_proc_ac97; - } - } - - return 0; - -err_proc_ac97: - sprintf(s, "driver/emu10k1/%s/info", pci_name(card->pci_dev)); - remove_proc_entry(s, NULL); - -err_dev_proc: - sprintf(s, "driver/emu10k1/%s", pci_name(card->pci_dev)); - remove_proc_entry(s, NULL); - -err_emu10k1_proc: - remove_proc_entry("driver/emu10k1", NULL); - -err_out: - return -EIO; -} - -static void emu10k1_proc_cleanup(struct emu10k1_card *card) -{ - char s[48]; - - if (!card->is_aps) { - sprintf(s, "driver/emu10k1/%s/ac97", pci_name(card->pci_dev)); - remove_proc_entry(s, NULL); - } - - sprintf(s, "driver/emu10k1/%s/info", pci_name(card->pci_dev)); - remove_proc_entry(s, NULL); - - sprintf(s, "driver/emu10k1/%s", pci_name(card->pci_dev)); - remove_proc_entry(s, NULL); - - remove_proc_entry("driver/emu10k1", NULL); -} - -static int __devinit emu10k1_mixer_init(struct emu10k1_card *card) -{ - struct ac97_codec *codec = ac97_alloc_codec(); - - if(codec == NULL) - { - printk(KERN_ERR "emu10k1: cannot allocate mixer\n"); - return -EIO; - } - card->ac97 = codec; - card->ac97->private_data = card; - - if (!card->is_aps) { - card->ac97->id = 0; - card->ac97->codec_read = emu10k1_ac97_read; - card->ac97->codec_write = emu10k1_ac97_write; - - if (ac97_probe_codec (card->ac97) == 0) { - printk(KERN_ERR "emu10k1: unable to probe AC97 codec\n"); - goto err_out; - } - /* 5.1: Enable the additional AC97 Slots and unmute extra channels on AC97 codec */ - if (codec->codec_read(codec, AC97_EXTENDED_ID) & 0x0080){ - printk(KERN_INFO "emu10k1: SBLive! 5.1 card detected\n"); - sblive_writeptr(card, AC97SLOT, 0, AC97SLOT_CNTR | AC97SLOT_LFE); - codec->codec_write(codec, AC97_SURROUND_MASTER, 0x0); - } - - // Force 5bit: - //card->ac97->bit_resolution=5; - - /* these will store the original values and never be modified */ - card->ac97_supported_mixers = card->ac97->supported_mixers; - card->ac97_stereo_mixers = card->ac97->stereo_mixers; - } - - return 0; - - err_out: - ac97_release_codec(card->ac97); - return -EIO; -} - -static void emu10k1_mixer_cleanup(struct emu10k1_card *card) -{ - ac97_release_codec(card->ac97); -} - -static int __devinit emu10k1_midi_init(struct emu10k1_card *card) -{ - int ret; - - card->mpuout = kzalloc(sizeof(struct emu10k1_mpuout), GFP_KERNEL); - if (card->mpuout == NULL) { - printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuout: out of memory\n"); - ret = -ENOMEM; - goto err_out1; - } - - card->mpuout->intr = 1; - card->mpuout->status = FLAGS_AVAILABLE; - card->mpuout->state = CARDMIDIOUT_STATE_DEFAULT; - - tasklet_init(&card->mpuout->tasklet, emu10k1_mpuout_bh, (unsigned long) card); - - spin_lock_init(&card->mpuout->lock); - - card->mpuin = kzalloc(sizeof(struct emu10k1_mpuin), GFP_KERNEL); - if (card->mpuin == NULL) { - printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuin: out of memory\n"); - ret = -ENOMEM; - goto err_out2; - } - - card->mpuin->status = FLAGS_AVAILABLE; - - tasklet_init(&card->mpuin->tasklet, emu10k1_mpuin_bh, (unsigned long) card->mpuin); - - spin_lock_init(&card->mpuin->lock); - - /* Reset the MPU port */ - if (emu10k1_mpu_reset(card) < 0) { - ERROR(); - ret = -EIO; - goto err_out3; - } - - return 0; - -err_out3: - kfree(card->mpuin); -err_out2: - kfree(card->mpuout); -err_out1: - return ret; -} - -static void emu10k1_midi_cleanup(struct emu10k1_card *card) -{ - tasklet_kill(&card->mpuout->tasklet); - kfree(card->mpuout); - - tasklet_kill(&card->mpuin->tasklet); - kfree(card->mpuin); -} - -static void __devinit voice_init(struct emu10k1_card *card) -{ - int i; - - for (i = 0; i < NUM_G; i++) - card->voicetable[i] = VOICE_USAGE_FREE; -} - -static void __devinit timer_init(struct emu10k1_card *card) -{ - INIT_LIST_HEAD(&card->timers); - card->timer_delay = TIMER_STOPPED; - spin_lock_init(&card->timer_lock); -} - -static void __devinit addxmgr_init(struct emu10k1_card *card) -{ - u32 count; - - for (count = 0; count < MAXPAGES; count++) - card->emupagetable[count] = 0; - - /* Mark first page as used */ - /* This page is reserved by the driver */ - card->emupagetable[0] = 0x8001; - card->emupagetable[1] = MAXPAGES - 1; -} - -static void fx_cleanup(struct patch_manager *mgr) -{ - int i; - for(i = 0; i < mgr->current_pages; i++) - free_page((unsigned long) mgr->patch[i]); -} - -static int __devinit fx_init(struct emu10k1_card *card) -{ - struct patch_manager *mgr = &card->mgr; - struct dsp_patch *patch; - struct dsp_rpatch *rpatch; - s32 left, right; - int i; - u32 pc = 0; - u32 patch_n=0; - struct emu_efx_info_t emu_efx_info[2]= - {{ 20, 10, 0x400, 0x100, 0x20 }, - { 24, 12, 0x600, 0x400, 0x60 }, - }; - - - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { - mgr->ctrl_gpr[i][0] = -1; - mgr->ctrl_gpr[i][1] = -1; - } - - - if (card->is_audigy) - mgr->current_pages = (2 + PATCHES_PER_PAGE - 1) / PATCHES_PER_PAGE; - else - /* !! The number below must equal the number of patches, currently 11 !! */ - mgr->current_pages = (11 + PATCHES_PER_PAGE - 1) / PATCHES_PER_PAGE; - - for (i = 0; i < mgr->current_pages; i++) { - mgr->patch[i] = (void *)__get_free_page(GFP_KERNEL); - if (mgr->patch[i] == NULL) { - mgr->current_pages = i; - fx_cleanup(mgr); - return -ENOMEM; - } - memset(mgr->patch[i], 0, PAGE_SIZE); - } - - if (card->is_audigy) { - for (i = 0; i < 1024; i++) - OP(0xf, 0x0c0, 0x0c0, 0x0cf, 0x0c0); - - for (i = 0; i < 512 ; i++) - sblive_writeptr(card, A_GPR_BASE+i,0,0); - - pc=0; - - //Pcm input volume - OP(0, 0x402, 0x0c0, 0x406, 0x000); - OP(0, 0x403, 0x0c0, 0x407, 0x001); - - //CD-Digital input Volume - OP(0, 0x404, 0x0c0, 0x40d, 0x42); - OP(0, 0x405, 0x0c0, 0x40f, 0x43); - - // CD + PCM - OP(6, 0x400, 0x0c0, 0x402, 0x404); - OP(6, 0x401, 0x0c0, 0x403, 0x405); - - // Front Output + Master Volume - OP(0, 0x68, 0x0c0, 0x408, 0x400); - OP(0, 0x69, 0x0c0, 0x409, 0x401); - - // Add-in analog inputs for other speakers - OP(6, 0x400, 0x40, 0x400, 0xc0); - OP(6, 0x401, 0x41, 0x401, 0xc0); - - // Digital Front + Master Volume - OP(0, 0x60, 0x0c0, 0x408, 0x400); - OP(0, 0x61, 0x0c0, 0x409, 0x401); - - // Rear Output + Rear Volume - OP(0, 0x06e, 0x0c0, 0x419, 0x400); - OP(0, 0x06f, 0x0c0, 0x41a, 0x401); - - // Digital Rear Output + Rear Volume - OP(0, 0x066, 0x0c0, 0x419, 0x400); - OP(0, 0x067, 0x0c0, 0x41a, 0x401); - - // Audigy Drive, Headphone out - OP(6, 0x64, 0x0c0, 0x0c0, 0x400); - OP(6, 0x65, 0x0c0, 0x0c0, 0x401); - - // ac97 Recording - OP(6, 0x76, 0x0c0, 0x0c0, 0x40); - OP(6, 0x77, 0x0c0, 0x0c0, 0x41); - - // Center = sub = Left/2 + Right/2 - OP(0xe, 0x400, 0x401, 0xcd, 0x400); - - // center/sub Volume (master) - OP(0, 0x06a, 0x0c0, 0x408, 0x400); - OP(0, 0x06b, 0x0c0, 0x409, 0x400); - - // Digital center/sub Volume (master) - OP(0, 0x062, 0x0c0, 0x408, 0x400); - OP(0, 0x063, 0x0c0, 0x409, 0x400); - - ROUTING_PATCH_START(rpatch, "Routing"); - ROUTING_PATCH_END(rpatch); - - /* delimiter patch */ - patch = PATCH(mgr, patch_n); - patch->code_size = 0; - - - sblive_writeptr(card, 0x53, 0, 0); - } else { - for (i = 0; i < 512 ; i++) - OP(6, 0x40, 0x40, 0x40, 0x40); - - for (i = 0; i < 256; i++) - sblive_writeptr_tag(card, 0, - FXGPREGBASE + i, 0, - TANKMEMADDRREGBASE + i, 0, - TAGLIST_END); - - - pc = 0; - - //first free GPR = 0x11b - - - /* FX volume correction and Volume control*/ - INPUT_PATCH_START(patch, "Pcm L vol", 0x0, 0); - GET_OUTPUT_GPR(patch, 0x100, 0x0); - GET_CONTROL_GPR(patch, 0x106, "Vol", 0, 0x7fffffff); - GET_DYNAMIC_GPR(patch, 0x112); - - OP(4, 0x112, 0x40, PCM_IN_L, 0x44); //*4 - OP(0, 0x100, 0x040, 0x112, 0x106); //*vol - INPUT_PATCH_END(patch); - - - INPUT_PATCH_START(patch, "Pcm R vol", 0x1, 0); - GET_OUTPUT_GPR(patch, 0x101, 0x1); - GET_CONTROL_GPR(patch, 0x107, "Vol", 0, 0x7fffffff); - GET_DYNAMIC_GPR(patch, 0x112); - - OP(4, 0x112, 0x40, PCM_IN_R, 0x44); - OP(0, 0x101, 0x040, 0x112, 0x107); - - INPUT_PATCH_END(patch); - - - // CD-Digital In Volume control - INPUT_PATCH_START(patch, "CD-Digital Vol L", 0x12, 0); - GET_OUTPUT_GPR(patch, 0x10c, 0x12); - GET_CONTROL_GPR(patch, 0x10d, "Vol", 0, 0x7fffffff); - - OP(0, 0x10c, 0x040, SPDIF_CD_L, 0x10d); - INPUT_PATCH_END(patch); - - INPUT_PATCH_START(patch, "CD-Digital Vol R", 0x13, 0); - GET_OUTPUT_GPR(patch, 0x10e, 0x13); - GET_CONTROL_GPR(patch, 0x10f, "Vol", 0, 0x7fffffff); - - OP(0, 0x10e, 0x040, SPDIF_CD_R, 0x10f); - INPUT_PATCH_END(patch); - - //Volume Correction for Multi-channel Inputs - INPUT_PATCH_START(patch, "Multi-Channel Gain", 0x08, 0); - patch->input=patch->output=0x3F00; - - GET_OUTPUT_GPR(patch, 0x113, MULTI_FRONT_L); - GET_OUTPUT_GPR(patch, 0x114, MULTI_FRONT_R); - GET_OUTPUT_GPR(patch, 0x115, MULTI_REAR_L); - GET_OUTPUT_GPR(patch, 0x116, MULTI_REAR_R); - GET_OUTPUT_GPR(patch, 0x117, MULTI_CENTER); - GET_OUTPUT_GPR(patch, 0x118, MULTI_LFE); - - OP(4, 0x113, 0x40, MULTI_FRONT_L, 0x44); - OP(4, 0x114, 0x40, MULTI_FRONT_R, 0x44); - OP(4, 0x115, 0x40, MULTI_REAR_L, 0x44); - OP(4, 0x116, 0x40, MULTI_REAR_R, 0x44); - OP(4, 0x117, 0x40, MULTI_CENTER, 0x44); - OP(4, 0x118, 0x40, MULTI_LFE, 0x44); - - INPUT_PATCH_END(patch); - - - //Routing patch start - ROUTING_PATCH_START(rpatch, "Routing"); - GET_INPUT_GPR(rpatch, 0x100, 0x0); - GET_INPUT_GPR(rpatch, 0x101, 0x1); - GET_INPUT_GPR(rpatch, 0x10c, 0x12); - GET_INPUT_GPR(rpatch, 0x10e, 0x13); - GET_INPUT_GPR(rpatch, 0x113, MULTI_FRONT_L); - GET_INPUT_GPR(rpatch, 0x114, MULTI_FRONT_R); - GET_INPUT_GPR(rpatch, 0x115, MULTI_REAR_L); - GET_INPUT_GPR(rpatch, 0x116, MULTI_REAR_R); - GET_INPUT_GPR(rpatch, 0x117, MULTI_CENTER); - GET_INPUT_GPR(rpatch, 0x118, MULTI_LFE); - - GET_DYNAMIC_GPR(rpatch, 0x102); - GET_DYNAMIC_GPR(rpatch, 0x103); - - GET_OUTPUT_GPR(rpatch, 0x104, 0x8); - GET_OUTPUT_GPR(rpatch, 0x105, 0x9); - GET_OUTPUT_GPR(rpatch, 0x10a, 0x2); - GET_OUTPUT_GPR(rpatch, 0x10b, 0x3); - - - /* input buffer */ - OP(6, 0x102, AC97_IN_L, 0x40, 0x40); - OP(6, 0x103, AC97_IN_R, 0x40, 0x40); - - - /* Digital In + PCM + MULTI_FRONT-> AC97 out (front speakers)*/ - OP(6, AC97_FRONT_L, 0x100, 0x10c, 0x113); - - CONNECT(MULTI_FRONT_L, AC97_FRONT_L); - CONNECT(PCM_IN_L, AC97_FRONT_L); - CONNECT(SPDIF_CD_L, AC97_FRONT_L); - - OP(6, AC97_FRONT_R, 0x101, 0x10e, 0x114); - - CONNECT(MULTI_FRONT_R, AC97_FRONT_R); - CONNECT(PCM_IN_R, AC97_FRONT_R); - CONNECT(SPDIF_CD_R, AC97_FRONT_R); - - /* Digital In + PCM + AC97 In + PCM1 + MULTI_REAR --> Rear Channel */ - OP(6, 0x104, PCM1_IN_L, 0x100, 0x115); - OP(6, 0x104, 0x104, 0x10c, 0x102); - - CONNECT(MULTI_REAR_L, ANALOG_REAR_L); - CONNECT(AC97_IN_L, ANALOG_REAR_L); - CONNECT(PCM_IN_L, ANALOG_REAR_L); - CONNECT(SPDIF_CD_L, ANALOG_REAR_L); - CONNECT(PCM1_IN_L, ANALOG_REAR_L); - - OP(6, 0x105, PCM1_IN_R, 0x101, 0x116); - OP(6, 0x105, 0x105, 0x10e, 0x103); - - CONNECT(MULTI_REAR_R, ANALOG_REAR_R); - CONNECT(AC97_IN_R, ANALOG_REAR_R); - CONNECT(PCM_IN_R, ANALOG_REAR_R); - CONNECT(SPDIF_CD_R, ANALOG_REAR_R); - CONNECT(PCM1_IN_R, ANALOG_REAR_R); - - /* Digital In + PCM + AC97 In + MULTI_FRONT --> Digital out */ - OP(6, 0x10b, 0x100, 0x102, 0x10c); - OP(6, 0x10b, 0x10b, 0x113, 0x40); - - CONNECT(MULTI_FRONT_L, DIGITAL_OUT_L); - CONNECT(PCM_IN_L, DIGITAL_OUT_L); - CONNECT(AC97_IN_L, DIGITAL_OUT_L); - CONNECT(SPDIF_CD_L, DIGITAL_OUT_L); - - OP(6, 0x10a, 0x101, 0x103, 0x10e); - OP(6, 0x10b, 0x10b, 0x114, 0x40); - - CONNECT(MULTI_FRONT_R, DIGITAL_OUT_R); - CONNECT(PCM_IN_R, DIGITAL_OUT_R); - CONNECT(AC97_IN_R, DIGITAL_OUT_R); - CONNECT(SPDIF_CD_R, DIGITAL_OUT_R); - - /* AC97 In --> ADC Recording Buffer */ - OP(6, ADC_REC_L, 0x102, 0x40, 0x40); - - CONNECT(AC97_IN_L, ADC_REC_L); - - OP(6, ADC_REC_R, 0x103, 0x40, 0x40); - - CONNECT(AC97_IN_R, ADC_REC_R); - - - /* fx12:Analog-Center */ - OP(6, ANALOG_CENTER, 0x117, 0x40, 0x40); - CONNECT(MULTI_CENTER, ANALOG_CENTER); - - /* fx11:Analog-LFE */ - OP(6, ANALOG_LFE, 0x118, 0x40, 0x40); - CONNECT(MULTI_LFE, ANALOG_LFE); - - /* fx12:Digital-Center */ - OP(6, DIGITAL_CENTER, 0x117, 0x40, 0x40); - CONNECT(MULTI_CENTER, DIGITAL_CENTER); - - /* fx11:Analog-LFE */ - OP(6, DIGITAL_LFE, 0x118, 0x40, 0x40); - CONNECT(MULTI_LFE, DIGITAL_LFE); - - ROUTING_PATCH_END(rpatch); - - - // Rear volume control - OUTPUT_PATCH_START(patch, "Vol Rear L", 0x8, 0); - GET_INPUT_GPR(patch, 0x104, 0x8); - GET_CONTROL_GPR(patch, 0x119, "Vol", 0, 0x7fffffff); - - OP(0, ANALOG_REAR_L, 0x040, 0x104, 0x119); - OUTPUT_PATCH_END(patch); - - OUTPUT_PATCH_START(patch, "Vol Rear R", 0x9, 0); - GET_INPUT_GPR(patch, 0x105, 0x9); - GET_CONTROL_GPR(patch, 0x11a, "Vol", 0, 0x7fffffff); - - OP(0, ANALOG_REAR_R, 0x040, 0x105, 0x11a); - OUTPUT_PATCH_END(patch); - - - //Master volume control on front-digital - OUTPUT_PATCH_START(patch, "Vol Master L", 0x2, 1); - GET_INPUT_GPR(patch, 0x10a, 0x2); - GET_CONTROL_GPR(patch, 0x108, "Vol", 0, 0x7fffffff); - - OP(0, DIGITAL_OUT_L, 0x040, 0x10a, 0x108); - OUTPUT_PATCH_END(patch); - - - OUTPUT_PATCH_START(patch, "Vol Master R", 0x3, 1); - GET_INPUT_GPR(patch, 0x10b, 0x3); - GET_CONTROL_GPR(patch, 0x109, "Vol", 0, 0x7fffffff); - - OP(0, DIGITAL_OUT_R, 0x040, 0x10b, 0x109); - OUTPUT_PATCH_END(patch); - - - /* delimiter patch */ - patch = PATCH(mgr, patch_n); - patch->code_size = 0; - - - sblive_writeptr(card, DBG, 0, 0); - } - - spin_lock_init(&mgr->lock); - - // Set up Volume controls, try to keep this the same for both Audigy and Live - - //Master volume - mgr->ctrl_gpr[SOUND_MIXER_VOLUME][0] = 8; - mgr->ctrl_gpr[SOUND_MIXER_VOLUME][1] = 9; - - left = card->ac97->mixer_state[SOUND_MIXER_VOLUME] & 0xff; - right = (card->ac97->mixer_state[SOUND_MIXER_VOLUME] >> 8) & 0xff; - - emu10k1_set_volume_gpr(card, 8, left, 1 << card->ac97->bit_resolution); - emu10k1_set_volume_gpr(card, 9, right, 1 << card->ac97->bit_resolution); - - //Rear volume - mgr->ctrl_gpr[ SOUND_MIXER_OGAIN ][0] = 0x19; - mgr->ctrl_gpr[ SOUND_MIXER_OGAIN ][1] = 0x1a; - - left = right = 67; - card->ac97->mixer_state[SOUND_MIXER_OGAIN] = (right << 8) | left; - - card->ac97->supported_mixers |= SOUND_MASK_OGAIN; - card->ac97->stereo_mixers |= SOUND_MASK_OGAIN; - - emu10k1_set_volume_gpr(card, 0x19, left, VOL_5BIT); - emu10k1_set_volume_gpr(card, 0x1a, right, VOL_5BIT); - - //PCM Volume - mgr->ctrl_gpr[SOUND_MIXER_PCM][0] = 6; - mgr->ctrl_gpr[SOUND_MIXER_PCM][1] = 7; - - left = card->ac97->mixer_state[SOUND_MIXER_PCM] & 0xff; - right = (card->ac97->mixer_state[SOUND_MIXER_PCM] >> 8) & 0xff; - - emu10k1_set_volume_gpr(card, 6, left, VOL_5BIT); - emu10k1_set_volume_gpr(card, 7, right, VOL_5BIT); - - //CD-Digital Volume - mgr->ctrl_gpr[SOUND_MIXER_DIGITAL1][0] = 0xd; - mgr->ctrl_gpr[SOUND_MIXER_DIGITAL1][1] = 0xf; - - left = right = 67; - card->ac97->mixer_state[SOUND_MIXER_DIGITAL1] = (right << 8) | left; - - card->ac97->supported_mixers |= SOUND_MASK_DIGITAL1; - card->ac97->stereo_mixers |= SOUND_MASK_DIGITAL1; - - emu10k1_set_volume_gpr(card, 0xd, left, VOL_5BIT); - emu10k1_set_volume_gpr(card, 0xf, right, VOL_5BIT); - - - //hard wire the ac97's pcm, pcm volume is done above using dsp code. - if (card->is_audigy) - //for Audigy, we mute it and use the philips 6 channel DAC instead - emu10k1_ac97_write(card->ac97, 0x18, 0x8000); - else - //For the Live we hardwire it to full volume - emu10k1_ac97_write(card->ac97, 0x18, 0x0); - - //remove it from the ac97_codec's control - card->ac97_supported_mixers &= ~SOUND_MASK_PCM; - card->ac97_stereo_mixers &= ~SOUND_MASK_PCM; - - //set Igain to 0dB by default, maybe consider hardwiring it here. - emu10k1_ac97_write(card->ac97, AC97_RECORD_GAIN, 0x0000); - card->ac97->mixer_state[SOUND_MIXER_IGAIN] = 0x101; - - return 0; -} - -static int __devinit hw_init(struct emu10k1_card *card) -{ - int nCh; - u32 pagecount; /* tmp */ - int ret; - - /* Disable audio and lock cache */ - emu10k1_writefn0(card, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE); - - /* Reset recording buffers */ - sblive_writeptr_tag(card, 0, - MICBS, ADCBS_BUFSIZE_NONE, - MICBA, 0, - FXBS, ADCBS_BUFSIZE_NONE, - FXBA, 0, - ADCBS, ADCBS_BUFSIZE_NONE, - ADCBA, 0, - TAGLIST_END); - - /* Disable channel interrupt */ - emu10k1_writefn0(card, INTE, 0); - sblive_writeptr_tag(card, 0, - CLIEL, 0, - CLIEH, 0, - SOLEL, 0, - SOLEH, 0, - TAGLIST_END); - - if (card->is_audigy) { - sblive_writeptr_tag(card,0, - 0x5e,0xf00, - 0x5f,0x3, - TAGLIST_END); - } - - /* Init envelope engine */ - for (nCh = 0; nCh < NUM_G; nCh++) { - sblive_writeptr_tag(card, nCh, - DCYSUSV, 0, - IP, 0, - VTFT, 0xffff, - CVCF, 0xffff, - PTRX, 0, - //CPF, 0, - CCR, 0, - - PSST, 0, - DSL, 0x10, - CCCA, 0, - Z1, 0, - Z2, 0, - FXRT, 0xd01c0000, - - ATKHLDM, 0, - DCYSUSM, 0, - IFATN, 0xffff, - PEFE, 0, - FMMOD, 0, - TREMFRQ, 24, /* 1 Hz */ - FM2FRQ2, 24, /* 1 Hz */ - TEMPENV, 0, - - /*** These are last so OFF prevents writing ***/ - LFOVAL2, 0, - LFOVAL1, 0, - ATKHLDV, 0, - ENVVOL, 0, - ENVVAL, 0, - TAGLIST_END); - sblive_writeptr(card, CPF, nCh, 0); - /* - Audigy FXRT initialization - reversed eng'd, may not be accurate. - */ - if (card->is_audigy) { - sblive_writeptr_tag(card,nCh, - 0x4c,0x0, - 0x4d,0x0, - 0x4e,0x0, - 0x4f,0x0, - A_FXRT1, 0x3f3f3f3f, - A_FXRT2, 0x3f3f3f3f, - A_SENDAMOUNTS, 0, - TAGLIST_END); - } - } - - - /* - ** Init to 0x02109204 : - ** Clock accuracy = 0 (1000ppm) - ** Sample Rate = 2 (48kHz) - ** Audio Channel = 1 (Left of 2) - ** Source Number = 0 (Unspecified) - ** Generation Status = 1 (Original for Cat Code 12) - ** Cat Code = 12 (Digital Signal Mixer) - ** Mode = 0 (Mode 0) - ** Emphasis = 0 (None) - ** CP = 1 (Copyright unasserted) - ** AN = 0 (Digital audio) - ** P = 0 (Consumer) - */ - - sblive_writeptr_tag(card, 0, - - /* SPDIF0 */ - SPCS0, (SPCS_CLKACCY_1000PPM | 0x002000000 | - SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | SPCS_GENERATIONSTATUS | 0x00001200 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT), - - /* SPDIF1 */ - SPCS1, (SPCS_CLKACCY_1000PPM | 0x002000000 | - SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | SPCS_GENERATIONSTATUS | 0x00001200 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT), - - /* SPDIF2 & SPDIF3 */ - SPCS2, (SPCS_CLKACCY_1000PPM | 0x002000000 | - SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | SPCS_GENERATIONSTATUS | 0x00001200 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT), - - TAGLIST_END); - - if (card->is_audigy && (card->chiprev == 4)) { - /* Hacks for Alice3 to work independent of haP16V driver */ - u32 tmp; - - //Setup SRCMulti_I2S SamplingRate - tmp = sblive_readptr(card, A_SPDIF_SAMPLERATE, 0); - tmp &= 0xfffff1ff; - tmp |= (0x2<<9); - sblive_writeptr(card, A_SPDIF_SAMPLERATE, 0, tmp); - - /* Setup SRCSel (Enable Spdif,I2S SRCMulti) */ - emu10k1_writefn0(card, 0x20, 0x600000); - emu10k1_writefn0(card, 0x24, 0x14); - - /* Setup SRCMulti Input Audio Enable */ - emu10k1_writefn0(card, 0x20, 0x6E0000); - emu10k1_writefn0(card, 0x24, 0xFF00FF00); - } - - ret = fx_init(card); /* initialize effects engine */ - if (ret < 0) - return ret; - - card->tankmem.size = 0; - - card->virtualpagetable.size = MAXPAGES * sizeof(u32); - - card->virtualpagetable.addr = pci_alloc_consistent(card->pci_dev, card->virtualpagetable.size, &card->virtualpagetable.dma_handle); - if (card->virtualpagetable.addr == NULL) { - ERROR(); - ret = -ENOMEM; - goto err0; - } - - card->silentpage.size = EMUPAGESIZE; - - card->silentpage.addr = pci_alloc_consistent(card->pci_dev, card->silentpage.size, &card->silentpage.dma_handle); - if (card->silentpage.addr == NULL) { - ERROR(); - ret = -ENOMEM; - goto err1; - } - - for (pagecount = 0; pagecount < MAXPAGES; pagecount++) - ((u32 *) card->virtualpagetable.addr)[pagecount] = cpu_to_le32(((u32) card->silentpage.dma_handle * 2) | pagecount); - - /* Init page table & tank memory base register */ - sblive_writeptr_tag(card, 0, - PTB, (u32) card->virtualpagetable.dma_handle, - TCB, 0, - TCBS, 0, - TAGLIST_END); - - for (nCh = 0; nCh < NUM_G; nCh++) { - sblive_writeptr_tag(card, nCh, - MAPA, MAP_PTI_MASK | ((u32) card->silentpage.dma_handle * 2), - MAPB, MAP_PTI_MASK | ((u32) card->silentpage.dma_handle * 2), - TAGLIST_END); - } - - /* Hokay, now enable the AUD bit */ - /* Enable Audio = 1 */ - /* Mute Disable Audio = 0 */ - /* Lock Tank Memory = 1 */ - /* Lock Sound Memory = 0 */ - /* Auto Mute = 1 */ - if (card->is_audigy) { - if (card->chiprev == 4) - emu10k1_writefn0(card, HCFG, HCFG_AUDIOENABLE | HCFG_AC3ENABLE_CDSPDIF | HCFG_AC3ENABLE_GPSPDIF | HCFG_AUTOMUTE | HCFG_JOYENABLE); - else - emu10k1_writefn0(card, HCFG, HCFG_AUDIOENABLE | HCFG_AUTOMUTE | HCFG_JOYENABLE); - } else { - if (card->model == 0x20 || card->model == 0xc400 || - (card->model == 0x21 && card->chiprev < 6)) - emu10k1_writefn0(card, HCFG, HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE); - else - emu10k1_writefn0(card, HCFG, HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE | HCFG_JOYENABLE); - } - /* Enable Vol_Ctrl irqs */ - emu10k1_irq_enable(card, INTE_VOLINCRENABLE | INTE_VOLDECRENABLE | INTE_MUTEENABLE | INTE_FXDSPENABLE); - - if (card->is_audigy && (card->chiprev == 4)) { - /* Unmute Analog now. Set GPO6 to 1 for Apollo. - * This has to be done after init ALice3 I2SOut beyond 48KHz. - * So, sequence is important. */ - u32 tmp = emu10k1_readfn0(card, A_IOCFG); - tmp |= 0x0040; - emu10k1_writefn0(card, A_IOCFG, tmp); - } - - /* FIXME: TOSLink detection */ - card->has_toslink = 0; - - /* Initialize digital passthrough variables */ - card->pt.pos_gpr = card->pt.intr_gpr = card->pt.enable_gpr = -1; - card->pt.selected = 0; - card->pt.state = PT_STATE_INACTIVE; - card->pt.spcs_to_use = 0x01; - card->pt.patch_name = "AC3pass"; - card->pt.intr_gpr_name = "count"; - card->pt.enable_gpr_name = "enable"; - card->pt.pos_gpr_name = "ptr"; - spin_lock_init(&card->pt.lock); - init_waitqueue_head(&card->pt.wait); - -/* tmp = sblive_readfn0(card, HCFG); - if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) { - sblive_writefn0(card, HCFG, tmp | 0x800); - - udelay(512); - - if (tmp != (sblive_readfn0(card, HCFG) & ~0x800)) { - card->has_toslink = 1; - sblive_writefn0(card, HCFG, tmp); - } - } -*/ - return 0; - - err1: - pci_free_consistent(card->pci_dev, card->virtualpagetable.size, card->virtualpagetable.addr, card->virtualpagetable.dma_handle); - err0: - fx_cleanup(&card->mgr); - - return ret; -} - -static int __devinit emu10k1_init(struct emu10k1_card *card) -{ - /* Init Card */ - if (hw_init(card) < 0) - return -1; - - voice_init(card); - timer_init(card); - addxmgr_init(card); - - DPD(2, " hw control register -> %#x\n", emu10k1_readfn0(card, HCFG)); - - return 0; -} - -static void emu10k1_cleanup(struct emu10k1_card *card) -{ - int ch; - - emu10k1_writefn0(card, INTE, 0); - - /** Shutdown the chip **/ - for (ch = 0; ch < NUM_G; ch++) - sblive_writeptr(card, DCYSUSV, ch, 0); - - for (ch = 0; ch < NUM_G; ch++) { - sblive_writeptr_tag(card, ch, - VTFT, 0, - CVCF, 0, - PTRX, 0, - //CPF, 0, - TAGLIST_END); - sblive_writeptr(card, CPF, ch, 0); - } - - /* Disable audio and lock cache */ - emu10k1_writefn0(card, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE); - - sblive_writeptr_tag(card, 0, - PTB, 0, - - /* Reset recording buffers */ - MICBS, ADCBS_BUFSIZE_NONE, - MICBA, 0, - FXBS, ADCBS_BUFSIZE_NONE, - FXBA, 0, - FXWC, 0, - ADCBS, ADCBS_BUFSIZE_NONE, - ADCBA, 0, - TCBS, 0, - TCB, 0, - DBG, 0x8000, - - /* Disable channel interrupt */ - CLIEL, 0, - CLIEH, 0, - SOLEL, 0, - SOLEH, 0, - TAGLIST_END); - - if (card->is_audigy) - sblive_writeptr(card, 0, A_DBG, A_DBG_SINGLE_STEP); - - pci_free_consistent(card->pci_dev, card->virtualpagetable.size, card->virtualpagetable.addr, card->virtualpagetable.dma_handle); - pci_free_consistent(card->pci_dev, card->silentpage.size, card->silentpage.addr, card->silentpage.dma_handle); - - if(card->tankmem.size != 0) - pci_free_consistent(card->pci_dev, card->tankmem.size, card->tankmem.addr, card->tankmem.dma_handle); - - /* release patch storage memory */ - fx_cleanup(&card->mgr); -} - -/* Driver initialization routine */ -static int __devinit emu10k1_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) -{ - struct emu10k1_card *card; - u32 subsysvid; - int ret; - - if (pci_set_dma_mask(pci_dev, EMU10K1_DMA_MASK)) { - printk(KERN_ERR "emu10k1: architecture does not support 29bit PCI busmaster DMA\n"); - return -ENODEV; - } - - if (pci_enable_device(pci_dev)) - return -EIO; - - pci_set_master(pci_dev); - - if ((card = kzalloc(sizeof(struct emu10k1_card), GFP_KERNEL)) == NULL) { - printk(KERN_ERR "emu10k1: out of memory\n"); - return -ENOMEM; - } - - card->iobase = pci_resource_start(pci_dev, 0); - card->length = pci_resource_len(pci_dev, 0); - - if (request_region(card->iobase, card->length, card_names[pci_id->driver_data]) == NULL) { - printk(KERN_ERR "emu10k1: IO space in use\n"); - ret = -EBUSY; - goto err_region; - } - - pci_set_drvdata(pci_dev, card); - - card->irq = pci_dev->irq; - card->pci_dev = pci_dev; - - /* Reserve IRQ Line */ - if (request_irq(card->irq, emu10k1_interrupt, IRQF_SHARED, card_names[pci_id->driver_data], card)) { - printk(KERN_ERR "emu10k1: IRQ in use\n"); - ret = -EBUSY; - goto err_irq; - } - - card->chiprev = pci_dev->revision; - pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &card->model); - - printk(KERN_INFO "emu10k1: %s rev %d model %#04x found, IO at %#04lx-%#04lx, IRQ %d\n", - card_names[pci_id->driver_data], card->chiprev, card->model, card->iobase, - card->iobase + card->length - 1, card->irq); - - if (pci_id->device == PCI_DEVICE_ID_CREATIVE_AUDIGY) - card->is_audigy = 1; - - pci_read_config_dword(pci_dev, PCI_SUBSYSTEM_VENDOR_ID, &subsysvid); - card->is_aps = (subsysvid == EMU_APS_SUBID); - - spin_lock_init(&card->lock); - mutex_init(&card->open_sem); - card->open_mode = 0; - init_waitqueue_head(&card->open_wait); - - ret = emu10k1_audio_init(card); - if (ret < 0) { - printk(KERN_ERR "emu10k1: cannot initialize audio devices\n"); - goto err_audio; - } - - ret = emu10k1_mixer_init(card); - if (ret < 0) { - printk(KERN_ERR "emu10k1: cannot initialize AC97 codec\n"); - goto err_mixer; - } - - ret = emu10k1_midi_init(card); - if (ret < 0) { - printk(KERN_ERR "emu10k1: cannot register midi device\n"); - goto err_midi; - } - - ret = emu10k1_init(card); - if (ret < 0) { - printk(KERN_ERR "emu10k1: cannot initialize device\n"); - goto err_emu10k1_init; - } - - if (card->is_aps) - emu10k1_ecard_init(card); - - ret = emu10k1_register_devices(card); - if (ret < 0) - goto err_register; - - /* proc entries must be created after registering devices, as - * emu10k1_info_proc prints card->audio_dev &co. */ - ret = emu10k1_proc_init(card); - if (ret < 0) { - printk(KERN_ERR "emu10k1: cannot initialize proc directory\n"); - goto err_proc; - } - - list_add(&card->list, &emu10k1_devs); - - return 0; - -err_proc: - emu10k1_unregister_devices(card); - -err_register: - emu10k1_cleanup(card); - -err_emu10k1_init: - emu10k1_midi_cleanup(card); - -err_midi: - emu10k1_mixer_cleanup(card); - -err_mixer: - emu10k1_audio_cleanup(card); - -err_audio: - free_irq(card->irq, card); - -err_irq: - release_region(card->iobase, card->length); - pci_set_drvdata(pci_dev, NULL); - -err_region: - kfree(card); - - return ret; -} - -static void __devexit emu10k1_remove(struct pci_dev *pci_dev) -{ - struct emu10k1_card *card = pci_get_drvdata(pci_dev); - - list_del(&card->list); - - emu10k1_unregister_devices(card); - emu10k1_cleanup(card); - emu10k1_midi_cleanup(card); - emu10k1_mixer_cleanup(card); - emu10k1_proc_cleanup(card); - emu10k1_audio_cleanup(card); - free_irq(card->irq, card); - release_region(card->iobase, card->length); - kfree(card); - pci_set_drvdata(pci_dev, NULL); -} - -MODULE_AUTHOR("Bertrand Lee, Cai Ying. (Email to: emu10k1-devel@lists.sourceforge.net)"); -MODULE_DESCRIPTION("Creative EMU10K1 PCI Audio Driver v" DRIVER_VERSION "\nCopyright (C) 1999 Creative Technology Ltd."); -MODULE_LICENSE("GPL"); - -static struct pci_driver emu10k1_pci_driver = { - .name = "emu10k1", - .id_table = emu10k1_pci_tbl, - .probe = emu10k1_probe, - .remove = __devexit_p(emu10k1_remove), -}; - -static int __init emu10k1_init_module(void) -{ - printk(KERN_INFO "Creative EMU10K1 PCI Audio Driver, version " DRIVER_VERSION ", " __TIME__ " " __DATE__ "\n"); - - return pci_register_driver(&emu10k1_pci_driver); -} - -static void __exit emu10k1_cleanup_module(void) -{ - pci_unregister_driver(&emu10k1_pci_driver); - - return; -} - -module_init(emu10k1_init_module); -module_exit(emu10k1_cleanup_module); - -#ifdef EMU10K1_SEQUENCER - -/* in midi.c */ -extern int emu10k1_seq_midi_open(int dev, int mode, - void (*input)(int dev, unsigned char midi_byte), - void (*output)(int dev)); -extern void emu10k1_seq_midi_close(int dev); -extern int emu10k1_seq_midi_out(int dev, unsigned char midi_byte); -extern int emu10k1_seq_midi_start_read(int dev); -extern int emu10k1_seq_midi_end_read(int dev); -extern void emu10k1_seq_midi_kick(int dev); -extern int emu10k1_seq_midi_buffer_status(int dev); - -static struct midi_operations emu10k1_midi_operations = -{ - THIS_MODULE, - {"EMU10K1 MIDI", 0, 0, SNDCARD_EMU10K1}, - &std_midi_synth, - {0}, - emu10k1_seq_midi_open, - emu10k1_seq_midi_close, - NULL, - emu10k1_seq_midi_out, - emu10k1_seq_midi_start_read, - emu10k1_seq_midi_end_read, - emu10k1_seq_midi_kick, - NULL, - emu10k1_seq_midi_buffer_status, - NULL -}; - -#endif diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c deleted file mode 100644 index df1e990449a..00000000000 --- a/sound/oss/emu10k1/midi.c +++ /dev/null @@ -1,614 +0,0 @@ -/* - ********************************************************************** - * midi.c - /dev/midi interface for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include <linux/module.h> -#include <linux/poll.h> -#include <linux/slab.h> -#include <linux/sched.h> -#include <linux/smp_lock.h> -#include <asm/uaccess.h> - -#include "hwaccess.h" -#include "cardmo.h" -#include "cardmi.h" -#include "midi.h" - -#ifdef EMU10K1_SEQUENCER -#include "../sound_config.h" -#endif - -static DEFINE_SPINLOCK(midi_spinlock); - -static void init_midi_hdr(struct midi_hdr *midihdr) -{ - midihdr->bufferlength = MIDIIN_BUFLEN; - midihdr->bytesrecorded = 0; - midihdr->flags = 0; -} - -static int midiin_add_buffer(struct emu10k1_mididevice *midi_dev, struct midi_hdr **midihdrptr) -{ - struct midi_hdr *midihdr; - - if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) { - ERROR(); - return -EINVAL; - } - - init_midi_hdr(midihdr); - - midihdr->data = kmalloc(MIDIIN_BUFLEN, GFP_KERNEL); - if (!midihdr->data) { - ERROR(); - kfree(midihdr); - return -1; - } - - if (emu10k1_mpuin_add_buffer(midi_dev->card->mpuin, midihdr) < 0) { - ERROR(); - kfree(midihdr->data); - kfree(midihdr); - return -1; - } - - *midihdrptr = midihdr; - list_add_tail(&midihdr->list, &midi_dev->mid_hdrs); - - return 0; -} - -static int emu10k1_midi_open(struct inode *inode, struct file *file) -{ - int minor = iminor(inode); - struct emu10k1_card *card = NULL; - struct emu10k1_mididevice *midi_dev; - struct list_head *entry; - - DPF(2, "emu10k1_midi_open()\n"); - - /* Check for correct device to open */ - list_for_each(entry, &emu10k1_devs) { - card = list_entry(entry, struct emu10k1_card, list); - - if (card->midi_dev == minor) - goto match; - } - - return -ENODEV; - -match: -#ifdef EMU10K1_SEQUENCER - if (card->seq_mididev) /* card is opened by sequencer */ - return -EBUSY; -#endif - - /* Wait for device to become free */ - mutex_lock(&card->open_sem); - while (card->open_mode & (file->f_mode << FMODE_MIDI_SHIFT)) { - if (file->f_flags & O_NONBLOCK) { - mutex_unlock(&card->open_sem); - return -EBUSY; - } - - mutex_unlock(&card->open_sem); - interruptible_sleep_on(&card->open_wait); - - if (signal_pending(current)) { - return -ERESTARTSYS; - } - - mutex_lock(&card->open_sem); - } - - if ((midi_dev = kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL) - return -EINVAL; - - midi_dev->card = card; - midi_dev->mistate = MIDIIN_STATE_STOPPED; - init_waitqueue_head(&midi_dev->oWait); - init_waitqueue_head(&midi_dev->iWait); - midi_dev->ird = 0; - midi_dev->iwr = 0; - midi_dev->icnt = 0; - INIT_LIST_HEAD(&midi_dev->mid_hdrs); - - if (file->f_mode & FMODE_READ) { - struct midi_openinfo dsCardMidiOpenInfo; - struct midi_hdr *midihdr1; - struct midi_hdr *midihdr2; - - dsCardMidiOpenInfo.refdata = (unsigned long) midi_dev; - - if (emu10k1_mpuin_open(card, &dsCardMidiOpenInfo) < 0) { - ERROR(); - kfree(midi_dev); - return -ENODEV; - } - - /* Add two buffers to receive sysex buffer */ - if (midiin_add_buffer(midi_dev, &midihdr1) < 0) { - kfree(midi_dev); - return -ENODEV; - } - - if (midiin_add_buffer(midi_dev, &midihdr2) < 0) { - list_del(&midihdr1->list); - kfree(midihdr1->data); - kfree(midihdr1); - kfree(midi_dev); - return -ENODEV; - } - } - - if (file->f_mode & FMODE_WRITE) { - struct midi_openinfo dsCardMidiOpenInfo; - - dsCardMidiOpenInfo.refdata = (unsigned long) midi_dev; - - if (emu10k1_mpuout_open(card, &dsCardMidiOpenInfo) < 0) { - ERROR(); - kfree(midi_dev); - return -ENODEV; - } - } - - file->private_data = (void *) midi_dev; - - card->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE); - - mutex_unlock(&card->open_sem); - - return nonseekable_open(inode, file); -} - -static int emu10k1_midi_release(struct inode *inode, struct file *file) -{ - struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data; - struct emu10k1_card *card; - - lock_kernel(); - - card = midi_dev->card; - DPF(2, "emu10k1_midi_release()\n"); - - if (file->f_mode & FMODE_WRITE) { - if (!(file->f_flags & O_NONBLOCK)) { - - while (!signal_pending(current) && (card->mpuout->firstmidiq != NULL)) { - DPF(4, "Cannot close - buffers not empty\n"); - - interruptible_sleep_on(&midi_dev->oWait); - - } - } - - emu10k1_mpuout_close(card); - } - - if (file->f_mode & FMODE_READ) { - struct midi_hdr *midihdr; - - if (midi_dev->mistate == MIDIIN_STATE_STARTED) { - emu10k1_mpuin_stop(card); - midi_dev->mistate = MIDIIN_STATE_STOPPED; - } - - emu10k1_mpuin_reset(card); - emu10k1_mpuin_close(card); - - while (!list_empty(&midi_dev->mid_hdrs)) { - midihdr = list_entry(midi_dev->mid_hdrs.next, struct midi_hdr, list); - - list_del(midi_dev->mid_hdrs.next); - kfree(midihdr->data); - kfree(midihdr); - } - } - - kfree(midi_dev); - - mutex_lock(&card->open_sem); - card->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE)); - mutex_unlock(&card->open_sem); - wake_up_interruptible(&card->open_wait); - - unlock_kernel(); - - return 0; -} - -static ssize_t emu10k1_midi_read(struct file *file, char __user *buffer, size_t count, loff_t * pos) -{ - struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data; - ssize_t ret = 0; - u16 cnt; - unsigned long flags; - - DPD(4, "emu10k1_midi_read(), count %#x\n", (u32) count); - - if (!access_ok(VERIFY_WRITE, buffer, count)) - return -EFAULT; - - if (midi_dev->mistate == MIDIIN_STATE_STOPPED) { - if (emu10k1_mpuin_start(midi_dev->card) < 0) { - ERROR(); - return -EINVAL; - } - - midi_dev->mistate = MIDIIN_STATE_STARTED; - } - - while (count > 0) { - cnt = MIDIIN_BUFLEN - midi_dev->ird; - - spin_lock_irqsave(&midi_spinlock, flags); - - if (midi_dev->icnt < cnt) - cnt = midi_dev->icnt; - - spin_unlock_irqrestore(&midi_spinlock, flags); - - if (cnt > count) - cnt = count; - - if (cnt <= 0) { - if (file->f_flags & O_NONBLOCK) - return ret ? ret : -EAGAIN; - DPF(2, " Go to sleep...\n"); - - interruptible_sleep_on(&midi_dev->iWait); - - if (signal_pending(current)) - return ret ? ret : -ERESTARTSYS; - - continue; - } - - if (copy_to_user(buffer, midi_dev->iBuf + midi_dev->ird, cnt)) { - ERROR(); - return ret ? ret : -EFAULT; - } - - midi_dev->ird += cnt; - midi_dev->ird %= MIDIIN_BUFLEN; - - spin_lock_irqsave(&midi_spinlock, flags); - - midi_dev->icnt -= cnt; - - spin_unlock_irqrestore(&midi_spinlock, flags); - - count -= cnt; - buffer += cnt; - ret += cnt; - - if (midi_dev->icnt == 0) - break; - } - - return ret; -} - -static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t * pos) -{ - struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data; - struct midi_hdr *midihdr; - unsigned long flags; - - DPD(4, "emu10k1_midi_write(), count=%#x\n", (u32) count); - - if (!access_ok(VERIFY_READ, buffer, count)) - return -EFAULT; - - if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) - return -EINVAL; - - midihdr->bufferlength = count; - midihdr->bytesrecorded = 0; - midihdr->flags = 0; - - midihdr->data = kmalloc(count, GFP_KERNEL); - if (!midihdr->data) { - ERROR(); - kfree(midihdr); - return -EINVAL; - } - - if (copy_from_user(midihdr->data, buffer, count)) { - kfree(midihdr->data); - kfree(midihdr); - return -EFAULT; - } - - spin_lock_irqsave(&midi_spinlock, flags); - - if (emu10k1_mpuout_add_buffer(midi_dev->card, midihdr) < 0) { - ERROR(); - kfree(midihdr->data); - kfree(midihdr); - spin_unlock_irqrestore(&midi_spinlock, flags); - return -EINVAL; - } - - spin_unlock_irqrestore(&midi_spinlock, flags); - - return count; -} - -static unsigned int emu10k1_midi_poll(struct file *file, struct poll_table_struct *wait) -{ - struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data; - unsigned long flags; - unsigned int mask = 0; - - DPF(4, "emu10k1_midi_poll() called\n"); - - if (file->f_mode & FMODE_WRITE) - poll_wait(file, &midi_dev->oWait, wait); - - if (file->f_mode & FMODE_READ) - poll_wait(file, &midi_dev->iWait, wait); - - spin_lock_irqsave(&midi_spinlock, flags); - - if (file->f_mode & FMODE_WRITE) - mask |= POLLOUT | POLLWRNORM; - - if (file->f_mode & FMODE_READ) { - if (midi_dev->mistate == MIDIIN_STATE_STARTED) - if (midi_dev->icnt > 0) - mask |= POLLIN | POLLRDNORM; - } - - spin_unlock_irqrestore(&midi_spinlock, flags); - - return mask; -} - -int emu10k1_midi_callback(unsigned long msg, unsigned long refdata, unsigned long *pmsg) -{ - struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) refdata; - struct midi_hdr *midihdr = NULL; - unsigned long flags; - int i; - - DPF(4, "emu10k1_midi_callback()\n"); - - spin_lock_irqsave(&midi_spinlock, flags); - - switch (msg) { - case ICARDMIDI_OUTLONGDATA: - midihdr = (struct midi_hdr *) pmsg[2]; - - kfree(midihdr->data); - kfree(midihdr); - wake_up_interruptible(&midi_dev->oWait); - - break; - - case ICARDMIDI_INLONGDATA: - midihdr = (struct midi_hdr *) pmsg[2]; - - for (i = 0; i < midihdr->bytesrecorded; i++) { - midi_dev->iBuf[midi_dev->iwr++] = midihdr->data[i]; - midi_dev->iwr %= MIDIIN_BUFLEN; - } - - midi_dev->icnt += midihdr->bytesrecorded; - - if (midi_dev->mistate == MIDIIN_STATE_STARTED) { - init_midi_hdr(midihdr); - emu10k1_mpuin_add_buffer(midi_dev->card->mpuin, midihdr); - wake_up_interruptible(&midi_dev->iWait); - } - break; - - case ICARDMIDI_INDATA: - { - u8 *pBuf = (u8 *) & pmsg[1]; - u16 bytesvalid = pmsg[2]; - - for (i = 0; i < bytesvalid; i++) { - midi_dev->iBuf[midi_dev->iwr++] = pBuf[i]; - midi_dev->iwr %= MIDIIN_BUFLEN; - } - - midi_dev->icnt += bytesvalid; - } - - wake_up_interruptible(&midi_dev->iWait); - break; - - default: /* Unknown message */ - spin_unlock_irqrestore(&midi_spinlock, flags); - return -1; - } - - spin_unlock_irqrestore(&midi_spinlock, flags); - - return 0; -} - -/* MIDI file operations */ -const struct file_operations emu10k1_midi_fops = { - .owner = THIS_MODULE, - .read = emu10k1_midi_read, - .write = emu10k1_midi_write, - .poll = emu10k1_midi_poll, - .open = emu10k1_midi_open, - .release = emu10k1_midi_release, -}; - - -#ifdef EMU10K1_SEQUENCER - -/* functions used for sequencer access */ - -int emu10k1_seq_midi_open(int dev, int mode, - void (*input) (int dev, unsigned char data), - void (*output) (int dev)) -{ - struct emu10k1_card *card; - struct midi_openinfo dsCardMidiOpenInfo; - struct emu10k1_mididevice *midi_dev; - - if (midi_devs[dev] == NULL || midi_devs[dev]->devc == NULL) - return -EINVAL; - - card = midi_devs[dev]->devc; - - if (card->open_mode) /* card is opened native */ - return -EBUSY; - - DPF(2, "emu10k1_seq_midi_open()\n"); - - if ((midi_dev = kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL) - return -EINVAL; - - midi_dev->card = card; - midi_dev->mistate = MIDIIN_STATE_STOPPED; - init_waitqueue_head(&midi_dev->oWait); - init_waitqueue_head(&midi_dev->iWait); - midi_dev->ird = 0; - midi_dev->iwr = 0; - midi_dev->icnt = 0; - INIT_LIST_HEAD(&midi_dev->mid_hdrs); - - dsCardMidiOpenInfo.refdata = (unsigned long) midi_dev; - - if (emu10k1_mpuout_open(card, &dsCardMidiOpenInfo) < 0) { - ERROR(); - return -ENODEV; - } - - card->seq_mididev = midi_dev; - - return 0; -} - -void emu10k1_seq_midi_close(int dev) -{ - struct emu10k1_card *card; - - DPF(2, "emu10k1_seq_midi_close()\n"); - if (midi_devs[dev] == NULL || midi_devs[dev]->devc == NULL) - return; - - card = midi_devs[dev]->devc; - emu10k1_mpuout_close(card); - - kfree(card->seq_mididev); - card->seq_mididev = NULL; -} - -int emu10k1_seq_midi_out(int dev, unsigned char midi_byte) -{ - struct emu10k1_card *card; - struct midi_hdr *midihdr; - unsigned long flags; - - if (midi_devs[dev] == NULL || midi_devs[dev]->devc == NULL) - return -EINVAL; - - card = midi_devs[dev]->devc; - - if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) - return -EINVAL; - - midihdr->bufferlength = 1; - midihdr->bytesrecorded = 0; - midihdr->flags = 0; - - midihdr->data = kmalloc(1, GFP_KERNEL); - if (!midihdr->data) { - ERROR(); - kfree(midihdr); - return -EINVAL; - } - - *(midihdr->data) = midi_byte; - - spin_lock_irqsave(&midi_spinlock, flags); - - if (emu10k1_mpuout_add_buffer(card, midihdr) < 0) { - ERROR(); - kfree(midihdr->data); - kfree(midihdr); - spin_unlock_irqrestore(&midi_spinlock, flags); - return -EINVAL; - } - - spin_unlock_irqrestore(&midi_spinlock, flags); - - return 1; -} - -int emu10k1_seq_midi_start_read(int dev) -{ - return 0; -} - -int emu10k1_seq_midi_end_read(int dev) -{ - return 0; -} - -void emu10k1_seq_midi_kick(int dev) -{ -} - -int emu10k1_seq_midi_buffer_status(int dev) -{ - int count; - struct midi_queue *queue; - struct emu10k1_card *card; - - if (midi_devs[dev] == NULL || midi_devs[dev]->devc == NULL) - return -EINVAL; - - count = 0; - - card = midi_devs[dev]->devc; - queue = card->mpuout->firstmidiq; - - while (queue != NULL) { - count++; - if (queue == card->mpuout->lastmidiq) - break; - - queue = queue->next; - } - - return count; -} - -#endif - diff --git a/sound/oss/emu10k1/midi.h b/sound/oss/emu10k1/midi.h deleted file mode 100644 index 2459ec929e8..00000000000 --- a/sound/oss/emu10k1/midi.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - ********************************************************************** - * midi.h - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _MIDI_H -#define _MIDI_H - -#define FMODE_MIDI_SHIFT 3 -#define FMODE_MIDI_READ (FMODE_READ << FMODE_MIDI_SHIFT) -#define FMODE_MIDI_WRITE (FMODE_WRITE << FMODE_MIDI_SHIFT) - -#define MIDIIN_STATE_STARTED 0x00000001 -#define MIDIIN_STATE_STOPPED 0x00000002 - -#define MIDIIN_BUFLEN 1024 - -struct emu10k1_mididevice -{ - struct emu10k1_card *card; - u32 mistate; - wait_queue_head_t oWait; - wait_queue_head_t iWait; - s8 iBuf[MIDIIN_BUFLEN]; - u16 ird, iwr, icnt; - struct list_head mid_hdrs; -}; - -/* uncomment next line to use midi port on Audigy drive */ -//#define USE_AUDIGY_DRIVE_MIDI - -#ifdef USE_AUDIGY_DRIVE_MIDI -#define A_MUDATA A_MUDATA2 -#define A_MUCMD A_MUCMD2 -#define A_MUSTAT A_MUCMD2 -#define A_IPR_MIDITRANSBUFEMPTY A_IPR_MIDITRANSBUFEMPTY2 -#define A_IPR_MIDIRECVBUFEMPTY A_IPR_MIDIRECVBUFEMPTY2 -#define A_INTE_MIDITXENABLE A_INTE_MIDITXENABLE2 -#define A_INTE_MIDIRXENABLE A_INTE_MIDIRXENABLE2 -#else -#define A_MUDATA A_MUDATA1 -#define A_MUCMD A_MUCMD1 -#define A_MUSTAT A_MUCMD1 -#define A_IPR_MIDITRANSBUFEMPTY A_IPR_MIDITRANSBUFEMPTY1 -#define A_IPR_MIDIRECVBUFEMPTY A_IPR_MIDIRECVBUFEMPTY1 -#define A_INTE_MIDITXENABLE A_INTE_MIDITXENABLE1 -#define A_INTE_MIDIRXENABLE A_INTE_MIDIRXENABLE1 -#endif - - -#endif /* _MIDI_H */ - diff --git a/sound/oss/emu10k1/mixer.c b/sound/oss/emu10k1/mixer.c deleted file mode 100644 index bc3805fb070..00000000000 --- a/sound/oss/emu10k1/mixer.c +++ /dev/null @@ -1,690 +0,0 @@ -/* - ********************************************************************** - * mixer.c - /dev/mixer interface for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * November 2, 1999 Alan Cox cleaned up stuff - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include <linux/module.h> -#include <asm/uaccess.h> -#include <linux/fs.h> - -#include "hwaccess.h" -#include "8010.h" -#include "recmgr.h" - - -static const u32 bass_table[41][5] = { - { 0x3e4f844f, 0x84ed4cc3, 0x3cc69927, 0x7b03553a, 0xc4da8486 }, - { 0x3e69a17a, 0x84c280fb, 0x3cd77cd4, 0x7b2f2a6f, 0xc4b08d1d }, - { 0x3e82ff42, 0x849991d5, 0x3ce7466b, 0x7b5917c6, 0xc48863ee }, - { 0x3e9bab3c, 0x847267f0, 0x3cf5ffe8, 0x7b813560, 0xc461f22c }, - { 0x3eb3b275, 0x844ced29, 0x3d03b295, 0x7ba79a1c, 0xc43d223b }, - { 0x3ecb2174, 0x84290c8b, 0x3d106714, 0x7bcc5ba3, 0xc419dfa5 }, - { 0x3ee2044b, 0x8406b244, 0x3d1c2561, 0x7bef8e77, 0xc3f8170f }, - { 0x3ef86698, 0x83e5cb96, 0x3d26f4d8, 0x7c114600, 0xc3d7b625 }, - { 0x3f0e5390, 0x83c646c9, 0x3d30dc39, 0x7c319498, 0xc3b8ab97 }, - { 0x3f23d60b, 0x83a81321, 0x3d39e1af, 0x7c508b9c, 0xc39ae704 }, - { 0x3f38f884, 0x838b20d2, 0x3d420ad2, 0x7c6e3b75, 0xc37e58f1 }, - { 0x3f4dc52c, 0x836f60ef, 0x3d495cab, 0x7c8ab3a6, 0xc362f2be }, - { 0x3f6245e8, 0x8354c565, 0x3d4fdbb8, 0x7ca602d6, 0xc348a69b }, - { 0x3f76845f, 0x833b40ec, 0x3d558bf0, 0x7cc036df, 0xc32f677c }, - { 0x3f8a8a03, 0x8322c6fb, 0x3d5a70c4, 0x7cd95cd7, 0xc317290b }, - { 0x3f9e6014, 0x830b4bc3, 0x3d5e8d25, 0x7cf1811a, 0xc2ffdfa5 }, - { 0x3fb20fae, 0x82f4c420, 0x3d61e37f, 0x7d08af56, 0xc2e9804a }, - { 0x3fc5a1cc, 0x82df2592, 0x3d6475c3, 0x7d1ef294, 0xc2d40096 }, - { 0x3fd91f55, 0x82ca6632, 0x3d664564, 0x7d345541, 0xc2bf56b9 }, - { 0x3fec9120, 0x82b67cac, 0x3d675356, 0x7d48e138, 0xc2ab796e }, - { 0x40000000, 0x82a36037, 0x3d67a012, 0x7d5c9fc9, 0xc2985fee }, - { 0x401374c7, 0x8291088a, 0x3d672b93, 0x7d6f99c3, 0xc28601f2 }, - { 0x4026f857, 0x827f6dd7, 0x3d65f559, 0x7d81d77c, 0xc27457a3 }, - { 0x403a939f, 0x826e88c5, 0x3d63fc63, 0x7d9360d4, 0xc2635996 }, - { 0x404e4faf, 0x825e5266, 0x3d613f32, 0x7da43d42, 0xc25300c6 }, - { 0x406235ba, 0x824ec434, 0x3d5dbbc3, 0x7db473d7, 0xc243468e }, - { 0x40764f1f, 0x823fd80c, 0x3d596f8f, 0x7dc40b44, 0xc23424a2 }, - { 0x408aa576, 0x82318824, 0x3d545787, 0x7dd309e2, 0xc2259509 }, - { 0x409f4296, 0x8223cf0b, 0x3d4e7012, 0x7de175b5, 0xc2179218 }, - { 0x40b430a0, 0x8216a7a1, 0x3d47b505, 0x7def5475, 0xc20a1670 }, - { 0x40c97a0a, 0x820a0d12, 0x3d4021a1, 0x7dfcab8d, 0xc1fd1cf5 }, - { 0x40df29a6, 0x81fdfad6, 0x3d37b08d, 0x7e098028, 0xc1f0a0ca }, - { 0x40f54ab1, 0x81f26ca9, 0x3d2e5bd1, 0x7e15d72b, 0xc1e49d52 }, - { 0x410be8da, 0x81e75e89, 0x3d241cce, 0x7e21b544, 0xc1d90e24 }, - { 0x41231051, 0x81dcccb3, 0x3d18ec37, 0x7e2d1ee6, 0xc1cdef10 }, - { 0x413acdd0, 0x81d2b39e, 0x3d0cc20a, 0x7e38184e, 0xc1c33c13 }, - { 0x41532ea7, 0x81c90ffb, 0x3cff9585, 0x7e42a58b, 0xc1b8f15a }, - { 0x416c40cd, 0x81bfdeb2, 0x3cf15d21, 0x7e4cca7c, 0xc1af0b3f }, - { 0x418612ea, 0x81b71cdc, 0x3ce20e85, 0x7e568ad3, 0xc1a58640 }, - { 0x41a0b465, 0x81aec7c5, 0x3cd19e7c, 0x7e5fea1e, 0xc19c5f03 }, - { 0x41bc3573, 0x81a6dcea, 0x3cc000e9, 0x7e68ebc2, 0xc1939250 } -}; - -static const u32 treble_table[41][5] = { - { 0x0125cba9, 0xfed5debd, 0x00599b6c, 0x0d2506da, 0xfa85b354 }, - { 0x0142f67e, 0xfeb03163, 0x0066cd0f, 0x0d14c69d, 0xfa914473 }, - { 0x016328bd, 0xfe860158, 0x0075b7f2, 0x0d03eb27, 0xfa9d32d2 }, - { 0x0186b438, 0xfe56c982, 0x00869234, 0x0cf27048, 0xfaa97fca }, - { 0x01adf358, 0xfe21f5fe, 0x00999842, 0x0ce051c2, 0xfab62ca5 }, - { 0x01d949fa, 0xfde6e287, 0x00af0d8d, 0x0ccd8b4a, 0xfac33aa7 }, - { 0x02092669, 0xfda4d8bf, 0x00c73d4c, 0x0cba1884, 0xfad0ab07 }, - { 0x023e0268, 0xfd5b0e4a, 0x00e27b54, 0x0ca5f509, 0xfade7ef2 }, - { 0x0278645c, 0xfd08a2b0, 0x01012509, 0x0c911c63, 0xfaecb788 }, - { 0x02b8e091, 0xfcac9d1a, 0x0123a262, 0x0c7b8a14, 0xfafb55df }, - { 0x03001a9a, 0xfc45e9ce, 0x014a6709, 0x0c65398f, 0xfb0a5aff }, - { 0x034ec6d7, 0xfbd3576b, 0x0175f397, 0x0c4e2643, 0xfb19c7e4 }, - { 0x03a5ac15, 0xfb5393ee, 0x01a6d6ed, 0x0c364b94, 0xfb299d7c }, - { 0x0405a562, 0xfac52968, 0x01ddafae, 0x0c1da4e2, 0xfb39dca5 }, - { 0x046fa3fe, 0xfa267a66, 0x021b2ddd, 0x0c042d8d, 0xfb4a8631 }, - { 0x04e4b17f, 0xf975be0f, 0x0260149f, 0x0be9e0f2, 0xfb5b9ae0 }, - { 0x0565f220, 0xf8b0fbe5, 0x02ad3c29, 0x0bceba73, 0xfb6d1b60 }, - { 0x05f4a745, 0xf7d60722, 0x030393d4, 0x0bb2b578, 0xfb7f084d }, - { 0x06923236, 0xf6e279bd, 0x03642465, 0x0b95cd75, 0xfb916233 }, - { 0x07401713, 0xf5d3aef9, 0x03d01283, 0x0b77fded, 0xfba42984 }, - { 0x08000000, 0xf4a6bd88, 0x0448a161, 0x0b594278, 0xfbb75e9f }, - { 0x08d3c097, 0xf3587131, 0x04cf35a4, 0x0b3996c9, 0xfbcb01cb }, - { 0x09bd59a2, 0xf1e543f9, 0x05655880, 0x0b18f6b2, 0xfbdf1333 }, - { 0x0abefd0f, 0xf04956ca, 0x060cbb12, 0x0af75e2c, 0xfbf392e8 }, - { 0x0bdb123e, 0xee806984, 0x06c739fe, 0x0ad4c962, 0xfc0880dd }, - { 0x0d143a94, 0xec85d287, 0x0796e150, 0x0ab134b0, 0xfc1ddce5 }, - { 0x0e6d5664, 0xea547598, 0x087df0a0, 0x0a8c9cb6, 0xfc33a6ad }, - { 0x0fe98a2a, 0xe7e6ba35, 0x097edf83, 0x0a66fe5b, 0xfc49ddc2 }, - { 0x118c4421, 0xe536813a, 0x0a9c6248, 0x0a4056d7, 0xfc608185 }, - { 0x1359422e, 0xe23d19eb, 0x0bd96efb, 0x0a18a3bf, 0xfc77912c }, - { 0x1554982b, 0xdef33645, 0x0d3942bd, 0x09efe312, 0xfc8f0bc1 }, - { 0x1782b68a, 0xdb50deb1, 0x0ebf676d, 0x09c6133f, 0xfca6f019 }, - { 0x19e8715d, 0xd74d64fd, 0x106fb999, 0x099b3337, 0xfcbf3cd6 }, - { 0x1c8b07b8, 0xd2df56ab, 0x124e6ec8, 0x096f4274, 0xfcd7f060 }, - { 0x1f702b6d, 0xcdfc6e92, 0x14601c10, 0x0942410b, 0xfcf108e5 }, - { 0x229e0933, 0xc89985cd, 0x16a9bcfa, 0x09142fb5, 0xfd0a8451 }, - { 0x261b5118, 0xc2aa8409, 0x1930bab6, 0x08e50fdc, 0xfd24604d }, - { 0x29ef3f5d, 0xbc224f28, 0x1bfaf396, 0x08b4e3aa, 0xfd3e9a3b }, - { 0x2e21a59b, 0xb4f2ba46, 0x1f0ec2d6, 0x0883ae15, 0xfd592f33 }, - { 0x32baf44b, 0xad0c7429, 0x227308a3, 0x085172eb, 0xfd741bfd }, - { 0x37c4448b, 0xa45ef51d, 0x262f3267, 0x081e36dc, 0xfd8f5d14 } -}; - - -static void set_bass(struct emu10k1_card *card, int l, int r) -{ - int i; - - l = (l * 40 + 50) / 100; - r = (r * 40 + 50) / 100; - - for (i = 0; i < 5; i++) - sblive_writeptr(card, (card->is_audigy ? A_GPR_BASE : GPR_BASE) + card->mgr.ctrl_gpr[SOUND_MIXER_BASS][0] + i, 0, bass_table[l][i]); -} - -static void set_treble(struct emu10k1_card *card, int l, int r) -{ - int i; - - l = (l * 40 + 50) / 100; - r = (r * 40 + 50) / 100; - - for (i = 0; i < 5; i++) - sblive_writeptr(card, (card->is_audigy ? A_GPR_BASE : GPR_BASE) + card->mgr.ctrl_gpr[SOUND_MIXER_TREBLE][0] + i , 0, treble_table[l][i]); -} - -const char volume_params[SOUND_MIXER_NRDEVICES]= { -/* Used by the ac97 driver */ - [SOUND_MIXER_VOLUME] = VOL_6BIT, - [SOUND_MIXER_BASS] = VOL_4BIT, - [SOUND_MIXER_TREBLE] = VOL_4BIT, - [SOUND_MIXER_PCM] = VOL_5BIT, - [SOUND_MIXER_SPEAKER] = VOL_4BIT, - [SOUND_MIXER_LINE] = VOL_5BIT, - [SOUND_MIXER_MIC] = VOL_5BIT, - [SOUND_MIXER_CD] = VOL_5BIT, - [SOUND_MIXER_ALTPCM] = VOL_6BIT, - [SOUND_MIXER_IGAIN] = VOL_4BIT, - [SOUND_MIXER_LINE1] = VOL_5BIT, - [SOUND_MIXER_PHONEIN] = VOL_5BIT, - [SOUND_MIXER_PHONEOUT] = VOL_6BIT, - [SOUND_MIXER_VIDEO] = VOL_5BIT, -/* Not used by the ac97 driver */ - [SOUND_MIXER_SYNTH] = VOL_5BIT, - [SOUND_MIXER_IMIX] = VOL_5BIT, - [SOUND_MIXER_RECLEV] = VOL_5BIT, - [SOUND_MIXER_OGAIN] = VOL_5BIT, - [SOUND_MIXER_LINE2] = VOL_5BIT, - [SOUND_MIXER_LINE3] = VOL_5BIT, - [SOUND_MIXER_DIGITAL1] = VOL_5BIT, - [SOUND_MIXER_DIGITAL2] = VOL_5BIT, - [SOUND_MIXER_DIGITAL3] = VOL_5BIT, - [SOUND_MIXER_RADIO] = VOL_5BIT, - [SOUND_MIXER_MONITOR] = VOL_5BIT -}; - -/* Mixer file operations */ -static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, unsigned long arg) -{ - struct mixer_private_ioctl *ctl; - struct dsp_patch *patch; - u32 size, page; - int addr, size_reg, i, ret; - unsigned int id, ch; - void __user *argp = (void __user *)arg; - - switch (cmd) { - - case SOUND_MIXER_PRIVATE3: - - ctl = kmalloc(sizeof(struct mixer_private_ioctl), GFP_KERNEL); - if (ctl == NULL) - return -ENOMEM; - - if (copy_from_user(ctl, argp, sizeof(struct mixer_private_ioctl))) { - kfree(ctl); - return -EFAULT; - } - - ret = 0; - switch (ctl->cmd) { -#ifdef DBGEMU - case CMD_WRITEFN0: - emu10k1_writefn0_2(card, ctl->val[0], ctl->val[1], ctl->val[2]); - break; -#endif - case CMD_WRITEPTR: -#ifdef DBGEMU - if (ctl->val[1] >= 0x40 || ctl->val[0] >= 0x1000) { -#else - if (ctl->val[1] >= 0x40 || ctl->val[0] >= 0x1000 || ((ctl->val[0] < 0x100 ) && - //Any register allowed raw access goes here: - (ctl->val[0] != A_SPDIF_SAMPLERATE) && (ctl->val[0] != A_DBG) - ) - ) { -#endif - ret = -EINVAL; - break; - } - sblive_writeptr(card, ctl->val[0], ctl->val[1], ctl->val[2]); - break; - - case CMD_READFN0: - ctl->val[2] = emu10k1_readfn0(card, ctl->val[0]); - - if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl))) - ret = -EFAULT; - - break; - - case CMD_READPTR: - if (ctl->val[1] >= 0x40 || (ctl->val[0] & 0x7ff) > 0xff) { - ret = -EINVAL; - break; - } - - if ((ctl->val[0] & 0x7ff) > 0x3f) - ctl->val[1] = 0x00; - - ctl->val[2] = sblive_readptr(card, ctl->val[0], ctl->val[1]); - - if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl))) - ret = -EFAULT; - - break; - - case CMD_SETRECSRC: - switch (ctl->val[0]) { - case WAVERECORD_AC97: - if (card->is_aps) { - ret = -EINVAL; - break; - } - - card->wavein.recsrc = WAVERECORD_AC97; - break; - - case WAVERECORD_MIC: - card->wavein.recsrc = WAVERECORD_MIC; - break; - - case WAVERECORD_FX: - card->wavein.recsrc = WAVERECORD_FX; - card->wavein.fxwc = ctl->val[1] & 0xffff; - - if (!card->wavein.fxwc) - ret = -EINVAL; - - break; - - default: - ret = -EINVAL; - break; - } - break; - - case CMD_GETRECSRC: - ctl->val[0] = card->wavein.recsrc; - ctl->val[1] = card->wavein.fxwc; - if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl))) - ret = -EFAULT; - - break; - - case CMD_GETVOICEPARAM: - ctl->val[0] = card->waveout.send_routing[0]; - ctl->val[1] = card->waveout.send_dcba[0]; - - ctl->val[2] = card->waveout.send_routing[1]; - ctl->val[3] = card->waveout.send_dcba[1]; - - ctl->val[4] = card->waveout.send_routing[2]; - ctl->val[5] = card->waveout.send_dcba[2]; - - if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl))) - ret = -EFAULT; - - break; - - case CMD_SETVOICEPARAM: - card->waveout.send_routing[0] = ctl->val[0]; - card->waveout.send_dcba[0] = ctl->val[1]; - - card->waveout.send_routing[1] = ctl->val[2]; - card->waveout.send_dcba[1] = ctl->val[3]; - - card->waveout.send_routing[2] = ctl->val[4]; - card->waveout.send_dcba[2] = ctl->val[5]; - - break; - - case CMD_SETMCH_FX: - card->mchannel_fx = ctl->val[0] & 0x000f; - break; - - case CMD_GETPATCH: - if (ctl->val[0] == 0) { - if (copy_to_user(argp, &card->mgr.rpatch, sizeof(struct dsp_rpatch))) - ret = -EFAULT; - } else { - if ((ctl->val[0] - 1) / PATCHES_PER_PAGE >= card->mgr.current_pages) { - ret = -EINVAL; - break; - } - - if (copy_to_user(argp, PATCH(&card->mgr, ctl->val[0] - 1), sizeof(struct dsp_patch))) - ret = -EFAULT; - } - - break; - - case CMD_GETGPR: - id = ctl->val[0]; - - if (id > NUM_GPRS) { - ret = -EINVAL; - break; - } - - if (copy_to_user(argp, &card->mgr.gpr[id], sizeof(struct dsp_gpr))) - ret = -EFAULT; - - break; - - case CMD_GETCTLGPR: - addr = emu10k1_find_control_gpr(&card->mgr, (char *) ctl->val, &((char *) ctl->val)[PATCH_NAME_SIZE]); - ctl->val[0] = sblive_readptr(card, addr, 0); - - if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl))) - ret = -EFAULT; - - break; - - case CMD_SETPATCH: - if (ctl->val[0] == 0) - memcpy(&card->mgr.rpatch, &ctl->val[1], sizeof(struct dsp_rpatch)); - else { - page = (ctl->val[0] - 1) / PATCHES_PER_PAGE; - if (page > MAX_PATCHES_PAGES) { - ret = -EINVAL; - break; - } - - if (page >= card->mgr.current_pages) { - for (i = card->mgr.current_pages; i < page + 1; i++) { - card->mgr.patch[i] = (void *)__get_free_page(GFP_KERNEL); - if(card->mgr.patch[i] == NULL) { - card->mgr.current_pages = i; - ret = -ENOMEM; - break; - } - memset(card->mgr.patch[i], 0, PAGE_SIZE); - } - card->mgr.current_pages = page + 1; - } - - patch = PATCH(&card->mgr, ctl->val[0] - 1); - - memcpy(patch, &ctl->val[1], sizeof(struct dsp_patch)); - - if (patch->code_size == 0) { - for(i = page + 1; i < card->mgr.current_pages; i++) - free_page((unsigned long) card->mgr.patch[i]); - - card->mgr.current_pages = page + 1; - } - } - break; - - case CMD_SETGPR: - if (ctl->val[0] > NUM_GPRS) { - ret = -EINVAL; - break; - } - - memcpy(&card->mgr.gpr[ctl->val[0]], &ctl->val[1], sizeof(struct dsp_gpr)); - break; - - case CMD_SETCTLGPR: - addr = emu10k1_find_control_gpr(&card->mgr, (char *) ctl->val, (char *) ctl->val + PATCH_NAME_SIZE); - emu10k1_set_control_gpr(card, addr, *((s32 *)((char *) ctl->val + 2 * PATCH_NAME_SIZE)), 0); - break; - - case CMD_SETGPOUT: - if ( ((ctl->val[0] > 2) && (!card->is_audigy)) - || (ctl->val[0] > 15) || ctl->val[1] > 1) { - ret= -EINVAL; - break; - } - - if (card->is_audigy) - emu10k1_writefn0(card, (1 << 24) | ((ctl->val[0]) << 16) | A_IOCFG, ctl->val[1]); - else - emu10k1_writefn0(card, (1 << 24) | (((ctl->val[0]) + 10) << 16) | HCFG, ctl->val[1]); - break; - - case CMD_GETGPR2OSS: - id = ctl->val[0]; - ch = ctl->val[1]; - - if (id >= SOUND_MIXER_NRDEVICES || ch >= 2) { - ret = -EINVAL; - break; - } - - ctl->val[2] = card->mgr.ctrl_gpr[id][ch]; - - if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl))) - ret = -EFAULT; - - break; - - case CMD_SETGPR2OSS: - id = ctl->val[0]; - /* 0 == left, 1 == right */ - ch = ctl->val[1]; - addr = ctl->val[2]; - - if (id >= SOUND_MIXER_NRDEVICES || ch >= 2) { - ret = -EINVAL; - break; - } - - card->mgr.ctrl_gpr[id][ch] = addr; - - if (card->is_aps) - break; - - if (addr >= 0) { - unsigned int state = card->ac97->mixer_state[id]; - - if (ch == 1) { - state >>= 8; - card->ac97->stereo_mixers |= (1 << id); - } - - card->ac97->supported_mixers |= (1 << id); - - if (id == SOUND_MIXER_TREBLE) { - set_treble(card, card->ac97->mixer_state[id] & 0xff, (card->ac97->mixer_state[id] >> 8) & 0xff); - } else if (id == SOUND_MIXER_BASS) { - set_bass(card, card->ac97->mixer_state[id] & 0xff, (card->ac97->mixer_state[id] >> 8) & 0xff); - } else - emu10k1_set_volume_gpr(card, addr, state & 0xff, - volume_params[id]); - } else { - card->ac97->stereo_mixers &= ~(1 << id); - card->ac97->stereo_mixers |= card->ac97_stereo_mixers; - - if (ch == 0) { - card->ac97->supported_mixers &= ~(1 << id); - card->ac97->supported_mixers |= card->ac97_supported_mixers; - } - } - break; - - case CMD_SETPASSTHROUGH: - card->pt.selected = ctl->val[0] ? 1 : 0; - if (card->pt.state != PT_STATE_INACTIVE) - break; - - card->pt.spcs_to_use = ctl->val[0] & 0x07; - break; - - case CMD_PRIVATE3_VERSION: - ctl->val[0] = PRIVATE3_VERSION; //private3 version - ctl->val[1] = MAJOR_VER; //major driver version - ctl->val[2] = MINOR_VER; //minor driver version - ctl->val[3] = card->is_audigy; //1=card is audigy - - if (card->is_audigy) - ctl->val[4]=emu10k1_readfn0(card, 0x18); - - if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl))) - ret = -EFAULT; - break; - - case CMD_AC97_BOOST: - if (ctl->val[0]) - emu10k1_ac97_write(card->ac97, 0x18, 0x0); - else - emu10k1_ac97_write(card->ac97, 0x18, 0x0808); - break; - default: - ret = -EINVAL; - break; - } - - kfree(ctl); - return ret; - break; - - case SOUND_MIXER_PRIVATE4: - - if (copy_from_user(&size, argp, sizeof(size))) - return -EFAULT; - - DPD(2, "External tram size %#x\n", size); - - if (size > 0x1fffff) - return -EINVAL; - - size_reg = 0; - - if (size != 0) { - size = (size - 1) >> 14; - - while (size) { - size >>= 1; - size_reg++; - } - - size = 0x4000 << size_reg; - } - - DPD(2, "External tram size %#x %#x\n", size, size_reg); - - if (size != card->tankmem.size) { - if (card->tankmem.size > 0) { - emu10k1_writefn0(card, HCFG_LOCKTANKCACHE, 1); - - sblive_writeptr_tag(card, 0, TCB, 0, TCBS, 0, TAGLIST_END); - - pci_free_consistent(card->pci_dev, card->tankmem.size, card->tankmem.addr, card->tankmem.dma_handle); - - card->tankmem.size = 0; - } - - if (size != 0) { - card->tankmem.addr = pci_alloc_consistent(card->pci_dev, size, &card->tankmem.dma_handle); - if (card->tankmem.addr == NULL) - return -ENOMEM; - - card->tankmem.size = size; - - sblive_writeptr_tag(card, 0, TCB, (u32) card->tankmem.dma_handle, TCBS,(u32) size_reg, TAGLIST_END); - - emu10k1_writefn0(card, HCFG_LOCKTANKCACHE, 0); - } - } - return 0; - break; - - default: - break; - } - - return -EINVAL; -} - -static int emu10k1_dsp_mixer(struct emu10k1_card *card, unsigned int oss_mixer, unsigned long arg) -{ - unsigned int left, right; - int val; - int scale; - - card->ac97->modcnt++; - - if (get_user(val, (int __user *)arg)) - return -EFAULT; - - /* cleanse input a little */ - right = ((val >> 8) & 0xff); - left = (val & 0xff); - - if (right > 100) right = 100; - if (left > 100) left = 100; - - card->ac97->mixer_state[oss_mixer] = (right << 8) | left; - if (oss_mixer == SOUND_MIXER_TREBLE) { - set_treble(card, left, right); - return 0; - } if (oss_mixer == SOUND_MIXER_BASS) { - set_bass(card, left, right); - return 0; - } - - if (oss_mixer == SOUND_MIXER_VOLUME) - scale = 1 << card->ac97->bit_resolution; - else - scale = volume_params[oss_mixer]; - - emu10k1_set_volume_gpr(card, card->mgr.ctrl_gpr[oss_mixer][0], left, scale); - emu10k1_set_volume_gpr(card, card->mgr.ctrl_gpr[oss_mixer][1], right, scale); - - if (card->ac97_supported_mixers & (1 << oss_mixer)) - card->ac97->write_mixer(card->ac97, oss_mixer, left, right); - - return 0; -} - -static int emu10k1_mixer_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) -{ - int ret; - struct emu10k1_card *card = file->private_data; - unsigned int oss_mixer = _IOC_NR(cmd); - - ret = -EINVAL; - if (!card->is_aps) { - if (cmd == SOUND_MIXER_INFO) { - mixer_info info; - - strlcpy(info.id, card->ac97->name, sizeof(info.id)); - - if (card->is_audigy) - strlcpy(info.name, "Audigy - Emu10k1", sizeof(info.name)); - else - strlcpy(info.name, "Creative SBLive - Emu10k1", sizeof(info.name)); - - info.modify_counter = card->ac97->modcnt; - - if (copy_to_user((void __user *)arg, &info, sizeof(info))) - return -EFAULT; - - return 0; - } - - if ((_SIOC_DIR(cmd) == (_SIOC_WRITE|_SIOC_READ)) && oss_mixer <= SOUND_MIXER_NRDEVICES) - ret = emu10k1_dsp_mixer(card, oss_mixer, arg); - else - ret = card->ac97->mixer_ioctl(card->ac97, cmd, arg); - } - - if (ret < 0) - ret = emu10k1_private_mixer(card, cmd, arg); - - return ret; -} - -static int emu10k1_mixer_open(struct inode *inode, struct file *file) -{ - int minor = iminor(inode); - struct emu10k1_card *card = NULL; - struct list_head *entry; - - DPF(4, "emu10k1_mixer_open()\n"); - - list_for_each(entry, &emu10k1_devs) { - card = list_entry(entry, struct emu10k1_card, list); - - if (card->ac97->dev_mixer == minor) - goto match; - } - - return -ENODEV; - - match: - file->private_data = card; - return 0; -} - -static int emu10k1_mixer_release(struct inode *inode, struct file *file) -{ - DPF(4, "emu10k1_mixer_release()\n"); - return 0; -} - -const struct file_operations emu10k1_mixer_fops = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .ioctl = emu10k1_mixer_ioctl, - .open = emu10k1_mixer_open, - .release = emu10k1_mixer_release, -}; diff --git a/sound/oss/emu10k1/passthrough.c b/sound/oss/emu10k1/passthrough.c deleted file mode 100644 index 6d21d4368de..00000000000 --- a/sound/oss/emu10k1/passthrough.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - ********************************************************************** - * passthrough.c -- Emu10k1 digital passthrough - * Copyright (C) 2001 Juha Yrjölä <jyrjola@cc.hut.fi> - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * May 15, 2001 Juha Yrjölä base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include <linux/module.h> -#include <linux/poll.h> -#include <linux/slab.h> -#include <linux/bitops.h> -#include <asm/io.h> -#include <linux/sched.h> -#include <linux/smp_lock.h> - -#include "hwaccess.h" -#include "cardwo.h" -#include "cardwi.h" -#include "recmgr.h" -#include "irqmgr.h" -#include "audio.h" -#include "8010.h" - -static void pt_putsamples(struct pt_data *pt, u16 *ptr, u16 left, u16 right) -{ - unsigned int idx; - - ptr[pt->copyptr] = left; - idx = pt->copyptr + PT_SAMPLES/2; - idx %= PT_SAMPLES; - ptr[idx] = right; -} - -static inline int pt_can_write(struct pt_data *pt) -{ - return pt->blocks_copied < pt->blocks_played + 8; -} - -static int pt_wait_for_write(struct emu10k1_wavedevice *wavedev, int nonblock) -{ - struct emu10k1_card *card = wavedev->card; - struct pt_data *pt = &card->pt; - - if (nonblock && !pt_can_write(pt)) - return -EAGAIN; - while (!pt_can_write(pt) && pt->state != PT_STATE_INACTIVE) { - interruptible_sleep_on(&pt->wait); - if (signal_pending(current)) - return -ERESTARTSYS; - } - if (pt->state == PT_STATE_INACTIVE) - return -EAGAIN; - - return 0; -} - -static int pt_putblock(struct emu10k1_wavedevice *wave_dev, u16 *block, int nonblock) -{ - struct woinst *woinst = wave_dev->woinst; - struct emu10k1_card *card = wave_dev->card; - struct pt_data *pt = &card->pt; - u16 *ptr = (u16 *) card->tankmem.addr; - int i = 0, r; - unsigned long flags; - - r = pt_wait_for_write(wave_dev, nonblock); - if (r < 0) - return r; - spin_lock_irqsave(&card->pt.lock, flags); - while (i < PT_BLOCKSAMPLES) { - pt_putsamples(pt, ptr, block[2*i], block[2*i+1]); - if (pt->copyptr == 0) - pt->copyptr = PT_SAMPLES; - pt->copyptr--; - i++; - } - woinst->total_copied += PT_BLOCKSIZE; - pt->blocks_copied++; - if (pt->blocks_copied >= 4 && pt->state != PT_STATE_PLAYING) { - DPF(2, "activating digital pass-through playback\n"); - sblive_writeptr(card, GPR_BASE + pt->enable_gpr, 0, 1); - pt->state = PT_STATE_PLAYING; - } - spin_unlock_irqrestore(&card->pt.lock, flags); - return 0; -} - -int emu10k1_pt_setup(struct emu10k1_wavedevice *wave_dev) -{ - u32 bits; - struct emu10k1_card *card = wave_dev->card; - struct pt_data *pt = &card->pt; - int i; - - for (i = 0; i < 3; i++) { - pt->old_spcs[i] = sblive_readptr(card, SPCS0 + i, 0); - if (pt->spcs_to_use & (1 << i)) { - DPD(2, "using S/PDIF port %d\n", i); - bits = SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 | - SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | SPCS_GENERATIONSTATUS | - 0x00001200 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT; - if (pt->ac3data) - bits |= SPCS_NOTAUDIODATA; - sblive_writeptr(card, SPCS0 + i, 0, bits); - } - } - return 0; -} - -ssize_t emu10k1_pt_write(struct file *file, const char __user *buffer, size_t count) -{ - struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data; - struct emu10k1_card *card = wave_dev->card; - struct pt_data *pt = &card->pt; - int nonblock, i, r, blocks, blocks_copied, bytes_copied = 0; - - DPD(3, "emu10k1_pt_write(): %d bytes\n", count); - - nonblock = file->f_flags & O_NONBLOCK; - - if (card->tankmem.size < PT_SAMPLES*2) - return -EFAULT; - if (pt->state == PT_STATE_INACTIVE) { - DPF(2, "bufptr init\n"); - pt->playptr = PT_SAMPLES-1; - pt->copyptr = PT_INITPTR; - pt->blocks_played = pt->blocks_copied = 0; - memset(card->tankmem.addr, 0, card->tankmem.size); - pt->state = PT_STATE_ACTIVATED; - pt->buf = kmalloc(PT_BLOCKSIZE, GFP_KERNEL); - pt->prepend_size = 0; - if (pt->buf == NULL) - return -ENOMEM; - emu10k1_pt_setup(wave_dev); - } - if (pt->prepend_size) { - int needed = PT_BLOCKSIZE - pt->prepend_size; - - DPD(3, "prepend size %d, prepending %d bytes\n", pt->prepend_size, needed); - if (count < needed) { - if (copy_from_user(pt->buf + pt->prepend_size, - buffer, count)) - return -EFAULT; - pt->prepend_size += count; - DPD(3, "prepend size now %d\n", pt->prepend_size); - return count; - } - if (copy_from_user(pt->buf + pt->prepend_size, buffer, needed)) - return -EFAULT; - r = pt_putblock(wave_dev, (u16 *) pt->buf, nonblock); - if (r) - return r; - bytes_copied += needed; - pt->prepend_size = 0; - } - blocks = (count-bytes_copied)/PT_BLOCKSIZE; - blocks_copied = 0; - while (blocks > 0) { - u16 __user *bufptr = (u16 __user *) buffer + (bytes_copied/2); - if (copy_from_user(pt->buf, bufptr, PT_BLOCKSIZE)) - return -EFAULT; - r = pt_putblock(wave_dev, (u16 *)pt->buf, nonblock); - if (r) { - if (bytes_copied) - return bytes_copied; - else - return r; - } - bytes_copied += PT_BLOCKSIZE; - blocks--; - blocks_copied++; - } - i = count - bytes_copied; - if (i) { - pt->prepend_size = i; - if (copy_from_user(pt->buf, buffer + bytes_copied, i)) - return -EFAULT; - bytes_copied += i; - DPD(3, "filling prepend buffer with %d bytes", i); - } - return bytes_copied; -} - -void emu10k1_pt_stop(struct emu10k1_card *card) -{ - struct pt_data *pt = &card->pt; - int i; - - if (pt->state != PT_STATE_INACTIVE) { - DPF(2, "digital pass-through stopped\n"); - sblive_writeptr(card, (card->is_audigy ? A_GPR_BASE : GPR_BASE) + pt->enable_gpr, 0, 0); - for (i = 0; i < 3; i++) { - if (pt->spcs_to_use & (1 << i)) - sblive_writeptr(card, SPCS0 + i, 0, pt->old_spcs[i]); - } - pt->state = PT_STATE_INACTIVE; - kfree(pt->buf); - } -} - -void emu10k1_pt_waveout_update(struct emu10k1_wavedevice *wave_dev) -{ - struct woinst *woinst = wave_dev->woinst; - struct pt_data *pt = &wave_dev->card->pt; - u32 pos; - - if (pt->state == PT_STATE_PLAYING && pt->pos_gpr >= 0) { - pos = sblive_readptr(wave_dev->card, GPR_BASE + pt->pos_gpr, 0); - if (pos > PT_BLOCKSAMPLES) - pos = PT_BLOCKSAMPLES; - pos = 4 * (PT_BLOCKSAMPLES - pos); - } else - pos = 0; - woinst->total_played = pt->blocks_played * woinst->buffer.fragment_size + pos; - woinst->buffer.hw_pos = pos; -} diff --git a/sound/oss/emu10k1/passthrough.h b/sound/oss/emu10k1/passthrough.h deleted file mode 100644 index 420cc978425..00000000000 --- a/sound/oss/emu10k1/passthrough.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - ********************************************************************** - * passthrough.h -- Emu10k1 digital passthrough header file - * Copyright (C) 2001 Juha Yrjölä <jyrjola@cc.hut.fi> - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * May 15, 2001 Juha Yrjölä base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _PASSTHROUGH_H -#define _PASSTHROUGH_H - -#include "audio.h" - -/* number of 16-bit stereo samples in XTRAM buffer */ -#define PT_SAMPLES 0x8000 -#define PT_BLOCKSAMPLES 0x400 -#define PT_BLOCKSIZE (PT_BLOCKSAMPLES*4) -#define PT_BLOCKSIZE_LOG2 12 -#define PT_BLOCKCOUNT (PT_SAMPLES/PT_BLOCKSAMPLES) -#define PT_INITPTR (PT_SAMPLES/2-1) - -#define PT_STATE_INACTIVE 0 -#define PT_STATE_ACTIVATED 1 -#define PT_STATE_PLAYING 2 - -/* passthrough struct */ -struct pt_data -{ - u8 selected, state, spcs_to_use; - int intr_gpr, enable_gpr, pos_gpr; - u32 blocks_played, blocks_copied, old_spcs[3]; - u32 playptr, copyptr; - u32 prepend_size; - u8 *buf; - u8 ac3data; - - char *patch_name, *intr_gpr_name, *enable_gpr_name, *pos_gpr_name; - - wait_queue_head_t wait; - spinlock_t lock; -}; - -/* - Passthrough can be done in two methods: - - Method 1 : tram - In original emu10k1, we couldn't bypass the sample rate converters. Even at 48kHz - (the internal sample rate of the emu10k1) the samples would get messed up. - To over come this, samples are copied into the tram and a special dsp patch copies - the samples out and generates interrupts when a block has finnished playing. - - Method 2 : Interpolator bypass - - Creative fixed the sample rate convert problem in emu10k1 rev 7 and higher - (including the emu10k2 (audigy)). This allows us to use the regular, and much simpler - playback method. - - - In both methods, dsp code is used to mux audio and passthrough. This ensures that the spdif - doesn't receive audio and pasthrough data at the same time. The spdif flag SPCS_NOTAUDIODATA - is set to tell - - */ - -// emu10k1 revs greater than or equal to 7 can use method2 - -#define USE_PT_METHOD2 (card->is_audigy) -#define USE_PT_METHOD1 !USE_PT_METHOD2 - -ssize_t emu10k1_pt_write(struct file *file, const char __user *buf, size_t count); - -int emu10k1_pt_setup(struct emu10k1_wavedevice *wave_dev); -void emu10k1_pt_stop(struct emu10k1_card *card); -void emu10k1_pt_waveout_update(struct emu10k1_wavedevice *wave_dev); - -#endif /* _PASSTHROUGH_H */ diff --git a/sound/oss/emu10k1/recmgr.c b/sound/oss/emu10k1/recmgr.c deleted file mode 100644 index 2ce56180e7d..00000000000 --- a/sound/oss/emu10k1/recmgr.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - ********************************************************************** - * recmgr.c -- Recording manager for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include <linux/delay.h> -#include "8010.h" -#include "recmgr.h" - -void emu10k1_reset_record(struct emu10k1_card *card, struct wavein_buffer *buffer) -{ - DPF(2, "emu10k1_reset_record()\n"); - - sblive_writeptr(card, buffer->sizereg, 0, ADCBS_BUFSIZE_NONE); - - sblive_writeptr(card, buffer->sizereg, 0, buffer->sizeregval); - - while (sblive_readptr(card, buffer->idxreg, 0)) - udelay(5); -} - -void emu10k1_start_record(struct emu10k1_card *card, struct wavein_buffer *buffer) -{ - DPF(2, "emu10k1_start_record()\n"); - - if (buffer->adcctl) - sblive_writeptr(card, ADCCR, 0, buffer->adcctl); -} - -void emu10k1_stop_record(struct emu10k1_card *card, struct wavein_buffer *buffer) -{ - DPF(2, "emu10k1_stop_record()\n"); - - /* Disable record transfer */ - if (buffer->adcctl) - sblive_writeptr(card, ADCCR, 0, 0); -} - -void emu10k1_set_record_src(struct emu10k1_card *card, struct wiinst *wiinst) -{ - struct wavein_buffer *buffer = &wiinst->buffer; - - DPF(2, "emu10k1_set_record_src()\n"); - - switch (wiinst->recsrc) { - - case WAVERECORD_AC97: - DPF(2, "recording source: AC97\n"); - buffer->sizereg = ADCBS; - buffer->addrreg = ADCBA; - buffer->idxreg = card->is_audigy ? A_ADCIDX_IDX : ADCIDX_IDX; - - switch (wiinst->format.samplingrate) { - case 0xBB80: - buffer->adcctl = ADCCR_SAMPLERATE_48; - break; - case 0xAC44: - buffer->adcctl = ADCCR_SAMPLERATE_44; - break; - case 0x7D00: - buffer->adcctl = ADCCR_SAMPLERATE_32; - break; - case 0x5DC0: - buffer->adcctl = ADCCR_SAMPLERATE_24; - break; - case 0x5622: - buffer->adcctl = ADCCR_SAMPLERATE_22; - break; - case 0x3E80: - buffer->adcctl = ADCCR_SAMPLERATE_16; - break; - // FIXME: audigy supports 12kHz recording - /* - case ????: - buffer->adcctl = A_ADCCR_SAMPLERATE_12; - break; - */ - case 0x2B11: - buffer->adcctl = card->is_audigy ? A_ADCCR_SAMPLERATE_11 : ADCCR_SAMPLERATE_11; - break; - case 0x1F40: - buffer->adcctl = card->is_audigy ? A_ADCCR_SAMPLERATE_8 : ADCCR_SAMPLERATE_8; - break; - default: - BUG(); - break; - } - - buffer->adcctl |= card->is_audigy ? A_ADCCR_LCHANENABLE : ADCCR_LCHANENABLE; - - if (wiinst->format.channels == 2) - buffer->adcctl |= card->is_audigy ? A_ADCCR_RCHANENABLE : ADCCR_RCHANENABLE; - - break; - - case WAVERECORD_MIC: - DPF(2, "recording source: MIC\n"); - buffer->sizereg = MICBS; - buffer->addrreg = MICBA; - buffer->idxreg = MICIDX_IDX; - buffer->adcctl = 0; - break; - - case WAVERECORD_FX: - DPF(2, "recording source: FX\n"); - buffer->sizereg = FXBS; - buffer->addrreg = FXBA; - buffer->idxreg = FXIDX_IDX; - buffer->adcctl = 0; - - sblive_writeptr(card, FXWC, 0, wiinst->fxwc); - break; - default: - BUG(); - break; - } - - DPD(2, "bus addx: %#lx\n", (unsigned long) buffer->dma_handle); - - sblive_writeptr(card, buffer->addrreg, 0, (u32)buffer->dma_handle); -} diff --git a/sound/oss/emu10k1/recmgr.h b/sound/oss/emu10k1/recmgr.h deleted file mode 100644 index a68766ac4fd..00000000000 --- a/sound/oss/emu10k1/recmgr.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - ********************************************************************** - * recmgr.h - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _RECORDMGR_H -#define _RECORDMGR_H - -#include "hwaccess.h" -#include "cardwi.h" - -/* Recording resources */ -#define WAVERECORD_AC97 0x01 -#define WAVERECORD_MIC 0x02 -#define WAVERECORD_FX 0x03 - -void emu10k1_reset_record(struct emu10k1_card *card, struct wavein_buffer *buffer); -void emu10k1_start_record(struct emu10k1_card *, struct wavein_buffer *); -void emu10k1_stop_record(struct emu10k1_card *, struct wavein_buffer *); -void emu10k1_set_record_src(struct emu10k1_card *, struct wiinst *wiinst); - -#endif /* _RECORDMGR_H */ diff --git a/sound/oss/emu10k1/timer.c b/sound/oss/emu10k1/timer.c deleted file mode 100644 index d10d30739f4..00000000000 --- a/sound/oss/emu10k1/timer.c +++ /dev/null @@ -1,176 +0,0 @@ - -/* - ********************************************************************** - * timer.c - * Copyright (C) 1999, 2000 Creative Labs, inc. - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -/* 3/6/2000 Improved support for different timer delays Rui Sousa */ - -/* 4/3/2000 Implemented timer list using list.h Rui Sousa */ - -#include "hwaccess.h" -#include "8010.h" -#include "irqmgr.h" -#include "timer.h" - -/* Try to schedule only once per fragment */ - -void emu10k1_timer_irqhandler(struct emu10k1_card *card) -{ - struct emu_timer *t; - struct list_head *entry; - - spin_lock(&card->timer_lock); - - list_for_each(entry, &card->timers) { - t = list_entry(entry, struct emu_timer, list); - - if (t->state & TIMER_STATE_ACTIVE) { - t->count++; - if (t->count == t->count_max) { - t->count = 0; - tasklet_hi_schedule(&t->tasklet); - } - } - } - - spin_unlock(&card->timer_lock); - - return; -} - -void emu10k1_timer_install(struct emu10k1_card *card, struct emu_timer *timer, u16 delay) -{ - struct emu_timer *t; - struct list_head *entry; - unsigned long flags; - - if (delay < 5) - delay = 5; - - timer->delay = delay; - timer->state = TIMER_STATE_INSTALLED; - - spin_lock_irqsave(&card->timer_lock, flags); - - timer->count_max = timer->delay / (card->timer_delay < 1024 ? card->timer_delay : 1024); - timer->count = timer->count_max - 1; - - list_add(&timer->list, &card->timers); - - if (card->timer_delay > delay) { - if (card->timer_delay == TIMER_STOPPED) - emu10k1_irq_enable(card, INTE_INTERVALTIMERENB); - - card->timer_delay = delay; - delay = (delay < 1024 ? delay : 1024); - - emu10k1_timer_set(card, delay); - - list_for_each(entry, &card->timers) { - t = list_entry(entry, struct emu_timer, list); - - t->count_max = t->delay / delay; - /* don't want to think much, just force scheduling - on the next interrupt */ - t->count = t->count_max - 1; - } - - DPD(2, "timer rate --> %u\n", delay); - } - - spin_unlock_irqrestore(&card->timer_lock, flags); - - return; -} - -void emu10k1_timer_uninstall(struct emu10k1_card *card, struct emu_timer *timer) -{ - struct emu_timer *t; - struct list_head *entry; - u16 delay = TIMER_STOPPED; - unsigned long flags; - - if (timer->state == TIMER_STATE_UNINSTALLED) - return; - - spin_lock_irqsave(&card->timer_lock, flags); - - list_del(&timer->list); - - list_for_each(entry, &card->timers) { - t = list_entry(entry, struct emu_timer, list); - - if (t->delay < delay) - delay = t->delay; - } - - if (card->timer_delay != delay) { - card->timer_delay = delay; - - if (delay == TIMER_STOPPED) - emu10k1_irq_disable(card, INTE_INTERVALTIMERENB); - else { - delay = (delay < 1024 ? delay : 1024); - - emu10k1_timer_set(card, delay); - - list_for_each(entry, &card->timers) { - t = list_entry(entry, struct emu_timer, list); - - t->count_max = t->delay / delay; - t->count = t->count_max - 1; - } - } - - DPD(2, "timer rate --> %u\n", delay); - } - - spin_unlock_irqrestore(&card->timer_lock, flags); - - timer->state = TIMER_STATE_UNINSTALLED; - - return; -} - -void emu10k1_timer_enable(struct emu10k1_card *card, struct emu_timer *timer) -{ - unsigned long flags; - - spin_lock_irqsave(&card->timer_lock, flags); - timer->state |= TIMER_STATE_ACTIVE; - spin_unlock_irqrestore(&card->timer_lock, flags); - - return; -} - -void emu10k1_timer_disable(struct emu10k1_card *card, struct emu_timer *timer) -{ - unsigned long flags; - - spin_lock_irqsave(&card->timer_lock, flags); - timer->state &= ~TIMER_STATE_ACTIVE; - spin_unlock_irqrestore(&card->timer_lock, flags); - - return; -} diff --git a/sound/oss/emu10k1/timer.h b/sound/oss/emu10k1/timer.h deleted file mode 100644 index b2543b4d53a..00000000000 --- a/sound/oss/emu10k1/timer.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - ********************************************************************** - * timer.h - * Copyright (C) 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - - -#ifndef _TIMER_H -#define _TIMER_H - -#include <linux/sched.h> -#include <linux/interrupt.h> -#include "hwaccess.h" - -struct emu_timer -{ - struct list_head list; - struct tasklet_struct tasklet; - u8 state; - u16 count; /* current number of interrupts */ - u16 count_max; /* number of interrupts needed to schedule the bh */ - u16 delay; /* timer delay */ -}; - -void emu10k1_timer_install(struct emu10k1_card *, struct emu_timer *, u16); -void emu10k1_timer_uninstall(struct emu10k1_card *, struct emu_timer *); -void emu10k1_timer_enable(struct emu10k1_card *, struct emu_timer *); -void emu10k1_timer_disable(struct emu10k1_card *, struct emu_timer *); - -#define TIMER_STOPPED 0xffff -#define TIMER_STATE_INSTALLED 0x01 -#define TIMER_STATE_ACTIVE 0x02 -#define TIMER_STATE_UNINSTALLED 0x04 - -#endif /* _TIMER_H */ diff --git a/sound/oss/emu10k1/voicemgr.c b/sound/oss/emu10k1/voicemgr.c deleted file mode 100644 index d88b602c07c..00000000000 --- a/sound/oss/emu10k1/voicemgr.c +++ /dev/null @@ -1,398 +0,0 @@ -/* - ********************************************************************** - * voicemgr.c - Voice manager for emu10k1 driver - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#include "voicemgr.h" -#include "8010.h" - -#define PITCH_48000 0x00004000 -#define PITCH_96000 0x00008000 -#define PITCH_85000 0x00007155 -#define PITCH_80726 0x00006ba2 -#define PITCH_67882 0x00005a82 -#define PITCH_57081 0x00004c1c - -static u32 emu10k1_select_interprom(struct emu10k1_card *card, - struct emu_voice *voice) -{ - if(voice->pitch_target==PITCH_48000) - return CCCA_INTERPROM_0; - else if(voice->pitch_target<PITCH_48000) - return CCCA_INTERPROM_1; - else if(voice->pitch_target>=PITCH_96000) - return CCCA_INTERPROM_0; - else if(voice->pitch_target>=PITCH_85000) - return CCCA_INTERPROM_6; - else if(voice->pitch_target>=PITCH_80726) - return CCCA_INTERPROM_5; - else if(voice->pitch_target>=PITCH_67882) - return CCCA_INTERPROM_4; - else if(voice->pitch_target>=PITCH_57081) - return CCCA_INTERPROM_3; - else - return CCCA_INTERPROM_2; -} - - -/** - * emu10k1_voice_alloc_buffer - - * - * allocates the memory buffer for a voice. Two page tables are kept for each buffer. - * One (dma_handle) keeps track of the host memory pages used and the other (virtualpagetable) - * is passed to the device so that it can do DMA to host memory. - * - */ -int emu10k1_voice_alloc_buffer(struct emu10k1_card *card, struct voice_mem *mem, u32 pages) -{ - u32 pageindex, pagecount; - u32 busaddx; - int i; - - DPD(2, "requested pages is: %d\n", pages); - - if ((mem->emupageindex = emu10k1_addxmgr_alloc(pages * PAGE_SIZE, card)) < 0) - { - DPF(1, "couldn't allocate emu10k1 address space\n"); - return -1; - } - - /* Fill in virtual memory table */ - for (pagecount = 0; pagecount < pages; pagecount++) { - if ((mem->addr[pagecount] = pci_alloc_consistent(card->pci_dev, PAGE_SIZE, &mem->dma_handle[pagecount])) - == NULL) { - mem->pages = pagecount; - DPF(1, "couldn't allocate dma memory\n"); - return -1; - } - - DPD(2, "Virtual Addx: %p\n", mem->addr[pagecount]); - - for (i = 0; i < PAGE_SIZE / EMUPAGESIZE; i++) { - busaddx = (u32) mem->dma_handle[pagecount] + i * EMUPAGESIZE; - - DPD(3, "Bus Addx: %#x\n", busaddx); - - pageindex = mem->emupageindex + pagecount * PAGE_SIZE / EMUPAGESIZE + i; - - ((u32 *) card->virtualpagetable.addr)[pageindex] = cpu_to_le32((busaddx * 2) | pageindex); - } - } - - mem->pages = pagecount; - - return 0; -} - -/** - * emu10k1_voice_free_buffer - - * - * frees the memory buffer for a voice. - */ -void emu10k1_voice_free_buffer(struct emu10k1_card *card, struct voice_mem *mem) -{ - u32 pagecount, pageindex; - int i; - - if (mem->emupageindex < 0) - return; - - for (pagecount = 0; pagecount < mem->pages; pagecount++) { - pci_free_consistent(card->pci_dev, PAGE_SIZE, - mem->addr[pagecount], - mem->dma_handle[pagecount]); - - for (i = 0; i < PAGE_SIZE / EMUPAGESIZE; i++) { - pageindex = mem->emupageindex + pagecount * PAGE_SIZE / EMUPAGESIZE + i; - ((u32 *) card->virtualpagetable.addr)[pageindex] = - cpu_to_le32(((u32) card->silentpage.dma_handle * 2) | pageindex); - } - } - - emu10k1_addxmgr_free(card, mem->emupageindex); - mem->emupageindex = -1; -} - -int emu10k1_voice_alloc(struct emu10k1_card *card, struct emu_voice *voice) -{ - u8 *voicetable = card->voicetable; - int i; - unsigned long flags; - - DPF(2, "emu10k1_voice_alloc()\n"); - - spin_lock_irqsave(&card->lock, flags); - - if (voice->flags & VOICE_FLAGS_STEREO) { - for (i = 0; i < NUM_G; i += 2) - if ((voicetable[i] == VOICE_USAGE_FREE) && (voicetable[i + 1] == VOICE_USAGE_FREE)) { - voicetable[i] = voice->usage; - voicetable[i + 1] = voice->usage; - break; - } - } else { - for (i = 0; i < NUM_G; i++) - if (voicetable[i] == VOICE_USAGE_FREE) { - voicetable[i] = voice->usage; - break; - } - } - - spin_unlock_irqrestore(&card->lock, flags); - - if (i >= NUM_G) - return -1; - - voice->card = card; - voice->num = i; - - for (i = 0; i < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); i++) { - DPD(2, " voice allocated -> %d\n", voice->num + i); - - sblive_writeptr_tag(card, voice->num + i, IFATN, 0xffff, - DCYSUSV, 0, - VTFT, 0x0000ffff, - PTRX, 0, - TAGLIST_END); - } - - return 0; -} - -void emu10k1_voice_free(struct emu_voice *voice) -{ - struct emu10k1_card *card = voice->card; - int i; - unsigned long flags; - - DPF(2, "emu10k1_voice_free()\n"); - - if (voice->usage == VOICE_USAGE_FREE) - return; - - for (i = 0; i < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); i++) { - DPD(2, " voice released -> %d\n", voice->num + i); - - sblive_writeptr_tag(card, voice->num + i, DCYSUSV, 0, - VTFT, 0x0000ffff, - PTRX_PITCHTARGET, 0, - CVCF, 0x0000ffff, - //CPF, 0, - TAGLIST_END); - - sblive_writeptr(card, CPF, voice->num + i, 0); - } - - voice->usage = VOICE_USAGE_FREE; - - spin_lock_irqsave(&card->lock, flags); - - card->voicetable[voice->num] = VOICE_USAGE_FREE; - - if (voice->flags & VOICE_FLAGS_STEREO) - card->voicetable[voice->num + 1] = VOICE_USAGE_FREE; - - spin_unlock_irqrestore(&card->lock, flags); -} - -void emu10k1_voice_playback_setup(struct emu_voice *voice) -{ - struct emu10k1_card *card = voice->card; - u32 start; - int i; - - DPF(2, "emu10k1_voice_playback_setup()\n"); - - if (voice->flags & VOICE_FLAGS_STEREO) { - /* Set stereo bit */ - start = 28; - sblive_writeptr(card, CPF, voice->num, CPF_STEREO_MASK); - sblive_writeptr(card, CPF, voice->num + 1, CPF_STEREO_MASK); - } else { - start = 30; - sblive_writeptr(card, CPF, voice->num, 0); - } - - if(!(voice->flags & VOICE_FLAGS_16BIT)) - start *= 2; - - voice->start += start; - - for (i = 0; i < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); i++) { - if (card->is_audigy) { - sblive_writeptr(card, A_FXRT1, voice->num + i, voice->params[i].send_routing); - sblive_writeptr(card, A_FXRT2, voice->num + i, voice->params[i].send_routing2); - sblive_writeptr(card, A_SENDAMOUNTS, voice->num + i, voice->params[i].send_hgfe); - } else { - sblive_writeptr(card, FXRT, voice->num + i, voice->params[i].send_routing << 16); - } - - /* Stop CA */ - /* Assumption that PT is already 0 so no harm overwriting */ - sblive_writeptr(card, PTRX, voice->num + i, ((voice->params[i].send_dcba & 0xff) << 8) - | ((voice->params[i].send_dcba & 0xff00) >> 8)); - - sblive_writeptr_tag(card, voice->num + i, - /* CSL, ST, CA */ - DSL, voice->endloop | (voice->params[i].send_dcba & 0xff000000), - PSST, voice->startloop | ((voice->params[i].send_dcba & 0x00ff0000) << 8), - CCCA, (voice->start) | emu10k1_select_interprom(card,voice) | - ((voice->flags & VOICE_FLAGS_16BIT) ? 0 : CCCA_8BITSELECT), - /* Clear filter delay memory */ - Z1, 0, - Z2, 0, - /* Invalidate maps */ - MAPA, MAP_PTI_MASK | ((u32) card->silentpage.dma_handle * 2), - MAPB, MAP_PTI_MASK | ((u32) card->silentpage.dma_handle * 2), - /* modulation envelope */ - CVCF, 0x0000ffff, - VTFT, 0x0000ffff, - ATKHLDM, 0, - DCYSUSM, 0x007f, - LFOVAL1, 0x8000, - LFOVAL2, 0x8000, - FMMOD, 0, - TREMFRQ, 0, - FM2FRQ2, 0, - ENVVAL, 0x8000, - /* volume envelope */ - ATKHLDV, 0x7f7f, - ENVVOL, 0x8000, - /* filter envelope */ - PEFE_FILTERAMOUNT, 0x7f, - /* pitch envelope */ - PEFE_PITCHAMOUNT, 0, TAGLIST_END); - - voice->params[i].fc_target = 0xffff; - } -} - -void emu10k1_voices_start(struct emu_voice *first_voice, unsigned int num_voices, int set) -{ - struct emu10k1_card *card = first_voice->card; - struct emu_voice *voice; - unsigned int voicenum; - int j; - - DPF(2, "emu10k1_voices_start()\n"); - - for (voicenum = 0; voicenum < num_voices; voicenum++) - { - voice = first_voice + voicenum; - - if (!set) { - u32 cra, ccis, cs, sample; - if (voice->flags & VOICE_FLAGS_STEREO) { - cra = 64; - ccis = 28; - cs = 4; - } else { - cra = 64; - ccis = 30; - cs = 2; - } - - if(voice->flags & VOICE_FLAGS_16BIT) { - sample = 0x00000000; - } else { - sample = 0x80808080; - ccis *= 2; - } - - for(j = 0; j < cs; j++) - sblive_writeptr(card, CD0 + j, voice->num, sample); - - /* Reset cache */ - sblive_writeptr(card, CCR_CACHEINVALIDSIZE, voice->num, 0); - if (voice->flags & VOICE_FLAGS_STEREO) - sblive_writeptr(card, CCR_CACHEINVALIDSIZE, voice->num + 1, 0); - - sblive_writeptr(card, CCR_READADDRESS, voice->num, cra); - - if (voice->flags & VOICE_FLAGS_STEREO) - sblive_writeptr(card, CCR_READADDRESS, voice->num + 1, cra); - - /* Fill cache */ - sblive_writeptr(card, CCR_CACHEINVALIDSIZE, voice->num, ccis); - } - - for (j = 0; j < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); j++) { - sblive_writeptr_tag(card, voice->num + j, - IFATN, (voice->params[j].initial_fc << 8) | voice->params[j].initial_attn, - VTFT, (voice->params[j].volume_target << 16) | voice->params[j].fc_target, - CVCF, (voice->params[j].volume_target << 16) | voice->params[j].fc_target, - DCYSUSV, (voice->params[j].byampl_env_sustain << 8) | voice->params[j].byampl_env_decay, - TAGLIST_END); - - emu10k1_clear_stop_on_loop(card, voice->num + j); - } - } - - - for (voicenum = 0; voicenum < num_voices; voicenum++) - { - voice = first_voice + voicenum; - - for (j = 0; j < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); j++) { - sblive_writeptr(card, PTRX_PITCHTARGET, voice->num + j, voice->pitch_target); - - if (j == 0) - sblive_writeptr(card, CPF_CURRENTPITCH, voice->num, voice->pitch_target); - - sblive_writeptr(card, IP, voice->num + j, voice->initial_pitch); - } - } -} - -void emu10k1_voices_stop(struct emu_voice *first_voice, int num_voices) -{ - struct emu10k1_card *card = first_voice->card; - struct emu_voice *voice; - unsigned int voice_num; - int j; - - DPF(2, "emu10k1_voice_stop()\n"); - - for (voice_num = 0; voice_num < num_voices; voice_num++) - { - voice = first_voice + voice_num; - - for (j = 0; j < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); j++) { - sblive_writeptr_tag(card, voice->num + j, - PTRX_PITCHTARGET, 0, - CPF_CURRENTPITCH, 0, - IFATN, 0xffff, - VTFT, 0x0000ffff, - CVCF, 0x0000ffff, - IP, 0, - TAGLIST_END); - } - } -} - diff --git a/sound/oss/emu10k1/voicemgr.h b/sound/oss/emu10k1/voicemgr.h deleted file mode 100644 index 099a8cb7f2c..00000000000 --- a/sound/oss/emu10k1/voicemgr.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - ********************************************************************** - * sblive_voice.h -- EMU Voice Resource Manager header file - * Copyright 1999, 2000 Creative Labs, Inc. - * - ********************************************************************** - * - * Date Author Summary of changes - * ---- ------ ------------------ - * October 20, 1999 Bertrand Lee base code release - * - ********************************************************************** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - * USA. - * - ********************************************************************** - */ - -#ifndef _VOICEMGR_H -#define _VOICEMGR_H - -#include "hwaccess.h" - -/* struct emu_voice.usage flags */ -#define VOICE_USAGE_FREE 0x01 -#define VOICE_USAGE_MIDI 0x02 -#define VOICE_USAGE_PLAYBACK 0x04 - -/* struct emu_voice.flags flags */ -#define VOICE_FLAGS_STEREO 0x02 -#define VOICE_FLAGS_16BIT 0x04 - -struct voice_param -{ - /* FX bus amount send */ - - u32 send_routing; - // audigy only: - u32 send_routing2; - - u32 send_dcba; - // audigy only: - u32 send_hgfe; - - - u32 initial_fc; - u32 fc_target; - - u32 initial_attn; - u32 volume_target; - - u32 byampl_env_sustain; - u32 byampl_env_decay; -}; - -struct voice_mem { - int emupageindex; - void *addr[BUFMAXPAGES]; - dma_addr_t dma_handle[BUFMAXPAGES]; - u32 pages; -}; - -struct emu_voice -{ - struct emu10k1_card *card; - u8 usage; /* Free, MIDI, playback */ - u8 num; /* Voice ID */ - u8 flags; /* Stereo/mono, 8/16 bit */ - - u32 startloop; - u32 endloop; - u32 start; - - u32 initial_pitch; - u32 pitch_target; - - struct voice_param params[2]; - - struct voice_mem mem; -}; - -int emu10k1_voice_alloc_buffer(struct emu10k1_card *, struct voice_mem *, u32); -void emu10k1_voice_free_buffer(struct emu10k1_card *, struct voice_mem *); -int emu10k1_voice_alloc(struct emu10k1_card *, struct emu_voice *); -void emu10k1_voice_free(struct emu_voice *); -void emu10k1_voice_playback_setup(struct emu_voice *); -void emu10k1_voices_start(struct emu_voice *, unsigned int, int); -void emu10k1_voices_stop(struct emu_voice *, int); - -#endif /* _VOICEMGR_H */ diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c index 2796c0ef985..a690ca57adb 100644 --- a/sound/oss/mpu401.c +++ b/sound/oss/mpu401.c @@ -1003,7 +1003,8 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner) } if (!devc->shared_irq) { - if (request_irq(devc->irq, mpuintr, 0, "mpu401", (void *)m) < 0) + if (request_irq(devc->irq, mpuintr, 0, "mpu401", + hw_config) < 0) { printk(KERN_WARNING "mpu401: Failed to allocate IRQ%d\n", devc->irq); ret = -ENOMEM; @@ -1112,7 +1113,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner) return 0; out_irq: - free_irq(devc->irq, (void *)m); + free_irq(devc->irq, hw_config); out_mididev: sound_unload_mididev(m); out_err: @@ -1227,7 +1228,7 @@ void unload_mpu401(struct address_info *hw_config) if (n != -1) { release_region(hw_config->io_base, 2); if (hw_config->always_detect == 0 && hw_config->irq > 0) - free_irq(hw_config->irq, (void *)n); + free_irq(hw_config->irq, hw_config); p=mpu401_synth_operations[n]; sound_unload_mididev(n); sound_unload_timerdev(hw_config->slots[2]); diff --git a/sound/oss/nm256.h b/sound/oss/nm256.h deleted file mode 100644 index 1dade903399..00000000000 --- a/sound/oss/nm256.h +++ /dev/null @@ -1,292 +0,0 @@ -#ifndef _NM256_H_ -#define _NM256_H_ - -#include <linux/spinlock.h> -#include <linux/interrupt.h> - -#include "ac97.h" - -/* The revisions that we currently handle. */ -enum nm256rev { - REV_NM256AV, REV_NM256ZX -}; - -/* Per-card structure. */ -struct nm256_info -{ - /* Magic number used to verify that this struct is valid. */ -#define NM_MAGIC_SIG 0x55aa00ff - int magsig; - - /* Revision number */ - enum nm256rev rev; - - struct ac97_hwint mdev; - - /* Our audio device numbers. */ - int dev[2]; - - /* The # of times each device has been opened. (Should only be - 0 or 1). */ - int opencnt[2]; - - /* We use two devices, because we can do simultaneous play and record. - This keeps track of which device is being used for what purpose; - these are the actual device numbers. */ - int dev_for_play; - int dev_for_record; - - spinlock_t lock; - - /* The mixer device. */ - int mixer_oss_dev; - - /* - * Can only be opened once for each operation. These aren't set - * until an actual I/O operation is performed; this allows one - * device to be open for read/write without inhibiting I/O to - * the other device. - */ - int is_open_play; - int is_open_record; - - /* Non-zero if we're currently playing a sample. */ - int playing; - /* Ditto for recording a sample. */ - int recording; - - /* The two memory ports. */ - struct nm256_ports { - /* Physical address of the port. */ - u32 physaddr; - /* Our mapped-in pointer. */ - char __iomem *ptr; - /* PTR's offset within the physical port. */ - u32 start_offset; - /* And the offset of the end of the buffer. */ - u32 end_offset; - } port[2]; - - /* The following are offsets within memory port 1. */ - u32 coeffBuf; - u32 allCoeffBuf; - - /* Record and playback buffers. */ - u32 abuf1, abuf2; - - /* Offset of the AC97 mixer in memory port 2. */ - u32 mixer; - - /* Offset of the mixer status register in memory port 2. */ - u32 mixer_status_offset; - - /* Non-zero if we have written initial values to the mixer. */ - u8 mixer_values_init; - - /* - * Status mask bit; (*mixer_status_loc & mixer_status_mask) == 0 means - * it's ready. - */ - u16 mixer_status_mask; - - /* The sizes of the playback and record ring buffers. */ - u32 playbackBufferSize; - u32 recordBufferSize; - - /* Are the coefficient values in the memory cache current? */ - u8 coeffsCurrent; - - /* For writes, the amount we last wrote. */ - u32 requested_amt; - /* The start of the block currently playing. */ - u32 curPlayPos; - - /* The amount of data we were requested to record. */ - u32 requestedRecAmt; - /* The offset of the currently-recording block. */ - u32 curRecPos; - /* The destination buffer. */ - char *recBuf; - - /* Our IRQ number. */ - int irq; - - /* A flag indicating how many times we've grabbed the IRQ. */ - int has_irq; - - /* The card interrupt service routine. */ - irq_handler_t introutine; - - /* Current audio config, cached. */ - struct sinfo { - u32 samplerate; - u8 bits; - u8 stereo; - } sinfo[2]; /* goes with each device */ - - /* The cards are stored in a chain; this is the next card. */ - struct nm256_info *next_card; -}; - -/* The BIOS signature. */ -#define NM_SIGNATURE 0x4e4d0000 -/* Signature mask. */ -#define NM_SIG_MASK 0xffff0000 - -/* Size of the second memory area. */ -#define NM_PORT2_SIZE 4096 - -/* The base offset of the mixer in the second memory area. */ -#define NM_MIXER_OFFSET 0x600 - -/* The maximum size of a coefficient entry. */ -#define NM_MAX_COEFFICIENT 0x5000 - -/* The interrupt register. */ -#define NM_INT_REG 0xa04 -/* And its bits. */ -#define NM_PLAYBACK_INT 0x40 -#define NM_RECORD_INT 0x100 -#define NM_MISC_INT_1 0x4000 -#define NM_MISC_INT_2 0x1 -#define NM_ACK_INT(CARD, X) nm256_writePort16((CARD), 2, NM_INT_REG, (X) << 1) - -/* The AV's "mixer ready" status bit and location. */ -#define NM_MIXER_STATUS_OFFSET 0xa04 -#define NM_MIXER_READY_MASK 0x0800 -#define NM_MIXER_PRESENCE 0xa06 -#define NM_PRESENCE_MASK 0x0050 -#define NM_PRESENCE_VALUE 0x0040 - -/* - * For the ZX. It uses the same interrupt register, but it holds 32 - * bits instead of 16. - */ -#define NM2_PLAYBACK_INT 0x10000 -#define NM2_RECORD_INT 0x80000 -#define NM2_MISC_INT_1 0x8 -#define NM2_MISC_INT_2 0x2 -#define NM2_ACK_INT(CARD, X) nm256_writePort32((CARD), 2, NM_INT_REG, (X)) - -/* The ZX's "mixer ready" status bit and location. */ -#define NM2_MIXER_STATUS_OFFSET 0xa06 -#define NM2_MIXER_READY_MASK 0x0800 - -/* The playback registers start from here. */ -#define NM_PLAYBACK_REG_OFFSET 0x0 -/* The record registers start from here. */ -#define NM_RECORD_REG_OFFSET 0x200 - -/* The rate register is located 2 bytes from the start of the register area. */ -#define NM_RATE_REG_OFFSET 2 - -/* Mono/stereo flag, number of bits on playback, and rate mask. */ -#define NM_RATE_STEREO 1 -#define NM_RATE_BITS_16 2 -#define NM_RATE_MASK 0xf0 - -/* Playback enable register. */ -#define NM_PLAYBACK_ENABLE_REG (NM_PLAYBACK_REG_OFFSET + 0x1) -#define NM_PLAYBACK_ENABLE_FLAG 1 -#define NM_PLAYBACK_ONESHOT 2 -#define NM_PLAYBACK_FREERUN 4 - -/* Mutes the audio output. */ -#define NM_AUDIO_MUTE_REG (NM_PLAYBACK_REG_OFFSET + 0x18) -#define NM_AUDIO_MUTE_LEFT 0x8000 -#define NM_AUDIO_MUTE_RIGHT 0x0080 - -/* Recording enable register. */ -#define NM_RECORD_ENABLE_REG (NM_RECORD_REG_OFFSET + 0) -#define NM_RECORD_ENABLE_FLAG 1 -#define NM_RECORD_FREERUN 2 - -#define NM_RBUFFER_START (NM_RECORD_REG_OFFSET + 0x4) -#define NM_RBUFFER_END (NM_RECORD_REG_OFFSET + 0x10) -#define NM_RBUFFER_WMARK (NM_RECORD_REG_OFFSET + 0xc) -#define NM_RBUFFER_CURRP (NM_RECORD_REG_OFFSET + 0x8) - -#define NM_PBUFFER_START (NM_PLAYBACK_REG_OFFSET + 0x4) -#define NM_PBUFFER_END (NM_PLAYBACK_REG_OFFSET + 0x14) -#define NM_PBUFFER_WMARK (NM_PLAYBACK_REG_OFFSET + 0xc) -#define NM_PBUFFER_CURRP (NM_PLAYBACK_REG_OFFSET + 0x8) - -/* A few trivial routines to make it easier to work with the registers - on the chip. */ - -/* This is a common code portion used to fix up the port offsets. */ -#define NM_FIX_PORT \ - if (port < 1 || port > 2 || card == NULL) \ - return -1; \ -\ - if (offset < card->port[port - 1].start_offset \ - || offset >= card->port[port - 1].end_offset) { \ - printk (KERN_ERR "Bad access: port %d, offset 0x%x\n", port, offset); \ - return -1; \ - } \ - offset -= card->port[port - 1].start_offset; - -#define DEFwritePortX(X, func) \ -static inline int nm256_writePort##X (struct nm256_info *card,\ - int port, int offset, int value)\ -{\ - u##X __iomem *addr;\ -\ - if (nm256_debug > 1)\ - printk (KERN_DEBUG "Writing 0x%x to %d:0x%x\n", value, port, offset);\ -\ - NM_FIX_PORT;\ -\ - addr = (u##X __iomem *)(card->port[port - 1].ptr + offset);\ - func (value, addr);\ - return 0;\ -} - -DEFwritePortX (8, writeb) -DEFwritePortX (16, writew) -DEFwritePortX (32, writel) - -#define DEFreadPortX(X, func) \ -static inline u##X nm256_readPort##X (struct nm256_info *card,\ - int port, int offset)\ -{\ - u##X __iomem *addr;\ -\ - NM_FIX_PORT\ -\ - addr = (u##X __iomem *)(card->port[port - 1].ptr + offset);\ - return func(addr);\ -} - -DEFreadPortX (8, readb) -DEFreadPortX (16, readw) -DEFreadPortX (32, readl) - -static inline int -nm256_writeBuffer8 (struct nm256_info *card, u8 *src, int port, int offset, - int amt) -{ - NM_FIX_PORT; - memcpy_toio (card->port[port - 1].ptr + offset, src, amt); - return 0; -} - -static inline int -nm256_readBuffer8 (struct nm256_info *card, u8 *dst, int port, int offset, - int amt) -{ - NM_FIX_PORT; - memcpy_fromio (dst, card->port[port - 1].ptr + offset, amt); - return 0; -} - -/* Returns a non-zero value if we should use the coefficient cache. */ -static int nm256_cachedCoefficients (struct nm256_info *card); - -#endif - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c deleted file mode 100644 index 44cd1550500..00000000000 --- a/sound/oss/nm256_audio.c +++ /dev/null @@ -1,1662 +0,0 @@ -/* - * Audio driver for the NeoMagic 256AV and 256ZX chipsets in native - * mode, with AC97 mixer support. - * - * Overall design and parts of this code stolen from vidc_*.c and - * skeleton.c. - * - * Yeah, there are a lot of magic constants in here. You tell ME what - * they are. I just get this stuff psychically, remember? - * - * This driver was written by someone who wishes to remain anonymous. - * It is in the public domain, so share and enjoy. Try to make a profit - * off of it; go on, I dare you. - * - * Changes: - * 11-10-2000 Bartlomiej Zolnierkiewicz <bkz@linux-ide.org> - * Added some __init - * 19-04-2001 Marcus Meissner <mm@caldera.de> - * Ported to 2.4 PCI API. - */ - -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/interrupt.h> -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/delay.h> -#include <linux/spinlock.h> -#include "sound_config.h" - -static int nm256_debug; -static int force_load; - -#include "nm256.h" -#include "nm256_coeff.h" - -/* - * The size of the playback reserve. When the playback buffer has less - * than NM256_PLAY_WMARK_SIZE bytes to output, we request a new - * buffer. - */ -#define NM256_PLAY_WMARK_SIZE 512 - -static struct audio_driver nm256_audio_driver; - -static int nm256_grabInterrupt (struct nm256_info *card); -static int nm256_releaseInterrupt (struct nm256_info *card); -static irqreturn_t nm256_interrupt (int irq, void *dev_id); -static irqreturn_t nm256_interrupt_zx (int irq, void *dev_id); - -/* These belong in linux/pci.h. */ -#define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005 -#define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006 -#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016 - -/* List of cards. */ -static struct nm256_info *nmcard_list; - -/* Release the mapped-in memory for CARD. */ -static void -nm256_release_ports (struct nm256_info *card) -{ - int x; - - for (x = 0; x < 2; x++) { - if (card->port[x].ptr != NULL) { - iounmap (card->port[x].ptr); - card->port[x].ptr = NULL; - } - } -} - -/* - * Map in the memory ports for CARD, if they aren't already mapped in - * and have been configured. If successful, a zero value is returned; - * otherwise any previously mapped-in areas are released and a non-zero - * value is returned. - * - * This is invoked twice, once for each port. Ideally it would only be - * called once, but we now need to map in the second port in order to - * check how much memory the card has on the 256ZX. - */ -static int -nm256_remap_ports (struct nm256_info *card) -{ - int x; - - for (x = 0; x < 2; x++) { - if (card->port[x].ptr == NULL && card->port[x].end_offset > 0) { - u32 physaddr - = card->port[x].physaddr + card->port[x].start_offset; - u32 size - = card->port[x].end_offset - card->port[x].start_offset; - - card->port[x].ptr = ioremap_nocache (physaddr, size); - - if (card->port[x].ptr == NULL) { - printk (KERN_ERR "NM256: Unable to remap port %d\n", x + 1); - nm256_release_ports (card); - return -1; - } - } - } - return 0; -} - -/* Locate the card in our list. */ -static struct nm256_info * -nm256_find_card (int dev) -{ - struct nm256_info *card; - - for (card = nmcard_list; card != NULL; card = card->next_card) - if (card->dev[0] == dev || card->dev[1] == dev) - return card; - - return NULL; -} - -/* - * Ditto, but find the card struct corresponding to the mixer device DEV - * instead. - */ -static struct nm256_info * -nm256_find_card_for_mixer (int dev) -{ - struct nm256_info *card; - - for (card = nmcard_list; card != NULL; card = card->next_card) - if (card->mixer_oss_dev == dev) - return card; - - return NULL; -} - -static int usecache; -static int buffertop; - -/* Check to see if we're using the bank of cached coefficients. */ -static int -nm256_cachedCoefficients (struct nm256_info *card) -{ - return usecache; -} - -/* The actual rates supported by the card. */ -static int samplerates[9] = { - 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 99999999 -}; - -/* - * Set the card samplerate, word size and stereo mode to correspond to - * the settings in the CARD struct for the specified device in DEV. - * We keep two separate sets of information, one for each device; the - * hardware is not actually configured until a read or write is - * attempted. - */ - -static int -nm256_setInfo (int dev, struct nm256_info *card) -{ - int x; - int w; - int targetrate; - - if (card->dev[0] == dev) - w = 0; - else if (card->dev[1] == dev) - w = 1; - else - return -ENODEV; - - targetrate = card->sinfo[w].samplerate; - - if ((card->sinfo[w].bits != 8 && card->sinfo[w].bits != 16) - || targetrate < samplerates[0] - || targetrate > samplerates[7]) - return -EINVAL; - - for (x = 0; x < 8; x++) - if (targetrate < ((samplerates[x] + samplerates[x + 1]) / 2)) - break; - - if (x < 8) { - u8 ratebits = ((x << 4) & NM_RATE_MASK); - if (card->sinfo[w].bits == 16) - ratebits |= NM_RATE_BITS_16; - if (card->sinfo[w].stereo) - ratebits |= NM_RATE_STEREO; - - card->sinfo[w].samplerate = samplerates[x]; - - - if (card->dev_for_play == dev && card->playing) { - if (nm256_debug) - printk (KERN_DEBUG "Setting play ratebits to 0x%x\n", - ratebits); - nm256_loadCoefficient (card, 0, x); - nm256_writePort8 (card, 2, - NM_PLAYBACK_REG_OFFSET + NM_RATE_REG_OFFSET, - ratebits); - } - - if (card->dev_for_record == dev && card->recording) { - if (nm256_debug) - printk (KERN_DEBUG "Setting record ratebits to 0x%x\n", - ratebits); - nm256_loadCoefficient (card, 1, x); - nm256_writePort8 (card, 2, - NM_RECORD_REG_OFFSET + NM_RATE_REG_OFFSET, - ratebits); - } - return 0; - } - else - return -EINVAL; -} - -/* Start the play process going. */ -static void -startPlay (struct nm256_info *card) -{ - if (! card->playing) { - card->playing = 1; - if (nm256_grabInterrupt (card) == 0) { - nm256_setInfo (card->dev_for_play, card); - - /* Enable playback engine and interrupts. */ - nm256_writePort8 (card, 2, NM_PLAYBACK_ENABLE_REG, - NM_PLAYBACK_ENABLE_FLAG | NM_PLAYBACK_FREERUN); - - /* Enable both channels. */ - nm256_writePort16 (card, 2, NM_AUDIO_MUTE_REG, 0x0); - } - } -} - -/* - * Request one chunk of AMT bytes from the recording device. When the - * operation is complete, the data will be copied into BUFFER and the - * function DMAbuf_inputintr will be invoked. - */ - -static void -nm256_startRecording (struct nm256_info *card, char *buffer, u32 amt) -{ - u32 endpos; - int enableEngine = 0; - u32 ringsize = card->recordBufferSize; - unsigned long flags; - - if (amt > (ringsize / 2)) { - /* - * Of course this won't actually work right, because the - * caller is going to assume we will give what we got asked - * for. - */ - printk (KERN_ERR "NM256: Read request too large: %d\n", amt); - amt = ringsize / 2; - } - - if (amt < 8) { - printk (KERN_ERR "NM256: Read request too small; %d\n", amt); - return; - } - - spin_lock_irqsave(&card->lock,flags); - /* - * If we're not currently recording, set up the start and end registers - * for the recording engine. - */ - if (! card->recording) { - card->recording = 1; - if (nm256_grabInterrupt (card) == 0) { - card->curRecPos = 0; - nm256_setInfo (card->dev_for_record, card); - nm256_writePort32 (card, 2, NM_RBUFFER_START, card->abuf2); - nm256_writePort32 (card, 2, NM_RBUFFER_END, - card->abuf2 + ringsize); - - nm256_writePort32 (card, 2, NM_RBUFFER_CURRP, - card->abuf2 + card->curRecPos); - enableEngine = 1; - } - else { - /* Not sure what else to do here. */ - spin_unlock_irqrestore(&card->lock,flags); - return; - } - } - - /* - * If we happen to go past the end of the buffer a bit (due to a - * delayed interrupt) it's OK. So might as well set the watermark - * right at the end of the data we want. - */ - endpos = card->abuf2 + ((card->curRecPos + amt) % ringsize); - - card->recBuf = buffer; - card->requestedRecAmt = amt; - nm256_writePort32 (card, 2, NM_RBUFFER_WMARK, endpos); - /* Enable recording engine and interrupts. */ - if (enableEngine) - nm256_writePort8 (card, 2, NM_RECORD_ENABLE_REG, - NM_RECORD_ENABLE_FLAG | NM_RECORD_FREERUN); - - spin_unlock_irqrestore(&card->lock,flags); -} - -/* Stop the play engine. */ -static void -stopPlay (struct nm256_info *card) -{ - /* Shut off sound from both channels. */ - nm256_writePort16 (card, 2, NM_AUDIO_MUTE_REG, - NM_AUDIO_MUTE_LEFT | NM_AUDIO_MUTE_RIGHT); - /* Disable play engine. */ - nm256_writePort8 (card, 2, NM_PLAYBACK_ENABLE_REG, 0); - if (card->playing) { - nm256_releaseInterrupt (card); - - /* Reset the relevant state bits. */ - card->playing = 0; - card->curPlayPos = 0; - } -} - -/* Stop recording. */ -static void -stopRecord (struct nm256_info *card) -{ - /* Disable recording engine. */ - nm256_writePort8 (card, 2, NM_RECORD_ENABLE_REG, 0); - - if (card->recording) { - nm256_releaseInterrupt (card); - - card->recording = 0; - card->curRecPos = 0; - } -} - -/* - * Ring buffers, man. That's where the hip-hop, wild-n-wooly action's at. - * 1972? (Well, I suppose it was cheep-n-easy to implement.) - * - * Write AMT bytes of BUFFER to the playback ring buffer, and start the - * playback engine running. It will only accept up to 1/2 of the total - * size of the ring buffer. No check is made that we're about to overwrite - * the currently-playing sample. - */ - -static void -nm256_write_block (struct nm256_info *card, char *buffer, u32 amt) -{ - u32 ringsize = card->playbackBufferSize; - u32 endstop; - unsigned long flags; - - if (amt > (ringsize / 2)) { - printk (KERN_ERR "NM256: Write request too large: %d\n", amt); - amt = (ringsize / 2); - } - - if (amt < NM256_PLAY_WMARK_SIZE) { - printk (KERN_ERR "NM256: Write request too small: %d\n", amt); - return; - } - - card->curPlayPos %= ringsize; - - card->requested_amt = amt; - - spin_lock_irqsave(&card->lock,flags); - - if ((card->curPlayPos + amt) >= ringsize) { - u32 rem = ringsize - card->curPlayPos; - - nm256_writeBuffer8 (card, buffer, 1, - card->abuf1 + card->curPlayPos, - rem); - if (amt > rem) - nm256_writeBuffer8 (card, buffer + rem, 1, card->abuf1, - amt - rem); - } - else - nm256_writeBuffer8 (card, buffer, 1, - card->abuf1 + card->curPlayPos, - amt); - - /* - * Setup the start-n-stop-n-limit registers, and start that engine - * goin'. - * - * Normally we just let it wrap around to avoid the click-click - * action scene. - */ - if (! card->playing) { - /* The PBUFFER_END register in this case points to one sample - before the end of the buffer. */ - int w = (card->dev_for_play == card->dev[0] ? 0 : 1); - int sampsize = (card->sinfo[w].bits == 16 ? 2 : 1); - - if (card->sinfo[w].stereo) - sampsize *= 2; - - /* Need to set the not-normally-changing-registers up. */ - nm256_writePort32 (card, 2, NM_PBUFFER_START, - card->abuf1 + card->curPlayPos); - nm256_writePort32 (card, 2, NM_PBUFFER_END, - card->abuf1 + ringsize - sampsize); - nm256_writePort32 (card, 2, NM_PBUFFER_CURRP, - card->abuf1 + card->curPlayPos); - } - endstop = (card->curPlayPos + amt - NM256_PLAY_WMARK_SIZE) % ringsize; - nm256_writePort32 (card, 2, NM_PBUFFER_WMARK, card->abuf1 + endstop); - - if (! card->playing) - startPlay (card); - - spin_unlock_irqrestore(&card->lock,flags); -} - -/* We just got a card playback interrupt; process it. */ -static void -nm256_get_new_block (struct nm256_info *card) -{ - /* Check to see how much got played so far. */ - u32 amt = nm256_readPort32 (card, 2, NM_PBUFFER_CURRP) - card->abuf1; - - if (amt >= card->playbackBufferSize) { - printk (KERN_ERR "NM256: Sound playback pointer invalid!\n"); - amt = 0; - } - - if (amt < card->curPlayPos) - amt = (card->playbackBufferSize - card->curPlayPos) + amt; - else - amt -= card->curPlayPos; - - if (card->requested_amt > (amt + NM256_PLAY_WMARK_SIZE)) { - u32 endstop = - card->curPlayPos + card->requested_amt - NM256_PLAY_WMARK_SIZE; - nm256_writePort32 (card, 2, NM_PBUFFER_WMARK, card->abuf1 + endstop); - } - else { - card->curPlayPos += card->requested_amt; - /* Get a new block to write. This will eventually invoke - nm256_write_block () or stopPlay (). */ - DMAbuf_outputintr (card->dev_for_play, 1); - } -} - -/* - * Read the last-recorded block from the ring buffer, copy it into the - * saved buffer pointer, and invoke DMAuf_inputintr() with the recording - * device. - */ - -static void -nm256_read_block (struct nm256_info *card) -{ - /* Grab the current position of the recording pointer. */ - u32 currptr = nm256_readPort32 (card, 2, NM_RBUFFER_CURRP) - card->abuf2; - u32 amtToRead = card->requestedRecAmt; - u32 ringsize = card->recordBufferSize; - - if (currptr >= card->recordBufferSize) { - printk (KERN_ERR "NM256: Sound buffer record pointer invalid!\n"); - currptr = 0; - } - - /* - * This test is probably redundant; we shouldn't be here unless - * it's true. - */ - if (card->recording) { - /* If we wrapped around, copy everything from the start of our - recording buffer to the end of the buffer. */ - if (currptr < card->curRecPos) { - u32 amt = min (ringsize - card->curRecPos, amtToRead); - - nm256_readBuffer8 (card, card->recBuf, 1, - card->abuf2 + card->curRecPos, - amt); - amtToRead -= amt; - card->curRecPos += amt; - card->recBuf += amt; - if (card->curRecPos == ringsize) - card->curRecPos = 0; - } - - if ((card->curRecPos < currptr) && (amtToRead > 0)) { - u32 amt = min (currptr - card->curRecPos, amtToRead); - nm256_readBuffer8 (card, card->recBuf, 1, - card->abuf2 + card->curRecPos, amt); - card->curRecPos = ((card->curRecPos + amt) % ringsize); - } - card->recBuf = NULL; - card->requestedRecAmt = 0; - DMAbuf_inputintr (card->dev_for_record); - } -} - -/* - * Initialize the hardware. - */ -static void -nm256_initHw (struct nm256_info *card) -{ - /* Reset everything. */ - nm256_writePort8 (card, 2, 0x0, 0x11); - nm256_writePort16 (card, 2, 0x214, 0); - - stopRecord (card); - stopPlay (card); -} - -/* - * Handle a potential interrupt for the device referred to by DEV_ID. - * - * I don't like the cut-n-paste job here either between the two routines, - * but there are sufficient differences between the two interrupt handlers - * that parameterizing it isn't all that great either. (Could use a macro, - * I suppose...yucky bleah.) - */ - -static irqreturn_t -nm256_interrupt (int irq, void *dev_id) -{ - struct nm256_info *card = (struct nm256_info *)dev_id; - u16 status; - static int badintrcount; - int handled = 0; - - if ((card == NULL) || (card->magsig != NM_MAGIC_SIG)) { - printk (KERN_ERR "NM256: Bad card pointer\n"); - return IRQ_NONE; - } - - status = nm256_readPort16 (card, 2, NM_INT_REG); - - /* Not ours. */ - if (status == 0) { - if (badintrcount++ > 1000) { - /* - * I'm not sure if the best thing is to stop the card from - * playing or just release the interrupt (after all, we're in - * a bad situation, so doing fancy stuff may not be such a good - * idea). - * - * I worry about the card engine continuing to play noise - * over and over, however--that could become a very - * obnoxious problem. And we know that when this usually - * happens things are fairly safe, it just means the user's - * inserted a PCMCIA card and someone's spamming us with IRQ 9s. - */ - - handled = 1; - if (card->playing) - stopPlay (card); - if (card->recording) - stopRecord (card); - badintrcount = 0; - } - return IRQ_RETVAL(handled); - } - - badintrcount = 0; - - /* Rather boring; check for individual interrupts and process them. */ - - if (status & NM_PLAYBACK_INT) { - handled = 1; - status &= ~NM_PLAYBACK_INT; - NM_ACK_INT (card, NM_PLAYBACK_INT); - - if (card->playing) - nm256_get_new_block (card); - } - - if (status & NM_RECORD_INT) { - handled = 1; - status &= ~NM_RECORD_INT; - NM_ACK_INT (card, NM_RECORD_INT); - - if (card->recording) - nm256_read_block (card); - } - - if (status & NM_MISC_INT_1) { - u8 cbyte; - - handled = 1; - status &= ~NM_MISC_INT_1; - printk (KERN_ERR "NM256: Got misc interrupt #1\n"); - NM_ACK_INT (card, NM_MISC_INT_1); - nm256_writePort16 (card, 2, NM_INT_REG, 0x8000); - cbyte = nm256_readPort8 (card, 2, 0x400); - nm256_writePort8 (card, 2, 0x400, cbyte | 2); - } - - if (status & NM_MISC_INT_2) { - u8 cbyte; - - handled = 1; - status &= ~NM_MISC_INT_2; - printk (KERN_ERR "NM256: Got misc interrupt #2\n"); - NM_ACK_INT (card, NM_MISC_INT_2); - cbyte = nm256_readPort8 (card, 2, 0x400); - nm256_writePort8 (card, 2, 0x400, cbyte & ~2); - } - - /* Unknown interrupt. */ - if (status) { - handled = 1; - printk (KERN_ERR "NM256: Fire in the hole! Unknown status 0x%x\n", - status); - /* Pray. */ - NM_ACK_INT (card, status); - } - return IRQ_RETVAL(handled); -} - -/* - * Handle a potential interrupt for the device referred to by DEV_ID. - * This handler is for the 256ZX, and is very similar to the non-ZX - * routine. - */ - -static irqreturn_t -nm256_interrupt_zx (int irq, void *dev_id) -{ - struct nm256_info *card = (struct nm256_info *)dev_id; - u32 status; - static int badintrcount; - int handled = 0; - - if ((card == NULL) || (card->magsig != NM_MAGIC_SIG)) { - printk (KERN_ERR "NM256: Bad card pointer\n"); - return IRQ_NONE; - } - - status = nm256_readPort32 (card, 2, NM_INT_REG); - - /* Not ours. */ - if (status == 0) { - if (badintrcount++ > 1000) { - printk (KERN_ERR "NM256: Releasing interrupt, over 1000 invalid interrupts\n"); - /* - * I'm not sure if the best thing is to stop the card from - * playing or just release the interrupt (after all, we're in - * a bad situation, so doing fancy stuff may not be such a good - * idea). - * - * I worry about the card engine continuing to play noise - * over and over, however--that could become a very - * obnoxious problem. And we know that when this usually - * happens things are fairly safe, it just means the user's - * inserted a PCMCIA card and someone's spamming us with - * IRQ 9s. - */ - - handled = 1; - if (card->playing) - stopPlay (card); - if (card->recording) - stopRecord (card); - badintrcount = 0; - } - return IRQ_RETVAL(handled); - } - - badintrcount = 0; - - /* Rather boring; check for individual interrupts and process them. */ - - if (status & NM2_PLAYBACK_INT) { - handled = 1; - status &= ~NM2_PLAYBACK_INT; - NM2_ACK_INT (card, NM2_PLAYBACK_INT); - - if (card->playing) - nm256_get_new_block (card); - } - - if (status & NM2_RECORD_INT) { - handled = 1; - status &= ~NM2_RECORD_INT; - NM2_ACK_INT (card, NM2_RECORD_INT); - - if (card->recording) - nm256_read_block (card); - } - - if (status & NM2_MISC_INT_1) { - u8 cbyte; - - handled = 1; - status &= ~NM2_MISC_INT_1; - printk (KERN_ERR "NM256: Got misc interrupt #1\n"); - NM2_ACK_INT (card, NM2_MISC_INT_1); - cbyte = nm256_readPort8 (card, 2, 0x400); - nm256_writePort8 (card, 2, 0x400, cbyte | 2); - } - - if (status & NM2_MISC_INT_2) { - u8 cbyte; - - handled = 1; - status &= ~NM2_MISC_INT_2; - printk (KERN_ERR "NM256: Got misc interrupt #2\n"); - NM2_ACK_INT (card, NM2_MISC_INT_2); - cbyte = nm256_readPort8 (card, 2, 0x400); - nm256_writePort8 (card, 2, 0x400, cbyte & ~2); - } - - /* Unknown interrupt. */ - if (status) { - handled = 1; - printk (KERN_ERR "NM256: Fire in the hole! Unknown status 0x%x\n", - status); - /* Pray. */ - NM2_ACK_INT (card, status); - } - return IRQ_RETVAL(handled); -} - -/* - * Request our interrupt. - */ -static int -nm256_grabInterrupt (struct nm256_info *card) -{ - if (card->has_irq++ == 0) { - if (request_irq (card->irq, card->introutine, IRQF_SHARED, - "NM256_audio", card) < 0) { - printk (KERN_ERR "NM256: can't obtain IRQ %d\n", card->irq); - return -1; - } - } - return 0; -} - -/* - * Release our interrupt. - */ -static int -nm256_releaseInterrupt (struct nm256_info *card) -{ - if (card->has_irq <= 0) { - printk (KERN_ERR "nm256: too many calls to releaseInterrupt\n"); - return -1; - } - card->has_irq--; - if (card->has_irq == 0) { - free_irq (card->irq, card); - } - return 0; -} - -/* - * Waits for the mixer to become ready to be written; returns a zero value - * if it timed out. - */ - -static int -nm256_isReady (struct ac97_hwint *dev) -{ - struct nm256_info *card = (struct nm256_info *)dev->driver_private; - int t2 = 10; - u32 testaddr; - u16 testb; - int done = 0; - - if (card->magsig != NM_MAGIC_SIG) { - printk (KERN_ERR "NM256: Bad magic signature in isReady!\n"); - return 0; - } - - testaddr = card->mixer_status_offset; - testb = card->mixer_status_mask; - - /* - * Loop around waiting for the mixer to become ready. - */ - while (! done && t2-- > 0) { - if ((nm256_readPort16 (card, 2, testaddr) & testb) == 0) - done = 1; - else - udelay (100); - } - return done; -} - -/* - * Return the contents of the AC97 mixer register REG. Returns a positive - * value if successful, or a negative error code. - */ -static int -nm256_readAC97Reg (struct ac97_hwint *dev, u8 reg) -{ - struct nm256_info *card = (struct nm256_info *)dev->driver_private; - - if (card->magsig != NM_MAGIC_SIG) { - printk (KERN_ERR "NM256: Bad magic signature in readAC97Reg!\n"); - return -EINVAL; - } - - if (reg < 128) { - int res; - - nm256_isReady (dev); - res = nm256_readPort16 (card, 2, card->mixer + reg); - /* Magic delay. Bleah yucky. */ - udelay (1000); - return res; - } - else - return -EINVAL; -} - -/* - * Writes VALUE to AC97 mixer register REG. Returns 0 if successful, or - * a negative error code. - */ -static int -nm256_writeAC97Reg (struct ac97_hwint *dev, u8 reg, u16 value) -{ - unsigned long flags; - int tries = 2; - int done = 0; - u32 base; - - struct nm256_info *card = (struct nm256_info *)dev->driver_private; - - if (card->magsig != NM_MAGIC_SIG) { - printk (KERN_ERR "NM256: Bad magic signature in writeAC97Reg!\n"); - return -EINVAL; - } - - base = card->mixer; - - spin_lock_irqsave(&card->lock,flags); - - nm256_isReady (dev); - - /* Wait for the write to take, too. */ - while ((tries-- > 0) && !done) { - nm256_writePort16 (card, 2, base + reg, value); - if (nm256_isReady (dev)) { - done = 1; - break; - } - - } - - spin_unlock_irqrestore(&card->lock,flags); - udelay (1000); - - return ! done; -} - -/* - * Initial register values to be written to the AC97 mixer. - * While most of these are identical to the reset values, we do this - * so that we have most of the register contents cached--this avoids - * reading from the mixer directly (which seems to be problematic, - * probably due to ignorance). - */ -struct initialValues -{ - unsigned short port; - unsigned short value; -}; - -static struct initialValues nm256_ac97_initial_values[] = -{ - { AC97_MASTER_VOL_STEREO, 0x8000 }, - { AC97_HEADPHONE_VOL, 0x8000 }, - { AC97_MASTER_VOL_MONO, 0x0000 }, - { AC97_PCBEEP_VOL, 0x0000 }, - { AC97_PHONE_VOL, 0x0008 }, - { AC97_MIC_VOL, 0x8000 }, - { AC97_LINEIN_VOL, 0x8808 }, - { AC97_CD_VOL, 0x8808 }, - { AC97_VIDEO_VOL, 0x8808 }, - { AC97_AUX_VOL, 0x8808 }, - { AC97_PCMOUT_VOL, 0x0808 }, - { AC97_RECORD_SELECT, 0x0000 }, - { AC97_RECORD_GAIN, 0x0B0B }, - { AC97_GENERAL_PURPOSE, 0x0000 }, - { 0xffff, 0xffff } -}; - -/* Initialize the AC97 into a known state. */ -static int -nm256_resetAC97 (struct ac97_hwint *dev) -{ - struct nm256_info *card = (struct nm256_info *)dev->driver_private; - int x; - - if (card->magsig != NM_MAGIC_SIG) { - printk (KERN_ERR "NM256: Bad magic signature in resetAC97!\n"); - return -EINVAL; - } - - /* Reset the mixer. 'Tis magic! */ - nm256_writePort8 (card, 2, 0x6c0, 1); -// nm256_writePort8 (card, 2, 0x6cc, 0x87); /* This crashes Dell latitudes */ - nm256_writePort8 (card, 2, 0x6cc, 0x80); - nm256_writePort8 (card, 2, 0x6cc, 0x0); - - if (! card->mixer_values_init) { - for (x = 0; nm256_ac97_initial_values[x].port != 0xffff; x++) { - ac97_put_register (dev, - nm256_ac97_initial_values[x].port, - nm256_ac97_initial_values[x].value); - card->mixer_values_init = 1; - } - } - - return 0; -} - -/* - * We don't do anything particularly special here; it just passes the - * mixer ioctl to the AC97 driver. - */ -static int -nm256_default_mixer_ioctl (int dev, unsigned int cmd, void __user *arg) -{ - struct nm256_info *card = nm256_find_card_for_mixer (dev); - if (card != NULL) - return ac97_mixer_ioctl (&(card->mdev), cmd, arg); - else - return -ENODEV; -} - -static struct mixer_operations nm256_mixer_operations = { - .owner = THIS_MODULE, - .id = "NeoMagic", - .name = "NM256AC97Mixer", - .ioctl = nm256_default_mixer_ioctl -}; - -/* - * Default settings for the OSS mixer. These are set last, after the - * mixer is initialized. - * - * I "love" C sometimes. Got braces? - */ -static struct ac97_mixer_value_list mixer_defaults[] = { - { SOUND_MIXER_VOLUME, { { 85, 85 } } }, - { SOUND_MIXER_SPEAKER, { { 100 } } }, - { SOUND_MIXER_PCM, { { 65, 65 } } }, - { SOUND_MIXER_CD, { { 65, 65 } } }, - { -1, { { 0, 0 } } } -}; - - -/* Installs the AC97 mixer into CARD. */ -static int __devinit -nm256_install_mixer (struct nm256_info *card) -{ - int mixer; - - card->mdev.reset_device = nm256_resetAC97; - card->mdev.read_reg = nm256_readAC97Reg; - card->mdev.write_reg = nm256_writeAC97Reg; - card->mdev.driver_private = (void *)card; - - if (ac97_init (&(card->mdev))) - return -1; - - mixer = sound_alloc_mixerdev(); - if (num_mixers >= MAX_MIXER_DEV) { - printk ("NM256 mixer: Unable to alloc mixerdev\n"); - return -1; - } - - mixer_devs[mixer] = &nm256_mixer_operations; - card->mixer_oss_dev = mixer; - - /* Some reasonable default values. */ - ac97_set_values (&(card->mdev), mixer_defaults); - - printk(KERN_INFO "Initialized AC97 mixer\n"); - return 0; -} - -/* - * See if the signature left by the NM256 BIOS is intact; if so, we use - * the associated address as the end of our audio buffer in the video - * RAM. - */ - -static void __devinit -nm256_peek_for_sig (struct nm256_info *card) -{ - u32 port1offset - = card->port[0].physaddr + card->port[0].end_offset - 0x0400; - /* The signature is located 1K below the end of video RAM. */ - char __iomem *temp = ioremap_nocache (port1offset, 16); - /* Default buffer end is 5120 bytes below the top of RAM. */ - u32 default_value = card->port[0].end_offset - 0x1400; - u32 sig; - - /* Install the default value first, so we don't have to repeatedly - do it if there is a problem. */ - card->port[0].end_offset = default_value; - - if (temp == NULL) { - printk (KERN_ERR "NM256: Unable to scan for card signature in video RAM\n"); - return; - } - sig = readl (temp); - if ((sig & NM_SIG_MASK) == NM_SIGNATURE) { - u32 pointer = readl (temp + 4); - - /* - * If it's obviously invalid, don't use it (the port already has a - * suitable default value set). - */ - if (pointer != 0xffffffff) - card->port[0].end_offset = pointer; - - printk (KERN_INFO "NM256: Found card signature in video RAM: 0x%x\n", - pointer); - } - - iounmap (temp); -} - -/* - * Install a driver for the PCI device referenced by PCIDEV. - * VERSTR is a human-readable version string. - */ - -static int __devinit -nm256_install(struct pci_dev *pcidev, enum nm256rev rev, char *verstr) -{ - struct nm256_info *card; - int x; - - if (pci_enable_device(pcidev)) - return 0; - - card = kmalloc (sizeof (struct nm256_info), GFP_KERNEL); - if (card == NULL) { - printk (KERN_ERR "NM256: out of memory!\n"); - return 0; - } - - card->magsig = NM_MAGIC_SIG; - card->playing = 0; - card->recording = 0; - card->rev = rev; - spin_lock_init(&card->lock); - - /* Init the memory port info. */ - for (x = 0; x < 2; x++) { - card->port[x].physaddr = pci_resource_start (pcidev, x); - card->port[x].ptr = NULL; - card->port[x].start_offset = 0; - card->port[x].end_offset = 0; - } - - /* Port 2 is easy. */ - card->port[1].start_offset = 0; - card->port[1].end_offset = NM_PORT2_SIZE; - - /* Yuck. But we have to map in port 2 so we can check how much RAM the - card has. */ - if (nm256_remap_ports (card)) { - kfree (card); - return 0; - } - - /* - * The NM256 has two memory ports. The first port is nothing - * more than a chunk of video RAM, which is used as the I/O ring - * buffer. The second port has the actual juicy stuff (like the - * mixer and the playback engine control registers). - */ - - if (card->rev == REV_NM256AV) { - /* Ok, try to see if this is a non-AC97 version of the hardware. */ - int pval = nm256_readPort16 (card, 2, NM_MIXER_PRESENCE); - if ((pval & NM_PRESENCE_MASK) != NM_PRESENCE_VALUE) { - if (! force_load) { - printk (KERN_ERR "NM256: This doesn't look to me like the AC97-compatible version.\n"); - printk (KERN_ERR " You can force the driver to load by passing in the module\n"); - printk (KERN_ERR " parameter:\n"); - printk (KERN_ERR " force_load = 1\n"); - printk (KERN_ERR "\n"); - printk (KERN_ERR " More likely, you should be using the appropriate SB-16 or\n"); - printk (KERN_ERR " CS4232 driver instead. (If your BIOS has settings for\n"); - printk (KERN_ERR " IRQ and/or DMA for the sound card, this is *not* the correct\n"); - printk (KERN_ERR " driver to use.)\n"); - nm256_release_ports (card); - kfree (card); - return 0; - } - else { - printk (KERN_INFO "NM256: Forcing driver load as per user request.\n"); - } - } - else { - /* printk (KERN_INFO "NM256: Congratulations. You're not running Eunice.\n")*/; - } - card->port[0].end_offset = 2560 * 1024; - card->introutine = nm256_interrupt; - card->mixer_status_offset = NM_MIXER_STATUS_OFFSET; - card->mixer_status_mask = NM_MIXER_READY_MASK; - } - else { - /* Not sure if there is any relevant detect for the ZX or not. */ - if (nm256_readPort8 (card, 2, 0xa0b) != 0) - card->port[0].end_offset = 6144 * 1024; - else - card->port[0].end_offset = 4096 * 1024; - - card->introutine = nm256_interrupt_zx; - card->mixer_status_offset = NM2_MIXER_STATUS_OFFSET; - card->mixer_status_mask = NM2_MIXER_READY_MASK; - } - - if (buffertop >= 98304 && buffertop < card->port[0].end_offset) - card->port[0].end_offset = buffertop; - else - nm256_peek_for_sig (card); - - card->port[0].start_offset = card->port[0].end_offset - 98304; - - printk (KERN_INFO "NM256: Mapping port 1 from 0x%x - 0x%x\n", - card->port[0].start_offset, card->port[0].end_offset); - - if (nm256_remap_ports (card)) { - kfree (card); - return 0; - } - - /* See if we can get the interrupt. */ - - card->irq = pcidev->irq; - card->has_irq = 0; - - if (nm256_grabInterrupt (card) != 0) { - nm256_release_ports (card); - kfree (card); - return 0; - } - - nm256_releaseInterrupt (card); - - /* - * Init the board. - */ - - card->playbackBufferSize = 16384; - card->recordBufferSize = 16384; - - card->coeffBuf = card->port[0].end_offset - NM_MAX_COEFFICIENT; - card->abuf2 = card->coeffBuf - card->recordBufferSize; - card->abuf1 = card->abuf2 - card->playbackBufferSize; - card->allCoeffBuf = card->abuf2 - (NM_TOTAL_COEFF_COUNT * 4); - - /* Fixed setting. */ - card->mixer = NM_MIXER_OFFSET; - card->mixer_values_init = 0; - - card->is_open_play = 0; - card->is_open_record = 0; - - card->coeffsCurrent = 0; - - card->opencnt[0] = 0; card->opencnt[1] = 0; - - /* Reasonable default settings, but largely unnecessary. */ - for (x = 0; x < 2; x++) { - card->sinfo[x].bits = 8; - card->sinfo[x].stereo = 0; - card->sinfo[x].samplerate = 8000; - } - - nm256_initHw (card); - - for (x = 0; x < 2; x++) { - if ((card->dev[x] = - sound_install_audiodrv(AUDIO_DRIVER_VERSION, - "NM256", &nm256_audio_driver, - sizeof(struct audio_driver), - DMA_NODMA, AFMT_U8 | AFMT_S16_LE, - NULL, -1, -1)) >= 0) { - /* 1K minimum buffer size. */ - audio_devs[card->dev[x]]->min_fragment = 10; - /* Maximum of 8K buffer size. */ - audio_devs[card->dev[x]]->max_fragment = 13; - } - else { - printk(KERN_ERR "NM256: Too many PCM devices available\n"); - nm256_release_ports (card); - kfree (card); - return 0; - } - } - - pci_set_drvdata(pcidev,card); - - /* Insert the card in the list. */ - card->next_card = nmcard_list; - nmcard_list = card; - - printk(KERN_INFO "Initialized NeoMagic %s audio in PCI native mode\n", - verstr); - - /* - * And our mixer. (We should allow support for other mixers, maybe.) - */ - - nm256_install_mixer (card); - - return 1; -} - - -static int __devinit -nm256_probe(struct pci_dev *pcidev,const struct pci_device_id *pciid) -{ - if (pcidev->device == PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO) - return nm256_install(pcidev, REV_NM256AV, "256AV"); - if (pcidev->device == PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO) - return nm256_install(pcidev, REV_NM256ZX, "256ZX"); - if (pcidev->device == PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO) - return nm256_install(pcidev, REV_NM256ZX, "256XL+"); - return -1; /* should not come here ... */ -} - -static void __devinit -nm256_remove(struct pci_dev *pcidev) { - struct nm256_info *xcard = pci_get_drvdata(pcidev); - struct nm256_info *card,*next_card = NULL; - - for (card = nmcard_list; card != NULL; card = next_card) { - next_card = card->next_card; - if (card == xcard) { - stopPlay (card); - stopRecord (card); - if (card->has_irq) - free_irq (card->irq, card); - nm256_release_ports (card); - sound_unload_mixerdev (card->mixer_oss_dev); - sound_unload_audiodev (card->dev[0]); - sound_unload_audiodev (card->dev[1]); - kfree (card); - break; - } - } - if (nmcard_list == card) - nmcard_list = next_card; -} - -/* - * Open the device - * - * DEV - device - * MODE - mode to open device (logical OR of OPEN_READ and OPEN_WRITE) - * - * Called when opening the DMAbuf (dmabuf.c:259) - */ -static int -nm256_audio_open(int dev, int mode) -{ - struct nm256_info *card = nm256_find_card (dev); - int w; - - if (card == NULL) - return -ENODEV; - - if (card->dev[0] == dev) - w = 0; - else if (card->dev[1] == dev) - w = 1; - else - return -ENODEV; - - if (card->opencnt[w] > 0) - return -EBUSY; - - /* No bits set? Huh? */ - if (! ((mode & OPEN_READ) || (mode & OPEN_WRITE))) - return -EIO; - - /* - * If it's open for both read and write, and the card's currently - * being read or written to, then do the opposite of what has - * already been done. Otherwise, don't specify any mode until the - * user actually tries to do I/O. (Some programs open the device - * for both read and write, but only actually do reading or writing.) - */ - - if ((mode & OPEN_WRITE) && (mode & OPEN_READ)) { - if (card->is_open_play) - mode = OPEN_WRITE; - else if (card->is_open_record) - mode = OPEN_READ; - else mode = 0; - } - - if (mode & OPEN_WRITE) { - if (card->is_open_play == 0) { - card->dev_for_play = dev; - card->is_open_play = 1; - } - else - return -EBUSY; - } - - if (mode & OPEN_READ) { - if (card->is_open_record == 0) { - card->dev_for_record = dev; - card->is_open_record = 1; - } - else - return -EBUSY; - } - - card->opencnt[w]++; - return 0; -} - -/* - * Close the device - * - * DEV - device - * - * Called when closing the DMAbuf (dmabuf.c:477) - * after halt_xfer - */ -static void -nm256_audio_close(int dev) -{ - struct nm256_info *card = nm256_find_card (dev); - - if (card != NULL) { - int w; - - if (card->dev[0] == dev) - w = 0; - else if (card->dev[1] == dev) - w = 1; - else - return; - - card->opencnt[w]--; - if (card->opencnt[w] <= 0) { - card->opencnt[w] = 0; - - if (card->dev_for_play == dev) { - stopPlay (card); - card->is_open_play = 0; - card->dev_for_play = -1; - } - - if (card->dev_for_record == dev) { - stopRecord (card); - card->is_open_record = 0; - card->dev_for_record = -1; - } - } - } -} - -/* Standard ioctl handler. */ -static int -nm256_audio_ioctl(int dev, unsigned int cmd, void __user *arg) -{ - int ret; - u32 oldinfo; - int w; - - struct nm256_info *card = nm256_find_card (dev); - - if (card == NULL) - return -ENODEV; - - if (dev == card->dev[0]) - w = 0; - else - w = 1; - - /* - * The code here is messy. There are probably better ways to do - * it. (It should be possible to handle it the same way the AC97 mixer - * is done.) - */ - switch (cmd) - { - case SOUND_PCM_WRITE_RATE: - if (get_user(ret, (int __user *) arg)) - return -EFAULT; - - if (ret != 0) { - oldinfo = card->sinfo[w].samplerate; - card->sinfo[w].samplerate = ret; - ret = nm256_setInfo(dev, card); - if (ret != 0) - card->sinfo[w].samplerate = oldinfo; - } - if (ret == 0) - ret = card->sinfo[w].samplerate; - break; - - case SOUND_PCM_READ_RATE: - ret = card->sinfo[w].samplerate; - break; - - case SNDCTL_DSP_STEREO: - if (get_user(ret, (int __user *) arg)) - return -EFAULT; - - card->sinfo[w].stereo = ret ? 1 : 0; - ret = nm256_setInfo (dev, card); - if (ret == 0) - ret = card->sinfo[w].stereo; - - break; - - case SOUND_PCM_WRITE_CHANNELS: - if (get_user(ret, (int __user *) arg)) - return -EFAULT; - - if (ret < 1 || ret > 3) - ret = card->sinfo[w].stereo + 1; - else { - card->sinfo[w].stereo = ret - 1; - ret = nm256_setInfo (dev, card); - if (ret == 0) - ret = card->sinfo[w].stereo + 1; - } - break; - - case SOUND_PCM_READ_CHANNELS: - ret = card->sinfo[w].stereo + 1; - break; - - case SNDCTL_DSP_SETFMT: - if (get_user(ret, (int __user *) arg)) - return -EFAULT; - - if (ret != 0) { - oldinfo = card->sinfo[w].bits; - card->sinfo[w].bits = ret; - ret = nm256_setInfo (dev, card); - if (ret != 0) - card->sinfo[w].bits = oldinfo; - } - if (ret == 0) - ret = card->sinfo[w].bits; - break; - - case SOUND_PCM_READ_BITS: - ret = card->sinfo[w].bits; - break; - - default: - return -EINVAL; - } - return put_user(ret, (int __user *) arg); -} - -/* - * Given the sound device DEV and an associated physical buffer PHYSBUF, - * return a pointer to the actual buffer in kernel space. - * - * This routine should exist as part of the soundcore routines. - */ - -static char * -nm256_getDMAbuffer (int dev, unsigned long physbuf) -{ - struct audio_operations *adev = audio_devs[dev]; - struct dma_buffparms *dmap = adev->dmap_out; - char *dma_start = - (char *)(physbuf - (unsigned long)dmap->raw_buf_phys - + (unsigned long)dmap->raw_buf); - - return dma_start; -} - - -/* - * Output a block to sound device - * - * dev - device number - * buf - physical address of buffer - * total_count - total byte count in buffer - * intrflag - set if this has been called from an interrupt - * (via DMAbuf_outputintr) - * restart_dma - set if engine needs to be re-initialised - * - * Called when: - * 1. Starting output (dmabuf.c:1327) - * 2. (dmabuf.c:1504) - * 3. A new buffer needs to be sent to the device (dmabuf.c:1579) - */ -static void -nm256_audio_output_block(int dev, unsigned long physbuf, - int total_count, int intrflag) -{ - struct nm256_info *card = nm256_find_card (dev); - - if (card != NULL) { - char *dma_buf = nm256_getDMAbuffer (dev, physbuf); - card->is_open_play = 1; - card->dev_for_play = dev; - nm256_write_block (card, dma_buf, total_count); - } -} - -/* Ditto, but do recording instead. */ -static void -nm256_audio_start_input(int dev, unsigned long physbuf, int count, - int intrflag) -{ - struct nm256_info *card = nm256_find_card (dev); - - if (card != NULL) { - char *dma_buf = nm256_getDMAbuffer (dev, physbuf); - card->is_open_record = 1; - card->dev_for_record = dev; - nm256_startRecording (card, dma_buf, count); - } -} - -/* - * Prepare for inputting samples to DEV. - * Each requested buffer will be BSIZE byes long, with a total of - * BCOUNT buffers. - */ - -static int -nm256_audio_prepare_for_input(int dev, int bsize, int bcount) -{ - struct nm256_info *card = nm256_find_card (dev); - - if (card == NULL) - return -ENODEV; - - if (card->is_open_record && card->dev_for_record != dev) - return -EBUSY; - - audio_devs[dev]->dmap_in->flags |= DMA_NODMA; - return 0; -} - -/* - * Prepare for outputting samples to `dev' - * - * Each buffer that will be passed will be `bsize' bytes long, - * with a total of `bcount' buffers. - * - * Called when: - * 1. A trigger enables audio output (dmabuf.c:978) - * 2. We get a write buffer without dma_mode setup (dmabuf.c:1152) - * 3. We restart a transfer (dmabuf.c:1324) - */ - -static int -nm256_audio_prepare_for_output(int dev, int bsize, int bcount) -{ - struct nm256_info *card = nm256_find_card (dev); - - if (card == NULL) - return -ENODEV; - - if (card->is_open_play && card->dev_for_play != dev) - return -EBUSY; - - audio_devs[dev]->dmap_out->flags |= DMA_NODMA; - return 0; -} - -/* Stop the current operations associated with DEV. */ -static void -nm256_audio_reset(int dev) -{ - struct nm256_info *card = nm256_find_card (dev); - - if (card != NULL) { - if (card->dev_for_play == dev) - stopPlay (card); - if (card->dev_for_record == dev) - stopRecord (card); - } -} - -static int -nm256_audio_local_qlen(int dev) -{ - return 0; -} - -static struct audio_driver nm256_audio_driver = -{ - .owner = THIS_MODULE, - .open = nm256_audio_open, - .close = nm256_audio_close, - .output_block = nm256_audio_output_block, - .start_input = nm256_audio_start_input, - .ioctl = nm256_audio_ioctl, - .prepare_for_input = nm256_audio_prepare_for_input, - .prepare_for_output = nm256_audio_prepare_for_output, - .halt_io = nm256_audio_reset, - .local_qlen = nm256_audio_local_qlen, -}; - -static struct pci_device_id nm256_pci_tbl[] = { - {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO, - PCI_ANY_ID, PCI_ANY_ID, 0, 0}, - {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO, - PCI_ANY_ID, PCI_ANY_ID, 0, 0}, - {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO, - PCI_ANY_ID, PCI_ANY_ID, 0, 0}, - {0,} -}; -MODULE_DEVICE_TABLE(pci, nm256_pci_tbl); -MODULE_LICENSE("GPL"); - - -static struct pci_driver nm256_pci_driver = { - .name = "nm256_audio", - .id_table = nm256_pci_tbl, - .probe = nm256_probe, - .remove = nm256_remove, -}; - -module_param(usecache, bool, 0); -module_param(buffertop, int, 0); -module_param(nm256_debug, bool, 0644); -module_param(force_load, bool, 0); - -static int __init do_init_nm256(void) -{ - printk (KERN_INFO "NeoMagic 256AV/256ZX audio driver, version 1.1p\n"); - return pci_register_driver(&nm256_pci_driver); -} - -static void __exit cleanup_nm256 (void) -{ - pci_unregister_driver(&nm256_pci_driver); -} - -module_init(do_init_nm256); -module_exit(cleanup_nm256); - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/sound/oss/nm256_coeff.h b/sound/oss/nm256_coeff.h deleted file mode 100644 index 6fc07f3cb33..00000000000 --- a/sound/oss/nm256_coeff.h +++ /dev/null @@ -1,4697 +0,0 @@ -#ifndef NM256_COEFF_H -#define NM256_COEFF_H - -#define NM_TOTAL_COEFF_COUNT 0x3158 - -static char coefficients[NM_TOTAL_COEFF_COUNT * 4] = { - 0xFF, 0xFF, 0x2F, 0x00, 0x4B, 0xFF, 0xA5, 0x01, 0xEF, 0xFC, 0x21, - 0x05, 0x87, 0xF7, 0x62, 0x11, 0xE9, 0x45, 0x5E, 0xF9, 0xB5, 0x01, - 0xDE, 0xFF, 0xA4, 0xFF, 0x60, 0x00, 0xCA, 0xFF, 0x0D, 0x00, 0xFD, - 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3D, 0xFC, 0xD6, 0x06, - 0x4C, 0xF3, 0xED, 0x20, 0x3D, 0x3D, 0x4A, 0xF3, 0x4E, 0x05, 0xB1, - 0xFD, 0xE1, 0x00, 0xC3, 0xFF, 0x05, 0x00, 0x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FF, 0x98, 0x01, 0x93, - 0xF9, 0x10, 0x46, 0x03, 0x11, 0xA7, 0xF7, 0x12, 0x05, 0xF6, 0xFC, - 0xA2, 0x01, 0x4C, 0xFF, 0x2F, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x26, - 0x00, 0x6A, 0xFF, 0x53, 0x01, 0xA6, 0xFD, 0xA6, 0x03, 0xA1, 0xFA, - 0xDE, 0x08, 0x76, 0x48, 0x0C, 0xFF, 0xDE, 0xFE, 0x73, 0x01, 0xC9, - 0xFE, 0xCA, 0x00, 0xA0, 0xFF, 0x17, 0x00, 0xFE, 0xFF, 0x36, 0x00, - 0x36, 0xFF, 0xE1, 0x01, 0x52, 0xFC, 0x93, 0x06, 0x10, 0xF4, 0x78, - 0x1D, 0x90, 0x3F, 0x3E, 0xF4, 0xAA, 0x04, 0x19, 0xFE, 0xA4, 0x00, - 0xE2, 0xFF, 0xFA, 0xFF, 0x03, 0x00, 0xFD, 0xFF, 0x26, 0x00, 0x68, - 0xFF, 0x93, 0x01, 0x92, 0xFC, 0xE2, 0x06, 0x83, 0xF1, 0x8C, 0x32, - 0xED, 0x2D, 0x90, 0xF1, 0x1E, 0x07, 0x57, 0xFC, 0xBD, 0x01, 0x51, - 0xFF, 0x2E, 0x00, 0xFD, 0xFF, 0x07, 0x00, 0xE8, 0xFF, 0x12, 0x00, - 0x42, 0x00, 0xC4, 0xFE, 0x94, 0x03, 0x02, 0xF6, 0x89, 0x42, 0x76, - 0x18, 0x5C, 0xF5, 0x12, 0x06, 0x84, 0xFC, 0xD1, 0x01, 0x3B, 0xFF, - 0x34, 0x00, 0xFE, 0xFF, 0x1D, 0x00, 0x8A, 0xFF, 0x03, 0x01, 0x53, - 0xFE, 0x53, 0x02, 0x39, 0xFD, 0xA9, 0x02, 0xF2, 0x48, 0xB9, 0x04, - 0x54, 0xFC, 0xCA, 0x02, 0x16, 0xFE, 0x20, 0x01, 0x7F, 0xFF, 0x20, - 0x00, 0x00, 0x00, 0xFF, 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, 0xFD, - 0x10, 0x01, 0xAB, 0xFF, 0x0E, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x19, - 0x00, 0x8E, 0xFF, 0x49, 0x01, 0x04, 0xFD, 0x4D, 0x06, 0x00, 0xF2, - 0xFE, 0x37, 0xCB, 0x27, 0x21, 0xF2, 0x23, 0x07, 0x34, 0xFC, 0xDD, - 0x01, 0x3F, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x0C, 0x00, 0xCE, 0xFF, - 0x56, 0x00, 0xB9, 0xFF, 0xB8, 0xFF, 0xF7, 0x01, 0xE2, 0xF8, 0x8D, - 0x45, 0x46, 0x12, 0x3C, 0xF7, 0x43, 0x05, 0xDF, 0xFC, 0xAC, 0x01, - 0x48, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x24, 0x00, 0x70, - 0xFF, 0x46, 0x01, 0xC3, 0xFD, 0x6D, 0x03, 0x14, 0xFB, 0xBE, 0x07, - 0xA6, 0x48, 0xF8, 0xFF, 0x70, 0xFE, 0xAE, 0x01, 0xAA, 0xFE, 0xD9, - 0x00, 0x9A, 0xFF, 0x19, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x37, 0xFF, - 0xDE, 0x01, 0x5D, 0xFC, 0x74, 0x06, 0x63, 0xF4, 0x23, 0x1C, 0x66, - 0x40, 0xAA, 0xF4, 0x65, 0x04, 0x44, 0xFE, 0x8B, 0x00, 0xEE, 0xFF, - 0xF5, 0xFF, 0x04, 0x00, 0xFD, 0xFF, 0x29, 0x00, 0x61, 0xFF, 0x9F, - 0x01, 0x80, 0xFC, 0xF7, 0x06, 0x7D, 0xF1, 0x5A, 0x31, 0x2C, 0x2F, - 0x83, 0xF1, 0x13, 0x07, 0x64, 0xFC, 0xB3, 0x01, 0x57, 0xFF, 0x2C, - 0x00, 0xFD, 0xFF, 0x06, 0x00, 0xED, 0xFF, 0x05, 0x00, 0x5D, 0x00, - 0x95, 0xFE, 0xE2, 0x03, 0x7F, 0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x00, 0x58, 0xFF, 0x82, 0x01, 0x3F, 0xFD, 0x78, 0x04, 0xF2, 0xF8, - 0x50, 0x0D, 0x5E, 0x47, 0xD5, 0xFB, 0x6F, 0x00, 0x96, 0x00, 0x40, - 0xFF, 0x91, 0x00, 0xB7, 0xFF, 0x12, 0x00, 0xFD, 0xFF, 0x36, 0x00, - 0x37, 0xFF, 0xE6, 0x01, 0x36, 0xFC, 0xEF, 0x06, 0xFC, 0xF2, 0x81, - 0x22, 0x1C, 0x3C, 0xEC, 0xF2, 0x90, 0x05, 0x85, 0xFD, 0xFB, 0x00, - 0xB6, 0xFF, 0x0A, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x1C, 0x00, 0x85, - 0xFF, 0x5B, 0x01, 0xE9, 0xFC, 0x73, 0x06, 0xD8, 0xF1, 0xE5, 0x36, - 0x19, 0x29, 0xF8, 0xF1, 0x29, 0x07, 0x37, 0xFC, 0xD8, 0x01, 0x42, - 0xFF, 0x33, 0x00, 0xFD, 0xFF, 0x0B, 0x00, 0xD3, 0xFF, 0x47, 0x00, - 0xD7, 0xFF, 0x82, 0xFF, 0x53, 0x02, 0x39, 0xF8, 0xFD, 0x44, 0x8D, - 0x13, 0xD3, 0xF6, 0x72, 0x05, 0xCA, 0xFC, 0xB5, 0x01, 0x45, 0xFF, - 0x31, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x23, 0x00, 0x75, 0xFF, 0x39, - 0x01, 0xE0, 0xFD, 0x33, 0x03, 0x87, 0xFB, 0xA2, 0x06, 0xCB, 0x48, - 0xEA, 0x00, 0x01, 0xFE, 0xE9, 0x01, 0x8A, 0xFE, 0xE8, 0x00, 0x95, - 0xFF, 0x1A, 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x38, 0xFF, 0xDA, 0x01, - 0x6A, 0xFC, 0x53, 0x06, 0xBA, 0xF4, 0xCE, 0x1A, 0x32, 0x41, 0x1F, - 0xF5, 0x1D, 0x04, 0x71, 0xFE, 0x71, 0x00, 0x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 0x2B, 0xB6, 0xF1, - 0x29, 0x07, 0x45, 0xFC, 0xCB, 0x01, 0x49, 0xFF, 0x31, 0x00, 0xFD, - 0xFF, 0x09, 0x00, 0xDE, 0xFF, 0x2B, 0x00, 0x11, 0x00, 0x1B, 0xFF, - 0x02, 0x03, 0xFE, 0xF6, 0xC3, 0x43, 0x22, 0x16, 0x07, 0xF6, 0xCA, - 0x05, 0xA3, 0xFC, 0xC5, 0x01, 0x3F, 0xFF, 0x33, 0x00, 0xFF, 0xFF, - 0x00, 0x00, 0x20, 0x00, 0x80, 0xFF, 0x1C, 0x01, 0x1C, 0xFE, 0xBD, - 0x02, 0x6E, 0xFC, 0x7D, 0x04, 0xF3, 0x48, 0xE2, 0x02, 0x1F, 0xFD, - 0x60, 0x02, 0x4C, 0xFE, 0x06, 0x01, 0x89, 0xFF, 0x1D, 0x00, 0xFE, - 0xFF, 0x34, 0x00, 0x3C, 0xFF, 0xCF, 0x01, 0x88, 0xFC, 0x09, 0x06, - 0x71, 0xF5, 0x2B, 0x18, 0xB2, 0x42, 0x20, 0xF6, 0x83, 0x03, 0xCF, - 0xFE, 0x3C, 0x00, 0x15, 0x00, 0xE6, 0xFF, 0x07, 0x00, 0xFD, 0xFF, - 0x2E, 0x00, 0x50, 0xFF, 0xBF, 0x01, 0x54, 0xFC, 0x20, 0x07, 0x94, - 0xF1, 0xA6, 0x2D, 0xD0, 0x32, 0x85, 0xF1, 0xDD, 0x06, 0x96, 0xFC, - 0x90, 0x01, 0x69, 0xFF, 0x26, 0x00, 0xFD, 0xFF, 0x03, 0x00, 0xFB, - 0xFF, 0xDF, 0xFF, 0xA9, 0x00, 0x10, 0xFE, 0xB9, 0x04, 0x27, 0xF4, - 0x5E, 0x3F, 0xC3, 0x1D, 0xFE, 0xF3, 0x99, 0x06, 0x50, 0xFC, 0xE2, - 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x17, 0x00, 0xA2, 0xFF, - 0xC7, 0x00, 0xD0, 0xFE, 0x65, 0x01, 0xF6, 0xFE, 0xD9, 0xFE, 0x6A, - 0x48, 0x1F, 0x09, 0x87, 0xFA, 0xB3, 0x03, 0xA0, 0xFD, 0x56, 0x01, - 0x69, 0xFF, 0x26, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2F, 0x00, 0x4D, - 0xFF, 0xA0, 0x01, 0xFB, 0xFC, 0x07, 0x05, 0xBF, 0xF7, 0xBB, 0x10, - 0x2B, 0x46, 0xBB, 0xF9, 0x83, 0x01, 0xFA, 0xFF, 0x95, 0xFF, 0x68, - 0x00, 0xC7, 0xFF, 0x0E, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3C, 0xFF, - 0xE1, 0x01, 0x31, 0xFC, 0x19, 0x07, 0x5B, 0xF2, 0x30, 0x26, 0x4B, - 0x39, 0x3B, 0xF2, 0x1A, 0x06, 0x29, 0xFD, 0x33, 0x01, 0x99, 0xFF, - 0x15, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x13, 0x00, 0x9F, 0xFF, 0x28, - 0x01, 0x3A, 0xFD, 0x00, 0x06, 0x5A, 0xF2, 0xDF, 0x39, 0x73, 0x25, - 0x79, 0xF2, 0x12, 0x07, 0x31, 0xFC, 0xE3, 0x01, 0x3B, 0xFF, 0x35, - 0x00, 0xFD, 0xFF, 0x0F, 0x00, 0xC4, 0xFF, 0x70, 0x00, 0x84, 0xFF, - 0x19, 0x00, 0x4D, 0x01, 0x22, 0xFA, 0x70, 0x46, 0x0A, 0x10, 0xFC, - 0xF7, 0xEB, 0x04, 0x08, 0xFD, 0x9A, 0x01, 0x4F, 0xFF, 0x2E, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0x27, 0x00, 0x66, 0xFF, 0x5E, 0x01, 0x90, - 0xFD, 0xD2, 0x03, 0x47, 0xFA, 0xC3, 0x09, 0x48, 0x48, 0x5A, 0xFE, - 0x33, 0xFF, 0x45, 0x01, 0xE2, 0xFE, 0xBE, 0x00, 0xA5, 0xFF, 0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A, - 0x05, 0x6A, 0xFD, 0x0B, 0x01, 0xAE, 0xFF, 0x0D, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x19, 0x00, 0x8C, 0xFF, 0x4D, 0x01, 0xFE, 0xFC, 0x56, - 0x06, 0xF7, 0xF1, 0xBF, 0x37, 0x15, 0x28, 0x18, 0xF2, 0x25, 0x07, - 0x34, 0xFC, 0xDC, 0x01, 0x3F, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x0C, - 0x00, 0xCF, 0xFF, 0x52, 0x00, 0xC0, 0xFF, 0xAC, 0xFF, 0x0C, 0x02, - 0xBC, 0xF8, 0x6D, 0x45, 0x8E, 0x12, 0x24, 0xF7, 0x4D, 0x05, 0xDB, - 0xFC, 0xAE, 0x01, 0x48, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0x00, 0x00, - 0x24, 0x00, 0x71, 0xFF, 0x43, 0x01, 0xC9, 0xFD, 0x60, 0x03, 0x2E, - 0xFB, 0x7E, 0x07, 0xAF, 0x48, 0x2D, 0x00, 0x58, 0xFE, 0xBB, 0x01, - 0xA3, 0xFE, 0xDD, 0x00, 0x99, 0xFF, 0x19, 0x00, 0xFE, 0xFF, 0x36, - 0x00, 0x37, 0xFF, 0xDD, 0x01, 0x60, 0xFC, 0x6D, 0x06, 0x76, 0xF4, - 0xD8, 0x1B, 0x95, 0x40, 0xC3, 0xF4, 0x56, 0x04, 0x4E, 0xFE, 0x85, - 0x00, 0xF1, 0xFF, 0xF4, 0xFF, 0x04, 0x00, 0xFD, 0xFF, 0x29, 0x00, - 0x60, 0xFF, 0xA2, 0x01, 0x7C, 0xFC, 0xFB, 0x06, 0x7C, 0xF1, 0x15, - 0x31, 0x73, 0x2F, 0x81, 0xF1, 0x10, 0x07, 0x67, 0xFC, 0xB1, 0x01, - 0x58, 0xFF, 0x2C, 0x00, 0xFD, 0xFF, 0x06, 0x00, 0xEE, 0xFF, 0x02, - 0x00, 0x63, 0x00, 0x8A, 0xFE, 0xF3, 0x03, 0x63, 0xF5, 0xA1, 0x41, - 0x12, 0x1A, 0xEB, 0xF4, 0x3F, 0x06, 0x72, 0xFC, 0xD7, 0x01, 0x39, - 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1B, 0x00, 0x91, 0xFF, 0xF1, 0x00, - 0x79, 0xFE, 0x0A, 0x02, 0xC3, 0xFD, 0x73, 0x01, 0xDB, 0x48, 0x07, - 0x06, 0xC7, 0xFB, 0x12, 0x03, 0xF1, 0xFD, 0x31, 0x01, 0x78, 0xFF, - 0x22, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x32, 0x00, 0x43, 0xFF, 0xBA, - 0x01, 0xBF, 0xFC, 0x8B, 0x05, 0x99, 0xF6, 0x43, 0x14, 0xA9, 0x44, - 0xDE, 0xF7, 0x85, 0x02, 0x65, 0xFF, 0xE7, 0xFF, 0x3F, 0x00, 0xD6, - 0xFF, 0x0A, 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x44, 0xFF, 0xD5, 0x01, - 0x3A, 0xFC, 0x2A, 0x07, 0xE3, 0xF1, 0xD1, 0x29, 0x46, 0x36, 0xC5, - 0xF1, 0x87, 0x06, 0xDA, 0xFC, 0x64, 0x01, 0x80, 0xFF, 0x1E, 0x00, - 0xFE, 0xFF, 0x01, 0x00, 0x08, 0x00, 0xBC, 0xFF, 0xEF, 0x00, 0x9A, - 0xFD, 0x72, 0x05, 0x16, 0xF3, 0xA5, 0x3C, 0xC4, 0x21, 0x21, 0xF3, - 0xE4, 0x06, 0x39, 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, - 0xFF, 0x12, 0x00, 0xB3, 0xFF, 0x99, 0x00, 0x2E, 0xFF, 0xB6, 0x00, - 0x36, 0x00, 0x47, 0xFC, 0x90, 0x47, 0xA4, 0x0C, 0x31, 0xF9, 0x5A, - 0x04, 0x4E, 0xFD, 0x7C, 0x01, 0x5B, 0xFF, 0x2A, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x2B, 0x00, 0x59, 0xFF, 0x80, 0x01, 0x45, 0xFD, 0x6C, - 0x04, 0x0B, 0xF9, 0x0B, 0x0D, 0x73, 0x47, 0x02, 0xFC, 0x58, 0x00, - 0xA3, 0x00, 0x39, 0xFF, 0x94, 0x00, 0xB5, 0xFF, 0x12, 0x00, 0xFD, - 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x37, 0xFC, 0xEB, 0x06, - 0x0B, 0xF3, 0x35, 0x22, 0x52, 0x3C, 0xFD, 0xF2, 0x84, 0x05, 0x8D, - 0xFD, 0xF6, 0x00, 0xB8, 0xFF, 0x09, 0x00, 0x01, 0x00, 0xFE, 0xFF, - 0x1D, 0x00, 0x83, 0xFF, 0x5E, 0x01, 0xE3, 0xFC, 0x7B, 0x06, 0xD0, - 0xF1, 0xA5, 0x36, 0x62, 0x29, 0xEF, 0xF1, 0x29, 0x07, 0x39, 0xFC, - 0xD7, 0x01, 0x42, 0xFF, 0x33, 0x00, 0xFD, 0xFF, 0x0B, 0x00, 0xD5, - 0xFF, 0x44, 0x00, 0xDD, 0xFF, 0x77, 0xFF, 0x67, 0x02, 0x14, 0xF8, - 0xDC, 0x44, 0xD5, 0x13, 0xBC, 0xF6, 0x7C, 0x05, 0xC5, 0xFC, 0xB7, - 0x01, 0x44, 0xFF, 0x31, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x22, 0x00, - 0x76, 0xFF, 0x35, 0x01, 0xE7, 0xFD, 0x26, 0x03, 0xA1, 0xFB, 0x64, - 0x06, 0xD2, 0x48, 0x21, 0x01, 0xE8, 0xFD, 0xF7, 0x01, 0x83, 0xFE, - 0xEC, 0x00, 0x93, 0xFF, 0x1A, 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x39, - 0xFF, 0xD9, 0x01, 0x6D, 0xFC, 0x4B, 0x06, 0xCD, 0xF4, 0x83, 0x1A, - 0x5F, 0x41, 0x3A, 0xF5, 0x0C, 0x04, 0x7B, 0xFE, 0x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0xFF, 0x5C, 0x00, 0xCB, 0xFF, 0x0D, 0x00, 0xFD, - 0xFF, 0x34, 0x00, 0x3E, 0xFF, 0xDF, 0x01, 0x33, 0xFC, 0x20, 0x07, - 0x35, 0xF2, 0x36, 0x27, 0x78, 0x38, 0x14, 0xF2, 0x3B, 0x06, 0x11, - 0xFD, 0x41, 0x01, 0x92, 0xFF, 0x17, 0x00, 0xFF, 0xFF, 0x00, 0x00, - 0x10, 0x00, 0xA7, 0xFF, 0x19, 0x01, 0x53, 0xFD, 0xDB, 0x05, 0x88, - 0xF2, 0xAD, 0x3A, 0x6D, 0x24, 0xA4, 0xF2, 0x08, 0x07, 0x32, 0xFC, - 0xE5, 0x01, 0x39, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x10, 0x00, 0xBF, - 0xFF, 0x7B, 0x00, 0x6C, 0xFF, 0x44, 0x00, 0x01, 0x01, 0xB6, 0xFA, - 0xC8, 0x46, 0x13, 0x0F, 0x51, 0xF8, 0xC4, 0x04, 0x1B, 0xFD, 0x92, - 0x01, 0x52, 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x28, 0x00, - 0x63, 0xFF, 0x67, 0x01, 0x7A, 0xFD, 0xFE, 0x03, 0xEE, 0xF9, 0xAA, - 0x0A, 0x16, 0x48, 0xAC, 0xFD, 0x86, 0xFF, 0x17, 0x01, 0xFA, 0xFE, - 0xB3, 0x00, 0xAA, 0xFF, 0x15, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, - 0xFF, 0xE5, 0x01, 0x44, 0xFC, 0xBD, 0x06, 0x97, 0xF3, 0x8A, 0x1F, - 0x31, 0x3E, 0xA5, 0xF3, 0x0F, 0x05, 0xDA, 0xFD, 0xC9, 0x00, 0xCF, - 0xFF, 0x01, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x22, 0x00, 0x73, 0xFF, - 0x7D, 0x01, 0xB3, 0xFC, 0xBB, 0x06, 0x9A, 0xF1, 0x60, 0x34, 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0xD7, 0xFE, 0x58, 0x01, 0x0F, 0xFF, - 0xA6, 0xFE, 0x5D, 0x48, 0x61, 0x09, 0x6E, 0xFA, 0xC0, 0x03, 0x99, - 0xFD, 0x59, 0x01, 0x68, 0xFF, 0x26, 0x00, 0x00, 0x00, 0xFF, 0xFF, - 0x2E, 0x00, 0x4E, 0xFF, 0x9E, 0x01, 0x00, 0xFD, 0xFC, 0x04, 0xD7, - 0xF7, 0x75, 0x10, 0x48, 0x46, 0xE4, 0xF9, 0x6E, 0x01, 0x06, 0x00, - 0x8E, 0xFF, 0x6B, 0x00, 0xC6, 0xFF, 0x0E, 0x00, 0xFD, 0xFF, 0x35, - 0x00, 0x3B, 0xFF, 0xE2, 0x01, 0x31, 0xFC, 0x16, 0x07, 0x67, 0xF2, - 0xE5, 0x25, 0x87, 0x39, 0x47, 0xF2, 0x10, 0x06, 0x30, 0xFD, 0x2F, - 0x01, 0x9C, 0xFF, 0x14, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x13, 0x00, - 0x9D, 0xFF, 0x2D, 0x01, 0x33, 0xFD, 0x0B, 0x06, 0x4D, 0xF2, 0xA5, - 0x39, 0xBF, 0x25, 0x6D, 0xF2, 0x15, 0x07, 0x31, 0xFC, 0xE2, 0x01, - 0x3B, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x0E, 0x00, 0xC5, 0xFF, 0x6D, - 0x00, 0x8B, 0xFF, 0x0D, 0x00, 0x63, 0x01, 0xF9, 0xF9, 0x55, 0x46, - 0x51, 0x10, 0xE3, 0xF7, 0xF7, 0x04, 0x03, 0xFD, 0x9D, 0x01, 0x4E, - 0xFF, 0x2E, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x26, 0x00, 0x68, 0xFF, - 0x5B, 0x01, 0x96, 0xFD, 0xC6, 0x03, 0x61, 0xFA, 0x81, 0x09, 0x57, - 0x48, 0x8D, 0xFE, 0x1B, 0xFF, 0x52, 0x01, 0xDB, 0xFE, 0xC2, 0x00, - 0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 0x00, 0x00, 0x00, 0xFF, 0xFF, - 0x32, 0x00, 0x41, 0xFF, 0xC0, 0x01, 0xAF, 0xFC, 0xAD, 0x05, 0x4A, - 0xF6, 0x44, 0x15, 0x2F, 0x44, 0x64, 0xF7, 0xC9, 0x02, 0x3D, 0xFF, - 0xFE, 0xFF, 0x34, 0x00, 0xDB, 0xFF, 0x09, 0x00, 0xFD, 0xFF, 0x32, - 0x00, 0x47, 0xFF, 0xD0, 0x01, 0x40, 0xFC, 0x2A, 0x07, 0xCA, 0xF1, - 0xD1, 0x2A, 0x65, 0x35, 0xAE, 0xF1, 0xA0, 0x06, 0xC7, 0xFC, 0x70, - 0x01, 0x7A, 0xFF, 0x20, 0x00, 0xFE, 0xFF, 0x02, 0x00, 0x05, 0x00, - 0xC5, 0xFF, 0xDE, 0x00, 0xB7, 0xFD, 0x45, 0x05, 0x56, 0xF3, 0x61, - 0x3D, 0xBA, 0x20, 0x56, 0xF3, 0xD3, 0x06, 0x3E, 0xFC, 0xE6, 0x01, - 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x13, 0x00, 0xAF, 0xFF, 0xA5, - 0x00, 0x16, 0xFF, 0xE3, 0x00, 0xE4, 0xFF, 0xEB, 0xFC, 0xD2, 0x47, - 0xB6, 0x0B, 0x89, 0xF9, 0x2F, 0x04, 0x62, 0xFD, 0x72, 0x01, 0x5E, - 0xFF, 0x29, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2C, 0x00, 0x56, 0xFF, - 0x88, 0x01, 0x31, 0xFD, 0x95, 0x04, 0xB4, 0xF8, 0xFC, 0x0D, 0x26, - 0x47, 0x64, 0xFB, 0xA7, 0x00, 0x77, 0x00, 0x51, 0xFF, 0x89, 0x00, - 0xBA, 0xFF, 0x11, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xE6, - 0x01, 0x34, 0xFC, 0xF9, 0x06, 0xD9, 0xF2, 0x3F, 0x23, 0x90, 0x3B, - 0xC4, 0xF2, 0xAE, 0x05, 0x72, 0xFD, 0x07, 0x01, 0xB0, 0xFF, 0x0C, - 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x1A, 0x00, 0x8A, 0xFF, 0x51, 0x01, - 0xF8, 0xFC, 0x5E, 0x06, 0xED, 0xF1, 0x82, 0x37, 0x60, 0x28, 0x0E, - 0xF2, 0x26, 0x07, 0x35, 0xFC, 0xDB, 0x01, 0x40, 0xFF, 0x34, 0x00, - 0xFD, 0xFF, 0x0C, 0x00, 0xD0, 0xFF, 0x4F, 0x00, 0xC7, 0xFF, 0xA0, - 0xFF, 0x20, 0x02, 0x96, 0xF8, 0x4E, 0x45, 0xD7, 0x12, 0x0D, 0xF7, - 0x58, 0x05, 0xD6, 0xFC, 0xB0, 0x01, 0x47, 0xFF, 0x30, 0x00, 0xFF, - 0xFF, 0x00, 0x00, 0x23, 0x00, 0x72, 0xFF, 0x40, 0x01, 0xD0, 0xFD, - 0x53, 0x03, 0x47, 0xFB, 0x3F, 0x07, 0xB8, 0x48, 0x62, 0x00, 0x3F, - 0xFE, 0xC8, 0x01, 0x9C, 0xFE, 0xE0, 0x00, 0x98, 0xFF, 0x19, 0x00, - 0xFE, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xDC, 0x01, 0x63, 0xFC, 0x66, - 0x06, 0x89, 0xF4, 0x8C, 0x1B, 0xC3, 0x40, 0xDD, 0xF4, 0x46, 0x04, - 0x58, 0xFE, 0x80, 0x00, 0xF4, 0xFF, 0xF3, 0xFF, 0x05, 0x00, 0xFD, - 0xFF, 0x29, 0x00, 0x5F, 0xFF, 0xA5, 0x01, 0x78, 0xFC, 0xFF, 0x06, - 0x7D, 0xF1, 0xCF, 0x30, 0xB8, 0x2F, 0x80, 0xF1, 0x0D, 0x07, 0x6A, - 0xFC, 0xAE, 0x01, 0x59, 0xFF, 0x2B, 0x00, 0xFD, 0xFF, 0x05, 0x00, - 0xEF, 0xFF, 0xFF, 0xFF, 0x69, 0x00, 0x80, 0xFE, 0x04, 0x04, 0x48, - 0xF5, 0x74, 0x41, 0x5D, 0x1A, 0xD7, 0xF4, 0x47, 0x06, 0x6F, 0xFC, - 0xD8, 0x01, 0x39, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1B, 0x00, 0x93, - 0xFF, 0xED, 0x00, 0x80, 0xFE, 0xFD, 0x01, 0xDC, 0xFD, 0x3C, 0x01, - 0xD5, 0x48, 0x45, 0x06, 0xAE, 0xFB, 0x1F, 0x03, 0xEA, 0xFD, 0x34, - 0x01, 0x77, 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x31, 0x00, - 0x44, 0xFF, 0xB8, 0x01, 0xC3, 0xFC, 0x81, 0x05, 0xB0, 0xF6, 0xFA, - 0x13, 0xCC, 0x44, 0x02, 0xF8, 0x71, 0x02, 0x71, 0xFF, 0xE1, 0xFF, - 0x42, 0x00, 0xD5, 0xFF, 0x0B, 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x43, - 0xFF, 0xD6, 0x01, 0x39, 0xFC, 0x2A, 0x07, 0xEB, 0xF1, 0x87, 0x29, - 0x85, 0x36, 0xCC, 0xF1, 0x7F, 0x06, 0xE0, 0xFC, 0x60, 0x01, 0x82, - 0xFF, 0x1D, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x09, 0x00, 0xBA, 0xFF, - 0xF4, 0x00, 0x91, 0xFD, 0x7E, 0x05, 0x05, 0xF3, 0x6E, 0x3C, 0x10, - 0x22, 0x12, 0xF3, 0xE9, 0x06, 0x38, 0xFC, 0xE6, 0x01, 0x37, 0xFF, - 0x36, 0x00, 0xFD, 0xFF, 0x12, 0x00, 0xB5, 0xFF, 0x96, 0x00, 0x35, - 0xFF, 0xA9, 0x00, 0x4D, 0x00, 0x19, 0xFC, 0x7C, 0x47, 0xE8, 0x0C, - 0x18, 0xF9, 0x66, 0x04, 0x48, 0xFD, 0x7E, 0x01, 0x5A, 0xFF, 0x2B, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x5A, 0xFF, 0x7D, 0x01, - 0x4B, 0xFD, 0x60, 0x04, 0x24, 0xF9, 0xC6, 0x0C, 0x86, 0x47, 0x30, - 0xFC, 0x41, 0x00, 0xB0, 0x00, 0x32, 0xFF, 0x98, 0x00, 0xB4, 0xFF, - 0x12, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x38, - 0xFC, 0xE6, 0x06, 0x19, 0xF3, 0xEA, 0x21, 0x8A, 0x3C, 0x0E, 0xF3, - 0x78, 0x05, 0x96, 0xFD, 0xF1, 0x00, 0xBB, 0xFF, 0x08, 0x00, 0x01, - 0x00, 0xFE, 0xFF, 0x1D, 0x00, 0x81, 0xFF, 0x62, 0x01, 0xDD, 0xFC, - 0x83, 0x06, 0xC9, 0xF1, 0x66, 0x36, 0xAC, 0x29, 0xE7, 0xF1, 0x2A, - 0x07, 0x3A, 0xFC, 0xD5, 0x01, 0x43, 0xFF, 0x33, 0x00, 0xFD, 0xFF, - 0x0B, 0x00, 0xD6, 0xFF, 0x41, 0x00, 0xE4, 0xFF, 0x6B, 0xFF, 0x7B, - 0x02, 0xF0, 0xF7, 0xBA, 0x44, 0x1E, 0x14, 0xA5, 0xF6, 0x86, 0x05, - 0xC1, 0xFC, 0xB9, 0x01, 0x44, 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0x00, - 0x00, 0x22, 0x00, 0x77, 0xFF, 0x32, 0x01, 0xED, 0xFD, 0x19, 0x03, - 0xBB, 0xFB, 0x26, 0x06, 0xD7, 0x48, 0x58, 0x01, 0xCF, 0xFD, 0x04, - 0x02, 0x7D, 0xFE, 0xEF, 0x00, 0x92, 0xFF, 0x1B, 0x00, 0xFE, 0xFF, - 0x35, 0x00, 0x39, 0xFF, 0xD8, 0x01, 0x70, 0xFC, 0x43, 0x06, 0xE1, - 0xF4, 0x38, 0x1A, 0x8C, 0x41, 0x55, 0xF5, 0xFC, 0x03, 0x85, 0xFE, - 0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0x73, 0x3B, 0x64, 0x23, 0xD2, - 0xF2, 0xFB, 0x06, 0x34, 0xFC, 0xE6, 0x01, 0x38, 0xFF, 0x36, 0x00, - 0xFD, 0xFF, 0x11, 0x00, 0xBB, 0xFF, 0x87, 0x00, 0x54, 0xFF, 0x70, - 0x00, 0xB3, 0x00, 0x4E, 0xFB, 0x1A, 0x47, 0x1F, 0x0E, 0xA8, 0xF8, - 0x9B, 0x04, 0x2E, 0xFD, 0x8A, 0x01, 0x55, 0xFF, 0x2C, 0x00, 0xFF, - 0xFF, 0x00, 0x00, 0x29, 0x00, 0x5F, 0xFF, 0x71, 0x01, 0x65, 0xFD, - 0x29, 0x04, 0x96, 0xF9, 0x95, 0x0B, 0xDC, 0x47, 0x03, 0xFD, 0xD9, - 0xFF, 0xEA, 0x00, 0x12, 0xFF, 0xA7, 0x00, 0xAE, 0xFF, 0x14, 0x00, - 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3E, 0xFC, 0xD0, - 0x06, 0x5E, 0xF3, 0x94, 0x20, 0x7B, 0x3D, 0x60, 0xF3, 0x3E, 0x05, - 0xBB, 0xFD, 0xDB, 0x00, 0xC6, 0xFF, 0x04, 0x00, 0x02, 0x00, 0xFE, - 0xFF, 0x20, 0x00, 0x79, 0xFF, 0x72, 0x01, 0xC4, 0xFC, 0xA4, 0x06, - 0xAB, 0xF1, 0x46, 0x35, 0xF7, 0x2A, 0xC6, 0xF1, 0x2A, 0x07, 0x40, - 0xFC, 0xCF, 0x01, 0x47, 0xFF, 0x31, 0x00, 0xFD, 0xFF, 0x09, 0x00, - 0xDB, 0xFF, 0x33, 0x00, 0x01, 0x00, 0x38, 0xFF, 0xD3, 0x02, 0x53, - 0xF7, 0x1F, 0x44, 0x69, 0x15, 0x3F, 0xF6, 0xB2, 0x05, 0xAD, 0xFC, - 0xC1, 0x01, 0x41, 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x20, - 0x00, 0x7D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xFF, 0x5F, 0x00, 0xCA, 0xFF, - 0x0D, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3D, 0xFF, 0xDF, 0x01, 0x32, - 0xFC, 0x1E, 0x07, 0x40, 0xF2, 0xEB, 0x26, 0xB5, 0x38, 0x1F, 0xF2, - 0x32, 0x06, 0x18, 0xFD, 0x3D, 0x01, 0x94, 0xFF, 0x16, 0x00, 0xFF, - 0xFF, 0x00, 0x00, 0x11, 0x00, 0xA4, 0xFF, 0x1D, 0x01, 0x4C, 0xFD, - 0xE6, 0x05, 0x7B, 0xF2, 0x71, 0x3A, 0xB8, 0x24, 0x97, 0xF2, 0x0B, - 0x07, 0x32, 0xFC, 0xE4, 0x01, 0x39, 0xFF, 0x36, 0x00, 0xFD, 0xFF, - 0x0F, 0x00, 0xC0, 0xFF, 0x78, 0x00, 0x73, 0xFF, 0x38, 0x00, 0x17, - 0x01, 0x8B, 0xFA, 0xAF, 0x46, 0x59, 0x0F, 0x39, 0xF8, 0xCF, 0x04, - 0x15, 0xFD, 0x95, 0x01, 0x51, 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0x00, - 0x00, 0x28, 0x00, 0x64, 0xFF, 0x65, 0x01, 0x81, 0xFD, 0xF2, 0x03, - 0x08, 0xFA, 0x68, 0x0A, 0x25, 0x48, 0xDE, 0xFD, 0x6E, 0xFF, 0x24, - 0x01, 0xF3, 0xFE, 0xB6, 0x00, 0xA8, 0xFF, 0x15, 0x00, 0xFD, 0xFF, - 0x36, 0x00, 0x36, 0xFF, 0xE5, 0x01, 0x46, 0xFC, 0xB8, 0x06, 0xA8, - 0xF3, 0x3F, 0x1F, 0x64, 0x3E, 0xBA, 0xF3, 0x01, 0x05, 0xE2, 0xFD, - 0xC4, 0x00, 0xD2, 0xFF, 0x00, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x23, - 0x00, 0x71, 0xFF, 0x81, 0x01, 0xAE, 0xFC, 0xC1, 0x06, 0x95, 0xF1, - 0x1E, 0x34,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xC0, 0x00, 0xDE, 0xFE, 0x4B, - 0x01, 0x27, 0xFF, 0x73, 0xFE, 0x4F, 0x48, 0xA2, 0x09, 0x54, 0xFA, - 0xCC, 0x03, 0x93, 0xFD, 0x5C, 0x01, 0x67, 0xFF, 0x27, 0x00, 0x00, - 0x00, 0xFF, 0xFF, 0x2E, 0x00, 0x4E, 0xFF, 0x9C, 0x01, 0x05, 0xFD, - 0xF1, 0x04, 0xF0, 0xF7, 0x2D, 0x10, 0x61, 0x46, 0x0D, 0xFA, 0x58, - 0x01, 0x13, 0x00, 0x87, 0xFF, 0x6E, 0x00, 0xC4, 0xFF, 0x0E, 0x00, - 0xFD, 0xFF, 0x35, 0x00, 0x3B, 0xFF, 0xE3, 0x01, 0x31, 0xFC, 0x14, - 0x07, 0x73, 0xF2, 0x99, 0x25, 0xC2, 0x39, 0x54, 0xF2, 0x05, 0x06, - 0x37, 0xFD, 0x2B, 0x01, 0x9E, 0xFF, 0x13, 0x00, 0xFF, 0xFF, 0xFF, - 0xFF, 0x14, 0x00, 0x9B, 0xFF, 0x31, 0x01, 0x2C, 0xFD, 0x15, 0x06, - 0x41, 0xF2, 0x6A, 0x39, 0x0A, 0x26, 0x61, 0xF2, 0x17, 0x07, 0x31, - 0xFC, 0xE2, 0x01, 0x3B, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x0E, 0x00, - 0xC6, 0xFF, 0x69, 0x00, 0x91, 0xFF, 0x00, 0x00, 0x78, 0x01, 0xD0, - 0xF9, 0x39, 0x46, 0x98, 0x10, 0xCB, 0xF7, 0x02, 0x05, 0xFE, 0xFC, - 0x9F, 0x01, 0x4D, 0xFF, 0x2E, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x26, - 0x00, 0x69, 0xFF, 0x58, 0x01, 0x9D, 0xFD, 0xB9, 0x03, 0x7B, 0xFA, - 0x40, 0x09, 0x63, 0x48, 0xBF, 0xFE, 0x03, 0xFF, 0x5F, 0x01, 0xD4, - 0xFE, 0xC5, 0x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0x76, 0xFE, - 0x15, 0x04, 0x2C, 0xF5, 0x49, 0x41, 0xA9, 0x1A, 0xC3, 0xF4, 0x4F, - 0x06, 0x6C, 0xFC, 0xD9, 0x01, 0x38, 0xFF, 0x35, 0x00, 0xFE, 0xFF, - 0x1A, 0x00, 0x94, 0xFF, 0xEA, 0x00, 0x87, 0xFE, 0xF0, 0x01, 0xF5, - 0xFD, 0x05, 0x01, 0xCE, 0x48, 0x83, 0x06, 0x94, 0xFB, 0x2C, 0x03, - 0xE4, 0xFD, 0x37, 0x01, 0x76, 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFF, - 0xFF, 0x31, 0x00, 0x45, 0xFF, 0xB6, 0x01, 0xC8, 0xFC, 0x77, 0x05, - 0xC7, 0xF6, 0xB1, 0x13, 0xED, 0x44, 0x26, 0xF8, 0x5D, 0x02, 0x7D, - 0xFF, 0xDA, 0xFF, 0x46, 0x00, 0xD4, 0xFF, 0x0B, 0x00, 0xFD, 0xFF, - 0x33, 0x00, 0x42, 0xFF, 0xD7, 0x01, 0x38, 0xFC, 0x29, 0x07, 0xF3, - 0xF1, 0x3E, 0x29, 0xC6, 0x36, 0xD4, 0xF1, 0x77, 0x06, 0xE6, 0xFC, - 0x5C, 0x01, 0x84, 0xFF, 0x1C, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x0A, - 0x00, 0xB7, 0xFF, 0xF9, 0x00, 0x89, 0xFD, 0x8A, 0x05, 0xF4, 0xF2, - 0x37, 0x3C, 0x5B, 0x22, 0x03, 0xF3, 0xED, 0x06, 0x37, 0xFC, 0xE6, - 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x12, 0x00, 0xB6, 0xFF, - 0x93, 0x00, 0x3C, 0xFF, 0x9D, 0x00, 0x63, 0x00, 0xEB, 0xFB, 0x69, - 0x47, 0x2D, 0x0D, 0xFF, 0xF8, 0x72, 0x04, 0x42, 0xFD, 0x81, 0x01, - 0x59, 0xFF, 0x2B, 0x00, 0x00,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B, - 0x03, 0x90, 0xFE, 0x60, 0x00, 0x04, 0x00, 0xED, 0xFF, 0x06, 0x00, - 0xFD, 0xFF, 0x2C, 0x00, 0x57, 0xFF, 0xB2, 0x01, 0x65, 0xFC, 0x12, - 0x07, 0x82, 0xF1, 0x50, 0x2F, 0x38, 0x31, 0x7C, 0xF1, 0xF9, 0x06, - 0x7E, 0xFC, 0xA1, 0x01, 0x61, 0xFF, 0x29, 0x00, 0xFD, 0xFF, 0x04, - 0x00, 0xF5, 0xFF, 0xEF, 0xFF, 0x88, 0x00, 0x49, 0xFE, 0x5D, 0x04, - 0xB7, 0xF4, 0x7D, 0x40, 0xFD, 0x1B, 0x6C, 0xF4, 0x70, 0x06, 0x5F, - 0xFC, 0xDE, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x19, 0x00, - 0x9A, 0xFF, 0xDB, 0x00, 0xA6, 0xFE, 0xB4, 0x01, 0x64, 0xFE, 0x12, - 0x00, 0xAA, 0x48, 0x9E, 0x07, 0x21, 0xFB, 0x66, 0x03, 0xC6, 0xFD, - 0x45, 0x01, 0x70, 0xFF, 0x24, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x30, - 0x00, 0x48, 0xFF, 0xAD, 0x01, 0xDD, 0xFC, 0x48, 0x05, 0x30, 0xF7, - 0x6B, 0x12, 0x7D, 0x45, 0xCF, 0xF8, 0x01, 0x02, 0xB2, 0xFF, 0xBD, - 0xFF, 0x54, 0x00, 0xCE, 0xFF, 0x0C, 0x00, 0xFD, 0xFF, 0x34, 0x00, - 0x3F, 0xFF, 0xDC, 0x01, 0x34, 0xFC, 0x24, 0x07, 0x1C, 0xF2, 0xF0, - 0x27, 0xDF, 0x37, 0xFB, 0xF1, 0x51, 0x06, 0x01, 0xFD, 0x4B, 0x01, - 0x8D, 0xFF, 0x19, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x0E, 0x00, 0xAC, - 0xFF, 0x0E, 0x01, 0x66, 0xFD, 0xBF, 0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x00, 0x20, 0x00, 0x7E, 0xFF, 0x21, 0x01, 0x12, 0xFE, 0xD1, - 0x02, 0x47, 0xFC, 0xD7, 0x04, 0xF0, 0x48, 0x8D, 0x02, 0x45, 0xFD, - 0x4D, 0x02, 0x56, 0xFE, 0x01, 0x01, 0x8B, 0xFF, 0x1D, 0x00, 0xFE, - 0xFF, 0x34, 0x00, 0x3B, 0xFF, 0xD1, 0x01, 0x83, 0xFC, 0x16, 0x06, - 0x51, 0xF5, 0x9B, 0x18, 0x75, 0x42, 0xF3, 0xF5, 0x9D, 0x03, 0xBF, - 0xFE, 0x45, 0x00, 0x11, 0x00, 0xE8, 0xFF, 0x07, 0x00, 0xFD, 0xFF, - 0x2E, 0x00, 0x52, 0xFF, 0xBC, 0x01, 0x58, 0xFC, 0x1D, 0x07, 0x8E, - 0xF1, 0x11, 0x2E, 0x6B, 0x32, 0x81, 0xF1, 0xE5, 0x06, 0x90, 0xFC, - 0x94, 0x01, 0x67, 0xFF, 0x26, 0x00, 0xFD, 0xFF, 0x04, 0x00, 0xF9, - 0xFF, 0xE3, 0xFF, 0xA1, 0x00, 0x1E, 0xFE, 0xA3, 0x04, 0x49, 0xF4, - 0xA8, 0x3F, 0x52, 0x1D, 0x19, 0xF4, 0x90, 0x06, 0x53, 0xFC, 0xE1, - 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x17, 0x00, 0xA0, 0xFF, - 0xCC, 0x00, 0xC6, 0xFE, 0x79, 0x01, 0xD2, 0xFE, 0x26, 0xFF, 0x7C, - 0x48, 0xBE, 0x08, 0xAE, 0xFA, 0xA0, 0x03, 0xA9, 0xFD, 0x52, 0x01, - 0x6B, 0xFF, 0x25, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2F, 0x00, 0x4C, - 0xFF, 0xA3, 0x01, 0xF3, 0xFC, 0x18, 0x05, 0x9B, 0xF7, 0x27, 0x11, - 0x02, 0x46, 0x7F, 0xF9, 0xA3, 0x01, 0xE8, 0xFF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89, 0x2B, 0xC3, - 0x34, 0xA0, 0xF1, 0xB1, 0x06, 0xBA, 0xFC, 0x79, 0x01, 0x76, 0xFF, - 0x21, 0x00, 0xFE, 0xFF, 0x02, 0x00, 0x02, 0x00, 0xCB, 0xFF, 0xD1, - 0x00, 0xCC, 0xFD, 0x24, 0x05, 0x87, 0xF3, 0xE4, 0x3D, 0xFD, 0x1F, - 0x7F, 0xF3, 0xC6, 0x06, 0x41, 0xFC, 0xE5, 0x01, 0x36, 0xFF, 0x36, - 0x00, 0xFD, 0xFF, 0x14, 0x00, 0xAC, 0xFF, 0xAE, 0x00, 0x05, 0xFF, - 0x03, 0x01, 0xAA, 0xFF, 0x63, 0xFD, 0xFD, 0x47, 0x0E, 0x0B, 0xC8, - 0xF9, 0x11, 0x04, 0x71, 0xFD, 0x6C, 0x01, 0x61, 0xFF, 0x28, 0x00, - 0x00, 0x00, 0xFF, 0xFF, 0x2D, 0x00, 0x53, 0xFF, 0x8F, 0x01, 0x23, - 0xFD, 0xB2, 0x04, 0x76, 0xF8, 0xAA, 0x0E, 0xED, 0x46, 0xF7, 0xFA, - 0xDF, 0x00, 0x57, 0x00, 0x62, 0xFF, 0x80, 0x00, 0xBD, 0xFF, 0x10, - 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x39, 0xFF, 0xE5, 0x01, 0x33, 0xFC, - 0x03, 0x07, 0xB7, 0xF2, 0xFC, 0x23, 0x03, 0x3B, 0x9E, 0xF2, 0xCB, - 0x05, 0x5F, 0xFD, 0x12, 0x01, 0xAA, 0xFF, 0x0E, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x18, 0x00, 0x8F, 0xFF, 0x47, 0x01, 0x08, 0xFD, 0x49, - 0x06, 0x05, 0xF2, 0x1D, 0x38, 0xA6, 0x27, 0x26, 0xF2, 0x23, 0x07, - 0x33, 0xFC, 0xDD, 0x01, 0x3E, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x0C, - 0x00, 0xCD, 0xFF, 0x57, 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, 0x01, 0x5F, 0xFD, 0xCB, 0x05, 0x9E, - 0xF2, 0x03, 0x3B, 0xFC, 0x23, 0xB7, 0xF2, 0x03, 0x07, 0x33, 0xFC, - 0xE5, 0x01, 0x39, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x10, 0x00, 0xBD, - 0xFF, 0x80, 0x00, 0x62, 0xFF, 0x57, 0x00, 0xDF, 0x00, 0xF7, 0xFA, - 0xED, 0x46, 0xAA, 0x0E, 0x76, 0xF8, 0xB2, 0x04, 0x23, 0xFD, 0x8F, - 0x01, 0x53, 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x28, 0x00, - 0x61, 0xFF, 0x6C, 0x01, 0x71, 0xFD, 0x11, 0x04, 0xC8, 0xF9, 0x0E, - 0x0B, 0xFD, 0x47, 0x63, 0xFD, 0xAA, 0xFF, 0x03, 0x01, 0x05, 0xFF, - 0xAE, 0x00, 0xAC, 0xFF, 0x14, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, - 0xFF, 0xE5, 0x01, 0x41, 0xFC, 0xC6, 0x06, 0x7F, 0xF3, 0xFD, 0x1F, - 0xE4, 0x3D, 0x87, 0xF3, 0x24, 0x05, 0xCC, 0xFD, 0xD1, 0x00, 0xCB, - 0xFF, 0x02, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x21, 0x00, 0x76, 0xFF, - 0x79, 0x01, 0xBA, 0xFC, 0xB1, 0x06, 0xA0, 0xF1, 0xC3, 0x34, 0x89, - 0x2B, 0xB9, 0xF1, 0x29, 0x07, 0x44, 0xFC, 0xCC, 0x01, 0x49, 0xFF, - 0x31, 0x00, 0xFD, 0xFF, 0x09, 0x00, 0xDE, 0xFF, 0x2C, 0x00, 0x0D, - 0x00, 0x21, 0xFF, 0xF9, 0x02, 0x0F, 0xF7, 0xD4, 0x43, 0xFD, 0x15, - 0x13, 0xF6, 0xC5, 0x05, 0xA5, 0xFC, 0xC4, 0x01, 0x40, 0xFF, 0x33, -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0x00, 0xFE, 0xFF, 0x15, 0x00, 0xA7, - 0xFF, 0xB9, 0x00, 0xEC, 0xFE, 0x31, 0x01, 0x57, 0xFF, 0x0F, 0xFE, - 0x33, 0x48, 0x25, 0x0A, 0x21, 0xFA, 0xE5, 0x03, 0x87, 0xFD, 0x62, - 0x01, 0x65, 0xFF, 0x27, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2E, 0x00, - 0x50, 0xFF, 0x97, 0x01, 0x10, 0xFD, 0xDA, 0x04, 0x20, 0xF8, 0xA0, - 0x0F, 0x97, 0x46, 0x61, 0xFA, 0x2D, 0x01, 0x2B, 0x00, 0x7A, 0xFF, - 0x75, 0x00, 0xC2, 0xFF, 0x0F, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x3A, - 0xFF, 0xE4, 0x01, 0x32, 0xFC, 0x0E, 0x07, 0x8B, 0xF2, 0x03, 0x25, - 0x38, 0x3A, 0x6D, 0xF2, 0xF1, 0x05, 0x45, 0xFD, 0x22, 0x01, 0xA2, - 0xFF, 0x11, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x16, 0x00, 0x96, 0xFF, - 0x39, 0x01, 0x1F, 0xFD, 0x28, 0x06, 0x2A, 0xF2, 0xF2, 0x38, 0xA0, - 0x26, 0x4B, 0xF2, 0x1C, 0x07, 0x32, 0xFC, 0xE0, 0x01, 0x3C, 0xFF, - 0x35, 0x00, 0xFD, 0xFF, 0x0D, 0x00, 0xC9, 0xFF, 0x63, 0x00, 0x9F, - 0xFF, 0xE8, 0xFF, 0xA3, 0x01, 0x7F, 0xF9, 0x02, 0x46, 0x27, 0x11, - 0x9B, 0xF7, 0x18, 0x05, 0xF3, 0xFC, 0xA3, 0x01, 0x4C, 0xFF, 0x2F, - 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x25, 0x00, 0x6B, 0xFF, 0x52, 0x01, - 0xA9, 0xFD, 0xA0, 0x03, 0xAE, 0xFA, 0xBE, 0x08, 0x7C, 0x48, 0x26, - 0xFF, 0xD2, 0xFE, 0x79, 0x01, 0xC6, 0xFE, 0xCC, 0x00, 0xA0, 0xFF, - 0x17, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE1, 0x01, 0x53, - 0xFC, 0x90, 0x06, 0x19, 0xF4, 0x52, 0x1D, 0xA8, 0x3F, 0x49, 0xF4, - 0xA3, 0x04, 0x1E, 0xFE, 0xA1, 0x00, 0xE3, 0xFF, 0xF9, 0xFF, 0x04, - 0x00, 0xFD, 0xFF, 0x26, 0x00, 0x67, 0xFF, 0x94, 0x01, 0x90, 0xFC, - 0xE5, 0x06, 0x81, 0xF1, 0x6B, 0x32, 0x11, 0x2E, 0x8E, 0xF1, 0x1D, - 0x07, 0x58, 0xFC, 0xBC, 0x01, 0x52, 0xFF, 0x2E, 0x00, 0xFD, 0xFF, - 0x07, 0x00, 0xE8, 0xFF, 0x11, 0x00, 0x45, 0x00, 0xBF, 0xFE, 0x9D, - 0x03, 0xF3, 0xF5, 0x75, 0x42, 0x9B, 0x18, 0x51, 0xF5, 0x16, 0x06, - 0x83, 0xFC, 0xD1, 0x01, 0x3B, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0x1D, - 0x00, 0x8B, 0xFF, 0x01, 0x01, 0x56, 0xFE, 0x4D, 0x02, 0x45, 0xFD, - 0x8D, 0x02, 0xF0, 0x48, 0xD7, 0x04, 0x47, 0xFC, 0xD1, 0x02, 0x12, - 0xFE, 0x21, 0x01, 0x7E, 0xFF, 0x20, 0x00, 0x00, 0x00, 0xFF, 0xFF, - 0x33, 0x00, 0x40, 0xFF, 0xC2, 0x01, 0xA9, 0xFC, 0xBC, 0x05, 0x29, - 0xF6, 0xB3, 0x15, 0xFA, 0x43, 0x31, 0xF7, 0xE6, 0x02, 0x2C, 0xFF, - 0x07, 0x00, 0x2F, 0x00, 0xDC, 0xFF, 0x09, 0x00, 0xFD, 0xFF, 0x31, - 0x00, 0x48, 0xFF, 0xCE, 0x01, 0x42, 0xFC, 0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 0x0C, 0x00, 0xCE, 0xFF, 0x54, 0x00, 0xBD, 0xFF, 0xB2, - 0xFF, 0x01, 0x02, 0xCF, 0xF8, 0x7D, 0x45, 0x6B, 0x12, 0x30, 0xF7, - 0x48, 0x05, 0xDD, 0xFC, 0xAD, 0x01, 0x48, 0xFF, 0x30, 0x00, 0xFF, - 0xFF, 0x00, 0x00, 0x24, 0x00, 0x70, 0xFF, 0x45, 0x01, 0xC6, 0xFD, - 0x66, 0x03, 0x21, 0xFB, 0x9E, 0x07, 0xAA, 0x48, 0x12, 0x00, 0x64, - 0xFE, 0xB4, 0x01, 0xA6, 0xFE, 0xDB, 0x00, 0x9A, 0xFF, 0x19, 0x00, - 0xFE, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xDE, 0x01, 0x5F, 0xFC, 0x70, - 0x06, 0x6C, 0xF4, 0xFD, 0x1B, 0x7D, 0x40, 0xB7, 0xF4, 0x5D, 0x04, - 0x49, 0xFE, 0x88, 0x00, 0xEF, 0xFF, 0xF5, 0xFF, 0x04, 0x00, 0xFD, - 0xFF, 0x29, 0x00, 0x61, 0xFF, 0xA1, 0x01, 0x7E, 0xFC, 0xF9, 0x06, - 0x7C, 0xF1, 0x38, 0x31, 0x50, 0x2F, 0x82, 0xF1, 0x12, 0x07, 0x65, - 0xFC, 0xB2, 0x01, 0x57, 0xFF, 0x2C, 0x00, 0xFD, 0xFF, 0x06, 0x00, - 0xED, 0xFF, 0x04, 0x00, 0x60, 0x00, 0x90, 0xFE, 0xEB, 0x03, 0x71, - 0xF5, 0xB7, 0x41, 0xED, 0x19, 0xF5, 0xF4, 0x3B, 0x06, 0x73, 0xFC, - 0xD7, 0x01, 0x39, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1B, 0x00, 0x91, - 0xFF, 0xF2, 0x00, 0x76, 0xFE, 0x11, 0x02, 0xB6, 0xFD, 0x8F, 0x01, - 0xDE, 0x48, 0xE9, 0x05, 0xD4, 0xFB, 0x0C, 0x03, 0xF4, 0xFD, 0x2F, - 0x01, 0x79, 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x32, 0x00, - 0x43, 0xFF, 0xBA, 0x01, 0xBC, 0xFC, 0x90, 0x05, 0x8E, 0xF6, 0x68, - 0x14, 0x99, 0x44, 0xCD, 0xF7, 0x8F, 0x02, 0x60, 0xFF, 0xEA, 0xFF, - 0x3E, 0x00, 0xD7, 0xFF, 0x0A, 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x44, - 0xFF, 0xD4, 0x01, 0x3B, 0xFC, 0x2A, 0x07, 0xDF, 0xF1, 0xF6, 0x29, - 0x27, 0x36, 0xC1, 0xF1, 0x8B, 0x06, 0xD8, 0xFC, 0x66, 0x01, 0x80, - 0xFF, 0x1E, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x07, 0x00, 0xBD, 0xFF, - 0xED, 0x00, 0x9E, 0xFD, 0x6C, 0x05, 0x1F, 0xF3, 0xC0, 0x3C, 0x9E, - 0x21, 0x28, 0xF3, 0xE2, 0x06, 0x3A, 0xFC, 0xE6, 0x01, 0x37, 0xFF, - 0x36, 0x00, 0xFD, 0xFF, 0x12, 0x00, 0xB3, 0xFF, 0x9B, 0x00, 0x2B, - 0xFF, 0xBD, 0x00, 0x2A, 0x00, 0x5E, 0xFC, 0x9A, 0x47, 0x82, 0x0C, - 0x3D, 0xF9, 0x54, 0x04, 0x50, 0xFD, 0x7A, 0x01, 0x5B, 0xFF, 0x2A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x59, 0xFF, 0x81, 0x01, - 0x42, 0xFD, 0x72, 0x04, 0xFF, 0xF8, 0x2D, 0x0D, 0x69, 0x47, 0xEB, - 0xFB, 0x63, 0x00, 0x9D, 0x00, 0x3C, 0xFF, 0x93, 0x00, 0xB6, 0xFF, - 0x12, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x37, - 0xFC, 0xED, 0x06, 0x03, 0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F2, 0xFF, - 0xF7, 0xFF, 0x7A, 0x00, 0x62, 0xFE, 0x35, 0x04, 0xF7, 0xF4, 0xEF, - 0x40, 0x40, 0x1B, 0x9C, 0xF4, 0x5E, 0x06, 0x66, 0xFC, 0xDB, 0x01, - 0x38, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x1A, 0x00, 0x96, 0xFF, 0xE3, - 0x00, 0x95, 0xFE, 0xD5, 0x01, 0x26, 0xFE, 0x98, 0x00, 0xBF, 0x48, - 0x00, 0x07, 0x61, 0xFB, 0x46, 0x03, 0xD6, 0xFD, 0x3D, 0x01, 0x73, - 0xFF, 0x23, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x31, 0x00, 0x46, 0xFF, - 0xB2, 0x01, 0xD1, 0xFC, 0x62, 0x05, 0xF6, 0xF6, 0x20, 0x13, 0x2E, - 0x45, 0x70, 0xF8, 0x34, 0x02, 0x94, 0xFF, 0xCD, 0xFF, 0x4C, 0x00, - 0xD2, 0xFF, 0x0B, 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x41, 0xFF, 0xDA, - 0x01, 0x36, 0xFC, 0x27, 0x07, 0x05, 0xF2, 0xAA, 0x28, 0x44, 0x37, - 0xE4, 0xF1, 0x67, 0x06, 0xF2, 0xFC, 0x55, 0x01, 0x88, 0xFF, 0x1B, - 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x0B, 0x00, 0xB2, 0xFF, 0x02, 0x01, - 0x7A, 0xFD, 0xA2, 0x05, 0xD4, 0xF2, 0xC7, 0x3B, 0xF2, 0x22, 0xE7, - 0xF2, 0xF5, 0x06, 0x35, 0xFC, 0xE6, 0x01, 0x38, 0xFF, 0x36, 0x00, - 0xFD, 0xFF, 0x11, 0x00, 0xB9, 0xFF, 0x8C, 0x00, 0x4A, 0xFF, 0x83, - 0x00, 0x91, 0x00, 0x91, 0xFB, 0x3D, 0x47, 0xB7, 0x0D, 0xCD, 0xF8, - 0x89, 0x04, 0x36, 0xFD, 0x86, 0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FF, 0x36, 0x00, 0xFD, 0xFF, - 0x15, 0x00, 0xA8, 0xFF, 0xB6, 0x00, 0xF3, 0xFE, 0x24, 0x01, 0x6E, - 0xFF, 0xDE, 0xFD, 0x25, 0x48, 0x68, 0x0A, 0x08, 0xFA, 0xF2, 0x03, - 0x81, 0xFD, 0x65, 0x01, 0x64, 0xFF, 0x28, 0x00, 0x00, 0x00, 0xFF, - 0xFF, 0x2D, 0x00, 0x51, 0xFF, 0x95, 0x01, 0x15, 0xFD, 0xCF, 0x04, - 0x39, 0xF8, 0x59, 0x0F, 0xAF, 0x46, 0x8B, 0xFA, 0x17, 0x01, 0x38, - 0x00, 0x73, 0xFF, 0x78, 0x00, 0xC0, 0xFF, 0x0F, 0x00, 0xFD, 0xFF, - 0x36, 0x00, 0x39, 0xFF, 0xE4, 0x01, 0x32, 0xFC, 0x0B, 0x07, 0x97, - 0xF2, 0xB8, 0x24, 0x71, 0x3A, 0x7B, 0xF2, 0xE6, 0x05, 0x4C, 0xFD, - 0x1D, 0x01, 0xA4, 0xFF, 0x11, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x16, - 0x00, 0x94, 0xFF, 0x3D, 0x01, 0x18, 0xFD, 0x32, 0x06, 0x1F, 0xF2, - 0xB5, 0x38, 0xEB, 0x26, 0x40, 0xF2, 0x1E, 0x07, 0x32, 0xFC, 0xDF, - 0x01, 0x3D, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x0D, 0x00, 0xCA, 0xFF, - 0x5F, 0x00, 0xA5, 0xFF, 0xDC, 0xFF, 0xB8, 0x01, 0x57, 0xF9, 0xE5, - 0x45, 0x6E, 0x11, 0x83, 0xF7, 0x23, 0x05, 0xEE, 0xFC, 0xA6, 0x01, - 0x4B, 0xFF, 0x2F, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x25, 0x00, 0x6C, - 0xFF, 0x4F, 0x01, 0xB0, 0xFD, 0x93, 0x03, 0xC7, 0xFA, 0x7D, 0x08, - 0x86, 0x48,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 0x00, 0xFD, 0xFF, 0x0C, 0x00, 0xD0, 0xFF, 0x51, 0x00, - 0xC3, 0xFF, 0xA6, 0xFF, 0x16, 0x02, 0xA9, 0xF8, 0x5C, 0x45, 0xB2, - 0x12, 0x19, 0xF7, 0x52, 0x05, 0xD8, 0xFC, 0xAF, 0x01, 0x47, 0xFF, - 0x30, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x24, 0x00, 0x71, 0xFF, 0x42, - 0x01, 0xCD, 0xFD, 0x59, 0x03, 0x3B, 0xFB, 0x5E, 0x07, 0xB3, 0x48, - 0x48, 0x00, 0x4B, 0xFE, 0xC2, 0x01, 0x9F, 0xFE, 0xDE, 0x00, 0x98, - 0xFF, 0x19, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xDD, 0x01, - 0x62, 0xFC, 0x69, 0x06, 0x7F, 0xF4, 0xB2, 0x1B, 0xAB, 0x40, 0xD0, - 0xF4, 0x4E, 0x04, 0x53, 0xFE, 0x83, 0x00, 0xF2, 0xFF, 0xF4, 0xFF, - 0x05, 0x00, 0xFD, 0xFF, 0x29, 0x00, 0x5F, 0xFF, 0xA3, 0x01, 0x7A, - 0xFC, 0xFD, 0x06, 0x7C, 0xF1, 0xF2, 0x30, 0x96, 0x2F, 0x80, 0xF1, - 0x0F, 0x07, 0x69, 0xFC, 0xB0, 0x01, 0x59, 0xFF, 0x2B, 0x00, 0xFD, - 0xFF, 0x06, 0x00, 0xEE, 0xFF, 0x01, 0x00, 0x66, 0x00, 0x85, 0xFE, - 0xFC, 0x03, 0x55, 0xF5, 0x8C, 0x41, 0x38, 0x1A, 0xE1, 0xF4, 0x43, - 0x06, 0x70, 0xFC, 0xD8, 0x01, 0x39, 0xFF, 0x35, 0x00, 0xFE, 0xFF, - 0x1B, 0x00, 0x92, 0xFF, 0xEF, 0x00, 0x7D, 0xFE, 0x04, 0x02, 0xCF, - 0xFD, 0x58, 0x01, 0xD7, 0x48, 0x26, 0x06, 0xBB, 0xFB, 0x19, 0x03, - 0xED, 0xFD, 0x32, 0x01, 0x77, 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFF, - 0xFF, 0x32, 0x00, 0x44, 0xFF, 0xB9, 0x01, 0xC1, 0xFC, 0x86, 0x05, - 0xA5, 0xF6, 0x1E, 0x14, 0xBA, 0x44, 0xF0, 0xF7, 0x7B, 0x02, 0x6B, - 0xFF, 0xE4, 0xFF, 0x41, 0x00, 0xD6, 0xFF, 0x0B, 0x00, 0xFD, 0xFF, - 0x33, 0x00, 0x43, 0xFF, 0xD5, 0x01, 0x3A, 0xFC, 0x2A, 0x07, 0xE7, - 0xF1, 0xAC, 0x29, 0x66, 0x36, 0xC9, 0xF1, 0x83, 0x06, 0xDD, 0xFC, - 0x62, 0x01, 0x81, 0xFF, 0x1D, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x08, - 0x00, 0xBB, 0xFF, 0xF1, 0x00, 0x96, 0xFD, 0x78, 0x05, 0x0E, 0xF3, - 0x8A, 0x3C, 0xEA, 0x21, 0x19, 0xF3, 0xE6, 0x06, 0x38, 0xFC, 0xE6, - 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x12, 0x00, 0xB4, 0xFF, - 0x98, 0x00, 0x32, 0xFF, 0xB0, 0x00, 0x41, 0x00, 0x30, 0xFC, 0x86, - 0x47, 0xC6, 0x0C, 0x24, 0xF9, 0x60, 0x04, 0x4B, 0xFD, 0x7D, 0x01, - 0x5A, 0xFF, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x5A, - 0xFF, 0x7E, 0x01, 0x48, 0xFD, 0x66, 0x04, 0x18, 0xF9, 0xE8, 0x0C, - 0x7C, 0x47, 0x19, 0xFC, 0x4D, 0x00, 0xA9, 0x00, 0x35, 0xFF, 0x96, - 0x00, 0xB5, 0xFF, 0x12, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF, - 0xE6, 0x01, 0x38, 0xFC, 0xE9, 0x06, 0x12, 0xF3, 0x10, 0x22, 0x6E, - 0x3C, 0x05, 0xF3, 0x7E, 0x05, 0x91, 0xFD, 0xF4, 0x00, 0xBA, 0xFF, - 0x09, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x1D, 0x00, 0x82, 0xFF, 0x60, - 0x01, 0xE0, 0xFC, 0x7F, 0x06, 0xCC, 0xF1, 0x85, 0x36, 0x87, 0x29, - 0xEB, 0xF1, 0x2A, 0x07, 0x39, 0xFC, 0xD6, 0x01, 0x43, 0xFF, 0x33, - 0x00, 0xFD, 0xFF, 0x0B, 0x00, 0xD5, 0xFF, 0x42, 0x00, 0xE1, 0xFF, - 0x71, 0xFF, 0x71, 0x02, 0x02, 0xF8, 0xCC, 0x44, 0xFA, 0x13, 0xB0, - 0xF6, 0x81, 0x05, 0xC3, 0xFC, 0xB8, 0x01, 0x44, 0xFF, 0x31, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0x22, 0x00, 0x77, 0xFF, 0x34, 0x01, 0xEA, - 0xFD, 0x1F, 0x03, 0xAE, 0xFB, 0x45, 0x06, 0xD5, 0x48, 0x3C, 0x01, - 0xDC, 0xFD, 0xFD, 0x01, 0x80, 0xFE, 0xED, 0x00, 0x93, 0xFF, 0x1B, - 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x39, 0xFF, 0xD8, 0x01, 0x6F, 0xFC, - 0x47, 0x06, 0xD7, 0xF4, 0x5D, 0x1A, 0x74, 0x41, 0x48, 0xF5, 0x04, - 0x04, 0x80, 0xFE, 0x69, 0x00, 0xFF, 0xFF, 0xEF, 0xFF, 0x05, 0x00, - 0xFD, 0xFF, 0x2B, 0x00, 0x59, 0xFF, 0xAE, 0x01, 0x6A, 0xFC, 0x0D, - 0x07, 0x80, 0xF1, 0xB8, 0x2F, 0xCF, 0x30, 0x7D, 0xF1, 0xFF, 0x06, - 0x78, 0xFC, 0xA5, 0x01, 0x5F, 0xFF, 0x29, 0x00, 0xFD, 0xFF, 0x05, - 0x00, 0xF3, 0xFF, 0xF4, 0xFF, 0x80, 0x00, 0x58, 0xFE, 0x46, 0x04, - 0xDD, 0xF4, 0xC3, 0x40, 0x8C, 0x1B, 0x89, 0xF4, 0x66, 0x06, 0x63, - 0xFC, 0xDC, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x19, 0x00, - 0x98, 0xFF, 0xE0, 0x00, 0x9C, 0xFE, 0xC8, 0x01, 0x3F, 0xFE, 0x62, - 0x00, 0xB8, 0x48, 0x3F, 0x07, 0x47, 0xFB, 0x53, 0x03, 0xD0, 0xFD, - 0x40, 0x01, 0x72, 0xFF, 0x23, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x30, - 0x00, 0x47, 0xFF, 0xB0, 0x01, 0xD6, 0xFC, 0x58, 0x05, 0x0D, 0xF7, - 0xD7, 0x12, 0x4E, 0x45, 0x96, 0xF8, 0x20, 0x02, 0xA0, 0xFF, 0xC7, - 0xFF, 0x4F, 0x00, 0xD0, 0xFF, 0x0C, 0x00, 0xFD, 0xFF, 0x34, 0x00, - 0x40, 0xFF, 0xDB, 0x01, 0x35, 0xFC, 0x26, 0x07, 0x0E, 0xF2, 0x60, - 0x28, 0x82, 0x37, 0xED, 0xF1, 0x5E, 0x06, 0xF8, 0xFC, 0x51, 0x01, - 0x8A, 0xFF, 0x1A, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x0C, 0x00, 0xB0, - 0xFF, 0x07, 0x01, 0x72, 0xFD, 0xAE, 0x05, 0xC4, 0xF2, 0x90, 0x3B, - 0x3F, 0x23, 0xD9, 0xF2, 0xF9, 0x06, 0x34, 0xFC, 0xE6, 0x01, 0x38, - 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x11, 0x00, 0xBA, 0xFF, 0x89, 0x00, - 0x51, 0xFF, 0x77, 0x00, 0xA7, 0x00, 0x64, 0xFB, 0x26, 0x47, 0xFC, - 0x0D, 0xB4, 0xF8, 0x95, 0x04, 0x31, 0xFD, 0x88, 0x01, 0x56, 0xFF, - 0x2C, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x29, 0x00, 0x5E, 0xFF, 0x72, - 0x01, 0x62, 0xFD, 0x2F, 0x04, 0x89, 0xF9, 0xB6, 0x0B, 0xD2, 0x47, - 0xEB, 0xFC, 0xE4, 0xFF, 0xE3, 0x00, 0x16, 0xFF, 0xA5, 0x00, 0xAF, - 0xFF, 0x13, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, - 0x3E, 0xFC, 0xD3, 0x06, 0x56, 0xF3, 0xBA, 0x20, 0x61, 0x3D, 0x56, - 0xF3, 0x45, 0x05, 0xB7, 0xFD, 0xDE, 0x00, 0xC5, 0xFF, 0x05, 0x00, - 0x02, 0x00, 0xFE, 0xFF, 0x20, 0x00, 0x7A, 0xFF, 0x70, 0x01, 0xC7, - 0xFC, 0xA0, 0x06, 0xAE, 0xF1, 0x65, 0x35, 0xD1, 0x2A, 0xCA, 0xF1, - 0x2A, 0x07, 0x40, 0xFC, 0xD0, 0x01, 0x47, 0xFF, 0x32, 0x00, 0xFD, - 0xFF, 0x09, 0x00, 0xDB, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0x3D, 0xFF, - 0xC9, 0x02, 0x64, 0xF7, 0x2F, 0x44, 0x44, 0x15, 0x4A, 0xF6, 0xAD, - 0x05, 0xAF, 0xFC, 0xC0, 0x01, 0x41, 0xFF, 0x32, 0x00, 0xFF, 0xFF, - 0x00, 0x00, 0x21, 0x00, 0x7C, 0xFF, 0x26, 0x01, 0x08, 0xFE, 0xE4, - 0x02, 0x21, 0xFC, 0x31, 0x05, 0xEB, 0x48, 0x37, 0x02, 0x6B, 0xFD, - 0x39, 0x02, 0x61, 0xFE, 0xFC, 0x00, 0x8D, 0xFF, 0x1C, 0x00, 0xFE, - 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xD3, 0x01, 0x7D, 0xFC, 0x23, 0x06, - 0x32, 0xF5, 0x0C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, 0xFF, 0x8D, 0x01, 0x9B, 0xFC, 0xD8, 0x06, 0x87, - 0xF1, 0x13, 0x33, 0x5E, 0x2D, 0x98, 0xF1, 0x22, 0x07, 0x52, 0xFC, - 0xC1, 0x01, 0x4F, 0xFF, 0x2F, 0x00, 0xFD, 0xFF, 0x07, 0x00, 0xE5, - 0xFF, 0x18, 0x00, 0x36, 0x00, 0xD9, 0xFE, 0x71, 0x03, 0x3F, 0xF6, - 0xDB, 0x42, 0xE0, 0x17, 0x86, 0xF5, 0x00, 0x06, 0x8C, 0xFC, 0xCE, - 0x01, 0x3C, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0x1D, 0x00, 0x88, 0xFF, - 0x09, 0x01, 0x45, 0xFE, 0x6E, 0x02, 0x06, 0xFD, 0x1C, 0x03, 0xF4, - 0x48, 0x41, 0x04, 0x87, 0xFC, 0xB0, 0x02, 0x23, 0xFE, 0x19, 0x01, - 0x81, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0x3F, - 0xFF, 0xC6, 0x01, 0x9F, 0xFC, 0xD3, 0x05, 0xF1, 0xF5, 0x6C, 0x16, - 0x9E, 0x43, 0xDD, 0xF6, 0x15, 0x03, 0x10, 0xFF, 0x17, 0x00, 0x28, - 0x00, 0xDF, 0xFF, 0x09, 0x00, 0xFD, 0xFF, 0x30, 0x00, 0x4A, 0xFF, - 0xCA, 0x01, 0x47, 0xFC, 0x28, 0x07, 0xB0, 0xF1, 0xF5, 0x2B, 0x60, - 0x34, 0x9A, 0xF1, 0xBB, 0x06, 0xB3, 0xFC, 0x7D, 0x01, 0x73, 0xFF, - 0x22, 0x00, 0xFE, 0xFF, 0x02, 0x00, 0x01, 0x00, 0xCF, 0xFF, 0xC9, - 0x00, 0xDA, 0xFD, 0x0F, 0x05, 0xA5, 0xF3, 0x31, 0x3E, 0x8A, 0x1F, - 0x97, 0xF3, 0xBD, 0x06, 0x44, 0xFC, 0xE5, 0x01, 0x36, 0xFF, 0x36, - 0x00, 0xFD, 0xFF, 0x15, 0x00, 0xAA, 0xFF, 0xB3, 0x00, 0xFA, 0xFE, - 0x17, 0x01, 0x86, 0xFF, 0xAC, 0xFD, 0x16, 0x48, 0xAA, 0x0A, 0xEE, - 0xF9, 0xFE, 0x03, 0x7A, 0xFD, 0x67, 0x01, 0x63, 0xFF, 0x28, 0x00, - 0x00, 0x00, 0xFF, 0xFF, 0x2D, 0x00, 0x52, 0xFF, 0x92, 0x01, 0x1B, - 0xFD, 0xC4, 0x04, 0x51, 0xF8, 0x13, 0x0F, 0xC8, 0x46, 0xB6, 0xFA, - 0x01, 0x01, 0x44, 0x00, 0x6C, 0xFF, 0x7B, 0x00, 0xBF, 0xFF, 0x10, - 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x39, 0xFF, 0xE5, 0x01, 0x32, 0xFC, - 0x08, 0x07, 0xA4, 0xF2, 0x6D, 0x24, 0xAD, 0x3A, 0x88, 0xF2, 0xDB, - 0x05, 0x53, 0xFD, 0x19, 0x01, 0xA7, 0xFF, 0x10, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x17, 0x00, 0x92, 0xFF, 0x41, 0x01, 0x11, 0xFD, 0x3B, - 0x06, 0x14, 0xF2, 0x78, 0x38, 0x36, 0x27, 0x35, 0xF2, 0x20, 0x07, - 0x33, 0xFC, 0xDF, 0x01, 0x3E, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x0D, - 0x00, 0xCB, 0xFF, 0x5C, 0x00, 0xAC, 0xFF, 0xD0, 0xFF, 0xCD, 0x01, - 0x30, 0xF9, 0xC8, 0x45, 0xB6, 0x11, 0x6B, 0xF7, 0x2D, 0x05, 0xE9, - 0xFC, 0xA8, 0x01, 0x4A, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0x00, 0x00, - 0x25, 0x00, 0x6D, 0xFF, 0x4C, 0x01, 0xB6, 0xFD, 0x86, 0x03, 0xE1, - 0xFA, 0x3D, 0x08, 0x92, 0x48, 0x8E, 0xFF, 0xA1, 0xFE, 0x93, 0x01, - 0xB8, 0xFE, 0xD3, 0x00, 0x9D, 0xFF, 0x18, 0x00, 0xFE, 0xFF, 0x36, - 0x00, 0x37, 0xFF, 0xE0, 0x01, 0x58, 0xFC, 0x82, 0x06, 0x3E, 0xF4, - 0xBA, 0x1C, 0x07, 0x40, 0x79, 0xF4, 0x84, 0x04, 0x31, 0xFE, 0x96, - 0x00, 0xE8, 0xFF, 0xF7, 0xFF, 0x04, 0x00, 0xFD, 0xFF, 0x28, 0x00, - 0x64, 0xFF, 0x9A, 0x01, 0x88, 0xFC, 0xEE, 0x06, 0x7E, 0xF1, 0xE3, - 0x31, 0x9F, 0x2E, 0x88, 0xF1, 0x19, 0x07, 0x5E, 0xFC, 0xB7, 0x01, - 0x54, 0xFF, 0x2D, 0x00, 0xFD, 0xFF, 0x06, 0x00, 0xEA, 0xFF, 0x0B, - 0x00, 0x51, 0x00, 0xAA, 0xFE, 0xC0, 0x03, 0xB8, 0xF5, 0x21, 0x42, - 0x31, 0x19, 0x28, 0xF5, 0x27, 0x06, 0x7C, 0xFC, 0xD4, 0x01, 0x3A, - 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1C, 0x00, 0x8D, 0xFF, 0xFA, 0x00, - 0x64, 0xFE, 0x32, 0x02, 0x78, 0xFD, 0x1B, 0x02, 0xEA, 0x48, 0x50, - 0x05, 0x14, 0xFC, 0xEB, 0x02, 0x05, 0xFE, 0x27, 0x01, 0x7C, 0xFF, - 0x21, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x32, 0x00, 0x41, 0xFF, 0xBF, - 0x01, 0xB2, 0xFC, 0xA9, 0x05, 0x55, 0xF6, 0x20, 0x15, 0x42, 0x44, - 0x75, 0xF7, 0xBF, 0x02, 0x43, 0xFF, 0xFA, 0xFF, 0x36, 0x00, 0xDA, - 0xFF, 0x0A, 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x46, 0xFF, 0xD1, 0x01, - 0x3F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, - 0xFB, 0x26, 0x03, 0xE7, 0xFD, 0x35, 0x01, 0x76, 0xFF, 0x22, 0x00, - 0x00, 0x00, 0xFF, 0xFF, 0x31, 0x00, 0x44, 0xFF, 0xB7, 0x01, 0xC5, - 0xFC, 0x7C, 0x05, 0xBC, 0xF6, 0xD5, 0x13, 0xDC, 0x44, 0x14, 0xF8, - 0x67, 0x02, 0x77, 0xFF, 0xDD, 0xFF, 0x44, 0x00, 0xD5, 0xFF, 0x0B, - 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x42, 0xFF, 0xD7, 0x01, 0x39, 0xFC, - 0x29, 0x07, 0xEF, 0xF1, 0x62, 0x29, 0xA5, 0x36, 0xD0, 0xF1, 0x7B, - 0x06, 0xE3, 0xFC, 0x5E, 0x01, 0x83, 0xFF, 0x1D, 0x00, 0xFE, 0xFF, - 0x01, 0x00, 0x09, 0x00, 0xB8, 0xFF, 0xF6, 0x00, 0x8D, 0xFD, 0x84, - 0x05, 0xFD, 0xF2, 0x52, 0x3C, 0x35, 0x22, 0x0B, 0xF3, 0xEB, 0x06, - 0x37, 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x12, - 0x00, 0xB5, 0xFF, 0x94, 0x00, 0x39, 0xFF, 0xA3, 0x00, 0x58, 0x00, - 0x02, 0xFC, 0x73, 0x47, 0x0B, 0x0D, 0x0B, 0xF9, 0x6C, 0x04, 0x45, - 0xFD, 0x80, 0x01, 0x59, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2A, 0x00, 0x5B, 0xFF, 0x7C, 0x01, 0x4E, 0xFD, 0x5A, 0x04, 0x31, - 0xF9, 0xA4, 0x0C, 0x90, 0x47, 0x47, 0xFC, 0x36, 0x00, 0xB6, 0x00, - 0x2E, 0xFF, 0x99, 0x00, 0xB3, 0xFF, 0x12, 0x00, 0xFD, 0xFF, 0x36, - 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x39, 0xFC, 0xE4, 0x06, 0x21, 0xF3, - 0xC4, 0x21, 0xA5, 0x3C, 0x16, 0xF3, 0x72, 0x05, 0x9A, 0xFD, 0xEF, - 0x00, 0xBC, 0xFF, 0x08, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x1E, 0x00, - 0x80, 0xFF, 0x64, 0x01, 0xDA, 0xFC, 0x87, 0x06, 0xC5, 0xF1, 0x46, - 0x36, 0xD1, 0x29, 0xE3, 0xF1, 0x2A, 0x07, 0x3A, 0xFC, 0xD5, 0x01, - 0x44, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0x0A, 0x00, 0xD6, 0xFF, 0x3F, - 0x00, 0xE7, 0xFF, 0x65, 0xFF, 0x85, 0x02, 0xDE, 0xF7, 0xA9, 0x44, - 0x43, 0x14, 0x99, 0xF6, 0x8B, 0x05, 0xBF, 0xFC, 0xBA, 0x01, 0x43, - 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x22, 0x00, 0x78, 0xFF, - 0x31, 0x01, 0xF1, 0xFD, 0x12, 0x03, 0xC7, 0xFB, 0x07, 0x06, 0xDB, - 0x48, 0x73, 0x01, 0xC3, 0xFD, 0x0A, 0x02, 0x79, 0xFE, 0xF1, 0x00, - 0x91, 0xFF, 0x1B, 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x39, 0xFF, 0xD7, - 0x01, 0x72, 0xFC, 0x3F, 0x06, 0xEB, 0xF4, 0x12, 0x1A, 0xA1, 0x41, - 0x63, 0xF5, 0xF3, 0x03, 0x8A, 0xFE, 0x63, 0x00, 0x02, 0x00, 0xEE, - 0xFF, 0x06, 0x00, 0xFD, 0xFF, 0x2C, 0x00, 0x58, 0xFF, 0xB1, 0x01, - 0x67, 0xFC, 0x10, 0x07, 0x81, 0xF1, 0x73, 0x2F, 0x15, 0x31, 0x7C, - 0xF1, 0xFB, 0x06, 0x7C, 0xFC, 0xA2, 0x01, 0x60, 0xFF, 0x29, 0x00, - 0xFD, 0xFF, 0x04,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, 0xFD, 0x8B, - 0x01, 0x55, 0xFF, 0x2C, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x29, 0x00, - 0x5F, 0xFF, 0x70, 0x01, 0x68, 0xFD, 0x23, 0x04, 0xA2, 0xF9, 0x73, - 0x0B, 0xE4, 0x47, 0x1B, 0xFD, 0xCD, 0xFF, 0xF0, 0x00, 0x0F, 0xFF, - 0xA9, 0x00, 0xAE, 0xFF, 0x14, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, - 0xFF, 0xE6, 0x01, 0x3F, 0xFC, 0xCE, 0x06, 0x66, 0xF3, 0x6F, 0x20, - 0x96, 0x3D, 0x69, 0xF3, 0x38, 0x05, 0xBF, 0xFD, 0xD9, 0x00, 0xC7, - 0xFF, 0x04, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x20, 0x00, 0x78, 0xFF, - 0x74, 0x01, 0xC2, 0xFC, 0xA7, 0x06, 0xA8, 0xF1, 0x25, 0x35, 0x1B, - 0x2B, 0xC2, 0xF1, 0x2A, 0x07, 0x41, 0xFC, 0xCE, 0x01, 0x47, 0xFF, - 0x31, 0x00, 0xFD, 0xFF, 0x09, 0x00, 0xDC, 0xFF, 0x31, 0x00, 0x04, - 0x00, 0x32, 0xFF, 0xDC, 0x02, 0x42, 0xF7, 0x0B, 0x44, 0x8E, 0x15, - 0x34, 0xF6, 0xB7, 0x05, 0xAB, 0xFC, 0xC1, 0x01, 0x40, 0xFF, 0x33, - 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x20, 0x00, 0x7E, 0xFF, 0x23, 0x01, - 0x0F, 0xFE, 0xD7, 0x02, 0x3B, 0xFC, 0xF5, 0x04, 0xED, 0x48, 0x70, - 0x02, 0x52, 0xFD, 0x46, 0x02, 0x5A, 0xFE, 0xFF, 0x00, 0x8B, 0xFF, - 0x1C, 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x3B, 0xFF, 0xD2, 0x01, 0x81, - 0xFC, 0x1A, 0x06, 0x47, 0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0x11, 0x00, - 0xA3, 0xFF, 0x20, 0x01, 0x49, 0xFD, 0xEB, 0x05, 0x74, 0xF2, 0x54, - 0x3A, 0xDD, 0x24, 0x91, 0xF2, 0x0C, 0x07, 0x32, 0xFC, 0xE4, 0x01, - 0x3A, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x0F, 0x00, 0xC1, 0xFF, 0x76, - 0x00, 0x76, 0xFF, 0x32, 0x00, 0x22, 0x01, 0x76, 0xFA, 0xA3, 0x46, - 0x7D, 0x0F, 0x2C, 0xF8, 0xD5, 0x04, 0x13, 0xFD, 0x96, 0x01, 0x51, - 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x27, 0x00, 0x64, 0xFF, - 0x63, 0x01, 0x84, 0xFD, 0xEB, 0x03, 0x14, 0xFA, 0x47, 0x0A, 0x2C, - 0x48, 0xF6, 0xFD, 0x63, 0xFF, 0x2B, 0x01, 0xF0, 0xFE, 0xB8, 0x00, - 0xA8, 0xFF, 0x15, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE4, - 0x01, 0x47, 0xFC, 0xB5, 0x06, 0xB0, 0xF3, 0x19, 0x1F, 0x7E, 0x3E, - 0xC4, 0xF3, 0xFA, 0x04, 0xE7, 0xFD, 0xC1, 0x00, 0xD3, 0xFF, 0xFF, - 0xFF, 0x02, 0x00, 0xFE, 0xFF, 0x23, 0x00, 0x71, 0xFF, 0x82, 0x01, - 0xAB, 0xFC, 0xC4, 0x06, 0x93, 0xF1, 0xFD, 0x33, 0x62, 0x2C, 0xA8, - 0xF1, 0x27, 0x07, 0x4A, 0xFC, 0xC7, 0x01, 0x4C, 0xFF, 0x30, 0x00, - 0xFD, 0xFF, 0x08, 0x00, 0xE1, 0xFF, 0x23, 0x00, 0x20, 0x00, 0x00, - 0xFF, 0x31, 0x03, 0xAD, 0xF6, 0x65, 0x43, 0xDC, 0x16, 0xD1, 0xF5, - 0xE1, 0x05, 0x99, 0xFC, 0x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xF7, 0x0A, - 0x10, 0x70, 0x46, 0x22, 0xFA, 0x4D, 0x01, 0x19, 0x00, 0x84, 0xFF, - 0x70, 0x00, 0xC4, 0xFF, 0x0F, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3B, - 0xFF, 0xE3, 0x01, 0x31, 0xFC, 0x12, 0x07, 0x79, 0xF2, 0x73, 0x25, - 0xDF, 0x39, 0x5A, 0xF2, 0x00, 0x06, 0x3A, 0xFD, 0x28, 0x01, 0x9F, - 0xFF, 0x13, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x15, 0x00, 0x99, 0xFF, - 0x33, 0x01, 0x29, 0xFD, 0x1A, 0x06, 0x3B, 0xF2, 0x4B, 0x39, 0x30, - 0x26, 0x5B, 0xF2, 0x19, 0x07, 0x31, 0xFC, 0xE1, 0x01, 0x3C, 0xFF, - 0x35, 0x00, 0xFD, 0xFF, 0x0E, 0x00, 0xC7, 0xFF, 0x68, 0x00, 0x95, - 0xFF, 0xFA, 0xFF, 0x83, 0x01, 0xBB, 0xF9, 0x2B, 0x46, 0xBB, 0x10, - 0xBF, 0xF7, 0x07, 0x05, 0xFB, 0xFC, 0xA0, 0x01, 0x4D, 0xFF, 0x2F, - 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x26, 0x00, 0x69, 0xFF, 0x56, 0x01, - 0xA0, 0xFD, 0xB3, 0x03, 0x87, 0xFA, 0x1F, 0x09, 0x6A, 0x48, 0xD9, - 0xFE, 0xF6, 0xFE, 0x65, 0x01, 0xD0, 0xFE, 0xC7, 0x00, 0xA2, 0xFF, - 0x17, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE2, 0x01, 0x50, - 0xFC, 0x99, 0x06, 0xFE, 0xF3, 0xC3, 0x1D, 0x5E, 0x3F, 0x27, 0xF4, - 0xB9, 0x04, 0x10, 0xFE, 0xA9, 0x00, 0xDF, 0xFF, 0xFB, 0xFF, 0x03, - 0x00, 0xFD, 0xFF, 0x26, 0x00, 0x69, 0xFF, 0x90, 0x01, 0x96, 0xFC, - 0xDD, 0x06, 0x85, 0xF1, 0xD0, 0x32, 0xA6, 0x2D, 0x94, 0xF1, 0x20, - 0x07, 0x54, 0xFC, 0xBF, 0x01, 0x50, 0xFF, 0x2E, 0x00, 0xFD, 0xFF, - 0x07, 0x00, 0xE6, 0xFF, 0x15, 0x00, 0x3C, 0x00, 0xCF, 0xFE, 0x83, - 0x03, 0x20, 0xF6, 0xB2, 0x42, 0x2B, 0x18, 0x71, 0xF5, 0x09, 0x06, - 0x88, 0xFC, 0xCF, 0x01, 0x3C, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0x1D, - 0x00, 0x89, 0xFF, 0x06, 0x01, 0x4C, 0xFE, 0x60, 0x02, 0x1F, 0xFD, - 0xE2, 0x02, 0xF3, 0x48, 0x7D, 0x04, 0x6E, 0xFC, 0xBD, 0x02, 0x1C, - 0xFE, 0x1C, 0x01, 0x80, 0xFF, 0x20, 0x00, 0x00, 0x00, 0xFF, 0xFF, - 0x33, 0x00, 0x3F, 0xFF, 0xC5, 0x01, 0xA3, 0xFC, 0xCA, 0x05, 0x07, - 0xF6, 0x22, 0x16, 0xC3, 0x43, 0xFE, 0xF6, 0x02, 0x03, 0x1B, 0xFF, - 0x11, 0x00, 0x2B, 0x00, 0xDE, 0xFF, 0x09, 0x00, 0xFD, 0xFF, 0x31, - 0x00, 0x49, 0xFF, 0xCB, 0x01, 0x45, 0xFC, 0x29, 0x07, 0xB6, 0xF1, - 0xAD, 0x2B, 0xA2, 0x34, 0x9E, 0xF1, 0xB4, 0x06, 0xB8, 0xFC, 0x7A, - 0x01, 0x75, 0xFF, 0x22, 0x00, 0xFE, 0xFF, 0x02, 0x00, 0x02, 0x00, - 0xCC, 0xFF, 0xCE, 0x00, 0xD1, 0xFD, 0x1D, 0x05, 0x91, 0xF3, 0xFE, - 0x3D, 0xD7, 0x1F, 0x87, 0xF3, 0xC3, 0x06, 0x42, 0xFC, 0xE5, 0x01, - 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x14, 0x00, 0xAB, 0xFF, 0xAF, - 0x00, 0x01, 0xFF, 0x0A, 0x01, 0x9E, 0xFF, 0x7C, 0xFD, 0x03, 0x48, - 0xED, 0x0A, 0xD5, 0xF9, 0x0A, 0x04, 0x74, 0xFD, 0x6A, 0x01, 0x62, - 0xFF, 0x28, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2D, 0x00, 0x53, 0xFF, - 0x90, 0x01, 0x20, 0xFD, 0xB8, 0x04, 0x6A, 0xF8, 0xCD, 0x0E, 0xE1, - 0x46, 0xE1, 0xFA, 0xEB, 0x00, 0x51, 0x00, 0x65, 0xFF, 0x7F, 0x00, - 0xBE, 0xFF, 0x10, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x39, 0xFF, 0xE5, - 0x01, 0x33, 0xFC, 0x04, 0x07, 0xB1, 0xF2, 0x21, 0x24, 0xE6, 0x3A, - 0x97, 0xF2, 0xD0, 0x05, 0x5B, 0xFD, 0x15, 0x01, 0xA9, 0xFF, 0x0F, - 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x18, 0x00, 0x90, 0xFF, 0x45, 0x01, - 0x0B, 0xFD, 0x44, 0x06, 0x0A, 0xF2, 0x3B, 0x38, 0x80, 0x27, 0x2B, - 0xF2, 0x22, 0x07, 0x33, 0xFC, 0xDE, 0x01, 0x3E, 0xFF, 0x34, 0x00, - 0xFD, 0xFF, 0x0D, 0x00, 0xCD, 0xFF, 0x59, 0x00, 0xB3, 0xFF, 0xC4, - 0xFF, 0xE2, 0x01, 0x09, 0xF9, 0xAA, 0x45, 0xFE, 0x11, 0x54, 0xF7, - 0x38, 0x05, 0xE4, 0xFC, 0xAA, 0x01, 0x49, 0xFF, 0x30, 0x00, 0xFF, - 0xFF, 0x00, 0x00, 0x24, 0x00, 0x6E, 0xFF, 0x49, 0x01, 0xBC, 0xFD, - 0x7A, 0x03, 0xFA, 0xFA, 0xFD, 0x07, 0x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, 0x06, 0x87, 0xFB, 0x33, 0x03, 0xE0, 0xFD, 0x39, 0x01, 0x75, - 0xFF, 0x23, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x31, 0x00, 0x45, 0xFF, - 0xB5, 0x01, 0xCA, 0xFC, 0x72, 0x05, 0xD3, 0xF6, 0x8D, 0x13, 0xFD, - 0x44, 0x39, 0xF8, 0x53, 0x02, 0x82, 0xFF, 0xD7, 0xFF, 0x47, 0x00, - 0xD3, 0xFF, 0x0B, 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x42, 0xFF, 0xD8, - 0x01, 0x37, 0xFC, 0x29, 0x07, 0xF8, 0xF1, 0x19, 0x29, 0xE5, 0x36, - 0xD8, 0xF1, 0x73, 0x06, 0xE9, 0xFC, 0x5B, 0x01, 0x85, 0xFF, 0x1C, - 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x0A, 0x00, 0xB6, 0xFF, 0xFB, 0x00, - 0x85, 0xFD, 0x90, 0x05, 0xEC, 0xF2, 0x1C, 0x3C, 0x81, 0x22, 0xFC, - 0xF2, 0xEF, 0x06, 0x36, 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, - 0xFD, 0xFF, 0x12, 0x00, 0xB7, 0xFF, 0x91, 0x00, 0x40, 0xFF, 0x96, - 0x00, 0x6F, 0x00, 0xD5, 0xFB, 0x5E, 0x47, 0x50, 0x0D, 0xF2, 0xF8, - 0x78, 0x04, 0x3F, 0xFD, 0x82, 0x01, 0x58, 0xFF, 0x2B, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x2A, 0x00, 0x5C, 0xFF, 0x79, 0x01, 0x53, 0xFD, - 0x4E, 0x04, 0x4A, 0xF9, 0x60, 0x0C, 0xA3, 0x47, 0x76, 0xFC, 0x1F, - 0x00, 0xC3, 0x00, 0x27, 0xFF, 0x9D, 0x00, 0xB2, 0xFF, 0x13, 0x00, - 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x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D, 0x04, - 0x26, 0xFD, 0x8D, 0x01, 0x54, 0xFF, 0x2C, 0x00, 0xFF, 0xFF, 0x00, - 0x00, 0x29, 0x00, 0x60, 0xFF, 0x6D, 0x01, 0x6E, 0xFD, 0x17, 0x04, - 0xBC, 0xF9, 0x30, 0x0B, 0xF4, 0x47, 0x4B, 0xFD, 0xB5, 0xFF, 0xFD, - 0x00, 0x08, 0xFF, 0xAC, 0x00, 0xAC, 0xFF, 0x14, 0x00, 0xFD, 0xFF, - 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x41, 0xFC, 0xC8, 0x06, 0x76, - 0xF3, 0x22, 0x20, 0xCA, 0x3D, 0x7D, 0xF3, 0x2A, 0x05, 0xC8, 0xFD, - 0xD4, 0x00, 0xCA, 0xFF, 0x03, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x21, - 0x00, 0x77, 0xFF, 0x77, 0x01, 0xBD, 0xFC, 0xAE, 0x06, 0xA3, 0xF1, - 0xE3, 0x34, 0x64, 0x2B, 0xBC, 0xF1, 0x2A, 0x07, 0x43, 0xFC, 0xCD, - 0x01, 0x48, 0xFF, 0x31, 0x00, 0xFD, 0xFF, 0x09, 0x00, 0xDD, 0xFF, - 0x2E, 0x00, 0x0A, 0x00, 0x27, 0xFF, 0xEF, 0x02, 0x20, 0xF7, 0xE7, - 0x43, 0xD8, 0x15, 0x1E, 0xF6, 0xC0, 0x05, 0xA7, 0xFC, 0xC3, 0x01, - 0x40, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x20, 0x00, 0x7F, - 0xFF, 0x20, 0x01, 0x16, 0xFE, 0xCA, 0x02, 0x54, 0xFC, 0xB9, 0x04, - 0xF2, 0x48, 0xA9, 0x02, 0x39, 0xFD, 0x53, 0x02, 0x53, 0xFE, 0x03, - 0x01, 0x8A, 0xFF, 0x1D, 0x00, 0xFE, 0xFF, 0x34, 0x00, 0x3B, 0xFF, - 0xD1, 0x01, 0x84, 0xFC, 0x12, 0x06, 0x5C, 0xF5, 0x76, 0x18, 0x89, - 0x42, 0x02, 0xF6, 0x94, 0x03, 0xC4, 0xFE, 0x42, 0x00, 0x12, 0x00, - 0xE8, 0xFF, 0x07, 0x00, 0xFD, 0xFF, 0x2E, 0x00, 0x51, 0xFF, 0xBD, - 0x01, 0x57, 0xFC, 0x1E, 0x07, 0x90, 0xF1, 0xED, 0x2D, 0x8C, 0x32, - 0x83, 0xF1, 0xE2, 0x06, 0x92, 0xFC, 0x93, 0x01, 0x68, 0xFF, 0x26, - 0x00, 0xFD, 0xFF, 0x03, 0x00, 0xFA, 0xFF, 0xE2, 0xFF, 0xA4, 0x00, - 0x19, 0xFE, 0xAA, 0x04, 0x3E, 0xF4, 0x90, 0x3F, 0x78, 0x1D, 0x10, - 0xF4, 0x93, 0x06, 0x52, 0xFC, 0xE1, 0x01, 0x36, 0xFF, 0x36, 0x00, - 0xFE, 0xFF, 0x17, 0x00, 0xA0, 0xFF, 0xCA, 0x00, 0xC9, 0xFE, 0x73, - 0x01, 0xDE, 0xFE, 0x0C, 0xFF, 0x76, 0x48, 0xDE, 0x08, 0xA1, 0xFA, - 0xA6, 0x03, 0xA6, 0xFD, 0x53, 0x01, 0x6A, 0xFF, 0x26, 0x00, 0x00, - 0x00, 0xFF, 0xFF, 0x2F, 0x00, 0x4C, 0xFF, 0xA2, 0x01, 0xF6, 0xFC, - 0x12, 0x05, 0xA7, 0xF7, 0x03, 0x11, 0x10, 0x46, 0x93, 0xF9, 0x98, - 0x01, 0xEE, 0xFF, 0x9B, 0xFF, 0x64, 0x00, 0xC8, 0xFF, 0x0E, 0x00, - 0xFD, 0xFF, 0x35, 0x00, 0x3C, 0xFF, 0xE1, 0x01, 0x32, 0xFC, 0x1B, - 0x07, 0x50, 0xF2, 0x7B, 0x26, 0x11, 0x39, 0x2F, 0xF2, 0x23, 0x06, - 0x22, 0xFD, 0x37, 0x01, 0x97, 0xFF, 0x15, 0x00, 0xFF, 0xFF, 0x00, - 0x00, 0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, 0xFE, 0x3A, 0x48, 0x04, 0x0A, 0x2E, 0xFA, 0xDF, 0x03, 0x8A, - 0xFD, 0x60, 0x01, 0x65, 0xFF, 0x27, 0x00, 0x00, 0x00, 0xFD, 0xFF, - 0x35, 0x00, 0x3A, 0xFF, 0xE3, 0x01, 0x31, 0xFC, 0x0F, 0x07, 0x84, - 0xF2, 0x29, 0x25, 0x1A, 0x3A, 0x67, 0xF2, 0xF6, 0x05, 0x41, 0xFD, - 0x24, 0x01, 0xA1, 0xFF, 0x12, 0x00, 0x00, 0x00, 0x0E, 0x00, 0xC8, - 0xFF, 0x64, 0x00, 0x9B, 0xFF, 0xEE, 0xFF, 0x98, 0x01, 0x93, 0xF9, - 0x10, 0x46, 0x03, 0x11, 0xA7, 0xF7, 0x12, 0x05, 0xF6, 0xFC, 0xA2, - 0x01, 0x4C, 0xFF, 0x2F, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00, - 0x36, 0xFF, 0xE1, 0x01, 0x52, 0xFC, 0x93, 0x06, 0x10, 0xF4, 0x78, - 0x1D, 0x90, 0x3F, 0x3E, 0xF4, 0xAA, 0x04, 0x19, 0xFE, 0xA4, 0x00, - 0xE2, 0xFF, 0xFA, 0xFF, 0x03, 0x00, 0x07, 0x00, 0xE8, 0xFF, 0x12, - 0x00, 0x42, 0x00, 0xC4, 0xFE, 0x94, 0x03, 0x02, 0xF6, 0x89, 0x42, - 0x76, 0x18, 0x5C, 0xF5, 0x12, 0x06, 0x84, 0xFC, 0xD1, 0x01, 0x3B, - 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x33, 0x00, 0x40, 0xFF, - 0xC3, 0x01, 0xA7, 0xFC, 0xC0, 0x05, 0x1E, 0xF6, 0xD8, 0x15, 0xE7, - 0x43, 0x20, 0xF7, 0xEF, 0x02, 0x27, 0xFF, 0x0A, 0x00, 0x2E, 0x00, - 0xDD, 0xFF, 0x09, 0x00, 0x02, 0x00, 0x03, 0x00, 0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x3F, 0xFF, 0x33, - 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x34, 0x00, 0x3C, 0xFF, 0xCF, 0x01, - 0x88, 0xFC, 0x09, 0x06, 0x71, 0xF5, 0x2B, 0x18, 0xB2, 0x42, 0x20, - 0xF6, 0x83, 0x03, 0xCF, 0xFE, 0x3C, 0x00, 0x15, 0x00, 0xE6, 0xFF, - 0x07, 0x00, 0x03, 0x00, 0xFB, 0xFF, 0xDF, 0xFF, 0xA9, 0x00, 0x10, - 0xFE, 0xB9, 0x04, 0x27, 0xF4, 0x5E, 0x3F, 0xC3, 0x1D, 0xFE, 0xF3, - 0x99, 0x06, 0x50, 0xFC, 0xE2, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, - 0xFF, 0xFF, 0xFF, 0x2F, 0x00, 0x4D, 0xFF, 0xA0, 0x01, 0xFB, 0xFC, - 0x07, 0x05, 0xBF, 0xF7, 0xBB, 0x10, 0x2B, 0x46, 0xBB, 0xF9, 0x83, - 0x01, 0xFA, 0xFF, 0x95, 0xFF, 0x68, 0x00, 0xC7, 0xFF, 0x0E, 0x00, - 0x00, 0x00, 0x13, 0x00, 0x9F, 0xFF, 0x28, 0x01, 0x3A, 0xFD, 0x00, - 0x06, 0x5A, 0xF2, 0xDF, 0x39, 0x73, 0x25, 0x79, 0xF2, 0x12, 0x07, - 0x31, 0xFC, 0xE3, 0x01, 0x3B, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x00, - 0x00, 0x27, 0x00, 0x66, 0xFF, 0x5E, 0x01, 0x90, 0xFD, 0xD2, 0x03, - 0x47, 0xFA, 0xC3, 0x09, 0x48, 0x48, 0x5A, 0xFE, 0x33, 0xFF, 0x45, - 0x01, 0xE2, 0xFE, 0xBE, 0x00, 0xA5, 0xFF, 0x16, 0x00, 0xFD, 0xFF, - 0x24, 0x00, 0x6D, 0xFF, 0x88, 0x01, 0xA2, 0xFC, 0xD0, 0x06, 0x8C, - 0xF1, 0x78, 0x33, 0xF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 0x34, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x24, - 0x00, 0x71, 0xFF, 0x43, 0x01, 0xC9, 0xFD, 0x60, 0x03, 0x2E, 0xFB, - 0x7E, 0x07, 0xAF, 0x48, 0x2D, 0x00, 0x58, 0xFE, 0xBB, 0x01, 0xA3, - 0xFE, 0xDD, 0x00, 0x99, 0xFF, 0x19, 0x00, 0xFD, 0xFF, 0x29, 0x00, - 0x60, 0xFF, 0xA2, 0x01, 0x7C, 0xFC, 0xFB, 0x06, 0x7C, 0xF1, 0x15, - 0x31, 0x73, 0x2F, 0x81, 0xF1, 0x10, 0x07, 0x67, 0xFC, 0xB1, 0x01, - 0x58, 0xFF, 0x2C, 0x00, 0xFD, 0xFF, 0x1B, 0x00, 0x91, 0xFF, 0xF1, - 0x00, 0x79, 0xFE, 0x0A, 0x02, 0xC3, 0xFD, 0x73, 0x01, 0xDB, 0x48, - 0x07, 0x06, 0xC7, 0xFB, 0x12, 0x03, 0xF1, 0xFD, 0x31, 0x01, 0x78, - 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x44, 0xFF, - 0xD5, 0x01, 0x3A, 0xFC, 0x2A, 0x07, 0xE3, 0xF1, 0xD1, 0x29, 0x46, - 0x36, 0xC5, 0xF1, 0x87, 0x06, 0xDA, 0xFC, 0x64, 0x01, 0x80, 0xFF, - 0x1E, 0x00, 0xFE, 0xFF, 0x12, 0x00, 0xB3, 0xFF, 0x99, 0x00, 0x2E, - 0xFF, 0xB6, 0x00, 0x36, 0x00, 0x47, 0xFC, 0x90, 0x47, 0xA4, 0x0C, - 0x31, 0xF9, 0x5A, 0x04, 0x4E, 0xFD, 0x7C, 0x01, 0x5B, 0xFF, 0x2A, - 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, - 0x37, 0xFC, 0xEB, 0x06, 0x0B, 0xF3, 0x35, 0x22, 0x52, 0x3C, 0xFD, - 0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, 0x6E, 0x01, 0x06, 0x00, 0x8E, - 0xFF, 0x6B, 0x00, 0xC6, 0xFF, 0x0E, 0x00, 0xFF, 0xFF, 0x13, 0x00, - 0x9D, 0xFF, 0x2D, 0x01, 0x33, 0xFD, 0x0B, 0x06, 0x4D, 0xF2, 0xA5, - 0x39, 0xBF, 0x25, 0x6D, 0xF2, 0x15, 0x07, 0x31, 0xFC, 0xE2, 0x01, - 0x3B, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x26, 0x00, 0x68, - 0xFF, 0x5B, 0x01, 0x96, 0xFD, 0xC6, 0x03, 0x61, 0xFA, 0x81, 0x09, - 0x57, 0x48, 0x8D, 0xFE, 0x1B, 0xFF, 0x52, 0x01, 0xDB, 0xFE, 0xC2, - 0x00, 0xA4, 0xFF, 0x16, 0x00, 0xFD, 0xFF, 0x25, 0x00, 0x6C, 0xFF, - 0x8B, 0x01, 0x9D, 0xFC, 0xD5, 0x06, 0x89, 0xF1, 0x35, 0x33, 0x3A, - 0x2D, 0x9A, 0xF1, 0x23, 0x07, 0x51, 0xFC, 0xC2, 0x01, 0x4F, 0xFF, - 0x2F, 0x00, 0xFD, 0xFF, 0x1E, 0x00, 0x87, 0xFF, 0x0B, 0x01, 0x42, - 0xFE, 0x74, 0x02, 0xF9, 0xFC, 0x39, 0x03, 0xF5, 0x48, 0x24, 0x04, - 0x94, 0xFC, 0xA9, 0x02, 0x27, 0xFE, 0x18, 0x01, 0x82, 0xFF, 0x1F, - 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x30, 0x00, 0x4B, 0xFF, 0xC9, 0x01, - 0x48, 0xFC, 0x28, 0x07, 0xAD, 0xF1, 0x19, 0x2C, 0x3F, 0x34, 0x97, - 0xF1, 0xBE, 0x06, 0xB0, 0xFC, 0x7F, 0x01, 0x72, 0xFF, 0x23, 0x00, - 0xFE, 0xFF, 0x15, 0x00, 0xA9, 0xFF, 0xB4, 0x00, 0xF7, 0xFE, 0x1D, - 0x01,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0x00, 0x02, 0x00, 0x05, 0x00, - 0xC5, 0xFF, 0xDE, 0x00, 0xB7, 0xFD, 0x45, 0x05, 0x56, 0xF3, 0x61, - 0x3D, 0xBA, 0x20, 0x56, 0xF3, 0xD3, 0x06, 0x3E, 0xFC, 0xE6, 0x01, - 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFF, 0xFF, 0x2C, 0x00, 0x56, - 0xFF, 0x88, 0x01, 0x31, 0xFD, 0x95, 0x04, 0xB4, 0xF8, 0xFC, 0x0D, - 0x26, 0x47, 0x64, 0xFB, 0xA7, 0x00, 0x77, 0x00, 0x51, 0xFF, 0x89, - 0x00, 0xBA, 0xFF, 0x11, 0x00, 0xFF, 0xFF, 0x1A, 0x00, 0x8A, 0xFF, - 0x51, 0x01, 0xF8, 0xFC, 0x5E, 0x06, 0xED, 0xF1, 0x82, 0x37, 0x60, - 0x28, 0x0E, 0xF2, 0x26, 0x07, 0x35, 0xFC, 0xDB, 0x01, 0x40, 0xFF, - 0x34, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x23, 0x00, 0x72, 0xFF, 0x40, - 0x01, 0xD0, 0xFD, 0x53, 0x03, 0x47, 0xFB, 0x3F, 0x07, 0xB8, 0x48, - 0x62, 0x00, 0x3F, 0xFE, 0xC8, 0x01, 0x9C, 0xFE, 0xE0, 0x00, 0x98, - 0xFF, 0x19, 0x00, 0xFD, 0xFF, 0x29, 0x00, 0x5F, 0xFF, 0xA5, 0x01, - 0x78, 0xFC, 0xFF, 0x06, 0x7D, 0xF1, 0xCF, 0x30, 0xB8, 0x2F, 0x80, - 0xF1, 0x0D, 0x07, 0x6A, 0xFC, 0xAE, 0x01, 0x59, 0xFF, 0x2B, 0x00, - 0xFD, 0xFF, 0x1B, 0x00, 0x93, 0xFF, 0xED, 0x00, 0x80, 0xFE, 0xFD, - 0x01, 0xDC, 0xFD, 0x3C, 0x01, 0xD5, 0x48, 0x45, 0x06, 0xAE, 0xFB, - 0x1F, 0x03, 0xEA, 0xFD, 0x34, 0x01, 0x77, 0xFF, 0x22, 0x00, 0x00, - 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x43, 0xFF, 0xD6, 0x01, 0x39, 0xFC, - 0x2A, 0x07, 0xEB, 0xF1, 0x87, 0x29, 0x85, 0x36, 0xCC, 0xF1, 0x7F, - 0x06, 0xE0, 0xFC, 0x60, 0x01, 0x82, 0xFF, 0x1D, 0x00, 0xFE, 0xFF, - 0x12, 0x00, 0xB5, 0xFF, 0x96, 0x00, 0x35, 0xFF, 0xA9, 0x00, 0x4D, - 0x00, 0x19, 0xFC, 0x7C, 0x47, 0xE8, 0x0C, 0x18, 0xF9, 0x66, 0x04, - 0x48, 0xFD, 0x7E, 0x01, 0x5A, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0xFD, - 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x38, 0xFC, 0xE6, 0x06, - 0x19, 0xF3, 0xEA, 0x21, 0x8A, 0x3C, 0x0E, 0xF3, 0x78, 0x05, 0x96, - 0xFD, 0xF1, 0x00, 0xBB, 0xFF, 0x08, 0x00, 0x01, 0x00, 0x0B, 0x00, - 0xD6, 0xFF, 0x41, 0x00, 0xE4, 0xFF, 0x6B, 0xFF, 0x7B, 0x02, 0xF0, - 0xF7, 0xBA, 0x44, 0x1E, 0x14, 0xA5, 0xF6, 0x86, 0x05, 0xC1, 0xFC, - 0xB9, 0x01, 0x44, 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x35, - 0x00, 0x39, 0xFF, 0xD8, 0x01, 0x70, 0xFC, 0x43, 0x06, 0xE1, 0xF4, - 0x38, 0x1A, 0x8C, 0x41, 0x55, 0xF5, 0xFC, 0x03, 0x85, 0xFE, 0x66, - 0x00, 0x01, 0x00, 0xEE, 0xFF, 0x06, 0x00, 0x05, 0x00, 0xF4, 0xFF, - 0xF2, 0xFF, 0x83, 0x00, 0x53, 0xFE, 0x4E, 0x04, 0xD0, 0x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x00, 0x53, 0xFF, 0xBA, 0x01, 0x5B, 0xFC, - 0x1B, 0x07, 0x8B, 0xF1, 0x58, 0x2E, 0x26, 0x32, 0x80, 0xF1, 0xEA, - 0x06, 0x8C, 0xFC, 0x97, 0x01, 0x66, 0xFF, 0x27, 0x00, 0xFD, 0xFF, - 0x17, 0x00, 0x9E, 0xFF, 0xCF, 0x00, 0xBF, 0xFE, 0x86, 0x01, 0xBA, - 0xFE, 0x5A, 0xFF, 0x86, 0x48, 0x7D, 0x08, 0xC7, 0xFA, 0x93, 0x03, - 0xB0, 0xFD, 0x4F, 0x01, 0x6C, 0xFF, 0x25, 0x00, 0x00, 0x00, 0xFD, - 0xFF, 0x35, 0x00, 0x3D, 0xFF, 0xDF, 0x01, 0x32, 0xFC, 0x1E, 0x07, - 0x40, 0xF2, 0xEB, 0x26, 0xB5, 0x38, 0x1F, 0xF2, 0x32, 0x06, 0x18, - 0xFD, 0x3D, 0x01, 0x94, 0xFF, 0x16, 0x00, 0xFF, 0xFF, 0x0F, 0x00, - 0xC0, 0xFF, 0x78, 0x00, 0x73, 0xFF, 0x38, 0x00, 0x17, 0x01, 0x8B, - 0xFA, 0xAF, 0x46, 0x59, 0x0F, 0x39, 0xF8, 0xCF, 0x04, 0x15, 0xFD, - 0x95, 0x01, 0x51, 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0x36, - 0x00, 0x36, 0xFF, 0xE5, 0x01, 0x46, 0xFC, 0xB8, 0x06, 0xA8, 0xF3, - 0x3F, 0x1F, 0x64, 0x3E, 0xBA, 0xF3, 0x01, 0x05, 0xE2, 0xFD, 0xC4, - 0x00, 0xD2, 0xFF, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0xE1, 0xFF, - 0x25, 0x00, 0x1D, 0x00, 0x05, 0xFF, 0x28, 0x03, 0xBD, 0xF6, 0x77, - 0x43, 0xB6, 0x16, 0xDC, 0xF5, 0xDD, 0x05, 0x9B, 0xFC, 0xC8, 0x01,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, 0x32, 0x82, 0x2D, 0x96, 0xF1, 0x21, - 0x07, 0x53, 0xFC, 0xC0, 0x01, 0x50, 0xFF, 0x2E, 0x00, 0xFD, 0xFF, - 0x1D, 0x00, 0x88, 0xFF, 0x07, 0x01, 0x49, 0xFE, 0x67, 0x02, 0x13, - 0xFD, 0xFF, 0x02, 0xF4, 0x48, 0x5F, 0x04, 0x7A, 0xFC, 0xB6, 0x02, - 0x20, 0xFE, 0x1B, 0x01, 0x81, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFD, - 0xFF, 0x30, 0x00, 0x4A, 0xFF, 0xCA, 0x01, 0x46, 0xFC, 0x29, 0x07, - 0xB3, 0xF1, 0xD1, 0x2B, 0x81, 0x34, 0x9C, 0xF1, 0xB8, 0x06, 0xB5, - 0xFC, 0x7C, 0x01, 0x74, 0xFF, 0x22, 0x00, 0xFE, 0xFF, 0x15, 0x00, - 0xAA, 0xFF, 0xB1, 0x00, 0xFE, 0xFE, 0x10, 0x01, 0x92, 0xFF, 0x94, - 0xFD, 0x0D, 0x48, 0xCB, 0x0A, 0xE2, 0xF9, 0x04, 0x04, 0x77, 0xFD, - 0x69, 0x01, 0x62, 0xFF, 0x28, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36, - 0x00, 0x39, 0xFF, 0xE5, 0x01, 0x32, 0xFC, 0x06, 0x07, 0xAA, 0xF2, - 0x46, 0x24, 0xC8, 0x3A, 0x90, 0xF2, 0xD6, 0x05, 0x57, 0xFD, 0x17, - 0x01, 0xA8, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x0D, 0x00, 0xCC, 0xFF, - 0x5A, 0x00, 0xAF, 0xFF, 0xCA, 0xFF, 0xD8, 0x01, 0x1C, 0xF9, 0xB8, - 0x45, 0xDA, 0x11, 0x60, 0xF7, 0x33, 0x05, 0xE7, 0xFC, 0xA9, 0x01, - 0x4A, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00, 0x37, - 0xFF, 0xDF, 0x01, 0x5A, 0xFC, 0x7E, 0x06, 0x47, 0xF4, 0x94, 0x1C, - 0x1F, 0x40, 0x85, 0xF4, 0x7D, 0x04, 0x36, 0xFE, 0x93, 0x00, 0xEA, - 0xFF, 0xF7, 0xFF, 0x04, 0x00, 0x06, 0x00, 0xEB, 0xFF, 0x09, 0x00, - 0x54, 0x00, 0xA4, 0xFE, 0xC9, 0x03, 0xAA, 0xF5, 0x0C, 0x42, 0x56, - 0x19, 0x1E, 0xF5, 0x2B, 0x06, 0x7A, 0xFC, 0xD4, 0x01, 0x3A, 0xFF, - 0x35, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x32, 0x00, 0x42, 0xFF, 0xBE, - 0x01, 0xB4, 0xFC, 0xA4, 0x05, 0x61, 0xF6, 0xFB, 0x14, 0x53, 0x44, - 0x86, 0xF7, 0xB6, 0x02, 0x49, 0xFF, 0xF7, 0xFF, 0x37, 0x00, 0xD9, - 0xFF, 0x0A, 0x00, 0x01, 0x00, 0x06, 0x00, 0xC2, 0xFF, 0xE3, 0x00, - 0xAE, 0xFD, 0x52, 0x05, 0x44, 0xF3, 0x2A, 0x3D, 0x06, 0x21, 0x47, - 0xF3, 0xD8, 0x06, 0x3C, 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, - 0xFD, 0xFF, 0x00, 0x00, 0x2B, 0x00, 0x57, 0xFF, 0x86, 0x01, 0x36, - 0xFD, 0x89, 0x04, 0xCD, 0xF8, 0xB7, 0x0D, 0x3D, 0x47, 0x91, 0xFB, - 0x91, 0x00, 0x83, 0x00, 0x4A, 0xFF, 0x8C, 0x00, 0xB9, 0xFF, 0x11, - 0x00, 0xFE, 0xFF, 0x1B, 0x00, 0x88, 0xFF, 0x55, 0x01, 0xF2, 0xFC, - 0x67, 0x06, 0xE4, 0xF1, 0x44, 0x37, 0xAA, 0x28, 0x05, 0xF2, 0x27, - 0x07, 0x36, 0xFC, 0xDA, 0x01, 0x41, 0xFF, 0x33, 0x00, 0xFD, 0xFF, - 0x00, 0x00, 0x23, 0x00, 0x73, 0xFF, 0x3D, 0x01, 0xD6, 0xFD, 0x46, - 0x03, 0x61, 0xFB, 0x00, 0x07, 0xBF, 0x48, 0x98, 0x00, 0x26, 0xFE, - 0xD5, 0x01, 0x95, 0xFE, 0xE3, 0x00, 0x96, 0xFF, 0x1A, 0x00, 0xFD, - 0xFF, 0x2A, 0x00, 0x5D, 0xFF, 0xA7, 0x01, 0x75, 0xFC, 0x03, 0x07, - 0x7D, 0xF1, 0x8A, 0x30, 0xFF, 0x2F, 0x7E, 0xF1, 0x0A, 0x07, 0x6E, - 0xFC, 0xAC, 0x01, 0x5A, 0xFF, 0x2B, 0x00, 0xFD, 0xFF, 0x1A, 0x00, - 0x94, 0xFF, 0xEA, 0x00, 0x87, 0xFE, 0xF0, 0x01, 0xF5, 0xFD, 0x05, - 0x01, 0xCE, 0x48, 0x83, 0x06, 0x94, 0xFB, 0x2C, 0x03, 0xE4, 0xFD, - 0x37, 0x01, 0x76, 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x33, - 0x00, 0x42, 0xFF, 0xD7, 0x01, 0x38, 0xFC, 0x29, 0x07, 0xF3, 0xF1, - 0x3E, 0x29, 0xC6, 0x36, 0xD4, 0xF1, 0x77, 0x06, 0xE6, 0xFC, 0x5C, - 0x01, 0x84, 0xFF, 0x1C, 0x00, 0xFE, 0xFF, 0x12, 0x00, 0xB6, 0xFF, - 0x93, 0x00, 0x3C, 0xFF, 0x9D, 0x00, 0x63, 0x00, 0xEB, 0xFB, 0x69, - 0x47, 0x2D, 0x0D, 0xFF, 0xF8, 0x72, 0x04, 0x42, 0xFD, 0x81, 0x01, - 0x59, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37, - 0xFF, 0xE6, 0x01, 0x3A, 0xFC, 0xE2, 0x06, 0x28, 0xF3, 0x9E, 0x21, - 0xC0, 0x3C, 0x1F, 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0xFA, 0x42, 0x01, - 0x1F, 0x00, 0x81, 0xFF, 0x71, 0x00, 0xC3, 0xFF, 0x0F, 0x00, 0xFF, - 0xFF, 0x15, 0x00, 0x98, 0xFF, 0x35, 0x01, 0x25, 0xFD, 0x1E, 0x06, - 0x35, 0xF2, 0x2E, 0x39, 0x55, 0x26, 0x56, 0xF2, 0x1A, 0x07, 0x31, - 0xFC, 0xE1, 0x01, 0x3C, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x00, 0x00, - 0x26, 0x00, 0x6A, 0xFF, 0x55, 0x01, 0xA3, 0xFD, 0xAD, 0x03, 0x94, - 0xFA, 0xFF, 0x08, 0x70, 0x48, 0xF3, 0xFE, 0xEA, 0xFE, 0x6C, 0x01, - 0xCD, 0xFE, 0xC9, 0x00, 0xA1, 0xFF, 0x17, 0x00, 0xFD, 0xFF, 0x26, - 0x00, 0x69, 0xFF, 0x91, 0x01, 0x94, 0xFC, 0xE0, 0x06, 0x84, 0xF1, - 0xAF, 0x32, 0xCA, 0x2D, 0x92, 0xF1, 0x1F, 0x07, 0x56, 0xFC, 0xBE, - 0x01, 0x51, 0xFF, 0x2E, 0x00, 0xFD, 0xFF, 0x1D, 0x00, 0x8A, 0xFF, - 0x04, 0x01, 0x50, 0xFE, 0x5A, 0x02, 0x2C, 0xFD, 0xC6, 0x02, 0xF2, - 0x48, 0x9B, 0x04, 0x61, 0xFC, 0xC3, 0x02, 0x19, 0xFE, 0x1E, 0x01, - 0x7F, 0xFF, 0x20, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x31, 0x00, 0x49, - 0xFF, 0xCC, 0x01, 0x44, 0xFC, 0x29, 0x07, 0xB9, 0xF1, 0x89, 0x2B, - 0xC3, 0x34, 0xA0, 0xF1, 0xB1, 0x06, 0xBA, 0xFC, 0x79, 0x01, 0x76, - 0xFF, 0x21, 0x00, 0xFE, 0xFF, 0x14, 0x00, 0xAC, 0xFF, 0xAE, 0x00, - 0x05, 0xFF, 0x03, 0x01, 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03, 0xDD, 0xFD, 0x3A, 0x01, 0x74, 0xFF, - 0x23, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x41, 0xFF, 0xD8, - 0x01, 0x37, 0xFC, 0x28, 0x07, 0xFC, 0xF1, 0xF3, 0x28, 0x04, 0x37, - 0xDC, 0xF1, 0x6F, 0x06, 0xEC, 0xFC, 0x59, 0x01, 0x86, 0xFF, 0x1C, - 0x00, 0xFE, 0xFF, 0x11, 0x00, 0xB7, 0xFF, 0x8F, 0x00, 0x43, 0xFF, - 0x90, 0x00, 0x7A, 0x00, 0xBE, 0xFB, 0x52, 0x47, 0x72, 0x0D, 0xE6, - 0xF8, 0x7E, 0x04, 0x3C, 0xFD, 0x83, 0x01, 0x58, 0xFF, 0x2B, 0x00, - 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3B, - 0xFC, 0xDD, 0x06, 0x37, 0xF3, 0x52, 0x21, 0xF6, 0x3C, 0x31, 0xF3, - 0x5F, 0x05, 0xA6, 0xFD, 0xE8, 0x00, 0xC0, 0xFF, 0x07, 0x00, 0x01, - 0x00, 0x0A, 0x00, 0xD8, 0xFF, 0x3A, 0x00, 0xF1, 0xFF, 0x54, 0xFF, - 0xA2, 0x02, 0xA9, 0xF7, 0x77, 0x44, 0xB1, 0x14, 0x77, 0xF6, 0x9A, - 0x05, 0xB8, 0xFC, 0xBC, 0x01, 0x42, 0xFF, 0x32, 0x00, 0xFF, 0xFF, - 0xFE, 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xD6, 0x01, 0x77, 0xFC, 0x33, - 0x06, 0x09, 0xF5, 0xA1, 0x19, 0xE1, 0x41, 0x8D, 0xF5, 0xDA, 0x03, - 0x9A, 0xFE, 0x5A, 0x00, 0x06, 0x00, 0xEC, 0xFF, 0x06, 0x00, 0x04, - 0x00, 0xF6, 0xFF, 0xED, 0xFF, 0x8E, 0x00, 0x3F, 0xFE, 0x6D, 0x04,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 0x36, 0x00, 0x37, 0xFF, 0xDE, 0x01, 0x5F, 0xFC, 0x70, 0x06, 0x6C, - 0xF4, 0xFD, 0x1B, 0x7D, 0x40, 0xB7, 0xF4, 0x5D, 0x04, 0x49, 0xFE, - 0x88, 0x00, 0xEF, 0xFF, 0xF5, 0xFF, 0x04, 0x00, 0x06, 0x00, 0xED, - 0xFF, 0x04, 0x00, 0x60, 0x00, 0x90, 0xFE, 0xEB, 0x03, 0x71, 0xF5, - 0xB7, 0x41, 0xED, 0x19, 0xF5, 0xF4, 0x3B, 0x06, 0x73, 0xFC, 0xD7, - 0x01, 0x39, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x32, 0x00, - 0x43, 0xFF, 0xBA, 0x01, 0xBC, 0xFC, 0x90, 0x05, 0x8E, 0xF6, 0x68, - 0x14, 0x99, 0x44, 0xCD, 0xF7, 0x8F, 0x02, 0x60, 0xFF, 0xEA, 0xFF, - 0x3E, 0x00, 0xD7, 0xFF, 0x0A, 0x00, 0x01, 0x00, 0x07, 0x00, 0xBD, - 0xFF, 0xED, 0x00, 0x9E, 0xFD, 0x6C, 0x05, 0x1F, 0xF3, 0xC0, 0x3C, - 0x9E, 0x21, 0x28, 0xF3, 0xE2, 0x06, 0x3A, 0xFC, 0xE6, 0x01, 0x37, - 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x2B, 0x00, 0x59, 0xFF, - 0x81, 0x01, 0x42, 0xFD, 0x72, 0x04, 0xFF, 0xF8, 0x2D, 0x0D, 0x69, - 0x47, 0xEB, 0xFB, 0x63, 0x00, 0x9D, 0x00, 0x3C, 0xFF, 0x93, 0x00, - 0xB6, 0xFF, 0x12, 0x00, 0xFE, 0xFF, 0x1C, 0x00, 0x84, 0xFF, 0x5C, - 0x01, 0xE6, 0xFC, 0x77, 0x06, 0xD4, 0xF1, 0xC6, 0x36, 0x3E, 0x29, - 0xF3, 0xF1, 0x29, 0x07, 0x38, 0xFC, 0xD7, 0x01, 0x42, 0xFF, 0x33, - 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x22, 0x00, 0x76, 0xFF, 0x37, 0x01, - 0xE4, 0xFD, 0x2C, 0x03, 0x94, 0xFB, 0x83, 0x06, 0xCE, 0x48, 0x05, - 0x01, 0xF5, 0xFD, 0xF0, 0x01, 0x87, 0xFE, 0xEA, 0x00, 0x94, 0xFF, - 0x1A, 0x00, 0xFD, 0xFF, 0x2B, 0x00, 0x5A, 0xFF, 0xAC, 0x01, 0x6E, - 0xFC, 0x0A, 0x07, 0x7E, 0xF1, 0xFF, 0x2F, 0x8A, 0x30, 0x7D, 0xF1, - 0x03, 0x07, 0x75, 0xFC, 0xA7, 0x01, 0x5D, 0xFF, 0x2A, 0x00, 0xFD, - 0xFF, 0x1A, 0x00, 0x96, 0xFF, 0xE3, 0x00, 0x95, 0xFE, 0xD5, 0x01, - 0x26, 0xFE, 0x98, 0x00, 0xBF, 0x48, 0x00, 0x07, 0x61, 0xFB, 0x46, - 0x03, 0xD6, 0xFD, 0x3D, 0x01, 0x73, 0xFF, 0x23, 0x00, 0x00, 0x00, - 0xFD, 0xFF, 0x33, 0x00, 0x41, 0xFF, 0xDA, 0x01, 0x36, 0xFC, 0x27, - 0x07, 0x05, 0xF2, 0xAA, 0x28, 0x44, 0x37, 0xE4, 0xF1, 0x67, 0x06, - 0xF2, 0xFC, 0x55, 0x01, 0x88, 0xFF, 0x1B, 0x00, 0xFE, 0xFF, 0x11, - 0x00, 0xB9, 0xFF, 0x8C, 0x00, 0x4A, 0xFF, 0x83, 0x00, 0x91, 0x00, - 0x91, 0xFB, 0x3D, 0x47, 0xB7, 0x0D, 0xCD, 0xF8, 0x89, 0x04, 0x36, - 0xFD, 0x86, 0x01, 0x57, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0xFD, 0xFF, - 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3C, 0xFC, 0xD8, 0x06, 0x47, - 0xF3, 0x06, 0x21, 0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69, 0x01, - 0x77, 0xFD, 0x04, 0x04, 0xE2, 0xF9, 0xCB, 0x0A, 0x0D, 0x48, 0x94, - 0xFD, 0x92, 0xFF, 0x10, 0x01, 0xFE, 0xFE, 0xB1, 0x00, 0xAA, 0xFF, - 0x15, 0x00, 0xFE, 0xFF, 0x22, 0x00, 0x74, 0xFF, 0x7C, 0x01, 0xB5, - 0xFC, 0xB8, 0x06, 0x9C, 0xF1, 0x81, 0x34, 0xD1, 0x2B, 0xB3, 0xF1, - 0x29, 0x07, 0x46, 0xFC, 0xCA, 0x01, 0x4A, 0xFF, 0x30, 0x00, 0xFD, - 0xFF, 0x00, 0x00, 0x1F, 0x00, 0x81, 0xFF, 0x1B, 0x01, 0x20, 0xFE, - 0xB6, 0x02, 0x7A, 0xFC, 0x5F, 0x04, 0xF4, 0x48, 0xFF, 0x02, 0x13, - 0xFD, 0x67, 0x02, 0x49, 0xFE, 0x07, 0x01, 0x88, 0xFF, 0x1D, 0x00, - 0xFD, 0xFF, 0x2E, 0x00, 0x50, 0xFF, 0xC0, 0x01, 0x53, 0xFC, 0x21, - 0x07, 0x96, 0xF1, 0x82, 0x2D, 0xF2, 0x32, 0x86, 0xF1, 0xDB, 0x06, - 0x99, 0xFC, 0x8E, 0x01, 0x6A, 0xFF, 0x25, 0x00, 0xFD, 0xFF, 0x16, - 0x00, 0xA2, 0xFF, 0xC5, 0x00, 0xD4, 0xFE, 0x5F, 0x01, 0x03, 0xFF, - 0xBF, 0xFE, 0x63, 0x48, 0x40, 0x09, 0x7B, 0xFA, 0xB9, 0x03, 0x9D, - 0xFD, 0x58, 0x01, 0x69, 0xFF, 0x26, 0x00, 0x00, 0x00, 0xFD, 0xFF, - 0x35, 0x00, 0x3B, 0xFF, 0xE2, 0x01, 0x31, 0xFC, 0x17, 0x07, 0x61, - 0xF2, 0x0A, 0x26, 0x6A, 0x39, 0x41, 0xF2, 0x15, 0x06, 0x2C, 0xFD, - 0x31, 0x01, 0x9B, 0xFF, 0x14, 0x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0xEA, 0x00, 0xD9, 0xFF, 0x03, 0xFD, - 0xDC, 0x47, 0x95, 0x0B, 0x96, 0xF9, 0x29, 0x04, 0x65, 0xFD, 0x71, - 0x01, 0x5F, 0xFF, 0x29, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00, - 0x38, 0xFF, 0xE6, 0x01, 0x34, 0xFC, 0xFB, 0x06, 0xD2, 0xF2, 0x64, - 0x23, 0x73, 0x3B, 0xBC, 0xF2, 0xB4, 0x05, 0x6E, 0xFD, 0x09, 0x01, - 0xAF, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0x0C, 0x00, 0xD0, 0xFF, 0x51, - 0x00, 0xC3, 0xFF, 0xA6, 0xFF, 0x16, 0x02, 0xA9, 0xF8, 0x5C, 0x45, - 0xB2, 0x12, 0x19, 0xF7, 0x52, 0x05, 0xD8, 0xFC, 0xAF, 0x01, 0x47, - 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00, 0x38, 0xFF, - 0xDD, 0x01, 0x62, 0xFC, 0x69, 0x06, 0x7F, 0xF4, 0xB2, 0x1B, 0xAB, - 0x40, 0xD0, 0xF4, 0x4E, 0x04, 0x53, 0xFE, 0x83, 0x00, 0xF2, 0xFF, - 0xF4, 0xFF, 0x05, 0x00, 0x06, 0x00, 0xEE, 0xFF, 0x01, 0x00, 0x66, - 0x00, 0x85, 0xFE, 0xFC, 0x03, 0x55, 0xF5, 0x8C, 0x41, 0x38, 0x1A, - 0xE1, 0xF4, 0x43, 0x06, 0x70, 0xFC, 0xD8, 0x01, 0x39, 0xFF, 0x35, - 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x32, 0x00, 0x44, 0xFF, 0xB9, 0x01, - 0xC1, 0xFC, 0x86, 0x05, 0xA5, 0xF6, 0x1E, 0x14, 0xBA, 0x44, 0xF0, - 0xF7, 0x7B, 0x02, 0x6B, 0xFF, 0xE4, 0xFF, 0x41, 0x00, 0xD6, 0xFF, - 0x0B, 0x00, 0x01, 0x00, 0x08, 0x00, 0xBB, 0xFF, 0xF1, 0x00, 0x96, - 0xFD, 0x78, 0x05, 0x0E, 0xF3, 0x8A, 0x3C, 0xEA, 0x21, 0x19, 0xF3, - 0xE6, 0x06, 0x38, 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, - 0xFF, 0x00, 0x00, 0x2B, 0x00, 0x5A, 0xFF, 0x7E, 0x01, 0x48, 0xFD, - 0x66, 0x04, 0x18, 0xF9, 0xE8, 0x0C, 0x7C, 0x47, 0x19, 0xFC, 0x4D, - 0x00, 0xA9, 0x00, 0x35, 0xFF, 0x96, 0x00, 0xB5, 0xFF, 0x12, 0x00, - 0xFE, 0xFF, 0x1D, 0x00, 0x82, 0xFF, 0x60, 0x01, 0xE0, 0xFC, 0x7F, - 0x06, 0xCC, 0xF1, 0x85, 0x36, 0x87, 0x29, 0xEB, 0xF1, 0x2A, 0x07, - 0x39, 0xFC, 0xD6, 0x01, 0x43, 0xFF, 0x33, 0x00, 0xFD, 0xFF, 0x00, - 0x00, 0x22, 0x00, 0x77, 0xFF, 0x34, 0x01, 0xEA, 0xFD, 0x1F, 0x03, - 0xAE, 0xFB, 0x45, 0x06, 0xD5, 0x48, 0x3C, 0x01, 0xDC, 0xFD, 0xFD, - 0x01, 0x80, 0xFE, 0xED, 0x00, 0x93, 0xFF, 0x1B, 0x00, 0xFD, 0xFF, - 0x2B, 0x00, 0x59, 0xFF, 0xAE, 0x01, 0x6A, 0xFC, 0x0D, 0x07, 0x80, - 0xF1, 0xB8, 0x2F, 0xCF, 0x30, 0x7D, 0xF1, 0xFF, 0x06, 0x78, 0xFC, - 0xA5, 0x01, 0x5F, 0xFF, 0x29, 0x00, 0xFD, 0xFF, 0x19, 0x00, 0x98, - 0xFF, 0xE0, 0x00, 0x9C, 0xFE, 0xC8, 0x01, 0x3F, 0xFE, 0x62, 0x00, - 0xB8, 0x48, 0x3F, 0x07, 0x47, 0xFB, 0x53, 0x03, 0xD0, 0xFD, 0x40, - 0x01, 0x72, 0xFF, 0x23, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x34, 0x00, - 0x40, 0xFF, 0xDB, 0x01, 0x35, 0xFC, 0x26, 0x07, 0x0E, 0xF2, 0x60, - 0x28, 0x82, 0x37, 0xED, 0xF1, 0x5E, 0x06, 0xF8, 0xFC, 0x51, 0x01, - 0x8A, 0xFF, 0x1A, 0x00, 0xFF, 0xFF, 0x11, 0x00, 0xBA, 0xFF, 0x89, - 0x00, 0x51, 0xFF, 0x77, 0x00, 0xA7, 0x00, 0x64, 0xFB, 0x26, 0x47, - 0xFC, 0x0D, 0xB4, 0xF8, 0x95, 0x04, 0x31, 0xFD, 0x88, 0x01, 0x56, - 0xFF, 0x2C, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, - 0xE6, 0x01, 0x3E, 0xFC, 0xD3, 0x06, 0x56, 0xF3, 0xBA, 0x20, 0x61, - 0x3D, 0x56, 0xF3, 0x45, 0x05, 0xB7, 0xFD, 0xDE, 0x00, 0xC5, 0xFF, - 0x05, 0x00, 0x02, 0x00, 0x09, 0x00, 0xDB, 0xFF, 0x34, 0x00, 0xFE, - 0xFF, 0x3D, 0xFF, 0xC9, 0x02, 0x64, 0xF7, 0x2F, 0x44, 0x44, 0x15, - 0x4A, 0xF6, 0xAD, 0x05, 0xAF, 0xFC, 0xC0, 0x01, 0x41, 0xFF, 0x32, - 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xD3, 0x01, - 0x7D, 0xFC, 0x23, 0x06, 0x32, 0xF5, 0x0C, 0x19, 0x38, 0x42, 0xC7, - 0xF5, 0xB8, 0x03, 0xAF, 0xFE, 0x4E, 0x00, 0x0C, 0x00, 0xEA, 0xFF, - 0x06, 0x00, 0x04, 0x00, 0xF8, 0xFF, 0xE7, 0xFF, 0x99, 0x00, 0x2C, - 0xFE, 0x8C, 0x04, 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C, 0xCE, 0x01, 0x3C, 0xFF, 0x34, 0x00, 0xFE, - 0xFF, 0xFF, 0xFF, 0x33, 0x00, 0x3F, 0xFF, 0xC6, 0x01, 0x9F, 0xFC, - 0xD3, 0x05, 0xF1, 0xF5, 0x6C, 0x16, 0x9E, 0x43, 0xDD, 0xF6, 0x15, - 0x03, 0x10, 0xFF, 0x17, 0x00, 0x28, 0x00, 0xDF, 0xFF, 0x09, 0x00, - 0x02, 0x00, 0x01, 0x00, 0xCF, 0xFF, 0xC9, 0x00, 0xDA, 0xFD, 0x0F, - 0x05, 0xA5, 0xF3, 0x31, 0x3E, 0x8A, 0x1F, 0x97, 0xF3, 0xBD, 0x06, - 0x44, 0xFC, 0xE5, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFF, - 0xFF, 0x2D, 0x00, 0x52, 0xFF, 0x92, 0x01, 0x1B, 0xFD, 0xC4, 0x04, - 0x51, 0xF8, 0x13, 0x0F, 0xC8, 0x46, 0xB6, 0xFA, 0x01, 0x01, 0x44, - 0x00, 0x6C, 0xFF, 0x7B, 0x00, 0xBF, 0xFF, 0x10, 0x00, 0xFF, 0xFF, - 0x17, 0x00, 0x92, 0xFF, 0x41, 0x01, 0x11, 0xFD, 0x3B, 0x06, 0x14, - 0xF2, 0x78, 0x38, 0x36, 0x27, 0x35, 0xF2, 0x20, 0x07, 0x33, 0xFC, - 0xDF, 0x01, 0x3E, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x25, - 0x00, 0x6D, 0xFF, 0x4C, 0x01, 0xB6, 0xFD, 0x86, 0x03, 0xE1, 0xFA, - 0x3D, 0x08, 0x92, 0x48, 0x8E, 0xFF, 0xA1, 0xFE, 0x93, 0x01, 0xB8, - 0xFE, 0xD3, 0x00, 0x9D, 0xFF, 0x18, 0x00, 0xFD, 0xFF, 0x28, 0x00, - 0x64, 0xFF, 0x9A, 0x01, 0x88, 0xFC, 0xEE, 0x06, 0x7E, 0xF1, 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D5, 0x01, - 0x44, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x22, 0x00, 0x78, - 0xFF, 0x31, 0x01, 0xF1, 0xFD, 0x12, 0x03, 0xC7, 0xFB, 0x07, 0x06, - 0xDB, 0x48, 0x73, 0x01, 0xC3, 0xFD, 0x0A, 0x02, 0x79, 0xFE, 0xF1, - 0x00, 0x91, 0xFF, 0x1B, 0x00, 0xFD, 0xFF, 0x2C, 0x00, 0x58, 0xFF, - 0xB1, 0x01, 0x67, 0xFC, 0x10, 0x07, 0x81, 0xF1, 0x73, 0x2F, 0x15, - 0x31, 0x7C, 0xF1, 0xFB, 0x06, 0x7C, 0xFC, 0xA2, 0x01, 0x60, 0xFF, - 0x29, 0x00, 0xFD, 0xFF, 0x19, 0x00, 0x99, 0xFF, 0xDD, 0x00, 0xA3, - 0xFE, 0xBB, 0x01, 0x58, 0xFE, 0x2D, 0x00, 0xAF, 0x48, 0x7E, 0x07, - 0x2E, 0xFB, 0x60, 0x03, 0xC9, 0xFD, 0x43, 0x01, 0x71, 0xFF, 0x24, - 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x34, 0x00, 0x3F, 0xFF, 0xDC, 0x01, - 0x34, 0xFC, 0x25, 0x07, 0x18, 0xF2, 0x15, 0x28, 0xBF, 0x37, 0xF7, - 0xF1, 0x56, 0x06, 0xFE, 0xFC, 0x4D, 0x01, 0x8C, 0xFF, 0x19, 0x00, - 0xFF, 0xFF, 0x10, 0x00, 0xBB, 0xFF, 0x85, 0x00, 0x58, 0xFF, 0x6A, - 0x00, 0xBE, 0x00, 0x38, 0xFB, 0x0F, 0x47, 0x42, 0x0E, 0x9B, 0xF8, - 0xA1, 0x04, 0x2B, 0xFD, 0x8B, 0x01, 0x55, 0xFF, 0x2C, 0x00, 0xFF, - 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3F, 0xFC, - 0xCE, 0x06, 0x66, 0xF3, 0x6F, 0x20, 0x96, 0x3D, 0x69, 0xF3, 0x38, - 0x05, 0xBF, 0xFD, 0xD9, 0x00, 0xC7, 0xFF, 0x04, 0x00, 0x02, 0x00, - 0x09, 0x00, 0xDC, 0xFF, 0x31, 0x00, 0x04, 0x00, 0x32, 0xFF, 0xDC, - 0x02, 0x42, 0xF7, 0x0B, 0x44, 0x8E, 0x15, 0x34, 0xF6, 0xB7, 0x05, - 0xAB, 0xFC, 0xC1, 0x01, 0x40, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0xFE, - 0xFF, 0x35, 0x00, 0x3B, 0xFF, 0xD2, 0x01, 0x81, 0xFC, 0x1A, 0x06, - 0x47, 0xF5, 0xC1, 0x18, 0x60, 0x42, 0xE4, 0xF5, 0xA6, 0x03, 0xB9, - 0xFE, 0x48, 0x00, 0x0F, 0x00, 0xE9, 0xFF, 0x07, 0x00, 0x04, 0x00, - 0xF9, 0xFF, 0xE4, 0xFF, 0x9F, 0x00, 0x23, 0xFE, 0x9B, 0x04, 0x55, - 0xF4, 0xC0, 0x3F, 0x2C, 0x1D, 0x22, 0xF4, 0x8C, 0x06, 0x55, 0xFC, - 0xE1, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x2F, - 0x00, 0x4B, 0xFF, 0xA4, 0x01, 0xF1, 0xFC, 0x1D, 0x05, 0x8F, 0xF7, - 0x4A, 0x11, 0xF2, 0x45, 0x6B, 0xF9, 0xAE, 0x01, 0xE2, 0xFF, 0xA2, - 0xFF, 0x61, 0x00, 0xC9, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0x11, 0x00, - 0xA3, 0xFF, 0x20, 0x01, 0x49, 0xFD, 0xEB, 0x05, 0x74, 0xF2, 0x54, - 0x3A, 0xDD, 0x24, 0x91, 0xF2, 0x0C, 0x07, 0x32, 0xFC, 0xE4, 0x01, - 0x3A, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x27, 0x00, 0x64, - 0xF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x07, 0x14, 0xFB, 0x6D, 0x03, - 0xC3, 0xFD, 0x46, 0x01, 0x70, 0xFF, 0x24, 0x00, 0x00, 0x00, 0xFD, - 0xFF, 0x34, 0x00, 0x3F, 0xFF, 0xDD, 0x01, 0x34, 0xFC, 0x23, 0x07, - 0x21, 0xF2, 0xCB, 0x27, 0xFE, 0x37, 0x00, 0xF2, 0x4D, 0x06, 0x04, - 0xFD, 0x49, 0x01, 0x8E, 0xFF, 0x19, 0x00, 0xFF, 0xFF, 0x10, 0x00, - 0xBD, 0xFF, 0x82, 0x00, 0x5E, 0xFF, 0x5D, 0x00, 0xD4, 0x00, 0x0C, - 0xFB, 0xF9, 0x46, 0x87, 0x0E, 0x82, 0xF8, 0xAD, 0x04, 0x26, 0xFD, - 0x8D, 0x01, 0x54, 0xFF, 0x2C, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0x36, - 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x41, 0xFC, 0xC8, 0x06, 0x76, 0xF3, - 0x22, 0x20, 0xCA, 0x3D, 0x7D, 0xF3, 0x2A, 0x05, 0xC8, 0xFD, 0xD4, - 0x00, 0xCA, 0xFF, 0x03, 0x00, 0x02, 0x00, 0x09, 0x00, 0xDD, 0xFF, - 0x2E, 0x00, 0x0A, 0x00, 0x27, 0xFF, 0xEF, 0x02, 0x20, 0xF7, 0xE7, - 0x43, 0xD8, 0x15, 0x1E, 0xF6, 0xC0, 0x05, 0xA7, 0xFC, 0xC3, 0x01, - 0x40, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x34, 0x00, 0x3B, - 0xFF, 0xD1, 0x01, 0x84, 0xFC, 0x12, 0x06, 0x5C, 0xF5, 0x76, 0x18, - 0x89, 0x42, 0x02, 0xF6, 0x94, 0x03, 0xC4, 0xFE, 0x42, 0x00, 0x12, - 0x00, 0xE8, 0xFF, 0x07, 0x00, 0x03, 0x00, 0xFA, 0xFF, 0xE2, 0xFF, - 0xA4, 0x00, 0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xDF, 0x03, 0x8A, 0xFD, 0x60, 0x01, 0x65, 0xFF, - 0x27, 0x00, 0x00, 0x00, 0x0E, 0x00, 0xC8, 0xFF, 0x64, 0x00, 0x9B, - 0xFF, 0xEE, 0xFF, 0x98, 0x01, 0x93, 0xF9, 0x10, 0x46, 0x03, 0x11, - 0xA7, 0xF7, 0x12, 0x05, 0xF6, 0xFC, 0xA2, 0x01, 0x4C, 0xFF, 0x2F, - 0x00, 0xFF, 0xFF, 0x07, 0x00, 0xE8, 0xFF, 0x12, 0x00, 0x42, 0x00, - 0xC4, 0xFE, 0x94, 0x03, 0x02, 0xF6, 0x89, 0x42, 0x76, 0x18, 0x5C, - 0xF5, 0x12, 0x06, 0x84, 0xFC, 0xD1, 0x01, 0x3B, 0xFF, 0x34, 0x00, - 0xFE, 0xFF, 0x02, 0x00, 0x03, 0x00, 0xCA, 0xFF, 0xD4, 0x00, 0xC8, - 0xFD, 0x2A, 0x05, 0x7D, 0xF3, 0xCA, 0x3D, 0x22, 0x20, 0x76, 0xF3, - 0xC8, 0x06, 0x41, 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, - 0xFF, 0xFF, 0xFF, 0x19, 0x00, 0x8E, 0xFF, 0x49, 0x01, 0x04, 0xFD, - 0x4D, 0x06, 0x00, 0xF2, 0xFE, 0x37, 0xCB, 0x27, 0x21, 0xF2, 0x23, - 0x07, 0x34, 0xFC, 0xDD, 0x01, 0x3F, 0xFF, 0x34, 0x00, 0xFD, 0xFF, - 0xFD, 0xFF, 0x29, 0x00, 0x61, 0xFF, 0x9F, 0x01, 0x80, 0xFC, 0xF7, - 0x06, 0x7D, 0xF1, 0x5A, 0x31, 0x2C, 0x2F, 0x83, 0xF1, 0x13, 0x07, - 0x64, 0xFC, 0xB3, 0x01, 0x57, 0xFF, 0x2C, 0x00, 0xFD, 0xFF, 0xFD, - 0xFF, 0x32, 0x00, 0x44, 0xFF, 0xD3, 0x01, 0x3C, 0xFC, 0x2A, 0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0x4E, - 0xFC, 0xC3, 0x01, 0x4E, 0xFF, 0x2F, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, - 0x30, 0x00, 0x4C, 0xFF, 0xC7, 0x01, 0x4A, 0xFC, 0x27, 0x07, 0xA8, - 0xF1, 0x62, 0x2C, 0xFD, 0x33, 0x93, 0xF1, 0xC4, 0x06, 0xAB, 0xFC, - 0x82, 0x01, 0x71, 0xFF, 0x23, 0x00, 0xFE, 0xFF, 0xFD, 0xFF, 0x36, - 0x00, 0x3A, 0xFF, 0xE4, 0x01, 0x32, 0xFC, 0x0C, 0x07, 0x91, 0xF2, - 0xDD, 0x24, 0x54, 0x3A, 0x74, 0xF2, 0xEB, 0x05, 0x49, 0xFD, 0x20, - 0x01, 0xA3, 0xFF, 0x11, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x36, 0x00, - 0x37, 0xFF, 0xE1, 0x01, 0x55, 0xFC, 0x8C, 0x06, 0x22, 0xF4, 0x2C, - 0x1D, 0xC0, 0x3F, 0x55, 0xF4, 0x9B, 0x04, 0x23, 0xFE, 0x9F, 0x00, - 0xE4, 0xFF, 0xF9, 0xFF, 0x04, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0x40, - 0xFF, 0xC1, 0x01, 0xAB, 0xFC, 0xB7, 0x05, 0x34, 0xF6, 0x8E, 0x15, - 0x0B, 0x44, 0x42, 0xF7, 0xDC, 0x02, 0x32, 0xFF, 0x04, 0x00, 0x31, - 0x00, 0xDC, 0xFF, 0x09, 0x00, 0xFF, 0xFF, 0x2C, 0x00, 0x55, 0xFF, - 0x8B, 0x01, 0x2B, 0xFD, 0xA1, 0x04, 0x9B, 0xF8, 0x42, 0x0E, 0x0F, - 0x47, 0x38, 0xFB, 0xBE, 0x00, 0x6A, 0x00, 0x58, 0xFF, 0x85, 0x00, - 0xBB, 0xFF, 0x10, 0x00, 0x00, 0x00, 0x24, 0x00, 0x71, 0xFF, 0x43, - 0x01, 0xC9, 0xFD, 0x60, 0x03, 0x2E, 0xFB, 0x7E, 0x07, 0xAF, 0x48, - 0x2D, 0x00, 0x58, 0xFE, 0xBB, 0x01, 0xA3, 0xFE, 0xDD, 0x00, 0x99, - 0xFF, 0x19, 0x00, 0x1B, 0x00, 0x91, 0xFF, 0xF1, 0x00, 0x79, 0xFE, - 0x0A, 0x02, 0xC3, 0xFD, 0x73, 0x01, 0xDB, 0x48, 0x07, 0x06, 0xC7, - 0xFB, 0x12, 0x03, 0xF1, 0xFD, 0x31, 0x01, 0x78, 0xFF, 0x22, 0x00, - 0x00, 0x00, 0x12, 0x00, 0xB3, 0xFF, 0x99, 0x00, 0x2E, 0xFF, 0xB6, - 0x00, 0x36, 0x00, 0x47, 0xFC, 0x90, 0x47, 0xA4, 0x0C, 0x31, 0xF9, - 0x5A, 0x04, 0x4E, 0xFD, 0x7C, 0x01, 0x5B, 0xFF, 0x2A, 0x00, 0x00, - 0x00, 0x0B, 0x00, 0xD5, 0xFF, 0x44, 0x00, 0xDD, 0xFF, 0x77, 0xFF, - 0x67, 0x02, 0x14, 0xF8, 0xDC, 0x44, 0xD5, 0x13, 0xBC, 0xF6, 0x7C, - 0x05, 0xC5, 0xFC, 0xB7, 0x01, 0x44, 0xFF, 0x31, 0x00, 0xFF, 0xFF, - 0x05, 0x00, 0xF3, 0xFF, 0xF5, 0xFF, 0x7D, 0x00, 0x5D, 0xFE, 0x3E, - 0x04, 0xEA, 0xF4, 0xD9, 0x40, 0x66, 0x1B, 0x93, 0xF4, 0x62, 0x06, - 0x64, 0xFC, 0xDC, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x00, - 0x00, 0x0C, 0x00, 0xB1, 0xFF, 0x04, 0x01, 0x76, 0xFD, 0xA8, 0x05, - 0xCC, 0xF2, 0xAB, 0x3B, 0x18, 0x23, 0xE0, 0xF2, 0xF7, 0x06, 0x35, - 0xFC, 0xE6, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFE, 0xFF, - 0x20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E, 0xFF, 0x6B, 0x00, 0xC6, - 0xFF, 0x0E, 0x00, 0x00, 0x00, 0x26, 0x00, 0x68, 0xFF, 0x5B, 0x01, - 0x96, 0xFD, 0xC6, 0x03, 0x61, 0xFA, 0x81, 0x09, 0x57, 0x48, 0x8D, - 0xFE, 0x1B, 0xFF, 0x52, 0x01, 0xDB, 0xFE, 0xC2, 0x00, 0xA4, 0xFF, - 0x16, 0x00, 0x1E, 0x00, 0x87, 0xFF, 0x0B, 0x01, 0x42, 0xFE, 0x74, - 0x02, 0xF9, 0xFC, 0x39, 0x03, 0xF5, 0x48, 0x24, 0x04, 0x94, 0xFC, - 0xA9, 0x02, 0x27, 0xFE, 0x18, 0x01, 0x82, 0xFF, 0x1F, 0x00, 0x00, - 0x00, 0x15, 0x00, 0xA9, 0xFF, 0xB4, 0x00, 0xF7, 0xFE, 0x1D, 0x01, - 0x7A, 0xFF, 0xC5, 0xFD, 0x1D, 0x48, 0x89, 0x0A, 0xFB, 0xF9, 0xF8, - 0x03, 0x7D, 0xFD, 0x66, 0x01, 0x63, 0xFF, 0x28, 0x00, 0x00, 0x00, - 0x0D, 0x00, 0xCB, 0xFF, 0x5E, 0x00, 0xA9, 0xFF, 0xD6, 0xFF, 0xC3, - 0x01, 0x43, 0xF9, 0xD7, 0x45, 0x92, 0x11, 0x77, 0xF7, 0x28, 0x05, - 0xEC, 0xFC, 0xA7, 0x01, 0x4A, 0xFF, 0x2F, 0x00, 0xFF, 0xFF, 0x06, - 0x00, 0xEA, 0xFF, 0x0C, 0x00, 0x4E, 0x00, 0xAF, 0xFE, 0xB8, 0x03, - 0xC7, 0xF5, 0x38, 0x42, 0x0C, 0x19, 0x32, 0xF5, 0x23, 0x06, 0x7D, - 0xFC, 0xD3, 0x01, 0x3A, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x02, 0x00, - 0x05, 0x00, 0xC5, 0xFF, 0xDE, 0x00, 0xB7, 0xFD, 0x45, 0x05, 0x56, - 0xF3, 0x61, 0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F, 0xAF, 0x01, - 0xD8, 0xFC, 0x52, 0x05, 0x19, 0xF7, 0xB2, 0x12, 0x5C, 0x45, 0xA9, - 0xF8, 0x16, 0x02, 0xA6, 0xFF, 0xC3, 0xFF, 0x51, 0x00, 0xD0, 0xFF, - 0x0C, 0x00, 0x00, 0x00, 0x29, 0x00, 0x5F, 0xFF, 0x71, 0x01, 0x65, - 0xFD, 0x29, 0x04, 0x96, 0xF9, 0x95, 0x0B, 0xDC, 0x47, 0x03, 0xFD, - 0xD9, 0xFF, 0xEA, 0x00, 0x12, 0xFF, 0xA7, 0x00, 0xAE, 0xFF, 0x14, - 0x00, 0x00, 0x00, 0x20, 0x00, 0x7D, 0xFF, 0x24, 0x01, 0x0C, 0xFE, - 0xDE, 0x02, 0x2E, 0xFC, 0x13, 0x05, 0xEC, 0x48, 0x54, 0x02, 0x5E, - 0xFD, 0x3F, 0x02, 0x5D, 0xFE, 0xFE, 0x00, 0x8C, 0xFF, 0x1C, 0x00, - 0x17, 0x00, 0x9E, 0xFF, 0xCF, 0x00, 0xBF, 0xFE, 0x86, 0x01, 0xBA, - 0xFE, 0x5A, 0xFF, 0x86, 0x48, 0x7D, 0x08, 0xC7, 0xFA, 0x93, 0x03, - 0xB0, 0xFD, 0x4F, 0x01, 0x6C, 0xFF, 0x25, 0x00, 0x00, 0x00, 0x0F, - 0x00, 0xC0, 0xFF, 0x78, 0x00, 0x73, 0xFF, 0x38, 0x00, 0x17, 0x01, - 0x8B, 0xFA, 0xAF, 0x46, 0x59, 0x0F, 0x39, 0xF8, 0xCF, 0x04, 0x15, - 0xFD, 0x95, 0x01, 0x51, 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0x08, 0x00, - 0xE1, 0xFF, 0x25, 0x00, 0x1D, 0x00, 0x05, 0xFF, 0x28, 0x03, 0xBD, - 0xF6, 0x77, 0x43, 0xB6, 0x16, 0xDC, 0xF5, 0xDD, 0x05, 0x9B, 0xFC, - 0xC8, 0x01, 0x3E, 0xFF, 0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40, 0x85, - 0xF4, 0x7D, 0x04, 0x36, 0xFE, 0x93, 0x00, 0xEA, 0xFF, 0xF7, 0xFF, - 0x04, 0x00, 0xFF, 0xFF, 0x32, 0x00, 0x42, 0xFF, 0xBE, 0x01, 0xB4, - 0xFC, 0xA4, 0x05, 0x61, 0xF6, 0xFB, 0x14, 0x53, 0x44, 0x86, 0xF7, - 0xB6, 0x02, 0x49, 0xFF, 0xF7, 0xFF, 0x37, 0x00, 0xD9, 0xFF, 0x0A, - 0x00, 0x00, 0x00, 0x2B, 0x00, 0x57, 0xFF, 0x86, 0x01, 0x36, 0xFD, - 0x89, 0x04, 0xCD, 0xF8, 0xB7, 0x0D, 0x3D, 0x47, 0x91, 0xFB, 0x91, - 0x00, 0x83, 0x00, 0x4A, 0xFF, 0x8C, 0x00, 0xB9, 0xFF, 0x11, 0x00, - 0x00, 0x00, 0x23, 0x00, 0x73, 0xFF, 0x3D, 0x01, 0xD6, 0xFD, 0x46, - 0x03, 0x61, 0xFB, 0x00, 0x07, 0xBF, 0x48, 0x98, 0x00, 0x26, 0xFE, - 0xD5, 0x01, 0x95, 0xFE, 0xE3, 0x00, 0x96, 0xFF, 0x1A, 0x00, 0x1A, - 0x00, 0x94, 0xFF, 0xEA, 0x00, 0x87, 0xFE, 0xF0, 0x01, 0xF5, 0xFD, - 0x05, 0x01, 0xCE, 0x48, 0x83, 0x06, 0x94, 0xFB, 0x2C, 0x03, 0xE4, - 0xFD, 0x37, 0x01, 0x76, 0xFF, 0x22, 0x00, 0x00, 0x00, 0x12, 0x00, - 0xB6, 0xFF, 0x93, 0x00, 0x3C, 0xFF, 0x9D, 0x00, 0x63, 0x00, 0xEB, - 0xFB, 0x69, 0x47, 0x2D, 0x0D, 0xFF, 0xF8, 0x72, 0x04, 0x42, 0xFD, - 0x81, 0x01, 0x59, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0x0A, 0x00, 0xD7, - 0xFF, 0x3E, 0x00, 0xEA, 0xFF, 0x60, 0xFF, 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0x11, 0x04, 0x71, 0xFD, 0x6C, - 0x01, 0x61, 0xFF, 0x28, 0x00, 0x00, 0x00, 0x0C, 0x00, 0xCD, 0xFF, - 0x57, 0x00, 0xB6, 0xFF, 0xBE, 0xFF, 0xED, 0x01, 0xF5, 0xF8, 0x9B, - 0x45, 0x22, 0x12, 0x48, 0xF7, 0x3D, 0x05, 0xE2, 0xFC, 0xAB, 0x01, - 0x49, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0x06, 0x00, 0xEC, 0xFF, 0x06, - 0x00, 0x5A, 0x00, 0x9A, 0xFE, 0xDA, 0x03, 0x8D, 0xF5, 0xE1, 0x41, - 0xA1, 0x19, 0x09, 0xF5, 0x33, 0x06, 0x77, 0xFC, 0xD6, 0x01, 0x3A, - 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x07, 0x00, 0xC0, 0xFF, - 0xE8, 0x00, 0xA6, 0xFD, 0x5F, 0x05, 0x31, 0xF3, 0xF6, 0x3C, 0x52, - 0x21, 0x37, 0xF3, 0xDD, 0x06, 0x3B, 0xFC, 0xE6, 0x01, 0x36, 0xFF, - 0x36, 0x00, 0xFD, 0xFF, 0xFE, 0xFF, 0x1C, 0x00, 0x86, 0xFF, 0x59, - 0x01, 0xEC, 0xFC, 0x6F, 0x06, 0xDC, 0xF1, 0x04, 0x37, 0xF3, 0x28, - 0xFC, 0xF1, 0x28, 0x07, 0x37, 0xFC, 0xD8, 0x01, 0x41, 0xFF, 0x33, - 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x2A, 0x00, 0x5C, 0xFF, 0xAA, 0x01, - 0x71, 0xFC, 0x07, 0x07, 0x7E, 0xF1, 0x44, 0x30, 0x44, 0x30, 0x7E, - 0xF1, 0x07, 0x07, 0x71, 0xFC, 0xAA, 0x01, 0x5C, 0xFF, 0x2A, 0x00, - 0xFD, 0xFF, 0xFD, 0xFF, 0x33, 0x00, 0x41, 0xFF, 0xD8, 0x01, 0x37, - 0xFC, 0x28, 0x07, 0xFC, 0xF1, 0xF3, 0x28, 0x04, 0x37, 0xDC, 0xF1, - 0x6F, 0x06, 0xEC, 0xFC, 0x59, 0x01, 0x86, 0xFF, 0x1C, 0x00, 0xFE, - 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3B, 0xFC, - 0xDD, 0x06, 0x37, 0xF3, 0x52, 0x21, 0xF6, 0x3C, 0x31, 0xF3, 0x5F, - 0x05, 0xA6, 0xFD, 0xE8, 0x00, 0xC0, 0xFF, 0x07, 0x00, 0x01, 0x00, - 0xFE, 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xD6, 0x01, 0x77, 0xFC, 0x33, - 0x06, 0x09, 0xF5, 0xA1, 0x19, 0xE1, 0x41, 0x8D, 0xF5, 0xDA, 0x03, - 0x9A, 0xFE, 0x5A, 0x00, 0x06, 0x00, 0xEC, 0xFF, 0x06, 0x00, 0xFF, - 0xFF, 0x30, 0x00, 0x49, 0xFF, 0xAB, 0x01, 0xE2, 0xFC, 0x3D, 0x05, - 0x48, 0xF7, 0x22, 0x12, 0x9B, 0x45, 0xF5, 0xF8, 0xED, 0x01, 0xBE, - 0xFF, 0xB6, 0xFF, 0x57, 0x00, 0xCD, 0xFF, 0x0C, 0x00, 0x00, 0x00, - 0x28, 0x00, 0x61, 0xFF, 0x6C, 0x01, 0x71, 0xFD, 0x11, 0x04, 0xC8, - 0xF9, 0x0E, 0x0B, 0xFD, 0x47, 0x63, 0xFD, 0xAA, 0xFF, 0x03, 0x01, - 0x05, 0xFF, 0xAE, 0x00, 0xAC, 0xFF, 0x14, 0x00, 0x00, 0x00, 0x20, - 0x00, 0x7F, 0xFF, 0x1E, 0x01, 0x19, 0xFE, 0xC3, 0x02, 0x61, 0xFC, - 0x9B, 0x04, 0xF2, 0x48, 0xC6, 0x02, 0x2C, 0xFD, 0x5A, 0x02, 0x50, - 0xFE, 0x04, 0x01, 0x8A, 0xFF, 0x1D, 0x00, 0x17, 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, 0x94, 0xFB, 0x83, - 0x06, 0xCE, 0x48, 0x05, 0x01, 0xF5, 0xFD, 0xF0, 0x01, 0x87, 0xFE, - 0xEA, 0x00, 0x94, 0xFF, 0x1A, 0x00, 0x1A, 0x00, 0x96, 0xFF, 0xE3, - 0x00, 0x95, 0xFE, 0xD5, 0x01, 0x26, 0xFE, 0x98, 0x00, 0xBF, 0x48, - 0x00, 0x07, 0x61, 0xFB, 0x46, 0x03, 0xD6, 0xFD, 0x3D, 0x01, 0x73, - 0xFF, 0x23, 0x00, 0x00, 0x00, 0x11, 0x00, 0xB9, 0xFF, 0x8C, 0x00, - 0x4A, 0xFF, 0x83, 0x00, 0x91, 0x00, 0x91, 0xFB, 0x3D, 0x47, 0xB7, - 0x0D, 0xCD, 0xF8, 0x89, 0x04, 0x36, 0xFD, 0x86, 0x01, 0x57, 0xFF, - 0x2B, 0x00, 0x00, 0x00, 0x0A, 0x00, 0xD9, 0xFF, 0x37, 0x00, 0xF7, - 0xFF, 0x49, 0xFF, 0xB6, 0x02, 0x86, 0xF7, 0x53, 0x44, 0xFB, 0x14, - 0x61, 0xF6, 0xA4, 0x05, 0xB4, 0xFC, 0xBE, 0x01, 0x42, 0xFF, 0x32, - 0x00, 0xFF, 0xFF, 0x04, 0x00, 0xF7, 0xFF, 0xEA, 0xFF, 0x93, 0x00, - 0x36, 0xFE, 0x7D, 0x04, 0x85, 0xF4, 0x1F, 0x40, 0x94, 0x1C, 0x47, - 0xF4, 0x7E, 0x06, 0x5A, 0xFC, 0xDF, 0x01, 0x37, 0xFF, 0x36, 0x00, - 0xFE, 0xFF, 0x00, 0x00, 0x0F, 0x00, 0xA8, 0xFF, 0x17, 0x01, 0x57, - 0xFD, 0xD6, 0x05, 0x90, 0xF2, 0xC8, 0x3A, 0x46, 0x24, 0xAA, 0xF2, - 0x06, 0x07, 0x32, 0xFC, 0xE5, 0x01, 0x39, 0xFF, 0x36, 0x00, 0xFD, - 0xFF, 0xFE, 0xFF, 0x22, 0x00,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xFF, - 0x78, 0x00, 0xC0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x25, 0x00, 0x6C, - 0xFF, 0x4F, 0x01, 0xB0, 0xFD, 0x93, 0x03, 0xC7, 0xFA, 0x7D, 0x08, - 0x86, 0x48, 0x5A, 0xFF, 0xBA, 0xFE, 0x86, 0x01, 0xBF, 0xFE, 0xCF, - 0x00, 0x9E, 0xFF, 0x17, 0x00, 0x1C, 0x00, 0x8C, 0xFF, 0xFE, 0x00, - 0x5D, 0xFE, 0x3F, 0x02, 0x5E, 0xFD, 0x54, 0x02, 0xEC, 0x48, 0x13, - 0x05, 0x2E, 0xFC, 0xDE, 0x02, 0x0C, 0xFE, 0x24, 0x01, 0x7D, 0xFF, - 0x20, 0x00, 0x00, 0x00, 0x14, 0x00, 0xAE, 0xFF, 0xA7, 0x00, 0x12, - 0xFF, 0xEA, 0x00, 0xD9, 0xFF, 0x03, 0xFD, 0xDC, 0x47, 0x95, 0x0B, - 0x96, 0xF9, 0x29, 0x04, 0x65, 0xFD, 0x71, 0x01, 0x5F, 0xFF, 0x29, - 0x00, 0x00, 0x00, 0x0C, 0x00, 0xD0, 0xFF, 0x51, 0x00, 0xC3, 0xFF, - 0xA6, 0xFF, 0x16, 0x02, 0xA9, 0xF8, 0x5C, 0x45, 0xB2, 0x12, 0x19, - 0xF7, 0x52, 0x05, 0xD8, 0xFC, 0xAF, 0x01, 0x47, 0xFF, 0x30, 0x00, - 0xFF, 0xFF, 0x06, 0x00, 0xEE, 0xFF, 0x01, 0x00, 0x66, 0x00, 0x85, - 0xFE, 0xFC, 0x03, 0x55, 0xF5, 0x8C, 0x41, 0x38, 0x1A, 0xE1, 0xF4, - 0x43, 0x06, 0x70, 0xFC, 0xD8, 0x01, 0x39, 0xFF, 0x35, 0x00, 0xFE, - 0xFF, 0x01, 0x00, 0x08, 0x00, 0xBB, 0xFF, 0xF1, 0x00, 0x96, 0xFD, - 0x78, 0x05, 0x0E, 0xF3, 0x8A, 0x3C, 0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F, 0xA7, 0x01, 0xEC, 0xFC, 0x28, 0x05, 0x77, 0xF7, 0x92, 0x11, - 0xD7, 0x45, 0x43, 0xF9, 0xC3, 0x01, 0xD6, 0xFF, 0xA9, 0xFF, 0x5E, - 0x00, 0xCB, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0x28, 0x00, 0x63, 0xFF, - 0x66, 0x01, 0x7D, 0xFD, 0xF8, 0x03, 0xFB, 0xF9, 0x89, 0x0A, 0x1D, - 0x48, 0xC5, 0xFD, 0x7A, 0xFF, 0x1D, 0x01, 0xF7, 0xFE, 0xB4, 0x00, - 0xA9, 0xFF, 0x15, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x82, 0xFF, 0x18, - 0x01, 0x27, 0xFE, 0xA9, 0x02, 0x94, 0xFC, 0x24, 0x04, 0xF5, 0x48, - 0x39, 0x03, 0xF9, 0xFC, 0x74, 0x02, 0x42, 0xFE, 0x0B, 0x01, 0x87, - 0xFF, 0x1E, 0x00, 0x16, 0x00, 0xA4, 0xFF, 0xC2, 0x00, 0xDB, 0xFE, - 0x52, 0x01, 0x1B, 0xFF, 0x8D, 0xFE, 0x57, 0x48, 0x81, 0x09, 0x61, - 0xFA, 0xC6, 0x03, 0x96, 0xFD, 0x5B, 0x01, 0x68, 0xFF, 0x26, 0x00, - 0x00, 0x00, 0x0E, 0x00, 0xC6, 0xFF, 0x6B, 0x00, 0x8E, 0xFF, 0x06, - 0x00, 0x6E, 0x01, 0xE4, 0xF9, 0x48, 0x46, 0x75, 0x10, 0xD7, 0xF7, - 0xFC, 0x04, 0x00, 0xFD, 0x9E, 0x01, 0x4E, 0xFF, 0x2E, 0x00, 0xFF, - 0xFF, 0x07, 0x00, 0xE5, 0xFF, 0x18, 0x00, 0x36, 0x00, 0xD9, 0xFE, - 0x71, 0x03, 0x3F, 0xF6, 0xDB, 0x42, 0xE0, 0x17, 0x86, 0xF5, 0x00, - 0x06, 0x8C, 0xFC, 0xCE, 0x01, 0x3C, 0xFF, 0x34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EA, 0xF4, 0x3E, 0x04, 0x5D, 0xFE, 0x7D, 0x00, 0xF5, - 0xFF, 0xF3, 0xFF, 0x05, 0x00, 0xFF, 0xFF, 0x31, 0x00, 0x44, 0xFF, - 0xB7, 0x01, 0xC5, 0xFC, 0x7C, 0x05, 0xBC, 0xF6, 0xD5, 0x13, 0xDC, - 0x44, 0x14, 0xF8, 0x67, 0x02, 0x77, 0xFF, 0xDD, 0xFF, 0x44, 0x00, - 0xD5, 0xFF, 0x0B, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x5B, 0xFF, 0x7C, - 0x01, 0x4E, 0xFD, 0x5A, 0x04, 0x31, 0xF9, 0xA4, 0x0C, 0x90, 0x47, - 0x47, 0xFC, 0x36, 0x00, 0xB6, 0x00, 0x2E, 0xFF, 0x99, 0x00, 0xB3, - 0xFF, 0x12, 0x00, 0x00, 0x00, 0x22, 0x00, 0x78, 0xFF, 0x31, 0x01, - 0xF1, 0xFD, 0x12, 0x03, 0xC7, 0xFB, 0x07, 0x06, 0xDB, 0x48, 0x73, - 0x01, 0xC3, 0xFD, 0x0A, 0x02, 0x79, 0xFE, 0xF1, 0x00, 0x91, 0xFF, - 0x1B, 0x00, 0x19, 0x00, 0x99, 0xFF, 0xDD, 0x00, 0xA3, 0xFE, 0xBB, - 0x01, 0x58, 0xFE, 0x2D, 0x00, 0xAF, 0x48, 0x7E, 0x07, 0x2E, 0xFB, - 0x60, 0x03, 0xC9, 0xFD, 0x43, 0x01, 0x71, 0xFF, 0x24, 0x00, 0x00, - 0x00, 0x10, 0x00, 0xBB, 0xFF, 0x85, 0x00, 0x58, 0xFF, 0x6A, 0x00, - 0xBE, 0x00, 0x38, 0xFB, 0x0F, 0x47, 0x42, 0x0E, 0x9B, 0xF8, 0xA1, - 0x04, 0x2B, 0xFD, 0x8B, 0x01, 0x55, 0xFF, 0x2C, 0x00, 0xFF, 0xFF, - 0x09, 0x00, 0xDC, 0xFF, 0x31, 0x00, 0x04, 0x00, 0x32, 0xFF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FC, 0x23, 0x07, 0x21, 0xF2, 0xCB, 0x27, 0xFE, - 0x37, 0x00, 0xF2, 0x4D, 0x06, 0x04, 0xFD, 0x49, 0x01, 0x8E, 0xFF, - 0x19, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, - 0x01, 0x41, 0xFC, 0xC8, 0x06, 0x76, 0xF3, 0x22, 0x20, 0xCA, 0x3D, - 0x7D, 0xF3, 0x2A, 0x05, 0xC8, 0xFD, 0xD4, 0x00, 0xCA, 0xFF, 0x03, - 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x34, 0x00, 0x3B, 0xFF, 0xD1, 0x01, - 0x84, 0xFC, 0x12, 0x06, 0x5C, 0xF5, 0x76, 0x18, 0x89, 0x42, 0x02, - 0xF6, 0x94, 0x03, 0xC4, 0xFE, 0x42, 0x00, 0x12, 0x00, 0xE8, 0xFF, - 0x07, 0x00, 0xFF, 0xFF, 0x2F, 0x00, 0x4C, 0xFF, 0xA2, 0x01, 0xF6, - 0xFC, 0x12, 0x05, 0xA7, 0xF7, 0x03, 0x11, 0x10, 0x46, 0x93, 0xF9, - 0x98, 0x01, 0xEE, 0xFF, 0x9B, 0xFF, 0x64, 0x00, 0xC8, 0xFF, 0x0E, - 0x00, 0x00, 0x00, 0x27, 0x00, 0x65, 0xFF, 0x60, 0x01, 0x8A, 0xFD, - 0xDF, 0x03, 0x2E, 0xFA, 0x04, 0x0A, 0x3A, 0x48, 0x28, 0xFE, 0x4B, - 0xFF, 0x38, 0x01, 0xE9, 0xFE, 0xBB, 0x00, 0xA6, 0xFF, 0x16, 0x00, - 0x00, 0x00, 0x1E, 0x00, 0x84, 0xFF, 0x11, 0x01, 0x34, 0xFE, 0x8F, - 0x02, 0xC7, 0xFC, 0xAE, 0x03, 0xF7, 0x48, 0xAE, 0x03, 0xC7, 0xFC, - 0x8F, 0x02, 0x34, 0xFE, 0x11, 0x01, 0x84, 0xFF, 0x1E, 0x00, 0x00, -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 0x10, 0x07, 0x20, 0xF2, 0x1C, - 0x78, 0x0A, 0xCA, 0xFC, 0x50, 0xFC, 0x27, 0x00, 0xDC, 0x00, 0x15, - 0x00, 0xFC, 0xFF, 0xF7, 0xFF, 0x64, 0x00, 0xF5, 0x00, 0x97, 0xFE, - 0x40, 0xFB, 0x5D, 0x01, 0x8B, 0x13, 0x25, 0x21, 0x47, 0x1A, 0x2C, - 0x07, 0xDB, 0xFB, 0x05, 0xFD, 0x8C, 0x00, 0xB9, 0x00, 0x04, 0x00, - 0xFF, 0xFF, 0xFA, 0xFF, 0x8D, 0x00, 0xD3, 0x00, 0xD6, 0xFD, 0x56, - 0xFB, 0xF4, 0x03, 0xF0, 0x16, 0x8A, 0x21, 0x31, 0x17, 0x2B, 0x04, - 0x5B, 0xFB, 0xC7, 0xFD, 0xCF, 0x00, 0x90, 0x00, 0xFA, 0xFF, 0x00, - 0x00, 0xFF, 0xFF, 0x03, 0x00, 0xB6, 0x00, 0x92, 0x00, 0x13, 0xFD, - 0xCD, 0xFB, 0xEE, 0x06, 0x0D, 0x1A, 0x33, 0x21, 0xD0, 0x13, 0x8C, - 0x01, 0x3E, 0xFB, 0x88, 0xFE, 0xF3, 0x00, 0x67, 0x00, 0xF7, 0xFF, - 0x06, 0x00, 0x1D, 0x00, 0x03, 0xFF, 0xFE, 0x00, 0xA1, 0x02, 0xA6, - 0xF8, 0x56, 0x02, 0xA5, 0x28, 0xA5, 0x28, 0x56, 0x02, 0xA6, 0xF8, - 0xA1, 0x02, 0xFE, 0x00, 0x03, 0xFF, 0x1D, 0x00, 0x06, 0x00, 0x00, - 0x00, 0x21, 0x00, 0xA6, 0xFF, 0x3F, 0xFF, 0x0B, 0x03, 0x42, 0xFE, - 0x3E, 0xF8, 0x7F, 0x15, 0xAC, 0x30, 0x7F, 0x15, 0x3E, 0xF8, 0x42, - 0xFE, 0x0B, 0x03, 0x3F, 0xFF, 0xA6, 0xFF, 0x21, 0x00, 0x00, 0x00, - 0xFA, 0x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x00, 0x47, 0x00, 0xD3, - 0xFF, 0x04, 0x00, 0x0F, 0x00, 0x95, 0xFF, 0x17, 0x01, 0x3D, 0xFE, - 0xBD, 0x01, 0x30, 0x00, 0xCC, 0xF8, 0x92, 0x3B, 0x2A, 0x20, 0x2E, - 0xF3, 0x12, 0x06, 0x8F, 0xFD, 0x9A, 0x00, 0x10, 0x00, 0xE5, 0xFF, - 0x02, 0x00, 0x10, 0x00, 0x8C, 0xFF, 0x42, 0x01, 0xBB, 0xFD, 0xE4, - 0x02, 0x01, 0xFE, 0x9C, 0xFC, 0x45, 0x3F, 0x16, 0x19, 0x2D, 0xF4, - 0x41, 0x06, 0x21, 0xFD, 0xF3, 0x00, 0xE0, 0xFF, 0xF4, 0xFF, 0x01, - 0x00, 0x10, 0x00, 0x8B, 0xFF, 0x5D, 0x01, 0x4F, 0xFD, 0xFB, 0x03, - 0xB2, 0xFB, 0x53, 0x01, 0xC2, 0x41, 0x24, 0x12, 0xBA, 0xF5, 0x0F, - 0x06, 0xE9, 0xFC, 0x33, 0x01, 0xBB, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0x0D, 0x00, 0x93, 0xFF, 0x63, 0x01, 0x04, 0xFD, 0xEF, 0x04, 0x62, - 0xF9, 0xD7, 0x06, 0xF2, 0x42, 0x8D, 0x0B, 0xB0, 0xF7, 0x87, 0x05, - 0xE6, 0xFC, 0x58, 0x01, 0xA0, 0xFF, 0x09, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x07, 0x00, 0xA5, 0xFF, 0x52, 0x01, 0xE2, 0xFC, 0xAD, 0x05, - 0x35, 0xF7, 0x08, 0x0D, 0xCB, 0x42, 0x81, 0x05, 0xE8, 0xF9, 0xBB, - 0x04, 0x12, 0xFD, 0x64, 0x01, 0x90, 0xFF, 0x0E, 0x00, 0x00, 0x00, - 0xFE, 0xFF, 0xC2, 0xFF, 0x27, 0x01, 0xF1, 0xFC, 0x22, 0x06, 0x54, - 0xF5, 0xB8, 0x13, 0x4A, 0x41, 0x29, 0x00, 0x3C, 0xFC, 0xBD, 0x03, - 0x66, 0xFD, 0x58, 0x01, 0x8A, 0xFF, 0x11, 0x00, 0x01, 0x00, 0xF1, - 0xFF, 0xEB, 0xFF, 0xE1, 0x00, 0x35, 0xFD, 0x40, 0x06, 0xE4, 0xF3, - 0xB7, 0x1A, 0x85, 0x3E, 0xA6, 0xFB, 0x86, 0xFE, 0xA0, 0x02, 0xD7, - 0xFD, 0x39, 0x01, 0x8E, 0xFF, 0x10, 0x00, 0x03, 0x00, 0xE1, 0xFF, - 0x1C, 0x00, 0x82, 0x00, 0xB0, 0xFD, 0xF9, 0x05, 0x0C, 0xF3, 0xCB, - 0x21, 0x8F, 0x3A, 0x0D, 0xF8, 0xA9, 0x00, 0x79, 0x01, 0x5D, 0xFE, - 0x0B, 0x01, 0x98, 0xFF, 0x0E, 0x00, 0x05, 0x00, 0xCE, 0xFF, 0x55, - 0x00, 0x0D, 0x00, 0x60, 0xFE, 0x48, 0x05, 0xEC, 0xF2, 0xB6, 0x28, - 0x91, 0x35, 0x68, 0xF5, 0x88, 0x02, 0x5A, 0x00, 0xED, 0xFE, 0xD4, - 0x00, 0xA8, 0xFF, 0x0B, 0x00, 0x08, 0x00, 0xBB, 0xFF, 0x92, 0x00, - 0x87, 0xFF, 0x3F, 0xFF, 0x2B, 0x04, 0xA1, 0xF3, 0x3D, 0x2F, 0xB8, - 0x2F, 0xB8, 0xF3, 0x11, 0x04, 0x52, 0xFF, 0x7C, 0xFF, 0x97, 0x00, - 0xBA, 0xFF, 0x08, 0x00, 0x0B, 0x00, 0xA9, 0xFF, 0xCF, 0x00, 0xF8, - 0xFE, 0x44, 0x00, 0xAA, 0x02, 0x3E, 0xF5, 0x24, 0x35, 0x3B, 0x29, - 0xF2, 0xF2, 0x35, 0x05, 0x70, 0xFE, 0x03, 0x00, 0x5A, 0x00, 0xCD, - 0xFF, 0x05, 0x00, 0x0E, 0x00, 0x99, 0xFF, 0x07, 0x01, 0x68, 0xFE, - 0x63, 0x01, 0xD0, 0x00, 0xD0, 0xF7, 0x35, 0x3A, 0x55, 0x22, 0x02, - 0xF3, 0xEF, 0x05, 0xBC, 0xFD, 0x7A, 0x00, 0x20, 0x00, 0xDF, 0xFF, - 0x03, 0x00, 0x10, 0x00, 0x8E, 0xFF, 0x36, 0x01, 0xE1, 0xFD, 0x8A, - 0x02, 0xB2, 0xFE, 0x56, 0xFB, 0x40, 0x3E, 0x42, 0x1B, 0xCE, 0xF3, - 0x3E, 0x06, 0x3D, 0xFD, 0xDB, 0x00, 0xEE, 0xFF, 0xF0, 0xFF, 0x01, - 0x00, 0x11, 0x00, 0x8A, 0xFF, 0x57, 0x01, 0x6D, 0xFD, 0xA8, 0x03, - 0x69, 0xFC, 0xC8, 0xFF, 0x20, 0x41, 0x40, 0x14, 0x33, 0xF5, 0x28, - 0x06, 0xF5, 0xFC, 0x22, 0x01, 0xC5, 0xFF, 0xFD, 0xFF, 0x00, 0x00, - 0x0F, 0x00, 0x8F, 0xFF, 0x64, 0x01, 0x17, 0xFD, 0xA9, 0x04, 0x16, - 0xFA, 0x10, 0x05, 0xB8, 0x42, 0x87, 0x0D, 0x0D, 0xF7, 0xB9, 0x05, - 0xE2, 0xFC, 0x50, 0x01, 0xA7, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0A, 0x00, 0x9E, 0xFF, 0x5A, 0x01, 0xE8, 0xFC, 0x7A, 0x05, - 0xDA, 0xF7, 0x10, 0x0B, 0xFB, 0x42, 0x4B, 0x07, 0x35, 0xF9, 0x00, - 0x05, 0x00, 0xFD, 0x63, 0x01, 0x94, 0xFF, 0x0D, 0x00, 0x00, 0x00, - 0x01, 0x00, 0xB8, 0xFF, 0x37, 0x01, 0xE7, 0xFC, 0x07, 0x06, 0xDE, - 0xF5, 0x9F, 0x11, 0xE4, 0x41, 0xB8, 0x01, 0x84, 0xFB, 0x0F, 0x04, - 0x48, 0xFD, 0x5E, 0x01, 0x8B, 0xFF, 0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0xF2, 0xC1, 0x05, 0xEE, 0xFD, 0x57, 0x00, 0x31, 0x00, 0xDA, 0xFF, - 0x03, 0x00, 0x10, 0x00, 0x91, 0xFF, 0x29, 0x01, 0x09, 0xFE, 0x2F, - 0x02, 0x5F, 0xFF, 0x27, 0xFA, 0x20, 0x3D, 0x70, 0x1D, 0x7D, 0xF3, - 0x31, 0x06, 0x5E, 0xFD, 0xBF, 0x00, 0xFD, 0xFF, 0xEB, 0xFF, 0x02, - 0x00, 0x11, 0x00, 0x8B, 0xFF, 0x4E, 0x01, 0x8E, 0xFD, 0x52, 0x03, - 0x20, 0xFD, 0x52, 0xFE, 0x60, 0x40, 0x63, 0x16, 0xB7, 0xF4, 0x39, - 0x06, 0x05, 0xFD, 0x0F, 0x01, 0xD1, 0xFF, 0xF9, 0xFF, 0x00, 0x00, - 0x10, 0x00, 0x8D, 0xFF, 0x62, 0x01, 0x2E, 0xFD, 0x5E, 0x04, 0xCC, - 0xFA, 0x5B, 0x03, 0x5E, 0x42, 0x8E, 0x0F, 0x71, 0xF6, 0xE4, 0x05, - 0xE2, 0xFC, 0x45, 0x01, 0xAF, 0xFF, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0B, 0x00, 0x99, 0xFF, 0x60, 0x01, 0xF2, 0xFC, 0x40, 0x05, - 0x85, 0xF8, 0x26, 0x09, 0x0C, 0x43, 0x26, 0x09, 0x85, 0xF8, 0x40, - 0x05, 0xF2, 0xFC, 0x60, 0x01, 0x99, 0xFF, 0x0B, 0x00, 0x00, 0x00, - 0x04, 0x00, 0xAF, 0xFF, 0x45, 0x01, 0xE2, 0xFC, 0xE4, 0x05, 0x71, - 0xF6, 0x8E, 0x0F, 0x5E, 0x42, 0x5B, 0x03, 0xCC, 0xFA, 0x5E, 0x04, - 0x2E, 0xFD, 0x62, 0x01, 0x8D, 0xFF, 0x10, 0x00, 0x00, 0x00, 0xF9, - 0xFF, 0xD1, 0xFF, 0x0F, 0x01, 0x05, 0xFD, 0x39,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, 0x00, 0x94, 0xFF, 0x1B, 0x01, 0x33, 0xFE, 0xD4, - 0x01, 0x07, 0x00, 0x0E, 0xF9, 0xE6, 0x3B, 0x9F, 0x1F, 0x3C, 0xF3, - 0x1A, 0x06, 0x85, 0xFD, 0xA2, 0x00, 0x0C, 0x00, 0xE6, 0xFF, 0x02, - 0x00, 0x11, 0x00, 0x8C, 0xFF, 0x45, 0x01, 0xB2, 0xFD, 0xFA, 0x02, - 0xD5, 0xFD, 0xF1, 0xFC, 0x81, 0x3F, 0x8B, 0x18, 0x47, 0xF4, 0x41, - 0x06, 0x1B, 0xFD, 0xF9, 0x00, 0xDD, 0xFF, 0xF5, 0xFF, 0x01, 0x00, - 0x10, 0x00, 0x8B, 0xFF, 0x5E, 0x01, 0x48, 0xFD, 0x0F, 0x04, 0x84, - 0xFB, 0xB8, 0x01, 0xE4, 0x41, 0x9F, 0x11, 0xDE, 0xF5, 0x07, 0x06, - 0xE7, 0xFC, 0x37, 0x01, 0xB8, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x0D, - 0x00, 0x94, 0xFF, 0x63, 0x01, 0x00, 0xFD, 0x00, 0x05, 0x35, 0xF9, - 0x4B, 0x07, 0xFB, 0x42, 0x10, 0x0B, 0xDA, 0xF7, 0x7A, 0x05, 0xE8, - 0xFC, 0x5A, 0x01, 0x9E, 0xFF, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x07, 0x00, 0xA7, 0xFF, 0x50, 0x01, 0xE2, 0xFC, 0xB9, 0x05, 0x0D, - 0xF7, 0x87, 0x0D, 0xB8, 0x42, 0x10, 0x05, 0x16, 0xFA, 0xA9, 0x04, - 0x17, 0xFD, 0x64, 0x01, 0x8F, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0xFD, - 0xFF, 0xC5, 0xFF, 0x22, 0x01, 0xF5, 0xFC, 0x28, 0x06, 0x33, 0xF5, - 0x40, 0x14, 0x20, 0x41, 0xC8, 0xFF, 0x69, 0xFC, 0xA8, 0x03, 0x6D, - 0xFD, 0x57, 0x01, 0x8A, 0xFF, 0x11, 0x00, 0x01, 0x00, 0xF0, 0xFF, - 0xEE, 0xFF, 0xDB, 0x00, 0x3D, 0xFD, 0x3E, 0x06, 0xCE, 0xF3, 0x42, - 0x1B, 0x40, 0x3E, 0x56, 0xFB, 0xB2, 0xFE, 0x8A, 0x02, 0xE1, 0xFD, - 0x36, 0x01, 0x8E, 0xFF, 0x10, 0x00, 0x03, 0x00, 0xDF, 0xFF, 0x20, - 0x00, 0x7A, 0x00, 0xBC, 0xFD, 0xEF, 0x05, 0x02, 0xF3, 0x55, 0x22, - 0x35, 0x3A, 0xD0, 0xF7, 0xD0, 0x00, 0x63, 0x01, 0x68, 0xFE, 0x07, - 0x01, 0x99, 0xFF, 0x0E, 0x00, 0x05, 0x00, 0xCD, 0xFF, 0x5A, 0x00, - 0x03, 0x00, 0x70, 0xFE, 0x35, 0x05, 0xF2, 0xF2, 0x3B, 0x29, 0x24, - 0x35, 0x3E, 0xF5, 0xAA, 0x02, 0x44, 0x00, 0xF8, 0xFE, 0xCF, 0x00, - 0xA9, 0xFF, 0x0B, 0x00, 0x08, 0x00, 0xBA, 0xFF, 0x97, 0x00, 0x7C, - 0xFF, 0x52, 0xFF, 0x11, 0x04, 0xB8, 0xF3, 0xB8, 0x2F, 0x3D, 0x2F, - 0xA1, 0xF3, 0x2B, 0x04, 0x3F, 0xFF, 0x87, 0xFF, 0x92, 0x00, 0xBB, - 0xFF, 0x08, 0x00, 0x0B, 0x00, 0xA8, 0xFF, 0xD4, 0x00, 0xED, 0xFE, - 0x5A, 0x00, 0x88, 0x02, 0x68, 0xF5, 0x91, 0x35, 0xB6, 0x28, 0xEC, - 0xF2, 0x48, 0x05, 0x60, 0xFE, 0x0D, 0x00, 0x55, 0x00, 0xCE, 0xFF, - 0x05, 0x00, 0x0E, 0x00, 0x98, 0xFF, 0x0B, 0x01, 0x5D, 0xFE, 0x79, - 0x01, 0xA9, 0x00, 0x0D, 0xF8, 0x8F, 0x3A, 0xCB, 0x21, 0x0C, 0xF3, - 0xF9, 0x05, 0xB0, 0xFD, 0x82, 0x00, 0x1C, 0x00, 0xE1, 0xFF, 0x03, - 0x00, 0x10, 0x00, 0x8E, 0xFF, 0x39, 0x01, 0xD7, 0xFD, 0xA0, 0x02, - 0x86, 0xFE, 0xA6, 0xFB, 0x85, 0x3E, 0xB7, 0x1A, 0xE4, 0xF3, 0x40, - 0x06, 0x35, 0xFD, 0xE1, 0x00, 0xEB, 0xFF, 0xF1, 0xFF, 0x01, 0x00, - 0x11, 0x00, 0x8A, 0xFF, 0x58, 0x01, 0x66, 0xFD, 0xBD, 0x03, 0x3C, - 0xFC, 0x29, 0x00, 0x4A, 0x41, 0xB8, 0x13, 0x54, 0xF5, 0x22, 0x06, - 0xF1, 0xFC, 0x27, 0x01, 0xC2, 0xFF, 0xFE, 0xFF, 0x00, 0x00, 0x0E, - 0x00, 0x90, 0xFF, 0x64, 0x01, 0x12, 0xFD, 0xBB, 0x04, 0xE8, 0xF9, - 0x81, 0x05, 0xCB, 0x42, 0x08, 0x0D, 0x35, 0xF7, 0xAD, 0x05, 0xE2, - 0xFC, 0x52, 0x01, 0xA5, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x09, 0x00, 0xA0, 0xFF, 0x58, 0x01, 0xE6, 0xFC, 0x87, 0x05, 0xB0, - 0xF7, 0x8D, 0x0B, 0xF2, 0x42, 0xD7, 0x06, 0x62, 0xF9, 0xEF, 0x04, - 0x04, 0xFD, 0x63, 0x01, 0x93, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xBB, 0xFF, 0x33, 0x01, 0xE9, 0xFC, 0x0F, 0x06, 0xBA, 0xF5, - 0x24, 0x12, 0xC2, 0x41, 0x53, 0x01, 0xB2, 0xFB, 0xFB, 0x03, 0x4F, - 0xFD, 0x5D, 0x01, 0x8B, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF4, 0xFF, - 0xE0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, 0x00, 0xDB, 0xFF, 0x03, - 0x00, 0x10, 0x00, 0x90, 0xFF, 0x2D, 0x01, 0xFF, 0xFD, 0x46, 0x02, - 0x34, 0xFF, 0x71, 0xFA, 0x6B, 0x3D, 0xE5, 0x1C, 0x90, 0xF3, 0x35, - 0x06, 0x55, 0xFD, 0xC6, 0x00, 0xF9, 0xFF, 0xEC, 0xFF, 0x01, 0x00, - 0x11, 0x00, 0x8B, 0xFF, 0x51, 0x01, 0x86, 0xFD, 0x68, 0x03, 0xF3, - 0xFC, 0xAE, 0xFE, 0x92, 0x40, 0xDA, 0x15, 0xD5, 0xF4, 0x35, 0x06, - 0x00, 0xFD, 0x14, 0x01, 0xCE, 0xFF, 0xFA, 0xFF, 0x00, 0x00, 0x0F, - 0x00, 0x8D, 0xFF, 0x63, 0x01, 0x28, 0xFD, 0x71, 0x04, 0x9E, 0xFA, - 0xC7, 0x03, 0x79, 0x42, 0x0B, 0x0F, 0x97, 0xF6, 0xDA, 0x05, 0xE2, - 0xFC, 0x48, 0x01, 0xAD, 0xFF, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0B, 0x00, 0x9A, 0xFF, 0x5F, 0x01, 0xEF, 0xFC, 0x4F, 0x05, 0x5A, - 0xF8, 0x9F, 0x09, 0x0A, 0x43, 0xAE, 0x08, 0xB1, 0xF8, 0x30, 0x05, - 0xF5, 0xFC, 0x61, 0x01, 0x97, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x03, - 0x00, 0xB1, 0xFF, 0x41, 0x01, 0xE3, 0xFC, 0xED, 0x05, 0x4C, 0xF6, - 0x11, 0x10, 0x42, 0x42, 0xF1, 0x02, 0xFA, 0xFA, 0x4B, 0x04, 0x34, - 0xFD, 0x61, 0x01, 0x8C, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF8, 0xFF, - 0xD4, 0xFF, 0x0A, 0x01, 0x0A, 0xFD, 0x3C, 0x06, 0x9A, 0xF4, 0xED, - 0x16, 0x2A, 0x40,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0xFE, 0xEB, 0x01, - 0xDD, 0xFF, 0x52, 0xF9, 0x36, 0x3C, 0x13, 0x1F, 0x4B, 0xF3, 0x20, - 0x06, 0x7B, 0xFD, 0xA9, 0x00, 0x08, 0x00, 0xE7, 0xFF, 0x02, 0x00, - 0x11, 0x00, 0x8C, 0xFF, 0x47, 0x01, 0xA9, 0xFD, 0x10, 0x03, 0xA8, - 0xFD, 0x47, 0xFD, 0xBB, 0x3F, 0x01, 0x18, 0x62, 0xF4, 0x40, 0x06, - 0x15, 0xFD, 0xFF, 0x00, 0xDA, 0xFF, 0xF6, 0xFF, 0x01, 0x00, 0x10, - 0x00, 0x8B, 0xFF, 0x5F, 0x01, 0x41, 0xFD, 0x23, 0x04, 0x56, 0xFB, - 0x1F, 0x02, 0x06, 0x42, 0x19, 0x11, 0x02, 0xF6, 0xFF, 0x05, 0xE5, - 0xFC, 0x3B, 0x01, 0xB6, 0xFF, 0x02, 0x00, 0x00, 0x00, 0x0D, 0x00, - 0x95, 0xFF, 0x62, 0x01, 0xFC, 0xFC, 0x10, 0x05, 0x09, 0xF9, 0xC1, - 0x07, 0x03, 0x43, 0x94, 0x0A, 0x05, 0xF8, 0x6C, 0x05, 0xEA, 0xFC, - 0x5C, 0x01, 0x9D, 0xFF, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, - 0x00, 0xA9, 0xFF, 0x4D, 0x01, 0xE1, 0xFC, 0xC4, 0x05, 0xE6, 0xF6, - 0x08, 0x0E, 0xA5, 0x42, 0xA1, 0x04, 0x43, 0xFA, 0x97, 0x04, 0x1D, - 0xFD, 0x64, 0x01, 0x8F, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0xFC, 0xFF, - 0xC8, 0xFF, 0x1E, 0x01, 0xF8, 0xFC, 0x2D, 0x06, 0x13, 0xF5, 0xC8, - 0x14, 0xF2, 0x40, 0x69, 0xFF, 0x97, 0xFC, 0x92, 0x03, 0x75, 0xFD, - 0x55, 0x01, 0x8A, 0xFF, 0x11, 0x00, 0x01, 0x00, 0xEF, 0xFF, 0xF2, - 0xFF, 0xD4, 0x00, 0x45, 0xFD, 0x3B, 0x06, 0xB8, 0xF3, 0xCE, 0x1B, - 0xFB, 0x3D, 0x08, 0xFB, 0xDE, 0xFE, 0x73, 0x02, 0xEB, 0xFD, 0x33, - 0x01, 0x8F, 0xFF, 0x10, 0x00, 0x03, 0x00, 0xDE, 0xFF, 0x25, 0x00, - 0x71, 0x00, 0xC8, 0xFD, 0xE5, 0x05, 0xFA, 0xF2, 0xDF, 0x22, 0xDB, - 0x39, 0x94, 0xF7, 0xF7, 0x00, 0x4C, 0x01, 0x73, 0xFE, 0x03, 0x01, - 0x9A, 0xFF, 0x0E, 0x00, 0x05, 0x00, 0xCC, 0xFF, 0x5E, 0x00, 0xF9, - 0xFF, 0x80, 0xFE, 0x23, 0x05, 0xF9, 0xF2, 0xC0, 0x29, 0xB8, 0x34, - 0x16, 0xF5, 0xCB, 0x02, 0x2F, 0x00, 0x03, 0xFF, 0xCA, 0x00, 0xAA, - 0xFF, 0x0B, 0x00, 0x08, 0x00, 0xB8, 0xFF, 0x9B, 0x00, 0x72, 0xFF, - 0x65, 0xFF, 0xF6, 0x03, 0xD1, 0xF3, 0x31, 0x30, 0xC1, 0x2E, 0x8B, - 0xF3, 0x45, 0x04, 0x2D, 0xFF, 0x92, 0xFF, 0x8D, 0x00, 0xBD, 0xFF, - 0x08, 0x00, 0x0C, 0x00, 0xA6, 0xFF, 0xD8, 0x00, 0xE2, 0xFE, 0x6F, - 0x00, 0x66, 0x02, 0x93, 0xF5, 0xFB, 0x35, 0x31, 0x28, 0xE7, 0xF2, - 0x59, 0x05, 0x51, 0xFE, 0x17, 0x00, 0x50, 0x00, 0xD0, 0xFF, 0x05, - 0x00, 0x0E, 0x00, 0x97, 0xFF, 0x0F, 0x01, 0x53, 0xFE, 0x90, 0x01, - 0x81, 0x00, 0x4B, 0xF8, 0xE6, 0x3A, 0x3F, 0x21, 0x16, 0xF3, 0x02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41, 0x06, 0x14, 0xF4, 0xA1, 0x19, - 0x06, 0x3F, 0x49, 0xFC, 0x2E, 0xFE, 0xCD, 0x02, 0xC4, 0xFD, 0x3F, - 0x01, 0x8D, 0xFF, 0x10, 0x00, 0x02, 0x00, 0xE3, 0xFF, 0x14, 0x00, - 0x92, 0x00, 0x9A, 0xFD, 0x0A, 0x06, 0x22, 0xF3, 0xB4, 0x20, 0x3C, - 0x3B, 0x8B, 0xF8, 0x58, 0x00, 0xA7, 0x01, 0x48, 0xFE, 0x13, 0x01, - 0x96, 0xFF, 0x0F, 0x00, 0x04, 0x00, 0xD1, 0xFF, 0x4C, 0x00, 0x20, - 0x00, 0x42, 0xFE, 0x6A, 0x05, 0xE3, 0xF2, 0xAB, 0x27, 0x66, 0x36, - 0xC0, 0xF5, 0x44, 0x02, 0x85, 0x00, 0xD7, 0xFE, 0xDD, 0x00, 0xA5, - 0xFF, 0x0C, 0x00, 0x07, 0x00, 0xBE, 0xFF, 0x89, 0x00, 0x9D, 0xFF, - 0x1A, 0xFF, 0x5E, 0x04, 0x76, 0xF3, 0x45, 0x2E, 0xAA, 0x30, 0xEB, - 0xF3, 0xDB, 0x03, 0x79, 0xFF, 0x67, 0xFF, 0xA0, 0x00, 0xB7, 0xFF, - 0x09, 0x00, 0x0B, 0x00, 0xAC, 0xFF, 0xC6, 0x00, 0x0E, 0xFF, 0x1A, - 0x00, 0xEB, 0x02, 0xEF, 0xF4, 0x49, 0x34, 0x43, 0x2A, 0x02, 0xF3, - 0x0F, 0x05, 0x90, 0xFE, 0xEF, 0xFF, 0x63, 0x00, 0xCA, 0xFF, 0x06, - 0x00, 0x0E, 0x00, 0x9B, 0xFF, 0xFF, 0x00, 0x7E, 0xFE, 0x36, 0x01, - 0x1E, 0x01, 0x5B, 0xF7, 0x7E, 0x39, 0x69, 0x23, 0xF3, 0xF2, 0xD9, - 0x05, 0xD4, 0xFD, 0x69, 0x00, 0x29, 0x00, 0xDD, 0xFF, 0x03, 0x00, - 0x10, 0x00, 0x90, 0xFF, 0x30, 0x01, 0xF5, 0xFD, 0x5C, 0x02, 0x09, - 0xFF, 0xBC, 0xFA, 0xB5, 0x3D, 0x5A, 0x1C, 0xA3, 0xF3, 0x38, 0x06, - 0x4D, 0xFD, 0xCD, 0x00, 0xF5, 0xFF, 0xED, 0xFF, 0x01, 0x00, 0x11, - 0x00, 0x8B, 0xFF, 0x53, 0x01, 0x7E, 0xFD, 0x7D, 0x03, 0xC5, 0xFC, - 0x0B, 0xFF, 0xC3, 0x40, 0x51, 0x15, 0xF4, 0xF4, 0x31, 0x06, 0xFC, - 0xFC, 0x19, 0x01, 0xCB, 0xFF, 0xFB, 0xFF, 0x00, 0x00, 0x0F, 0x00, - 0x8E, 0xFF, 0x63, 0x01, 0x22, 0xFD, 0x84, 0x04, 0x71, 0xFA, 0x34, - 0x04, 0x90, 0x42, 0x89, 0x0E, 0xBE, 0xF6, 0xCF, 0x05, 0xE1, 0xFC, - 0x4A, 0x01, 0xAB, 0xFF, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, - 0x00, 0x9B, 0xFF, 0x5D, 0x01, 0xEC, 0xFC, 0x5D, 0x05, 0x2F, 0xF8, - 0x19, 0x0A, 0x07, 0x43, 0x37, 0x08, 0xDD, 0xF8, 0x21, 0x05, 0xF8, - 0xFC, 0x62, 0x01, 0x96, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x03, 0x00, - 0xB4, 0xFF, 0x3E, 0x01, 0xE4, 0xFC, 0xF6, 0x05, 0x26, 0xF6, 0x95, - 0x10, 0x26, 0x42, 0x87, 0x02, 0x28, 0xFB, 0x37, 0x04, 0x3B, 0xFD, - 0x60, 0x01, 0x8C, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF7, 0xFF, 0xD7, - 0xFF, 0x04, 0x01, 0x0F, 0xFD, 0x3E, 0x06, 0x7D, 0xF4, 0x76, 0x17, - 0xF4, 0x3F, 0x9F, 0xFD, 0x7B, 0xFD, 0x26, 0x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 0xF9, 0x87, 0x3C, 0x88, 0x1E, 0x5A, 0xF3, 0x26, 0x06, - 0x71, 0xFD, 0xB1, 0x00, 0x04, 0x00, 0xE9, 0xFF, 0x02, 0x00, 0x11, - 0x00, 0x8B, 0xFF, 0x4A, 0x01, 0xA0, 0xFD, 0x26, 0x03, 0x7B, 0xFD, - 0x9F, 0xFD, 0xF4, 0x3F, 0x76, 0x17, 0x7D, 0xF4, 0x3E, 0x06, 0x0F, - 0xFD, 0x04, 0x01, 0xD7, 0xFF, 0xF7, 0xFF, 0x01, 0x00, 0x10, 0x00, - 0x8C, 0xFF, 0x60, 0x01, 0x3B, 0xFD, 0x37, 0x04, 0x28, 0xFB, 0x87, - 0x02, 0x26, 0x42, 0x95, 0x10, 0x26, 0xF6, 0xF6, 0x05, 0xE4, 0xFC, - 0x3E, 0x01, 0xB4, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x96, - 0xFF, 0x62, 0x01, 0xF8, 0xFC, 0x21, 0x05, 0xDD, 0xF8, 0x37, 0x08, - 0x07, 0x43, 0x19, 0x0A, 0x2F, 0xF8, 0x5D, 0x05, 0xEC, 0xFC, 0x5D, - 0x01, 0x9B, 0xFF, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, - 0xAB, 0xFF, 0x4A, 0x01, 0xE1, 0xFC, 0xCF, 0x05, 0xBE, 0xF6, 0x89, - 0x0E, 0x90, 0x42, 0x34, 0x04, 0x71, 0xFA, 0x84, 0x04, 0x22, 0xFD, - 0x63, 0x01, 0x8E, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0xFB, 0xFF, 0xCB, - 0xFF, 0x19, 0x01, 0xFC, 0xFC, 0x31, 0x06, 0xF4, 0xF4, 0x51, 0x15, - 0xC3, 0x40, 0x0B, 0xFF, 0xC5, 0xFC, 0x7D, 0x03, 0x7E, 0xFD, 0x53, - 0x01, 0x8B, 0xFF, 0x11, 0x00, 0x01, 0x00, 0xED, 0xFF, 0x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 0x14, 0x00, 0xE3, 0xFF, 0x02, 0x00, 0x10, - 0x00, 0x8D, 0xFF, 0x3F, 0x01, 0xC4, 0xFD, 0xCD, 0x02, 0x2E, 0xFE, - 0x49, 0xFC, 0x06, 0x3F, 0xA1, 0x19, 0x14, 0xF4, 0x41, 0x06, 0x27, - 0xFD, 0xED, 0x00, 0xE4, 0xFF, 0xF3, 0xFF, 0x01, 0x00, 0x10, 0x00, - 0x8B, 0xFF, 0x5B, 0x01, 0x57, 0xFD, 0xE6, 0x03, 0xE0, 0xFB, 0xEE, - 0x00, 0x9C, 0x41, 0xAB, 0x12, 0x98, 0xF5, 0x16, 0x06, 0xEC, 0xFC, - 0x2F, 0x01, 0xBD, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x92, - 0xFF, 0x64, 0x01, 0x09, 0xFD, 0xDE, 0x04, 0x8E, 0xF9, 0x64, 0x06, - 0xE6, 0x42, 0x0A, 0x0C, 0x87, 0xF7, 0x94, 0x05, 0xE5, 0xFC, 0x56, - 0x01, 0xA2, 0xFF, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, - 0xA3, 0xFF, 0x54, 0x01, 0xE3, 0xFC, 0xA1, 0x05, 0x5E, 0xF7, 0x88, - 0x0C, 0xD9, 0x42, 0xF2, 0x05, 0xBB, 0xF9, 0xCD, 0x04, 0x0D, 0xFD, - 0x64, 0x01, 0x91, 0xFF, 0x0E, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC0, - 0xFF, 0x2B, 0x01, 0xEE, 0xFC, 0x1C, 0x06, 0x75, 0xF5, 0x32, 0x13, - 0x75, 0x41, 0x8B, 0x00, 0x0E, 0xFC, 0xD2, 0x03, 0x5E, 0xFD, 0x5A, - 0x01, 0x8B, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF2, 0xFF, 0xE7, 0xFF, - 0xE7, 0x00, 0x2E, 0xFD, 0x41, 0x06, 0xFC, 0xF3, 0x2C, 0x1A, 0xC6, - 0x3E, 0xF7, 0xFB, 0x5A, 0xFE, 0xB7, 0x02, 0xCE, 0xFD, 0x3C, 0x01, - 0x8D, 0xFF, 0x10, 0x00, 0x02, 0x00, 0xE2, 0xFF, 0x18, 0x00, 0x8A, - 0x00, 0xA5, 0xFD, 0x02, 0x06, 0x16, 0xF3, 0x3F, 0x21, 0xE6, 0x3A, - 0x4B, 0xF8, 0x81, 0x00, 0x90, 0x01, 0x53, 0xFE, 0x0F, 0x01, 0x97, - 0xFF, 0x0E, 0x00, 0x05, 0x00, 0xD0, 0xFF, 0x50, 0x00, 0x17, 0x00, - 0x51, 0xFE, 0x59, 0x05, 0xE7, 0xF2, 0x31, 0x28, 0xFB, 0x35, 0x93, - 0xF5, 0x66, 0x02, 0x6F, 0x00, 0xE2, 0xFE, 0xD8, 0x00, 0xA6, 0xFF, - 0x0C, 0x00, 0x08, 0x00, 0xBD, 0xFF, 0x8D, 0x00, 0x92, 0xFF, 0x2D, - 0xFF, 0x45, 0x04, 0x8B, 0xF3, 0xC1, 0x2E, 0x31, 0x30, 0xD1, 0xF3, - 0xF6, 0x03, 0x65, 0xFF, 0x72, 0xFF, 0x9B, 0x00, 0xB8, 0xFF, 0x08, - 0x00, 0x0B, 0x00, 0xAA, 0xFF, 0xCA, 0x00, 0x03, 0xFF, 0x2F, 0x00, - 0xCB, 0x02, 0x16, 0xF5, 0xB8, 0x34, 0xC0, 0x29, 0xF9, 0xF2, 0x23, - 0x05, 0x80, 0xFE, 0xF9, 0xFF, 0x5E, 0x00, 0xCC, 0xFF, 0x05, 0x00, - 0x0E, 0x00, 0x9A, 0xFF, 0x03, 0x01, 0x73, 0xFE, 0x4C, 0x01, 0xF7, - 0x00, 0x94, 0xF7, 0xDB, 0x39, 0xDF, 0x22, 0xFA, 0xF2, 0xE5, 0x05, - 0xC8, 0xFD, 0x71, 0x00, 0x25, 0x00, 0xDE, 0xFF, 0x03, 0x00, 0x10, - 0x00, 0x8F, 0xFF, 0x33, 0x01, 0xEB, 0xFD, 0x73, 0x02, 0xDE, 0xFE, - 0x08, 0xFB, 0xFB, 0x3D, 0xCE, 0x1B, 0xB8, 0xF3, 0x3B, 0x06, 0x45, - 0xFD, 0xD4, 0x00, 0xF2, 0xFF, 0xEF, 0xFF, 0x01, 0x00, 0x11, 0x00, - 0x8A, 0xFF, 0x55, 0x01, 0x75, 0xFD, 0x92, 0x03, 0x97, 0xFC, 0x69, - 0xFF, 0xF2, 0x40, 0xC8, 0x14, 0x13, 0xF5, 0x2D, 0x06, 0xF8, 0xFC, - 0x1E, 0x01, 0xC8, 0xFF, 0xFC, 0xFF, 0x00, 0x00, 0x0F, 0x00, 0x8F, - 0xFF, 0x64, 0x01, 0x1D, 0xFD, 0x97, 0x04, 0x43, 0xFA, 0xA1, 0x04, - 0xA5, 0x42, 0x08, 0x0E, 0xE6, 0xF6, 0xC4, 0x05, 0xE1, 0xFC, 0x4D, - 0x01, 0xA9, 0xFF, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, - 0x9D, 0xFF, 0x5C, 0x01, 0xEA, 0xFC, 0x6C, 0x05, 0x05, 0xF8, 0x94, - 0x0A, 0x03, 0x43, 0xC1, 0x07, 0x09, 0xF9, 0x10, 0x05, 0xFC, 0xFC, - 0x62, 0x01, 0x95, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0x02, 0x00, 0xB6, - 0xFF, 0x3B, 0x01, 0xE5, 0xFC, 0xFF, 0x05, 0x02, 0xF6, 0x19, 0x11, - 0x06, 0x42, 0x1F, 0x02, 0x56, 0xFB, 0x23, 0x04, 0x41, 0xFD, 0x5F, - 0x01, 0x8B, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF6, 0xFF, 0xDA, 0xFF, - 0xFF, 0x00, 0x15, 0xFD, 0x40, 0x06, 0x62, 0xF4, 0x01, 0x18, 0xBB, - 0x3F, 0x47, 0xFD, 0xA8, 0xFD, 0x10, 0x03, 0xA9, 0xFD, 0x47, 0x01, - 0x8C, 0x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, 0xF3, 0x2C, 0x06, 0x67, - 0xFD, 0xB8, 0x00, 0x00, 0x00, 0xEA, 0xFF, 0x02, 0x00, 0x11, 0x00, - 0x8B, 0xFF, 0x4C, 0x01, 0x97, 0xFD, 0x3C, 0x03, 0x4D, 0xFD, 0xF8, - 0xFD, 0x2A, 0x40, 0xED, 0x16, 0x9A, 0xF4, 0x3C, 0x06, 0x0A, 0xFD, - 0x0A, 0x01, 0xD4, 0xFF, 0xF8, 0xFF, 0x01, 0x00, 0x10, 0x00, 0x8C, - 0xFF, 0x61, 0x01, 0x34, 0xFD, 0x4B, 0x04, 0xFA, 0xFA, 0xF1, 0x02, - 0x42, 0x42, 0x11, 0x10, 0x4C, 0xF6, 0xED, 0x05, 0xE3, 0xFC, 0x41, - 0x01, 0xB1, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x97, 0xFF, - 0x61, 0x01, 0xF5, 0xFC, 0x30, 0x05, 0xB1, 0xF8, 0xAE, 0x08, 0x0A, - 0x43, 0x9F, 0x09, 0x5A, 0xF8, 0x4F, 0x05, 0xEF, 0xFC, 0x5F, 0x01, - 0x9A, 0xFF, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0xAD, - 0xFF, 0x48, 0x01, 0xE2, 0xFC, 0xDA, 0x05, 0x97, 0xF6, 0x0B, 0x0F, - 0x79, 0x42, 0xC7, 0x03, 0x9E, 0xFA, 0x71, 0x04, 0x28, 0xFD, 0x63, - 0x01, 0x8D, 0xFF, 0x0F, 0x00 -}; - -static u16 -CoefficientSizes[] = { - /* Playback */ - 0x00C0, 0x5000, 0x0060, 0x2800, 0x0040, 0x0060, 0x1400, 0x0000, - /* Record */ - 0x0020, 0x1260, 0x0020, 0x1260, 0x0000, 0x0040, 0x1260, 0x0000, -}; - -#ifndef JUST_DATA - -static u16 -nm256_getStartOffset (u8 which) -{ - u16 offset = 0; - - while (which-- > 0) - offset += CoefficientSizes[which]; - - return offset; -} - -static void -nm256_loadOneCoefficient (struct nm256_info *card, int devnum, u32 port, - u16 which) -{ - u32 coeffBuf = (which < 8) ? card->coeffBuf : card->allCoeffBuf; - u16 offset = nm256_getStartOffset (which); - u16 size = CoefficientSizes[which]; - - card->coeffsCurrent = 0; - - if (nm256_debug) - printk (KERN_INFO "NM256: Loading coefficient buffer 0x%x-0x%x with coefficient %d, size %d, port 0x%x\n", - coeffBuf, coeffBuf + size - 1, which, size, port); - nm256_writeBuffer8 (card, coefficients + offset, 1, coeffBuf, size); - nm256_writePort32 (card, 2, port + 0, coeffBuf); - /* ??? Record seems to behave differently than playback. */ - if (devnum == 0) - size--; - nm256_writePort32 (card, 2, port + 4, coeffBuf + size); -} - -static void -nm256_loadAllCoefficients (struct nm256_info *card) -{ - nm256_writeBuffer8 (card, coefficients, 1, card->allCoeffBuf, - NM_TOTAL_COEFF_COUNT * 4); - card->coeffsCurrent = 1; -} - -static void -nm256_loadCoefficient (struct nm256_info *card, int which, int number) -{ - static u16 addrs[3] = { 0x1c, 0x21c, 0x408 }; - /* The enable register for the specified engine. */ - u32 poffset = (which == 1 ? 0x200 : 1); - - if (nm256_readPort8 (card, 2, poffset) & 1) { - printk (KERN_ERR "NM256: Engine was enabled while loading coefficients!\n"); - return; - } - - /* The recording engine uses coefficient values 8-15. */ - if (which == 1) - number += 8; - - if (! nm256_cachedCoefficients (card)) - nm256_loadOneCoefficient (card, which, addrs[which], number); - else { - u32 base = card->allCoeffBuf; - u32 offset = nm256_getStartOffset (number); - u32 endOffset = offset + CoefficientSizes[number]; - - if (nm256_debug) - printk (KERN_DEBUG "loading coefficient %d at port 0x%x, offset %d (0x%x-0x%x)\n", - number, addrs[which], offset, base + offset, - base + endOffset - 1); - - if (! card->coeffsCurrent) - nm256_loadAllCoefficients (card); - - nm256_writePort32 (card, 2, addrs[which], base + offset); - nm256_writePort32 (card, 2, addrs[which] + 4, base + endOffset - 1); - } -} - -#endif /* JUST_DATA */ - -#endif - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/sound/oss/opl3.c b/sound/oss/opl3.c index fc273e55094..7781c13c147 100644 --- a/sound/oss/opl3.c +++ b/sound/oss/opl3.c @@ -34,7 +34,6 @@ #include "sound_config.h" -#include "opl3.h" #include "opl3_hw.h" #define MAX_VOICE 18 @@ -73,7 +72,6 @@ typedef struct opl_devinfo unsigned char cmask; int is_opl4; - int *osp; } opl_devinfo; static struct opl_devinfo *devc = NULL; @@ -144,7 +142,7 @@ static int opl3_ioctl(int dev, unsigned int cmd, void __user * arg) } } -int opl3_detect(int ioaddr, int *osp) +static int opl3_detect(int ioaddr) { /* * This function returns 1 if the FM chip is present at the given I/O port @@ -182,7 +180,6 @@ int opl3_detect(int ioaddr, int *osp) goto cleanup_devc; } - devc->osp = osp; devc->base = ioaddr; /* Reset timers 1 and 2 */ @@ -1105,7 +1102,7 @@ static struct synth_operations opl3_operations = .setup_voice = opl3_setup_voice }; -int opl3_init(int ioaddr, int *osp, struct module *owner) +static int opl3_init(int ioaddr, struct module *owner) { int i; int me; @@ -1194,9 +1191,6 @@ int opl3_init(int ioaddr, int *osp, struct module *owner) return me; } -EXPORT_SYMBOL(opl3_init); -EXPORT_SYMBOL(opl3_detect); - static int me; static int io = -1; @@ -1209,12 +1203,12 @@ static int __init init_opl3 (void) if (io != -1) /* User loading pure OPL3 module */ { - if (!opl3_detect(io, NULL)) + if (!opl3_detect(io)) { return -ENODEV; } - me = opl3_init(io, NULL, THIS_MODULE); + me = opl3_init(io, THIS_MODULE); } return 0; diff --git a/sound/oss/opl3.h b/sound/oss/opl3.h deleted file mode 100644 index 0bc9a4bcda1..00000000000 --- a/sound/oss/opl3.h +++ /dev/null @@ -1,5 +0,0 @@ - -int opl3_detect (int ioaddr, int *osp); -int opl3_init(int ioaddr, int *osp, struct module *owner); - -void enable_opl3_mode(int left, int right, int both); diff --git a/sound/oss/opl3sa2.c b/sound/oss/opl3sa2.c deleted file mode 100644 index e20051f1be4..00000000000 --- a/sound/oss/opl3sa2.c +++ /dev/null @@ -1,1020 +0,0 @@ -/* - * sound/oss/opl3sa2.c - * - * A low level driver for Yamaha OPL3-SA2 and SA3 cards. - * NOTE: All traces of the name OPL3-SAx have now (December 2000) been - * removed from the driver code, as an email exchange with Yamaha - * provided the information that the YMF-719 is indeed just a - * re-badged 715. - * - * Copyright 1998-2001 Scott Murray <scott@spiteful.org> - * - * Originally based on the CS4232 driver (in cs4232.c) by Hannu Savolainen - * and others. Now incorporates code/ideas from pss.c, also by Hannu - * Savolainen. Both of those files are distributed with the following - * license: - * - * "Copyright (C) by Hannu Savolainen 1993-1997 - * - * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL) - * Version 2 (June 1991). See the "COPYING" file distributed with this software - * for more info." - * - * As such, in accordance with the above license, this file, opl3sa2.c, is - * distributed under the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 (June 1991). - * See the "COPYING" file distributed with this software for more information. - * - * Change History - * -------------- - * Scott Murray Original driver (Jun 14, 1998) - * Paul J.Y. Lahaie Changed probing / attach code order - * Scott Murray Added mixer support (Dec 03, 1998) - * Scott Murray Changed detection code to be more forgiving, - * added force option as last resort, - * fixed ioctl return values. (Dec 30, 1998) - * Scott Murray Simpler detection code should work all the time now - * (with thanks to Ben Hutchings for the heuristic), - * removed now unnecessary force option. (Jan 5, 1999) - * Christoph Hellwig Adapted to module_init/module_exit (Mar 4, 2000) - * Scott Murray Reworked SA2 versus SA3 mixer code, updated chipset - * version detection code (again!). (Dec 5, 2000) - * Scott Murray Adjusted master volume mixer scaling. (Dec 6, 2000) - * Scott Murray Based on a patch by Joel Yliluoma (aka Bisqwit), - * integrated wide mixer and adjusted mic, bass, treble - * scaling. (Dec 6, 2000) - * Scott Murray Based on a patch by Peter Englmaier, integrated - * ymode and loopback options. (Dec 6, 2000) - * Scott Murray Inspired by a patch by Peter Englmaier, and based on - * what ALSA does, added initialization code for the - * default DMA and IRQ settings. (Dec 6, 2000) - * Scott Murray Added some more checks to the card detection code, - * based on what ALSA does. (Dec 12, 2000) - * Scott Murray Inspired by similar patches from John Fremlin, - * Jim Radford, Mike Rolig, and Ingmar Steen, added 2.4 - * ISA PnP API support, mainly based on bits from - * sb_card.c and awe_wave.c. (Dec 12, 2000) - * Scott Murray Some small cleanups to the init code output. - * (Jan 7, 2001) - * Zwane Mwaikambo Added PM support. (Dec 4 2001) - * - * Adam Belay Converted driver to new PnP Layer (Oct 12, 2002) - * Zwane Mwaikambo Code, data structure cleanups. (Feb 15 2002) - * Zwane Mwaikambo Free resources during auxiliary device probe - * failures (Apr 29 2002) - * - */ - -#include <linux/pnp.h> -#include <linux/init.h> -#include <linux/module.h> -#include <linux/delay.h> -#include "sound_config.h" - -#include "ad1848.h" -#include "mpu401.h" - -#define OPL3SA2_MODULE_NAME "opl3sa2" -#define PFX OPL3SA2_MODULE_NAME ": " - -/* Useful control port indexes: */ -#define OPL3SA2_PM 0x01 -#define OPL3SA2_SYS_CTRL 0x02 -#define OPL3SA2_IRQ_CONFIG 0x03 -#define OPL3SA2_DMA_CONFIG 0x06 -#define OPL3SA2_MASTER_LEFT 0x07 -#define OPL3SA2_MASTER_RIGHT 0x08 -#define OPL3SA2_MIC 0x09 -#define OPL3SA2_MISC 0x0A - -#define OPL3SA3_WIDE 0x14 -#define OPL3SA3_BASS 0x15 -#define OPL3SA3_TREBLE 0x16 - -/* Useful constants: */ -#define DEFAULT_VOLUME 50 -#define DEFAULT_MIC 50 -#define DEFAULT_TIMBRE 0 - -/* Power saving modes */ -#define OPL3SA2_PM_MODE0 0x00 -#define OPL3SA2_PM_MODE1 0x04 /* PSV */ -#define OPL3SA2_PM_MODE2 0x05 /* PSV | PDX */ -#define OPL3SA2_PM_MODE3 0x27 /* ADOWN | PSV | PDN | PDX */ - - -/* For checking against what the card returns: */ -#define VERSION_UNKNOWN 0 -#define VERSION_YMF711 1 -#define VERSION_YMF715 2 -#define VERSION_YMF715B 3 -#define VERSION_YMF715E 4 -/* also assuming that anything > 4 but <= 7 is a 715E */ - -/* Chipset type constants for use below */ -#define CHIPSET_UNKNOWN -1 -#define CHIPSET_OPL3SA2 0 -#define CHIPSET_OPL3SA3 1 -static const char *CHIPSET_TABLE[] = {"OPL3-SA2", "OPL3-SA3"}; - -#ifdef CONFIG_PNP -#define OPL3SA2_CARDS_MAX 4 -#else -#define OPL3SA2_CARDS_MAX 1 -#endif - -/* This should be pretty obvious */ -static int opl3sa2_cards_num; - -typedef struct { - /* device resources */ - unsigned short cfg_port; - struct address_info cfg; - struct address_info cfg_mss; - struct address_info cfg_mpu; -#ifdef CONFIG_PNP - /* PnP Stuff */ - struct pnp_dev* pdev; - int activated; /* Whether said devices have been activated */ -#endif - unsigned int card; - int chipset; /* What's my version(s)? */ - char *chipset_name; - - /* mixer data */ - int mixer; - unsigned int volume_l; - unsigned int volume_r; - unsigned int mic; - unsigned int bass_l; - unsigned int bass_r; - unsigned int treble_l; - unsigned int treble_r; - unsigned int wide_l; - unsigned int wide_r; -} opl3sa2_state_t; -static opl3sa2_state_t opl3sa2_state[OPL3SA2_CARDS_MAX]; - - - -/* Our parameters */ -static int __initdata io = -1; -static int __initdata mss_io = -1; -static int __initdata mpu_io = -1; -static int __initdata irq = -1; -static int __initdata dma = -1; -static int __initdata dma2 = -1; -static int __initdata ymode = -1; -static int __initdata loopback = -1; - -#ifdef CONFIG_PNP -/* PnP specific parameters */ -static int __initdata isapnp = 1; -static int __initdata multiple = 1; - -/* Whether said devices have been activated */ -static int opl3sa2_activated[OPL3SA2_CARDS_MAX]; -#else -static int __initdata isapnp; /* = 0 */ -static int __initdata multiple; /* = 0 */ -#endif - -MODULE_DESCRIPTION("Module for OPL3-SA2 and SA3 sound cards (uses AD1848 MSS driver)."); -MODULE_AUTHOR("Scott Murray <scott@spiteful.org>"); -MODULE_LICENSE("GPL"); - - -module_param(io, int, 0); -MODULE_PARM_DESC(io, "Set I/O base of OPL3-SA2 or SA3 card (usually 0x370. Address must be even and must be from 0x100 to 0xFFE)"); - -module_param(mss_io, int, 0); -MODULE_PARM_DESC(mss_io, "Set MSS (audio) I/O base (0x530, 0xE80, or other. Address must end in 0 or 4 and must be from 0x530 to 0xF48)"); - -module_param(mpu_io, int, 0); -MODULE_PARM_DESC(mpu_io, "Set MIDI I/O base (0x330 or other. Address must be even and must be from 0x300 to 0x334)"); - -module_param(irq, int, 0); -MODULE_PARM_DESC(irq, "Set MSS (audio) IRQ (5, 7, 9, 10, 11, 12)"); - -module_param(dma, int, 0); -MODULE_PARM_DESC(dma, "Set MSS (audio) first DMA channel (0, 1, 3)"); - -module_param(dma2, int, 0); -MODULE_PARM_DESC(dma2, "Set MSS (audio) second DMA channel (0, 1, 3)"); - -module_param(ymode, int, 0); -MODULE_PARM_DESC(ymode, "Set Yamaha 3D enhancement mode (0 = Desktop/Normal, 1 = Notebook PC (1), 2 = Notebook PC (2), 3 = Hi-Fi)"); - -module_param(loopback, int, 0); -MODULE_PARM_DESC(loopback, "Set A/D input source. Useful for echo cancellation (0 = Mic Rch (default), 1 = Mono output loopback)"); - -#ifdef CONFIG_PNP -module_param(isapnp, bool, 0); -MODULE_PARM_DESC(isapnp, "When set to 0, ISA PnP support will be disabled"); - -module_param(multiple, bool, 0); -MODULE_PARM_DESC(multiple, "When set to 0, will not search for multiple cards"); -#endif - - -/* - * Standard read and write functions -*/ - -static inline void opl3sa2_write(unsigned short port, - unsigned char index, - unsigned char data) -{ - outb_p(index, port); - outb(data, port + 1); -} - - -static inline void opl3sa2_read(unsigned short port, - unsigned char index, - unsigned char* data) -{ - outb_p(index, port); - *data = inb(port + 1); -} - - -/* - * All of the mixer functions... - */ - -static void opl3sa2_set_volume(opl3sa2_state_t* devc, int left, int right) -{ - static unsigned char scale[101] = { - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x0e, 0x0e, - 0x0e, 0x0e, 0x0e, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0c, - 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0b, 0x0b, 0x0b, 0x0b, - 0x0b, 0x0b, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00 - }; - unsigned char vol; - - vol = scale[left]; - - /* If level is zero, turn on mute */ - if(!left) - vol |= 0x80; - - opl3sa2_write(devc->cfg_port, OPL3SA2_MASTER_LEFT, vol); - - vol = scale[right]; - - /* If level is zero, turn on mute */ - if(!right) - vol |= 0x80; - - opl3sa2_write(devc->cfg_port, OPL3SA2_MASTER_RIGHT, vol); -} - - -static void opl3sa2_set_mic(opl3sa2_state_t* devc, int level) -{ - unsigned char vol = 0x1F; - - if((level >= 0) && (level <= 100)) - vol = 0x1F - (unsigned char) (32 * level / 101); - - /* If level is zero, turn on mute */ - if(!level) - vol |= 0x80; - - opl3sa2_write(devc->cfg_port, OPL3SA2_MIC, vol); -} - - -static void opl3sa3_set_bass(opl3sa2_state_t* devc, int left, int right) -{ - unsigned char bass; - - bass = left ? ((unsigned char) (8 * left / 101)) : 0; - bass |= (right ? ((unsigned char) (8 * right / 101)) : 0) << 4; - - opl3sa2_write(devc->cfg_port, OPL3SA3_BASS, bass); -} - - -static void opl3sa3_set_treble(opl3sa2_state_t* devc, int left, int right) -{ - unsigned char treble; - - treble = left ? ((unsigned char) (8 * left / 101)) : 0; - treble |= (right ? ((unsigned char) (8 * right / 101)) : 0) << 4; - - opl3sa2_write(devc->cfg_port, OPL3SA3_TREBLE, treble); -} - - - - -static void opl3sa2_mixer_reset(opl3sa2_state_t* devc) -{ - if (devc) { - opl3sa2_set_volume(devc, DEFAULT_VOLUME, DEFAULT_VOLUME); - devc->volume_l = devc->volume_r = DEFAULT_VOLUME; - - opl3sa2_set_mic(devc, DEFAULT_MIC); - devc->mic = DEFAULT_MIC; - - if (devc->chipset == CHIPSET_OPL3SA3) { - opl3sa3_set_bass(devc, DEFAULT_TIMBRE, DEFAULT_TIMBRE); - devc->bass_l = devc->bass_r = DEFAULT_TIMBRE; - opl3sa3_set_treble(devc, DEFAULT_TIMBRE, DEFAULT_TIMBRE); - devc->treble_l = devc->treble_r = DEFAULT_TIMBRE; - } - } -} - -static inline void arg_to_vol_mono(unsigned int vol, int* value) -{ - int left; - - left = vol & 0x00ff; - if (left > 100) - left = 100; - *value = left; -} - - -static inline void arg_to_vol_stereo(unsigned int vol, int* aleft, int* aright) -{ - arg_to_vol_mono(vol, aleft); - arg_to_vol_mono(vol >> 8, aright); -} - - -static inline int ret_vol_mono(int vol) -{ - return ((vol << 8) | vol); -} - - -static inline int ret_vol_stereo(int left, int right) -{ - return ((right << 8) | left); -} - - -static int opl3sa2_mixer_ioctl(int dev, unsigned int cmd, void __user *arg) -{ - int retval, value, cmdf = cmd & 0xff; - int __user *p = (int __user *)arg; - - opl3sa2_state_t* devc = &opl3sa2_state[dev]; - - switch (cmdf) { - case SOUND_MIXER_VOLUME: - case SOUND_MIXER_MIC: - case SOUND_MIXER_DEVMASK: - case SOUND_MIXER_STEREODEVS: - case SOUND_MIXER_RECMASK: - case SOUND_MIXER_RECSRC: - case SOUND_MIXER_CAPS: - break; - - default: - return -EINVAL; - } - - if (((cmd >> 8) & 0xff) != 'M') - return -EINVAL; - - retval = 0; - if (_SIOC_DIR (cmd) & _SIOC_WRITE) { - switch (cmdf) { - case SOUND_MIXER_VOLUME: - retval = get_user(value, (unsigned __user *) arg); - if (retval) - break; - arg_to_vol_stereo(value, &devc->volume_l, &devc->volume_r); - opl3sa2_set_volume(devc, devc->volume_l, devc->volume_r); - value = ret_vol_stereo(devc->volume_l, devc->volume_r); - retval = put_user(value, p); - break; - - case SOUND_MIXER_MIC: - retval = get_user(value, (unsigned __user *) arg); - if (retval) - break; - arg_to_vol_mono(value, &devc->mic); - opl3sa2_set_mic(devc, devc->mic); - value = ret_vol_mono(devc->mic); - retval = put_user(value, p); - break; - - default: - retval = -EINVAL; - } - } - else { - /* - * Return parameters - */ - switch (cmdf) { - case SOUND_MIXER_DEVMASK: - retval = put_user(SOUND_MASK_VOLUME | SOUND_MASK_MIC, p); - break; - - case SOUND_MIXER_STEREODEVS: - retval = put_user(SOUND_MASK_VOLUME, p); - break; - - case SOUND_MIXER_RECMASK: - /* No recording devices */ - retval = put_user(0, p); - break; - - case SOUND_MIXER_CAPS: - retval = put_user(SOUND_CAP_EXCL_INPUT, p); - break; - - case SOUND_MIXER_RECSRC: - /* No recording source */ - retval = put_user(0, p); - break; - - case SOUND_MIXER_VOLUME: - value = ret_vol_stereo(devc->volume_l, devc->volume_r); - retval = put_user(value, p); - break; - - case SOUND_MIXER_MIC: - value = ret_vol_mono(devc->mic); - put_user(value, p); - break; - - default: - retval = -EINVAL; - } - } - return retval; -} -/* opl3sa2_mixer_ioctl end */ - - -static int opl3sa3_mixer_ioctl(int dev, unsigned int cmd, void __user * arg) -{ - int value, retval, cmdf = cmd & 0xff; - - opl3sa2_state_t* devc = &opl3sa2_state[dev]; - - switch (cmdf) { - case SOUND_MIXER_BASS: - value = ret_vol_stereo(devc->bass_l, devc->bass_r); - retval = put_user(value, (int __user *) arg); - break; - - case SOUND_MIXER_TREBLE: - value = ret_vol_stereo(devc->treble_l, devc->treble_r); - retval = put_user(value, (int __user *) arg); - break; - - case SOUND_MIXER_DIGITAL1: - value = ret_vol_stereo(devc->wide_l, devc->wide_r); - retval = put_user(value, (int __user *) arg); - break; - - default: - retval = -EINVAL; - } - return retval; -} -/* opl3sa3_mixer_ioctl end */ - - -static struct mixer_operations opl3sa2_mixer_operations = -{ - .owner = THIS_MODULE, - .id = "OPL3-SA2", - .name = "Yamaha OPL3-SA2", - .ioctl = opl3sa2_mixer_ioctl -}; - -static struct mixer_operations opl3sa3_mixer_operations = -{ - .owner = THIS_MODULE, - .id = "OPL3-SA3", - .name = "Yamaha OPL3-SA3", - .ioctl = opl3sa3_mixer_ioctl -}; - -/* End of mixer-related stuff */ - - -/* - * Component probe, attach, unload functions - */ - -static inline void __exit unload_opl3sa2_mpu(struct address_info *hw_config) -{ - unload_mpu401(hw_config); -} - - -static void __init attach_opl3sa2_mss(struct address_info* hw_config, struct resource *ports) -{ - int initial_mixers; - - initial_mixers = num_mixers; - attach_ms_sound(hw_config, ports, THIS_MODULE); /* Slot 0 */ - if (hw_config->slots[0] != -1) { - /* Did the MSS driver install? */ - if(num_mixers == (initial_mixers + 1)) { - /* The MSS mixer is installed, reroute mixers appropriately */ - AD1848_REROUTE(SOUND_MIXER_LINE1, SOUND_MIXER_CD); - AD1848_REROUTE(SOUND_MIXER_LINE2, SOUND_MIXER_SYNTH); - AD1848_REROUTE(SOUND_MIXER_LINE3, SOUND_MIXER_LINE); - } - else { - printk(KERN_ERR PFX "MSS mixer not installed?\n"); - } - } -} - - -static inline void __exit unload_opl3sa2_mss(struct address_info* hw_config) -{ - unload_ms_sound(hw_config); -} - - -static int __init probe_opl3sa2(struct address_info* hw_config, int card) -{ - unsigned char misc; - unsigned char tmp; - unsigned char version; - - /* - * Try and allocate our I/O port range. - */ - if (!request_region(hw_config->io_base, 2, OPL3SA2_MODULE_NAME)) { - printk(KERN_ERR PFX "Control I/O port %#x not free\n", - hw_config->io_base); - goto out_nodev; - } - - /* - * Check if writing to the read-only version bits of the miscellaneous - * register succeeds or not (it should not). - */ - opl3sa2_read(hw_config->io_base, OPL3SA2_MISC, &misc); - opl3sa2_write(hw_config->io_base, OPL3SA2_MISC, misc ^ 0x07); - opl3sa2_read(hw_config->io_base, OPL3SA2_MISC, &tmp); - if(tmp != misc) { - printk(KERN_ERR PFX "Control I/O port %#x is not a YMF7xx chipset!\n", - hw_config->io_base); - goto out_region; - } - - /* - * Check if the MIC register is accessible. - */ - opl3sa2_read(hw_config->io_base, OPL3SA2_MIC, &tmp); - opl3sa2_write(hw_config->io_base, OPL3SA2_MIC, 0x8a); - opl3sa2_read(hw_config->io_base, OPL3SA2_MIC, &tmp); - if((tmp & 0x9f) != 0x8a) { - printk(KERN_ERR - PFX "Control I/O port %#x is not a YMF7xx chipset!\n", - hw_config->io_base); - goto out_region; - } - opl3sa2_write(hw_config->io_base, OPL3SA2_MIC, tmp); - - /* - * Determine chipset type (SA2 or SA3) - * - * This is done by looking at the chipset version in the lower 3 bits - * of the miscellaneous register. - */ - version = misc & 0x07; - printk(KERN_DEBUG PFX "Chipset version = %#x\n", version); - switch (version) { - case 0: - opl3sa2_state[card].chipset = CHIPSET_UNKNOWN; - printk(KERN_ERR - PFX "Unknown Yamaha audio controller version\n"); - break; - - case VERSION_YMF711: - opl3sa2_state[card].chipset = CHIPSET_OPL3SA2; - printk(KERN_INFO PFX "Found OPL3-SA2 (YMF711)\n"); - break; - - case VERSION_YMF715: - opl3sa2_state[card].chipset = CHIPSET_OPL3SA3; - printk(KERN_INFO - PFX "Found OPL3-SA3 (YMF715 or YMF719)\n"); - break; - - case VERSION_YMF715B: - opl3sa2_state[card].chipset = CHIPSET_OPL3SA3; - printk(KERN_INFO - PFX "Found OPL3-SA3 (YMF715B or YMF719B)\n"); - break; - - case VERSION_YMF715E: - default: - opl3sa2_state[card].chipset = CHIPSET_OPL3SA3; - printk(KERN_INFO - PFX "Found OPL3-SA3 (YMF715E or YMF719E)\n"); - break; - } - - if (opl3sa2_state[card].chipset != CHIPSET_UNKNOWN) { - /* Generate a pretty name */ - opl3sa2_state[card].chipset_name = (char *)CHIPSET_TABLE[opl3sa2_state[card].chipset]; - return 0; - } - -out_region: - release_region(hw_config->io_base, 2); -out_nodev: - return -ENODEV; -} - - -static void __init attach_opl3sa2(struct address_info* hw_config, int card) -{ - /* Initialize IRQ configuration to IRQ-B: -, IRQ-A: WSS+MPU+OPL3 */ - opl3sa2_write(hw_config->io_base, OPL3SA2_IRQ_CONFIG, 0x0d); - - /* Initialize DMA configuration */ - if(hw_config->dma2 == hw_config->dma) { - /* Want DMA configuration DMA-B: -, DMA-A: WSS-P+WSS-R */ - opl3sa2_write(hw_config->io_base, OPL3SA2_DMA_CONFIG, 0x03); - } - else { - /* Want DMA configuration DMA-B: WSS-R, DMA-A: WSS-P */ - opl3sa2_write(hw_config->io_base, OPL3SA2_DMA_CONFIG, 0x21); - } -} - - -static void __init attach_opl3sa2_mixer(struct address_info *hw_config, int card) -{ - struct mixer_operations* mixer_operations; - opl3sa2_state_t* devc = &opl3sa2_state[card]; - - /* Install master mixer */ - if (devc->chipset == CHIPSET_OPL3SA3) { - mixer_operations = &opl3sa3_mixer_operations; - } - else { - mixer_operations = &opl3sa2_mixer_operations; - } - - devc->cfg_port = hw_config->io_base; - devc->mixer = sound_install_mixer(MIXER_DRIVER_VERSION, - mixer_operations->name, - mixer_operations, - sizeof(struct mixer_operations), - devc); - if(devc->mixer < 0) { - printk(KERN_ERR PFX "Could not install %s master mixer\n", - mixer_operations->name); - } - else { - opl3sa2_mixer_reset(devc); - - } -} - - -static void opl3sa2_clear_slots(struct address_info* hw_config) -{ - int i; - - for(i = 0; i < 6; i++) { - hw_config->slots[i] = -1; - } -} - - -static void __init opl3sa2_set_ymode(struct address_info* hw_config, int ymode) -{ - /* - * Set the Yamaha 3D enhancement mode (aka Ymersion) if asked to and - * it's supported. - * - * 0: Desktop (aka normal) 5-12 cm speakers - * 1: Notebook PC mode 1 3 cm speakers - * 2: Notebook PC mode 2 1.5 cm speakers - * 3: Hi-fi 16-38 cm speakers - */ - if(ymode >= 0 && ymode <= 3) { - unsigned char sys_ctrl; - - opl3sa2_read(hw_config->io_base, OPL3SA2_SYS_CTRL, &sys_ctrl); - sys_ctrl = (sys_ctrl & 0xcf) | ((ymode & 3) << 4); - opl3sa2_write(hw_config->io_base, OPL3SA2_SYS_CTRL, sys_ctrl); - } - else { - printk(KERN_ERR PFX "not setting ymode, it must be one of 0,1,2,3\n"); - } -} - - -static void __init opl3sa2_set_loopback(struct address_info* hw_config, int loopback) -{ - if(loopback >= 0 && loopback <= 1) { - unsigned char misc; - - opl3sa2_read(hw_config->io_base, OPL3SA2_MISC, &misc); - misc = (misc & 0xef) | ((loopback & 1) << 4); - opl3sa2_write(hw_config->io_base, OPL3SA2_MISC, misc); - } - else { - printk(KERN_ERR PFX "not setting loopback, it must be either 0 or 1\n"); - } -} - - -static void __exit unload_opl3sa2(struct address_info* hw_config, int card) -{ - /* Release control ports */ - release_region(hw_config->io_base, 2); - - /* Unload mixer */ - if(opl3sa2_state[card].mixer >= 0) - sound_unload_mixerdev(opl3sa2_state[card].mixer); - -} - -#ifdef CONFIG_PNP -static struct pnp_device_id pnp_opl3sa2_list[] = { - {.id = "YMH0021", .driver_data = 0}, - {.id = ""} -}; - -MODULE_DEVICE_TABLE(pnp, pnp_opl3sa2_list); - -static int opl3sa2_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) -{ - int card = opl3sa2_cards_num; - - /* we don't actually want to return an error as the user may have specified - * no multiple card search - */ - - if (opl3sa2_cards_num == OPL3SA2_CARDS_MAX) - return 0; - opl3sa2_activated[card] = 1; - - /* Our own config: */ - opl3sa2_state[card].cfg.io_base = pnp_port_start(dev, 4); - opl3sa2_state[card].cfg.irq = pnp_irq(dev, 0); - opl3sa2_state[card].cfg.dma = pnp_dma(dev, 0); - opl3sa2_state[card].cfg.dma2 = pnp_dma(dev, 1); - - /* The MSS config: */ - opl3sa2_state[card].cfg_mss.io_base = pnp_port_start(dev, 1); - opl3sa2_state[card].cfg_mss.irq = pnp_irq(dev, 0); - opl3sa2_state[card].cfg_mss.dma = pnp_dma(dev, 0); - opl3sa2_state[card].cfg_mss.dma2 = pnp_dma(dev, 1); - opl3sa2_state[card].cfg_mss.card_subtype = 1; /* No IRQ or DMA setup */ - - opl3sa2_state[card].cfg_mpu.io_base = pnp_port_start(dev, 3); - opl3sa2_state[card].cfg_mpu.irq = pnp_irq(dev, 0); - opl3sa2_state[card].cfg_mpu.dma = -1; - opl3sa2_state[card].cfg_mpu.dma2 = -1; - opl3sa2_state[card].cfg_mpu.always_detect = 1; /* It's there, so use shared IRQs */ - - /* Call me paranoid: */ - opl3sa2_clear_slots(&opl3sa2_state[card].cfg); - opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mss); - opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mpu); - - opl3sa2_state[card].pdev = dev; - opl3sa2_cards_num++; - - return 0; -} - -static struct pnp_driver opl3sa2_driver = { - .name = "opl3sa2", - .id_table = pnp_opl3sa2_list, - .probe = opl3sa2_pnp_probe, -}; - -#endif /* CONFIG_PNP */ - -/* End of component functions */ - -/* - * Install OPL3-SA2 based card(s). - * - * Need to have ad1848 and mpu401 loaded ready. - */ -static int __init init_opl3sa2(void) -{ - int card, max; - - /* Sanitize isapnp and multiple settings */ - isapnp = isapnp != 0 ? 1 : 0; - multiple = multiple != 0 ? 1 : 0; - - max = (multiple && isapnp) ? OPL3SA2_CARDS_MAX : 1; - -#ifdef CONFIG_PNP - if (isapnp){ - pnp_register_driver(&opl3sa2_driver); - if(!opl3sa2_cards_num){ - printk(KERN_INFO PFX "No PnP cards found\n"); - isapnp = 0; - } - max = opl3sa2_cards_num; - } -#endif - - for (card = 0; card < max; card++) { - /* If a user wants an I/O then assume they meant it */ - struct resource *ports; - int base; - - if (!isapnp) { - if (io == -1 || irq == -1 || dma == -1 || - dma2 == -1 || mss_io == -1) { - printk(KERN_ERR - PFX "io, mss_io, irq, dma, and dma2 must be set\n"); - return -EINVAL; - } - opl3sa2_cards_num++; - - /* - * Our own config: - * (NOTE: IRQ and DMA aren't used, so they're set to - * give pretty output from conf_printf. :) - */ - opl3sa2_state[card].cfg.io_base = io; - opl3sa2_state[card].cfg.irq = irq; - opl3sa2_state[card].cfg.dma = dma; - opl3sa2_state[card].cfg.dma2 = dma2; - - /* The MSS config: */ - opl3sa2_state[card].cfg_mss.io_base = mss_io; - opl3sa2_state[card].cfg_mss.irq = irq; - opl3sa2_state[card].cfg_mss.dma = dma; - opl3sa2_state[card].cfg_mss.dma2 = dma2; - opl3sa2_state[card].cfg_mss.card_subtype = 1; /* No IRQ or DMA setup */ - - opl3sa2_state[card].cfg_mpu.io_base = mpu_io; - opl3sa2_state[card].cfg_mpu.irq = irq; - opl3sa2_state[card].cfg_mpu.dma = -1; - opl3sa2_state[card].cfg_mpu.always_detect = 1; /* Use shared IRQs */ - - /* Call me paranoid: */ - opl3sa2_clear_slots(&opl3sa2_state[card].cfg); - opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mss); - opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mpu); - } - - /* FIXME: leak */ - if (probe_opl3sa2(&opl3sa2_state[card].cfg, card)) - return -ENODEV; - - base = opl3sa2_state[card].cfg_mss.io_base; - - if (!request_region(base, 4, "WSS config")) - goto failed; - - ports = request_region(base + 4, 4, "ad1848"); - if (!ports) - goto failed2; - - if (!probe_ms_sound(&opl3sa2_state[card].cfg_mss, ports)) { - /* - * If one or more cards are already registered, don't - * return an error but print a warning. Note, this - * should never really happen unless the hardware or - * ISA PnP screwed up. - */ - release_region(base + 4, 4); - failed2: - release_region(base, 4); - failed: - release_region(opl3sa2_state[card].cfg.io_base, 2); - - if (opl3sa2_cards_num) { - printk(KERN_WARNING - PFX "There was a problem probing one " - " of the ISA PNP cards, continuing\n"); - opl3sa2_cards_num--; - continue; - } else - return -ENODEV; - } - - attach_opl3sa2(&opl3sa2_state[card].cfg, card); - conf_printf(opl3sa2_state[card].chipset_name, &opl3sa2_state[card].cfg); - attach_opl3sa2_mixer(&opl3sa2_state[card].cfg, card); - attach_opl3sa2_mss(&opl3sa2_state[card].cfg_mss, ports); - - /* ewww =) */ - opl3sa2_state[card].card = card; - - /* - * Set the Yamaha 3D enhancement mode (aka Ymersion) if asked to and - * it's supported. - */ - if (ymode != -1) { - if (opl3sa2_state[card].chipset == CHIPSET_OPL3SA2) { - printk(KERN_ERR - PFX "ymode not supported on OPL3-SA2\n"); - } - else { - opl3sa2_set_ymode(&opl3sa2_state[card].cfg, ymode); - } - } - - - /* Set A/D input to Mono loopback if asked to. */ - if (loopback != -1) { - opl3sa2_set_loopback(&opl3sa2_state[card].cfg, loopback); - } - - /* Attach MPU if we've been asked to do so, failure isn't fatal */ - if (opl3sa2_state[card].cfg_mpu.io_base != -1) { - int base = opl3sa2_state[card].cfg_mpu.io_base; - struct resource *ports; - ports = request_region(base, 2, "mpu401"); - if (!ports) - goto out; - if (!probe_mpu401(&opl3sa2_state[card].cfg_mpu, ports)) { - release_region(base, 2); - goto out; - } - if (attach_mpu401(&opl3sa2_state[card].cfg_mpu, THIS_MODULE)) { - printk(KERN_ERR PFX "failed to attach MPU401\n"); - opl3sa2_state[card].cfg_mpu.slots[1] = -1; - } - } - } - -out: - if (isapnp) { - printk(KERN_NOTICE PFX "%d PnP card(s) found.\n", opl3sa2_cards_num); - } - - return 0; -} - - -/* - * Uninstall OPL3-SA2 based card(s). - */ -static void __exit cleanup_opl3sa2(void) -{ - int card; - - for(card = 0; card < opl3sa2_cards_num; card++) { - if (opl3sa2_state[card].cfg_mpu.slots[1] != -1) { - unload_opl3sa2_mpu(&opl3sa2_state[card].cfg_mpu); - } - unload_opl3sa2_mss(&opl3sa2_state[card].cfg_mss); - unload_opl3sa2(&opl3sa2_state[card].cfg, card); -#ifdef CONFIG_PNP - pnp_unregister_driver(&opl3sa2_driver); -#endif - } -} - -module_init(init_opl3sa2); -module_exit(cleanup_opl3sa2); - -#ifndef MODULE -static int __init setup_opl3sa2(char *str) -{ - /* io, irq, dma, dma2,... */ -#ifdef CONFIG_PNP - int ints[11]; -#else - int ints[9]; -#endif - str = get_options(str, ARRAY_SIZE(ints), ints); - - io = ints[1]; - irq = ints[2]; - dma = ints[3]; - dma2 = ints[4]; - mss_io = ints[5]; - mpu_io = ints[6]; - ymode = ints[7]; - loopback = ints[8]; -#ifdef CONFIG_PNP - isapnp = ints[9]; - multiple = ints[10]; -#endif - return 1; -} - -__setup("opl3sa2=", setup_opl3sa2); -#endif diff --git a/sound/oss/trident.c b/sound/oss/trident.c index 3bc1f6e9e4a..96adc47917a 100644 --- a/sound/oss/trident.c +++ b/sound/oss/trident.c @@ -11,12 +11,12 @@ * Built from: * Low level code: <audio@tridentmicro.com> from ALSA * Framework: Thomas Sailer <sailer@ife.ee.ethz.ch> - * Extended by: Zach Brown <zab@redhat.com> + * Extended by: Zach Brown <zab@redhat.com> * * Hacked up by: * Aaron Holtzman <aholtzma@ess.engr.uvic.ca> * Ollie Lho <ollie@sis.com.tw> SiS 7018 Audio Core Support - * Ching-Ling Lee <cling-li@ali.com.tw> ALi 5451 Audio Core Support + * Ching-Ling Lee <cling-li@ali.com.tw> ALi 5451 Audio Core Support * Matt Wu <mattwu@acersoftech.com.cn> ALi 5451 Audio Core Support * Peter Wächtler <pwaechtler@loewe-komp.de> CyberPro5050 support * Muli Ben-Yehuda <mulix@mulix.org> @@ -54,33 +54,33 @@ * adapt to new pci joystick attachment interface * v0.14.10f * July 24 2002 Muli Ben-Yehuda <mulix@actcom.co.il> - * patch from Eric Lemar (via Ian Soboroff): in suspend and resume, - * fix wrong cast from pci_dev* to struct trident_card*. + * patch from Eric Lemar (via Ian Soboroff): in suspend and resume, + * fix wrong cast from pci_dev* to struct trident_card*. * v0.14.10e * July 19 2002 Muli Ben-Yehuda <mulix@actcom.co.il> - * rewrite the DMA buffer allocation/deallcoation functions, to make it - * modular and fix a bug where we would call free_pages on memory - * obtained with pci_alloc_consistent. Also remove unnecessary #ifdef + * rewrite the DMA buffer allocation/deallcoation functions, to make it + * modular and fix a bug where we would call free_pages on memory + * obtained with pci_alloc_consistent. Also remove unnecessary #ifdef * CONFIG_PROC_FS and various other cleanups. * v0.14.10d * July 19 2002 Muli Ben-Yehuda <mulix@actcom.co.il> * made several printk(KERN_NOTICE...) into TRDBG(...), to avoid spamming - * my syslog with hundreds of messages. + * my syslog with hundreds of messages. * v0.14.10c * July 16 2002 Muli Ben-Yehuda <mulix@actcom.co.il> * Cleaned up Lei Hu's 0.4.10 driver to conform to Documentation/CodingStyle - * and the coding style used in the rest of the file. + * and the coding style used in the rest of the file. * v0.14.10b * June 23 2002 Muli Ben-Yehuda <mulix@actcom.co.il> - * add a missing unlock_set_fmt, remove a superflous lock/unlock pair - * with nothing in between. + * add a missing unlock_set_fmt, remove a superflous lock/unlock pair + * with nothing in between. * v0.14.10a - * June 21 2002 Muli Ben-Yehuda <mulix@actcom.co.il> - * use a debug macro instead of #ifdef CONFIG_DEBUG, trim to 80 columns - * per line, use 'do {} while (0)' in statement macros. + * June 21 2002 Muli Ben-Yehuda <mulix@actcom.co.il> + * use a debug macro instead of #ifdef CONFIG_DEBUG, trim to 80 columns + * per line, use 'do {} while (0)' in statement macros. * v0.14.10 * June 6 2002 Lei Hu <Lei_hu@ali.com.tw> - * rewrite the part to read/write registers of audio codec for Ali5451 + * rewrite the part to read/write registers of audio codec for Ali5451 * v0.14.9e * January 2 2002 Vojtech Pavlik <vojtech@ucw.cz> added gameport * support to avoid resource conflict with pcigame.c @@ -111,7 +111,7 @@ * Set EBUF1 and EBUF2 to still mode * Add dc97/ac97 reset function * Fix power management: ali_restore_regs - * unreleased + * unreleased * Mar 09 2001 Matt Wu * Add cache for ac97 access * v0.14.7 @@ -120,7 +120,7 @@ * Fix bug: an extra tail will be played when playing * Jan 05 2001 Matt Wu * Implement multi-channels and S/PDIF in support for ALi 1535+ - * v0.14.6 + * v0.14.6 * Nov 1 2000 Ching-Ling Lee * Fix the bug of memory leak when switching 5.1-channels to 2 channels. * Add lock protection into dynamic changing format of data. @@ -138,7 +138,7 @@ * v0.14.3 May 10 2000 Ollie Lho * fixed a small bug in trident_update_ptr, xmms 1.0.1 no longer uses 100% CPU * v0.14.2 Mar 29 2000 Ching-Ling Lee - * Add clear to silence advance in trident_update_ptr + * Add clear to silence advance in trident_update_ptr * fix invalid data of the end of the sound * v0.14.1 Mar 24 2000 Ching-Ling Lee * ALi 5451 support added, playback and recording O.K. @@ -178,7 +178,7 @@ * SiS 7018 support added, playback O.K. * v0.01 Alan Cox et. al. * Initial Release in kernel 2.3.30, does not work - * + * * ToDo * Clean up of low level channel register access code. (done) * Fix the bug on dma buffer management in update_ptr, read/write, drain_dac (done) @@ -326,7 +326,7 @@ struct trident_state { unsigned error; /* number of over/underruns */ /* put process on wait queue when no more space in buffer */ - wait_queue_head_t wait; + wait_queue_head_t wait; /* redundant, but makes calculations easier */ unsigned fragsize; @@ -358,7 +358,7 @@ struct trident_state { struct trident_channel { int num; /* channel number */ u32 lba; /* Loop Begine Address, where dma buffer starts */ - u32 eso; /* End Sample Offset, wehre dma buffer ends */ + u32 eso; /* End Sample Offset, wehre dma buffer ends */ /* (in the unit of samples) */ u32 delta; /* delta value, sample rate / 48k for playback, */ /* 48k/sample rate for recording */ @@ -417,7 +417,7 @@ struct trident_card { /* soundcore stuff */ int dev_audio; - /* structures for abstraction of hardware facilities, codecs, */ + /* structures for abstraction of hardware facilities, codecs, */ /* banks and channels */ struct ac97_codec *ac97_codec[NR_AC97]; struct trident_pcm_bank banks[NR_BANKS]; @@ -479,7 +479,7 @@ static void trident_ac97_set(struct ac97_codec *codec, u8 reg, u16 val); static u16 trident_ac97_get(struct ac97_codec *codec, u8 reg); static int trident_open_mixdev(struct inode *inode, struct file *file); -static int trident_ioctl_mixdev(struct inode *inode, struct file *file, +static int trident_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); static void ali_ac97_set(struct trident_card *card, int secondary, u8 reg, u16 val); @@ -496,10 +496,10 @@ static void ali_disable_spdif_in(struct trident_card *card); static void ali_disable_special_channel(struct trident_card *card, int ch); static void ali_setup_spdif_out(struct trident_card *card, int flag); static int ali_write_5_1(struct trident_state *state, - const char __user *buffer, - int cnt_for_multi_channel, unsigned int *copy_count, + const char __user *buffer, + int cnt_for_multi_channel, unsigned int *copy_count, unsigned int *state_cnt); -static int ali_allocate_other_states_resources(struct trident_state *state, +static int ali_allocate_other_states_resources(struct trident_state *state, int chan_nums); static void ali_free_other_states_resources(struct trident_state *state); @@ -722,7 +722,7 @@ trident_free_pcm_channel(struct trident_card *card, unsigned int channel) if (channel < 31 || channel > 63) return; - if (card->pci_id == PCI_DEVICE_ID_TRIDENT_4DWAVE_DX || + if (card->pci_id == PCI_DEVICE_ID_TRIDENT_4DWAVE_DX || card->pci_id == PCI_DEVICE_ID_TRIDENT_4DWAVE_NX) { b = inb(TRID_REG(card, T4D_REC_CH)); if ((b & ~0x80) == channel) @@ -742,7 +742,7 @@ cyber_alloc_pcm_channel(struct trident_card *card) int idx; /* The cyberpro 5050 has only 32 voices and one bank */ - /* .. at least they are not documented (if you want to call that + /* .. at least they are not documented (if you want to call that * crap documentation), perhaps broken ? */ bank = &card->banks[BANK_A]; @@ -802,7 +802,7 @@ cyber_init_ritual(struct trident_card *card) /* enable, if it was disabled */ if ((portDat & CYBER_BMSK_AUENZ) != CYBER_BMSK_AUENZ_ENABLE) { printk(KERN_INFO "cyberpro5050: enabling audio controller\n"); - cyber_outidx(CYBER_PORT_AUDIO, CYBER_IDX_AUDIO_ENABLE, + cyber_outidx(CYBER_PORT_AUDIO, CYBER_IDX_AUDIO_ENABLE, portDat | CYBER_BMSK_AUENZ_ENABLE); /* check again if hardware is enabled now */ portDat = cyber_inidx(CYBER_PORT_AUDIO, CYBER_IDX_AUDIO_ENABLE); @@ -811,7 +811,7 @@ cyber_init_ritual(struct trident_card *card) printk(KERN_ERR "cyberpro5050: initAudioAccess: no success\n"); ret = -1; } else { - cyber_outidx(CYBER_PORT_AUDIO, CYBER_IDX_IRQ_ENABLE, + cyber_outidx(CYBER_PORT_AUDIO, CYBER_IDX_IRQ_ENABLE, CYBER_BMSK_AUDIO_INT_ENABLE); cyber_outidx(CYBER_PORT_AUDIO, 0xbf, 0x01); cyber_outidx(CYBER_PORT_AUDIO, 0xba, 0x20); @@ -827,7 +827,7 @@ cyber_init_ritual(struct trident_card *card) /* called with spin lock held */ static int -trident_load_channel_registers(struct trident_card *card, u32 * data, +trident_load_channel_registers(struct trident_card *card, u32 * data, unsigned int channel) { int i; @@ -845,7 +845,7 @@ trident_load_channel_registers(struct trident_card *card, u32 * data, continue; outl(data[i], TRID_REG(card, CHANNEL_START + 4 * i)); } - if (card->pci_id == PCI_DEVICE_ID_ALI_5451 || + if (card->pci_id == PCI_DEVICE_ID_ALI_5451 || card->pci_id == PCI_DEVICE_ID_INTERG_5050) { outl(ALI_EMOD_Still, TRID_REG(card, ALI_EBUF1)); outl(ALI_EMOD_Still, TRID_REG(card, ALI_EBUF2)); @@ -884,7 +884,7 @@ trident_write_voice_regs(struct trident_state *state) break; case PCI_DEVICE_ID_TRIDENT_4DWAVE_NX: data[0] = (channel->delta << 24); - data[2] = ((channel->delta << 16) & 0xff000000) | + data[2] = ((channel->delta << 16) & 0xff000000) | (channel->eso & 0x00ffffff); data[3] = channel->fm_vol & 0xffff; break; @@ -989,13 +989,13 @@ trident_play_setup(struct trident_state *state) if (state->card->pci_id != PCI_DEVICE_ID_SI_7018) { channel->attribute = 0; if (state->card->pci_id == PCI_DEVICE_ID_ALI_5451) { - if ((channel->num == ALI_SPDIF_IN_CHANNEL) || + if ((channel->num == ALI_SPDIF_IN_CHANNEL) || (channel->num == ALI_PCM_IN_CHANNEL)) ali_disable_special_channel(state->card, channel->num); - else if ((inl(TRID_REG(state->card, ALI_GLOBAL_CONTROL)) + else if ((inl(TRID_REG(state->card, ALI_GLOBAL_CONTROL)) & ALI_SPDIF_OUT_CH_ENABLE) && (channel->num == ALI_SPDIF_OUT_CHANNEL)) { - ali_set_spdif_out_rate(state->card, + ali_set_spdif_out_rate(state->card, state->dmabuf.rate); state->dmabuf.channel->delta = 0x1000; } @@ -1063,7 +1063,7 @@ trident_rec_setup(struct trident_state *state) channel->lba = dmabuf->dma_handle; channel->delta = compute_rate_rec(dmabuf->rate); - if ((card->pci_id == PCI_DEVICE_ID_ALI_5451) && + if ((card->pci_id == PCI_DEVICE_ID_ALI_5451) && (channel->num == ALI_SPDIF_IN_CHANNEL)) { rate = ali_get_spdif_in_rate(card); if (rate == 0) { @@ -1180,8 +1180,8 @@ start_adc(struct trident_state *state) unsigned long flags; spin_lock_irqsave(&card->lock, flags); - if ((dmabuf->mapped || - dmabuf->count < (signed) dmabuf->dmasize) && + if ((dmabuf->mapped || + dmabuf->count < (signed) dmabuf->dmasize) && dmabuf->ready) { dmabuf->enable |= ADC_RUNNING; trident_enable_voice_irq(card, chan_num); @@ -1261,7 +1261,7 @@ alloc_dmabuf(struct dmabuf *dmabuf, struct pci_dev *pci_dev, int order) void *rawbuf = NULL; struct page *page, *pend; - if (!(rawbuf = pci_alloc_consistent(pci_dev, PAGE_SIZE << order, + if (!(rawbuf = pci_alloc_consistent(pci_dev, PAGE_SIZE << order, &dmabuf->dma_handle))) return -ENOMEM; @@ -1272,7 +1272,7 @@ alloc_dmabuf(struct dmabuf *dmabuf, struct pci_dev *pci_dev, int order) dmabuf->rawbuf = rawbuf; dmabuf->buforder = order; - /* now mark the pages as reserved; otherwise */ + /* now mark the pages as reserved; otherwise */ /* remap_pfn_range doesn't do what we want */ pend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1); for (page = virt_to_page(rawbuf); page <= pend; page++) @@ -1310,7 +1310,7 @@ dealloc_dmabuf(struct dmabuf *dmabuf, struct pci_dev *pci_dev) pend = virt_to_page(dmabuf->rawbuf + (PAGE_SIZE << dmabuf->buforder) - 1); for (page = virt_to_page(dmabuf->rawbuf); page <= pend; page++) ClearPageReserved(page); - pci_free_consistent(pci_dev, PAGE_SIZE << dmabuf->buforder, + pci_free_consistent(pci_dev, PAGE_SIZE << dmabuf->buforder, dmabuf->rawbuf, dmabuf->dma_handle); dmabuf->rawbuf = NULL; } @@ -1368,7 +1368,7 @@ prog_dmabuf(struct trident_state *state, enum dmabuf_mode rec) dealloc_dmabuf(&state->dmabuf, state->card->pci_dev); /* release the auxiliary DMA buffers */ for (i -= 2; i >= 0; i--) - dealloc_dmabuf(&state->other_states[i]->dmabuf, + dealloc_dmabuf(&state->other_states[i]->dmabuf, state->card->pci_dev); unlock_set_fmt(state); return ret; @@ -1398,7 +1398,7 @@ prog_dmabuf(struct trident_state *state, enum dmabuf_mode rec) dmabuf->fragsamples = dmabuf->fragsize >> sample_shift[dmabuf->fmt]; dmabuf->dmasize = dmabuf->numfrag << dmabuf->fragshift; - memset(dmabuf->rawbuf, (dmabuf->fmt & TRIDENT_FMT_16BIT) ? 0 : 0x80, + memset(dmabuf->rawbuf, (dmabuf->fmt & TRIDENT_FMT_16BIT) ? 0 : 0x80, dmabuf->dmasize); spin_lock_irqsave(&s->card->lock, flags); @@ -1453,7 +1453,7 @@ trident_clear_tail(struct trident_state *state) swptr = dmabuf->swptr; spin_unlock_irqrestore(&state->card->lock, flags); - if (swptr == 0 || swptr == dmabuf->dmasize / 2 || + if (swptr == 0 || swptr == dmabuf->dmasize / 2 || swptr == dmabuf->dmasize) return; @@ -1511,7 +1511,7 @@ drain_dac(struct trident_state *state, int nonblock) /* No matter how much data is left in the buffer, we have to wait until CSO == ESO/2 or CSO == ESO when address engine interrupts */ - if (state->card->pci_id == PCI_DEVICE_ID_ALI_5451 || + if (state->card->pci_id == PCI_DEVICE_ID_ALI_5451 || state->card->pci_id == PCI_DEVICE_ID_INTERG_5050) { diff = dmabuf->swptr - trident_get_dma_addr(state) + dmabuf->dmasize; diff = diff % (dmabuf->dmasize); @@ -1532,7 +1532,7 @@ drain_dac(struct trident_state *state, int nonblock) return 0; } -/* update buffer manangement pointers, especially, */ +/* update buffer manangement pointers, especially, */ /* dmabuf->count and dmabuf->hwptr */ static void trident_update_ptr(struct trident_state *state) @@ -1559,11 +1559,11 @@ trident_update_ptr(struct trident_state *state) } else { dmabuf->count += diff; - if (dmabuf->count < 0 || + if (dmabuf->count < 0 || dmabuf->count > dmabuf->dmasize) { - /* buffer underrun or buffer overrun, */ - /* we have no way to recover it here, just */ - /* stop the machine and let the process */ + /* buffer underrun or buffer overrun, */ + /* we have no way to recover it here, just */ + /* stop the machine and let the process */ /* force hwptr and swptr to sync */ __stop_adc(state); dmabuf->error++; @@ -1582,7 +1582,7 @@ trident_update_ptr(struct trident_state *state) } else { dmabuf->count -= diff; - if (dmabuf->count < 0 || + if (dmabuf->count < 0 || dmabuf->count > dmabuf->dmasize) { /* buffer underrun or buffer overrun, we have no way to recover it here, just stop the machine and let the process force hwptr @@ -1608,13 +1608,13 @@ trident_update_ptr(struct trident_state *state) if (state->chans_num == 6) { clear_cnt = clear_cnt / 2; swptr = swptr / 2; - memset(state->other_states[0]->dmabuf.rawbuf + swptr, + memset(state->other_states[0]->dmabuf.rawbuf + swptr, silence, clear_cnt); - memset(state->other_states[1]->dmabuf.rawbuf + swptr, + memset(state->other_states[1]->dmabuf.rawbuf + swptr, silence, clear_cnt); - memset(state->other_states[2]->dmabuf.rawbuf + swptr, + memset(state->other_states[2]->dmabuf.rawbuf + swptr, silence, clear_cnt); - memset(state->other_states[3]->dmabuf.rawbuf + swptr, + memset(state->other_states[3]->dmabuf.rawbuf + swptr, silence, clear_cnt); } dmabuf->endcleared = 1; @@ -1627,13 +1627,13 @@ trident_update_ptr(struct trident_state *state) if (state->chans_num == 6) { clear_cnt = clear_cnt / 2; swptr = swptr / 2; - memset(state->other_states[0]->dmabuf.rawbuf + swptr, + memset(state->other_states[0]->dmabuf.rawbuf + swptr, silence, clear_cnt); - memset(state->other_states[1]->dmabuf.rawbuf + swptr, + memset(state->other_states[1]->dmabuf.rawbuf + swptr, silence, clear_cnt); - memset(state->other_states[2]->dmabuf.rawbuf + swptr, + memset(state->other_states[2]->dmabuf.rawbuf + swptr, silence, clear_cnt); - memset(state->other_states[3]->dmabuf.rawbuf + swptr, + memset(state->other_states[3]->dmabuf.rawbuf + swptr, silence, clear_cnt); } dmabuf->endcleared = 1; @@ -1665,7 +1665,7 @@ trident_address_interrupt(struct trident_card *card) if ((state = card->states[i]) != NULL) { trident_update_ptr(state); } else { - printk(KERN_WARNING "trident: spurious channel " + printk(KERN_WARNING "trident: spurious channel " "irq %d.\n", channel); trident_stop_voice(card, channel); trident_disable_voice_irq(card, channel); @@ -1694,7 +1694,7 @@ ali_hwvol_control(struct trident_card *card, int opt) if (opt == 1) { // MUTE dwTemp ^= 0x8000; - ali_ac97_write(card->ac97_codec[0], + ali_ac97_write(card->ac97_codec[0], 0x02, dwTemp); } else if (opt == 2) { // Down if (mute) @@ -1706,7 +1706,7 @@ ali_hwvol_control(struct trident_card *card, int opt) dwTemp &= 0xe0e0; dwTemp |= (volume[0]) | (volume[1] << 8); ali_ac97_write(card->ac97_codec[0], 0x02, dwTemp); - card->ac97_codec[0]->mixer_state[0] = ((32 - volume[0]) * 25 / 8) | + card->ac97_codec[0]->mixer_state[0] = ((32 - volume[0]) * 25 / 8) | (((32 - volume[1]) * 25 / 8) << 8); } else if (opt == 4) { // Up if (mute) @@ -1718,7 +1718,7 @@ ali_hwvol_control(struct trident_card *card, int opt) dwTemp &= 0xe0e0; dwTemp |= (volume[0]) | (volume[1] << 8); ali_ac97_write(card->ac97_codec[0], 0x02, dwTemp); - card->ac97_codec[0]->mixer_state[0] = ((32 - volume[0]) * 25 / 8) | + card->ac97_codec[0]->mixer_state[0] = ((32 - volume[0]) * 25 / 8) | (((32 - volume[1]) * 25 / 8) << 8); } else { /* Nothing needs doing */ @@ -1801,7 +1801,7 @@ cyber_address_interrupt(struct trident_card *card) if ((state = card->states[i]) != NULL) { trident_update_ptr(state); } else { - printk(KERN_WARNING "cyber5050: spurious " + printk(KERN_WARNING "cyber5050: spurious " "channel irq %d.\n", channel); trident_stop_voice(card, channel); trident_disable_voice_irq(card, channel); @@ -1836,21 +1836,21 @@ trident_interrupt(int irq, void *dev_id) ali_queue_task(card, gpio & 0x07); } event = inl(TRID_REG(card, T4D_MISCINT)); - outl(event | (ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), + outl(event | (ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(card, T4D_MISCINT)); spin_unlock(&card->lock); return IRQ_HANDLED; } /* manually clear interrupt status, bad hardware design, blame T^2 */ - outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), + outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(card, T4D_MISCINT)); spin_unlock(&card->lock); return IRQ_HANDLED; } -/* in this loop, dmabuf.count signifies the amount of data that is waiting */ -/* to be copied to the user's buffer. it is filled by the dma machine and */ +/* in this loop, dmabuf.count signifies the amount of data that is waiting */ +/* to be copied to the user's buffer. it is filled by the dma machine and */ /* drained by this loop. */ static ssize_t trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos) @@ -1878,8 +1878,8 @@ trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos while (count > 0) { spin_lock_irqsave(&state->card->lock, flags); if (dmabuf->count > (signed) dmabuf->dmasize) { - /* buffer overrun, we are recovering from */ - /* sleep_on_timeout, resync hwptr and swptr, */ + /* buffer overrun, we are recovering from */ + /* sleep_on_timeout, resync hwptr and swptr, */ /* make process flush the buffer */ dmabuf->count = dmabuf->dmasize; dmabuf->swptr = dmabuf->hwptr; @@ -1894,7 +1894,7 @@ trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos cnt = count; if (cnt <= 0) { unsigned long tmo; - /* buffer is empty, start the dma machine and */ + /* buffer is empty, start the dma machine and */ /* wait for data to be recorded */ start_adc(state); if (file->f_flags & O_NONBLOCK) { @@ -1904,8 +1904,8 @@ trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos } mutex_unlock(&state->sem); - /* No matter how much space left in the buffer, */ - /* we have to wait until CSO == ESO/2 or CSO == ESO */ + /* No matter how much space left in the buffer, */ + /* we have to wait until CSO == ESO/2 or CSO == ESO */ /* when address engine interrupts */ tmo = (dmabuf->dmasize * HZ) / (dmabuf->rate * 2); tmo >>= sample_shift[dmabuf->fmt]; @@ -2005,7 +2005,7 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t while (count > 0) { spin_lock_irqsave(&state->card->lock, flags); if (dmabuf->count < 0) { - /* buffer underrun, we are recovering from */ + /* buffer underrun, we are recovering from */ /* sleep_on_timeout, resync hwptr and swptr */ dmabuf->count = 0; dmabuf->swptr = dmabuf->hwptr; @@ -2020,7 +2020,7 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t cnt = count; if (cnt <= 0) { unsigned long tmo; - /* buffer is full, start the dma machine and */ + /* buffer is full, start the dma machine and */ /* wait for data to be played */ start_dac(state); if (file->f_flags & O_NONBLOCK) { @@ -2028,8 +2028,8 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t ret = -EAGAIN; goto out; } - /* No matter how much data left in the buffer, */ - /* we have to wait until CSO == ESO/2 or CSO == ESO */ + /* No matter how much data left in the buffer, */ + /* we have to wait until CSO == ESO/2 or CSO == ESO */ /* when address engine interrupts */ lock_set_fmt(state); tmo = (dmabuf->dmasize * HZ) / (dmabuf->rate * 2); @@ -2037,15 +2037,15 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t unlock_set_fmt(state); mutex_unlock(&state->sem); - /* There are two situations when sleep_on_timeout */ - /* returns, one is when the interrupt is serviced */ - /* correctly and the process is waked up by ISR */ - /* ON TIME. Another is when timeout is expired, which */ - /* means that either interrupt is NOT serviced */ - /* correctly (pending interrupt) or it is TOO LATE */ - /* for the process to be scheduled to run */ - /* (scheduler latency) which results in a (potential) */ - /* buffer underrun. And worse, there is NOTHING we */ + /* There are two situations when sleep_on_timeout */ + /* returns, one is when the interrupt is serviced */ + /* correctly and the process is waked up by ISR */ + /* ON TIME. Another is when timeout is expired, which */ + /* means that either interrupt is NOT serviced */ + /* correctly (pending interrupt) or it is TOO LATE */ + /* for the process to be scheduled to run */ + /* (scheduler latency) which results in a (potential) */ + /* buffer underrun. And worse, there is NOTHING we */ /* can do to prevent it. */ if (!interruptible_sleep_on_timeout(&dmabuf->wait, tmo)) { pr_debug(KERN_ERR "trident: playback schedule " @@ -2054,8 +2054,8 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t dmabuf->fragsize, dmabuf->count, dmabuf->hwptr, dmabuf->swptr); - /* a buffer underrun, we delay the recovery */ - /* until next time the while loop begin and */ + /* a buffer underrun, we delay the recovery */ + /* until next time the while loop begin and */ /* we REALLY have data to play */ } if (signal_pending(current)) { @@ -2079,7 +2079,7 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t if (state->chans_num == 6) { copy_count = 0; state_cnt = 0; - if (ali_write_5_1(state, buffer, cnt, ©_count, + if (ali_write_5_1(state, buffer, cnt, ©_count, &state_cnt) == -EFAULT) { if (state_cnt) { swptr = (swptr + state_cnt) % dmabuf->dmasize; @@ -2096,7 +2096,7 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t goto out; } } else { - if (copy_from_user(dmabuf->rawbuf + swptr, + if (copy_from_user(dmabuf->rawbuf + swptr, buffer, cnt)) { if (!ret) ret = -EFAULT; @@ -2172,7 +2172,7 @@ trident_poll(struct file *file, struct poll_table_struct *wait) if (dmabuf->count >= (signed) dmabuf->fragsize) mask |= POLLOUT | POLLWRNORM; } else { - if ((signed) dmabuf->dmasize >= dmabuf->count + + if ((signed) dmabuf->dmasize >= dmabuf->count + (signed) dmabuf->fragsize) mask |= POLLOUT | POLLWRNORM; } @@ -2227,7 +2227,7 @@ out: } static int -trident_ioctl(struct inode *inode, struct file *file, +trident_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { struct trident_state *state = (struct trident_state *)file->private_data; @@ -2348,7 +2348,7 @@ trident_ioctl(struct inode *inode, struct file *file, case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format */ - ret = put_user(AFMT_S16_LE | AFMT_U16_LE | AFMT_S8 | + ret = put_user(AFMT_S16_LE | AFMT_U16_LE | AFMT_S8 | AFMT_U8, p); break; @@ -2379,7 +2379,7 @@ trident_ioctl(struct inode *inode, struct file *file, } } unlock_set_fmt(state); - ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : + ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : AFMT_U8, p); break; @@ -2438,7 +2438,7 @@ trident_ioctl(struct inode *inode, struct file *file, stop_adc(state); dmabuf->ready = 0; if (val >= 2) { - if (!((file->f_mode & FMODE_WRITE) && + if (!((file->f_mode & FMODE_WRITE) && (val == 6))) val = 2; dmabuf->fmt |= TRIDENT_FMT_STEREO; @@ -2504,7 +2504,7 @@ trident_ioctl(struct inode *inode, struct file *file, abinfo.fragstotal = dmabuf->numfrag; abinfo.fragments = abinfo.bytes >> dmabuf->fragshift; spin_unlock_irqrestore(&state->card->lock, flags); - ret = copy_to_user(argp, &abinfo, sizeof (abinfo)) ? + ret = copy_to_user(argp, &abinfo, sizeof (abinfo)) ? -EFAULT : 0; break; @@ -2524,7 +2524,7 @@ trident_ioctl(struct inode *inode, struct file *file, abinfo.fragstotal = dmabuf->numfrag; abinfo.fragments = abinfo.bytes >> dmabuf->fragshift; spin_unlock_irqrestore(&state->card->lock, flags); - ret = copy_to_user(argp, &abinfo, sizeof (abinfo)) ? + ret = copy_to_user(argp, &abinfo, sizeof (abinfo)) ? -EFAULT : 0; break; @@ -2533,7 +2533,7 @@ trident_ioctl(struct inode *inode, struct file *file, break; case SNDCTL_DSP_GETCAPS: - ret = put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER | + ret = put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP | DSP_CAP_BIND, p); break; @@ -2553,7 +2553,7 @@ trident_ioctl(struct inode *inode, struct file *file, } if (file->f_mode & FMODE_READ) { if (val & PCM_ENABLE_INPUT) { - if (!dmabuf->ready && + if (!dmabuf->ready && (ret = prog_dmabuf_record(state))) break; start_adc(state); @@ -2562,7 +2562,7 @@ trident_ioctl(struct inode *inode, struct file *file, } if (file->f_mode & FMODE_WRITE) { if (val & PCM_ENABLE_OUTPUT) { - if (!dmabuf->ready && + if (!dmabuf->ready && (ret = prog_dmabuf_playback(state))) break; start_dac(state); @@ -2589,7 +2589,7 @@ trident_ioctl(struct inode *inode, struct file *file, if (dmabuf->mapped) dmabuf->count &= dmabuf->fragsize - 1; spin_unlock_irqrestore(&state->card->lock, flags); - ret = copy_to_user(argp, &cinfo, sizeof (cinfo)) ? + ret = copy_to_user(argp, &cinfo, sizeof (cinfo)) ? -EFAULT : 0; break; @@ -2612,7 +2612,7 @@ trident_ioctl(struct inode *inode, struct file *file, if (dmabuf->mapped) dmabuf->count &= dmabuf->fragsize - 1; spin_unlock_irqrestore(&state->card->lock, flags); - ret = copy_to_user(argp, &cinfo, sizeof (cinfo)) ? + ret = copy_to_user(argp, &cinfo, sizeof (cinfo)) ? -EFAULT : 0; break; @@ -2641,17 +2641,17 @@ trident_ioctl(struct inode *inode, struct file *file, break; case SOUND_PCM_READ_CHANNELS: - ret = put_user((dmabuf->fmt & TRIDENT_FMT_STEREO) ? 2 : 1, + ret = put_user((dmabuf->fmt & TRIDENT_FMT_STEREO) ? 2 : 1, p); break; case SOUND_PCM_READ_BITS: - ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : + ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : AFMT_U8, p); break; case SNDCTL_DSP_GETCHANNELMASK: - ret = put_user(DSP_BIND_FRONT | DSP_BIND_SURR | + ret = put_user(DSP_BIND_FRONT | DSP_BIND_SURR | DSP_BIND_CENTER_LFE, p); break; @@ -2671,10 +2671,10 @@ trident_ioctl(struct inode *inode, struct file *file, } else { dmabuf->ready = 0; if (file->f_mode & FMODE_READ) - dmabuf->channel->attribute = (CHANNEL_REC | + dmabuf->channel->attribute = (CHANNEL_REC | SRC_ENABLE); if (file->f_mode & FMODE_WRITE) - dmabuf->channel->attribute = (CHANNEL_SPC_PB | + dmabuf->channel->attribute = (CHANNEL_SPC_PB | SRC_ENABLE); dmabuf->channel->attribute |= mask2attr[ffs(val)]; } @@ -2702,6 +2702,7 @@ trident_open(struct inode *inode, struct file *file) struct trident_card *card = devs; struct trident_state *state = NULL; struct dmabuf *dmabuf = NULL; + unsigned long flags; /* Added by Matt Wu 01-05-2001 */ /* TODO: there's some redundacy here wrt the check below */ @@ -2765,8 +2766,8 @@ trident_open(struct inode *inode, struct file *file) init_waitqueue_head(&dmabuf->wait); file->private_data = state; - /* set default sample format. According to OSS Programmer's */ - /* Guide /dev/dsp should be default to unsigned 8-bits, mono, */ + /* set default sample format. According to OSS Programmer's */ + /* Guide /dev/dsp should be default to unsigned 8-bits, mono, */ /* with sample rate 8kHz and /dev/dspW will accept 16-bits sample */ if (file->f_mode & FMODE_WRITE) { dmabuf->fmt &= ~TRIDENT_FMT_MASK; @@ -2779,11 +2780,13 @@ trident_open(struct inode *inode, struct file *file) /* set default channel attribute to normal playback */ dmabuf->channel->attribute = CHANNEL_PB; } + spin_lock_irqsave(&card->lock, flags); trident_set_dac_rate(state, 8000); + spin_unlock_irqrestore(&card->lock, flags); } if (file->f_mode & FMODE_READ) { - /* FIXME: Trident 4d can only record in signed 16-bits stereo, */ + /* FIXME: Trident 4d can only record in signed 16-bits stereo, */ /* 48kHz sample, to be dealed with in trident_set_adc_rate() ?? */ dmabuf->fmt &= ~TRIDENT_FMT_MASK; if ((minor & 0x0f) == SND_DEV_DSP16) @@ -2794,10 +2797,12 @@ trident_open(struct inode *inode, struct file *file) if (card->pci_id == PCI_DEVICE_ID_SI_7018) { /* set default channel attribute to 0x8a80, record from PCM L/R FIFO and mono = (left + right + 1)/2 */ - dmabuf->channel->attribute = (CHANNEL_REC | PCM_LR | + dmabuf->channel->attribute = (CHANNEL_REC | PCM_LR | MONO_MIX); } + spin_lock_irqsave(&card->lock, flags); trident_set_adc_rate(state, 8000); + spin_unlock_irqrestore(&card->lock, flags); /* Added by Matt Wu 01-05-2001 */ if (card->pci_id == PCI_DEVICE_ID_ALI_5451) @@ -3020,7 +3025,7 @@ acquirecodecaccess(struct trident_card *card) break; if (wsemabits == 0) { unlock: - outl(((u32) (wcontrol & 0x1eff) | 0x00004000), + outl(((u32) (wcontrol & 0x1eff) | 0x00004000), TRID_REG(card, ALI_AC97_WRITE)); continue; } @@ -3104,7 +3109,7 @@ ali_ac97_get(struct trident_card *card, int secondary, u8 reg) ncount = 10; while (1) { - if ((inw(TRID_REG(card, ALI_AC97_WRITE)) & ALI_AC97_BUSY_READ) + if ((inw(TRID_REG(card, ALI_AC97_WRITE)) & ALI_AC97_BUSY_READ) != 0) break; if (ncount <= 0) @@ -3112,7 +3117,7 @@ ali_ac97_get(struct trident_card *card, int secondary, u8 reg) if (ncount-- == 1) { pr_debug("ali_ac97_read :try clear busy flag\n"); aud_reg = inl(TRID_REG(card, ALI_AC97_WRITE)); - outl((aud_reg & 0xffff7fff), + outl((aud_reg & 0xffff7fff), TRID_REG(card, ALI_AC97_WRITE)); } udelay(10); @@ -3159,7 +3164,7 @@ ali_ac97_set(struct trident_card *card, int secondary, u8 reg, u16 val) wcontrol = inw(TRID_REG(card, ALI_AC97_WRITE)); wcontrol &= 0xff00; - wcontrol |= (0x8100 | reg); /* bit 8=1: (ali1535 )reserved/ */ + wcontrol |= (0x8100 | reg); /* bit 8=1: (ali1535 )reserved/ */ /* ali1535+ write */ outl((data | wcontrol), TRID_REG(card, ALI_AC97_WRITE)); @@ -3177,7 +3182,7 @@ ali_ac97_set(struct trident_card *card, int secondary, u8 reg, u16 val) break; if (ncount-- == 1) { pr_debug("ali_ac97_set :try clear busy flag!!\n"); - outw(wcontrol & 0x7fff, + outw(wcontrol & 0x7fff, TRID_REG(card, ALI_AC97_WRITE)); } udelay(10); @@ -3382,7 +3387,7 @@ ali_detect_spdif_rate(struct trident_card *card) bval |= 0x1F; outb(bval, TRID_REG(card, ALI_SPDIF_CTRL + 1)); - while (((R1 < 0x0B) || (R1 > 0x0E)) && (R1 != 0x12) && + while (((R1 < 0x0B) || (R1 > 0x0E)) && (R1 != 0x12) && count <= 50000) { count++; @@ -3669,14 +3674,14 @@ ali_save_regs(struct trident_card *card) spin_lock_irqsave(&card->lock, flags); ali_registers.global_regs[0x2c] = inl(TRID_REG(card, T4D_MISCINT)); - //ali_registers.global_regs[0x20] = inl(TRID_REG(card,T4D_START_A)); + //ali_registers.global_regs[0x20] = inl(TRID_REG(card,T4D_START_A)); ali_registers.global_regs[0x21] = inl(TRID_REG(card, T4D_STOP_A)); //disable all IRQ bits outl(ALI_DISABLE_ALL_IRQ, TRID_REG(card, T4D_MISCINT)); for (i = 1; i < ALI_MIXER_REGS; i++) - ali_registers.mixer_regs[i] = ali_ac97_read(card->ac97_codec[0], + ali_registers.mixer_regs[i] = ali_ac97_read(card->ac97_codec[0], i * 2); for (i = 0; i < ALI_GLOBAL_REGS; i++) { @@ -3688,7 +3693,7 @@ ali_save_regs(struct trident_card *card) for (i = 0; i < ALI_CHANNELS; i++) { outb(i, TRID_REG(card, T4D_LFO_GC_CIR)); for (j = 0; j < ALI_CHANNEL_REGS; j++) - ali_registers.channel_regs[i][j] = inl(TRID_REG(card, + ali_registers.channel_regs[i][j] = inl(TRID_REG(card, j * 4 + 0xe0)); } @@ -3707,18 +3712,18 @@ ali_restore_regs(struct trident_card *card) spin_lock_irqsave(&card->lock, flags); for (i = 1; i < ALI_MIXER_REGS; i++) - ali_ac97_write(card->ac97_codec[0], i * 2, + ali_ac97_write(card->ac97_codec[0], i * 2, ali_registers.mixer_regs[i]); for (i = 0; i < ALI_CHANNELS; i++) { outb(i, TRID_REG(card, T4D_LFO_GC_CIR)); for (j = 0; j < ALI_CHANNEL_REGS; j++) - outl(ali_registers.channel_regs[i][j], + outl(ali_registers.channel_regs[i][j], TRID_REG(card, j * 4 + 0xe0)); } for (i = 0; i < ALI_GLOBAL_REGS; i++) { - if ((i * 4 == T4D_MISCINT) || (i * 4 == T4D_STOP_A) || + if ((i * 4 == T4D_MISCINT) || (i * 4 == T4D_STOP_A) || (i * 4 == T4D_START_A)) continue; outl(ali_registers.global_regs[i], TRID_REG(card, i * 4)); @@ -3763,7 +3768,7 @@ ali_alloc_pcm_channel(struct trident_card *card) bank = &card->banks[BANK_A]; - if (inl(TRID_REG(card, ALI_GLOBAL_CONTROL)) & + if (inl(TRID_REG(card, ALI_GLOBAL_CONTROL)) & (ALI_SPDIF_OUT_CH_ENABLE)) { idx = ALI_SPDIF_OUT_CHANNEL; if (!(bank->bitmap & (1 << idx))) { @@ -3774,7 +3779,7 @@ ali_alloc_pcm_channel(struct trident_card *card) } } - for (idx = ALI_PCM_OUT_CHANNEL_FIRST; idx <= ALI_PCM_OUT_CHANNEL_LAST; + for (idx = ALI_PCM_OUT_CHANNEL_FIRST; idx <= ALI_PCM_OUT_CHANNEL_LAST; idx++) { if (!(bank->bitmap & (1 << idx))) { struct trident_channel *channel = &bank->channels[idx]; @@ -3785,9 +3790,9 @@ ali_alloc_pcm_channel(struct trident_card *card) } /* no more free channels avaliable */ -#if 0 +#if 0 printk(KERN_ERR "ali: no more channels available on Bank A.\n"); -#endif /* 0 */ +#endif /* 0 */ return NULL; } @@ -3812,9 +3817,9 @@ ali_alloc_rec_pcm_channel(struct trident_card *card) } /* no free recordable channels avaliable */ -#if 0 +#if 0 printk(KERN_ERR "ali: no recordable channels available on Bank A.\n"); -#endif /* 0 */ +#endif /* 0 */ return NULL; } @@ -3837,14 +3842,14 @@ ali_set_spdif_out_rate(struct trident_card *card, unsigned int rate) break; } - /* select spdif_out */ + /* select spdif_out */ ch_st_sel = inb(TRID_REG(card, ALI_SPDIF_CTRL)) & ALI_SPDIF_OUT_CH_STATUS; - ch_st_sel |= 0x80; /* select right */ + ch_st_sel |= 0x80; /* select right */ outb(ch_st_sel, TRID_REG(card, ALI_SPDIF_CTRL)); outb(status_rate | 0x20, TRID_REG(card, ALI_SPDIF_CS + 2)); - ch_st_sel &= (~0x80); /* select left */ + ch_st_sel &= (~0x80); /* select left */ outb(ch_st_sel, TRID_REG(card, ALI_SPDIF_CTRL)); outw(status_rate | 0x10, TRID_REG(card, ALI_SPDIF_CS + 2)); } @@ -3881,14 +3886,14 @@ ali_address_interrupt(struct trident_card *card) } } -/* Updating the values of counters of other_states' DMAs without lock +/* Updating the values of counters of other_states' DMAs without lock protection is no harm because all DMAs of multi-channels and interrupt depend on a master state's DMA, and changing the counters of the master state DMA is protected by a spinlock. */ static int -ali_write_5_1(struct trident_state *state, const char __user *buf, - int cnt_for_multi_channel, unsigned int *copy_count, +ali_write_5_1(struct trident_state *state, const char __user *buf, + int cnt_for_multi_channel, unsigned int *copy_count, unsigned int *state_cnt) { @@ -3904,10 +3909,10 @@ ali_write_5_1(struct trident_state *state, const char __user *buf, if ((i = state->multi_channels_adjust_count) > 0) { if (i == 1) { - if (copy_from_user(dmabuf->rawbuf + swptr, + if (copy_from_user(dmabuf->rawbuf + swptr, buffer, sample_s)) return -EFAULT; - seek_offset(swptr, buffer, cnt_for_multi_channel, + seek_offset(swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count); i--; (*state_cnt) += sample_s; @@ -3916,10 +3921,10 @@ ali_write_5_1(struct trident_state *state, const char __user *buf, i = i - (state->chans_num - other_dma_nums); for (; (i < other_dma_nums) && (cnt_for_multi_channel > 0); i++) { dmabuf_temp = &state->other_states[i]->dmabuf; - if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, + if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, buffer, sample_s)) return -EFAULT; - seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, + seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count); } if (cnt_for_multi_channel == 0) @@ -3928,39 +3933,39 @@ ali_write_5_1(struct trident_state *state, const char __user *buf, if (cnt_for_multi_channel > 0) { loop = cnt_for_multi_channel / (state->chans_num * sample_s); for (i = 0; i < loop; i++) { - if (copy_from_user(dmabuf->rawbuf + swptr, buffer, + if (copy_from_user(dmabuf->rawbuf + swptr, buffer, sample_s * 2)) return -EFAULT; - seek_offset(swptr, buffer, cnt_for_multi_channel, + seek_offset(swptr, buffer, cnt_for_multi_channel, sample_s * 2, *copy_count); (*state_cnt) += (sample_s * 2); dmabuf_temp = &state->other_states[0]->dmabuf; - if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, + if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, buffer, sample_s)) return -EFAULT; - seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, + seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count); dmabuf_temp = &state->other_states[1]->dmabuf; - if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, + if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, buffer, sample_s)) return -EFAULT; - seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, + seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count); dmabuf_temp = &state->other_states[2]->dmabuf; - if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, + if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, buffer, sample_s)) return -EFAULT; - seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, + seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count); dmabuf_temp = &state->other_states[3]->dmabuf; - if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, + if (copy_from_user(dmabuf_temp->rawbuf + dmabuf_temp->swptr, buffer, sample_s)) return -EFAULT; - seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, + seek_offset(dmabuf_temp->swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count); } @@ -3969,15 +3974,15 @@ ali_write_5_1(struct trident_state *state, const char __user *buf, if (copy_from_user(dmabuf->rawbuf + swptr, buffer, sample_s)) return -EFAULT; - seek_offset(swptr, buffer, cnt_for_multi_channel, + seek_offset(swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count); (*state_cnt) += sample_s; if (cnt_for_multi_channel > 0) { - if (copy_from_user(dmabuf->rawbuf + swptr, + if (copy_from_user(dmabuf->rawbuf + swptr, buffer, sample_s)) return -EFAULT; - seek_offset(swptr, buffer, cnt_for_multi_channel, + seek_offset(swptr, buffer, cnt_for_multi_channel, sample_s, *copy_count); (*state_cnt) += sample_s; @@ -3986,12 +3991,12 @@ ali_write_5_1(struct trident_state *state, const char __user *buf, loop = state->multi_channels_adjust_count - diff; for (i = 0; i < loop; i++) { dmabuf_temp = &state->other_states[i]->dmabuf; - if (copy_from_user(dmabuf_temp->rawbuf + - dmabuf_temp->swptr, + if (copy_from_user(dmabuf_temp->rawbuf + + dmabuf_temp->swptr, buffer, sample_s)) return -EFAULT; - seek_offset(dmabuf_temp->swptr, buffer, - cnt_for_multi_channel, + seek_offset(dmabuf_temp->swptr, buffer, + cnt_for_multi_channel, sample_s, *copy_count); } } @@ -4048,11 +4053,11 @@ ali_write_proc(struct file *file, const char __user *buffer, unsigned long count ali_disable_special_channel(card, ALI_SPDIF_OUT_CHANNEL); break; case '1': - ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT | + ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT | ALI_SPDIF_OUT_PCM); break; case '2': - ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT | + ali_setup_spdif_out(card, ALI_SPDIF_OUT_TO_SPDIF_OUT | ALI_SPDIF_OUT_NON_PCM); break; case '3': @@ -4077,7 +4082,7 @@ trident_open_mixdev(struct inode *inode, struct file *file) for (card = devs; card != NULL; card = card->next) for (i = 0; i < NR_AC97; i++) - if (card->ac97_codec[i] != NULL && + if (card->ac97_codec[i] != NULL && card->ac97_codec[i]->dev_mixer == minor) goto match; @@ -4091,7 +4096,7 @@ trident_open_mixdev(struct inode *inode, struct file *file) } static int -trident_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, +trident_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { struct ac97_codec *codec = (struct ac97_codec *) file->private_data; @@ -4185,9 +4190,9 @@ trident_ac97_init(struct trident_card *card) /* disable AC97 GPIO interrupt */ outl(0x00, TRID_REG(card, SI_AC97_GPIO)); /* when power up the AC link is in cold reset mode so stop it */ - outl(PCMOUT | SURROUT | CENTEROUT | LFEOUT | SECONDARY_ID, + outl(PCMOUT | SURROUT | CENTEROUT | LFEOUT | SECONDARY_ID, TRID_REG(card, SI_SERIAL_INTF_CTRL)); - /* it take a long time to recover from a cold reset */ + /* it take a long time to recover from a cold reset */ /* (especially when you have more than one codec) */ udelay(2000); ready_2nd = inl(TRID_REG(card, SI_SERIAL_INTF_CTRL)); @@ -4207,9 +4212,9 @@ trident_ac97_init(struct trident_card *card) /* disable AC97 GPIO interrupt */ outl(0x00, TRID_REG(card, SI_AC97_GPIO)); /* when power up, the AC link is in cold reset mode, so stop it */ - outl(PCMOUT | SURROUT | CENTEROUT | LFEOUT, + outl(PCMOUT | SURROUT | CENTEROUT | LFEOUT, TRID_REG(card, SI_SERIAL_INTF_CTRL)); - /* it take a long time to recover from a cold reset (especially */ + /* it take a long time to recover from a cold reset (especially */ /* when you have more than one codec) */ udelay(2000); ready_2nd = inl(TRID_REG(card, SI_SERIAL_INTF_CTRL)); @@ -4221,7 +4226,7 @@ trident_ac97_init(struct trident_card *card) if ((codec = ac97_alloc_codec()) == NULL) return -ENOMEM; - /* initialize some basic codec information, other fields */ + /* initialize some basic codec information, other fields */ /* will be filled in ac97_probe_codec */ codec->private_data = card; codec->id = num_ac97; @@ -4352,8 +4357,8 @@ static inline int trident_register_gameport(struct trident_card *card) { return static inline void trident_unregister_gameport(struct trident_card *card) { } #endif /* SUPPORT_JOYSTICK */ -/* install the driver, we do not allocate hardware channel nor DMA buffer */ -/* now, they are defered until "ACCESS" time (in prog_dmabuf called by */ +/* install the driver, we do not allocate hardware channel nor DMA buffer */ +/* now, they are defered until "ACCESS" time (in prog_dmabuf called by */ /* open/read/write/ioctl/mmap) */ static int __devinit trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) @@ -4376,9 +4381,9 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) else dma_mask = TRIDENT_DMA_MASK; if (pci_set_dma_mask(pci_dev, dma_mask)) { - printk(KERN_ERR "trident: architecture does not support" - " %s PCI busmaster DMA\n", - pci_dev->device == PCI_DEVICE_ID_ALI_5451 ? + printk(KERN_ERR "trident: architecture does not support" + " %s PCI busmaster DMA\n", + pci_dev->device == PCI_DEVICE_ID_ALI_5451 ? "32-bit" : "30-bit"); goto out; } @@ -4422,7 +4427,7 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) pci_set_master(pci_dev); - printk(KERN_INFO "trident: %s found at IO 0x%04lx, IRQ %d\n", + printk(KERN_INFO "trident: %s found at IO 0x%04lx, IRQ %d\n", card_names[pci_id->driver_data], card->iobase, card->irq); if (card->pci_id == PCI_DEVICE_ID_ALI_5451) { @@ -4449,9 +4454,9 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) /* Add H/W Volume Control By Matt Wu Jul. 06, 2001 */ card->hwvolctl = 0; - pci_dev_m1533 = pci_find_device(PCI_VENDOR_ID_AL, - PCI_DEVICE_ID_AL_M1533, - pci_dev_m1533); + pci_dev_m1533 = pci_get_device(PCI_VENDOR_ID_AL, + PCI_DEVICE_ID_AL_M1533, + pci_dev_m1533); rc = -ENODEV; if (pci_dev_m1533 == NULL) goto out_proc_fs; @@ -4465,6 +4470,8 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) bits &= 0xbf; /*clear bit 6 */ pci_write_config_byte(pci_dev_m1533, 0x7b, bits); } + pci_dev_put(pci_dev_m1533); + } else if (card->pci_id == PCI_DEVICE_ID_INTERG_5050) { card->alloc_pcm_channel = cyber_alloc_pcm_channel; card->alloc_rec_pcm_channel = cyber_alloc_pcm_channel; @@ -4482,7 +4489,7 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) rc = -ENODEV; if (request_irq(card->irq, &trident_interrupt, IRQF_SHARED, card_names[pci_id->driver_data], card)) { - printk(KERN_ERR "trident: unable to allocate irq %d\n", + printk(KERN_ERR "trident: unable to allocate irq %d\n", card->irq); goto out_proc_fs; } @@ -4533,7 +4540,7 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) printk(KERN_INFO "trident: Running on Alpha system " "type Nautilus\n"); ac97_data = ali_ac97_get(card, 0, AC97_POWER_CONTROL); - ali_ac97_set(card, 0, AC97_POWER_CONTROL, + ali_ac97_set(card, 0, AC97_POWER_CONTROL, ac97_data | ALI_EAPD_POWER_DOWN); } } @@ -4566,7 +4573,7 @@ out_proc_fs: devs = NULL; out_release_region: release_region(iobase, 256); - return rc; + return rc; } static void __devexit @@ -4634,8 +4641,8 @@ static struct pci_driver trident_pci_driver = { static int __init trident_init_module(void) { - printk(KERN_INFO "Trident 4DWave/SiS 7018/ALi 5451,Tvia CyberPro " - "5050 PCI Audio, version " DRIVER_VERSION ", " __TIME__ " " + printk(KERN_INFO "Trident 4DWave/SiS 7018/ALi 5451,Tvia CyberPro " + "5050 PCI Audio, version " DRIVER_VERSION ", " __TIME__ " " __DATE__ "\n"); return pci_register_driver(&trident_pci_driver); diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig index 61e35ecc57b..c6b44102aa5 100644 --- a/sound/pci/Kconfig +++ b/sound/pci/Kconfig @@ -33,6 +33,7 @@ config SND_ALS4000 select SND_OPL3_LIB select SND_MPU401_UART select SND_PCM + select SND_SB_COMMON help Say Y here to include support for soundcards based on Avance Logic ALS4000 chips. @@ -215,6 +216,16 @@ config SND_CS46XX_NEW_DSP This works better than the old code, so say Y. +config SND_CS5530 + tristate "CS5530 Audio" + depends on SND && ISA_DMA_API + select SND_SB16_DSP + help + Say Y here to include support for audio on Cyrix/NatSemi CS5530 chips. + + To compile this driver as a module, choose M here: the module + will be called snd-cs5530. + config SND_CS5535AUDIO tristate "CS5535/CS5536 Audio" depends on SND && X86 && !X86_64 diff --git a/sound/pci/Makefile b/sound/pci/Makefile index e06736da9ef..cd76e0293d0 100644 --- a/sound/pci/Makefile +++ b/sound/pci/Makefile @@ -12,6 +12,7 @@ snd-azt3328-objs := azt3328.o snd-bt87x-objs := bt87x.o snd-cmipci-objs := cmipci.o snd-cs4281-objs := cs4281.o +snd-cs5530-objs := cs5530.o snd-ens1370-objs := ens1370.o snd-ens1371-objs := ens1371.o snd-es1938-objs := es1938.o @@ -36,6 +37,7 @@ obj-$(CONFIG_SND_AZT3328) += snd-azt3328.o obj-$(CONFIG_SND_BT87X) += snd-bt87x.o obj-$(CONFIG_SND_CMIPCI) += snd-cmipci.o obj-$(CONFIG_SND_CS4281) += snd-cs4281.o +obj-$(CONFIG_SND_CS5530) += snd-cs5530.o obj-$(CONFIG_SND_ENS1370) += snd-ens1370.o obj-$(CONFIG_SND_ENS1371) += snd-ens1371.o obj-$(CONFIG_SND_ES1938) += snd-es1938.o diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index 41543a4933e..05b4c869694 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -239,7 +239,7 @@ struct snd_ali_image { struct snd_ali { - unsigned long irq; + int irq; unsigned long port; unsigned char revision; @@ -731,8 +731,7 @@ static void snd_ali_detect_spdif_rate(struct snd_ali *codec) return; } - count = 0; - while (count++ <= 50000) { + for (count = 0; count <= 50000; count++) { snd_ali_delay(codec, 6); bval = inb(ALI_REG(codec,ALI_SPDIF_CTRL + 1)); R2 = bval & 0x1F; @@ -2343,7 +2342,7 @@ static int __devinit snd_ali_probe(struct pci_dev *pci, strcpy(card->driver, "ALI5451"); strcpy(card->shortname, "ALI 5451"); - sprintf(card->longname, "%s at 0x%lx, irq %li", + sprintf(card->longname, "%s at 0x%lx, irq %i", card->shortname, codec->port, codec->irq); snd_ali_printk("register card.\n"); diff --git a/sound/pci/als300.c b/sound/pci/als300.c index 8afcb98ca7b..48cc39b771d 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c @@ -88,8 +88,8 @@ #define PLAYBACK_BLOCK_COUNTER 0x9A #define RECORD_BLOCK_COUNTER 0x9B -#define DEBUG_CALLS 1 -#define DEBUG_PLAY_REC 1 +#define DEBUG_CALLS 0 +#define DEBUG_PLAY_REC 0 #if DEBUG_CALLS #define snd_als300_dbgcalls(format, args...) printk(format, ##args) @@ -733,7 +733,8 @@ static int __devinit snd_als300_create(struct snd_card *card, snd_als300_init(chip); - if (snd_als300_ac97(chip) < 0) { + err = snd_als300_ac97(chip); + if (err < 0) { snd_printk(KERN_WARNING "Could not create ac97\n"); snd_als300_free(chip); return err; diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 9fd7b8a5b75..fcab8fb97e3 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -168,6 +168,25 @@ MODULE_PARM_DESC(subsystem, "Force card subsystem model."); #include "ca0106.h" static struct snd_ca0106_details ca0106_chip_details[] = { + /* Sound Blaster X-Fi Extreme Audio. This does not have an AC97. 53SB079000000 */ + /* It is really just a normal SB Live 24bit. */ + /* + * CTRL:CA0111-WTLF + * ADC: WM8775SEDS + * DAC: CS4382-KQZ + */ + /* Tested: + * Playback on front, rear, center/lfe speakers + * Capture from Mic in. + * Not-Tested: + * Capture from Line in. + * Playback to digital out. + */ + { .serial = 0x10121102, + .name = "X-Fi Extreme Audio [SB0790]", + .gpio_type = 1, + .i2c_adc = 1 } , + /* New Dell Sound Blaster Live! 7.1 24bit. This does not have an AC97. */ /* AudigyLS[SB0310] */ { .serial = 0x10021102, .name = "AudigyLS [SB0310]", diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index bef1f6d1859..71d7aab9d86 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -2897,6 +2897,10 @@ static int snd_cs46xx_free(struct snd_cs46xx *chip) } #endif +#ifdef CONFIG_PM + kfree(chip->saved_regs); +#endif + pci_disable_device(chip->pci); kfree(chip); return 0; @@ -3140,6 +3144,23 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip) /* * start and load DSP */ + +static void cs46xx_enable_stream_irqs(struct snd_cs46xx *chip) +{ + unsigned int tmp; + + snd_cs46xx_pokeBA0(chip, BA0_HICR, HICR_IEV | HICR_CHGM); + + tmp = snd_cs46xx_peek(chip, BA1_PFIE); + tmp &= ~0x0000f03f; + snd_cs46xx_poke(chip, BA1_PFIE, tmp); /* playback interrupt enable */ + + tmp = snd_cs46xx_peek(chip, BA1_CIE); + tmp &= ~0x0000003f; + tmp |= 0x00000001; + snd_cs46xx_poke(chip, BA1_CIE, tmp); /* capture interrupt enable */ +} + int __devinit snd_cs46xx_start_dsp(struct snd_cs46xx *chip) { unsigned int tmp; @@ -3214,19 +3235,7 @@ int __devinit snd_cs46xx_start_dsp(struct snd_cs46xx *chip) snd_cs46xx_proc_start(chip); - /* - * Enable interrupts on the part. - */ - snd_cs46xx_pokeBA0(chip, BA0_HICR, HICR_IEV | HICR_CHGM); - - tmp = snd_cs46xx_peek(chip, BA1_PFIE); - tmp &= ~0x0000f03f; - snd_cs46xx_poke(chip, BA1_PFIE, tmp); /* playback interrupt enable */ - - tmp = snd_cs46xx_peek(chip, BA1_CIE); - tmp &= ~0x0000003f; - tmp |= 0x00000001; - snd_cs46xx_poke(chip, BA1_CIE, tmp); /* capture interrupt enable */ + cs46xx_enable_stream_irqs(chip); #ifndef CONFIG_SND_CS46XX_NEW_DSP /* set the attenuation to 0dB */ @@ -3665,11 +3674,19 @@ static struct cs_card_type __devinitdata cards[] = { * APM support */ #ifdef CONFIG_PM +static unsigned int saved_regs[] = { + BA0_ACOSV, + BA0_ASER_FADDR, + BA0_ASER_MASTER, + BA1_PVOL, + BA1_CVOL, +}; + int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state) { struct snd_card *card = pci_get_drvdata(pci); struct snd_cs46xx *chip = card->private_data; - int amp_saved; + int i, amp_saved; snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); chip->in_suspend = 1; @@ -3680,6 +3697,10 @@ int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state) snd_ac97_suspend(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]); snd_ac97_suspend(chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]); + /* save some registers */ + for (i = 0; i < ARRAY_SIZE(saved_regs); i++) + chip->saved_regs[i] = snd_cs46xx_peekBA0(chip, saved_regs[i]); + amp_saved = chip->amplifier; /* turn off amp */ chip->amplifier_ctrl(chip, -chip->amplifier); @@ -3698,7 +3719,7 @@ int snd_cs46xx_resume(struct pci_dev *pci) { struct snd_card *card = pci_get_drvdata(pci); struct snd_cs46xx *chip = card->private_data; - int amp_saved; + int i, amp_saved; pci_set_power_state(pci, PCI_D0); pci_restore_state(pci); @@ -3716,6 +3737,16 @@ int snd_cs46xx_resume(struct pci_dev *pci) snd_cs46xx_chip_init(chip); + snd_cs46xx_reset(chip); +#ifdef CONFIG_SND_CS46XX_NEW_DSP + cs46xx_dsp_resume(chip); + /* restore some registers */ + for (i = 0; i < ARRAY_SIZE(saved_regs); i++) + snd_cs46xx_pokeBA0(chip, saved_regs[i], chip->saved_regs[i]); +#else + snd_cs46xx_download_image(chip); +#endif + #if 0 snd_cs46xx_codec_write(chip, BA0_AC97_GENERAL_PURPOSE, chip->ac97_general_purpose); @@ -3730,6 +3761,13 @@ int snd_cs46xx_resume(struct pci_dev *pci) snd_ac97_resume(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]); snd_ac97_resume(chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]); + /* reset playback/capture */ + snd_cs46xx_set_play_sample_rate(chip, 8000); + snd_cs46xx_set_capture_sample_rate(chip, 8000); + snd_cs46xx_proc_start(chip); + + cs46xx_enable_stream_irqs(chip); + if (amp_saved) chip->amplifier_ctrl(chip, 1); /* turn amp on */ else @@ -3896,6 +3934,15 @@ int __devinit snd_cs46xx_create(struct snd_card *card, snd_cs46xx_proc_init(card, chip); +#ifdef CONFIG_PM + chip->saved_regs = kmalloc(sizeof(*chip->saved_regs) * + ARRAY_SIZE(saved_regs), GFP_KERNEL); + if (!chip->saved_regs) { + snd_cs46xx_free(chip); + return -ENOMEM; + } +#endif + chip->active_ctrl(chip, -1); /* disable CLKRUN */ snd_card_set_dev(card, &pci->dev); diff --git a/sound/pci/cs46xx/cs46xx_lib.h b/sound/pci/cs46xx/cs46xx_lib.h index f75750c2bd2..20dcd72f06c 100644 --- a/sound/pci/cs46xx/cs46xx_lib.h +++ b/sound/pci/cs46xx/cs46xx_lib.h @@ -86,6 +86,9 @@ static inline unsigned int snd_cs46xx_peekBA0(struct snd_cs46xx *chip, unsigned struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip); void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip); int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module); +#ifdef CONFIG_PM +int cs46xx_dsp_resume(struct snd_cs46xx * chip); +#endif struct dsp_symbol_entry *cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symbol_type); #ifdef CONFIG_PROC_FS diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index 336e77e2600..590b35d91df 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c @@ -306,13 +306,59 @@ void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip) mutex_unlock(&chip->spos_mutex); } +static int dsp_load_parameter(struct snd_cs46xx *chip, + struct dsp_segment_desc *parameter) +{ + u32 doffset, dsize; + + if (!parameter) { + snd_printdd("dsp_spos: module got no parameter segment\n"); + return 0; + } + + doffset = (parameter->offset * 4 + DSP_PARAMETER_BYTE_OFFSET); + dsize = parameter->size * 4; + + snd_printdd("dsp_spos: " + "downloading parameter data to chip (%08x-%08x)\n", + doffset,doffset + dsize); + if (snd_cs46xx_download (chip, parameter->data, doffset, dsize)) { + snd_printk(KERN_ERR "dsp_spos: " + "failed to download parameter data to DSP\n"); + return -EINVAL; + } + return 0; +} + +static int dsp_load_sample(struct snd_cs46xx *chip, + struct dsp_segment_desc *sample) +{ + u32 doffset, dsize; + + if (!sample) { + snd_printdd("dsp_spos: module got no sample segment\n"); + return 0; + } + + doffset = (sample->offset * 4 + DSP_SAMPLE_BYTE_OFFSET); + dsize = sample->size * 4; + + snd_printdd("dsp_spos: downloading sample data to chip (%08x-%08x)\n", + doffset,doffset + dsize); + + if (snd_cs46xx_download (chip,sample->data,doffset,dsize)) { + snd_printk(KERN_ERR "dsp_spos: failed to sample data to DSP\n"); + return -EINVAL; + } + return 0; +} + int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module) { struct dsp_spos_instance * ins = chip->dsp_spos_instance; struct dsp_segment_desc * code = get_segment_desc (module,SEGTYPE_SP_PROGRAM); - struct dsp_segment_desc * parameter = get_segment_desc (module,SEGTYPE_SP_PARAMETER); - struct dsp_segment_desc * sample = get_segment_desc (module,SEGTYPE_SP_SAMPLE); u32 doffset, dsize; + int err; if (ins->nmodules == DSP_MAX_MODULES - 1) { snd_printk(KERN_ERR "dsp_spos: to many modules loaded into DSP\n"); @@ -326,49 +372,20 @@ int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * m snd_cs46xx_clear_BA1(chip, DSP_PARAMETER_BYTE_OFFSET, DSP_PARAMETER_BYTE_SIZE); } - if (parameter == NULL) { - snd_printdd("dsp_spos: module got no parameter segment\n"); - } else { - if (ins->nmodules > 0) { - snd_printk(KERN_WARNING "dsp_spos: WARNING current parameter data may be overwriten!\n"); - } - - doffset = (parameter->offset * 4 + DSP_PARAMETER_BYTE_OFFSET); - dsize = parameter->size * 4; - - snd_printdd("dsp_spos: downloading parameter data to chip (%08x-%08x)\n", - doffset,doffset + dsize); - - if (snd_cs46xx_download (chip, parameter->data, doffset, dsize)) { - snd_printk(KERN_ERR "dsp_spos: failed to download parameter data to DSP\n"); - return -EINVAL; - } - } + err = dsp_load_parameter(chip, get_segment_desc(module, + SEGTYPE_SP_PARAMETER)); + if (err < 0) + return err; if (ins->nmodules == 0) { snd_printdd("dsp_spos: clearing sample area\n"); snd_cs46xx_clear_BA1(chip, DSP_SAMPLE_BYTE_OFFSET, DSP_SAMPLE_BYTE_SIZE); } - if (sample == NULL) { - snd_printdd("dsp_spos: module got no sample segment\n"); - } else { - if (ins->nmodules > 0) { - snd_printk(KERN_WARNING "dsp_spos: WARNING current sample data may be overwriten\n"); - } - - doffset = (sample->offset * 4 + DSP_SAMPLE_BYTE_OFFSET); - dsize = sample->size * 4; - - snd_printdd("dsp_spos: downloading sample data to chip (%08x-%08x)\n", - doffset,doffset + dsize); - - if (snd_cs46xx_download (chip,sample->data,doffset,dsize)) { - snd_printk(KERN_ERR "dsp_spos: failed to sample data to DSP\n"); - return -EINVAL; - } - } - + err = dsp_load_sample(chip, get_segment_desc(module, + SEGTYPE_SP_SAMPLE)); + if (err < 0) + return err; if (ins->nmodules == 0) { snd_printdd("dsp_spos: clearing code area\n"); @@ -986,7 +1003,10 @@ _map_task_tree (struct snd_cs46xx *chip, char * name, u32 dest, u32 size) return NULL; } - strcpy(ins->tasks[ins->ntask].task_name,name); + if (name) + strcpy(ins->tasks[ins->ntask].task_name, name); + else + strcpy(ins->tasks[ins->ntask].task_name, "(NULL)"); ins->tasks[ins->ntask].address = dest; ins->tasks[ins->ntask].size = size; @@ -995,7 +1015,8 @@ _map_task_tree (struct snd_cs46xx *chip, char * name, u32 dest, u32 size) desc = (ins->tasks + ins->ntask); ins->ntask++; - add_symbol (chip,name,dest,SYMBOL_PARAMETER); + if (name) + add_symbol (chip,name,dest,SYMBOL_PARAMETER); return desc; } @@ -1006,6 +1027,7 @@ cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 desc = _map_scb (chip,name,dest); if (desc) { + desc->data = scb_data; _dsp_create_scb(chip,scb_data,dest); } else { snd_printk(KERN_ERR "dsp_spos: failed to map SCB\n"); @@ -1023,6 +1045,7 @@ cs46xx_dsp_create_task_tree (struct snd_cs46xx *chip, char * name, u32 * task_da desc = _map_task_tree (chip,name,dest,size); if (desc) { + desc->data = task_data; _dsp_create_task_tree(chip,task_data,dest,size); } else { snd_printk(KERN_ERR "dsp_spos: failed to map TASK\n"); @@ -1320,8 +1343,10 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip) 0x0000ffff }; - /* dirty hack ... */ - _dsp_create_task_tree (chip,(u32 *)&mix2_ostream_spb,WRITE_BACK_SPB,2); + if (!cs46xx_dsp_create_task_tree(chip, NULL, + (u32 *)&mix2_ostream_spb, + WRITE_BACK_SPB, 2)) + goto _fail_end; } /* input sample converter */ @@ -1622,7 +1647,6 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip, return 0; } - static void cs46xx_dsp_disable_spdif_hw (struct snd_cs46xx *chip) { struct dsp_spos_instance * ins = chip->dsp_spos_instance; @@ -1894,3 +1918,61 @@ int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right) return 0; } + +#ifdef CONFIG_PM +int cs46xx_dsp_resume(struct snd_cs46xx * chip) +{ + struct dsp_spos_instance * ins = chip->dsp_spos_instance; + int i, err; + + /* clear parameter, sample and code areas */ + snd_cs46xx_clear_BA1(chip, DSP_PARAMETER_BYTE_OFFSET, + DSP_PARAMETER_BYTE_SIZE); + snd_cs46xx_clear_BA1(chip, DSP_SAMPLE_BYTE_OFFSET, + DSP_SAMPLE_BYTE_SIZE); + snd_cs46xx_clear_BA1(chip, DSP_CODE_BYTE_OFFSET, DSP_CODE_BYTE_SIZE); + + for (i = 0; i < ins->nmodules; i++) { + struct dsp_module_desc *module = &ins->modules[i]; + struct dsp_segment_desc *seg; + u32 doffset, dsize; + + seg = get_segment_desc(module, SEGTYPE_SP_PARAMETER); + err = dsp_load_parameter(chip, seg); + if (err < 0) + return err; + + seg = get_segment_desc(module, SEGTYPE_SP_SAMPLE); + err = dsp_load_sample(chip, seg); + if (err < 0) + return err; + + seg = get_segment_desc(module, SEGTYPE_SP_PROGRAM); + if (!seg) + continue; + + doffset = seg->offset * 4 + module->load_address * 4 + + DSP_CODE_BYTE_OFFSET; + dsize = seg->size * 4; + err = snd_cs46xx_download(chip, + ins->code.data + module->load_address, + doffset, dsize); + if (err < 0) + return err; + } + + for (i = 0; i < ins->ntask; i++) { + struct dsp_task_descriptor *t = &ins->tasks[i]; + _dsp_create_task_tree(chip, t->data, t->address, t->size); + } + + for (i = 0; i < ins->nscb; i++) { + struct dsp_scb_descriptor *s = &ins->scbs[i]; + if (s->deleted) + continue; + _dsp_create_scb(chip, s->data, s->address); + } + + return 0; +} +#endif diff --git a/sound/pci/cs5530.c b/sound/pci/cs5530.c new file mode 100644 index 00000000000..240a0a46220 --- /dev/null +++ b/sound/pci/cs5530.c @@ -0,0 +1,306 @@ +/* + * cs5530.c - Initialisation code for Cyrix/NatSemi VSA1 softaudio + * + * (C) Copyright 2007 Ash Willis <ashwillis@programmer.net> + * (C) Copyright 2003 Red Hat Inc <alan@redhat.com> + * + * This driver was ported (shamelessly ripped ;) from oss/kahlua.c but I did + * mess with it a bit. The chip seems to have to have trouble with full duplex + * mode. If we're recording in 8bit 8000kHz, say, and we then attempt to + * simultaneously play back audio at 16bit 44100kHz, the device actually plays + * back in the same format in which it is capturing. By forcing the chip to + * always play/capture in 16/44100, we can let alsa-lib convert the samples and + * that way we can hack up some full duplex audio. + * + * XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems. + * The older version (VSA1) provides fairly good soundblaster emulation + * although there are a couple of bugs: large DMA buffers break record, + * and the MPU event handling seems suspect. VSA2 allows the native driver + * to control the AC97 audio engine directly and requires a different driver. + * + * Thanks to National Semiconductor for providing the needed information + * on the XpressAudio(tm) internals. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * TO DO: + * Investigate whether we can portably support Cognac (5520) in the + * same manner. + */ + +#include <sound/driver.h> +#include <linux/delay.h> +#include <linux/moduleparam.h> +#include <linux/pci.h> +#include <sound/core.h> +#include <sound/sb.h> +#include <sound/initval.h> + +MODULE_AUTHOR("Ash Willis"); +MODULE_DESCRIPTION("CS5530 Audio"); +MODULE_LICENSE("GPL"); + +static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; +static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; +static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; + +struct snd_cs5530 { + struct snd_card *card; + struct pci_dev *pci; + struct snd_sb *sb; + unsigned long pci_base; +}; + +static struct pci_device_id snd_cs5530_ids[] = { + {PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_AUDIO, PCI_ANY_ID, + PCI_ANY_ID, 0, 0}, + {0,} +}; + +MODULE_DEVICE_TABLE(pci, snd_cs5530_ids); + +static int snd_cs5530_free(struct snd_cs5530 *chip) +{ + pci_release_regions(chip->pci); + pci_disable_device(chip->pci); + kfree(chip); + return 0; +} + +static int snd_cs5530_dev_free(struct snd_device *device) +{ + struct snd_cs5530 *chip = device->device_data; + return snd_cs5530_free(chip); +} + +static void __devexit snd_cs5530_remove(struct pci_dev *pci) +{ + snd_card_free(pci_get_drvdata(pci)); + pci_set_drvdata(pci, NULL); +} + +static u8 __devinit snd_cs5530_mixer_read(unsigned long io, u8 reg) +{ + outb(reg, io + 4); + udelay(20); + reg = inb(io + 5); + udelay(20); + return reg; +} + +static int __devinit snd_cs5530_create(struct snd_card *card, + struct pci_dev *pci, + struct snd_cs5530 **rchip) +{ + struct snd_cs5530 *chip; + unsigned long sb_base; + u8 irq, dma8, dma16 = 0; + u16 map; + void __iomem *mem; + int err; + + static struct snd_device_ops ops = { + .dev_free = snd_cs5530_dev_free, + }; + *rchip = NULL; + + err = pci_enable_device(pci); + if (err < 0) + return err; + + chip = kzalloc(sizeof(*chip), GFP_KERNEL); + if (chip == NULL) { + pci_disable_device(pci); + return -ENOMEM; + } + + chip->card = card; + chip->pci = pci; + + err = pci_request_regions(pci, "CS5530"); + if (err < 0) { + kfree(chip); + pci_disable_device(pci); + return err; + } + chip->pci_base = pci_resource_start(pci, 0); + + mem = ioremap_nocache(chip->pci_base, pci_resource_len(pci, 0)); + if (mem == NULL) { + kfree(chip); + pci_disable_device(pci); + return -EBUSY; + } + + map = readw(mem + 0x18); + iounmap(mem); + + /* Map bits + 0:1 * 0x20 + 0x200 = sb base + 2 sb enable + 3 adlib enable + 5 MPU enable 0x330 + 6 MPU enable 0x300 + + The other bits may be used internally so must be masked */ + + sb_base = 0x220 + 0x20 * (map & 3); + + if (map & (1<<2)) + printk(KERN_INFO "CS5530: XpressAudio at 0x%lx\n", sb_base); + else { + printk(KERN_ERR "Could not find XpressAudio!\n"); + snd_cs5530_free(chip); + return -ENODEV; + } + + if (map & (1<<5)) + printk(KERN_INFO "CS5530: MPU at 0x300\n"); + else if (map & (1<<6)) + printk(KERN_INFO "CS5530: MPU at 0x330\n"); + + irq = snd_cs5530_mixer_read(sb_base, 0x80) & 0x0F; + dma8 = snd_cs5530_mixer_read(sb_base, 0x81); + + if (dma8 & 0x20) + dma16 = 5; + else if (dma8 & 0x40) + dma16 = 6; + else if (dma8 & 0x80) + dma16 = 7; + else { + printk(KERN_ERR "CS5530: No 16bit DMA enabled\n"); + snd_cs5530_free(chip); + return -ENODEV; + } + + if (dma8 & 0x01) + dma8 = 0; + else if (dma8 & 02) + dma8 = 1; + else if (dma8 & 0x08) + dma8 = 3; + else { + printk(KERN_ERR "CS5530: No 8bit DMA enabled\n"); + snd_cs5530_free(chip); + return -ENODEV; + } + + if (irq & 1) + irq = 9; + else if (irq & 2) + irq = 5; + else if (irq & 4) + irq = 7; + else if (irq & 8) + irq = 10; + else { + printk(KERN_ERR "CS5530: SoundBlaster IRQ not set\n"); + snd_cs5530_free(chip); + return -ENODEV; + } + + printk(KERN_INFO "CS5530: IRQ: %d DMA8: %d DMA16: %d\n", irq, dma8, + dma16); + + err = snd_sbdsp_create(card, sb_base, irq, snd_sb16dsp_interrupt, dma8, + dma16, SB_HW_CS5530, &chip->sb); + if (err < 0) { + printk(KERN_ERR "CS5530: Could not create SoundBlaster\n"); + snd_cs5530_free(chip); + return err; + } + + err = snd_sb16dsp_pcm(chip->sb, 0, &chip->sb->pcm); + if (err < 0) { + printk(KERN_ERR "CS5530: Could not create PCM\n"); + snd_cs5530_free(chip); + return err; + } + + err = snd_sbmixer_new(chip->sb); + if (err < 0) { + printk(KERN_ERR "CS5530: Could not create Mixer\n"); + snd_cs5530_free(chip); + return err; + } + + err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); + if (err < 0) { + snd_cs5530_free(chip); + return err; + } + + snd_card_set_dev(card, &pci->dev); + *rchip = chip; + return 0; +} + +static int __devinit snd_cs5530_probe(struct pci_dev *pci, + const struct pci_device_id *pci_id) +{ + static int dev; + struct snd_card *card; + struct snd_cs5530 *chip = NULL; + int err; + + if (dev >= SNDRV_CARDS) + return -ENODEV; + if (!enable[dev]) { + dev++; + return -ENOENT; + } + + card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); + + if (card == NULL) + return -ENOMEM; + + err = snd_cs5530_create(card, pci, &chip); + if (err < 0) { + snd_card_free(card); + return err; + } + + strcpy(card->driver, "CS5530"); + strcpy(card->shortname, "CS5530 Audio"); + sprintf(card->longname, "%s at 0x%lx", card->shortname, chip->pci_base); + + err = snd_card_register(card); + if (err < 0) { + snd_card_free(card); + return err; + } + pci_set_drvdata(pci, card); + dev++; + return 0; +} + +static struct pci_driver driver = { + .name = "CS5530_Audio", + .id_table = snd_cs5530_ids, + .probe = snd_cs5530_probe, + .remove = __devexit_p(snd_cs5530_remove), +}; + +static int __init alsa_card_cs5530_init(void) +{ + return pci_register_driver(&driver); +} + +static void __exit alsa_card_cs5530_exit(void) +{ + pci_unregister_driver(&driver); +} + +module_init(alsa_card_cs5530_init) +module_exit(alsa_card_cs5530_exit) + diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 4a9b59ad8ab..404ae1be0a4 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -51,9 +51,15 @@ #define HANA_FILENAME "emu/hana.fw" #define DOCK_FILENAME "emu/audio_dock.fw" +#define EMU1010B_FILENAME "emu/emu1010b.fw" +#define MICRO_DOCK_FILENAME "emu/micro_dock.fw" +#define EMU1010_NOTEBOOK_FILENAME "emu/emu1010_notebook.fw" MODULE_FIRMWARE(HANA_FILENAME); MODULE_FIRMWARE(DOCK_FILENAME); +MODULE_FIRMWARE(EMU1010B_FILENAME); +MODULE_FIRMWARE(MICRO_DOCK_FILENAME); +MODULE_FIRMWARE(EMU1010_NOTEBOOK_FILENAME); /************************************************************************* @@ -660,10 +666,12 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file return err; } snd_printk(KERN_INFO "firmware size=0x%zx\n", fw_entry->size); +#if 0 if (fw_entry->size != 0x133a4) { snd_printk(KERN_ERR "firmware: %s wrong size.\n",filename); return -EINVAL; } +#endif /* The FPGA is a Xilinx Spartan IIE XC2S50E */ /* GPIO7 -> FPGA PGMN @@ -694,6 +702,37 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file return 0; } +/* + * EMU-1010 - details found out from this driver, official MS Win drivers, + * testing the card: + * + * Audigy2 (aka Alice2): + * --------------------- + * * communication over PCI + * * conversion of 32-bit data coming over EMU32 links from HANA FPGA + * to 2 x 16-bit, using internal DSP instructions + * * slave mode, clock supplied by HANA + * * linked to HANA using: + * 32 x 32-bit serial EMU32 output channels + * 16 x EMU32 input channels + * (?) x I2S I/O channels (?) + * + * FPGA (aka HANA): + * --------------- + * * provides all (?) physical inputs and outputs of the card + * (ADC, DAC, SPDIF I/O, ADAT I/O, etc.) + * * provides clock signal for the card and Alice2 + * * two crystals - for 44.1kHz and 48kHz multiples + * * provides internal routing of signal sources to signal destinations + * * inputs/outputs to Alice2 - see above + * + * Current status of the driver: + * ---------------------------- + * * only 44.1/48kHz supported (the MS Win driver supports up to 192 kHz) + * * PCM device nb. 2: + * 16 x 16-bit playback - snd_emu10k1_fx8010_playback_ops + * 16 x 32-bit capture - snd_emu10k1_capture_efx_ops + */ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) { unsigned int i; @@ -727,7 +766,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) /* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */ snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); snd_printdd("reg1=0x%x\n",reg); - if (reg == 0x55) { + if ((reg & 0x3f) == 0x15) { /* FPGA netlist already present so clear it */ /* Return to programming mode */ @@ -735,19 +774,32 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) } snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); snd_printdd("reg2=0x%x\n",reg); - if (reg == 0x55) { + if ((reg & 0x3f) == 0x15) { /* FPGA failed to return to programming mode */ + snd_printk(KERN_INFO "emu1010: FPGA failed to return to programming mode\n"); return -ENODEV; } snd_printk(KERN_INFO "emu1010: EMU_HANA_ID=0x%x\n",reg); - if ((err = snd_emu1010_load_firmware(emu, HANA_FILENAME)) != 0) { - snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file %s failed\n", HANA_FILENAME); - return err; + if (emu->card_capabilities->emu1010 == 1) { + if ((err = snd_emu1010_load_firmware(emu, HANA_FILENAME)) != 0) { + snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file %s failed\n", HANA_FILENAME); + return err; + } + } else if (emu->card_capabilities->emu1010 == 2) { + if ((err = snd_emu1010_load_firmware(emu, EMU1010B_FILENAME)) != 0) { + snd_printk(KERN_INFO "emu1010: Loading Firmware file %s failed\n", EMU1010B_FILENAME); + return err; + } + } else if (emu->card_capabilities->emu1010 == 3) { + if ((err = snd_emu1010_load_firmware(emu, EMU1010_NOTEBOOK_FILENAME)) != 0) { + snd_printk(KERN_INFO "emu1010: Loading Firmware file %s failed\n", EMU1010_NOTEBOOK_FILENAME); + return err; + } } /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); - if (reg != 0x55) { + if ((reg & 0x3f) != 0x15) { /* FPGA failed to be programmed */ snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file failed, reg=0x%x\n", reg); return -ENODEV; @@ -850,6 +902,27 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) EMU_DST_ALICE2_EMU32_6, EMU_SRC_DOCK_ADC2_LEFT1); snd_emu1010_fpga_link_dst_src_write(emu, EMU_DST_ALICE2_EMU32_7, EMU_SRC_DOCK_ADC2_RIGHT1); + /* Pavel Hofman - setting defaults for 8 more capture channels + * Defaults only, users will set their own values anyways, let's + * just copy/paste. + */ + + snd_emu1010_fpga_link_dst_src_write(emu, + EMU_DST_ALICE2_EMU32_8, EMU_SRC_DOCK_MIC_A1); + snd_emu1010_fpga_link_dst_src_write(emu, + EMU_DST_ALICE2_EMU32_9, EMU_SRC_DOCK_MIC_B1); + snd_emu1010_fpga_link_dst_src_write(emu, + EMU_DST_ALICE2_EMU32_A, EMU_SRC_HAMOA_ADC_LEFT2); + snd_emu1010_fpga_link_dst_src_write(emu, + EMU_DST_ALICE2_EMU32_B, EMU_SRC_HAMOA_ADC_LEFT2); + snd_emu1010_fpga_link_dst_src_write(emu, + EMU_DST_ALICE2_EMU32_C, EMU_SRC_DOCK_ADC1_LEFT1); + snd_emu1010_fpga_link_dst_src_write(emu, + EMU_DST_ALICE2_EMU32_D, EMU_SRC_DOCK_ADC1_RIGHT1); + snd_emu1010_fpga_link_dst_src_write(emu, + EMU_DST_ALICE2_EMU32_E, EMU_SRC_DOCK_ADC2_LEFT1); + snd_emu1010_fpga_link_dst_src_write(emu, + EMU_DST_ALICE2_EMU32_F, EMU_SRC_DOCK_ADC2_RIGHT1); #endif #if 0 /* Original */ @@ -943,16 +1016,27 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) /* Return to Audio Dock programming mode */ snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n"); snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK ); - if ((err = snd_emu1010_load_firmware(emu, DOCK_FILENAME)) != 0) { - return err; + if (emu->card_capabilities->emu1010 == 1) { + if ((err = snd_emu1010_load_firmware(emu, DOCK_FILENAME)) != 0) { + return err; + } + } else if (emu->card_capabilities->emu1010 == 2) { + if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { + return err; + } + } else if (emu->card_capabilities->emu1010 == 3) { + if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { + return err; + } } + snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0 ); snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, ® ); snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_IRQ_STATUS=0x%x\n",reg); /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_ID=0x%x\n",reg); - if (reg != 0x55) { + if ((reg & 0x3f) != 0x15) { /* FPGA failed to be programmed */ snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware file failed, reg=0x%x\n", reg); return 0; @@ -1227,9 +1311,15 @@ static struct snd_emu_chip_details emu_chip_details[] = { .emu10k2_chip = 1, .ca0108_chip = 1, .ca_cardbus_chip = 1, - .spi_dac = 1, - .i2c_adc = 1, - .spk71 = 1} , + .spk71 = 1 , + .emu1010 = 3} , + {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102, + .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]", + .id = "EMU1010", + .emu10k2_chip = 1, + .ca0108_chip = 1, + .spk71 = 1 , + .emu1010 = 2} , {.vendor = 0x1102, .device = 0x0008, .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]", .id = "Audigy2", @@ -1663,12 +1753,13 @@ int __devinit snd_emu10k1_create(struct snd_card *card, emu->fx8010.extout_mask = extout_mask; emu->enable_ir = enable_ir; + if (emu->card_capabilities->ca_cardbus_chip) { + if ((err = snd_emu10k1_cardbus_init(emu)) < 0) + goto error; + } if (emu->card_capabilities->ecard) { if ((err = snd_emu10k1_ecard_init(emu)) < 0) goto error; - } else if (emu->card_capabilities->ca_cardbus_chip) { - if ((err = snd_emu10k1_cardbus_init(emu)) < 0) - goto error; } else if (emu->card_capabilities->emu1010) { if ((err = snd_emu10k1_emu1010_init(emu)) < 0) { snd_emu10k1_free(emu); @@ -1814,10 +1905,10 @@ void snd_emu10k1_suspend_regs(struct snd_emu10k1 *emu) void snd_emu10k1_resume_init(struct snd_emu10k1 *emu) { + if (emu->card_capabilities->ca_cardbus_chip) + snd_emu10k1_cardbus_init(emu); if (emu->card_capabilities->ecard) snd_emu10k1_ecard_init(emu); - else if (emu->card_capabilities->ca_cardbus_chip) - snd_emu10k1_cardbus_init(emu); else if (emu->card_capabilities->emu1010) snd_emu10k1_emu1010_init(emu); else diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c index c02012cccd8..7206c0fa06f 100644 --- a/sound/pci/emu10k1/emufx.c +++ b/sound/pci/emu10k1/emufx.c @@ -1123,6 +1123,11 @@ snd_emu10k1_init_stereo_onoff_control(struct snd_emu10k1_fx8010_control_gpr *ctl ctl->translation = EMU10K1_GPR_TRANSLATION_ONOFF; } +/* + * Used for emu1010 - conversion from 32-bit capture inputs from HANA + * to 2 x 16-bit registers in audigy - their values are read via DMA. + * Conversion is performed by Audigy DSP instructions of FX8010. + */ static int snd_emu10k1_audigy_dsp_convert_32_to_2x16( struct snd_emu10k1_fx8010_code *icode, u32 *ptr, int tmp, int bit_shifter16, @@ -1193,7 +1198,11 @@ static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu) snd_emu10k1_ptr_write(emu, A_DBG, 0, (emu->fx8010.dbg = 0) | A_DBG_SINGLE_STEP); #if 1 - /* PCM front Playback Volume (independent from stereo mix) */ + /* PCM front Playback Volume (independent from stereo mix) + * playback = 0 + ( gpr * FXBUS_PCM_LEFT_FRONT >> 31) + * where gpr contains attenuation from corresponding mixer control + * (snd_emu10k1_init_stereo_control) + */ A_OP(icode, &ptr, iMAC0, A_GPR(playback), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_FRONT)); A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_FRONT)); snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Front Playback Volume", gpr, 100); @@ -1549,7 +1558,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) if (emu->card_capabilities->emu1010) { snd_printk("EMU inputs on\n"); - /* Capture 8 channels of S32_LE sound */ + /* Capture 16 (originally 8) channels of S32_LE sound */ /* printk("emufx.c: gpr=0x%x, tmp=0x%x\n",gpr, tmp); */ /* For the EMU1010: How to get 32bit values from the DSP. High 16bits into L, low 16bits into R. */ @@ -1560,6 +1569,11 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_P16VIN(0x0), A_FXBUS2(0) ); /* Right ADC in 1 of 2 */ gpr_map[gpr++] = 0x00000000; + /* Delaying by one sample: instead of copying the input + * value A_P16VIN to output A_FXBUS2 as in the first channel, + * we use an auxiliary register, delaying the value by one + * sample + */ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(2) ); A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x1), A_C_00000000, A_C_00000000); gpr_map[gpr++] = 0x00000000; @@ -1583,6 +1597,66 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) gpr_map[gpr++] = 0x00000000; snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xe) ); A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x7), A_C_00000000, A_C_00000000); + /* Pavel Hofman - we still have voices, A_FXBUS2s, and + * A_P16VINs available - + * let's add 8 more capture channels - total of 16 + */ + gpr_map[gpr++] = 0x00000000; + snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, + bit_shifter16, + A_GPR(gpr - 1), + A_FXBUS2(0x10)); + A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x8), + A_C_00000000, A_C_00000000); + gpr_map[gpr++] = 0x00000000; + snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, + bit_shifter16, + A_GPR(gpr - 1), + A_FXBUS2(0x12)); + A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x9), + A_C_00000000, A_C_00000000); + gpr_map[gpr++] = 0x00000000; + snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, + bit_shifter16, + A_GPR(gpr - 1), + A_FXBUS2(0x14)); + A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xa), + A_C_00000000, A_C_00000000); + gpr_map[gpr++] = 0x00000000; + snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, + bit_shifter16, + A_GPR(gpr - 1), + A_FXBUS2(0x16)); + A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xb), + A_C_00000000, A_C_00000000); + gpr_map[gpr++] = 0x00000000; + snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, + bit_shifter16, + A_GPR(gpr - 1), + A_FXBUS2(0x18)); + A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xc), + A_C_00000000, A_C_00000000); + gpr_map[gpr++] = 0x00000000; + snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, + bit_shifter16, + A_GPR(gpr - 1), + A_FXBUS2(0x1a)); + A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xd), + A_C_00000000, A_C_00000000); + gpr_map[gpr++] = 0x00000000; + snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, + bit_shifter16, + A_GPR(gpr - 1), + A_FXBUS2(0x1c)); + A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xe), + A_C_00000000, A_C_00000000); + gpr_map[gpr++] = 0x00000000; + snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, + bit_shifter16, + A_GPR(gpr - 1), + A_FXBUS2(0x1e)); + A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xf), + A_C_00000000, A_C_00000000); #if 0 for (z = 4; z < 8; z++) { diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 4db6e1ca166..7b2c1dcc533 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c @@ -77,6 +77,10 @@ static int snd_emu10k1_spdif_get_mask(struct snd_kcontrol *kcontrol, return 0; } +/* + * Items labels in enum mixer controls assigning source data to + * each destination + */ static char *emu1010_src_texts[] = { "Silence", "Dock Mic A", @@ -133,6 +137,9 @@ static char *emu1010_src_texts[] = { "DSP 31", }; +/* + * List of data sources available for each destination + */ static unsigned int emu1010_src_regs[] = { EMU_SRC_SILENCE,/* 0 */ EMU_SRC_DOCK_MIC_A1, /* 1 */ @@ -189,6 +196,10 @@ static unsigned int emu1010_src_regs[] = { EMU_SRC_ALICE_EMU32B+0xf, /* 52 */ }; +/* + * Data destinations - physical EMU outputs. + * Each destination has an enum mixer control to choose a data source + */ static unsigned int emu1010_output_dst[] = { EMU_DST_DOCK_DAC1_LEFT1, /* 0 */ EMU_DST_DOCK_DAC1_RIGHT1, /* 1 */ @@ -216,6 +227,11 @@ static unsigned int emu1010_output_dst[] = { EMU_DST_HANA_ADAT+7, /* 23 */ }; +/* + * Data destinations - HANA outputs going to Alice2 (audigy) for + * capture (EMU32 + I2S links) + * Each destination has an enum mixer control to choose a data source + */ static unsigned int emu1010_input_dst[] = { EMU_DST_ALICE2_EMU32_0, EMU_DST_ALICE2_EMU32_1, diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c index ab4f5df5241..eda5cb373de 100644 --- a/sound/pci/emu10k1/emupcm.c +++ b/sound/pci/emu10k1/emupcm.c @@ -1233,24 +1233,26 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream) runtime->hw.rate_min = runtime->hw.rate_max = 48000; spin_lock_irq(&emu->reg_lock); if (emu->card_capabilities->emu1010) { - /* TODO + /* Nb. of channels has been increased to 16 */ + /* TODO * SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE * SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | * SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | * SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 * rate_min = 44100, * rate_max = 192000, - * channels_min = 8, - * channels_max = 8, + * channels_min = 16, + * channels_max = 16, * Need to add mixer control to fix sample rate * - * There are 16 mono channels of 16bits each. + * There are 32 mono channels of 16bits each. * 24bit Audio uses 2x channels over 16bit * 96kHz uses 2x channels over 48kHz * 192kHz uses 4x channels over 48kHz - * So, for 48kHz 24bit, one has 8 channels - * for 96kHz 24bit, one has 4 channels - * for 192kHz 24bit, one has 2 channels + * So, for 48kHz 24bit, one has 16 channels + * for 96kHz 24bit, one has 8 channels + * for 192kHz 24bit, one has 4 channels + * */ #if 1 switch (emu->emu1010.internal_clock) { @@ -1258,13 +1260,15 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream) /* For 44.1kHz */ runtime->hw.rates = SNDRV_PCM_RATE_44100; runtime->hw.rate_min = runtime->hw.rate_max = 44100; - runtime->hw.channels_min = runtime->hw.channels_max = 8; + runtime->hw.channels_min = + runtime->hw.channels_max = 16; break; case 1: /* For 48kHz */ runtime->hw.rates = SNDRV_PCM_RATE_48000; runtime->hw.rate_min = runtime->hw.rate_max = 48000; - runtime->hw.channels_min = runtime->hw.channels_max = 8; + runtime->hw.channels_min = + runtime->hw.channels_max = 16; break; }; #endif @@ -1282,7 +1286,7 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream) #endif runtime->hw.formats = SNDRV_PCM_FMTBIT_S32_LE; /* efx_voices_mask[0] is expected to be zero - * efx_voices_mask[1] is expected to have 16bits set + * efx_voices_mask[1] is expected to have 32bits set */ } else { runtime->hw.channels_min = runtime->hw.channels_max = 0; @@ -1787,11 +1791,24 @@ int __devinit snd_emu10k1_pcm_efx(struct snd_emu10k1 * emu, int device, struct s /* emu->efx_voices_mask[0] = FXWC_DEFAULTROUTE_C | FXWC_DEFAULTROUTE_A; */ if (emu->audigy) { emu->efx_voices_mask[0] = 0; - emu->efx_voices_mask[1] = 0xffff; + if (emu->card_capabilities->emu1010) + /* Pavel Hofman - 32 voices will be used for + * capture (write mode) - + * each bit = corresponding voice + */ + emu->efx_voices_mask[1] = 0xffffffff; + else + emu->efx_voices_mask[1] = 0xffff; } else { emu->efx_voices_mask[0] = 0xffff0000; emu->efx_voices_mask[1] = 0; } + /* For emu1010, the control has to set 32 upper bits (voices) + * out of the 64 bits (voices) to true for the 16-channels capture + * to work correctly. Correct A_FXWC2 initial value (0xffffffff) + * is already defined but the snd_emu10k1_pcm_efx_voices_mask + * control can override this register's value. + */ kctl = snd_ctl_new1(&snd_emu10k1_pcm_efx_voices_mask, emu); if (!kctl) return -ENOMEM; diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 7c403965153..21cb4268a59 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c @@ -1607,8 +1607,8 @@ struct es1371_quirk { unsigned char rev; /* revision */ }; -static int __devinit es1371_quirk_lookup(struct ensoniq *ensoniq, - struct es1371_quirk *list) +static int es1371_quirk_lookup(struct ensoniq *ensoniq, + struct es1371_quirk *list) { while (list->vid != (unsigned short)PCI_ANY_ID) { if (ensoniq->pci->vendor == list->vid && diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 2fa281cbef9..92bc8b3fa2a 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -341,6 +341,9 @@ struct azx { unsigned int single_cmd :1; unsigned int polling_mode :1; unsigned int msi :1; + + /* for debugging */ + unsigned int last_cmd; /* last issued command (to sync) */ }; /* driver types */ @@ -466,18 +469,10 @@ static void azx_free_cmd_io(struct azx *chip) } /* send a command */ -static int azx_corb_send_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, - unsigned int verb, unsigned int para) +static int azx_corb_send_cmd(struct hda_codec *codec, u32 val) { struct azx *chip = codec->bus->private_data; unsigned int wp; - u32 val; - - val = (u32)(codec->addr & 0x0f) << 28; - val |= (u32)direct << 27; - val |= (u32)nid << 20; - val |= verb << 8; - val |= para; /* add command to corb */ wp = azx_readb(chip, CORBWP); @@ -538,12 +533,12 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec) } if (! chip->rirb.cmds) return chip->rirb.res; /* the last value */ - schedule_timeout_interruptible(1); + schedule_timeout(1); } while (time_after_eq(timeout, jiffies)); if (chip->msi) { snd_printk(KERN_WARNING "hda_intel: No response from codec, " - "disabling MSI...\n"); + "disabling MSI: last cmd=0x%08x\n", chip->last_cmd); free_irq(chip->irq, chip); chip->irq = -1; pci_disable_msi(chip->pci); @@ -555,13 +550,15 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec) if (!chip->polling_mode) { snd_printk(KERN_WARNING "hda_intel: azx_get_response timeout, " - "switching to polling mode...\n"); + "switching to polling mode: last cmd=0x%08x\n", + chip->last_cmd); chip->polling_mode = 1; goto again; } snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " - "switching to single_cmd mode...\n"); + "switching to single_cmd mode: last cmd=0x%08x\n", + chip->last_cmd); chip->rirb.rp = azx_readb(chip, RIRBWP); chip->rirb.cmds = 0; /* switch to single_cmd mode */ @@ -581,20 +578,11 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec) */ /* send a command */ -static int azx_single_send_cmd(struct hda_codec *codec, hda_nid_t nid, - int direct, unsigned int verb, - unsigned int para) +static int azx_single_send_cmd(struct hda_codec *codec, u32 val) { struct azx *chip = codec->bus->private_data; - u32 val; int timeout = 50; - val = (u32)(codec->addr & 0x0f) << 28; - val |= (u32)direct << 27; - val |= (u32)nid << 20; - val |= verb << 8; - val |= para; - while (timeout--) { /* check ICB busy bit */ if (! (azx_readw(chip, IRS) & ICH6_IRS_BUSY)) { @@ -639,10 +627,19 @@ static int azx_send_cmd(struct hda_codec *codec, hda_nid_t nid, unsigned int para) { struct azx *chip = codec->bus->private_data; + u32 val; + + val = (u32)(codec->addr & 0x0f) << 28; + val |= (u32)direct << 27; + val |= (u32)nid << 20; + val |= verb << 8; + val |= para; + chip->last_cmd = val; + if (chip->single_cmd) - return azx_single_send_cmd(codec, nid, direct, verb, para); + return azx_single_send_cmd(codec, val); else - return azx_corb_send_cmd(codec, nid, direct, verb, para); + return azx_corb_send_cmd(codec, val); } /* get a response */ @@ -1788,6 +1785,12 @@ static struct pci_device_id azx_ids[] = { { 0x10de, 0x044b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP65 */ { 0x10de, 0x055c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP67 */ { 0x10de, 0x055d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP67 */ + { 0x10de, 0x07fc, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP73 */ + { 0x10de, 0x07fd, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP73 */ + { 0x10de, 0x0774, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP77 */ + { 0x10de, 0x0775, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP77 */ + { 0x10de, 0x0776, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP77 */ + { 0x10de, 0x0777, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP77 */ { 0, } }; MODULE_DEVICE_TABLE(pci, azx_ids); diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index e313e685f16..ac15066fd30 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c @@ -250,6 +250,12 @@ static void print_codec_info(struct snd_info_entry *entry, struct snd_info_buffe snd_iprintf(buffer, "Vendor Id: 0x%x\n", codec->vendor_id); snd_iprintf(buffer, "Subsystem Id: 0x%x\n", codec->subsystem_id); snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id); + + if (codec->mfg) + snd_iprintf(buffer, "Modem Function Group: 0x%x\n", codec->mfg); + else + snd_iprintf(buffer, "No Modem Function Group found\n"); + if (! codec->afg) return; snd_iprintf(buffer, "Default PCM:\n"); diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 0e1a879663f..4d7f8d11ad7 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -1,7 +1,8 @@ /* - * HD audio interface patch for AD1981HD, AD1983, AD1986A, AD1988 + * HD audio interface patch for AD1882, AD1884, AD1981HD, AD1983, AD1984, + * AD1986A, AD1988 * - * Copyright (c) 2005 Takashi Iwai <tiwai@suse.de> + * Copyright (c) 2005-2007 Takashi Iwai <tiwai@suse.de> * * This driver is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -61,7 +62,7 @@ struct ad198x_spec { int num_channel_mode; /* PCM information */ - struct hda_pcm pcm_rec[2]; /* used in alc_build_pcms() */ + struct hda_pcm pcm_rec[3]; /* used in alc_build_pcms() */ struct mutex amp_mutex; /* PCM volume/mute control mutex */ unsigned int spdif_route; @@ -2775,11 +2776,634 @@ static int patch_ad1988(struct hda_codec *codec) /* + * AD1884 / AD1984 + * + * port-B - front line/mic-in + * port-E - aux in/out + * port-F - aux in/out + * port-C - rear line/mic-in + * port-D - rear line/hp-out + * port-A - front line/hp-out + * + * AD1984 = AD1884 + two digital mic-ins + * + * FIXME: + * For simplicity, we share the single DAC for both HP and line-outs + * right now. The inidividual playbacks could be easily implemented, + * but no build-up framework is given, so far. + */ + +static hda_nid_t ad1884_dac_nids[1] = { + 0x04, +}; + +static hda_nid_t ad1884_adc_nids[2] = { + 0x08, 0x09, +}; + +static hda_nid_t ad1884_capsrc_nids[2] = { + 0x0c, 0x0d, +}; + +#define AD1884_SPDIF_OUT 0x02 + +static struct hda_input_mux ad1884_capture_source = { + .num_items = 4, + .items = { + { "Front Mic", 0x0 }, + { "Mic", 0x1 }, + { "CD", 0x2 }, + { "Mix", 0x3 }, + }, +}; + +static struct snd_kcontrol_new ad1884_base_mixers[] = { + HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), + /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */ + HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Front Playback Switch", 0x12, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x13, 1, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x13, 1, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), + HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), + HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT), + HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x01, HDA_INPUT), + HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x02, HDA_INPUT), + HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x02, HDA_INPUT), + /* + HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x20, 0x03, HDA_INPUT), + HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x20, 0x03, HDA_INPUT), + HDA_CODEC_VOLUME("Digital Beep Playback Volume", 0x10, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Digital Beep Playback Switch", 0x10, 0x0, HDA_OUTPUT), + */ + HDA_CODEC_VOLUME("Mic Boost", 0x15, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Front Mic Boost", 0x14, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x0d, 0x0, HDA_OUTPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + /* The multiple "Capture Source" controls confuse alsamixer + * So call somewhat different.. + * FIXME: the controls appear in the "playback" view! + */ + /* .name = "Capture Source", */ + .name = "Input Source", + .count = 2, + .info = ad198x_mux_enum_info, + .get = ad198x_mux_enum_get, + .put = ad198x_mux_enum_put, + }, + /* SPDIF controls */ + HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source", + /* identical with ad1983 */ + .info = ad1983_spdif_route_info, + .get = ad1983_spdif_route_get, + .put = ad1983_spdif_route_put, + }, + { } /* end */ +}; + +static struct snd_kcontrol_new ad1984_dmic_mixers[] = { + HDA_CODEC_VOLUME("Digital Mic Capture Volume", 0x05, 0x0, HDA_INPUT), + HDA_CODEC_MUTE("Digital Mic Capture Switch", 0x05, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME_IDX("Digital Mic Capture Volume", 1, 0x06, 0x0, + HDA_INPUT), + HDA_CODEC_MUTE_IDX("Digital Mic Capture Switch", 1, 0x06, 0x0, + HDA_INPUT), + { } /* end */ +}; + +/* + * initialization verbs + */ +static struct hda_verb ad1884_init_verbs[] = { + /* DACs; mute as default */ + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, + {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, + /* Port-A (HP) mixer */ + {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + /* Port-A pin */ + {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, + {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* HP selector - select DAC2 */ + {0x22, AC_VERB_SET_CONNECT_SEL, 0x1}, + /* Port-D (Line-out) mixer */ + {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + /* Port-D pin */ + {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, + {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* Mono-out mixer */ + {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + /* Mono-out pin */ + {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, + {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* Mono selector */ + {0x0e, AC_VERB_SET_CONNECT_SEL, 0x1}, + /* Port-B (front mic) pin */ + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* Port-C (rear mic) pin */ + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, + {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* Analog mixer; mute as default */ + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, + /* Analog Mix output amp */ + {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x1f}, /* 0dB */ + /* SPDIF output selector */ + {0x02, AC_VERB_SET_CONNECT_SEL, 0x0}, /* PCM */ + {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */ + { } /* end */ +}; + +static int patch_ad1884(struct hda_codec *codec) +{ + struct ad198x_spec *spec; + + spec = kzalloc(sizeof(*spec), GFP_KERNEL); + if (spec == NULL) + return -ENOMEM; + + mutex_init(&spec->amp_mutex); + codec->spec = spec; + + spec->multiout.max_channels = 2; + spec->multiout.num_dacs = ARRAY_SIZE(ad1884_dac_nids); + spec->multiout.dac_nids = ad1884_dac_nids; + spec->multiout.dig_out_nid = AD1884_SPDIF_OUT; + spec->num_adc_nids = ARRAY_SIZE(ad1884_adc_nids); + spec->adc_nids = ad1884_adc_nids; + spec->capsrc_nids = ad1884_capsrc_nids; + spec->input_mux = &ad1884_capture_source; + spec->num_mixers = 1; + spec->mixers[0] = ad1884_base_mixers; + spec->num_init_verbs = 1; + spec->init_verbs[0] = ad1884_init_verbs; + spec->spdif_route = 0; + + codec->patch_ops = ad198x_patch_ops; + + return 0; +} + +/* + * Lenovo Thinkpad T61/X61 + */ +static struct hda_input_mux ad1984_thinkpad_capture_source = { + .num_items = 3, + .items = { + { "Mic", 0x0 }, + { "Internal Mic", 0x1 }, + { "Mix", 0x3 }, + }, +}; + +static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = { + HDA_CODEC_VOLUME("PCM Playback Volume", 0x04, 0x0, HDA_OUTPUT), + /* HDA_CODEC_VOLUME_IDX("PCM Playback Volume", 1, 0x03, 0x0, HDA_OUTPUT), */ + HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Speaker Playback Switch", 0x12, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x00, HDA_INPUT), + HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x00, HDA_INPUT), + HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x20, 0x01, HDA_INPUT), + HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x20, 0x01, HDA_INPUT), + HDA_CODEC_VOLUME("Docking Mic Playback Volume", 0x20, 0x04, HDA_INPUT), + HDA_CODEC_MUTE("Docking Mic Playback Switch", 0x20, 0x04, HDA_INPUT), + HDA_CODEC_VOLUME("Mic Boost", 0x14, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Internal Mic Boost", 0x15, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Docking Mic Boost", 0x25, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x03, HDA_INPUT), + HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x03, HDA_INPUT), + HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x0d, 0x0, HDA_OUTPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + /* The multiple "Capture Source" controls confuse alsamixer + * So call somewhat different.. + * FIXME: the controls appear in the "playback" view! + */ + /* .name = "Capture Source", */ + .name = "Input Source", + .count = 2, + .info = ad198x_mux_enum_info, + .get = ad198x_mux_enum_get, + .put = ad198x_mux_enum_put, + }, + { } /* end */ +}; + +/* additional verbs */ +static struct hda_verb ad1984_thinkpad_init_verbs[] = { + /* Port-E (docking station mic) pin */ + {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, + {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* docking mic boost */ + {0x25, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* Analog mixer - docking mic; mute as default */ + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, + /* enable EAPD bit */ + {0x12, AC_VERB_SET_EAPD_BTLENABLE, 0x02}, + { } /* end */ +}; + +/* Digial MIC ADC NID 0x05 + 0x06 */ +static int ad1984_pcm_dmic_prepare(struct hda_pcm_stream *hinfo, + struct hda_codec *codec, + unsigned int stream_tag, + unsigned int format, + struct snd_pcm_substream *substream) +{ + snd_hda_codec_setup_stream(codec, 0x05 + substream->number, + stream_tag, 0, format); + return 0; +} + +static int ad1984_pcm_dmic_cleanup(struct hda_pcm_stream *hinfo, + struct hda_codec *codec, + struct snd_pcm_substream *substream) +{ + snd_hda_codec_setup_stream(codec, 0x05 + substream->number, + 0, 0, 0); + return 0; +} + +static struct hda_pcm_stream ad1984_pcm_dmic_capture = { + .substreams = 2, + .channels_min = 2, + .channels_max = 2, + .nid = 0x05, + .ops = { + .prepare = ad1984_pcm_dmic_prepare, + .cleanup = ad1984_pcm_dmic_cleanup + }, +}; + +static int ad1984_build_pcms(struct hda_codec *codec) +{ + struct ad198x_spec *spec = codec->spec; + struct hda_pcm *info; + int err; + + err = ad198x_build_pcms(codec); + if (err < 0) + return err; + + info = spec->pcm_rec + codec->num_pcms; + codec->num_pcms++; + info->name = "AD1984 Digital Mic"; + info->stream[SNDRV_PCM_STREAM_CAPTURE] = ad1984_pcm_dmic_capture; + return 0; +} + +/* models */ +enum { + AD1984_BASIC, + AD1984_THINKPAD, + AD1984_MODELS +}; + +static const char *ad1984_models[AD1984_MODELS] = { + [AD1984_BASIC] = "basic", + [AD1984_THINKPAD] = "thinkpad", +}; + +static struct snd_pci_quirk ad1984_cfg_tbl[] = { + /* Lenovo Thinkpad T61/X61 */ + SND_PCI_QUIRK(0x17aa, 0, "Lenovo Thinkpad", AD1984_THINKPAD), + {} +}; + +static int patch_ad1984(struct hda_codec *codec) +{ + struct ad198x_spec *spec; + int board_config, err; + + err = patch_ad1884(codec); + if (err < 0) + return err; + spec = codec->spec; + board_config = snd_hda_check_board_config(codec, AD1984_MODELS, + ad1984_models, ad1984_cfg_tbl); + switch (board_config) { + case AD1984_BASIC: + /* additional digital mics */ + spec->mixers[spec->num_mixers++] = ad1984_dmic_mixers; + codec->patch_ops.build_pcms = ad1984_build_pcms; + break; + case AD1984_THINKPAD: + spec->multiout.dig_out_nid = 0; + spec->input_mux = &ad1984_thinkpad_capture_source; + spec->mixers[0] = ad1984_thinkpad_mixers; + spec->init_verbs[spec->num_init_verbs++] = ad1984_thinkpad_init_verbs; + break; + } + return 0; +} + + +/* + * AD1882 + * + * port-A - front hp-out + * port-B - front mic-in + * port-C - rear line-in, shared surr-out (3stack) + * port-D - rear line-out + * port-E - rear mic-in, shared clfe-out (3stack) + * port-F - rear surr-out (6stack) + * port-G - rear clfe-out (6stack) + */ + +static hda_nid_t ad1882_dac_nids[3] = { + 0x04, 0x03, 0x05 +}; + +static hda_nid_t ad1882_adc_nids[2] = { + 0x08, 0x09, +}; + +static hda_nid_t ad1882_capsrc_nids[2] = { + 0x0c, 0x0d, +}; + +#define AD1882_SPDIF_OUT 0x02 + +/* list: 0x11, 0x39, 0x3a, 0x18, 0x3c, 0x3b, 0x12, 0x20 */ +static struct hda_input_mux ad1882_capture_source = { + .num_items = 5, + .items = { + { "Front Mic", 0x1 }, + { "Mic", 0x4 }, + { "Line", 0x2 }, + { "CD", 0x3 }, + { "Mix", 0x7 }, + }, +}; + +static struct snd_kcontrol_new ad1882_base_mixers[] = { + HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Headphone Playback Switch", 0x11, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Front Playback Switch", 0x12, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x13, 1, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x13, 1, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x00, HDA_INPUT), + HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), + HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT), + HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x01, HDA_INPUT), + HDA_CODEC_VOLUME("Line Playback Volume", 0x20, 0x04, HDA_INPUT), + HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x04, HDA_INPUT), + HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x06, HDA_INPUT), + HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x06, HDA_INPUT), + HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x07, HDA_INPUT), + HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x07, HDA_INPUT), + HDA_CODEC_VOLUME("Mic Boost", 0x3c, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Line-In Boost", 0x3a, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x0d, 0x0, HDA_OUTPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + /* The multiple "Capture Source" controls confuse alsamixer + * So call somewhat different.. + * FIXME: the controls appear in the "playback" view! + */ + /* .name = "Capture Source", */ + .name = "Input Source", + .count = 2, + .info = ad198x_mux_enum_info, + .get = ad198x_mux_enum_get, + .put = ad198x_mux_enum_put, + }, + /* SPDIF controls */ + HDA_CODEC_VOLUME("IEC958 Playback Volume", 0x1b, 0x0, HDA_OUTPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source", + /* identical with ad1983 */ + .info = ad1983_spdif_route_info, + .get = ad1983_spdif_route_get, + .put = ad1983_spdif_route_put, + }, + { } /* end */ +}; + +static struct snd_kcontrol_new ad1882_3stack_mixers[] = { + HDA_CODEC_MUTE("Surround Playback Switch", 0x15, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x17, 1, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x17, 2, 0x0, HDA_OUTPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "Channel Mode", + .info = ad198x_ch_mode_info, + .get = ad198x_ch_mode_get, + .put = ad198x_ch_mode_put, + }, + { } /* end */ +}; + +static struct snd_kcontrol_new ad1882_6stack_mixers[] = { + HDA_CODEC_MUTE("Surround Playback Switch", 0x16, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x24, 1, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x24, 2, 0x0, HDA_OUTPUT), + { } /* end */ +}; + +static struct hda_verb ad1882_ch2_init[] = { + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, + {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, + {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, + {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, + {0x26, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, + {0x26, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, + { } /* end */ +}; + +static struct hda_verb ad1882_ch4_init[] = { + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, + {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, + {0x26, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, + {0x26, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, + { } /* end */ +}; + +static struct hda_verb ad1882_ch6_init[] = { + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, + {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, + {0x26, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x26, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + { } /* end */ +}; + +static struct hda_channel_mode ad1882_modes[3] = { + { 2, ad1882_ch2_init }, + { 4, ad1882_ch4_init }, + { 6, ad1882_ch6_init }, +}; + +/* + * initialization verbs + */ +static struct hda_verb ad1882_init_verbs[] = { + /* DACs; mute as default */ + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, + {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, + {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, + /* Port-A (HP) mixer */ + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + /* Port-A pin */ + {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, + {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* HP selector - select DAC2 */ + {0x37, AC_VERB_SET_CONNECT_SEL, 0x1}, + /* Port-D (Line-out) mixer */ + {0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + /* Port-D pin */ + {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, + {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* Mono-out mixer */ + {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + /* Mono-out pin */ + {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, + {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* Port-B (front mic) pin */ + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x39, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, /* boost */ + /* Port-C (line-in) pin */ + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, + {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x3a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, /* boost */ + /* Port-C mixer - mute as input */ + {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, + {0x2c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, + /* Port-E (mic-in) pin */ + {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x3c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, /* boost */ + /* Port-E mixer - mute as input */ + {0x26, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, + {0x26, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, + /* Port-F (surround) */ + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, + {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* Port-G (CLFE) */ + {0x24, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* Analog mixer; mute as default */ + /* list: 0x39, 0x3a, 0x11, 0x12, 0x3c, 0x3b, 0x18, 0x1a */ + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, + {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, + /* Analog Mix output amp */ + {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x1f}, /* 0dB */ + /* SPDIF output selector */ + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */ + {0x02, AC_VERB_SET_CONNECT_SEL, 0x0}, /* PCM */ + {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */ + { } /* end */ +}; + +/* models */ +enum { + AD1882_3STACK, + AD1882_6STACK, + AD1882_MODELS +}; + +static const char *ad1882_models[AD1986A_MODELS] = { + [AD1882_3STACK] = "3stack", + [AD1882_6STACK] = "6stack", +}; + + +static int patch_ad1882(struct hda_codec *codec) +{ + struct ad198x_spec *spec; + int board_config; + + spec = kzalloc(sizeof(*spec), GFP_KERNEL); + if (spec == NULL) + return -ENOMEM; + + mutex_init(&spec->amp_mutex); + codec->spec = spec; + + spec->multiout.max_channels = 6; + spec->multiout.num_dacs = 3; + spec->multiout.dac_nids = ad1882_dac_nids; + spec->multiout.dig_out_nid = AD1882_SPDIF_OUT; + spec->num_adc_nids = ARRAY_SIZE(ad1882_adc_nids); + spec->adc_nids = ad1882_adc_nids; + spec->capsrc_nids = ad1882_capsrc_nids; + spec->input_mux = &ad1882_capture_source; + spec->num_mixers = 1; + spec->mixers[0] = ad1882_base_mixers; + spec->num_init_verbs = 1; + spec->init_verbs[0] = ad1882_init_verbs; + spec->spdif_route = 0; + + codec->patch_ops = ad198x_patch_ops; + + /* override some parameters */ + board_config = snd_hda_check_board_config(codec, AD1882_MODELS, + ad1882_models, NULL); + switch (board_config) { + default: + case AD1882_3STACK: + spec->num_mixers = 2; + spec->mixers[1] = ad1882_3stack_mixers; + spec->channel_mode = ad1882_modes; + spec->num_channel_mode = ARRAY_SIZE(ad1882_modes); + spec->need_dac_fix = 1; + spec->multiout.max_channels = 2; + spec->multiout.num_dacs = 1; + break; + case AD1882_6STACK: + spec->num_mixers = 2; + spec->mixers[1] = ad1882_6stack_mixers; + break; + } + return 0; +} + + +/* * patch entries */ struct hda_codec_preset snd_hda_preset_analog[] = { + { .id = 0x11d41882, .name = "AD1882", .patch = patch_ad1882 }, + { .id = 0x11d41884, .name = "AD1884", .patch = patch_ad1884 }, { .id = 0x11d41981, .name = "AD1981", .patch = patch_ad1981 }, { .id = 0x11d41983, .name = "AD1983", .patch = patch_ad1983 }, + { .id = 0x11d41984, .name = "AD1984", .patch = patch_ad1984 }, { .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a }, { .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 }, { .id = 0x11d4198b, .name = "AD1988B", .patch = patch_ad1988 }, diff --git a/sound/pci/hda/patch_atihdmi.c b/sound/pci/hda/patch_atihdmi.c index f8eb4c90f80..72d3ab9751a 100644 --- a/sound/pci/hda/patch_atihdmi.c +++ b/sound/pci/hda/patch_atihdmi.c @@ -172,6 +172,7 @@ static int patch_atihdmi(struct hda_codec *codec) */ struct hda_codec_preset snd_hda_preset_atihdmi[] = { { .id = 0x1002793c, .name = "ATI RS600 HDMI", .patch = patch_atihdmi }, + { .id = 0x10027919, .name = "ATI RS600 HDMI", .patch = patch_atihdmi }, { .id = 0x1002791a, .name = "ATI RS690/780 HDMI", .patch = patch_atihdmi }, { .id = 0x1002aa01, .name = "ATI R600 HDMI", .patch = patch_atihdmi }, {} /* terminator */ diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index bef214bcddd..4d8e8af5c81 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -801,7 +801,9 @@ static struct snd_pci_quirk cxt5045_cfg_tbl[] = { SND_PCI_QUIRK(0x103c, 0x30b2, "HP DV Series", CXT5045_LAPTOP), SND_PCI_QUIRK(0x103c, 0x30b5, "HP DV2120", CXT5045_LAPTOP), SND_PCI_QUIRK(0x103c, 0x30cd, "HP DV Series", CXT5045_LAPTOP), + SND_PCI_QUIRK(0x103c, 0x30d9, "HP Spartan", CXT5045_LAPTOP), SND_PCI_QUIRK(0x1734, 0x10ad, "Fujitsu Si1520", CXT5045_FUJITSU), + SND_PCI_QUIRK(0x1734, 0x10cb, "Fujitsu Si3515", CXT5045_LAPTOP), SND_PCI_QUIRK(0x8086, 0x2111, "Conexant Reference board", CXT5045_LAPTOP), {} }; diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 4776de93928..9a47eec5a27 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -94,10 +94,18 @@ enum { ALC262_HP_BPC_D7000_WF, ALC262_BENQ_ED8, ALC262_SONY_ASSAMD, + ALC262_BENQ_T31, ALC262_AUTO, ALC262_MODEL_LAST /* last tag */ }; +/* ALC268 models */ +enum { + ALC268_3ST, + ALC268_AUTO, + ALC268_MODEL_LAST /* last tag */ +}; + /* ALC861 models */ enum { ALC861_3ST, @@ -115,6 +123,7 @@ enum { /* ALC861-VD models */ enum { ALC660VD_3ST, + ALC660VD_3ST_DIG, ALC861VD_3ST, ALC861VD_3ST_DIG, ALC861VD_6ST_DIG, @@ -144,6 +153,7 @@ enum { ALC882_TARGA, ALC882_ASUS_A7J, ALC885_MACPRO, + ALC885_IMAC24, ALC882_AUTO, ALC882_MODEL_LAST, }; @@ -163,6 +173,8 @@ enum { ALC883_LENOVO_101E_2ch, ALC883_LENOVO_NB0763, ALC888_LENOVO_MS7195_DIG, + ALC888_6ST_HP, + ALC888_3ST_HP, ALC883_AUTO, ALC883_MODEL_LAST, }; @@ -713,6 +725,38 @@ static void alc_subsystem_id(struct hda_codec *codec, } /* + * Fix-up pin default configurations + */ + +struct alc_pincfg { + hda_nid_t nid; + u32 val; +}; + +static void alc_fix_pincfg(struct hda_codec *codec, + const struct snd_pci_quirk *quirk, + const struct alc_pincfg **pinfix) +{ + const struct alc_pincfg *cfg; + + quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); + if (!quirk) + return; + + cfg = pinfix[quirk->value]; + for (; cfg->nid; cfg++) { + int i; + u32 val = cfg->val; + for (i = 0; i < 4; i++) { + snd_hda_codec_write(codec, cfg->nid, 0, + AC_VERB_SET_CONFIG_DEFAULT_BYTES_0 + i, + val & 0xff); + val >>= 8; + } + } +} + +/* * ALC880 3-stack model * * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e) @@ -1878,31 +1922,53 @@ static void alc880_lg_unsol_event(struct hda_codec *codec, unsigned int res) * Pin assignment: * Speaker-out: 0x14 * Mic-In: 0x18 - * Built-in Mic-In: 0x19 (?) - * HP-Out: 0x1b + * Built-in Mic-In: 0x19 + * Line-In: 0x1b + * HP-Out: 0x1a * SPDIF-Out: 0x1e */ -/* seems analog CD is not working */ static struct hda_input_mux alc880_lg_lw_capture_source = { - .num_items = 2, + .num_items = 3, .items = { { "Mic", 0x0 }, { "Internal Mic", 0x1 }, + { "Line In", 0x2 }, }, }; +#define alc880_lg_lw_modes alc880_threestack_modes + static struct snd_kcontrol_new alc880_lg_lw_mixer[] = { - HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT), - HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT), + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), + HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), + HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT), + HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT), + HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT), + HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT), + HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT), + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), + HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "Channel Mode", + .info = alc_ch_mode_info, + .get = alc_ch_mode_get, + .put = alc_ch_mode_put, + }, { } /* end */ }; static struct hda_verb alc880_lg_lw_init_verbs[] = { + {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */ + {0x10, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */ + {0x12, AC_VERB_SET_CONNECT_SEL, 0x03}, /* line/surround */ + /* set capture source to mic-in */ {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, @@ -1912,7 +1978,6 @@ static struct hda_verb alc880_lg_lw_init_verbs[] = { {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* HP-out */ - {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* mic-in to input */ @@ -2856,11 +2921,11 @@ static struct alc_config_preset alc880_presets[] = { .mixers = { alc880_lg_lw_mixer }, .init_verbs = { alc880_volume_init_verbs, alc880_lg_lw_init_verbs }, - .num_dacs = 1, + .num_dacs = ARRAY_SIZE(alc880_dac_nids), .dac_nids = alc880_dac_nids, .dig_out_nid = ALC880_DIGOUT_NID, - .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes), - .channel_mode = alc880_2_jack_modes, + .num_channel_mode = ARRAY_SIZE(alc880_lg_lw_modes), + .channel_mode = alc880_lg_lw_modes, .input_mux = &alc880_lg_lw_capture_source, .unsol_event = alc880_lg_lw_unsol_event, .init_hook = alc880_lg_lw_automute, @@ -5054,6 +5119,60 @@ static struct hda_verb alc882_macpro_init_verbs[] = { { } }; +/* iMac 24 mixer. */ +static struct snd_kcontrol_new alc885_imac24_mixer[] = { + HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT), + HDA_CODEC_MUTE("Master Playback Switch", 0x0c, 0x00, HDA_INPUT), + { } /* end */ +}; + +/* iMac 24 init verbs. */ +static struct hda_verb alc885_imac24_init_verbs[] = { + /* Internal speakers: output 0 (0x0c) */ + {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, + {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, + {0x18, AC_VERB_SET_CONNECT_SEL, 0x00}, + /* Internal speakers: output 0 (0x0c) */ + {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, + {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, + {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00}, + /* Headphone: output 0 (0x0c) */ + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, + {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, + /* Front Mic: input vref at 80% */ + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, + {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + { } +}; + +/* Toggle speaker-output according to the hp-jack state */ +static void alc885_imac24_automute(struct hda_codec *codec) +{ + unsigned int present; + + present = snd_hda_codec_read(codec, 0x14, 0, + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; + snd_hda_codec_amp_update(codec, 0x18, 0, HDA_OUTPUT, 0, + 0x80, present ? 0x80 : 0); + snd_hda_codec_amp_update(codec, 0x18, 1, HDA_OUTPUT, 0, + 0x80, present ? 0x80 : 0); + snd_hda_codec_amp_update(codec, 0x1a, 0, HDA_OUTPUT, 0, + 0x80, present ? 0x80 : 0); + snd_hda_codec_amp_update(codec, 0x1a, 1, HDA_OUTPUT, 0, + 0x80, present ? 0x80 : 0); +} + +/* Processes unsolicited events. */ +static void alc885_imac24_unsol_event(struct hda_codec *codec, + unsigned int res) +{ + /* Headphone insertion or removal. */ + if ((res >> 26) == ALC880_HP_EVENT) + alc885_imac24_automute(codec); +} + static struct hda_verb alc882_targa_verbs[] = { {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, @@ -5274,6 +5393,7 @@ static const char *alc882_models[ALC882_MODEL_LAST] = { [ALC882_ARIMA] = "arima", [ALC882_W2JC] = "w2jc", [ALC885_MACPRO] = "macpro", + [ALC885_IMAC24] = "imac24", [ALC882_AUTO] = "auto", }; @@ -5284,6 +5404,7 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = { SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */ SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), SND_PCI_QUIRK(0x1043, 0x060d, "Asus A7J", ALC882_ASUS_A7J), + SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG), SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG), SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC), {} @@ -5345,6 +5466,19 @@ static struct alc_config_preset alc882_presets[] = { .channel_mode = alc882_ch_modes, .input_mux = &alc882_capture_source, }, + [ALC885_IMAC24] = { + .mixers = { alc885_imac24_mixer }, + .init_verbs = { alc885_imac24_init_verbs }, + .num_dacs = ARRAY_SIZE(alc882_dac_nids), + .dac_nids = alc882_dac_nids, + .dig_out_nid = ALC882_DIGOUT_NID, + .dig_in_nid = ALC882_DIGIN_NID, + .num_channel_mode = ARRAY_SIZE(alc882_ch_modes), + .channel_mode = alc882_ch_modes, + .input_mux = &alc882_capture_source, + .unsol_event = alc885_imac24_unsol_event, + .init_hook = alc885_imac24_automute, + }, [ALC882_TARGA] = { .mixers = { alc882_targa_mixer, alc882_chmode_mixer, alc882_capture_mixer }, @@ -5379,6 +5513,29 @@ static struct alc_config_preset alc882_presets[] = { /* + * Pin config fixes + */ +enum { + PINFIX_ABIT_AW9D_MAX +}; + +static struct alc_pincfg alc882_abit_aw9d_pinfix[] = { + { 0x15, 0x01080104 }, /* side */ + { 0x16, 0x01011012 }, /* rear */ + { 0x17, 0x01016011 }, /* clfe */ + { } +}; + +static const struct alc_pincfg *alc882_pin_fixes[] = { + [PINFIX_ABIT_AW9D_MAX] = alc882_abit_aw9d_pinfix, +}; + +static struct snd_pci_quirk alc882_pinfix_tbl[] = { + SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX), + {} +}; + +/* * BIOS auto configuration */ static void alc882_auto_set_output_and_unmute(struct hda_codec *codec, @@ -5494,6 +5651,9 @@ static int patch_alc882(struct hda_codec *codec) case 0x106b0c00: /* Mac Pro */ board_config = ALC885_MACPRO; break; + case 0x106b1000: /* iMac 24 */ + board_config = ALC885_IMAC24; + break; default: printk(KERN_INFO "hda_codec: Unknown model for ALC882, " "trying auto-probe from BIOS...\n"); @@ -5501,6 +5661,8 @@ static int patch_alc882(struct hda_codec *codec) } } + alc_fix_pincfg(codec, alc882_pinfix_tbl, alc882_pin_fixes); + if (board_config == ALC882_AUTO) { /* automatic parse from the BIOS config */ err = alc882_parse_auto_config(codec); @@ -5518,7 +5680,7 @@ static int patch_alc882(struct hda_codec *codec) if (board_config != ALC882_AUTO) setup_preset(spec, &alc882_presets[board_config]); - if (board_config == ALC885_MACPRO) { + if (board_config == ALC885_MACPRO || board_config == ALC885_IMAC24) { alc882_gpio_mute(codec, 0, 0); alc882_gpio_mute(codec, 1, 0); } @@ -5995,6 +6157,84 @@ static struct snd_kcontrol_new alc883_medion_md2_mixer[] = { { } /* end */ }; +static struct snd_kcontrol_new alc888_6st_hp_mixer[] = { + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), + HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), + HDA_CODEC_VOLUME("Surround Playback Volume", 0x0e, 0x0, HDA_OUTPUT), + HDA_BIND_MUTE("Surround Playback Switch", 0x0e, 2, HDA_INPUT), + HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT), + HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT), + HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT), + HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT), + HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT), + HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), + HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), + HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), + HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT), + HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), + HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), + HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), + HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), + HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), + HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + /* .name = "Capture Source", */ + .name = "Input Source", + .count = 2, + .info = alc883_mux_enum_info, + .get = alc883_mux_enum_get, + .put = alc883_mux_enum_put, + }, + { } /* end */ +}; + +static struct snd_kcontrol_new alc888_3st_hp_mixer[] = { + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), + HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), + HDA_CODEC_VOLUME("Surround Playback Volume", 0x0e, 0x0, HDA_OUTPUT), + HDA_BIND_MUTE("Surround Playback Switch", 0x0e, 2, HDA_INPUT), + HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT), + HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT), + HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT), + HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), + HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), + HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), + HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT), + HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), + HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), + HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), + HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), + HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), + HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + /* .name = "Capture Source", */ + .name = "Input Source", + .count = 2, + .info = alc883_mux_enum_info, + .get = alc883_mux_enum_get, + .put = alc883_mux_enum_put, + }, + { } /* end */ +}; + static struct snd_kcontrol_new alc883_chmode_mixer[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, @@ -6126,6 +6366,42 @@ static struct hda_verb alc888_lenovo_ms7195_verbs[] = { { } /* end */ }; +static struct hda_verb alc888_6st_hp_verbs[] = { + {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */ + {0x15, AC_VERB_SET_CONNECT_SEL, 0x02}, /* Rear : output 2 (0x0e) */ + {0x16, AC_VERB_SET_CONNECT_SEL, 0x01}, /* CLFE : output 1 (0x0d) */ + {0x17, AC_VERB_SET_CONNECT_SEL, 0x03}, /* Side : output 3 (0x0f) */ + { } +}; + +static struct hda_verb alc888_3st_hp_verbs[] = { + {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */ + {0x18, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Rear : output 1 (0x0d) */ + {0x16, AC_VERB_SET_CONNECT_SEL, 0x02}, /* CLFE : output 2 (0x0e) */ + { } +}; + +static struct hda_verb alc888_3st_hp_2ch_init[] = { + { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, + { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, + { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, + { 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, + { } +}; + +static struct hda_verb alc888_3st_hp_6ch_init[] = { + { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, + { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, + { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, + { 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, + { } +}; + +static struct hda_channel_mode alc888_3st_hp_modes[2] = { + { 2, alc888_3st_hp_2ch_init }, + { 6, alc888_3st_hp_6ch_init }, +}; + /* toggle front-jack and RCA according to the hp-jack state */ static void alc888_lenovo_ms7195_front_automute(struct hda_codec *codec) { @@ -6368,11 +6644,14 @@ static const char *alc883_models[ALC883_MODEL_LAST] = { [ALC883_LENOVO_101E_2ch] = "lenovo-101e", [ALC883_LENOVO_NB0763] = "lenovo-nb0763", [ALC888_LENOVO_MS7195_DIG] = "lenovo-ms7195-dig", + [ALC888_6ST_HP] = "6stack-hp", + [ALC888_3ST_HP] = "3stack-hp", [ALC883_AUTO] = "auto", }; static struct snd_pci_quirk alc883_cfg_tbl[] = { SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG), + SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG), SND_PCI_QUIRK(0x108e, 0x534d, NULL, ALC883_3ST_6ch), SND_PCI_QUIRK(0x1558, 0, "Clevo laptop", ALC883_LAPTOP_EAPD), SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC883_6ST_DIG), @@ -6381,6 +6660,8 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG), SND_PCI_QUIRK(0x1462, 0x7250, "MSI", ALC883_6ST_DIG), SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG), + SND_PCI_QUIRK(0x1462, 0x7327, "MSI", ALC883_6ST_DIG), + SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG), SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG), SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG), SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG), @@ -6400,6 +6681,9 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch), SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763), + SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC888_6ST_HP), + SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP), + SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP), SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2), {} }; @@ -6584,6 +6868,31 @@ static struct alc_config_preset alc883_presets[] = { .unsol_event = alc883_lenovo_ms7195_unsol_event, .init_hook = alc888_lenovo_ms7195_front_automute, }, + [ALC888_6ST_HP] = { + .mixers = { alc888_6st_hp_mixer, alc883_chmode_mixer }, + .init_verbs = { alc883_init_verbs, alc888_6st_hp_verbs }, + .num_dacs = ARRAY_SIZE(alc883_dac_nids), + .dac_nids = alc883_dac_nids, + .dig_out_nid = ALC883_DIGOUT_NID, + .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), + .adc_nids = alc883_adc_nids, + .dig_in_nid = ALC883_DIGIN_NID, + .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), + .channel_mode = alc883_sixstack_modes, + .input_mux = &alc883_capture_source, + }, + [ALC888_3ST_HP] = { + .mixers = { alc888_3st_hp_mixer, alc883_chmode_mixer }, + .init_verbs = { alc883_init_verbs, alc888_3st_hp_verbs }, + .num_dacs = ARRAY_SIZE(alc883_dac_nids), + .dac_nids = alc883_dac_nids, + .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), + .adc_nids = alc883_adc_nids, + .num_channel_mode = ARRAY_SIZE(alc888_3st_hp_modes), + .channel_mode = alc888_3st_hp_modes, + .need_dac_fix = 1, + .input_mux = &alc883_capture_source, + }, }; @@ -6857,7 +7166,16 @@ static struct snd_kcontrol_new alc262_sony_mixer[] = { { } /* end */ }; - +static struct snd_kcontrol_new alc262_benq_t31_mixer[] = { + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), + HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), + { } /* end */ +}; #define alc262_capture_mixer alc882_capture_mixer #define alc262_capture_alt_mixer alc882_capture_alt_mixer @@ -7189,6 +7507,15 @@ static struct hda_verb alc262_EAPD_verbs[] = { {} }; +static struct hda_verb alc262_benq_t31_EAPD_verbs[] = { + {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, + + {0x20, AC_VERB_SET_COEF_INDEX, 0x07}, + {0x20, AC_VERB_SET_PROC_COEF, 0x3050}, + {} +}; + /* add playback controls from the parsed DAC table */ static int alc262_auto_create_multi_out_ctls(struct alc_spec *spec, const struct auto_pin_cfg *cfg) @@ -7584,7 +7911,8 @@ static const char *alc262_models[ALC262_MODEL_LAST] = { [ALC262_HP_BPC] = "hp-bpc", [ALC262_HP_BPC_D7000_WL]= "hp-bpc-d7000", [ALC262_BENQ_ED8] = "benq", - [ALC262_BENQ_ED8] = "sony-assamd", + [ALC262_BENQ_T31] = "benq-t31", + [ALC262_SONY_ASSAMD] = "sony-assamd", [ALC262_AUTO] = "auto", }; @@ -7592,8 +7920,12 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = { SND_PCI_QUIRK(0x1002, 0x437b, "Hippo", ALC262_HIPPO), SND_PCI_QUIRK(0x103c, 0x12fe, "HP xw9400", ALC262_HP_BPC), SND_PCI_QUIRK(0x103c, 0x280c, "HP xw4400", ALC262_HP_BPC), + SND_PCI_QUIRK(0x103c, 0x12ff, "HP xw4550", ALC262_HP_BPC), + SND_PCI_QUIRK(0x103c, 0x1308, "HP xw4600", ALC262_HP_BPC), SND_PCI_QUIRK(0x103c, 0x3014, "HP xw6400", ALC262_HP_BPC), + SND_PCI_QUIRK(0x103c, 0x1307, "HP xw6600", ALC262_HP_BPC), SND_PCI_QUIRK(0x103c, 0x3015, "HP xw8400", ALC262_HP_BPC), + SND_PCI_QUIRK(0x103c, 0x1306, "HP xw8600", ALC262_HP_BPC), SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL), SND_PCI_QUIRK(0x103c, 0x2802, "HP D7000", ALC262_HP_BPC_D7000_WL), SND_PCI_QUIRK(0x103c, 0x2804, "HP D7000", ALC262_HP_BPC_D7000_WL), @@ -7606,6 +7938,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = { SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1), SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), + SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31), SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD), SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD), SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD), @@ -7710,6 +8043,17 @@ static struct alc_config_preset alc262_presets[] = { .channel_mode = alc262_modes, .input_mux = &alc262_capture_source, .unsol_event = alc262_hippo_unsol_event, + }, + [ALC262_BENQ_T31] = { + .mixers = { alc262_benq_t31_mixer }, + .init_verbs = { alc262_init_verbs, alc262_benq_t31_EAPD_verbs, alc262_hippo_unsol_verbs }, + .num_dacs = ARRAY_SIZE(alc262_dac_nids), + .dac_nids = alc262_dac_nids, + .hp_nid = 0x03, + .num_channel_mode = ARRAY_SIZE(alc262_modes), + .channel_mode = alc262_modes, + .input_mux = &alc262_capture_source, + .unsol_event = alc262_hippo_unsol_event, }, }; @@ -7800,6 +8144,515 @@ static int patch_alc262(struct hda_codec *codec) } /* + * ALC268 channel source setting (2 channel) + */ +#define ALC268_DIGOUT_NID ALC880_DIGOUT_NID +#define alc268_modes alc260_modes + +static hda_nid_t alc268_dac_nids[2] = { + /* front, hp */ + 0x02, 0x03 +}; + +static hda_nid_t alc268_adc_nids[2] = { + /* ADC0-1 */ + 0x08, 0x07 +}; + +static hda_nid_t alc268_adc_nids_alt[1] = { + /* ADC0 */ + 0x08 +}; + +static struct snd_kcontrol_new alc268_base_mixer[] = { + /* output mixer control */ + HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), + { } +}; + +/* + * generic initialization of ADC, input mixers and output mixers + */ +static struct hda_verb alc268_base_init_verbs[] = { + /* Unmute DAC0-1 and set vol = 0 */ + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + + /* + * Set up output mixers (0x0c - 0x0e) + */ + /* set vol=0 to output mixers */ + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, + {0x0e, AC_VERB_SET_CONNECT_SEL, 0x00}, + + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40}, + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0}, + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40}, + {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, + {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20}, + {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20}, + {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20}, + + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, + + /* FIXME: use matrix-type input source selection */ + /* Mixer elements: 0x18, 19, 1a, 1c, 14, 15, 0b */ + /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */ + /* Input mixer2 */ + {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, + {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))}, + {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8))}, + {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x03 << 8))}, + + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))}, + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8))}, + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x03 << 8))}, + { } +}; + +/* + * generic initialization of ADC, input mixers and output mixers + */ +static struct hda_verb alc268_volume_init_verbs[] = { + /* set output DAC */ + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + + {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, + {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20}, + {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20}, + {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20}, + + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + + {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + + /* set PCBEEP vol = 0 */ + {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, (0xb000 | (0x00 << 8))}, + + { } +}; + +#define alc268_mux_enum_info alc_mux_enum_info +#define alc268_mux_enum_get alc_mux_enum_get + +static int alc268_mux_enum_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct hda_codec *codec = snd_kcontrol_chip(kcontrol); + struct alc_spec *spec = codec->spec; + const struct hda_input_mux *imux = spec->input_mux; + unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); + static hda_nid_t capture_mixers[3] = { 0x23, 0x24 }; + hda_nid_t nid = capture_mixers[adc_idx]; + unsigned int *cur_val = &spec->cur_mux[adc_idx]; + unsigned int i, idx; + + idx = ucontrol->value.enumerated.item[0]; + if (idx >= imux->num_items) + idx = imux->num_items - 1; + if (*cur_val == idx && !codec->in_resume) + return 0; + for (i = 0; i < imux->num_items; i++) { + unsigned int v = (i == idx) ? 0x7000 : 0x7080; + snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, + v | (imux->items[i].index << 8)); + snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, + idx ); + } + *cur_val = idx; + return 1; +} + +static struct snd_kcontrol_new alc268_capture_alt_mixer[] = { + HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + /* The multiple "Capture Source" controls confuse alsamixer + * So call somewhat different.. + * FIXME: the controls appear in the "playback" view! + */ + /* .name = "Capture Source", */ + .name = "Input Source", + .count = 1, + .info = alc268_mux_enum_info, + .get = alc268_mux_enum_get, + .put = alc268_mux_enum_put, + }, + { } /* end */ +}; + +static struct snd_kcontrol_new alc268_capture_mixer[] = { + HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x24, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x24, 0x0, HDA_OUTPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + /* The multiple "Capture Source" controls confuse alsamixer + * So call somewhat different.. + * FIXME: the controls appear in the "playback" view! + */ + /* .name = "Capture Source", */ + .name = "Input Source", + .count = 2, + .info = alc268_mux_enum_info, + .get = alc268_mux_enum_get, + .put = alc268_mux_enum_put, + }, + { } /* end */ +}; + +static struct hda_input_mux alc268_capture_source = { + .num_items = 4, + .items = { + { "Mic", 0x0 }, + { "Front Mic", 0x1 }, + { "Line", 0x2 }, + { "CD", 0x3 }, + }, +}; + +/* create input playback/capture controls for the given pin */ +static int alc268_new_analog_output(struct alc_spec *spec, hda_nid_t nid, + const char *ctlname, int idx) +{ + char name[32]; + int err; + + sprintf(name, "%s Playback Volume", ctlname); + if (nid == 0x14) { + err = add_control(spec, ALC_CTL_WIDGET_VOL, name, + HDA_COMPOSE_AMP_VAL(0x02, 3, idx, + HDA_OUTPUT)); + if (err < 0) + return err; + } else if (nid == 0x15) { + err = add_control(spec, ALC_CTL_WIDGET_VOL, name, + HDA_COMPOSE_AMP_VAL(0x03, 3, idx, + HDA_OUTPUT)); + if (err < 0) + return err; + } else + return -1; + sprintf(name, "%s Playback Switch", ctlname); + err = add_control(spec, ALC_CTL_WIDGET_MUTE, name, + HDA_COMPOSE_AMP_VAL(nid, 3, idx, HDA_OUTPUT)); + if (err < 0) + return err; + return 0; +} + +/* add playback controls from the parsed DAC table */ +static int alc268_auto_create_multi_out_ctls(struct alc_spec *spec, + const struct auto_pin_cfg *cfg) +{ + hda_nid_t nid; + int err; + + spec->multiout.num_dacs = 2; /* only use one dac */ + spec->multiout.dac_nids = spec->private_dac_nids; + spec->multiout.dac_nids[0] = 2; + spec->multiout.dac_nids[1] = 3; + + nid = cfg->line_out_pins[0]; + if (nid) + alc268_new_analog_output(spec, nid, "Front", 0); + + nid = cfg->speaker_pins[0]; + if (nid == 0x1d) { + err = add_control(spec, ALC_CTL_WIDGET_VOL, + "Speaker Playback Volume", + HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT)); + if (err < 0) + return err; + } + nid = cfg->hp_pins[0]; + if (nid) + alc268_new_analog_output(spec, nid, "Headphone", 0); + + nid = cfg->line_out_pins[1] | cfg->line_out_pins[2]; + if (nid == 0x16) { + err = add_control(spec, ALC_CTL_WIDGET_MUTE, + "Mono Playback Switch", + HDA_COMPOSE_AMP_VAL(nid, 2, 0, HDA_INPUT)); + if (err < 0) + return err; + } + return 0; +} + +/* create playback/capture controls for input pins */ +static int alc268_auto_create_analog_input_ctls(struct alc_spec *spec, + const struct auto_pin_cfg *cfg) +{ + struct hda_input_mux *imux = &spec->private_imux; + int i, idx1; + + for (i = 0; i < AUTO_PIN_LAST; i++) { + switch(cfg->input_pins[i]) { + case 0x18: + idx1 = 0; /* Mic 1 */ + break; + case 0x19: + idx1 = 1; /* Mic 2 */ + break; + case 0x1a: + idx1 = 2; /* Line In */ + break; + case 0x1c: + idx1 = 3; /* CD */ + break; + default: + continue; + } + imux->items[imux->num_items].label = auto_pin_cfg_labels[i]; + imux->items[imux->num_items].index = idx1; + imux->num_items++; + } + return 0; +} + +static void alc268_auto_init_mono_speaker_out(struct hda_codec *codec) +{ + struct alc_spec *spec = codec->spec; + hda_nid_t speaker_nid = spec->autocfg.speaker_pins[0]; + hda_nid_t hp_nid = spec->autocfg.hp_pins[0]; + hda_nid_t line_nid = spec->autocfg.line_out_pins[0]; + unsigned int dac_vol1, dac_vol2; + + if (speaker_nid) { + snd_hda_codec_write(codec, speaker_nid, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); + snd_hda_codec_write(codec, 0x0f, 0, + AC_VERB_SET_AMP_GAIN_MUTE, + AMP_IN_UNMUTE(1)); + snd_hda_codec_write(codec, 0x10, 0, + AC_VERB_SET_AMP_GAIN_MUTE, + AMP_IN_UNMUTE(1)); + } else { + snd_hda_codec_write(codec, 0x0f, 0, + AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)); + snd_hda_codec_write(codec, 0x10, 0, + AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)); + } + + dac_vol1 = dac_vol2 = 0xb000 | 0x40; /* set max volume */ + if (line_nid == 0x14) + dac_vol2 = AMP_OUT_ZERO; + else if (line_nid == 0x15) + dac_vol1 = AMP_OUT_ZERO; + if (hp_nid == 0x14) + dac_vol2 = AMP_OUT_ZERO; + else if (hp_nid == 0x15) + dac_vol1 = AMP_OUT_ZERO; + if (line_nid != 0x16 || hp_nid != 0x16 || + spec->autocfg.line_out_pins[1] != 0x16 || + spec->autocfg.line_out_pins[2] != 0x16) + dac_vol1 = dac_vol2 = AMP_OUT_ZERO; + + snd_hda_codec_write(codec, 0x02, 0, + AC_VERB_SET_AMP_GAIN_MUTE, dac_vol1); + snd_hda_codec_write(codec, 0x03, 0, + AC_VERB_SET_AMP_GAIN_MUTE, dac_vol2); +} + +/* pcm configuration: identiacal with ALC880 */ +#define alc268_pcm_analog_playback alc880_pcm_analog_playback +#define alc268_pcm_analog_capture alc880_pcm_analog_capture +#define alc268_pcm_digital_playback alc880_pcm_digital_playback + +/* + * BIOS auto configuration + */ +static int alc268_parse_auto_config(struct hda_codec *codec) +{ + struct alc_spec *spec = codec->spec; + int err; + static hda_nid_t alc268_ignore[] = { 0 }; + + err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, + alc268_ignore); + if (err < 0) + return err; + if (!spec->autocfg.line_outs) + return 0; /* can't find valid BIOS pin config */ + + err = alc268_auto_create_multi_out_ctls(spec, &spec->autocfg); + if (err < 0) + return err; + err = alc268_auto_create_analog_input_ctls(spec, &spec->autocfg); + if (err < 0) + return err; + + spec->multiout.max_channels = 2; + + /* digital only support output */ + if (spec->autocfg.dig_out_pin) + spec->multiout.dig_out_nid = ALC268_DIGOUT_NID; + + if (spec->kctl_alloc) + spec->mixers[spec->num_mixers++] = spec->kctl_alloc; + + spec->init_verbs[spec->num_init_verbs++] = alc268_volume_init_verbs; + spec->num_mux_defs = 1; + spec->input_mux = &spec->private_imux; + + return 1; +} + +#define alc268_auto_init_multi_out alc882_auto_init_multi_out +#define alc268_auto_init_hp_out alc882_auto_init_hp_out +#define alc268_auto_init_analog_input alc882_auto_init_analog_input + +/* init callback for auto-configuration model -- overriding the default init */ +static void alc268_auto_init(struct hda_codec *codec) +{ + alc268_auto_init_multi_out(codec); + alc268_auto_init_hp_out(codec); + alc268_auto_init_mono_speaker_out(codec); + alc268_auto_init_analog_input(codec); +} + +/* + * configuration and preset + */ +static const char *alc268_models[ALC268_MODEL_LAST] = { + [ALC268_3ST] = "3stack", + [ALC268_AUTO] = "auto", +}; + +static struct snd_pci_quirk alc268_cfg_tbl[] = { + SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), + {} +}; + +static struct alc_config_preset alc268_presets[] = { + [ALC268_3ST] = { + .mixers = { alc268_base_mixer, alc268_capture_alt_mixer }, + .init_verbs = { alc268_base_init_verbs }, + .num_dacs = ARRAY_SIZE(alc268_dac_nids), + .dac_nids = alc268_dac_nids, + .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt), + .adc_nids = alc268_adc_nids_alt, + .hp_nid = 0x03, + .dig_out_nid = ALC268_DIGOUT_NID, + .num_channel_mode = ARRAY_SIZE(alc268_modes), + .channel_mode = alc268_modes, + .input_mux = &alc268_capture_source, + }, +}; + +static int patch_alc268(struct hda_codec *codec) +{ + struct alc_spec *spec; + int board_config; + int err; + + spec = kcalloc(1, sizeof(*spec), GFP_KERNEL); + if (spec == NULL) + return -ENOMEM; + + codec->spec = spec; + + board_config = snd_hda_check_board_config(codec, ALC268_MODEL_LAST, + alc268_models, + alc268_cfg_tbl); + + if (board_config < 0 || board_config >= ALC268_MODEL_LAST) { + printk(KERN_INFO "hda_codec: Unknown model for ALC268, " + "trying auto-probe from BIOS...\n"); + board_config = ALC268_AUTO; + } + + if (board_config == ALC268_AUTO) { + /* automatic parse from the BIOS config */ + err = alc268_parse_auto_config(codec); + if (err < 0) { + alc_free(codec); + return err; + } else if (!err) { + printk(KERN_INFO + "hda_codec: Cannot set up configuration " + "from BIOS. Using base mode...\n"); + board_config = ALC268_3ST; + } + } + + if (board_config != ALC268_AUTO) + setup_preset(spec, &alc268_presets[board_config]); + + spec->stream_name_analog = "ALC268 Analog"; + spec->stream_analog_playback = &alc268_pcm_analog_playback; + spec->stream_analog_capture = &alc268_pcm_analog_capture; + + spec->stream_name_digital = "ALC268 Digital"; + spec->stream_digital_playback = &alc268_pcm_digital_playback; + + if (board_config == ALC268_AUTO) { + if (!spec->adc_nids && spec->input_mux) { + /* check whether NID 0x07 is valid */ + unsigned int wcap = get_wcaps(codec, 0x07); + + /* get type */ + wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; + if (wcap != AC_WID_AUD_IN) { + spec->adc_nids = alc268_adc_nids_alt; + spec->num_adc_nids = + ARRAY_SIZE(alc268_adc_nids_alt); + spec->mixers[spec->num_mixers] = + alc268_capture_alt_mixer; + spec->num_mixers++; + } else { + spec->adc_nids = alc268_adc_nids; + spec->num_adc_nids = + ARRAY_SIZE(alc268_adc_nids); + spec->mixers[spec->num_mixers] = + alc268_capture_mixer; + spec->num_mixers++; + } + } + } + codec->patch_ops = alc_patch_ops; + if (board_config == ALC268_AUTO) + spec->init_hook = alc268_auto_init; + + return 0; +} + +/* * ALC861 channel source setting (2/6 channel selection for 3-stack) */ @@ -8767,13 +9620,21 @@ static struct snd_pci_quirk alc861_cfg_tbl[] = { SND_PCI_QUIRK(0x1043, 0x1335, "ASUS F2/3", ALC861_ASUS_LAPTOP), SND_PCI_QUIRK(0x1043, 0x1338, "ASUS F2/3", ALC861_ASUS_LAPTOP), SND_PCI_QUIRK(0x1043, 0x13d7, "ASUS A9rp", ALC861_ASUS_LAPTOP), + SND_PCI_QUIRK(0x1584, 0x9075, "Airis Praxis N1212", ALC861_ASUS_LAPTOP), SND_PCI_QUIRK(0x1043, 0x1393, "ASUS", ALC861_ASUS), + SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS P1-AH2", ALC861_3ST_DIG), SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba", ALC861_TOSHIBA), - SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba", ALC861_TOSHIBA), + /* FIXME: the entry below breaks Toshiba A100 (model=auto works!) + * Any other models that need this preset? + */ + /* SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba", ALC861_TOSHIBA), */ SND_PCI_QUIRK(0x1584, 0x9072, "Uniwill m31", ALC861_UNIWILL_M31), + SND_PCI_QUIRK(0x1584, 0x9075, "Uniwill", ALC861_UNIWILL_M31), SND_PCI_QUIRK(0x1584, 0x2b01, "Uniwill X40AIx", ALC861_UNIWILL_M31), SND_PCI_QUIRK(0x1849, 0x0660, "Asrock 939SLI32", ALC660_3ST), SND_PCI_QUIRK(0x8086, 0xd600, "Intel", ALC861_3ST), + SND_PCI_QUIRK(0x1462, 0x7254, "HP dx2200 (MSI MS-7254)", ALC861_3ST), + SND_PCI_QUIRK(0x1462, 0x7297, "HP dx2250 (MSI MS-7297)", ALC861_3ST), {} }; @@ -9464,6 +10325,7 @@ static void alc861vd_dallas_unsol_event(struct hda_codec *codec, unsigned int re */ static const char *alc861vd_models[ALC861VD_MODEL_LAST] = { [ALC660VD_3ST] = "3stack-660", + [ALC660VD_3ST_DIG]= "3stack-660-digout", [ALC861VD_3ST] = "3stack", [ALC861VD_3ST_DIG] = "3stack-digout", [ALC861VD_6ST_DIG] = "6stack-digout", @@ -9475,7 +10337,7 @@ static const char *alc861vd_models[ALC861VD_MODEL_LAST] = { static struct snd_pci_quirk alc861vd_cfg_tbl[] = { SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST), SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST), - SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST), + SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG), SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), @@ -9483,6 +10345,7 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = { SND_PCI_QUIRK(0x1179, 0xff01, "DALLAS", ALC861VD_DALLAS), SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo 3000 C200", ALC861VD_LENOVO), SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo", ALC861VD_LENOVO), + SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), {} }; @@ -9499,6 +10362,19 @@ static struct alc_config_preset alc861vd_presets[] = { .channel_mode = alc861vd_3stack_2ch_modes, .input_mux = &alc861vd_capture_source, }, + [ALC660VD_3ST_DIG] = { + .mixers = { alc861vd_3st_mixer }, + .init_verbs = { alc861vd_volume_init_verbs, + alc861vd_3stack_init_verbs }, + .num_dacs = ARRAY_SIZE(alc660vd_dac_nids), + .dac_nids = alc660vd_dac_nids, + .dig_out_nid = ALC861VD_DIGOUT_NID, + .num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids), + .adc_nids = alc861vd_adc_nids, + .num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes), + .channel_mode = alc861vd_3stack_2ch_modes, + .input_mux = &alc861vd_capture_source, + }, [ALC861VD_3ST] = { .mixers = { alc861vd_3st_mixer }, .init_verbs = { alc861vd_volume_init_verbs, @@ -10420,7 +11296,7 @@ static int alc662_auto_create_multi_out_ctls(struct alc_spec *spec, for (i = 0; i < cfg->line_outs; i++) { if (!spec->multiout.dac_nids[i]) continue; - nid = alc880_idx_to_dac(i); + nid = alc880_idx_to_mixer(i); if (i == 2) { /* Center/LFE */ err = add_control(spec, ALC_CTL_WIDGET_VOL, @@ -10643,14 +11519,10 @@ static int alc662_parse_auto_config(struct hda_codec *codec) spec->num_mux_defs = 1; spec->input_mux = &spec->private_imux; - if (err < 0) - return err; - else if (err > 0) - /* hack - override the init verbs */ - spec->init_verbs[0] = alc662_auto_init_verbs; + spec->init_verbs[spec->num_init_verbs++] = alc662_auto_init_verbs; spec->mixers[spec->num_mixers] = alc662_capture_mixer; spec->num_mixers++; - return err; + return 1; } /* additional initialization for auto-configuration model */ @@ -10687,7 +11559,7 @@ static int patch_alc662(struct hda_codec *codec) if (err < 0) { alc_free(codec); return err; - } else if (err) { + } else if (!err) { printk(KERN_INFO "hda_codec: Cannot set up configuration " "from BIOS. Using base mode...\n"); @@ -10724,6 +11596,7 @@ static int patch_alc662(struct hda_codec *codec) struct hda_codec_preset snd_hda_preset_realtek[] = { { .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 }, { .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 }, + { .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 }, { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", .patch = patch_alc861 }, { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, diff --git a/sound/pci/hda/patch_si3054.c b/sound/pci/hda/patch_si3054.c index 43f537ef40b..6d2ecc38905 100644 --- a/sound/pci/hda/patch_si3054.c +++ b/sound/pci/hda/patch_si3054.c @@ -304,8 +304,12 @@ struct hda_codec_preset snd_hda_preset_si3054[] = { { .id = 0x10573055, .name = "Si3054", .patch = patch_si3054 }, { .id = 0x10573057, .name = "Si3054", .patch = patch_si3054 }, { .id = 0x10573155, .name = "Si3054", .patch = patch_si3054 }, + /* VIA HDA on Clevo m540 */ + { .id = 0x11063288, .name = "Si3054", .patch = patch_si3054 }, /* Asus A8J Modem (SM56) */ { .id = 0x15433155, .name = "Si3054", .patch = patch_si3054 }, + /* LG LW20 modem */ + { .id = 0x18540018, .name = "Si3054", .patch = patch_si3054 }, {} }; diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index e3964fc4c40..3f25de72966 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -44,6 +44,7 @@ enum { enum { STAC_9205_REF, + STAC_M43xx, STAC_9205_MODELS }; @@ -59,11 +60,19 @@ enum { STAC_D945_REF, STAC_D945GTP3, STAC_D945GTP5, + STAC_922X_DELL, + STAC_INTEL_MAC_V1, + STAC_INTEL_MAC_V2, + STAC_INTEL_MAC_V3, + STAC_INTEL_MAC_V4, + STAC_INTEL_MAC_V5, + /* for backward compitability */ STAC_MACMINI, STAC_MACBOOK, STAC_MACBOOK_PRO_V1, STAC_MACBOOK_PRO_V2, STAC_IMAC_INTEL, + STAC_IMAC_INTEL_20, STAC_922X_MODELS }; @@ -210,7 +219,6 @@ static hda_nid_t stac9205_pin_nids[12] = { 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x14, 0x16, 0x17, 0x18, 0x21, 0x22, - }; static int stac92xx_dmux_enum_info(struct snd_kcontrol *kcontrol, @@ -326,8 +334,6 @@ static struct snd_kcontrol_new stac9200_mixer[] = { }; static struct snd_kcontrol_new stac925x_mixer[] = { - HDA_CODEC_VOLUME("Master Playback Volume", 0xe, 0, HDA_OUTPUT), - HDA_CODEC_MUTE("Master Playback Switch", 0xe, 0, HDA_OUTPUT), { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Input Source", @@ -549,44 +555,78 @@ static unsigned int d945gtp5_pin_configs[10] = { 0x02a19320, 0x40000100, }; -static unsigned int macbook_pro_v1_pin_configs[10] = { - 0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010, - 0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e, - 0x02a19320, 0x400000fb +static unsigned int intel_mac_v1_pin_configs[10] = { + 0x0121e21f, 0x400000ff, 0x9017e110, 0x400000fd, + 0x400000fe, 0x0181e020, 0x1145e030, 0x11c5e240, + 0x400000fc, 0x400000fb, +}; + +static unsigned int intel_mac_v2_pin_configs[10] = { + 0x0121e21f, 0x90a7012e, 0x9017e110, 0x400000fd, + 0x400000fe, 0x0181e020, 0x1145e230, 0x500000fa, + 0x400000fc, 0x400000fb, +}; + +static unsigned int intel_mac_v3_pin_configs[10] = { + 0x0121e21f, 0x90a7012e, 0x9017e110, 0x400000fd, + 0x400000fe, 0x0181e020, 0x1145e230, 0x11c5e240, + 0x400000fc, 0x400000fb, }; -static unsigned int macbook_pro_v2_pin_configs[10] = { - 0x0221401f, 0x90a70120, 0x01813024, 0x01014010, - 0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e, +static unsigned int intel_mac_v4_pin_configs[10] = { + 0x0321e21f, 0x03a1e02e, 0x9017e110, 0x9017e11f, + 0x400000fe, 0x0381e020, 0x1345e230, 0x13c5e240, 0x400000fc, 0x400000fb, }; -static unsigned int imac_intel_pin_configs[10] = { - 0x0121e230, 0x90a70120, 0x9017e110, 0x400000fe, - 0x400000fd, 0x0181e021, 0x1145e040, 0x400000fa, +static unsigned int intel_mac_v5_pin_configs[10] = { + 0x0321e21f, 0x03a1e02e, 0x9017e110, 0x9017e11f, + 0x400000fe, 0x0381e020, 0x1345e230, 0x13c5e240, 0x400000fc, 0x400000fb, }; +static unsigned int stac922x_dell_pin_configs[10] = { + 0x0221121e, 0x408103ff, 0x02a1123e, 0x90100310, + 0x408003f1, 0x0221122f, 0x03451340, 0x40c003f2, + 0x50a003f3, 0x405003f4 +}; + static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { [STAC_D945_REF] = ref922x_pin_configs, [STAC_D945GTP3] = d945gtp3_pin_configs, [STAC_D945GTP5] = d945gtp5_pin_configs, - [STAC_MACMINI] = macbook_pro_v1_pin_configs, - [STAC_MACBOOK] = macbook_pro_v1_pin_configs, - [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs, - [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs, - [STAC_IMAC_INTEL] = imac_intel_pin_configs, + [STAC_922X_DELL] = stac922x_dell_pin_configs, + [STAC_INTEL_MAC_V1] = intel_mac_v1_pin_configs, + [STAC_INTEL_MAC_V2] = intel_mac_v2_pin_configs, + [STAC_INTEL_MAC_V3] = intel_mac_v3_pin_configs, + [STAC_INTEL_MAC_V4] = intel_mac_v4_pin_configs, + [STAC_INTEL_MAC_V5] = intel_mac_v5_pin_configs, + /* for backward compitability */ + [STAC_MACMINI] = intel_mac_v3_pin_configs, + [STAC_MACBOOK] = intel_mac_v5_pin_configs, + [STAC_MACBOOK_PRO_V1] = intel_mac_v3_pin_configs, + [STAC_MACBOOK_PRO_V2] = intel_mac_v3_pin_configs, + [STAC_IMAC_INTEL] = intel_mac_v2_pin_configs, + [STAC_IMAC_INTEL_20] = intel_mac_v3_pin_configs, }; static const char *stac922x_models[STAC_922X_MODELS] = { [STAC_D945_REF] = "ref", [STAC_D945GTP5] = "5stack", [STAC_D945GTP3] = "3stack", + [STAC_922X_DELL] = "dell", + [STAC_INTEL_MAC_V1] = "intel-mac-v1", + [STAC_INTEL_MAC_V2] = "intel-mac-v2", + [STAC_INTEL_MAC_V3] = "intel-mac-v3", + [STAC_INTEL_MAC_V4] = "intel-mac-v4", + [STAC_INTEL_MAC_V5] = "intel-mac-v5", + /* for backward compitability */ [STAC_MACMINI] = "macmini", [STAC_MACBOOK] = "macbook", [STAC_MACBOOK_PRO_V1] = "macbook-pro-v1", [STAC_MACBOOK_PRO_V2] = "macbook-pro", [STAC_IMAC_INTEL] = "imac-intel", + [STAC_IMAC_INTEL_20] = "imac-intel-20", }; static struct snd_pci_quirk stac922x_cfg_tbl[] = { @@ -649,7 +689,10 @@ static struct snd_pci_quirk stac922x_cfg_tbl[] = { /* other systems */ /* Apple Mac Mini (early 2006) */ SND_PCI_QUIRK(0x8384, 0x7680, - "Mac Mini", STAC_MACMINI), + "Mac Mini", STAC_INTEL_MAC_V3), + /* Dell */ + SND_PCI_QUIRK(0x1028, 0x01d7, "Dell XPS M1210", STAC_922X_DELL), + {} /* terminator */ }; @@ -730,7 +773,8 @@ static unsigned int ref9205_pin_configs[12] = { }; static unsigned int *stac9205_brd_tbl[STAC_9205_MODELS] = { - ref9205_pin_configs, + [STAC_REF] = ref9205_pin_configs, + [STAC_M43xx] = NULL, }; static const char *stac9205_models[STAC_9205_MODELS] = { @@ -741,6 +785,10 @@ static struct snd_pci_quirk stac9205_cfg_tbl[] = { /* SigmaTel reference board */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_9205_REF), + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x01f8, + "Dell Precision", STAC_M43xx), + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x01ff, + "Dell Precision", STAC_M43xx), {} /* terminator */ }; @@ -770,33 +818,56 @@ static int stac92xx_save_bios_config_regs(struct hda_codec *codec) return 0; } +static void stac92xx_set_config_reg(struct hda_codec *codec, + hda_nid_t pin_nid, unsigned int pin_config) +{ + int i; + snd_hda_codec_write(codec, pin_nid, 0, + AC_VERB_SET_CONFIG_DEFAULT_BYTES_0, + pin_config & 0x000000ff); + snd_hda_codec_write(codec, pin_nid, 0, + AC_VERB_SET_CONFIG_DEFAULT_BYTES_1, + (pin_config & 0x0000ff00) >> 8); + snd_hda_codec_write(codec, pin_nid, 0, + AC_VERB_SET_CONFIG_DEFAULT_BYTES_2, + (pin_config & 0x00ff0000) >> 16); + snd_hda_codec_write(codec, pin_nid, 0, + AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, + pin_config >> 24); + i = snd_hda_codec_read(codec, pin_nid, 0, + AC_VERB_GET_CONFIG_DEFAULT, + 0x00); + snd_printdd(KERN_INFO "hda_codec: pin nid %2.2x pin config %8.8x\n", + pin_nid, i); +} + static void stac92xx_set_config_regs(struct hda_codec *codec) { int i; struct sigmatel_spec *spec = codec->spec; - unsigned int pin_cfg; - if (! spec->pin_nids || ! spec->pin_configs) - return; + if (!spec->pin_configs) + return; - for (i = 0; i < spec->num_pins; i++) { - snd_hda_codec_write(codec, spec->pin_nids[i], 0, - AC_VERB_SET_CONFIG_DEFAULT_BYTES_0, - spec->pin_configs[i] & 0x000000ff); - snd_hda_codec_write(codec, spec->pin_nids[i], 0, - AC_VERB_SET_CONFIG_DEFAULT_BYTES_1, - (spec->pin_configs[i] & 0x0000ff00) >> 8); - snd_hda_codec_write(codec, spec->pin_nids[i], 0, - AC_VERB_SET_CONFIG_DEFAULT_BYTES_2, - (spec->pin_configs[i] & 0x00ff0000) >> 16); - snd_hda_codec_write(codec, spec->pin_nids[i], 0, - AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, - spec->pin_configs[i] >> 24); - pin_cfg = snd_hda_codec_read(codec, spec->pin_nids[i], 0, - AC_VERB_GET_CONFIG_DEFAULT, - 0x00); - snd_printdd(KERN_INFO "hda_codec: pin nid %2.2x pin config %8.8x\n", spec->pin_nids[i], pin_cfg); - } + for (i = 0; i < spec->num_pins; i++) + stac92xx_set_config_reg(codec, spec->pin_nids[i], + spec->pin_configs[i]); +} + +static void stac92xx_enable_gpio_mask(struct hda_codec *codec, + int gpio_mask, int gpio_data) +{ + /* Configure GPIOx as output */ + snd_hda_codec_write(codec, codec->afg, 0, + AC_VERB_SET_GPIO_DIRECTION, gpio_mask); + /* Configure GPIOx as CMOS */ + snd_hda_codec_write(codec, codec->afg, 0, 0x7e7, 0x00000000); + /* Assert GPIOx */ + snd_hda_codec_write(codec, codec->afg, 0, + AC_VERB_SET_GPIO_DATA, gpio_data); + /* Enable GPIOx */ + snd_hda_codec_write(codec, codec->afg, 0, + AC_VERB_SET_GPIO_MASK, gpio_mask); } /* @@ -1168,7 +1239,7 @@ static int is_in_dac_nids(struct sigmatel_spec *spec, hda_nid_t nid) * and 9202/925x. For those, dac_nids[] must be hard-coded. */ static int stac92xx_auto_fill_dac_nids(struct hda_codec *codec, - const struct auto_pin_cfg *cfg) + struct auto_pin_cfg *cfg) { struct sigmatel_spec *spec = codec->spec; int i, j, conn_len = 0; @@ -1193,6 +1264,13 @@ static int stac92xx_auto_fill_dac_nids(struct hda_codec *codec, } if (j == conn_len) { + if (spec->multiout.num_dacs > 0) { + /* we have already working output pins, + * so let's drop the broken ones again + */ + cfg->line_outs = spec->multiout.num_dacs; + break; + } /* error out, no available DAC found */ snd_printk(KERN_ERR "%s: No available DAC for pin 0x%x\n", @@ -1334,7 +1412,15 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec, continue; add_spec_dacs(spec, nid); } - + for (i = 0; i < cfg->line_outs; i++) { + nid = snd_hda_codec_read(codec, cfg->line_out_pins[i], 0, + AC_VERB_GET_CONNECT_LIST, 0) & 0xff; + if (check_in_dac_nids(spec, nid)) + nid = 0; + if (! nid) + continue; + add_spec_dacs(spec, nid); + } for (i = old_num_dacs; i < spec->multiout.num_dacs; i++) { static const char *pfxs[] = { "Speaker", "External Speaker", "Speaker2", @@ -1891,7 +1977,7 @@ static int patch_stac9200(struct hda_codec *codec) return -ENOMEM; codec->spec = spec; - spec->num_pins = 8; + spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); spec->pin_nids = stac9200_pin_nids; spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS, stac9200_models, @@ -1941,7 +2027,7 @@ static int patch_stac925x(struct hda_codec *codec) return -ENOMEM; codec->spec = spec; - spec->num_pins = 8; + spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); spec->pin_nids = stac925x_pin_nids; spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS, stac925x_models, @@ -2013,29 +2099,41 @@ static int patch_stac922x(struct hda_codec *codec) return -ENOMEM; codec->spec = spec; - spec->num_pins = 10; + spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); spec->pin_nids = stac922x_pin_nids; spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, stac922x_models, stac922x_cfg_tbl); - if (spec->board_config == STAC_MACMINI) { + if (spec->board_config == STAC_INTEL_MAC_V3) { spec->gpio_mute = 1; /* Intel Macs have all same PCI SSID, so we need to check * codec SSID to distinguish the exact models */ printk(KERN_INFO "hda_codec: STAC922x, Apple subsys_id=%x\n", codec->subsystem_id); switch (codec->subsystem_id) { - case 0x106b0a00: /* MacBook First generatoin */ - spec->board_config = STAC_MACBOOK; + + case 0x106b0800: + spec->board_config = STAC_INTEL_MAC_V1; + break; + case 0x106b0600: + case 0x106b0700: + spec->board_config = STAC_INTEL_MAC_V2; break; - case 0x106b0200: /* MacBook Pro first generation */ - spec->board_config = STAC_MACBOOK_PRO_V1; + case 0x106b0e00: + case 0x106b0f00: + case 0x106b1600: + case 0x106b1700: + case 0x106b0200: + case 0x106b1e00: + spec->board_config = STAC_INTEL_MAC_V3; break; - case 0x106b1e00: /* MacBook Pro second generation */ - spec->board_config = STAC_MACBOOK_PRO_V2; + case 0x106b1a00: + case 0x00000100: + spec->board_config = STAC_INTEL_MAC_V4; break; - case 0x106b0700: /* Intel-based iMac */ - spec->board_config = STAC_IMAC_INTEL; + case 0x106b0a00: + case 0x106b2200: + spec->board_config = STAC_INTEL_MAC_V5; break; } } @@ -2082,6 +2180,13 @@ static int patch_stac922x(struct hda_codec *codec) codec->patch_ops = stac92xx_patch_ops; + /* Fix Mux capture level; max to 2 */ + snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT, + (0 << AC_AMPCAP_OFFSET_SHIFT) | + (2 << AC_AMPCAP_NUM_STEPS_SHIFT) | + (0x27 << AC_AMPCAP_STEP_SIZE_SHIFT) | + (0 << AC_AMPCAP_MUTE_SHIFT)); + return 0; } @@ -2095,7 +2200,7 @@ static int patch_stac927x(struct hda_codec *codec) return -ENOMEM; codec->spec = spec; - spec->num_pins = 14; + spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); spec->pin_nids = stac927x_pin_nids; spec->board_config = snd_hda_check_board_config(codec, STAC_927X_MODELS, stac927x_models, @@ -2141,7 +2246,9 @@ static int patch_stac927x(struct hda_codec *codec) } spec->multiout.dac_nids = spec->dac_nids; - + /* GPIO0 High = Enable EAPD */ + stac92xx_enable_gpio_mask(codec, 0x00000001, 0x00000001); + err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); if (!err) { if (spec->board_config < 0) { @@ -2159,27 +2266,20 @@ static int patch_stac927x(struct hda_codec *codec) codec->patch_ops = stac92xx_patch_ops; - /* Fix Mux capture level; max to 2 */ - snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT, - (0 << AC_AMPCAP_OFFSET_SHIFT) | - (2 << AC_AMPCAP_NUM_STEPS_SHIFT) | - (0x27 << AC_AMPCAP_STEP_SIZE_SHIFT) | - (0 << AC_AMPCAP_MUTE_SHIFT)); - return 0; } static int patch_stac9205(struct hda_codec *codec) { struct sigmatel_spec *spec; - int err; + int err, gpio_mask, gpio_data; spec = kzalloc(sizeof(*spec), GFP_KERNEL); if (spec == NULL) return -ENOMEM; codec->spec = spec; - spec->num_pins = 14; + spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); spec->pin_nids = stac9205_pin_nids; spec->board_config = snd_hda_check_board_config(codec, STAC_9205_MODELS, stac9205_models, @@ -2209,19 +2309,21 @@ static int patch_stac9205(struct hda_codec *codec) spec->mixer = stac9205_mixer; spec->multiout.dac_nids = spec->dac_nids; + + if (spec->board_config == STAC_M43xx) { + /* Enable SPDIF in/out */ + stac92xx_set_config_reg(codec, 0x1f, 0x01441030); + stac92xx_set_config_reg(codec, 0x20, 0x1c410030); + + gpio_mask = 0x00000007; /* GPIO0-2 */ + /* GPIO0 High = EAPD, GPIO1 Low = DRM, + * GPIO2 High = Headphone Mute + */ + gpio_data = 0x00000005; + } else + gpio_mask = gpio_data = 0x00000001; /* GPIO0 High = EAPD */ - /* Configure GPIO0 as EAPD output */ - snd_hda_codec_write(codec, codec->afg, 0, - AC_VERB_SET_GPIO_DIRECTION, 0x00000001); - /* Configure GPIO0 as CMOS */ - snd_hda_codec_write(codec, codec->afg, 0, 0x7e7, 0x00000000); - /* Assert GPIO0 high */ - snd_hda_codec_write(codec, codec->afg, 0, - AC_VERB_SET_GPIO_DATA, 0x00000001); - /* Enable GPIO0 */ - snd_hda_codec_write(codec, codec->afg, 0, - AC_VERB_SET_GPIO_MASK, 0x00000001); - + stac92xx_enable_gpio_mask(codec, gpio_mask, gpio_data); err = stac92xx_parse_auto_config(codec, 0x1f, 0x20); if (!err) { if (spec->board_config < 0) { @@ -2256,8 +2358,8 @@ static struct hda_input_mux vaio_mux = { .num_items = 2, .items = { /* { "HP", 0x0 }, */ - { "Line", 0x1 }, - { "Mic", 0x2 }, + { "Mic Jack", 0x1 }, + { "Internal Mic", 0x2 }, { "PCM", 0x3 }, } }; @@ -2268,7 +2370,7 @@ static struct hda_verb vaio_init[] = { {0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* Mic? (<- 0x2) */ {0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, /* CD */ {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* Mic? */ - {0x15, AC_VERB_SET_CONNECT_SEL, 0x2}, /* mic-sel: 0a,0d,14,02 */ + {0x15, AC_VERB_SET_CONNECT_SEL, 0x1}, /* mic-sel: 0a,0d,14,02 */ {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* HP */ {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Speaker */ {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* capture sw/vol -> 0x8 */ @@ -2284,7 +2386,7 @@ static struct hda_verb vaio_ar_init[] = { {0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, /* CD */ /* {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },*/ /* Optical Out */ {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* Mic? */ - {0x15, AC_VERB_SET_CONNECT_SEL, 0x2}, /* mic-sel: 0a,0d,14,02 */ + {0x15, AC_VERB_SET_CONNECT_SEL, 0x1}, /* mic-sel: 0a,0d,14,02 */ {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* HP */ {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Speaker */ /* {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},*/ /* Optical Out */ diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c index 690ceb34064..d18a31e188a 100644 --- a/sound/pci/ice1712/revo.c +++ b/sound/pci/ice1712/revo.c @@ -186,7 +186,12 @@ static int revo51_i2c_init(struct snd_ice1712 *ice, #define AK_DAC(xname,xch) { .name = xname, .num_channels = xch } static const struct snd_akm4xxx_dac_channel revo71_front[] = { - AK_DAC("PCM Playback Volume", 2) + { + .name = "PCM Playback Volume", + .num_channels = 2, + /* front channels DAC supports muting */ + .switch_name = "PCM Playback Switch", + }, }; static const struct snd_akm4xxx_dac_channel revo71_surround[] = { diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c index 1d9232d2db3..170781a7229 100644 --- a/sound/pci/mixart/mixart_hwdep.c +++ b/sound/pci/mixart/mixart_hwdep.c @@ -24,6 +24,7 @@ #include <linux/interrupt.h> #include <linux/pci.h> #include <linux/firmware.h> +#include <linux/vmalloc.h> #include <asm/io.h> #include <sound/core.h> #include "mixart.h" diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index 03b3a4792f7..c7621bd770a 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -1533,7 +1533,8 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci, printk(KERN_ERR " force the driver to load by " "passing in the module parameter\n"); printk(KERN_ERR " force_ac97=1\n"); - printk(KERN_ERR " or try sb16 or cs423x drivers instead.\n"); + printk(KERN_ERR " or try sb16, opl3sa2, or " + "cs423x drivers instead.\n"); err = -ENXIO; goto __error; } diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c index bd7dbd267ed..2de27405a0b 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c @@ -406,7 +406,7 @@ static snd_pcm_uframes_t rme9652_hw_pointer(struct snd_rme9652 *rme9652) } else if (!frag) return 0; offset -= rme9652->max_jitter; - if (offset < 0) + if ((int)offset < 0) offset += period_size * 2; } else { if (offset > period_size + rme9652->max_jitter) { diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index 50c9f92cfd1..6ea09df0c73 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -2098,7 +2098,7 @@ static int snd_via82xx_chip_init(struct via82xx *chip) pci_read_config_byte(chip->pci, VIA_ACLINK_STAT, &pval); if (pval & VIA_ACLINK_C00_READY) /* primary codec ready */ break; - schedule_timeout_uninterruptible(1); + schedule_timeout(1); } while (time_before(jiffies, end_time)); if ((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_BUSY) @@ -2117,7 +2117,7 @@ static int snd_via82xx_chip_init(struct via82xx *chip) chip->ac97_secondary = 1; goto __ac97_ok2; } - schedule_timeout_interruptible(1); + schedule_timeout(1); } while (time_before(jiffies, end_time)); /* This is ok, the most of motherboards have only one codec */ diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 8cbf8eba4ae..72425e73aba 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c @@ -983,7 +983,7 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip) pci_read_config_byte(chip->pci, VIA_ACLINK_STAT, &pval); if (pval & VIA_ACLINK_C00_READY) /* primary codec ready */ break; - schedule_timeout_uninterruptible(1); + schedule_timeout(1); } while (time_before(jiffies, end_time)); if ((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_BUSY) @@ -1001,7 +1001,7 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip) chip->ac97_secondary = 1; goto __ac97_ok2; } - schedule_timeout_interruptible(1); + schedule_timeout(1); } while (time_before(jiffies, end_time)); /* This is ok, the most of motherboards have only one codec */ diff --git a/sound/ppc/Kconfig b/sound/ppc/Kconfig index a3fb1496e4d..cacb0b13688 100644 --- a/sound/ppc/Kconfig +++ b/sound/ppc/Kconfig @@ -33,3 +33,23 @@ config SND_POWERMAC_AUTO_DRC option. endmenu + +menu "ALSA PowerPC devices" + depends on SND!=n && ( PPC64 || PPC32 ) + +config SND_PS3 + tristate "PS3 Audio support" + depends on SND && PS3_PS3AV + select SND_PCM + default m + help + Say Y here to include support for audio on the PS3 + + To compile this driver as a module, choose M here: the module + will be called snd_ps3. + +config SND_PS3_DEFAULT_START_DELAY + int "Startup delay time in ms" + depends on SND_PS3 + default "2000" +endmenu diff --git a/sound/ppc/Makefile b/sound/ppc/Makefile index 4d95c652c8c..eacee2d0675 100644 --- a/sound/ppc/Makefile +++ b/sound/ppc/Makefile @@ -6,4 +6,5 @@ snd-powermac-objs := powermac.o pmac.o awacs.o burgundy.o daca.o tumbler.o keywest.o beep.o # Toplevel Module Dependency -obj-$(CONFIG_SND_POWERMAC) += snd-powermac.o +obj-$(CONFIG_SND_POWERMAC) += snd-powermac.o +obj-$(CONFIG_SND_PS3) += snd_ps3.o diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c new file mode 100644 index 00000000000..1aa0b467599 --- /dev/null +++ b/sound/ppc/snd_ps3.c @@ -0,0 +1,1125 @@ +/* + * Audio support for PS3 + * Copyright (C) 2007 Sony Computer Entertainment Inc. + * All rights reserved. + * Copyright 2006, 2007 Sony Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License + * as published by the Free Software Foundation; version 2 of the Licence. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <linux/init.h> +#include <linux/slab.h> +#include <linux/io.h> +#include <linux/interrupt.h> +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/initval.h> +#include <sound/pcm.h> +#include <sound/asound.h> +#include <sound/memalloc.h> +#include <sound/pcm_params.h> +#include <sound/control.h> +#include <linux/dmapool.h> +#include <linux/dma-mapping.h> +#include <asm/firmware.h> +#include <linux/io.h> +#include <asm/dma.h> +#include <asm/lv1call.h> +#include <asm/ps3.h> +#include <asm/ps3av.h> + +#include "snd_ps3_reg.h" +#include "snd_ps3.h" + +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("PS3 sound driver"); +MODULE_AUTHOR("Sony Computer Entertainment Inc."); + +/* module entries */ +static int __init snd_ps3_init(void); +static void __exit snd_ps3_exit(void); + +/* ALSA snd driver ops */ +static int snd_ps3_pcm_open(struct snd_pcm_substream *substream); +static int snd_ps3_pcm_close(struct snd_pcm_substream *substream); +static int snd_ps3_pcm_prepare(struct snd_pcm_substream *substream); +static int snd_ps3_pcm_trigger(struct snd_pcm_substream *substream, + int cmd); +static snd_pcm_uframes_t snd_ps3_pcm_pointer(struct snd_pcm_substream + *substream); +static int snd_ps3_pcm_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params); +static int snd_ps3_pcm_hw_free(struct snd_pcm_substream *substream); + + +/* ps3_system_bus_driver entries */ +static int __init snd_ps3_driver_probe(struct ps3_system_bus_device *dev); +static int snd_ps3_driver_remove(struct ps3_system_bus_device *dev); + +/* address setup */ +static int snd_ps3_map_mmio(void); +static void snd_ps3_unmap_mmio(void); +static int snd_ps3_allocate_irq(void); +static void snd_ps3_free_irq(void); +static void snd_ps3_audio_set_base_addr(uint64_t ioaddr_start); + +/* interrupt handler */ +static irqreturn_t snd_ps3_interrupt(int irq, void *dev_id); + + +/* set sampling rate/format */ +static int snd_ps3_set_avsetting(struct snd_pcm_substream *substream); +/* take effect parameter change */ +static int snd_ps3_change_avsetting(struct snd_ps3_card_info *card); +/* initialize avsetting and take it effect */ +static int snd_ps3_init_avsetting(struct snd_ps3_card_info *card); +/* setup dma */ +static int snd_ps3_program_dma(struct snd_ps3_card_info *card, + enum snd_ps3_dma_filltype filltype); +static void snd_ps3_wait_for_dma_stop(struct snd_ps3_card_info *card); + +static dma_addr_t v_to_bus(struct snd_ps3_card_info *, void *vaddr, int ch); + + +module_init(snd_ps3_init); +module_exit(snd_ps3_exit); + +/* + * global + */ +static struct snd_ps3_card_info the_card; + +static int snd_ps3_start_delay = CONFIG_SND_PS3_DEFAULT_START_DELAY; + +module_param_named(start_delay, snd_ps3_start_delay, uint, 0644); +MODULE_PARM_DESC(start_delay, "time to insert silent data in milisec"); + +static int index = SNDRV_DEFAULT_IDX1; +static char *id = SNDRV_DEFAULT_STR1; + +module_param(index, int, 0444); +MODULE_PARM_DESC(index, "Index value for PS3 soundchip."); +module_param(id, charp, 0444); +MODULE_PARM_DESC(id, "ID string for PS3 soundchip."); + + +/* + * PS3 audio register access + */ +static inline u32 read_reg(unsigned int reg) +{ + return in_be32(the_card.mapped_mmio_vaddr + reg); +} +static inline void write_reg(unsigned int reg, u32 val) +{ + out_be32(the_card.mapped_mmio_vaddr + reg, val); +} +static inline void update_reg(unsigned int reg, u32 or_val) +{ + u32 newval = read_reg(reg) | or_val; + write_reg(reg, newval); +} +static inline void update_mask_reg(unsigned int reg, u32 mask, u32 or_val) +{ + u32 newval = (read_reg(reg) & mask) | or_val; + write_reg(reg, newval); +} + +/* + * ALSA defs + */ +const static struct snd_pcm_hardware snd_ps3_pcm_hw = { + .info = (SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_NONINTERLEAVED | + SNDRV_PCM_INFO_MMAP_VALID), + .formats = (SNDRV_PCM_FMTBIT_S16_BE | + SNDRV_PCM_FMTBIT_S24_BE), + .rates = (SNDRV_PCM_RATE_44100 | + SNDRV_PCM_RATE_48000 | + SNDRV_PCM_RATE_88200 | + SNDRV_PCM_RATE_96000), + .rate_min = 44100, + .rate_max = 96000, + + .channels_min = 2, /* stereo only */ + .channels_max = 2, + + .buffer_bytes_max = PS3_AUDIO_FIFO_SIZE * 64, + + /* interrupt by four stages */ + .period_bytes_min = PS3_AUDIO_FIFO_STAGE_SIZE * 4, + .period_bytes_max = PS3_AUDIO_FIFO_STAGE_SIZE * 4, + + .periods_min = 16, + .periods_max = 32, /* buffer_size_max/ period_bytes_max */ + + .fifo_size = PS3_AUDIO_FIFO_SIZE +}; + +static struct snd_pcm_ops snd_ps3_pcm_spdif_ops = +{ + .open = snd_ps3_pcm_open, + .close = snd_ps3_pcm_close, + .prepare = snd_ps3_pcm_prepare, + .ioctl = snd_pcm_lib_ioctl, + .trigger = snd_ps3_pcm_trigger, + .pointer = snd_ps3_pcm_pointer, + .hw_params = snd_ps3_pcm_hw_params, + .hw_free = snd_ps3_pcm_hw_free +}; + +static int snd_ps3_verify_dma_stop(struct snd_ps3_card_info *card, + int count, int force_stop) +{ + int dma_ch, done, retries, stop_forced = 0; + uint32_t status; + + for (dma_ch = 0; dma_ch < 8; dma_ch ++) { + retries = count; + do { + status = read_reg(PS3_AUDIO_KICK(dma_ch)) & + PS3_AUDIO_KICK_STATUS_MASK; + switch (status) { + case PS3_AUDIO_KICK_STATUS_DONE: + case PS3_AUDIO_KICK_STATUS_NOTIFY: + case PS3_AUDIO_KICK_STATUS_CLEAR: + case PS3_AUDIO_KICK_STATUS_ERROR: + done = 1; + break; + default: + done = 0; + udelay(10); + } + } while (!done && --retries); + if (!retries && force_stop) { + pr_info("%s: DMA ch %d is not stopped.", + __func__, dma_ch); + /* last resort. force to stop dma. + * NOTE: this cause DMA done interrupts + */ + update_reg(PS3_AUDIO_CONFIG, PS3_AUDIO_CONFIG_CLEAR); + stop_forced = 1; + } + } + return stop_forced; +} + +/* + * wait for all dma is done. + * NOTE: caller should reset card->running before call. + * If not, the interrupt handler will re-start DMA, + * then DMA is never stopped. + */ +static void snd_ps3_wait_for_dma_stop(struct snd_ps3_card_info *card) +{ + int stop_forced; + /* + * wait for the last dma is done + */ + + /* + * expected maximum DMA done time is 5.7ms + something (DMA itself). + * 5.7ms is from 16bit/sample 2ch 44.1Khz; the time next + * DMA kick event would occur. + */ + stop_forced = snd_ps3_verify_dma_stop(card, 700, 1); + + /* + * clear outstanding interrupts. + */ + update_reg(PS3_AUDIO_INTR_0, 0); + update_reg(PS3_AUDIO_AX_IS, 0); + + /* + *revert CLEAR bit since it will not reset automatically after DMA stop + */ + if (stop_forced) + update_mask_reg(PS3_AUDIO_CONFIG, ~PS3_AUDIO_CONFIG_CLEAR, 0); + /* ensure the hardware sees changes */ + wmb(); +} + +static void snd_ps3_kick_dma(struct snd_ps3_card_info *card) +{ + + update_reg(PS3_AUDIO_KICK(0), PS3_AUDIO_KICK_REQUEST); + /* ensure the hardware sees the change */ + wmb(); +} + +/* + * convert virtual addr to ioif bus addr. + */ +static dma_addr_t v_to_bus(struct snd_ps3_card_info *card, + void * paddr, + int ch) +{ + return card->dma_start_bus_addr[ch] + + (paddr - card->dma_start_vaddr[ch]); +}; + + +/* + * increment ring buffer pointer. + * NOTE: caller must hold write spinlock + */ +static void snd_ps3_bump_buffer(struct snd_ps3_card_info *card, + enum snd_ps3_ch ch, size_t byte_count, + int stage) +{ + if (!stage) + card->dma_last_transfer_vaddr[ch] = + card->dma_next_transfer_vaddr[ch]; + card->dma_next_transfer_vaddr[ch] += byte_count; + if ((card->dma_start_vaddr[ch] + (card->dma_buffer_size / 2)) <= + card->dma_next_transfer_vaddr[ch]) { + card->dma_next_transfer_vaddr[ch] = card->dma_start_vaddr[ch]; + } +} +/* + * setup dmac to send data to audio and attenuate samples on the ring buffer + */ +static int snd_ps3_program_dma(struct snd_ps3_card_info *card, + enum snd_ps3_dma_filltype filltype) +{ + /* this dmac does not support over 4G */ + uint32_t dma_addr; + int fill_stages, dma_ch, stage; + enum snd_ps3_ch ch; + uint32_t ch0_kick_event = 0; /* initialize to mute gcc */ + void *start_vaddr; + unsigned long irqsave; + int silent = 0; + + switch (filltype) { + case SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL: + silent = 1; + /* intentionally fall thru */ + case SND_PS3_DMA_FILLTYPE_FIRSTFILL: + ch0_kick_event = PS3_AUDIO_KICK_EVENT_ALWAYS; + break; + + case SND_PS3_DMA_FILLTYPE_SILENT_RUNNING: + silent = 1; + /* intentionally fall thru */ + case SND_PS3_DMA_FILLTYPE_RUNNING: + ch0_kick_event = PS3_AUDIO_KICK_EVENT_SERIALOUT0_EMPTY; + break; + } + + snd_ps3_verify_dma_stop(card, 700, 0); + fill_stages = 4; + spin_lock_irqsave(&card->dma_lock, irqsave); + for (ch = 0; ch < 2; ch++) { + start_vaddr = card->dma_next_transfer_vaddr[0]; + for (stage = 0; stage < fill_stages; stage ++) { + dma_ch = stage * 2 + ch; + if (silent) + dma_addr = card->null_buffer_start_dma_addr; + else + dma_addr = + v_to_bus(card, + card->dma_next_transfer_vaddr[ch], + ch); + + write_reg(PS3_AUDIO_SOURCE(dma_ch), + (PS3_AUDIO_SOURCE_TARGET_SYSTEM_MEMORY | + dma_addr)); + + /* dst: fixed to 3wire#0 */ + if (ch == 0) + write_reg(PS3_AUDIO_DEST(dma_ch), + (PS3_AUDIO_DEST_TARGET_AUDIOFIFO | + PS3_AUDIO_AO_3W_LDATA(0))); + else + write_reg(PS3_AUDIO_DEST(dma_ch), + (PS3_AUDIO_DEST_TARGET_AUDIOFIFO | + PS3_AUDIO_AO_3W_RDATA(0))); + + /* count always 1 DMA block (1/2 stage = 128 bytes) */ + write_reg(PS3_AUDIO_DMASIZE(dma_ch), 0); + /* bump pointer if needed */ + if (!silent) + snd_ps3_bump_buffer(card, ch, + PS3_AUDIO_DMAC_BLOCK_SIZE, + stage); + + /* kick event */ + if (dma_ch == 0) + write_reg(PS3_AUDIO_KICK(dma_ch), + ch0_kick_event); + else + write_reg(PS3_AUDIO_KICK(dma_ch), + PS3_AUDIO_KICK_EVENT_AUDIO_DMA(dma_ch + - 1) | + PS3_AUDIO_KICK_REQUEST); + } + } + /* ensure the hardware sees the change */ + wmb(); + spin_unlock_irqrestore(&card->dma_lock, irqsave); + + return 0; +} + +/* + * audio mute on/off + * mute_on : 0 output enabled + * 1 mute + */ +static int snd_ps3_mute(int mute_on) +{ + return ps3av_audio_mute(mute_on); +} + +/* + * PCM operators + */ +static int snd_ps3_pcm_open(struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); + int pcm_index; + + pcm_index = substream->pcm->device; + /* to retrieve substream/runtime in interrupt handler */ + card->substream = substream; + + runtime->hw = snd_ps3_pcm_hw; + + card->start_delay = snd_ps3_start_delay; + + /* mute off */ + snd_ps3_mute(0); /* this function sleep */ + + snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, + PS3_AUDIO_FIFO_STAGE_SIZE * 4 * 2); + return 0; +}; + +static int snd_ps3_pcm_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) +{ + size_t size; + + /* alloc transport buffer */ + size = params_buffer_bytes(hw_params); + snd_pcm_lib_malloc_pages(substream, size); + return 0; +}; + +static int snd_ps3_delay_to_bytes(struct snd_pcm_substream *substream, + unsigned int delay_ms) +{ + int ret; + int rate ; + + rate = substream->runtime->rate; + ret = snd_pcm_format_size(substream->runtime->format, + rate * delay_ms / 1000) + * substream->runtime->channels; + + pr_debug(KERN_ERR "%s: time=%d rate=%d bytes=%ld, frames=%d, ret=%d\n", + __func__, + delay_ms, + rate, + snd_pcm_format_size(substream->runtime->format, rate), + rate * delay_ms / 1000, + ret); + + return ret; +}; + +static int snd_ps3_pcm_prepare(struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); + unsigned long irqsave; + + if (!snd_ps3_set_avsetting(substream)) { + /* some parameter changed */ + write_reg(PS3_AUDIO_AX_IE, + PS3_AUDIO_AX_IE_ASOBEIE(0) | + PS3_AUDIO_AX_IE_ASOBUIE(0)); + /* + * let SPDIF device re-lock with SPDIF signal, + * start with some silence + */ + card->silent = snd_ps3_delay_to_bytes(substream, + card->start_delay) / + (PS3_AUDIO_FIFO_STAGE_SIZE * 4); /* every 4 times */ + } + + /* restart ring buffer pointer */ + spin_lock_irqsave(&card->dma_lock, irqsave); + { + card->dma_buffer_size = runtime->dma_bytes; + + card->dma_last_transfer_vaddr[SND_PS3_CH_L] = + card->dma_next_transfer_vaddr[SND_PS3_CH_L] = + card->dma_start_vaddr[SND_PS3_CH_L] = + runtime->dma_area; + card->dma_start_bus_addr[SND_PS3_CH_L] = runtime->dma_addr; + + card->dma_last_transfer_vaddr[SND_PS3_CH_R] = + card->dma_next_transfer_vaddr[SND_PS3_CH_R] = + card->dma_start_vaddr[SND_PS3_CH_R] = + runtime->dma_area + (runtime->dma_bytes / 2); + card->dma_start_bus_addr[SND_PS3_CH_R] = + runtime->dma_addr + (runtime->dma_bytes / 2); + + pr_debug("%s: vaddr=%p bus=%#lx\n", __func__, + card->dma_start_vaddr[SND_PS3_CH_L], + card->dma_start_bus_addr[SND_PS3_CH_L]); + + } + spin_unlock_irqrestore(&card->dma_lock, irqsave); + + /* ensure the hardware sees the change */ + mb(); + + return 0; +}; + +static int snd_ps3_pcm_trigger(struct snd_pcm_substream *substream, + int cmd) +{ + struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); + int ret = 0; + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + /* clear outstanding interrupts */ + update_reg(PS3_AUDIO_AX_IS, 0); + + spin_lock(&card->dma_lock); + { + card->running = 1; + } + spin_unlock(&card->dma_lock); + + snd_ps3_program_dma(card, + SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL); + snd_ps3_kick_dma(card); + while (read_reg(PS3_AUDIO_KICK(7)) & + PS3_AUDIO_KICK_STATUS_MASK) { + udelay(1); + } + snd_ps3_program_dma(card, SND_PS3_DMA_FILLTYPE_SILENT_RUNNING); + snd_ps3_kick_dma(card); + break; + + case SNDRV_PCM_TRIGGER_STOP: + spin_lock(&card->dma_lock); + { + card->running = 0; + } + spin_unlock(&card->dma_lock); + snd_ps3_wait_for_dma_stop(card); + break; + default: + break; + + } + + return ret; +}; + +/* + * report current pointer + */ +static snd_pcm_uframes_t snd_ps3_pcm_pointer( + struct snd_pcm_substream *substream) +{ + struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); + size_t bytes; + snd_pcm_uframes_t ret; + + spin_lock(&card->dma_lock); + { + bytes = (size_t)(card->dma_last_transfer_vaddr[SND_PS3_CH_L] - + card->dma_start_vaddr[SND_PS3_CH_L]); + } + spin_unlock(&card->dma_lock); + + ret = bytes_to_frames(substream->runtime, bytes * 2); + + return ret; +}; + +static int snd_ps3_pcm_hw_free(struct snd_pcm_substream *substream) +{ + int ret; + ret = snd_pcm_lib_free_pages(substream); + return ret; +}; + +static int snd_ps3_pcm_close(struct snd_pcm_substream *substream) +{ + /* mute on */ + snd_ps3_mute(1); + return 0; +}; + +static void snd_ps3_audio_fixup(struct snd_ps3_card_info *card) +{ + /* + * avsetting driver seems to never change the followings + * so, init them here once + */ + + /* no dma interrupt needed */ + write_reg(PS3_AUDIO_INTR_EN_0, 0); + + /* use every 4 buffer empty interrupt */ + update_mask_reg(PS3_AUDIO_AX_IC, + PS3_AUDIO_AX_IC_AASOIMD_MASK, + PS3_AUDIO_AX_IC_AASOIMD_EVERY4); + + /* enable 3wire clocks */ + update_mask_reg(PS3_AUDIO_AO_3WMCTRL, + ~(PS3_AUDIO_AO_3WMCTRL_ASOBCLKD_DISABLED | + PS3_AUDIO_AO_3WMCTRL_ASOLRCKD_DISABLED), + 0); + update_reg(PS3_AUDIO_AO_3WMCTRL, + PS3_AUDIO_AO_3WMCTRL_ASOPLRCK_DEFAULT); +} + +/* + * av setting + * NOTE: calling this function may generate audio interrupt. + */ +static int snd_ps3_change_avsetting(struct snd_ps3_card_info *card) +{ + int ret, retries, i; + pr_debug("%s: start\n", __func__); + + ret = ps3av_set_audio_mode(card->avs.avs_audio_ch, + card->avs.avs_audio_rate, + card->avs.avs_audio_width, + card->avs.avs_audio_format, + card->avs.avs_audio_source); + /* + * Reset the following unwanted settings: + */ + + /* disable all 3wire buffers */ + update_mask_reg(PS3_AUDIO_AO_3WMCTRL, + ~(PS3_AUDIO_AO_3WMCTRL_ASOEN(0) | + PS3_AUDIO_AO_3WMCTRL_ASOEN(1) | + PS3_AUDIO_AO_3WMCTRL_ASOEN(2) | + PS3_AUDIO_AO_3WMCTRL_ASOEN(3)), + 0); + wmb(); /* ensure the hardware sees the change */ + /* wait for actually stopped */ + retries = 1000; + while ((read_reg(PS3_AUDIO_AO_3WMCTRL) & + (PS3_AUDIO_AO_3WMCTRL_ASORUN(0) | + PS3_AUDIO_AO_3WMCTRL_ASORUN(1) | + PS3_AUDIO_AO_3WMCTRL_ASORUN(2) | + PS3_AUDIO_AO_3WMCTRL_ASORUN(3))) && + --retries) { + udelay(1); + } + + /* reset buffer pointer */ + for (i = 0; i < 4; i++) { + update_reg(PS3_AUDIO_AO_3WCTRL(i), + PS3_AUDIO_AO_3WCTRL_ASOBRST_RESET); + udelay(10); + } + wmb(); /* ensure the hardware actually start resetting */ + + /* enable 3wire#0 buffer */ + update_reg(PS3_AUDIO_AO_3WMCTRL, PS3_AUDIO_AO_3WMCTRL_ASOEN(0)); + + + /* In 24bit mode,ALSA inserts a zero byte at first byte of per sample */ + update_mask_reg(PS3_AUDIO_AO_3WCTRL(0), + ~PS3_AUDIO_AO_3WCTRL_ASODF, + PS3_AUDIO_AO_3WCTRL_ASODF_LSB); + update_mask_reg(PS3_AUDIO_AO_SPDCTRL(0), + ~PS3_AUDIO_AO_SPDCTRL_SPODF, + PS3_AUDIO_AO_SPDCTRL_SPODF_LSB); + /* ensure all the setting above is written back to register */ + wmb(); + /* avsetting driver altered AX_IE, caller must reset it if you want */ + pr_debug("%s: end\n", __func__); + return ret; +} + +static int snd_ps3_init_avsetting(struct snd_ps3_card_info *card) +{ + int ret; + pr_debug("%s: start\n", __func__); + card->avs.avs_audio_ch = PS3AV_CMD_AUDIO_NUM_OF_CH_2; + card->avs.avs_audio_rate = PS3AV_CMD_AUDIO_FS_48K; + card->avs.avs_audio_width = PS3AV_CMD_AUDIO_WORD_BITS_16; + card->avs.avs_audio_format = PS3AV_CMD_AUDIO_FORMAT_PCM; + card->avs.avs_audio_source = PS3AV_CMD_AUDIO_SOURCE_SERIAL; + + ret = snd_ps3_change_avsetting(card); + + snd_ps3_audio_fixup(card); + + /* to start to generate SPDIF signal, fill data */ + snd_ps3_program_dma(card, SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL); + snd_ps3_kick_dma(card); + pr_debug("%s: end\n", __func__); + return ret; +} + +/* + * set sampling rate according to the substream + */ +static int snd_ps3_set_avsetting(struct snd_pcm_substream *substream) +{ + struct snd_ps3_card_info *card = snd_pcm_substream_chip(substream); + struct snd_ps3_avsetting_info avs; + + avs = card->avs; + + pr_debug("%s: called freq=%d width=%d\n", __func__, + substream->runtime->rate, + snd_pcm_format_width(substream->runtime->format)); + + pr_debug("%s: before freq=%d width=%d\n", __func__, + card->avs.avs_audio_rate, card->avs.avs_audio_width); + + /* sample rate */ + switch (substream->runtime->rate) { + case 44100: + avs.avs_audio_rate = PS3AV_CMD_AUDIO_FS_44K; + break; + case 48000: + avs.avs_audio_rate = PS3AV_CMD_AUDIO_FS_48K; + break; + case 88200: + avs.avs_audio_rate = PS3AV_CMD_AUDIO_FS_88K; + break; + case 96000: + avs.avs_audio_rate = PS3AV_CMD_AUDIO_FS_96K; + break; + default: + pr_info("%s: invalid rate %d\n", __func__, + substream->runtime->rate); + return 1; + } + + /* width */ + switch (snd_pcm_format_width(substream->runtime->format)) { + case 16: + avs.avs_audio_width = PS3AV_CMD_AUDIO_WORD_BITS_16; + break; + case 24: + avs.avs_audio_width = PS3AV_CMD_AUDIO_WORD_BITS_24; + break; + default: + pr_info("%s: invalid width %d\n", __func__, + snd_pcm_format_width(substream->runtime->format)); + return 1; + } + + if ((card->avs.avs_audio_width != avs.avs_audio_width) || + (card->avs.avs_audio_rate != avs.avs_audio_rate)) { + card->avs = avs; + snd_ps3_change_avsetting(card); + + pr_debug("%s: after freq=%d width=%d\n", __func__, + card->avs.avs_audio_rate, card->avs.avs_audio_width); + + return 0; + } else + return 1; +} + + + +static int snd_ps3_map_mmio(void) +{ + the_card.mapped_mmio_vaddr = + ioremap(the_card.ps3_dev->m_region->bus_addr, + the_card.ps3_dev->m_region->len); + + if (!the_card.mapped_mmio_vaddr) { + pr_info("%s: ioremap 0 failed p=%#lx l=%#lx \n", + __func__, the_card.ps3_dev->m_region->lpar_addr, + the_card.ps3_dev->m_region->len); + return -ENXIO; + } + + return 0; +}; + +static void snd_ps3_unmap_mmio(void) +{ + iounmap(the_card.mapped_mmio_vaddr); + the_card.mapped_mmio_vaddr = NULL; +} + +static int snd_ps3_allocate_irq(void) +{ + int ret; + u64 lpar_addr, lpar_size; + u64 __iomem *mapped; + + /* FIXME: move this to device_init (H/W probe) */ + + /* get irq outlet */ + ret = lv1_gpu_device_map(1, &lpar_addr, &lpar_size); + if (ret) { + pr_info("%s: device map 1 failed %d\n", __func__, + ret); + return -ENXIO; + } + + mapped = ioremap(lpar_addr, lpar_size); + if (!mapped) { + pr_info("%s: ioremap 1 failed \n", __func__); + return -ENXIO; + } + + the_card.audio_irq_outlet = in_be64(mapped); + + iounmap(mapped); + ret = lv1_gpu_device_unmap(1); + if (ret) + pr_info("%s: unmap 1 failed\n", __func__); + + /* irq */ + ret = ps3_irq_plug_setup(PS3_BINDING_CPU_ANY, + the_card.audio_irq_outlet, + &the_card.irq_no); + if (ret) { + pr_info("%s:ps3_alloc_irq failed (%d)\n", __func__, ret); + return ret; + } + + ret = request_irq(the_card.irq_no, snd_ps3_interrupt, IRQF_DISABLED, + SND_PS3_DRIVER_NAME, &the_card); + if (ret) { + pr_info("%s: request_irq failed (%d)\n", __func__, ret); + goto cleanup_irq; + } + + return 0; + + cleanup_irq: + ps3_irq_plug_destroy(the_card.irq_no); + return ret; +}; + +static void snd_ps3_free_irq(void) +{ + free_irq(the_card.irq_no, &the_card); + ps3_irq_plug_destroy(the_card.irq_no); +} + +static void snd_ps3_audio_set_base_addr(uint64_t ioaddr_start) +{ + uint64_t val; + int ret; + + val = (ioaddr_start & (0x0fUL << 32)) >> (32 - 20) | + (0x03UL << 24) | + (0x0fUL << 12) | + (PS3_AUDIO_IOID); + + ret = lv1_gpu_attribute(0x100, 0x007, val, 0, 0); + if (ret) + pr_info("%s: gpu_attribute failed %d\n", __func__, + ret); +} + +static int __init snd_ps3_driver_probe(struct ps3_system_bus_device *dev) +{ + int ret; + u64 lpar_addr, lpar_size; + + BUG_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1)); + BUG_ON(dev->match_id != PS3_MATCH_ID_SOUND); + + the_card.ps3_dev = dev; + + ret = ps3_open_hv_device(dev); + + if (ret) + return -ENXIO; + + /* setup MMIO */ + ret = lv1_gpu_device_map(2, &lpar_addr, &lpar_size); + if (ret) { + pr_info("%s: device map 2 failed %d\n", __func__, ret); + goto clean_open; + } + ps3_mmio_region_init(dev, dev->m_region, lpar_addr, lpar_size, + PAGE_SHIFT); + + ret = snd_ps3_map_mmio(); + if (ret) + goto clean_dev_map; + + /* setup DMA area */ + ps3_dma_region_init(dev, dev->d_region, + PAGE_SHIFT, /* use system page size */ + 0, /* dma type; not used */ + NULL, + _ALIGN_UP(SND_PS3_DMA_REGION_SIZE, PAGE_SIZE)); + dev->d_region->ioid = PS3_AUDIO_IOID; + + ret = ps3_dma_region_create(dev->d_region); + if (ret) { + pr_info("%s: region_create\n", __func__); + goto clean_mmio; + } + + snd_ps3_audio_set_base_addr(dev->d_region->bus_addr); + + /* CONFIG_SND_PS3_DEFAULT_START_DELAY */ + the_card.start_delay = snd_ps3_start_delay; + + /* irq */ + if (snd_ps3_allocate_irq()) { + ret = -ENXIO; + goto clean_dma_region; + } + + /* create card instance */ + the_card.card = snd_card_new(index, id, THIS_MODULE, 0); + if (!the_card.card) { + ret = -ENXIO; + goto clean_irq; + } + + strcpy(the_card.card->driver, "PS3"); + strcpy(the_card.card->shortname, "PS3"); + strcpy(the_card.card->longname, "PS3 sound"); + /* create PCM devices instance */ + /* NOTE:this driver works assuming pcm:substream = 1:1 */ + ret = snd_pcm_new(the_card.card, + "SPDIF", + 0, /* instance index, will be stored pcm.device*/ + 1, /* output substream */ + 0, /* input substream */ + &(the_card.pcm)); + if (ret) + goto clean_card; + + the_card.pcm->private_data = &the_card; + strcpy(the_card.pcm->name, "SPDIF"); + + /* set pcm ops */ + snd_pcm_set_ops(the_card.pcm, SNDRV_PCM_STREAM_PLAYBACK, + &snd_ps3_pcm_spdif_ops); + + the_card.pcm->info_flags = SNDRV_PCM_INFO_NONINTERLEAVED; + /* pre-alloc PCM DMA buffer*/ + ret = snd_pcm_lib_preallocate_pages_for_all(the_card.pcm, + SNDRV_DMA_TYPE_DEV, + &dev->core, + SND_PS3_PCM_PREALLOC_SIZE, + SND_PS3_PCM_PREALLOC_SIZE); + if (ret < 0) { + pr_info("%s: prealloc failed\n", __func__); + goto clean_card; + } + + /* + * allocate null buffer + * its size should be lager than PS3_AUDIO_FIFO_STAGE_SIZE * 2 + * PAGE_SIZE is enogh + */ + if (!(the_card.null_buffer_start_vaddr = + dma_alloc_coherent(&the_card.ps3_dev->core, + PAGE_SIZE, + &the_card.null_buffer_start_dma_addr, + GFP_KERNEL))) { + pr_info("%s: nullbuffer alloc failed\n", __func__); + goto clean_preallocate; + } + pr_debug("%s: null vaddr=%p dma=%#lx\n", __func__, + the_card.null_buffer_start_vaddr, + the_card.null_buffer_start_dma_addr); + /* set default sample rate/word width */ + snd_ps3_init_avsetting(&the_card); + + /* register the card */ + ret = snd_card_register(the_card.card); + if (ret < 0) + goto clean_dma_map; + + pr_info("%s started. start_delay=%dms\n", + the_card.card->longname, the_card.start_delay); + return 0; + +clean_dma_map: + dma_free_coherent(&the_card.ps3_dev->core, + PAGE_SIZE, + the_card.null_buffer_start_vaddr, + the_card.null_buffer_start_dma_addr); +clean_preallocate: + snd_pcm_lib_preallocate_free_for_all(the_card.pcm); +clean_card: + snd_card_free(the_card.card); +clean_irq: + snd_ps3_free_irq(); +clean_dma_region: + ps3_dma_region_free(dev->d_region); +clean_mmio: + snd_ps3_unmap_mmio(); +clean_dev_map: + lv1_gpu_device_unmap(2); +clean_open: + ps3_close_hv_device(dev); + /* + * there is no destructor function to pcm. + * midlayer automatically releases if the card removed + */ + return ret; +}; /* snd_ps3_probe */ + +/* called when module removal */ +static int snd_ps3_driver_remove(struct ps3_system_bus_device *dev) +{ + int ret; + pr_info("%s:start id=%d\n", __func__, dev->match_id); + if (dev->match_id != PS3_MATCH_ID_SOUND) + return -ENXIO; + + /* + * ctl and preallocate buffer will be freed in + * snd_card_free + */ + ret = snd_card_free(the_card.card); + if (ret) + pr_info("%s: ctl freecard=%d\n", __func__, ret); + + dma_free_coherent(&dev->core, + PAGE_SIZE, + the_card.null_buffer_start_vaddr, + the_card.null_buffer_start_dma_addr); + + ps3_dma_region_free(dev->d_region); + + snd_ps3_free_irq(); + snd_ps3_unmap_mmio(); + + lv1_gpu_device_unmap(2); + ps3_close_hv_device(dev); + pr_info("%s:end id=%d\n", __func__, dev->match_id); + return 0; +} /* snd_ps3_remove */ + +static struct ps3_system_bus_driver snd_ps3_bus_driver_info = { + .match_id = PS3_MATCH_ID_SOUND, + .probe = snd_ps3_driver_probe, + .remove = snd_ps3_driver_remove, + .shutdown = snd_ps3_driver_remove, + .core = { + .name = SND_PS3_DRIVER_NAME, + .owner = THIS_MODULE, + }, +}; + + +/* + * Interrupt handler + */ +static irqreturn_t snd_ps3_interrupt(int irq, void *dev_id) +{ + + uint32_t port_intr; + int underflow_occured = 0; + struct snd_ps3_card_info *card = dev_id; + + if (!card->running) { + update_reg(PS3_AUDIO_AX_IS, 0); + update_reg(PS3_AUDIO_INTR_0, 0); + return IRQ_HANDLED; + } + + port_intr = read_reg(PS3_AUDIO_AX_IS); + /* + *serial buffer empty detected (every 4 times), + *program next dma and kick it + */ + if (port_intr & PS3_AUDIO_AX_IE_ASOBEIE(0)) { + write_reg(PS3_AUDIO_AX_IS, PS3_AUDIO_AX_IE_ASOBEIE(0)); + if (port_intr & PS3_AUDIO_AX_IE_ASOBUIE(0)) { + write_reg(PS3_AUDIO_AX_IS, port_intr); + underflow_occured = 1; + } + if (card->silent) { + /* we are still in silent time */ + snd_ps3_program_dma(card, + (underflow_occured) ? + SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL : + SND_PS3_DMA_FILLTYPE_SILENT_RUNNING); + snd_ps3_kick_dma(card); + card->silent --; + } else { + snd_ps3_program_dma(card, + (underflow_occured) ? + SND_PS3_DMA_FILLTYPE_FIRSTFILL : + SND_PS3_DMA_FILLTYPE_RUNNING); + snd_ps3_kick_dma(card); + snd_pcm_period_elapsed(card->substream); + } + } else if (port_intr & PS3_AUDIO_AX_IE_ASOBUIE(0)) { + write_reg(PS3_AUDIO_AX_IS, PS3_AUDIO_AX_IE_ASOBUIE(0)); + /* + * serial out underflow, but buffer empty not detected. + * in this case, fill fifo with 0 to recover. After + * filling dummy data, serial automatically start to + * consume them and then will generate normal buffer + * empty interrupts. + * If both buffer underflow and buffer empty are occured, + * it is better to do nomal data transfer than empty one + */ + snd_ps3_program_dma(card, + SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL); + snd_ps3_kick_dma(card); + snd_ps3_program_dma(card, + SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL); + snd_ps3_kick_dma(card); + } + /* clear interrupt cause */ + return IRQ_HANDLED; +}; + +/* + * module/subsystem initialize/terminate + */ +static int __init snd_ps3_init(void) +{ + int ret; + + if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) + return -ENXIO; + + memset(&the_card, 0, sizeof(the_card)); + spin_lock_init(&the_card.dma_lock); + + /* register systembus DRIVER, this calls our probe() func */ + ret = ps3_system_bus_driver_register(&snd_ps3_bus_driver_info); + + return ret; +} + +static void __exit snd_ps3_exit(void) +{ + ps3_system_bus_driver_unregister(&snd_ps3_bus_driver_info); +} + +MODULE_ALIAS(PS3_MODULE_ALIAS_SOUND); diff --git a/sound/ppc/snd_ps3.h b/sound/ppc/snd_ps3.h new file mode 100644 index 00000000000..4b7e6fbbe50 --- /dev/null +++ b/sound/ppc/snd_ps3.h @@ -0,0 +1,135 @@ +/* + * Audio support for PS3 + * Copyright (C) 2007 Sony Computer Entertainment Inc. + * All rights reserved. + * Copyright 2006, 2007 Sony Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License + * as published by the Free Software Foundation; version 2 of the Licence. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#if !defined(_SND_PS3_H_) +#define _SND_PS3_H_ + +#include <linux/irqreturn.h> + +#define SND_PS3_DRIVER_NAME "snd_ps3" + +enum snd_ps3_out_channel { + SND_PS3_OUT_SPDIF_0, + SND_PS3_OUT_SPDIF_1, + SND_PS3_OUT_SERIAL_0, + SND_PS3_OUT_DEVS +}; + +enum snd_ps3_dma_filltype { + SND_PS3_DMA_FILLTYPE_FIRSTFILL, + SND_PS3_DMA_FILLTYPE_RUNNING, + SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL, + SND_PS3_DMA_FILLTYPE_SILENT_RUNNING +}; + +enum snd_ps3_ch { + SND_PS3_CH_L = 0, + SND_PS3_CH_R = 1, + SND_PS3_CH_MAX = 2 +}; + +struct snd_ps3_avsetting_info { + uint32_t avs_audio_ch; /* fixed */ + uint32_t avs_audio_rate; + uint32_t avs_audio_width; + uint32_t avs_audio_format; /* fixed */ + uint32_t avs_audio_source; /* fixed */ +}; +/* + * PS3 audio 'card' instance + * there should be only ONE hardware. + */ +struct snd_ps3_card_info { + struct ps3_system_bus_device *ps3_dev; + struct snd_card *card; + + struct snd_pcm *pcm; + struct snd_pcm_substream *substream; + + /* hvc info */ + u64 audio_lpar_addr; + u64 audio_lpar_size; + + /* registers */ + void __iomem *mapped_mmio_vaddr; + + /* irq */ + u64 audio_irq_outlet; + unsigned int irq_no; + + /* remember avsetting */ + struct snd_ps3_avsetting_info avs; + + /* dma buffer management */ + spinlock_t dma_lock; + /* dma_lock start */ + void * dma_start_vaddr[2]; /* 0 for L, 1 for R */ + dma_addr_t dma_start_bus_addr[2]; + size_t dma_buffer_size; + void * dma_last_transfer_vaddr[2]; + void * dma_next_transfer_vaddr[2]; + int silent; + /* dma_lock end */ + + int running; + + /* null buffer */ + void *null_buffer_start_vaddr; + dma_addr_t null_buffer_start_dma_addr; + + /* start delay */ + unsigned int start_delay; + +}; + + +/* PS3 audio DMAC block size in bytes */ +#define PS3_AUDIO_DMAC_BLOCK_SIZE (128) +/* one stage (stereo) of audio FIFO in bytes */ +#define PS3_AUDIO_FIFO_STAGE_SIZE (256) +/* how many stages the fifo have */ +#define PS3_AUDIO_FIFO_STAGE_COUNT (8) +/* fifo size 128 bytes * 8 stages * stereo (2ch) */ +#define PS3_AUDIO_FIFO_SIZE \ + (PS3_AUDIO_FIFO_STAGE_SIZE * PS3_AUDIO_FIFO_STAGE_COUNT) + +/* PS3 audio DMAC max block count in one dma shot = 128 (0x80) blocks*/ +#define PS3_AUDIO_DMAC_MAX_BLOCKS (PS3_AUDIO_DMASIZE_BLOCKS_MASK + 1) + +#define PS3_AUDIO_NORMAL_DMA_START_CH (0) +#define PS3_AUDIO_NORMAL_DMA_COUNT (8) +#define PS3_AUDIO_NULL_DMA_START_CH \ + (PS3_AUDIO_NORMAL_DMA_START_CH + PS3_AUDIO_NORMAL_DMA_COUNT) +#define PS3_AUDIO_NULL_DMA_COUNT (2) + +#define SND_PS3_MAX_VOL (0x0F) +#define SND_PS3_MIN_VOL (0x00) +#define SND_PS3_MIN_ATT SND_PS3_MIN_VOL +#define SND_PS3_MAX_ATT SND_PS3_MAX_VOL + +#define SND_PS3_PCM_PREALLOC_SIZE \ + (PS3_AUDIO_DMAC_BLOCK_SIZE * PS3_AUDIO_DMAC_MAX_BLOCKS * 4) + +#define SND_PS3_DMA_REGION_SIZE \ + (SND_PS3_PCM_PREALLOC_SIZE + PAGE_SIZE) + +#define PS3_AUDIO_IOID (1UL) + +#endif /* _SND_PS3_H_ */ diff --git a/sound/ppc/snd_ps3_reg.h b/sound/ppc/snd_ps3_reg.h new file mode 100644 index 00000000000..03fdee4aaaf --- /dev/null +++ b/sound/ppc/snd_ps3_reg.h @@ -0,0 +1,891 @@ +/* + * Audio support for PS3 + * Copyright (C) 2007 Sony Computer Entertainment Inc. + * Copyright 2006, 2007 Sony Corporation + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License + * as published by the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * interrupt / configure registers + */ + +#define PS3_AUDIO_INTR_0 (0x00000100) +#define PS3_AUDIO_INTR_EN_0 (0x00000140) +#define PS3_AUDIO_CONFIG (0x00000200) + +/* + * DMAC registers + * n:0..9 + */ +#define PS3_AUDIO_DMAC_REGBASE(x) (0x0000210 + 0x20 * (x)) + +#define PS3_AUDIO_KICK(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x00) +#define PS3_AUDIO_SOURCE(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x04) +#define PS3_AUDIO_DEST(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x08) +#define PS3_AUDIO_DMASIZE(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x0C) + +/* + * mute control + */ +#define PS3_AUDIO_AX_MCTRL (0x00004000) +#define PS3_AUDIO_AX_ISBP (0x00004004) +#define PS3_AUDIO_AX_AOBP (0x00004008) +#define PS3_AUDIO_AX_IC (0x00004010) +#define PS3_AUDIO_AX_IE (0x00004014) +#define PS3_AUDIO_AX_IS (0x00004018) + +/* + * three wire serial + * n:0..3 + */ +#define PS3_AUDIO_AO_MCTRL (0x00006000) +#define PS3_AUDIO_AO_3WMCTRL (0x00006004) + +#define PS3_AUDIO_AO_3WCTRL(n) (0x00006200 + 0x200 * (n)) + +/* + * S/PDIF + * n:0..1 + * x:0..11 + * y:0..5 + */ +#define PS3_AUDIO_AO_SPD_REGBASE(n) (0x00007200 + 0x200 * (n)) + +#define PS3_AUDIO_AO_SPDCTRL(n) \ + (PS3_AUDIO_AO_SPD_REGBASE(n) + 0x00) +#define PS3_AUDIO_AO_SPDUB(n, x) \ + (PS3_AUDIO_AO_SPD_REGBASE(n) + 0x04 + 0x04 * (x)) +#define PS3_AUDIO_AO_SPDCS(n, y) \ + (PS3_AUDIO_AO_SPD_REGBASE(n) + 0x34 + 0x04 * (y)) + + +/* + PS3_AUDIO_INTR_0 register tells an interrupt handler which audio + DMA channel triggered the interrupt. The interrupt status for a channel + can be cleared by writing a '1' to the corresponding bit. A new interrupt + cannot be generated until the previous interrupt has been cleared. + + Note that the status reported by PS3_AUDIO_INTR_0 is independent of the + value of PS3_AUDIO_INTR_EN_0. + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0 0 0 0 0 0 0 0 0 0 0 0 0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C| INTR_0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ +#define PS3_AUDIO_INTR_0_CHAN(n) (1 << ((n) * 2)) +#define PS3_AUDIO_INTR_0_CHAN9 PS3_AUDIO_INTR_0_CHAN(9) +#define PS3_AUDIO_INTR_0_CHAN8 PS3_AUDIO_INTR_0_CHAN(8) +#define PS3_AUDIO_INTR_0_CHAN7 PS3_AUDIO_INTR_0_CHAN(7) +#define PS3_AUDIO_INTR_0_CHAN6 PS3_AUDIO_INTR_0_CHAN(6) +#define PS3_AUDIO_INTR_0_CHAN5 PS3_AUDIO_INTR_0_CHAN(5) +#define PS3_AUDIO_INTR_0_CHAN4 PS3_AUDIO_INTR_0_CHAN(4) +#define PS3_AUDIO_INTR_0_CHAN3 PS3_AUDIO_INTR_0_CHAN(3) +#define PS3_AUDIO_INTR_0_CHAN2 PS3_AUDIO_INTR_0_CHAN(2) +#define PS3_AUDIO_INTR_0_CHAN1 PS3_AUDIO_INTR_0_CHAN(1) +#define PS3_AUDIO_INTR_0_CHAN0 PS3_AUDIO_INTR_0_CHAN(0) + +/* + The PS3_AUDIO_INTR_EN_0 register specifies which DMA channels can generate + an interrupt to the PU. Each bit of PS3_AUDIO_INTR_EN_0 is ANDed with the + corresponding bit in PS3_AUDIO_INTR_0. The resulting bits are OR'd together + to generate the Audio interrupt. + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0 0 0 0 0 0 0 0 0 0 0 0 0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C| INTR_EN_0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + + Bit assignments are same as PS3_AUDIO_INTR_0 +*/ + +/* + PS3_AUDIO_CONFIG + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0 0 0 0 0 0 0 0|0 0 0 0 0 0 0 0|0 0 0 0 0 0 0 C|0 0 0 0 0 0 0 0| CONFIG + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + +*/ + +/* The CLEAR field cancels all pending transfers, and stops any running DMA + transfers. Any interrupts associated with the canceled transfers + will occur as if the transfer had finished. + Since this bit is designed to recover from DMA related issues + which are caused by unpredictable situations, it is prefered to wait + for normal DMA transfer end without using this bit. +*/ +#define PS3_AUDIO_CONFIG_CLEAR (1 << 8) /* RWIVF */ + +/* + PS3_AUDIO_AX_MCTRL: Audio Port Mute Control Register + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|A|A|0 0 0 0 0 0 0|S|S|A|A|A|A| AX_MCTRL + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ + +/* 3 Wire Audio Serial Output Channel Mutes (0..3) */ +#define PS3_AUDIO_AX_MCTRL_ASOMT(n) (1 << (3 - (n))) /* RWIVF */ +#define PS3_AUDIO_AX_MCTRL_ASO3MT (1 << 0) /* RWIVF */ +#define PS3_AUDIO_AX_MCTRL_ASO2MT (1 << 1) /* RWIVF */ +#define PS3_AUDIO_AX_MCTRL_ASO1MT (1 << 2) /* RWIVF */ +#define PS3_AUDIO_AX_MCTRL_ASO0MT (1 << 3) /* RWIVF */ + +/* S/PDIF mutes (0,1)*/ +#define PS3_AUDIO_AX_MCTRL_SPOMT(n) (1 << (5 - (n))) /* RWIVF */ +#define PS3_AUDIO_AX_MCTRL_SPO1MT (1 << 4) /* RWIVF */ +#define PS3_AUDIO_AX_MCTRL_SPO0MT (1 << 5) /* RWIVF */ + +/* All 3 Wire Serial Outputs Mute */ +#define PS3_AUDIO_AX_MCTRL_AASOMT (1 << 13) /* RWIVF */ + +/* All S/PDIF Mute */ +#define PS3_AUDIO_AX_MCTRL_ASPOMT (1 << 14) /* RWIVF */ + +/* All Audio Outputs Mute */ +#define PS3_AUDIO_AX_MCTRL_AAOMT (1 << 15) /* RWIVF */ + +/* + S/PDIF Outputs Buffer Read/Write Pointer Register + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0 0 0 0 0 0 0 0|0|SPO0B|0|SPO1B|0 0 0 0 0 0 0 0|0|SPO0B|0|SPO1B| AX_ISBP + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + +*/ +/* + S/PDIF Output Channel Read Buffer Numbers + Buffer number is value of field. + Indicates current read access buffer ID from Audio Data + Transfer controller of S/PDIF Output +*/ + +#define PS3_AUDIO_AX_ISBP_SPOBRN_MASK(n) (0x7 << 4 * (1 - (n))) /* R-IUF */ +#define PS3_AUDIO_AX_ISBP_SPO1BRN_MASK (0x7 << 0) /* R-IUF */ +#define PS3_AUDIO_AX_ISBP_SPO0BRN_MASK (0x7 << 4) /* R-IUF */ + +/* +S/PDIF Output Channel Buffer Write Numbers +Indicates current write access buffer ID from bus master. +*/ +#define PS3_AUDIO_AX_ISBP_SPOBWN_MASK(n) (0x7 << 4 * (5 - (n))) /* R-IUF */ +#define PS3_AUDIO_AX_ISBP_SPO1BWN_MASK (0x7 << 16) /* R-IUF */ +#define PS3_AUDIO_AX_ISBP_SPO0BWN_MASK (0x7 << 20) /* R-IUF */ + +/* + 3 Wire Audio Serial Outputs Buffer Read/Write + Pointer Register + Buffer number is value of field + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0|ASO0B|0|ASO1B|0|ASO2B|0|ASO3B|0|ASO0B|0|ASO1B|0|ASO2B|0|ASO3B| AX_AOBP + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ + +/* +3 Wire Audio Serial Output Channel Buffer Read Numbers +Indicates current read access buffer Id from Audio Data Transfer +Controller of 3 Wire Audio Serial Output Channels +*/ +#define PS3_AUDIO_AX_AOBP_ASOBRN_MASK(n) (0x7 << 4 * (3 - (n))) /* R-IUF */ + +#define PS3_AUDIO_AX_AOBP_ASO3BRN_MASK (0x7 << 0) /* R-IUF */ +#define PS3_AUDIO_AX_AOBP_ASO2BRN_MASK (0x7 << 4) /* R-IUF */ +#define PS3_AUDIO_AX_AOBP_ASO1BRN_MASK (0x7 << 8) /* R-IUF */ +#define PS3_AUDIO_AX_AOBP_ASO0BRN_MASK (0x7 << 12) /* R-IUF */ + +/* +3 Wire Audio Serial Output Channel Buffer Write Numbers +Indicates current write access buffer ID from bus master. +*/ +#define PS3_AUDIO_AX_AOBP_ASOBWN_MASK(n) (0x7 << 4 * (7 - (n))) /* R-IUF */ + +#define PS3_AUDIO_AX_AOBP_ASO3BWN_MASK (0x7 << 16) /* R-IUF */ +#define PS3_AUDIO_AX_AOBP_ASO2BWN_MASK (0x7 << 20) /* R-IUF */ +#define PS3_AUDIO_AX_AOBP_ASO1BWN_MASK (0x7 << 24) /* R-IUF */ +#define PS3_AUDIO_AX_AOBP_ASO0BWN_MASK (0x7 << 28) /* R-IUF */ + + + +/* +Audio Port Interrupt Condition Register +For the fields in this register, the following values apply: +0 = Interrupt is generated every interrupt event. +1 = Interrupt is generated every 2 interrupt events. +2 = Interrupt is generated every 4 interrupt events. +3 = Reserved + + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0 0 0 0 0 0 0 0|0 0|SPO|0 0|SPO|0 0|AAS|0 0 0 0 0 0 0 0 0 0 0 0| AX_IC + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ +/* +All 3-Wire Audio Serial Outputs Interrupt Mode +Configures the Interrupt and Signal Notification +condition of all 3-wire Audio Serial Outputs. +*/ +#define PS3_AUDIO_AX_IC_AASOIMD_MASK (0x3 << 12) /* RWIVF */ +#define PS3_AUDIO_AX_IC_AASOIMD_EVERY1 (0x0 << 12) /* RWI-V */ +#define PS3_AUDIO_AX_IC_AASOIMD_EVERY2 (0x1 << 12) /* RW--V */ +#define PS3_AUDIO_AX_IC_AASOIMD_EVERY4 (0x2 << 12) /* RW--V */ + +/* +S/PDIF Output Channel Interrupt Modes +Configures the Interrupt and signal Notification +conditions of S/PDIF output channels. +*/ +#define PS3_AUDIO_AX_IC_SPO1IMD_MASK (0x3 << 16) /* RWIVF */ +#define PS3_AUDIO_AX_IC_SPO1IMD_EVERY1 (0x0 << 16) /* RWI-V */ +#define PS3_AUDIO_AX_IC_SPO1IMD_EVERY2 (0x1 << 16) /* RW--V */ +#define PS3_AUDIO_AX_IC_SPO1IMD_EVERY4 (0x2 << 16) /* RW--V */ + +#define PS3_AUDIO_AX_IC_SPO0IMD_MASK (0x3 << 20) /* RWIVF */ +#define PS3_AUDIO_AX_IC_SPO0IMD_EVERY1 (0x0 << 20) /* RWI-V */ +#define PS3_AUDIO_AX_IC_SPO0IMD_EVERY2 (0x1 << 20) /* RW--V */ +#define PS3_AUDIO_AX_IC_SPO0IMD_EVERY4 (0x2 << 20) /* RW--V */ + +/* +Audio Port interrupt Enable Register +Configures whether to enable or disable each Interrupt Generation. + + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0 0 0 0 0 0 0 0|S|S|0 0|A|A|A|A|0 0 0 0|S|S|0 0|S|S|0 0|A|A|A|A| AX_IE + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + +*/ + +/* +3 Wire Audio Serial Output Channel Buffer Underflow +Interrupt Enables +Select enable/disable of Buffer Underflow Interrupts for +3-Wire Audio Serial Output Channels +DISABLED=Interrupt generation disabled. +*/ +#define PS3_AUDIO_AX_IE_ASOBUIE(n) (1 << (3 - (n))) /* RWIVF */ +#define PS3_AUDIO_AX_IE_ASO3BUIE (1 << 0) /* RWIVF */ +#define PS3_AUDIO_AX_IE_ASO2BUIE (1 << 1) /* RWIVF */ +#define PS3_AUDIO_AX_IE_ASO1BUIE (1 << 2) /* RWIVF */ +#define PS3_AUDIO_AX_IE_ASO0BUIE (1 << 3) /* RWIVF */ + +/* S/PDIF Output Channel Buffer Underflow Interrupt Enables */ + +#define PS3_AUDIO_AX_IE_SPOBUIE(n) (1 << (7 - (n))) /* RWIVF */ +#define PS3_AUDIO_AX_IE_SPO1BUIE (1 << 6) /* RWIVF */ +#define PS3_AUDIO_AX_IE_SPO0BUIE (1 << 7) /* RWIVF */ + +/* S/PDIF Output Channel One Block Transfer Completion Interrupt Enables */ + +#define PS3_AUDIO_AX_IE_SPOBTCIE(n) (1 << (11 - (n))) /* RWIVF */ +#define PS3_AUDIO_AX_IE_SPO1BTCIE (1 << 10) /* RWIVF */ +#define PS3_AUDIO_AX_IE_SPO0BTCIE (1 << 11) /* RWIVF */ + +/* 3-Wire Audio Serial Output Channel Buffer Empty Interrupt Enables */ + +#define PS3_AUDIO_AX_IE_ASOBEIE(n) (1 << (19 - (n))) /* RWIVF */ +#define PS3_AUDIO_AX_IE_ASO3BEIE (1 << 16) /* RWIVF */ +#define PS3_AUDIO_AX_IE_ASO2BEIE (1 << 17) /* RWIVF */ +#define PS3_AUDIO_AX_IE_ASO1BEIE (1 << 18) /* RWIVF */ +#define PS3_AUDIO_AX_IE_ASO0BEIE (1 << 19) /* RWIVF */ + +/* S/PDIF Output Channel Buffer Empty Interrupt Enables */ + +#define PS3_AUDIO_AX_IE_SPOBEIE(n) (1 << (23 - (n))) /* RWIVF */ +#define PS3_AUDIO_AX_IE_SPO1BEIE (1 << 22) /* RWIVF */ +#define PS3_AUDIO_AX_IE_SPO0BEIE (1 << 23) /* RWIVF */ + +/* +Audio Port Interrupt Status Register +Indicates Interrupt status, which interrupt has occured, and can clear +each interrupt in this register. +Writing 1b to a field containing 1b clears field and de-asserts interrupt. +Writing 0b to a field has no effect. +Field vaules are the following: +0 - Interrupt hasn't occured. +1 - Interrupt has occured. + + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0 0 0 0 0 0 0 0|S|S|0 0|A|A|A|A|0 0 0 0|S|S|0 0|S|S|0 0|A|A|A|A| AX_IS + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + + Bit assignment are same as AX_IE +*/ + +/* +Audio Output Master Control Register +Configures Master Clock and other master Audio Output Settings + + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0|SCKSE|0|SCKSE| MR0 | MR1 |MCL|MCL|0 0 0 0|0 0 0 0 0 0 0 0| AO_MCTRL + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ + +/* +MCLK Output Control +Controls mclko[1] output. +0 - Disable output (fixed at High) +1 - Output clock produced by clock selected +with scksel1 by mr1 +2 - Reserved +3 - Reserved +*/ + +#define PS3_AUDIO_AO_MCTRL_MCLKC1_MASK (0x3 << 12) /* RWIVF */ +#define PS3_AUDIO_AO_MCTRL_MCLKC1_DISABLED (0x0 << 12) /* RWI-V */ +#define PS3_AUDIO_AO_MCTRL_MCLKC1_ENABLED (0x1 << 12) /* RW--V */ +#define PS3_AUDIO_AO_MCTRL_MCLKC1_RESVD2 (0x2 << 12) /* RW--V */ +#define PS3_AUDIO_AO_MCTRL_MCLKC1_RESVD3 (0x3 << 12) /* RW--V */ + +/* +MCLK Output Control +Controls mclko[0] output. +0 - Disable output (fixed at High) +1 - Output clock produced by clock selected +with SCKSEL0 by MR0 +2 - Reserved +3 - Reserved +*/ +#define PS3_AUDIO_AO_MCTRL_MCLKC0_MASK (0x3 << 14) /* RWIVF */ +#define PS3_AUDIO_AO_MCTRL_MCLKC0_DISABLED (0x0 << 14) /* RWI-V */ +#define PS3_AUDIO_AO_MCTRL_MCLKC0_ENABLED (0x1 << 14) /* RW--V */ +#define PS3_AUDIO_AO_MCTRL_MCLKC0_RESVD2 (0x2 << 14) /* RW--V */ +#define PS3_AUDIO_AO_MCTRL_MCLKC0_RESVD3 (0x3 << 14) /* RW--V */ +/* +Master Clock Rate 1 +Sets the divide ration of Master Clock1 (clock output from +mclko[1] for the input clock selected by scksel1. +*/ +#define PS3_AUDIO_AO_MCTRL_MR1_MASK (0xf << 16) +#define PS3_AUDIO_AO_MCTRL_MR1_DEFAULT (0x0 << 16) /* RWI-V */ +/* +Master Clock Rate 0 +Sets the divide ratio of Master Clock0 (clock output from +mclko[0] for the input clock selected by scksel0). +*/ +#define PS3_AUDIO_AO_MCTRL_MR0_MASK (0xf << 20) /* RWIVF */ +#define PS3_AUDIO_AO_MCTRL_MR0_DEFAULT (0x0 << 20) /* RWI-V */ +/* +System Clock Select 0/1 +Selects the system clock to be used as Master Clock 0/1 +Input the system clock that is appropriate for the sampling +rate. +*/ +#define PS3_AUDIO_AO_MCTRL_SCKSEL1_MASK (0x7 << 24) /* RWIVF */ +#define PS3_AUDIO_AO_MCTRL_SCKSEL1_DEFAULT (0x2 << 24) /* RWI-V */ + +#define PS3_AUDIO_AO_MCTRL_SCKSEL0_MASK (0x7 << 28) /* RWIVF */ +#define PS3_AUDIO_AO_MCTRL_SCKSEL0_DEFAULT (0x2 << 28) /* RWI-V */ + + +/* +3-Wire Audio Output Master Control Register +Configures clock, 3-Wire Audio Serial Output Enable, and +other 3-Wire Audio Serial Output Master Settings + + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |A|A|A|A|0 0 0|A| ASOSR |0 0 0 0|A|A|A|A|A|A|0|1|0 0 0 0 0 0 0 0| AO_3WMCTRL + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ + + +/* +LRCKO Polarity +0 - Reserved +1 - default +*/ +#define PS3_AUDIO_AO_3WMCTRL_ASOPLRCK (1 << 8) /* RWIVF */ +#define PS3_AUDIO_AO_3WMCTRL_ASOPLRCK_DEFAULT (1 << 8) /* RW--V */ + +/* LRCK Output Disable */ + +#define PS3_AUDIO_AO_3WMCTRL_ASOLRCKD (1 << 10) /* RWIVF */ +#define PS3_AUDIO_AO_3WMCTRL_ASOLRCKD_ENABLED (0 << 10) /* RW--V */ +#define PS3_AUDIO_AO_3WMCTRL_ASOLRCKD_DISABLED (1 << 10) /* RWI-V */ + +/* Bit Clock Output Disable */ + +#define PS3_AUDIO_AO_3WMCTRL_ASOBCLKD (1 << 11) /* RWIVF */ +#define PS3_AUDIO_AO_3WMCTRL_ASOBCLKD_ENABLED (0 << 11) /* RW--V */ +#define PS3_AUDIO_AO_3WMCTRL_ASOBCLKD_DISABLED (1 << 11) /* RWI-V */ + +/* +3-Wire Audio Serial Output Channel 0-3 Operational +Status. Each bit becomes 1 after each 3-Wire Audio +Serial Output Channel N is in action by setting 1 to +asoen. +Each bit becomes 0 after each 3-Wire Audio Serial Output +Channel N is out of action by setting 0 to asoen. +*/ +#define PS3_AUDIO_AO_3WMCTRL_ASORUN(n) (1 << (15 - (n))) /* R-IVF */ +#define PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(n) (0 << (15 - (n))) /* R-I-V */ +#define PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(n) (1 << (15 - (n))) /* R---V */ +#define PS3_AUDIO_AO_3WMCTRL_ASORUN0 \ + PS3_AUDIO_AO_3WMCTRL_ASORUN(0) +#define PS3_AUDIO_AO_3WMCTRL_ASORUN0_STOPPED \ + PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(0) +#define PS3_AUDIO_AO_3WMCTRL_ASORUN0_RUNNING \ + PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(0) +#define PS3_AUDIO_AO_3WMCTRL_ASORUN1 \ + PS3_AUDIO_AO_3WMCTRL_ASORUN(1) +#define PS3_AUDIO_AO_3WMCTRL_ASORUN1_STOPPED \ + PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(1) +#define PS3_AUDIO_AO_3WMCTRL_ASORUN1_RUNNING \ + PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(1) +#define PS3_AUDIO_AO_3WMCTRL_ASORUN2 \ + PS3_AUDIO_AO_3WMCTRL_ASORUN(2) +#define PS3_AUDIO_AO_3WMCTRL_ASORUN2_STOPPED \ + PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(2) +#define PS3_AUDIO_AO_3WMCTRL_ASORUN2_RUNNING \ + PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(2) +#define PS3_AUDIO_AO_3WMCTRL_ASORUN3 \ + PS3_AUDIO_AO_3WMCTRL_ASORUN(3) +#define PS3_AUDIO_AO_3WMCTRL_ASORUN3_STOPPED \ + PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(3) +#define PS3_AUDIO_AO_3WMCTRL_ASORUN3_RUNNING \ + PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(3) + +/* +Sampling Rate +Specifies the divide ratio of the bit clock (clock output +from bclko) used by the 3-wire Audio Output Clock, whcih +is applied to the master clock selected by mcksel. +Data output is synchronized with this clock. +*/ +#define PS3_AUDIO_AO_3WMCTRL_ASOSR_MASK (0xf << 20) /* RWIVF */ +#define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV2 (0x1 << 20) /* RWI-V */ +#define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV4 (0x2 << 20) /* RW--V */ +#define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV8 (0x4 << 20) /* RW--V */ +#define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV12 (0x6 << 20) /* RW--V */ + +/* +Master Clock Select +0 - Master Clock 0 +1 - Master Clock 1 +*/ +#define PS3_AUDIO_AO_3WMCTRL_ASOMCKSEL (1 << 24) /* RWIVF */ +#define PS3_AUDIO_AO_3WMCTRL_ASOMCKSEL_CLK0 (0 << 24) /* RWI-V */ +#define PS3_AUDIO_AO_3WMCTRL_ASOMCKSEL_CLK1 (1 << 24) /* RW--V */ + +/* +Enables and disables 4ch 3-Wire Audio Serial Output +operation. Each Bit from 0 to 3 corresponds to an +output channel, which means that each output channel +can be enabled or disabled individually. When +multiple channels are enabled at the same time, output +operations are performed in synchronization. +Bit 0 - Output Channel 0 (SDOUT[0]) +Bit 1 - Output Channel 1 (SDOUT[1]) +Bit 2 - Output Channel 2 (SDOUT[2]) +Bit 3 - Output Channel 3 (SDOUT[3]) +*/ +#define PS3_AUDIO_AO_3WMCTRL_ASOEN(n) (1 << (31 - (n))) /* RWIVF */ +#define PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(n) (0 << (31 - (n))) /* RWI-V */ +#define PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(n) (1 << (31 - (n))) /* RW--V */ + +#define PS3_AUDIO_AO_3WMCTRL_ASOEN0 \ + PS3_AUDIO_AO_3WMCTRL_ASOEN(0) /* RWIVF */ +#define PS3_AUDIO_AO_3WMCTRL_ASOEN0_DISABLED \ + PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(0) /* RWI-V */ +#define PS3_AUDIO_AO_3WMCTRL_ASOEN0_ENABLED \ + PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(0) /* RW--V */ +#define PS3_AUDIO_A1_3WMCTRL_ASOEN0 \ + PS3_AUDIO_AO_3WMCTRL_ASOEN(1) /* RWIVF */ +#define PS3_AUDIO_A1_3WMCTRL_ASOEN0_DISABLED \ + PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(1) /* RWI-V */ +#define PS3_AUDIO_A1_3WMCTRL_ASOEN0_ENABLED \ + PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(1) /* RW--V */ +#define PS3_AUDIO_A2_3WMCTRL_ASOEN0 \ + PS3_AUDIO_AO_3WMCTRL_ASOEN(2) /* RWIVF */ +#define PS3_AUDIO_A2_3WMCTRL_ASOEN0_DISABLED \ + PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(2) /* RWI-V */ +#define PS3_AUDIO_A2_3WMCTRL_ASOEN0_ENABLED \ + PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(2) /* RW--V */ +#define PS3_AUDIO_A3_3WMCTRL_ASOEN0 \ + PS3_AUDIO_AO_3WMCTRL_ASOEN(3) /* RWIVF */ +#define PS3_AUDIO_A3_3WMCTRL_ASOEN0_DISABLED \ + PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(3) /* RWI-V */ +#define PS3_AUDIO_A3_3WMCTRL_ASOEN0_ENABLED \ + PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(3) /* RW--V */ + +/* +3-Wire Audio Serial output Channel 0-3 Control Register +Configures settings for 3-Wire Serial Audio Output Channel 0-3 + + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|0 0 0 0|A|0|ASO|0 0 0|0|0|0|0|0| AO_3WCTRL + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + +*/ +/* +Data Bit Mode +Specifies the number of data bits +0 - 16 bits +1 - reserved +2 - 20 bits +3 - 24 bits +*/ +#define PS3_AUDIO_AO_3WCTRL_ASODB_MASK (0x3 << 8) /* RWIVF */ +#define PS3_AUDIO_AO_3WCTRL_ASODB_16BIT (0x0 << 8) /* RWI-V */ +#define PS3_AUDIO_AO_3WCTRL_ASODB_RESVD (0x1 << 8) /* RWI-V */ +#define PS3_AUDIO_AO_3WCTRL_ASODB_20BIT (0x2 << 8) /* RW--V */ +#define PS3_AUDIO_AO_3WCTRL_ASODB_24BIT (0x3 << 8) /* RW--V */ +/* +Data Format Mode +Specifies the data format where (LSB side or MSB) the data(in 20 bit +or 24 bit resolution mode) is put in a 32 bit field. +0 - Data put on LSB side +1 - Data put on MSB side +*/ +#define PS3_AUDIO_AO_3WCTRL_ASODF (1 << 11) /* RWIVF */ +#define PS3_AUDIO_AO_3WCTRL_ASODF_LSB (0 << 11) /* RWI-V */ +#define PS3_AUDIO_AO_3WCTRL_ASODF_MSB (1 << 11) /* RW--V */ +/* +Buffer Reset +Performs buffer reset. Writing 1 to this bit initializes the +corresponding 3-Wire Audio Output buffers(both L and R). +*/ +#define PS3_AUDIO_AO_3WCTRL_ASOBRST (1 << 16) /* CWIVF */ +#define PS3_AUDIO_AO_3WCTRL_ASOBRST_IDLE (0 << 16) /* -WI-V */ +#define PS3_AUDIO_AO_3WCTRL_ASOBRST_RESET (1 << 16) /* -W--T */ + +/* +S/PDIF Audio Output Channel 0/1 Control Register +Configures settings for S/PDIF Audio Output Channel 0/1. + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |S|0 0 0|S|0 0|S| SPOSR |0 0|SPO|0 0 0 0|S|0|SPO|0 0 0 0 0 0 0|S| AO_SPDCTRL + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ +/* +Buffer reset. Writing 1 to this bit initializes the +corresponding S/PDIF output buffer pointer. +*/ +#define PS3_AUDIO_AO_SPDCTRL_SPOBRST (1 << 0) /* CWIVF */ +#define PS3_AUDIO_AO_SPDCTRL_SPOBRST_IDLE (0 << 0) /* -WI-V */ +#define PS3_AUDIO_AO_SPDCTRL_SPOBRST_RESET (1 << 0) /* -W--T */ + +/* +Data Bit Mode +Specifies number of data bits +0 - 16 bits +1 - Reserved +2 - 20 bits +3 - 24 bits +*/ +#define PS3_AUDIO_AO_SPDCTRL_SPODB_MASK (0x3 << 8) /* RWIVF */ +#define PS3_AUDIO_AO_SPDCTRL_SPODB_16BIT (0x0 << 8) /* RWI-V */ +#define PS3_AUDIO_AO_SPDCTRL_SPODB_RESVD (0x1 << 8) /* RW--V */ +#define PS3_AUDIO_AO_SPDCTRL_SPODB_20BIT (0x2 << 8) /* RW--V */ +#define PS3_AUDIO_AO_SPDCTRL_SPODB_24BIT (0x3 << 8) /* RW--V */ +/* +Data format Mode +Specifies the data format, where (LSB side or MSB) +the data(in 20 or 24 bit resolution) is put in the +32 bit field. +0 - LSB Side +1 - MSB Side +*/ +#define PS3_AUDIO_AO_SPDCTRL_SPODF (1 << 11) /* RWIVF */ +#define PS3_AUDIO_AO_SPDCTRL_SPODF_LSB (0 << 11) /* RWI-V */ +#define PS3_AUDIO_AO_SPDCTRL_SPODF_MSB (1 << 11) /* RW--V */ +/* +Source Select +Specifies the source of the S/PDIF output. When 0, output +operation is controlled by 3wen[0] of AO_3WMCTRL register. +The SR must have the same setting as the a0_3wmctrl reg. +0 - 3-Wire Audio OUT Ch0 Buffer +1 - S/PDIF buffer +*/ +#define PS3_AUDIO_AO_SPDCTRL_SPOSS_MASK (0x3 << 16) /* RWIVF */ +#define PS3_AUDIO_AO_SPDCTRL_SPOSS_3WEN (0x0 << 16) /* RWI-V */ +#define PS3_AUDIO_AO_SPDCTRL_SPOSS_SPDIF (0x1 << 16) /* RW--V */ +/* +Sampling Rate +Specifies the divide ratio of the bit clock (clock output +from bclko) used by the S/PDIF Output Clock, which +is applied to the master clock selected by mcksel. +*/ +#define PS3_AUDIO_AO_SPDCTRL_SPOSR (0xf << 20) /* RWIVF */ +#define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV2 (0x1 << 20) /* RWI-V */ +#define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV4 (0x2 << 20) /* RW--V */ +#define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV8 (0x4 << 20) /* RW--V */ +#define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV12 (0x6 << 20) /* RW--V */ +/* +Master Clock Select +0 - Master Clock 0 +1 - Master Clock 1 +*/ +#define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL (1 << 24) /* RWIVF */ +#define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL_CLK0 (0 << 24) /* RWI-V */ +#define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL_CLK1 (1 << 24) /* RW--V */ + +/* +S/PDIF Output Channel Operational Status +This bit becomes 1 after S/PDIF Output Channel is in +action by setting 1 to spoen. This bit becomes 0 +after S/PDIF Output Channel is out of action by setting +0 to spoen. +*/ +#define PS3_AUDIO_AO_SPDCTRL_SPORUN (1 << 27) /* R-IVF */ +#define PS3_AUDIO_AO_SPDCTRL_SPORUN_STOPPED (0 << 27) /* R-I-V */ +#define PS3_AUDIO_AO_SPDCTRL_SPORUN_RUNNING (1 << 27) /* R---V */ + +/* +S/PDIF Audio Output Channel Output Enable +Enables and disables output operation. This bit is used +only when sposs = 1 +*/ +#define PS3_AUDIO_AO_SPDCTRL_SPOEN (1 << 31) /* RWIVF */ +#define PS3_AUDIO_AO_SPDCTRL_SPOEN_DISABLED (0 << 31) /* RWI-V */ +#define PS3_AUDIO_AO_SPDCTRL_SPOEN_ENABLED (1 << 31) /* RW--V */ + +/* +S/PDIF Audio Output Channel Channel Status +Setting Registers. +Configures channel status bit settings for each block +(192 bits). +Output is performed from the MSB(AO_SPDCS0 register bit 31). +The same value is added for subframes within the same frame. + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + | SPOCS | AO_SPDCS + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + +S/PDIF Audio Output Channel User Bit Setting +Configures user bit settings for each block (384 bits). +Output is performed from the MSB(ao_spdub0 register bit 31). + + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + | SPOUB | AO_SPDUB + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ +/***************************************************************************** + * + * DMAC register + * + *****************************************************************************/ +/* +The PS3_AUDIO_KICK register is used to initiate a DMA transfer and monitor +its status + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0 0 0 0 0|STATU|0 0 0| EVENT |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|R| KICK + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ +/* +The REQUEST field is written to ACTIVE to initiate a DMA request when EVENT +occurs. +It will return to the DONE state when the request is completed. +The registers for a DMA channel should only be written if REQUEST is IDLE. +*/ + +#define PS3_AUDIO_KICK_REQUEST (1 << 0) /* RWIVF */ +#define PS3_AUDIO_KICK_REQUEST_IDLE (0 << 0) /* RWI-V */ +#define PS3_AUDIO_KICK_REQUEST_ACTIVE (1 << 0) /* -W--T */ + +/* + *The EVENT field is used to set the event in which + *the DMA request becomes active. + */ +#define PS3_AUDIO_KICK_EVENT_MASK (0x1f << 16) /* RWIVF */ +#define PS3_AUDIO_KICK_EVENT_ALWAYS (0x00 << 16) /* RWI-V */ +#define PS3_AUDIO_KICK_EVENT_SERIALOUT0_EMPTY (0x01 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SERIALOUT0_UNDERFLOW (0x02 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SERIALOUT1_EMPTY (0x03 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SERIALOUT1_UNDERFLOW (0x04 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SERIALOUT2_EMPTY (0x05 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SERIALOUT2_UNDERFLOW (0x06 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SERIALOUT3_EMPTY (0x07 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SERIALOUT3_UNDERFLOW (0x08 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SPDIF0_BLOCKTRANSFERCOMPLETE \ + (0x09 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SPDIF0_UNDERFLOW (0x0A << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SPDIF0_EMPTY (0x0B << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SPDIF1_BLOCKTRANSFERCOMPLETE \ + (0x0C << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SPDIF1_UNDERFLOW (0x0D << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_SPDIF1_EMPTY (0x0E << 16) /* RW--V */ + +#define PS3_AUDIO_KICK_EVENT_AUDIO_DMA(n) \ + ((0x13 + (n)) << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_AUDIO_DMA0 (0x13 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_AUDIO_DMA1 (0x14 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_AUDIO_DMA2 (0x15 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_AUDIO_DMA3 (0x16 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_AUDIO_DMA4 (0x17 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_AUDIO_DMA5 (0x18 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_AUDIO_DMA6 (0x19 << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_AUDIO_DMA7 (0x1A << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_AUDIO_DMA8 (0x1B << 16) /* RW--V */ +#define PS3_AUDIO_KICK_EVENT_AUDIO_DMA9 (0x1C << 16) /* RW--V */ + +/* +The STATUS field can be used to monitor the progress of a DMA request. +DONE indicates the previous request has completed. +EVENT indicates that the DMA engine is waiting for the EVENT to occur. +PENDING indicates that the DMA engine has not started processing this +request, but the EVENT has occured. +DMA indicates that the data transfer is in progress. +NOTIFY indicates that the notifier signalling end of transfer is being written. +CLEAR indicated that the previous transfer was cleared. +ERROR indicates the previous transfer requested an unsupported +source/destination combination. +*/ + +#define PS3_AUDIO_KICK_STATUS_MASK (0x7 << 24) /* R-IVF */ +#define PS3_AUDIO_KICK_STATUS_DONE (0x0 << 24) /* R-I-V */ +#define PS3_AUDIO_KICK_STATUS_EVENT (0x1 << 24) /* R---V */ +#define PS3_AUDIO_KICK_STATUS_PENDING (0x2 << 24) /* R---V */ +#define PS3_AUDIO_KICK_STATUS_DMA (0x3 << 24) /* R---V */ +#define PS3_AUDIO_KICK_STATUS_NOTIFY (0x4 << 24) /* R---V */ +#define PS3_AUDIO_KICK_STATUS_CLEAR (0x5 << 24) /* R---V */ +#define PS3_AUDIO_KICK_STATUS_ERROR (0x6 << 24) /* R---V */ + +/* +The PS3_AUDIO_SOURCE register specifies the source address for transfers. + + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + | START |0 0 0 0 0|TAR| SOURCE + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ + +/* +The Audio DMA engine uses 128-byte transfers, thus the address must be aligned +to a 128 byte boundary. The low seven bits are assumed to be 0. +*/ + +#define PS3_AUDIO_SOURCE_START_MASK (0x01FFFFFF << 7) /* RWIUF */ + +/* +The TARGET field specifies the memory space containing the source address. +*/ + +#define PS3_AUDIO_SOURCE_TARGET_MASK (3 << 0) /* RWIVF */ +#define PS3_AUDIO_SOURCE_TARGET_SYSTEM_MEMORY (2 << 0) /* RW--V */ + +/* +The PS3_AUDIO_DEST register specifies the destination address for transfers. + + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + | START |0 0 0 0 0|TAR| DEST + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ + +/* +The Audio DMA engine uses 128-byte transfers, thus the address must be aligned +to a 128 byte boundary. The low seven bits are assumed to be 0. +*/ + +#define PS3_AUDIO_DEST_START_MASK (0x01FFFFFF << 7) /* RWIUF */ + +/* +The TARGET field specifies the memory space containing the destination address +AUDIOFIFO = Audio WriteData FIFO, +*/ + +#define PS3_AUDIO_DEST_TARGET_MASK (3 << 0) /* RWIVF */ +#define PS3_AUDIO_DEST_TARGET_AUDIOFIFO (1 << 0) /* RW--V */ + +/* +PS3_AUDIO_DMASIZE specifies the number of 128-byte blocks + 1 to transfer. +So a value of 0 means 128-bytes will get transfered. + + + 31 24 23 16 15 8 7 0 + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ + |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0| BLOCKS | DMASIZE + +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ +*/ + + +#define PS3_AUDIO_DMASIZE_BLOCKS_MASK (0x7f << 0) /* RWIUF */ + +/* + * source/destination address for internal fifos + */ +#define PS3_AUDIO_AO_3W_LDATA(n) (0x1000 + (0x100 * (n))) +#define PS3_AUDIO_AO_3W_RDATA(n) (0x1080 + (0x100 * (n))) + +#define PS3_AUDIO_AO_SPD_DATA(n) (0x2000 + (0x400 * (n))) + + +/* + * field attiribute + * + * Read + * ' ' = Other Information + * '-' = Field is part of a write-only register + * 'C' = Value read is always the same, constant value line follows (C) + * 'R' = Value is read + * + * Write + * ' ' = Other Information + * '-' = Must not be written (D), value ignored when written (R,A,F) + * 'W' = Can be written + * + * Internal State + * ' ' = Other Information + * '-' = No internal state + * 'X' = Internal state, initial value is unknown + * 'I' = Internal state, initial value is known and follows (I) + * + * Declaration/Size + * ' ' = Other Information + * '-' = Does Not Apply + * 'V' = Type is void + * 'U' = Type is unsigned integer + * 'S' = Type is signed integer + * 'F' = Type is IEEE floating point + * '1' = Byte size (008) + * '2' = Short size (016) + * '3' = Three byte size (024) + * '4' = Word size (032) + * '8' = Double size (064) + * + * Define Indicator + * ' ' = Other Information + * 'D' = Device + * 'M' = Memory + * 'R' = Register + * 'A' = Array of Registers + * 'F' = Field + * 'V' = Value + * 'T' = Task + */ + diff --git a/sound/sh/Kconfig b/sound/sh/Kconfig new file mode 100644 index 00000000000..b7e08ef22a9 --- /dev/null +++ b/sound/sh/Kconfig @@ -0,0 +1,14 @@ +# ALSA SH drivers + +menu "SUPERH devices" + depends on SND!=n && SUPERH + +config SND_AICA + tristate "Dreamcast Yamaha AICA sound" + depends on SH_DREAMCAST && SND + select SND_PCM + help + ALSA Sound driver for the SEGA Dreamcast console. + +endmenu + diff --git a/sound/sh/Makefile b/sound/sh/Makefile new file mode 100644 index 00000000000..8fdcb6e26f0 --- /dev/null +++ b/sound/sh/Makefile @@ -0,0 +1,8 @@ +# +# Makefile for ALSA +# + +snd-aica-objs := aica.o + +# Toplevel Module Dependency +obj-$(CONFIG_SND_AICA) += snd-aica.o diff --git a/sound/sh/aica.c b/sound/sh/aica.c new file mode 100644 index 00000000000..739786529ca --- /dev/null +++ b/sound/sh/aica.c @@ -0,0 +1,665 @@ +/* +* This code is licenced under +* the General Public Licence +* version 2 +* +* Copyright Adrian McMenamin 2005, 2006, 2007 +* <adrian@mcmen.demon.co.uk> +* Requires firmware (BSD licenced) available from: +* http://linuxdc.cvs.sourceforge.net/linuxdc/linux-sh-dc/sound/oss/aica/firmware/ +* or the maintainer +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of version 2 of the GNU General Public License as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* +*/ + +#include <linux/init.h> +#include <linux/jiffies.h> +#include <linux/slab.h> +#include <linux/time.h> +#include <linux/wait.h> +#include <linux/moduleparam.h> +#include <linux/platform_device.h> +#include <linux/firmware.h> +#include <linux/timer.h> +#include <linux/delay.h> +#include <linux/workqueue.h> +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/control.h> +#include <sound/pcm.h> +#include <sound/initval.h> +#include <sound/info.h> +#include <asm/io.h> +#include <asm/dma.h> +#include <asm/dreamcast/sysasic.h> +#include "aica.h" + +MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>"); +MODULE_DESCRIPTION("Dreamcast AICA sound (pcm) driver"); +MODULE_LICENSE("GPL"); +MODULE_SUPPORTED_DEVICE("{{Yamaha/SEGA, AICA}}"); + +/* module parameters */ +#define CARD_NAME "AICA" +static int index = -1; +static char *id; +static int enable = 1; +module_param(index, int, 0444); +MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); +module_param(id, charp, 0444); +MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard."); +module_param(enable, bool, 0644); +MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard."); + +/* Use workqueue */ +static struct workqueue_struct *aica_queue; + +/* Simple platform device */ +static struct platform_device *pd; +static struct resource aica_memory_space[2] = { + { + .name = "AICA ARM CONTROL", + .start = ARM_RESET_REGISTER, + .flags = IORESOURCE_MEM, + .end = ARM_RESET_REGISTER + 3, + }, + { + .name = "AICA Sound RAM", + .start = SPU_MEMORY_BASE, + .flags = IORESOURCE_MEM, + .end = SPU_MEMORY_BASE + 0x200000 - 1, + }, +}; + +/* SPU specific functions */ +/* spu_write_wait - wait for G2-SH FIFO to clear */ +static void spu_write_wait(void) +{ + int time_count; + time_count = 0; + while (1) { + if (!(readl(G2_FIFO) & 0x11)) + break; + /* To ensure hardware failure doesn't wedge kernel */ + time_count++; + if (time_count > 0x10000) { + snd_printk + ("WARNING: G2 FIFO appears to be blocked.\n"); + break; + } + } +} + +/* spu_memset - write to memory in SPU address space */ +static void spu_memset(u32 toi, u32 what, int length) +{ + int i; + snd_assert(length % 4 == 0, return); + for (i = 0; i < length; i++) { + if (!(i % 8)) + spu_write_wait(); + writel(what, toi + SPU_MEMORY_BASE); + toi++; + } +} + +/* spu_memload - write to SPU address space */ +static void spu_memload(u32 toi, void *from, int length) +{ + u32 *froml = from; + u32 __iomem *to = (u32 __iomem *) (SPU_MEMORY_BASE + toi); + int i; + u32 val; + length = DIV_ROUND_UP(length, 4); + spu_write_wait(); + for (i = 0; i < length; i++) { + if (!(i % 8)) + spu_write_wait(); + val = *froml; + writel(val, to); + froml++; + to++; + } +} + +/* spu_disable - set spu registers to stop sound output */ +static void spu_disable(void) +{ + int i; + u32 regval; + spu_write_wait(); + regval = readl(ARM_RESET_REGISTER); + regval |= 1; + spu_write_wait(); + writel(regval, ARM_RESET_REGISTER); + for (i = 0; i < 64; i++) { + spu_write_wait(); + regval = readl(SPU_REGISTER_BASE + (i * 0x80)); + regval = (regval & ~0x4000) | 0x8000; + spu_write_wait(); + writel(regval, SPU_REGISTER_BASE + (i * 0x80)); + } +} + +/* spu_enable - set spu registers to enable sound output */ +static void spu_enable(void) +{ + u32 regval = readl(ARM_RESET_REGISTER); + regval &= ~1; + spu_write_wait(); + writel(regval, ARM_RESET_REGISTER); +} + +/* + * Halt the sound processor, clear the memory, + * load some default ARM7 code, and then restart ARM7 +*/ +static void spu_reset(void) +{ + spu_disable(); + spu_memset(0, 0, 0x200000 / 4); + /* Put ARM7 in endless loop */ + ctrl_outl(0xea000002, SPU_MEMORY_BASE); + spu_enable(); +} + +/* aica_chn_start - write to spu to start playback */ +static void aica_chn_start(void) +{ + spu_write_wait(); + writel(AICA_CMD_KICK | AICA_CMD_START, (u32 *) AICA_CONTROL_POINT); +} + +/* aica_chn_halt - write to spu to halt playback */ +static void aica_chn_halt(void) +{ + spu_write_wait(); + writel(AICA_CMD_KICK | AICA_CMD_STOP, (u32 *) AICA_CONTROL_POINT); +} + +/* ALSA code below */ +static struct snd_pcm_hardware snd_pcm_aica_playback_hw = { + .info = (SNDRV_PCM_INFO_NONINTERLEAVED), + .formats = + (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_IMA_ADPCM), + .rates = SNDRV_PCM_RATE_8000_48000, + .rate_min = 8000, + .rate_max = 48000, + .channels_min = 1, + .channels_max = 2, + .buffer_bytes_max = AICA_BUFFER_SIZE, + .period_bytes_min = AICA_PERIOD_SIZE, + .period_bytes_max = AICA_PERIOD_SIZE, + .periods_min = AICA_PERIOD_NUMBER, + .periods_max = AICA_PERIOD_NUMBER, +}; + +static int aica_dma_transfer(int channels, int buffer_size, + struct snd_pcm_substream *substream) +{ + int q, err, period_offset; + struct snd_card_aica *dreamcastcard; + struct snd_pcm_runtime *runtime; + err = 0; + dreamcastcard = substream->pcm->private_data; + period_offset = dreamcastcard->clicks; + period_offset %= (AICA_PERIOD_NUMBER / channels); + runtime = substream->runtime; + for (q = 0; q < channels; q++) { + err = dma_xfer(AICA_DMA_CHANNEL, + (unsigned long) (runtime->dma_area + + (AICA_BUFFER_SIZE * q) / + channels + + AICA_PERIOD_SIZE * + period_offset), + AICA_CHANNEL0_OFFSET + q * CHANNEL_OFFSET + + AICA_PERIOD_SIZE * period_offset, + buffer_size / channels, AICA_DMA_MODE); + if (unlikely(err < 0)) + break; + dma_wait_for_completion(AICA_DMA_CHANNEL); + } + return err; +} + +static void startup_aica(struct snd_card_aica *dreamcastcard) +{ + spu_memload(AICA_CHANNEL0_CONTROL_OFFSET, + dreamcastcard->channel, sizeof(struct aica_channel)); + aica_chn_start(); +} + +static void run_spu_dma(struct work_struct *work) +{ + int buffer_size; + struct snd_pcm_runtime *runtime; + struct snd_card_aica *dreamcastcard; + dreamcastcard = + container_of(work, struct snd_card_aica, spu_dma_work); + runtime = dreamcastcard->substream->runtime; + if (unlikely(dreamcastcard->dma_check == 0)) { + buffer_size = + frames_to_bytes(runtime, runtime->buffer_size); + if (runtime->channels > 1) + dreamcastcard->channel->flags |= 0x01; + aica_dma_transfer(runtime->channels, buffer_size, + dreamcastcard->substream); + startup_aica(dreamcastcard); + dreamcastcard->clicks = + buffer_size / (AICA_PERIOD_SIZE * runtime->channels); + return; + } else { + aica_dma_transfer(runtime->channels, + AICA_PERIOD_SIZE * runtime->channels, + dreamcastcard->substream); + snd_pcm_period_elapsed(dreamcastcard->substream); + dreamcastcard->clicks++; + if (unlikely(dreamcastcard->clicks >= AICA_PERIOD_NUMBER)) + dreamcastcard->clicks %= AICA_PERIOD_NUMBER; + mod_timer(&dreamcastcard->timer, jiffies + 1); + } +} + +static void aica_period_elapsed(unsigned long timer_var) +{ + /*timer function - so cannot sleep */ + int play_period; + struct snd_pcm_runtime *runtime; + struct snd_pcm_substream *substream; + struct snd_card_aica *dreamcastcard; + substream = (struct snd_pcm_substream *) timer_var; + runtime = substream->runtime; + dreamcastcard = substream->pcm->private_data; + /* Have we played out an additional period? */ + play_period = + frames_to_bytes(runtime, + readl + (AICA_CONTROL_CHANNEL_SAMPLE_NUMBER)) / + AICA_PERIOD_SIZE; + if (play_period == dreamcastcard->current_period) { + /* reschedule the timer */ + mod_timer(&(dreamcastcard->timer), jiffies + 1); + return; + } + if (runtime->channels > 1) + dreamcastcard->current_period = play_period; + if (unlikely(dreamcastcard->dma_check == 0)) + dreamcastcard->dma_check = 1; + queue_work(aica_queue, &(dreamcastcard->spu_dma_work)); +} + +static void spu_begin_dma(struct snd_pcm_substream *substream) +{ + struct snd_card_aica *dreamcastcard; + struct snd_pcm_runtime *runtime; + runtime = substream->runtime; + dreamcastcard = substream->pcm->private_data; + /*get the queue to do the work */ + queue_work(aica_queue, &(dreamcastcard->spu_dma_work)); + /* Timer may already be running */ + if (unlikely(dreamcastcard->timer.data)) { + mod_timer(&dreamcastcard->timer, jiffies + 4); + return; + } + init_timer(&(dreamcastcard->timer)); + dreamcastcard->timer.data = (unsigned long) substream; + dreamcastcard->timer.function = aica_period_elapsed; + dreamcastcard->timer.expires = jiffies + 4; + add_timer(&(dreamcastcard->timer)); +} + +static int snd_aicapcm_pcm_open(struct snd_pcm_substream + *substream) +{ + struct snd_pcm_runtime *runtime; + struct aica_channel *channel; + struct snd_card_aica *dreamcastcard; + if (!enable) + return -ENOENT; + dreamcastcard = substream->pcm->private_data; + channel = kmalloc(sizeof(struct aica_channel), GFP_KERNEL); + if (!channel) + return -ENOMEM; + /* set defaults for channel */ + channel->sfmt = SM_8BIT; + channel->cmd = AICA_CMD_START; + channel->vol = dreamcastcard->master_volume; + channel->pan = 0x80; + channel->pos = 0; + channel->flags = 0; /* default to mono */ + dreamcastcard->channel = channel; + runtime = substream->runtime; + runtime->hw = snd_pcm_aica_playback_hw; + spu_enable(); + dreamcastcard->clicks = 0; + dreamcastcard->current_period = 0; + dreamcastcard->dma_check = 0; + return 0; +} + +static int snd_aicapcm_pcm_close(struct snd_pcm_substream + *substream) +{ + struct snd_card_aica *dreamcastcard = substream->pcm->private_data; + flush_workqueue(aica_queue); + if (dreamcastcard->timer.data) + del_timer(&dreamcastcard->timer); + kfree(dreamcastcard->channel); + spu_disable(); + return 0; +} + +static int snd_aicapcm_pcm_hw_free(struct snd_pcm_substream + *substream) +{ + /* Free the DMA buffer */ + return snd_pcm_lib_free_pages(substream); +} + +static int snd_aicapcm_pcm_hw_params(struct snd_pcm_substream + *substream, struct snd_pcm_hw_params + *hw_params) +{ + /* Allocate a DMA buffer using ALSA built-ins */ + return + snd_pcm_lib_malloc_pages(substream, + params_buffer_bytes(hw_params)); +} + +static int snd_aicapcm_pcm_prepare(struct snd_pcm_substream + *substream) +{ + struct snd_card_aica *dreamcastcard = substream->pcm->private_data; + if ((substream->runtime)->format == SNDRV_PCM_FORMAT_S16_LE) + dreamcastcard->channel->sfmt = SM_16BIT; + dreamcastcard->channel->freq = substream->runtime->rate; + dreamcastcard->substream = substream; + return 0; +} + +static int snd_aicapcm_pcm_trigger(struct snd_pcm_substream + *substream, int cmd) +{ + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + spu_begin_dma(substream); + break; + case SNDRV_PCM_TRIGGER_STOP: + aica_chn_halt(); + break; + default: + return -EINVAL; + } + return 0; +} + +static unsigned long snd_aicapcm_pcm_pointer(struct snd_pcm_substream + *substream) +{ + return readl(AICA_CONTROL_CHANNEL_SAMPLE_NUMBER); +} + +static struct snd_pcm_ops snd_aicapcm_playback_ops = { + .open = snd_aicapcm_pcm_open, + .close = snd_aicapcm_pcm_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = snd_aicapcm_pcm_hw_params, + .hw_free = snd_aicapcm_pcm_hw_free, + .prepare = snd_aicapcm_pcm_prepare, + .trigger = snd_aicapcm_pcm_trigger, + .pointer = snd_aicapcm_pcm_pointer, +}; + +/* TO DO: set up to handle more than one pcm instance */ +static int __init snd_aicapcmchip(struct snd_card_aica + *dreamcastcard, int pcm_index) +{ + struct snd_pcm *pcm; + int err; + /* AICA has no capture ability */ + err = + snd_pcm_new(dreamcastcard->card, "AICA PCM", pcm_index, 1, 0, + &pcm); + if (unlikely(err < 0)) + return err; + pcm->private_data = dreamcastcard; + strcpy(pcm->name, "AICA PCM"); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, + &snd_aicapcm_playback_ops); + /* Allocate the DMA buffers */ + err = + snd_pcm_lib_preallocate_pages_for_all(pcm, + SNDRV_DMA_TYPE_CONTINUOUS, + snd_dma_continuous_data + (GFP_KERNEL), + AICA_BUFFER_SIZE, + AICA_BUFFER_SIZE); + return err; +} + +/* Mixer controls */ +static int aica_pcmswitch_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) +{ + uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; + uinfo->count = 1; + uinfo->value.integer.min = 0; + uinfo->value.integer.max = 1; + return 0; +} + +static int aica_pcmswitch_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + ucontrol->value.integer.value[0] = 1; /* TO DO: Fix me */ + return 0; +} + +static int aica_pcmswitch_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + if (ucontrol->value.integer.value[0] == 1) + return 0; /* TO DO: Fix me */ + else + aica_chn_halt(); + return 0; +} + +static int aica_pcmvolume_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) +{ + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; + uinfo->count = 1; + uinfo->value.integer.min = 0; + uinfo->value.integer.max = 0xFF; + return 0; +} + +static int aica_pcmvolume_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_card_aica *dreamcastcard; + dreamcastcard = kcontrol->private_data; + if (unlikely(!dreamcastcard->channel)) + return -ETXTBSY; /* we've not yet been set up */ + ucontrol->value.integer.value[0] = dreamcastcard->channel->vol; + return 0; +} + +static int aica_pcmvolume_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_card_aica *dreamcastcard; + dreamcastcard = kcontrol->private_data; + if (unlikely(!dreamcastcard->channel)) + return -ETXTBSY; + if (unlikely(dreamcastcard->channel->vol == + ucontrol->value.integer.value[0])) + return 0; + dreamcastcard->channel->vol = ucontrol->value.integer.value[0]; + dreamcastcard->master_volume = ucontrol->value.integer.value[0]; + spu_memload(AICA_CHANNEL0_CONTROL_OFFSET, + dreamcastcard->channel, sizeof(struct aica_channel)); + return 1; +} + +static struct snd_kcontrol_new snd_aica_pcmswitch_control __devinitdata = { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "PCM Playback Switch", + .index = 0, + .info = aica_pcmswitch_info, + .get = aica_pcmswitch_get, + .put = aica_pcmswitch_put +}; + +static struct snd_kcontrol_new snd_aica_pcmvolume_control __devinitdata = { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "PCM Playback Volume", + .index = 0, + .info = aica_pcmvolume_info, + .get = aica_pcmvolume_get, + .put = aica_pcmvolume_put +}; + +static int load_aica_firmware(void) +{ + int err; + const struct firmware *fw_entry; + spu_reset(); + err = request_firmware(&fw_entry, "aica_firmware.bin", &pd->dev); + if (unlikely(err)) + return err; + /* write firware into memory */ + spu_disable(); + spu_memload(0, fw_entry->data, fw_entry->size); + spu_enable(); + release_firmware(fw_entry); + return err; +} + +static int __devinit add_aicamixer_controls(struct snd_card_aica + *dreamcastcard) +{ + int err; + err = snd_ctl_add + (dreamcastcard->card, + snd_ctl_new1(&snd_aica_pcmvolume_control, dreamcastcard)); + if (unlikely(err < 0)) + return err; + err = snd_ctl_add + (dreamcastcard->card, + snd_ctl_new1(&snd_aica_pcmswitch_control, dreamcastcard)); + if (unlikely(err < 0)) + return err; + return 0; +} + +static int snd_aica_remove(struct platform_device *devptr) +{ + struct snd_card_aica *dreamcastcard; + dreamcastcard = platform_get_drvdata(devptr); + if (unlikely(!dreamcastcard)) + return -ENODEV; + snd_card_free(dreamcastcard->card); + kfree(dreamcastcard); + platform_set_drvdata(devptr, NULL); + return 0; +} + +static int __init snd_aica_probe(struct platform_device *devptr) +{ + int err; + struct snd_card_aica *dreamcastcard; + dreamcastcard = kmalloc(sizeof(struct snd_card_aica), GFP_KERNEL); + if (unlikely(!dreamcastcard)) + return -ENOMEM; + dreamcastcard->card = + snd_card_new(index, SND_AICA_DRIVER, THIS_MODULE, 0); + if (unlikely(!dreamcastcard->card)) { + kfree(dreamcastcard); + return -ENODEV; + } + strcpy(dreamcastcard->card->driver, "snd_aica"); + strcpy(dreamcastcard->card->shortname, SND_AICA_DRIVER); + strcpy(dreamcastcard->card->longname, + "Yamaha AICA Super Intelligent Sound Processor for SEGA Dreamcast"); + /* Prepare to use the queue */ + INIT_WORK(&(dreamcastcard->spu_dma_work), run_spu_dma); + /* Load the PCM 'chip' */ + err = snd_aicapcmchip(dreamcastcard, 0); + if (unlikely(err < 0)) + goto freedreamcast; + snd_card_set_dev(dreamcastcard->card, &devptr->dev); + dreamcastcard->timer.data = 0; + dreamcastcard->channel = NULL; + /* Add basic controls */ + err = add_aicamixer_controls(dreamcastcard); + if (unlikely(err < 0)) + goto freedreamcast; + /* Register the card with ALSA subsystem */ + err = snd_card_register(dreamcastcard->card); + if (unlikely(err < 0)) + goto freedreamcast; + platform_set_drvdata(devptr, dreamcastcard); + aica_queue = create_workqueue(CARD_NAME); + if (unlikely(!aica_queue)) + goto freedreamcast; + snd_printk + ("ALSA Driver for Yamaha AICA Super Intelligent Sound Processor\n"); + return 0; + freedreamcast: + snd_card_free(dreamcastcard->card); + kfree(dreamcastcard); + return err; +} + +static struct platform_driver snd_aica_driver = { + .probe = snd_aica_probe, + .remove = snd_aica_remove, + .driver = { + .name = SND_AICA_DRIVER}, +}; + +static int __init aica_init(void) +{ + int err; + err = platform_driver_register(&snd_aica_driver); + if (unlikely(err < 0)) + return err; + pd = platform_device_register_simple(SND_AICA_DRIVER, -1, + aica_memory_space, 2); + if (unlikely(IS_ERR(pd))) { + platform_driver_unregister(&snd_aica_driver); + return PTR_ERR(pd); + } + /* Load the firmware */ + return load_aica_firmware(); +} + +static void __exit aica_exit(void) +{ + /* Destroy the aica kernel thread * + * being extra cautious to check if it exists*/ + if (likely(aica_queue)) + destroy_workqueue(aica_queue); + platform_device_unregister(pd); + platform_driver_unregister(&snd_aica_driver); + /* Kill any sound still playing and reset ARM7 to safe state */ + spu_reset(); +} + +module_init(aica_init); +module_exit(aica_exit); diff --git a/sound/sh/aica.h b/sound/sh/aica.h new file mode 100644 index 00000000000..8c11e3d10a5 --- /dev/null +++ b/sound/sh/aica.h @@ -0,0 +1,81 @@ +/* aica.h + * Header file for ALSA driver for + * Sega Dreamcast Yamaha AICA sound + * Copyright Adrian McMenamin + * <adrian@mcmen.demon.co.uk> + * 2006 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +/* SPU memory and register constants etc */ +#define G2_FIFO 0xa05f688c +#define SPU_MEMORY_BASE 0xA0800000 +#define ARM_RESET_REGISTER 0xA0702C00 +#define SPU_REGISTER_BASE 0xA0700000 + +/* AICA channels stuff */ +#define AICA_CONTROL_POINT 0xA0810000 +#define AICA_CONTROL_CHANNEL_SAMPLE_NUMBER 0xA0810008 +#define AICA_CHANNEL0_CONTROL_OFFSET 0x10004 + +/* Command values */ +#define AICA_CMD_KICK 0x80000000 +#define AICA_CMD_NONE 0 +#define AICA_CMD_START 1 +#define AICA_CMD_STOP 2 +#define AICA_CMD_VOL 3 + +/* Sound modes */ +#define SM_8BIT 1 +#define SM_16BIT 0 +#define SM_ADPCM 2 + +/* Buffer and period size */ +#define AICA_BUFFER_SIZE 0x8000 +#define AICA_PERIOD_SIZE 0x800 +#define AICA_PERIOD_NUMBER 16 + +#define AICA_CHANNEL0_OFFSET 0x11000 +#define AICA_CHANNEL1_OFFSET 0x21000 +#define CHANNEL_OFFSET 0x10000 + +#define AICA_DMA_CHANNEL 0 +#define AICA_DMA_MODE 5 + +#define SND_AICA_DRIVER "AICA" + +struct aica_channel { + uint32_t cmd; /* Command ID */ + uint32_t pos; /* Sample position */ + uint32_t length; /* Sample length */ + uint32_t freq; /* Frequency */ + uint32_t vol; /* Volume 0-255 */ + uint32_t pan; /* Pan 0-255 */ + uint32_t sfmt; /* Sound format */ + uint32_t flags; /* Bit flags */ +}; + +struct snd_card_aica { + struct work_struct spu_dma_work; + struct snd_card *card; + struct aica_channel *channel; + struct snd_pcm_substream *substream; + int clicks; + int current_period; + struct timer_list timer; + int master_volume; + int dma_check; +}; diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig index 10cffc08718..97b25523317 100644 --- a/sound/soc/Kconfig +++ b/sound/soc/Kconfig @@ -27,6 +27,7 @@ config SND_SOC source "sound/soc/at91/Kconfig" source "sound/soc/pxa/Kconfig" source "sound/soc/s3c24xx/Kconfig" +source "sound/soc/sh/Kconfig" # Supported codecs source "sound/soc/codecs/Kconfig" diff --git a/sound/soc/Makefile b/sound/soc/Makefile index 0ae2e49036f..30414037763 100644 --- a/sound/soc/Makefile +++ b/sound/soc/Makefile @@ -1,4 +1,4 @@ snd-soc-core-objs := soc-core.o soc-dapm.o obj-$(CONFIG_SND_SOC) += snd-soc-core.o -obj-$(CONFIG_SND_SOC) += codecs/ at91/ pxa/ s3c24xx/ +obj-$(CONFIG_SND_SOC) += codecs/ at91/ pxa/ s3c24xx/ sh/ diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig index 044a3712077..e97c68306a9 100644 --- a/sound/soc/s3c24xx/Kconfig +++ b/sound/soc/s3c24xx/Kconfig @@ -1,6 +1,7 @@ config SND_S3C24XX_SOC tristate "SoC Audio for the Samsung S3C24XX chips" depends on ARCH_S3C2410 && SND_SOC + select SND_PCM help Say Y or M if you want to add support for codecs attached to the S3C24XX AC97, I2S or SSP interface. You will also need @@ -8,3 +9,29 @@ config SND_S3C24XX_SOC config SND_S3C24XX_SOC_I2S tristate + +config SND_S3C2443_SOC_AC97 + tristate + select AC97_BUS + select SND_AC97_CODEC + select SND_SOC_AC97_BUS + +config SND_S3C24XX_SOC_NEO1973_WM8753 + tristate "SoC I2S Audio support for NEO1973 - WM8753" + depends on SND_S3C24XX_SOC && MACH_GTA01 + select SND_S3C24XX_SOC_I2S + select SND_SOC_WM8753 + help + Say Y if you want to add support for SoC audio on smdk2440 + with the WM8753. + +config SND_S3C24XX_SOC_SMDK2443_WM9710 + tristate "SoC AC97 Audio support for SMDK2443 - WM9710" + depends on SND_S3C24XX_SOC && MACH_SMDK2443 + select SND_S3C2443_SOC_AC97 + select SND_SOC_AC97_CODEC + help + Say Y if you want to add support for SoC audio on smdk2443 + with the WM9710. + + diff --git a/sound/soc/s3c24xx/Makefile b/sound/soc/s3c24xx/Makefile index 6f0fffcb30f..13c92f0fa1e 100644 --- a/sound/soc/s3c24xx/Makefile +++ b/sound/soc/s3c24xx/Makefile @@ -1,6 +1,15 @@ # S3c24XX Platform Support snd-soc-s3c24xx-objs := s3c24xx-pcm.o snd-soc-s3c24xx-i2s-objs := s3c24xx-i2s.o +snd-soc-s3c2443-ac97-objs := s3c2443-ac97.o obj-$(CONFIG_SND_S3C24XX_SOC) += snd-soc-s3c24xx.o obj-$(CONFIG_SND_S3C24XX_SOC_I2S) += snd-soc-s3c24xx-i2s.o +obj-$(CONFIG_SND_S3C2443_SOC_AC97) += snd-soc-s3c2443-ac97.o + +# S3C24XX Machine Support +snd-soc-neo1973-wm8753-objs := neo1973_wm8753.o +snd-soc-smdk2443-wm9710-objs := smdk2443_wm9710.o + +obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o +obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2443_WM9710) += snd-soc-smdk2443-wm9710.o diff --git a/sound/soc/s3c24xx/lm4857.h b/sound/soc/s3c24xx/lm4857.h new file mode 100644 index 00000000000..0cf5b7011d6 --- /dev/null +++ b/sound/soc/s3c24xx/lm4857.h @@ -0,0 +1,32 @@ +/* + * lm4857.h -- ALSA Soc Audio Layer + * + * Copyright 2007 Wolfson Microelectronics PLC. + * Author: Graeme Gregory + * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * Revision history + * 18th Jun 2007 Initial version. + */ + +#ifndef LM4857_H_ +#define LM4857_H_ + +/* The register offsets in the cache array */ +#define LM4857_MVOL 0 +#define LM4857_LVOL 1 +#define LM4857_RVOL 2 +#define LM4857_CTRL 3 + +/* the shifts required to set these bits */ +#define LM4857_3D 5 +#define LM4857_WAKEUP 5 +#define LM4857_EPGAIN 4 + +#endif /*LM4857_H_*/ + diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c new file mode 100644 index 00000000000..d5a8fc2cf8d --- /dev/null +++ b/sound/soc/s3c24xx/neo1973_wm8753.c @@ -0,0 +1,670 @@ +/* + * neo1973_wm8753.c -- SoC audio for Neo1973 + * + * Copyright 2007 Wolfson Microelectronics PLC. + * Author: Graeme Gregory + * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * Revision history + * 20th Jan 2007 Initial version. + * 05th Feb 2007 Rename all to Neo1973 + * + */ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/timer.h> +#include <linux/interrupt.h> +#include <linux/platform_device.h> +#include <linux/i2c.h> +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/soc.h> +#include <sound/soc-dapm.h> + +#include <asm/mach-types.h> +#include <asm/hardware/scoop.h> +#include <asm/arch/regs-iis.h> +#include <asm/arch/regs-clock.h> +#include <asm/arch/regs-gpio.h> +#include <asm/hardware.h> +#include <asm/arch/audio.h> +#include <asm/io.h> +#include <asm/arch/spi-gpio.h> +#include "../codecs/wm8753.h" +#include "lm4857.h" +#include "s3c24xx-pcm.h" +#include "s3c24xx-i2s.h" + +/* define the scenarios */ +#define NEO_AUDIO_OFF 0 +#define NEO_GSM_CALL_AUDIO_HANDSET 1 +#define NEO_GSM_CALL_AUDIO_HEADSET 2 +#define NEO_GSM_CALL_AUDIO_BLUETOOTH 3 +#define NEO_STEREO_TO_SPEAKERS 4 +#define NEO_STEREO_TO_HEADPHONES 5 +#define NEO_CAPTURE_HANDSET 6 +#define NEO_CAPTURE_HEADSET 7 +#define NEO_CAPTURE_BLUETOOTH 8 + +static struct snd_soc_machine neo1973; +static struct i2c_client *i2c; + +static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai; + struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai; + unsigned int pll_out = 0, bclk = 0; + int ret = 0; + unsigned long iis_clkrate; + + iis_clkrate = s3c24xx_i2s_get_clockrate(); + + switch (params_rate(params)) { + case 8000: + case 16000: + pll_out = 12288000; + break; + case 48000: + bclk = WM8753_BCLK_DIV_4; + pll_out = 12288000; + break; + case 96000: + bclk = WM8753_BCLK_DIV_2; + pll_out = 12288000; + break; + case 11025: + bclk = WM8753_BCLK_DIV_16; + pll_out = 11289600; + break; + case 22050: + bclk = WM8753_BCLK_DIV_8; + pll_out = 11289600; + break; + case 44100: + bclk = WM8753_BCLK_DIV_4; + pll_out = 11289600; + break; + case 88200: + bclk = WM8753_BCLK_DIV_2; + pll_out = 11289600; + break; + } + + /* set codec DAI configuration */ + ret = codec_dai->dai_ops.set_fmt(codec_dai, + SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBM_CFM); + if (ret < 0) + return ret; + + /* set cpu DAI configuration */ + ret = cpu_dai->dai_ops.set_fmt(cpu_dai, + SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBM_CFM); + if (ret < 0) + return ret; + + /* set the codec system clock for DAC and ADC */ + ret = codec_dai->dai_ops.set_sysclk(codec_dai, WM8753_MCLK, pll_out, + SND_SOC_CLOCK_IN); + if (ret < 0) + return ret; + + /* set MCLK division for sample rate */ + ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK, + S3C2410_IISMOD_32FS ); + if (ret < 0) + return ret; + + /* set codec BCLK division for sample rate */ + ret = codec_dai->dai_ops.set_clkdiv(codec_dai, WM8753_BCLKDIV, bclk); + if (ret < 0) + return ret; + + /* set prescaler division for sample rate */ + ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER, + S3C24XX_PRESCALE(4,4)); + if (ret < 0) + return ret; + + /* codec PLL input is PCLK/4 */ + ret = codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL1, + iis_clkrate / 4, pll_out); + if (ret < 0) + return ret; + + return 0; +} + +static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai; + + /* disable the PLL */ + return codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL1, 0, 0); +} + +/* + * Neo1973 WM8753 HiFi DAI opserations. + */ +static struct snd_soc_ops neo1973_hifi_ops = { + .hw_params = neo1973_hifi_hw_params, + .hw_free = neo1973_hifi_hw_free, +}; + +static int neo1973_voice_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai; + unsigned int pcmdiv = 0; + int ret = 0; + unsigned long iis_clkrate; + + iis_clkrate = s3c24xx_i2s_get_clockrate(); + + if (params_rate(params) != 8000) + return -EINVAL; + if (params_channels(params) != 1) + return -EINVAL; + + pcmdiv = WM8753_PCM_DIV_6; /* 2.048 MHz */ + + /* todo: gg check mode (DSP_B) against CSR datasheet */ + /* set codec DAI configuration */ + ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B | + SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); + if (ret < 0) + return ret; + + /* set the codec system clock for DAC and ADC */ + ret = codec_dai->dai_ops.set_sysclk(codec_dai, WM8753_PCMCLK, 12288000, + SND_SOC_CLOCK_IN); + if (ret < 0) + return ret; + + /* set codec PCM division for sample rate */ + ret = codec_dai->dai_ops.set_clkdiv(codec_dai, WM8753_PCMDIV, pcmdiv); + if (ret < 0) + return ret; + + /* configue and enable PLL for 12.288MHz output */ + ret = codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL2, + iis_clkrate / 4, 12288000); + if (ret < 0) + return ret; + + return 0; +} + +static int neo1973_voice_hw_free(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai; + + /* disable the PLL */ + return codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL2, 0, 0); +} + +static struct snd_soc_ops neo1973_voice_ops = { + .hw_params = neo1973_voice_hw_params, + .hw_free = neo1973_voice_hw_free, +}; + +static int neo1973_scenario = 0; + +static int neo1973_get_scenario(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + ucontrol->value.integer.value[0] = neo1973_scenario; + return 0; +} + +static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario) +{ + switch(neo1973_scenario) { + case NEO_AUDIO_OFF: + snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); + snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); + snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); + break; + case NEO_GSM_CALL_AUDIO_HANDSET: + snd_soc_dapm_set_endpoint(codec, "Audio Out", 1); + snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 1); + snd_soc_dapm_set_endpoint(codec, "GSM Line In", 1); + snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); + snd_soc_dapm_set_endpoint(codec, "Call Mic", 1); + break; + case NEO_GSM_CALL_AUDIO_HEADSET: + snd_soc_dapm_set_endpoint(codec, "Audio Out", 1); + snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 1); + snd_soc_dapm_set_endpoint(codec, "GSM Line In", 1); + snd_soc_dapm_set_endpoint(codec, "Headset Mic", 1); + snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); + break; + case NEO_GSM_CALL_AUDIO_BLUETOOTH: + snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 1); + snd_soc_dapm_set_endpoint(codec, "GSM Line In", 1); + snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); + snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); + break; + case NEO_STEREO_TO_SPEAKERS: + snd_soc_dapm_set_endpoint(codec, "Audio Out", 1); + snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); + snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); + snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); + break; + case NEO_STEREO_TO_HEADPHONES: + snd_soc_dapm_set_endpoint(codec, "Audio Out", 1); + snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); + snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); + snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); + break; + case NEO_CAPTURE_HANDSET: + snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); + snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); + snd_soc_dapm_set_endpoint(codec, "Call Mic", 1); + break; + case NEO_CAPTURE_HEADSET: + snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); + snd_soc_dapm_set_endpoint(codec, "Headset Mic", 1); + snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); + break; + case NEO_CAPTURE_BLUETOOTH: + snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); + snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); + snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); + break; + default: + snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); + snd_soc_dapm_set_endpoint(codec, "GSM Line In", 0); + snd_soc_dapm_set_endpoint(codec, "Headset Mic", 0); + snd_soc_dapm_set_endpoint(codec, "Call Mic", 0); + } + + snd_soc_dapm_sync_endpoints(codec); + + return 0; +} + +static int neo1973_set_scenario(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + + if (neo1973_scenario == ucontrol->value.integer.value[0]) + return 0; + + neo1973_scenario = ucontrol->value.integer.value[0]; + set_scenario_endpoints(codec, neo1973_scenario); + return 1; +} + +static u8 lm4857_regs[4] = {0x00, 0x40, 0x80, 0xC0}; + +static void lm4857_write_regs(void) +{ + if (i2c_master_send(i2c, lm4857_regs, 4) != 4) + printk(KERN_ERR "lm4857: i2c write failed\n"); +} + +static int lm4857_get_reg(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + int reg=kcontrol->private_value & 0xFF; + int shift = (kcontrol->private_value >> 8) & 0x0F; + int mask = (kcontrol->private_value >> 16) & 0xFF; + + ucontrol->value.integer.value[0] = (lm4857_regs[reg] >> shift) & mask; + return 0; +} + +static int lm4857_set_reg(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + int reg = kcontrol->private_value & 0xFF; + int shift = (kcontrol->private_value >> 8) & 0x0F; + int mask = (kcontrol->private_value >> 16) & 0xFF; + + if (((lm4857_regs[reg] >> shift ) & mask) == + ucontrol->value.integer.value[0]) + return 0; + + lm4857_regs[reg] &= ~ (mask << shift); + lm4857_regs[reg] |= ucontrol->value.integer.value[0] << shift; + lm4857_write_regs(); + return 1; +} + +static int lm4857_get_mode(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + u8 value = lm4857_regs[LM4857_CTRL] & 0x0F; + + if (value) + value -= 5; + + ucontrol->value.integer.value[0] = value; + return 0; +} + +static int lm4857_set_mode(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + u8 value = ucontrol->value.integer.value[0]; + + if (value) + value += 5; + + if ((lm4857_regs[LM4857_CTRL] & 0x0F) == value) + return 0; + + lm4857_regs[LM4857_CTRL] &= 0xF0; + lm4857_regs[LM4857_CTRL] |= value; + lm4857_write_regs(); + return 1; +} + +static const struct snd_soc_dapm_widget wm8753_dapm_widgets[] = { + SND_SOC_DAPM_LINE("Audio Out", NULL), + SND_SOC_DAPM_LINE("GSM Line Out", NULL), + SND_SOC_DAPM_LINE("GSM Line In", NULL), + SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_MIC("Call Mic", NULL), +}; + + +/* example machine audio_mapnections */ +static const char* audio_map[][3] = { + + /* Connections to the lm4857 amp */ + {"Audio Out", NULL, "LOUT1"}, + {"Audio Out", NULL, "ROUT1"}, + + /* Connections to the GSM Module */ + {"GSM Line Out", NULL, "MONO1"}, + {"GSM Line Out", NULL, "MONO2"}, + {"RXP", NULL, "GSM Line In"}, + {"RXN", NULL, "GSM Line In"}, + + /* Connections to Headset */ + {"MIC1", NULL, "Mic Bias"}, + {"Mic Bias", NULL, "Headset Mic"}, + + /* Call Mic */ + {"MIC2", NULL, "Mic Bias"}, + {"MIC2N", NULL, "Mic Bias"}, + {"Mic Bias", NULL, "Call Mic"}, + + /* Connect the ALC pins */ + {"ACIN", NULL, "ACOP"}, + + {NULL, NULL, NULL}, +}; + +static const char *lm4857_mode[] = { + "Off", + "Call Speaker", + "Stereo Speakers", + "Stereo Speakers + Headphones", + "Headphones" +}; + +static const struct soc_enum lm4857_mode_enum[] = { + SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(lm4857_mode), lm4857_mode), +}; + +static const char *neo_scenarios[] = { + "Off", + "GSM Handset", + "GSM Headset", + "GSM Bluetooth", + "Speakers", + "Headphones", + "Capture Handset", + "Capture Headset", + "Capture Bluetooth" +}; + +static const struct soc_enum neo_scenario_enum[] = { + SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(neo_scenarios),neo_scenarios), +}; + +static const struct snd_kcontrol_new wm8753_neo1973_controls[] = { + SOC_SINGLE_EXT("Amp Left Playback Volume", LM4857_LVOL, 0, 31, 0, + lm4857_get_reg, lm4857_set_reg), + SOC_SINGLE_EXT("Amp Right Playback Volume", LM4857_RVOL, 0, 31, 0, + lm4857_get_reg, lm4857_set_reg), + SOC_SINGLE_EXT("Amp Mono Playback Volume", LM4857_MVOL, 0, 31, 0, + lm4857_get_reg, lm4857_set_reg), + SOC_ENUM_EXT("Amp Mode", lm4857_mode_enum[0], + lm4857_get_mode, lm4857_set_mode), + SOC_ENUM_EXT("Neo Mode", neo_scenario_enum[0], + neo1973_get_scenario, neo1973_set_scenario), + SOC_SINGLE_EXT("Amp Spk 3D Playback Switch", LM4857_LVOL, 5, 1, 0, + lm4857_get_reg, lm4857_set_reg), + SOC_SINGLE_EXT("Amp HP 3d Playback Switch", LM4857_RVOL, 5, 1, 0, + lm4857_get_reg, lm4857_set_reg), + SOC_SINGLE_EXT("Amp Fast Wakeup Playback Switch", LM4857_CTRL, 5, 1, 0, + lm4857_get_reg, lm4857_set_reg), + SOC_SINGLE_EXT("Amp Earpiece 6dB Playback Switch", LM4857_CTRL, 4, 1, 0, + lm4857_get_reg, lm4857_set_reg), +}; + +/* + * This is an example machine initialisation for a wm8753 connected to a + * neo1973 II. It is missing logic to detect hp/mic insertions and logic + * to re-route the audio in such an event. + */ +static int neo1973_wm8753_init(struct snd_soc_codec *codec) +{ + int i, err; + + /* set up NC codec pins */ + snd_soc_dapm_set_endpoint(codec, "LOUT2", 0); + snd_soc_dapm_set_endpoint(codec, "ROUT2", 0); + snd_soc_dapm_set_endpoint(codec, "OUT3", 0); + snd_soc_dapm_set_endpoint(codec, "OUT4", 0); + snd_soc_dapm_set_endpoint(codec, "LINE1", 0); + snd_soc_dapm_set_endpoint(codec, "LINE2", 0); + + + /* set endpoints to default mode */ + set_scenario_endpoints(codec, NEO_AUDIO_OFF); + + /* Add neo1973 specific widgets */ + for (i = 0; i < ARRAY_SIZE(wm8753_dapm_widgets); i++) + snd_soc_dapm_new_control(codec, &wm8753_dapm_widgets[i]); + + /* add neo1973 specific controls */ + for (i = 0; i < ARRAY_SIZE(wm8753_neo1973_controls); i++) { + err = snd_ctl_add(codec->card, + snd_soc_cnew(&wm8753_neo1973_controls[i], + codec, NULL)); + if (err < 0) + return err; + } + + /* set up neo1973 specific audio path audio_mapnects */ + for (i = 0; audio_map[i][0] != NULL; i++) { + snd_soc_dapm_connect_input(codec, audio_map[i][0], + audio_map[i][1], audio_map[i][2]); + } + + snd_soc_dapm_sync_endpoints(codec); + return 0; +} + +/* + * BT Codec DAI + */ +static struct snd_soc_cpu_dai bt_dai = +{ .name = "Bluetooth", + .id = 0, + .type = SND_SOC_DAI_PCM, + .playback = { + .channels_min = 1, + .channels_max = 1, + .rates = SNDRV_PCM_RATE_8000, + .formats = SNDRV_PCM_FMTBIT_S16_LE,}, + .capture = { + .channels_min = 1, + .channels_max = 1, + .rates = SNDRV_PCM_RATE_8000, + .formats = SNDRV_PCM_FMTBIT_S16_LE,}, +}; + +static struct snd_soc_dai_link neo1973_dai[] = { +{ /* Hifi Playback - for similatious use with voice below */ + .name = "WM8753", + .stream_name = "WM8753 HiFi", + .cpu_dai = &s3c24xx_i2s_dai, + .codec_dai = &wm8753_dai[WM8753_DAI_HIFI], + .init = neo1973_wm8753_init, + .ops = &neo1973_hifi_ops, +}, +{ /* Voice via BT */ + .name = "Bluetooth", + .stream_name = "Voice", + .cpu_dai = &bt_dai, + .codec_dai = &wm8753_dai[WM8753_DAI_VOICE], + .ops = &neo1973_voice_ops, +}, +}; + +static struct snd_soc_machine neo1973 = { + .name = "neo1973", + .dai_link = neo1973_dai, + .num_links = ARRAY_SIZE(neo1973_dai), +}; + +static struct wm8753_setup_data neo1973_wm8753_setup = { + .i2c_address = 0x1a, +}; + +static struct snd_soc_device neo1973_snd_devdata = { + .machine = &neo1973, + .platform = &s3c24xx_soc_platform, + .codec_dev = &soc_codec_dev_wm8753, + .codec_data = &neo1973_wm8753_setup, +}; + +static struct i2c_client client_template; + +static unsigned short normal_i2c[] = { 0x7C, I2C_CLIENT_END }; + +/* Magic definition of all other variables and things */ +I2C_CLIENT_INSMOD; + +static int lm4857_amp_probe(struct i2c_adapter *adap, int addr, int kind) +{ + int ret; + + client_template.adapter = adap; + client_template.addr = addr; + + i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); + if (i2c == NULL) + return -ENOMEM; + + ret = i2c_attach_client(i2c); + if (ret < 0) { + printk(KERN_ERR "LM4857 failed to attach at addr %x\n", addr); + goto exit_err; + } + + lm4857_write_regs(); + return ret; + +exit_err: + kfree(i2c); + return ret; +} + +static int lm4857_i2c_detach(struct i2c_client *client) +{ + i2c_detach_client(client); + kfree(client); + return 0; +} + +static int lm4857_i2c_attach(struct i2c_adapter *adap) +{ + return i2c_probe(adap, &addr_data, lm4857_amp_probe); +} + +/* corgi i2c codec control layer */ +static struct i2c_driver lm4857_i2c_driver = { + .driver = { + .name = "LM4857 I2C Amp", + .owner = THIS_MODULE, + }, + .id = I2C_DRIVERID_LM4857, + .attach_adapter = lm4857_i2c_attach, + .detach_client = lm4857_i2c_detach, + .command = NULL, +}; + +static struct i2c_client client_template = { + .name = "LM4857", + .driver = &lm4857_i2c_driver, +}; + +static struct platform_device *neo1973_snd_device; + +static int __init neo1973_init(void) +{ + int ret; + + neo1973_snd_device = platform_device_alloc("soc-audio", -1); + if (!neo1973_snd_device) + return -ENOMEM; + + platform_set_drvdata(neo1973_snd_device, &neo1973_snd_devdata); + neo1973_snd_devdata.dev = &neo1973_snd_device->dev; + ret = platform_device_add(neo1973_snd_device); + + if (ret) + platform_device_put(neo1973_snd_device); + + ret = i2c_add_driver(&lm4857_i2c_driver); + if (ret != 0) + printk(KERN_ERR "can't add i2c driver"); + + return ret; +} + +static void __exit neo1973_exit(void) +{ + platform_device_unregister(neo1973_snd_device); +} + +module_init(neo1973_init); +module_exit(neo1973_exit); + +/* Module information */ +MODULE_AUTHOR("Graeme Gregory, graeme.gregory@wolfsonmicro.com, www.wolfsonmicro.com"); +MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973"); +MODULE_LICENSE("GPL"); diff --git a/sound/soc/s3c24xx/s3c2443-ac97.c b/sound/soc/s3c24xx/s3c2443-ac97.c new file mode 100644 index 00000000000..75acf7ef552 --- /dev/null +++ b/sound/soc/s3c24xx/s3c2443-ac97.c @@ -0,0 +1,401 @@ +/* + * s3c2443-ac97.c -- ALSA Soc Audio Layer + * + * (c) 2007 Wolfson Microelectronics PLC. + * Graeme Gregory graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com + * + * Copyright (C) 2005, Sean Choi <sh428.choi@samsung.com> + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Revision history + * 21st Mar 2007 Initial Version + */ + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/interrupt.h> +#include <linux/wait.h> +#include <linux/delay.h> +#include <linux/clk.h> + +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/ac97_codec.h> +#include <sound/initval.h> +#include <sound/soc.h> + +#include <asm/hardware.h> +#include <asm/io.h> +#include <asm/arch/regs-ac97.h> +#include <asm/arch/regs-gpio.h> +#include <asm/arch/regs-clock.h> +#include <asm/arch/audio.h> +#include <asm/dma.h> +#include <asm/arch/dma.h> + +#include "s3c24xx-pcm.h" +#include "s3c24xx-ac97.h" + +struct s3c24xx_ac97_info { + void __iomem *regs; + struct clk *ac97_clk; +}; +static struct s3c24xx_ac97_info s3c24xx_ac97; + +DECLARE_COMPLETION(ac97_completion); +static u32 codec_ready; +static DECLARE_MUTEX(ac97_mutex); + +static unsigned short s3c2443_ac97_read(struct snd_ac97 *ac97, + unsigned short reg) +{ + u32 ac_glbctrl; + u32 ac_codec_cmd; + u32 stat, addr, data; + + down(&ac97_mutex); + + codec_ready = S3C_AC97_GLBSTAT_CODECREADY; + ac_codec_cmd = readl(s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); + ac_codec_cmd = S3C_AC97_CODEC_CMD_READ | AC_CMD_ADDR(reg); + writel(ac_codec_cmd, s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); + + udelay(50); + + ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + ac_glbctrl |= S3C_AC97_GLBCTRL_CODECREADYIE; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + + wait_for_completion(&ac97_completion); + + stat = readl(s3c24xx_ac97.regs + S3C_AC97_STAT); + addr = (stat >> 16) & 0x7f; + data = (stat & 0xffff); + + if (addr != reg) + printk(KERN_ERR "s3c24xx-ac97: req addr = %02x," + " rep addr = %02x\n", reg, addr); + + up(&ac97_mutex); + + return (unsigned short)data; +} + +static void s3c2443_ac97_write(struct snd_ac97 *ac97, unsigned short reg, + unsigned short val) +{ + u32 ac_glbctrl; + u32 ac_codec_cmd; + + down(&ac97_mutex); + + codec_ready = S3C_AC97_GLBSTAT_CODECREADY; + ac_codec_cmd = readl(s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); + ac_codec_cmd = AC_CMD_ADDR(reg) | AC_CMD_DATA(val); + writel(ac_codec_cmd, s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); + + udelay(50); + + ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + ac_glbctrl |= S3C_AC97_GLBCTRL_CODECREADYIE; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + + wait_for_completion(&ac97_completion); + + ac_codec_cmd = readl(s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); + ac_codec_cmd |= S3C_AC97_CODEC_CMD_READ; + writel(ac_codec_cmd, s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD); + + up(&ac97_mutex); + +} + +static void s3c2443_ac97_warm_reset(struct snd_ac97 *ac97) +{ + u32 ac_glbctrl; + + ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + ac_glbctrl = S3C_AC97_GLBCTRL_WARMRESET; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + msleep(1); + + ac_glbctrl = 0; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + msleep(1); +} + +static void s3c2443_ac97_cold_reset(struct snd_ac97 *ac97) +{ + u32 ac_glbctrl; + + ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + ac_glbctrl = S3C_AC97_GLBCTRL_COLDRESET; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + msleep(1); + + ac_glbctrl = 0; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + msleep(1); + + ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + ac_glbctrl = S3C_AC97_GLBCTRL_ACLINKON; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + msleep(1); + + ac_glbctrl |= S3C_AC97_GLBCTRL_TRANSFERDATAENABLE; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + msleep(1); + + ac_glbctrl |= S3C_AC97_GLBCTRL_PCMOUTTM_DMA | + S3C_AC97_GLBCTRL_PCMINTM_DMA | S3C_AC97_GLBCTRL_MICINTM_DMA; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); +} + +static irqreturn_t s3c2443_ac97_irq(int irq, void *dev_id) +{ + int status; + u32 ac_glbctrl; + + status = readl(s3c24xx_ac97.regs + S3C_AC97_GLBSTAT) & codec_ready; + + if (status) { + ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + ac_glbctrl &= ~S3C_AC97_GLBCTRL_CODECREADYIE; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + complete(&ac97_completion); + } + return IRQ_HANDLED; +} + +struct snd_ac97_bus_ops soc_ac97_ops = { + .read = s3c2443_ac97_read, + .write = s3c2443_ac97_write, + .warm_reset = s3c2443_ac97_warm_reset, + .reset = s3c2443_ac97_cold_reset, +}; + +static struct s3c2410_dma_client s3c2443_dma_client_out = { + .name = "AC97 PCM Stereo out" +}; + +static struct s3c2410_dma_client s3c2443_dma_client_in = { + .name = "AC97 PCM Stereo in" +}; + +static struct s3c2410_dma_client s3c2443_dma_client_micin = { + .name = "AC97 Mic Mono in" +}; + +static struct s3c24xx_pcm_dma_params s3c2443_ac97_pcm_stereo_out = { + .client = &s3c2443_dma_client_out, + .channel = DMACH_PCM_OUT, + .dma_addr = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA, + .dma_size = 4, +}; + +static struct s3c24xx_pcm_dma_params s3c2443_ac97_pcm_stereo_in = { + .client = &s3c2443_dma_client_in, + .channel = DMACH_PCM_IN, + .dma_addr = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA, + .dma_size = 4, +}; + +static struct s3c24xx_pcm_dma_params s3c2443_ac97_mic_mono_in = { + .client = &s3c2443_dma_client_micin, + .channel = DMACH_MIC_IN, + .dma_addr = S3C2440_PA_AC97 + S3C_AC97_MIC_DATA, + .dma_size = 4, +}; + +static int s3c2443_ac97_probe(struct platform_device *pdev) +{ + int ret; + u32 ac_glbctrl; + + s3c24xx_ac97.regs = ioremap(S3C2440_PA_AC97, 0x100); + if (s3c24xx_ac97.regs == NULL) + return -ENXIO; + + s3c24xx_ac97.ac97_clk = clk_get(&pdev->dev, "ac97"); + if (s3c24xx_ac97.ac97_clk == NULL) { + printk(KERN_ERR "s3c2443-ac97 failed to get ac97_clock\n"); + iounmap(s3c24xx_ac97.regs); + return -ENODEV; + } + clk_enable(s3c24xx_ac97.ac97_clk); + + s3c2410_gpio_cfgpin(S3C2410_GPE0, S3C2443_GPE0_AC_nRESET); + s3c2410_gpio_cfgpin(S3C2410_GPE1, S3C2443_GPE1_AC_SYNC); + s3c2410_gpio_cfgpin(S3C2410_GPE2, S3C2443_GPE2_AC_BITCLK); + s3c2410_gpio_cfgpin(S3C2410_GPE3, S3C2443_GPE3_AC_SDI); + s3c2410_gpio_cfgpin(S3C2410_GPE4, S3C2443_GPE4_AC_SDO); + + ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + ac_glbctrl = S3C_AC97_GLBCTRL_COLDRESET; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + msleep(1); + + ac_glbctrl = 0; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + msleep(1); + + ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + ac_glbctrl = S3C_AC97_GLBCTRL_ACLINKON; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + msleep(1); + + ac_glbctrl |= S3C_AC97_GLBCTRL_TRANSFERDATAENABLE; + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + + ret = request_irq(IRQ_S3C2443_AC97, s3c2443_ac97_irq, + IRQF_DISABLED, "AC97", NULL); + if (ret < 0) { + printk(KERN_ERR "s3c24xx-ac97: interrupt request failed.\n"); + clk_disable(s3c24xx_ac97.ac97_clk); + clk_put(s3c24xx_ac97.ac97_clk); + iounmap(s3c24xx_ac97.regs); + } + return ret; +} + +static void s3c2443_ac97_remove(struct platform_device *pdev) +{ + free_irq(IRQ_S3C2443_AC97, NULL); + clk_disable(s3c24xx_ac97.ac97_clk); + clk_put(s3c24xx_ac97.ac97_clk); + iounmap(s3c24xx_ac97.regs); +} + +static int s3c2443_ac97_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai; + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + cpu_dai->dma_data = &s3c2443_ac97_pcm_stereo_out; + else + cpu_dai->dma_data = &s3c2443_ac97_pcm_stereo_in; + + return 0; +} + +static int s3c2443_ac97_trigger(struct snd_pcm_substream *substream, int cmd) +{ + u32 ac_glbctrl; + + ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + switch(cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + ac_glbctrl |= S3C_AC97_GLBCTRL_PCMINTM_DMA; + else + ac_glbctrl |= S3C_AC97_GLBCTRL_PCMOUTTM_DMA; + break; + case SNDRV_PCM_TRIGGER_STOP: + case SNDRV_PCM_TRIGGER_SUSPEND: + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + ac_glbctrl &= ~S3C_AC97_GLBCTRL_PCMINTM_MASK; + else + ac_glbctrl &= ~S3C_AC97_GLBCTRL_PCMOUTTM_MASK; + break; + } + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + + return 0; +} + +static int s3c2443_ac97_hw_mic_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai; + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + return -ENODEV; + else + cpu_dai->dma_data = &s3c2443_ac97_mic_mono_in; + + return 0; +} + +static int s3c2443_ac97_mic_trigger(struct snd_pcm_substream *substream, + int cmd) +{ + u32 ac_glbctrl; + + ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + switch(cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + ac_glbctrl |= S3C_AC97_GLBCTRL_PCMINTM_DMA; + break; + case SNDRV_PCM_TRIGGER_STOP: + case SNDRV_PCM_TRIGGER_SUSPEND: + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + ac_glbctrl &= ~S3C_AC97_GLBCTRL_PCMINTM_MASK; + } + writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); + + return 0; +} + +#define s3c2443_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \ + SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) + +struct snd_soc_cpu_dai s3c2443_ac97_dai[] = { +{ + .name = "s3c2443-ac97", + .id = 0, + .type = SND_SOC_DAI_AC97, + .probe = s3c2443_ac97_probe, + .remove = s3c2443_ac97_remove, + .playback = { + .stream_name = "AC97 Playback", + .channels_min = 2, + .channels_max = 2, + .rates = s3c2443_AC97_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE,}, + .capture = { + .stream_name = "AC97 Capture", + .channels_min = 2, + .channels_max = 2, + .rates = s3c2443_AC97_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE,}, + .ops = { + .hw_params = s3c2443_ac97_hw_params, + .trigger = s3c2443_ac97_trigger}, +}, +{ + .name = "pxa2xx-ac97-mic", + .id = 1, + .type = SND_SOC_DAI_AC97, + .capture = { + .stream_name = "AC97 Mic Capture", + .channels_min = 1, + .channels_max = 1, + .rates = s3c2443_AC97_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE,}, + .ops = { + .hw_params = s3c2443_ac97_hw_mic_params, + .trigger = s3c2443_ac97_mic_trigger,}, +}, +}; + +EXPORT_SYMBOL_GPL(s3c2443_ac97_dai); +EXPORT_SYMBOL_GPL(soc_ac97_ops); + +MODULE_AUTHOR("Graeme Gregory"); +MODULE_DESCRIPTION("AC97 driver for the Samsung s3c2443 chip"); +MODULE_LICENSE("GPL"); diff --git a/sound/soc/s3c24xx/s3c24xx-ac97.h b/sound/soc/s3c24xx/s3c24xx-ac97.h new file mode 100644 index 00000000000..2b835e8260f --- /dev/null +++ b/sound/soc/s3c24xx/s3c24xx-ac97.h @@ -0,0 +1,25 @@ +/* + * s3c24xx-ac97.c -- ALSA Soc Audio Layer + * + * (c) 2007 Wolfson Microelectronics PLC. + * Author: Graeme Gregory + * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * Revision history + * 10th Nov 2006 Initial version. + */ + +#ifndef S3C24XXAC97_H_ +#define S3C24XXAC97_H_ + +#define AC_CMD_ADDR(x) (x << 16) +#define AC_CMD_DATA(x) (x & 0xffff) + +extern struct snd_soc_cpu_dai s3c2443_ac97_dai[]; + +#endif /*S3C24XXAC97_H_*/ diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c index 8ca314dc889..39f02462e07 100644 --- a/sound/soc/s3c24xx/s3c24xx-i2s.c +++ b/sound/soc/s3c24xx/s3c24xx-i2s.c @@ -344,11 +344,11 @@ static int s3c24xx_i2s_set_clkdiv(struct snd_soc_cpu_dai *cpu_dai, DBG("Entered %s\n", __FUNCTION__); switch (div_id) { - case S3C24XX_DIV_MCLK: + case S3C24XX_DIV_BCLK: reg = readl(s3c24xx_i2s.regs + S3C2410_IISMOD) & ~S3C2410_IISMOD_FS_MASK; writel(reg | div, s3c24xx_i2s.regs + S3C2410_IISMOD); break; - case S3C24XX_DIV_BCLK: + case S3C24XX_DIV_MCLK: reg = readl(s3c24xx_i2s.regs + S3C2410_IISMOD) & ~(S3C2410_IISMOD_384FS); writel(reg | div, s3c24xx_i2s.regs + S3C2410_IISMOD); break; diff --git a/sound/soc/s3c24xx/smdk2443_wm9710.c b/sound/soc/s3c24xx/smdk2443_wm9710.c new file mode 100644 index 00000000000..d46cd811ceb --- /dev/null +++ b/sound/soc/s3c24xx/smdk2443_wm9710.c @@ -0,0 +1,85 @@ +/* + * smdk2443_wm9710.c -- SoC audio for smdk2443 + * + * Copyright 2007 Wolfson Microelectronics PLC. + * Author: Graeme Gregory + * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * Revision history + * 8th Mar 2007 Initial version. + * + */ + +#include <linux/module.h> +#include <linux/device.h> +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/soc.h> +#include <sound/soc-dapm.h> + +#include "../codecs/ac97.h" +#include "s3c24xx-pcm.h" +#include "s3c24xx-ac97.h" + +static struct snd_soc_machine smdk2443; + +static struct snd_soc_dai_link smdk2443_dai[] = { +{ + .name = "AC97", + .stream_name = "AC97 HiFi", + .cpu_dai = &s3c2443_ac97_dai[0], + .codec_dai = &ac97_dai, +}, +}; + +static struct snd_soc_machine smdk2443 = { + .name = "SMDK2443", + .dai_link = smdk2443_dai, + .num_links = ARRAY_SIZE(smdk2443_dai), +}; + +static struct snd_soc_device smdk2443_snd_ac97_devdata = { + .machine = &smdk2443, + .platform = &s3c24xx_soc_platform, + .codec_dev = &soc_codec_dev_ac97, +}; + +static struct platform_device *smdk2443_snd_ac97_device; + +static int __init smdk2443_init(void) +{ + int ret; + + smdk2443_snd_ac97_device = platform_device_alloc("soc-audio", -1); + if (!smdk2443_snd_ac97_device) + return -ENOMEM; + + platform_set_drvdata(smdk2443_snd_ac97_device, + &smdk2443_snd_ac97_devdata); + smdk2443_snd_ac97_devdata.dev = &smdk2443_snd_ac97_device->dev; + ret = platform_device_add(smdk2443_snd_ac97_device); + + if (ret) + platform_device_put(smdk2443_snd_ac97_device); + + return ret; +} + +static void __exit smdk2443_exit(void) +{ + platform_device_unregister(smdk2443_snd_ac97_device); +} + +module_init(smdk2443_init); +module_exit(smdk2443_exit); + +/* Module information */ +MODULE_AUTHOR("Graeme Gregory, graeme.gregory@wolfsonmicro.com, www.wolfsonmicro.com"); +MODULE_DESCRIPTION("ALSA SoC WM9710 SMDK2443"); +MODULE_LICENSE("GPL"); diff --git a/sound/soc/sh/Kconfig b/sound/soc/sh/Kconfig new file mode 100644 index 00000000000..f03220d23e7 --- /dev/null +++ b/sound/soc/sh/Kconfig @@ -0,0 +1,38 @@ +menu "SoC Audio support for SuperH" + +config SND_SOC_PCM_SH7760 + tristate "SoC Audio support for Renesas SH7760" + depends on CPU_SUBTYPE_SH7760 && SND_SOC && SH_DMABRG + help + Enable this option for SH7760 AC97/I2S audio support. + + +## +## Audio unit modules +## + +config SND_SOC_SH4_HAC + select AC97_BUS + select SND_SOC_AC97_BUS + select SND_AC97_CODEC + tristate + +config SND_SOC_SH4_SSI + tristate + + + +## +## Boards +## + +config SND_SH7760_AC97 + tristate "SH7760 AC97 sound support" + depends on CPU_SUBTYPE_SH7760 && SND_SOC_PCM_SH7760 + select SND_SOC_SH4_HAC + select SND_SOC_AC97_CODEC + help + This option enables generic sound support for the first + AC97 unit of the SH7760. + +endmenu diff --git a/sound/soc/sh/Makefile b/sound/soc/sh/Makefile new file mode 100644 index 00000000000..a8e8ab81cc6 --- /dev/null +++ b/sound/soc/sh/Makefile @@ -0,0 +1,14 @@ +## DMA engines +snd-soc-dma-sh7760-objs := dma-sh7760.o +obj-$(CONFIG_SND_SOC_PCM_SH7760) += snd-soc-dma-sh7760.o + +## audio units found on some SH-4 +snd-soc-hac-objs := hac.o +snd-soc-ssi-objs := ssi.o +obj-$(CONFIG_SND_SOC_SH4_HAC) += snd-soc-hac.o +obj-$(CONFIG_SND_SOC_SH4_SSI) += snd-soc-ssi.o + +## boards +snd-soc-sh7760-ac97-objs := sh7760-ac97.o + +obj-$(CONFIG_SND_SH7760_AC97) += snd-soc-sh7760-ac97.o diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c new file mode 100644 index 00000000000..cdee374b843 --- /dev/null +++ b/sound/soc/sh/dma-sh7760.c @@ -0,0 +1,354 @@ +/* + * SH7760 ("camelot") DMABRG audio DMA unit support + * + * Copyright (C) 2007 Manuel Lauss <mano@roarinelk.homelinux.net> + * licensed under the terms outlined in the file COPYING at the root + * of the linux kernel sources. + * + * The SH7760 DMABRG provides 4 dma channels (2x rec, 2x play), which + * trigger an interrupt when one half of the programmed transfer size + * has been xmitted. + * + * FIXME: little-endian only for now + */ + +#include <linux/module.h> +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/dma-mapping.h> +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/pcm_params.h> +#include <sound/soc.h> +#include <asm/dmabrg.h> + + +/* registers and bits */ +#define BRGATXSAR 0x00 +#define BRGARXDAR 0x04 +#define BRGATXTCR 0x08 +#define BRGARXTCR 0x0C +#define BRGACR 0x10 +#define BRGATXTCNT 0x14 +#define BRGARXTCNT 0x18 + +#define ACR_RAR (1 << 18) +#define ACR_RDS (1 << 17) +#define ACR_RDE (1 << 16) +#define ACR_TAR (1 << 2) +#define ACR_TDS (1 << 1) +#define ACR_TDE (1 << 0) + +/* receiver/transmitter data alignment */ +#define ACR_RAM_NONE (0 << 24) +#define ACR_RAM_4BYTE (1 << 24) +#define ACR_RAM_2WORD (2 << 24) +#define ACR_TAM_NONE (0 << 8) +#define ACR_TAM_4BYTE (1 << 8) +#define ACR_TAM_2WORD (2 << 8) + + +struct camelot_pcm { + unsigned long mmio; /* DMABRG audio channel control reg MMIO */ + unsigned int txid; /* ID of first DMABRG IRQ for this unit */ + + struct snd_pcm_substream *tx_ss; + unsigned long tx_period_size; + unsigned int tx_period; + + struct snd_pcm_substream *rx_ss; + unsigned long rx_period_size; + unsigned int rx_period; + +} cam_pcm_data[2] = { + { + .mmio = 0xFE3C0040, + .txid = DMABRGIRQ_A0TXF, + }, + { + .mmio = 0xFE3C0060, + .txid = DMABRGIRQ_A1TXF, + }, +}; + +#define BRGREG(x) (*(unsigned long *)(cam->mmio + (x))) + +/* + * set a minimum of 16kb per period, to avoid interrupt-"storm" and + * resulting skipping. In general, the bigger the minimum size, the + * better for overall system performance. (The SH7760 is a puny CPU + * with a slow SDRAM interface and poor internal bus bandwidth, + * *especially* when the LCDC is active). The minimum for the DMAC + * is 8 bytes; 16kbytes are enough to get skip-free playback of a + * 44kHz/16bit/stereo MP3 on a lightly loaded system, and maintain + * reasonable responsiveness in MPlayer. + */ +#define DMABRG_PERIOD_MIN 16 * 1024 +#define DMABRG_PERIOD_MAX 0x03fffffc +#define DMABRG_PREALLOC_BUFFER 32 * 1024 +#define DMABRG_PREALLOC_BUFFER_MAX 32 * 1024 + +/* support everything the SSI supports */ +#define DMABRG_RATES \ + SNDRV_PCM_RATE_8000_192000 + +#define DMABRG_FMTS \ + (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | \ + SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE | \ + SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_U20_3LE | \ + SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_U24_3LE | \ + SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_U32_LE) + +static struct snd_pcm_hardware camelot_pcm_hardware = { + .info = (SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_MMAP_VALID), + .formats = DMABRG_FMTS, + .rates = DMABRG_RATES, + .rate_min = 8000, + .rate_max = 192000, + .channels_min = 2, + .channels_max = 8, /* max of the SSI */ + .buffer_bytes_max = DMABRG_PERIOD_MAX, + .period_bytes_min = DMABRG_PERIOD_MIN, + .period_bytes_max = DMABRG_PERIOD_MAX / 2, + .periods_min = 2, + .periods_max = 2, + .fifo_size = 128, +}; + +static void camelot_txdma(void *data) +{ + struct camelot_pcm *cam = data; + cam->tx_period ^= 1; + snd_pcm_period_elapsed(cam->tx_ss); +} + +static void camelot_rxdma(void *data) +{ + struct camelot_pcm *cam = data; + cam->rx_period ^= 1; + snd_pcm_period_elapsed(cam->rx_ss); +} + +static int camelot_pcm_open(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct camelot_pcm *cam = &cam_pcm_data[rtd->dai->cpu_dai->id]; + int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int ret, dmairq; + + snd_soc_set_runtime_hwparams(substream, &camelot_pcm_hardware); + + /* DMABRG buffer half/full events */ + dmairq = (recv) ? cam->txid + 2 : cam->txid; + if (recv) { + cam->rx_ss = substream; + ret = dmabrg_request_irq(dmairq, camelot_rxdma, cam); + if (unlikely(ret)) { + pr_debug("audio unit %d irqs already taken!\n", + rtd->dai->cpu_dai->id); + return -EBUSY; + } + (void)dmabrg_request_irq(dmairq + 1,camelot_rxdma, cam); + } else { + cam->tx_ss = substream; + ret = dmabrg_request_irq(dmairq, camelot_txdma, cam); + if (unlikely(ret)) { + pr_debug("audio unit %d irqs already taken!\n", + rtd->dai->cpu_dai->id); + return -EBUSY; + } + (void)dmabrg_request_irq(dmairq + 1, camelot_txdma, cam); + } + return 0; +} + +static int camelot_pcm_close(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct camelot_pcm *cam = &cam_pcm_data[rtd->dai->cpu_dai->id]; + int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int dmairq; + + dmairq = (recv) ? cam->txid + 2 : cam->txid; + + if (recv) + cam->rx_ss = NULL; + else + cam->tx_ss = NULL; + + dmabrg_free_irq(dmairq + 1); + dmabrg_free_irq(dmairq); + + return 0; +} + +static int camelot_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct camelot_pcm *cam = &cam_pcm_data[rtd->dai->cpu_dai->id]; + int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int ret; + + ret = snd_pcm_lib_malloc_pages(substream, + params_buffer_bytes(hw_params)); + if (ret < 0) + return ret; + + if (recv) { + cam->rx_period_size = params_period_bytes(hw_params); + cam->rx_period = 0; + } else { + cam->tx_period_size = params_period_bytes(hw_params); + cam->tx_period = 0; + } + return 0; +} + +static int camelot_hw_free(struct snd_pcm_substream *substream) +{ + return snd_pcm_lib_free_pages(substream); +} + +static int camelot_prepare(struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct camelot_pcm *cam = &cam_pcm_data[rtd->dai->cpu_dai->id]; + + pr_debug("PCM data: addr 0x%08ulx len %d\n", + (u32)runtime->dma_addr, runtime->dma_bytes); + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + BRGREG(BRGATXSAR) = (unsigned long)runtime->dma_area; + BRGREG(BRGATXTCR) = runtime->dma_bytes; + } else { + BRGREG(BRGARXDAR) = (unsigned long)runtime->dma_area; + BRGREG(BRGARXTCR) = runtime->dma_bytes; + } + + return 0; +} + +static inline void dmabrg_play_dma_start(struct camelot_pcm *cam) +{ + unsigned long acr = BRGREG(BRGACR) & ~(ACR_TDS | ACR_RDS); + /* start DMABRG engine: XFER start, auto-addr-reload */ + BRGREG(BRGACR) = acr | ACR_TDE | ACR_TAR | ACR_TAM_2WORD; +} + +static inline void dmabrg_play_dma_stop(struct camelot_pcm *cam) +{ + unsigned long acr = BRGREG(BRGACR) & ~(ACR_TDS | ACR_RDS); + /* forcibly terminate data transmission */ + BRGREG(BRGACR) = acr | ACR_TDS; +} + +static inline void dmabrg_rec_dma_start(struct camelot_pcm *cam) +{ + unsigned long acr = BRGREG(BRGACR) & ~(ACR_TDS | ACR_RDS); + /* start DMABRG engine: recv start, auto-reload */ + BRGREG(BRGACR) = acr | ACR_RDE | ACR_RAR | ACR_RAM_2WORD; +} + +static inline void dmabrg_rec_dma_stop(struct camelot_pcm *cam) +{ + unsigned long acr = BRGREG(BRGACR) & ~(ACR_TDS | ACR_RDS); + /* forcibly terminate data receiver */ + BRGREG(BRGACR) = acr | ACR_RDS; +} + +static int camelot_trigger(struct snd_pcm_substream *substream, int cmd) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct camelot_pcm *cam = &cam_pcm_data[rtd->dai->cpu_dai->id]; + int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + if (recv) + dmabrg_rec_dma_start(cam); + else + dmabrg_play_dma_start(cam); + break; + case SNDRV_PCM_TRIGGER_STOP: + if (recv) + dmabrg_rec_dma_stop(cam); + else + dmabrg_play_dma_stop(cam); + break; + default: + return -EINVAL; + } + + return 0; +} + +static snd_pcm_uframes_t camelot_pos(struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct camelot_pcm *cam = &cam_pcm_data[rtd->dai->cpu_dai->id]; + int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + unsigned long pos; + + /* cannot use the DMABRG pointer register: under load, by the + * time ALSA comes around to read the register, it is already + * far ahead (or worse, already done with the fragment) of the + * position at the time the IRQ was triggered, which results in + * fast-playback sound in my test application (ScummVM) + */ + if (recv) + pos = cam->rx_period ? cam->rx_period_size : 0; + else + pos = cam->tx_period ? cam->tx_period_size : 0; + + return bytes_to_frames(runtime, pos); +} + +static struct snd_pcm_ops camelot_pcm_ops = { + .open = camelot_pcm_open, + .close = camelot_pcm_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = camelot_hw_params, + .hw_free = camelot_hw_free, + .prepare = camelot_prepare, + .trigger = camelot_trigger, + .pointer = camelot_pos, +}; + +static void camelot_pcm_free(struct snd_pcm *pcm) +{ + snd_pcm_lib_preallocate_free_for_all(pcm); +} + +static int camelot_pcm_new(struct snd_card *card, + struct snd_soc_codec_dai *dai, + struct snd_pcm *pcm) +{ + /* dont use SNDRV_DMA_TYPE_DEV, since it will oops the SH kernel + * in MMAP mode (i.e. aplay -M) + */ + snd_pcm_lib_preallocate_pages_for_all(pcm, + SNDRV_DMA_TYPE_CONTINUOUS, + snd_dma_continuous_data(GFP_KERNEL), + DMABRG_PREALLOC_BUFFER, DMABRG_PREALLOC_BUFFER_MAX); + + return 0; +} + +struct snd_soc_platform sh7760_soc_platform = { + .name = "sh7760-pcm", + .pcm_ops = &camelot_pcm_ops, + .pcm_new = camelot_pcm_new, + .pcm_free = camelot_pcm_free, +}; +EXPORT_SYMBOL_GPL(sh7760_soc_platform); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("SH7760 Audio DMA (DMABRG) driver"); +MODULE_AUTHOR("Manuel Lauss <mano@roarinelk.homelinux.net>"); diff --git a/sound/soc/sh/hac.c b/sound/soc/sh/hac.c new file mode 100644 index 00000000000..8e3f03908cd --- /dev/null +++ b/sound/soc/sh/hac.c @@ -0,0 +1,322 @@ +/* + * Hitachi Audio Controller (AC97) support for SH7760/SH7780 + * + * Copyright (c) 2007 Manuel Lauss <mano@roarinelk.homelinux.net> + * licensed under the terms outlined in the file COPYING at the root + * of the linux kernel sources. + * + * dont forget to set IPSEL/OMSEL register bits (in your board code) to + * enable HAC output pins! + */ + +/* BIG FAT FIXME: although the SH7760 has 2 independent AC97 units, only + * the FIRST can be used since ASoC does not pass any information to the + * ac97_read/write() functions regarding WHICH unit to use. You'll have + * to edit the code a bit to use the other AC97 unit. --mlau + */ + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/interrupt.h> +#include <linux/wait.h> +#include <linux/delay.h> +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/ac97_codec.h> +#include <sound/initval.h> +#include <sound/soc.h> + +/* regs and bits */ +#define HACCR 0x08 +#define HACCSAR 0x20 +#define HACCSDR 0x24 +#define HACPCML 0x28 +#define HACPCMR 0x2C +#define HACTIER 0x50 +#define HACTSR 0x54 +#define HACRIER 0x58 +#define HACRSR 0x5C +#define HACACR 0x60 + +#define CR_CR (1 << 15) /* "codec-ready" indicator */ +#define CR_CDRT (1 << 11) /* cold reset */ +#define CR_WMRT (1 << 10) /* warm reset */ +#define CR_B9 (1 << 9) /* the mysterious "bit 9" */ +#define CR_ST (1 << 5) /* AC97 link start bit */ + +#define CSAR_RD (1 << 19) /* AC97 data read bit */ +#define CSAR_WR (0) + +#define TSR_CMDAMT (1 << 31) +#define TSR_CMDDMT (1 << 30) + +#define RSR_STARY (1 << 22) +#define RSR_STDRY (1 << 21) + +#define ACR_DMARX16 (1 << 30) +#define ACR_DMATX16 (1 << 29) +#define ACR_TX12ATOM (1 << 26) +#define ACR_DMARX20 ((1 << 24) | (1 << 22)) +#define ACR_DMATX20 ((1 << 23) | (1 << 21)) + +#define CSDR_SHIFT 4 +#define CSDR_MASK (0xffff << CSDR_SHIFT) +#define CSAR_SHIFT 12 +#define CSAR_MASK (0x7f << CSAR_SHIFT) + +#define AC97_WRITE_RETRY 1 +#define AC97_READ_RETRY 5 + +/* manual-suggested AC97 codec access timeouts (us) */ +#define TMO_E1 500 /* 21 < E1 < 1000 */ +#define TMO_E2 13 /* 13 < E2 */ +#define TMO_E3 21 /* 21 < E3 */ +#define TMO_E4 500 /* 21 < E4 < 1000 */ + +struct hac_priv { + unsigned long mmio; /* HAC base address */ +} hac_cpu_data[] = { +#if defined(CONFIG_CPU_SUBTYPE_SH7760) + { + .mmio = 0xFE240000, + }, + { + .mmio = 0xFE250000, + }, +#elif defined(CONFIG_CPU_SUBTYPE_SH7780) + { + .mmio = 0xFFE40000, + }, +#else +#error "Unsupported SuperH SoC" +#endif +}; + +#define HACREG(reg) (*(unsigned long *)(hac->mmio + (reg))) + +/* + * AC97 read/write flow as outlined in the SH7760 manual (pages 903-906) + */ +static int hac_get_codec_data(struct hac_priv *hac, unsigned short r, + unsigned short *v) +{ + unsigned int to1, to2, i; + unsigned short adr; + + for (i = 0; i < AC97_READ_RETRY; ++i) { + *v = 0; + /* wait for HAC to receive something from the codec */ + for (to1 = TMO_E4; + to1 && !(HACREG(HACRSR) & RSR_STARY); + --to1) + udelay(1); + for (to2 = TMO_E4; + to2 && !(HACREG(HACRSR) & RSR_STDRY); + --to2) + udelay(1); + + if (!to1 && !to2) + return 0; /* codec comm is down */ + + adr = ((HACREG(HACCSAR) & CSAR_MASK) >> CSAR_SHIFT); + *v = ((HACREG(HACCSDR) & CSDR_MASK) >> CSDR_SHIFT); + + HACREG(HACRSR) &= ~(RSR_STDRY | RSR_STARY); + + if (r == adr) + break; + + /* manual says: wait at least 21 usec before retrying */ + udelay(21); + } + HACREG(HACRSR) &= ~(RSR_STDRY | RSR_STARY); + return (i < AC97_READ_RETRY); +} + +static unsigned short hac_read_codec_aux(struct hac_priv *hac, + unsigned short reg) +{ + unsigned short val; + unsigned int i, to; + + for (i = 0; i < AC97_READ_RETRY; i++) { + /* send_read_request */ + local_irq_disable(); + HACREG(HACTSR) &= ~(TSR_CMDAMT); + HACREG(HACCSAR) = (reg << CSAR_SHIFT) | CSAR_RD; + local_irq_enable(); + + for (to = TMO_E3; + to && !(HACREG(HACTSR) & TSR_CMDAMT); + --to) + udelay(1); + + HACREG(HACTSR) &= ~TSR_CMDAMT; + val = 0; + if (hac_get_codec_data(hac, reg, &val) != 0) + break; + } + + if (i == AC97_READ_RETRY) + return ~0; + + return val; +} + +static void hac_ac97_write(struct snd_ac97 *ac97, unsigned short reg, + unsigned short val) +{ + int unit_id = 0 /* ac97->private_data */; + struct hac_priv *hac = &hac_cpu_data[unit_id]; + unsigned int i, to; + /* write_codec_aux */ + for (i = 0; i < AC97_WRITE_RETRY; i++) { + /* send_write_request */ + local_irq_disable(); + HACREG(HACTSR) &= ~(TSR_CMDDMT | TSR_CMDAMT); + HACREG(HACCSDR) = (val << CSDR_SHIFT); + HACREG(HACCSAR) = (reg << CSAR_SHIFT) & (~CSAR_RD); + local_irq_enable(); + + /* poll-wait for CMDAMT and CMDDMT */ + for (to = TMO_E1; + to && !(HACREG(HACTSR) & (TSR_CMDAMT|TSR_CMDDMT)); + --to) + udelay(1); + + HACREG(HACTSR) &= ~(TSR_CMDAMT | TSR_CMDDMT); + if (to) + break; + /* timeout, try again */ + } +} + +static unsigned short hac_ac97_read(struct snd_ac97 *ac97, + unsigned short reg) +{ + int unit_id = 0 /* ac97->private_data */; + struct hac_priv *hac = &hac_cpu_data[unit_id]; + return hac_read_codec_aux(hac, reg); +} + +static void hac_ac97_warmrst(struct snd_ac97 *ac97) +{ + int unit_id = 0 /* ac97->private_data */; + struct hac_priv *hac = &hac_cpu_data[unit_id]; + unsigned int tmo; + + HACREG(HACCR) = CR_WMRT | CR_ST | CR_B9; + msleep(10); + HACREG(HACCR) = CR_ST | CR_B9; + for (tmo = 1000; (tmo > 0) && !(HACREG(HACCR) & CR_CR); tmo--) + udelay(1); + + if (!tmo) + printk(KERN_INFO "hac: reset: AC97 link down!\n"); + /* settings this bit lets us have a conversation with codec */ + HACREG(HACACR) |= ACR_TX12ATOM; +} + +static void hac_ac97_coldrst(struct snd_ac97 *ac97) +{ + int unit_id = 0 /* ac97->private_data */; + struct hac_priv *hac; + hac = &hac_cpu_data[unit_id]; + + HACREG(HACCR) = 0; + HACREG(HACCR) = CR_CDRT | CR_ST | CR_B9; + msleep(10); + hac_ac97_warmrst(ac97); +} + +struct snd_ac97_bus_ops soc_ac97_ops = { + .read = hac_ac97_read, + .write = hac_ac97_write, + .reset = hac_ac97_coldrst, + .warm_reset = hac_ac97_warmrst, +}; +EXPORT_SYMBOL_GPL(soc_ac97_ops); + +static int hac_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct hac_priv *hac = &hac_cpu_data[rtd->dai->cpu_dai->id]; + int d = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1; + + switch (params->msbits) { + case 16: + HACREG(HACACR) |= d ? ACR_DMARX16 : ACR_DMATX16; + HACREG(HACACR) &= d ? ~ACR_DMARX20 : ~ACR_DMATX20; + break; + case 20: + HACREG(HACACR) &= d ? ~ACR_DMARX16 : ~ACR_DMATX16; + HACREG(HACACR) |= d ? ACR_DMARX20 : ACR_DMATX20; + break; + default: + pr_debug("hac: invalid depth %d bit\n", params->msbits); + return -EINVAL; + break; + } + + return 0; +} + +#define AC97_RATES \ + SNDRV_PCM_RATE_8000_192000 + +#define AC97_FMTS \ + SNDRV_PCM_FMTBIT_S16_LE + +struct snd_soc_cpu_dai sh4_hac_dai[] = { +{ + .name = "HAC0", + .id = 0, + .type = SND_SOC_DAI_AC97, + .playback = { + .rates = AC97_RATES, + .formats = AC97_FMTS, + .channels_min = 2, + .channels_max = 2, + }, + .capture = { + .rates = AC97_RATES, + .formats = AC97_FMTS, + .channels_min = 2, + .channels_max = 2, + }, + .ops = { + .hw_params = hac_hw_params, + }, +}, +#ifdef CONFIG_CPU_SUBTYPE_SH7760 +{ + .name = "HAC1", + .id = 1, + .type = SND_SOC_DAI_AC97, + .playback = { + .rates = AC97_RATES, + .formats = AC97_FMTS, + .channels_min = 2, + .channels_max = 2, + }, + .capture = { + .rates = AC97_RATES, + .formats = AC97_FMTS, + .channels_min = 2, + .channels_max = 2, + }, + .ops = { + .hw_params = hac_hw_params, + }, + +}, +#endif +}; +EXPORT_SYMBOL_GPL(sh4_hac_dai); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("SuperH onchip HAC (AC97) audio driver"); +MODULE_AUTHOR("Manuel Lauss <mano@roarinelk.homelinux.net>"); diff --git a/sound/soc/sh/sh7760-ac97.c b/sound/soc/sh/sh7760-ac97.c new file mode 100644 index 00000000000..5563f14511f --- /dev/null +++ b/sound/soc/sh/sh7760-ac97.c @@ -0,0 +1,92 @@ +/* + * Generic AC97 sound support for SH7760 + * + * (c) 2007 Manuel Lauss + * + * Licensed under the GPLv2. + */ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/platform_device.h> +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/soc.h> +#include <sound/soc-dapm.h> +#include <asm/io.h> + +#include "../codecs/ac97.h" + +#define IPSEL 0xFE400034 + +/* platform specific structs can be declared here */ +extern struct snd_soc_cpu_dai sh4_hac_dai[2]; +extern struct snd_soc_platform sh7760_soc_platform; + +static int machine_init(struct snd_soc_codec *codec) +{ + snd_soc_dapm_sync_endpoints(codec); + return 0; +} + +static struct snd_soc_dai_link sh7760_ac97_dai = { + .name = "AC97", + .stream_name = "AC97 HiFi", + .cpu_dai = &sh4_hac_dai[0], /* HAC0 */ + .codec_dai = &ac97_dai, + .init = machine_init, + .ops = NULL, +}; + +static struct snd_soc_machine sh7760_ac97_soc_machine = { + .name = "SH7760 AC97", + .dai_link = &sh7760_ac97_dai, + .num_links = 1, +}; + +static struct snd_soc_device sh7760_ac97_snd_devdata = { + .machine = &sh7760_ac97_soc_machine, + .platform = &sh7760_soc_platform, + .codec_dev = &soc_codec_dev_ac97, +}; + +static struct platform_device *sh7760_ac97_snd_device; + +static int __init sh7760_ac97_init(void) +{ + int ret; + unsigned short ipsel; + + /* enable both AC97 controllers in pinmux reg */ + ipsel = ctrl_inw(IPSEL); + ctrl_outw(ipsel | (3 << 10), IPSEL); + + ret = -ENOMEM; + sh7760_ac97_snd_device = platform_device_alloc("soc-audio", -1); + if (!sh7760_ac97_snd_device) + goto out; + + platform_set_drvdata(sh7760_ac97_snd_device, + &sh7760_ac97_snd_devdata); + sh7760_ac97_snd_devdata.dev = &sh7760_ac97_snd_device->dev; + ret = platform_device_add(sh7760_ac97_snd_device); + + if (ret) + platform_device_put(sh7760_ac97_snd_device); + +out: + return ret; +} + +static void __exit sh7760_ac97_exit(void) +{ + platform_device_unregister(sh7760_ac97_snd_device); +} + +module_init(sh7760_ac97_init); +module_exit(sh7760_ac97_exit); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Generic SH7760 AC97 sound machine"); +MODULE_AUTHOR("Manuel Lauss <mano@roarinelk.homelinux.net>"); diff --git a/sound/soc/sh/ssi.c b/sound/soc/sh/ssi.c new file mode 100644 index 00000000000..b72bc316cb8 --- /dev/null +++ b/sound/soc/sh/ssi.c @@ -0,0 +1,400 @@ +/* + * Serial Sound Interface (I2S) support for SH7760/SH7780 + * + * Copyright (c) 2007 Manuel Lauss <mano@roarinelk.homelinux.net> + * + * licensed under the terms outlined in the file COPYING at the root + * of the linux kernel sources. + * + * dont forget to set IPSEL/OMSEL register bits (in your board code) to + * enable SSI output pins! + */ + +/* + * LIMITATIONS: + * The SSI unit has only one physical data line, so full duplex is + * impossible. This can be remedied on the SH7760 by using the + * other SSI unit for recording; however the SH7780 has only 1 SSI + * unit, and its pins are shared with the AC97 unit, among others. + * + * FEATURES: + * The SSI features "compressed mode": in this mode it continuously + * streams PCM data over the I2S lines and uses LRCK as a handshake + * signal. Can be used to send compressed data (AC3/DTS) to a DSP. + * The number of bits sent over the wire in a frame can be adjusted + * and can be independent from the actual sample bit depth. This is + * useful to support TDM mode codecs like the AD1939 which have a + * fixed TDM slot size, regardless of sample resolution. + */ + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/initval.h> +#include <sound/soc.h> +#include <asm/io.h> + +#define SSICR 0x00 +#define SSISR 0x04 + +#define CR_DMAEN (1 << 28) +#define CR_CHNL_SHIFT 22 +#define CR_CHNL_MASK (3 << CR_CHNL_SHIFT) +#define CR_DWL_SHIFT 19 +#define CR_DWL_MASK (7 << CR_DWL_SHIFT) +#define CR_SWL_SHIFT 16 +#define CR_SWL_MASK (7 << CR_SWL_SHIFT) +#define CR_SCK_MASTER (1 << 15) /* bitclock master bit */ +#define CR_SWS_MASTER (1 << 14) /* wordselect master bit */ +#define CR_SCKP (1 << 13) /* I2Sclock polarity */ +#define CR_SWSP (1 << 12) /* LRCK polarity */ +#define CR_SPDP (1 << 11) +#define CR_SDTA (1 << 10) /* i2s alignment (msb/lsb) */ +#define CR_PDTA (1 << 9) /* fifo data alignment */ +#define CR_DEL (1 << 8) /* delay data by 1 i2sclk */ +#define CR_BREN (1 << 7) /* clock gating in burst mode */ +#define CR_CKDIV_SHIFT 4 +#define CR_CKDIV_MASK (7 << CR_CKDIV_SHIFT) /* bitclock divider */ +#define CR_MUTE (1 << 3) /* SSI mute */ +#define CR_CPEN (1 << 2) /* compressed mode */ +#define CR_TRMD (1 << 1) /* transmit/receive select */ +#define CR_EN (1 << 0) /* enable SSI */ + +#define SSIREG(reg) (*(unsigned long *)(ssi->mmio + (reg))) + +struct ssi_priv { + unsigned long mmio; + unsigned long sysclk; + int inuse; +} ssi_cpu_data[] = { +#if defined(CONFIG_CPU_SUBTYPE_SH7760) + { + .mmio = 0xFE680000, + }, + { + .mmio = 0xFE690000, + }, +#elif defined(CONFIG_CPU_SUBTYPE_SH7780) + { + .mmio = 0xFFE70000, + }, +#else +#error "Unsupported SuperH SoC" +#endif +}; + +/* + * track usage of the SSI; it is simplex-only so prevent attempts of + * concurrent playback + capture. FIXME: any locking required? + */ +static int ssi_startup(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; + if (ssi->inuse) { + pr_debug("ssi: already in use!\n"); + return -EBUSY; + } else + ssi->inuse = 1; + return 0; +} + +static void ssi_shutdown(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; + + ssi->inuse = 0; +} + +static int ssi_trigger(struct snd_pcm_substream *substream, int cmd) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + SSIREG(SSICR) |= CR_DMAEN | CR_EN; + break; + case SNDRV_PCM_TRIGGER_STOP: + SSIREG(SSICR) &= ~(CR_DMAEN | CR_EN); + break; + default: + return -EINVAL; + } + + return 0; +} + +static int ssi_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; + unsigned long ssicr = SSIREG(SSICR); + unsigned int bits, channels, swl, recv, i; + + channels = params_channels(params); + bits = params->msbits; + recv = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 0 : 1; + + pr_debug("ssi_hw_params() enter\nssicr was %08lx\n", ssicr); + pr_debug("bits: %d channels: %d\n", bits, channels); + + ssicr &= ~(CR_TRMD | CR_CHNL_MASK | CR_DWL_MASK | CR_PDTA | + CR_SWL_MASK); + + /* direction (send/receive) */ + if (!recv) + ssicr |= CR_TRMD; /* transmit */ + + /* channels */ + if ((channels < 2) || (channels > 8) || (channels & 1)) { + pr_debug("ssi: invalid number of channels\n"); + return -EINVAL; + } + ssicr |= ((channels >> 1) - 1) << CR_CHNL_SHIFT; + + /* DATA WORD LENGTH (DWL): databits in audio sample */ + i = 0; + switch (bits) { + case 32: ++i; + case 24: ++i; + case 22: ++i; + case 20: ++i; + case 18: ++i; + case 16: ++i; + ssicr |= i << CR_DWL_SHIFT; + case 8: break; + default: + pr_debug("ssi: invalid sample width\n"); + return -EINVAL; + } + + /* + * SYSTEM WORD LENGTH: size in bits of half a frame over the I2S + * wires. This is usually bits_per_sample x channels/2; i.e. in + * Stereo mode the SWL equals DWL. SWL can be bigger than the + * product of (channels_per_slot x samplebits), e.g. for codecs + * like the AD1939 which only accept 32bit wide TDM slots. For + * "standard" I2S operation we set SWL = chans / 2 * DWL here. + * Waiting for ASoC to get TDM support ;-) + */ + if ((bits > 16) && (bits <= 24)) { + bits = 24; /* these are padded by the SSI */ + /*ssicr |= CR_PDTA;*/ /* cpu/data endianness ? */ + } + i = 0; + swl = (bits * channels) / 2; + switch (swl) { + case 256: ++i; + case 128: ++i; + case 64: ++i; + case 48: ++i; + case 32: ++i; + case 16: ++i; + ssicr |= i << CR_SWL_SHIFT; + case 8: break; + default: + pr_debug("ssi: invalid system word length computed\n"); + return -EINVAL; + } + + SSIREG(SSICR) = ssicr; + + pr_debug("ssi_hw_params() leave\nssicr is now %08lx\n", ssicr); + return 0; +} + +static int ssi_set_sysclk(struct snd_soc_cpu_dai *cpu_dai, int clk_id, + unsigned int freq, int dir) +{ + struct ssi_priv *ssi = &ssi_cpu_data[cpu_dai->id]; + + ssi->sysclk = freq; + + return 0; +} + +/* + * This divider is used to generate the SSI_SCK (I2S bitclock) from the + * clock at the HAC_BIT_CLK ("oversampling clock") pin. + */ +static int ssi_set_clkdiv(struct snd_soc_cpu_dai *dai, int did, int div) +{ + struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; + unsigned long ssicr; + int i; + + i = 0; + ssicr = SSIREG(SSICR) & ~CR_CKDIV_MASK; + switch (div) { + case 16: ++i; + case 8: ++i; + case 4: ++i; + case 2: ++i; + SSIREG(SSICR) = ssicr | (i << CR_CKDIV_SHIFT); + case 1: break; + default: + pr_debug("ssi: invalid sck divider %d\n", div); + return -EINVAL; + } + + return 0; +} + +static int ssi_set_fmt(struct snd_soc_cpu_dai *dai, unsigned int fmt) +{ + struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; + unsigned long ssicr = SSIREG(SSICR); + + pr_debug("ssi_set_fmt()\nssicr was 0x%08lx\n", ssicr); + + ssicr &= ~(CR_DEL | CR_PDTA | CR_BREN | CR_SWSP | CR_SCKP | + CR_SWS_MASTER | CR_SCK_MASTER); + + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { + case SND_SOC_DAIFMT_I2S: + break; + case SND_SOC_DAIFMT_RIGHT_J: + ssicr |= CR_DEL | CR_PDTA; + break; + case SND_SOC_DAIFMT_LEFT_J: + ssicr |= CR_DEL; + break; + default: + pr_debug("ssi: unsupported format\n"); + return -EINVAL; + } + + switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) { + case SND_SOC_DAIFMT_CONT: + break; + case SND_SOC_DAIFMT_GATED: + ssicr |= CR_BREN; + break; + } + + switch (fmt & SND_SOC_DAIFMT_INV_MASK) { + case SND_SOC_DAIFMT_NB_NF: + ssicr |= CR_SCKP; /* sample data at low clkedge */ + break; + case SND_SOC_DAIFMT_NB_IF: + ssicr |= CR_SCKP | CR_SWSP; + break; + case SND_SOC_DAIFMT_IB_NF: + break; + case SND_SOC_DAIFMT_IB_IF: + ssicr |= CR_SWSP; /* word select starts low */ + break; + default: + pr_debug("ssi: invalid inversion\n"); + return -EINVAL; + } + + switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { + case SND_SOC_DAIFMT_CBM_CFM: + break; + case SND_SOC_DAIFMT_CBS_CFM: + ssicr |= CR_SCK_MASTER; + break; + case SND_SOC_DAIFMT_CBM_CFS: + ssicr |= CR_SWS_MASTER; + break; + case SND_SOC_DAIFMT_CBS_CFS: + ssicr |= CR_SWS_MASTER | CR_SCK_MASTER; + break; + default: + pr_debug("ssi: invalid master/slave configuration\n"); + return -EINVAL; + } + + SSIREG(SSICR) = ssicr; + pr_debug("ssi_set_fmt() leave\nssicr is now 0x%08lx\n", ssicr); + + return 0; +} + +/* the SSI depends on an external clocksource (at HAC_BIT_CLK) even in + * Master mode, so really this is board specific; the SSI can do any + * rate with the right bitclk and divider settings. + */ +#define SSI_RATES \ + SNDRV_PCM_RATE_8000_192000 + +/* the SSI can do 8-32 bit samples, with 8 possible channels */ +#define SSI_FMTS \ + (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | \ + SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE | \ + SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_U20_3LE | \ + SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_U24_3LE | \ + SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_U32_LE) + +struct snd_soc_cpu_dai sh4_ssi_dai[] = { +{ + .name = "SSI0", + .id = 0, + .type = SND_SOC_DAI_I2S, + .playback = { + .rates = SSI_RATES, + .formats = SSI_FMTS, + .channels_min = 2, + .channels_max = 8, + }, + .capture = { + .rates = SSI_RATES, + .formats = SSI_FMTS, + .channels_min = 2, + .channels_max = 8, + }, + .ops = { + .startup = ssi_startup, + .shutdown = ssi_shutdown, + .trigger = ssi_trigger, + .hw_params = ssi_hw_params, + }, + .dai_ops = { + .set_sysclk = ssi_set_sysclk, + .set_clkdiv = ssi_set_clkdiv, + .set_fmt = ssi_set_fmt, + }, +}, +#ifdef CONFIG_CPU_SUBTYPE_SH7760 +{ + .name = "SSI1", + .id = 1, + .type = SND_SOC_DAI_I2S, + .playback = { + .rates = SSI_RATES, + .formats = SSI_FMTS, + .channels_min = 2, + .channels_max = 8, + }, + .capture = { + .rates = SSI_RATES, + .formats = SSI_FMTS, + .channels_min = 2, + .channels_max = 8, + }, + .ops = { + .startup = ssi_startup, + .shutdown = ssi_shutdown, + .trigger = ssi_trigger, + .hw_params = ssi_hw_params, + }, + .dai_ops = { + .set_sysclk = ssi_set_sysclk, + .set_clkdiv = ssi_set_clkdiv, + .set_fmt = ssi_set_fmt, + }, +}, +#endif +}; +EXPORT_SYMBOL_GPL(sh4_ssi_dai); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("SuperH onchip SSI (I2S) audio driver"); +MODULE_AUTHOR("Manuel Lauss <mano@roarinelk.homelinux.net>"); diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 8ebc1adb5ed..7bd5852fcc0 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -2350,7 +2350,9 @@ static int is_big_endian_format(struct snd_usb_audio *chip, struct audioformat * return 1; break; case USB_ID(0x0763, 0x2003): /* M-Audio Audiophile USB */ - return 1; + if (device_setup[chip->index] == 0x00 || + fp->altsetting==1 || fp->altsetting==2 || fp->altsetting==3) + return 1; } return 0; } @@ -2530,7 +2532,18 @@ static int parse_audio_format_i(struct snd_usb_audio *chip, struct audioformat * * but we give normal PCM format to get the existing * apps working... */ - pcm_format = SNDRV_PCM_FORMAT_S16_LE; + switch (chip->usb_id) { + + case USB_ID(0x0763, 0x2003): /* M-Audio Audiophile USB */ + if (device_setup[chip->index] == 0x00 && + fp->altsetting == 6) + pcm_format = SNDRV_PCM_FORMAT_S16_BE; + else + pcm_format = SNDRV_PCM_FORMAT_S16_LE; + break; + default: + pcm_format = SNDRV_PCM_FORMAT_S16_LE; + } } else { pcm_format = parse_audio_format_i_type(chip, fp, format, fmt); if (pcm_format < 0) @@ -3251,6 +3264,11 @@ static int snd_usb_cm106_boot_quirk(struct usb_device *dev) static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip, int iface, int altno) { + /* Reset ALL ifaces to 0 altsetting. + * Call it for every possible altsetting of every interface. + */ + usb_set_interface(chip->dev, iface, 0); + if (device_setup[chip->index] & AUDIOPHILE_SET) { if ((device_setup[chip->index] & AUDIOPHILE_SET_DTS) && altno != 6) diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h index 374fbf657a2..5a2f518c662 100644 --- a/sound/usb/usbquirks.h +++ b/sound/usb/usbquirks.h @@ -57,6 +57,24 @@ USB_DEVICE_ID_MATCH_INT_CLASS | USB_DEVICE_ID_MATCH_INT_SUBCLASS, .idVendor = 0x046d, + .idProduct = 0x08ae, + .bInterfaceClass = USB_CLASS_AUDIO, + .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL +}, +{ + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | + USB_DEVICE_ID_MATCH_INT_CLASS | + USB_DEVICE_ID_MATCH_INT_SUBCLASS, + .idVendor = 0x046d, + .idProduct = 0x08c6, + .bInterfaceClass = USB_CLASS_AUDIO, + .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL +}, +{ + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | + USB_DEVICE_ID_MATCH_INT_CLASS | + USB_DEVICE_ID_MATCH_INT_SUBCLASS, + .idVendor = 0x046d, .idProduct = 0x08f0, .bInterfaceClass = USB_CLASS_AUDIO, .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL @@ -1051,7 +1069,15 @@ YAMAHA_DEVICE(0x7010, "UB99"), .type = QUIRK_MIDI_STANDARD_INTERFACE } }, - /* TODO: add Roland EXR support */ +{ + USB_DEVICE(0x0582, 0x0060), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .vendor_name = "Roland", + .product_name = "EXR Series", + .ifnum = 0, + .type = QUIRK_MIDI_STANDARD_INTERFACE + } +}, { /* has ID 0x0067 when not in "Advanced Driver" mode */ USB_DEVICE(0x0582, 0x0065), @@ -1094,6 +1120,19 @@ YAMAHA_DEVICE(0x7010, "UB99"), } } }, +{ + USB_DEVICE(0x582, 0x00a6), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .vendor_name = "Roland", + .product_name = "Juno-G", + .ifnum = 0, + .type = QUIRK_MIDI_FIXED_ENDPOINT, + .data = & (const struct snd_usb_midi_endpoint_info) { + .out_cables = 0x0001, + .in_cables = 0x0001 + } + } +}, { /* * This quirk is for the "Advanced" modes of the Edirol UA-25. * If the switch is not in an advanced setting, the UA-25 has @@ -1230,6 +1269,37 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, /* TODO: add Edirol MD-P1 support */ +{ + /* Roland SH-201 */ + USB_DEVICE(0x0582, 0x00ad), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .vendor_name = "Roland", + .product_name = "SH-201", + .ifnum = QUIRK_ANY_INTERFACE, + .type = QUIRK_COMPOSITE, + .data = (const struct snd_usb_audio_quirk[]) { + { + .ifnum = 0, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 1, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 2, + .type = QUIRK_MIDI_FIXED_ENDPOINT, + .data = & (const struct snd_usb_midi_endpoint_info) { + .out_cables = 0x0001, + .in_cables = 0x0001 + } + }, + { + .ifnum = -1 + } + } + } +}, /* Guillemot devices */ { diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index 0a352e46862..48e9aa3f18c 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c @@ -935,10 +935,9 @@ static struct snd_pcm_ops snd_usX2Y_pcm_ops = */ static void usX2Y_audio_stream_free(struct snd_usX2Y_substream **usX2Y_substream) { - if (NULL != usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK]) { - kfree(usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK]); - usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK] = NULL; - } + kfree(usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK]); + usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK] = NULL; + kfree(usX2Y_substream[SNDRV_PCM_STREAM_CAPTURE]); usX2Y_substream[SNDRV_PCM_STREAM_CAPTURE] = NULL; } |