X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=sound%2Fisa%2Fes18xx.c;h=90498e4ca2601f3c82005a4de4eaafd5e857d935;hb=52e9d9f4b32a3bec91feb76c84e37b7dcffe5040;hp=f7732bf90be3a99742d48296b45bd17396b1d92a;hpb=a43266355b3d8cf6717a27159f9a417bdff73782;p=linux-2.6-omap-h63xx.git diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index f7732bf90be..90498e4ca26 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c @@ -77,7 +77,6 @@ * needed for ZV, so maybe the datasheet is entirely wrong here. */ -#include #include #include #include @@ -163,7 +162,7 @@ struct snd_audiodrive { #define ES18XX_DUPLEX_SAME 0x0010 /* Playback and record must share the same rate */ #define ES18XX_NEW_RATE 0x0020 /* More precise rate setting */ #define ES18XX_AUXB 0x0040 /* AuxB mixer control */ -#define ES18XX_HWV 0x0080 /* Has seperate hardware volume mixer controls*/ +#define ES18XX_HWV 0x0080 /* Has separate hardware volume mixer controls*/ #define ES18XX_MONO 0x0100 /* Mono_in mixer control */ #define ES18XX_I2S 0x0200 /* I2S mixer control */ #define ES18XX_MUTEREC 0x0400 /* Record source can be muted */ @@ -623,7 +622,7 @@ static int snd_es18xx_capture_prepare(struct snd_pcm_substream *substream) (snd_pcm_format_width(runtime->format) == 16 ? 0x04 : 0x00) | (snd_pcm_format_unsigned(runtime->format) ? 0x00 : 0x20)); - /* Set DMA controler */ + /* Set DMA controller */ snd_dma_program(chip->dma1, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT); return 0; @@ -689,7 +688,7 @@ static int snd_es18xx_playback2_prepare(struct snd_es18xx *chip, (snd_pcm_format_width(runtime->format) == 16 ? 0x04 : 0x00) | (snd_pcm_format_unsigned(runtime->format) ? 0x00 : 0x20)); - /* Set DMA controler */ + /* Set DMA controller */ snd_dma_program(chip->dma1, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); return 0; @@ -1071,14 +1070,7 @@ static int snd_es18xx_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem return (snd_es18xx_mixer_bits(chip, 0x1c, 0x07, val) != val) || retVal; } -static int snd_es18xx_info_spatializer_enable(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; -} +#define snd_es18xx_info_spatializer_enable snd_ctl_boolean_mono_info static int snd_es18xx_get_spatializer_enable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { @@ -1120,14 +1112,7 @@ static int snd_es18xx_get_hw_volume(struct snd_kcontrol *kcontrol, struct snd_ct return 0; } -static int snd_es18xx_info_hw_switch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) -{ - uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; - uinfo->count = 2; - uinfo->value.integer.min = 0; - uinfo->value.integer.max = 1; - return 0; -} +#define snd_es18xx_info_hw_switch snd_ctl_boolean_stereo_info static int snd_es18xx_get_hw_switch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { @@ -1456,6 +1441,8 @@ static int __devinit snd_es18xx_initialize(struct snd_es18xx *chip) snd_es18xx_write(chip, 0xB2, 0x50); /* Enable MPU and hardware volume interrupt */ snd_es18xx_mixer_write(chip, 0x64, 0x42); + /* Enable ESS wavetable input */ + snd_es18xx_mixer_bits(chip, 0x48, 0x10, 0x10); } else { int irqmask, dma1mask, dma2mask; @@ -2042,37 +2029,16 @@ static int pnpc_registered; static struct pnp_device_id snd_audiodrive_pnpbiosids[] = { { .id = "ESS1869" }, + { .id = "ESS1879" }, { .id = "" } /* end */ }; MODULE_DEVICE_TABLE(pnp, snd_audiodrive_pnpbiosids); /* PnP main device initialization */ -static int __devinit snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev, - struct pnp_resource_table *cfg) +static int __devinit snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev) { - int err; - - pnp_init_resource_table(cfg); - if (port[dev] != SNDRV_AUTO_PORT) - pnp_resource_change(&cfg->port_resource[0], port[dev], 16); - if (fm_port[dev] != SNDRV_AUTO_PORT) - pnp_resource_change(&cfg->port_resource[1], fm_port[dev], 4); - if (mpu_port[dev] != SNDRV_AUTO_PORT) - pnp_resource_change(&cfg->port_resource[2], mpu_port[dev], 2); - if (dma1[dev] != SNDRV_AUTO_DMA) - pnp_resource_change(&cfg->dma_resource[0], dma1[dev], 1); - if (dma2[dev] != SNDRV_AUTO_DMA) - pnp_resource_change(&cfg->dma_resource[1], dma2[dev], 1); - if (irq[dev] != SNDRV_AUTO_IRQ) - pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1); - if (pnp_device_is_isapnp(pdev)) { - err = pnp_manual_config_dev(pdev, cfg, 0); - if (err < 0) - snd_printk(KERN_ERR PFX "PnP manual resources are invalid, using auto config\n"); - } - err = pnp_activate_dev(pdev); - if (err < 0) { + if (pnp_activate_dev(pdev) < 0) { snd_printk(KERN_ERR PFX "PnP configure failure (out of resources?)\n"); return -EBUSY; } @@ -2100,16 +2066,9 @@ static int __devinit snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev, static int __devinit snd_audiodrive_pnp(int dev, struct snd_audiodrive *acard, struct pnp_dev *pdev) { - struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); - - if (!cfg) - return -ENOMEM; acard->dev = pdev; - if (snd_audiodrive_pnp_init_main(dev, acard->dev, cfg) < 0) { - kfree(cfg); + if (snd_audiodrive_pnp_init_main(dev, acard->dev) < 0) return -EBUSY; - } - kfree(cfg); return 0; } @@ -2138,33 +2097,24 @@ static int __devinit snd_audiodrive_pnpc(int dev, struct snd_audiodrive *acard, struct pnp_card_link *card, const struct pnp_card_device_id *id) { - struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); - - if (!cfg) - return -ENOMEM; acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); - if (acard->dev == NULL) { - kfree(cfg); + if (acard->dev == NULL) return -EBUSY; - } + acard->devc = pnp_request_card_device(card, id->devs[1].id, NULL); - if (acard->devc == NULL) { - kfree(cfg); + if (acard->devc == NULL) return -EBUSY; - } + /* Control port initialization */ if (pnp_activate_dev(acard->devc) < 0) { - kfree(cfg); snd_printk(KERN_ERR PFX "PnP control configure failure (out of resources?)\n"); return -EAGAIN; } snd_printdd("pnp: port=0x%llx\n", (unsigned long long)pnp_port_start(acard->devc, 0)); - if (snd_audiodrive_pnp_init_main(dev, acard->dev, cfg) < 0) { - kfree(cfg); + if (snd_audiodrive_pnp_init_main(dev, acard->dev) < 0) return -EBUSY; - } - kfree(cfg); + return 0; } #endif /* CONFIG_PNP */