Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321006
b: refs/heads/master
c: e5b3542
h: refs/heads/master
v: v3
  • Loading branch information
Fengguang Wu authored and Takashi Iwai committed Jul 30, 2012
1 parent 5af5b5b commit c97c0f3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e427c2375646789ecd0ccaef1a1e41458559ab2d
refs/heads/master: e5b35420ef7e6dc92a6cc5914bc9e5e5c1d48819
1 change: 1 addition & 0 deletions trunk/include/sound/es1688.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#define ES1688_HW_AUTO 0x0000
#define ES1688_HW_688 0x0001
#define ES1688_HW_1688 0x0002
#define ES1688_HW_UNDEF 0x0003

struct snd_es1688 {
unsigned long port; /* port of ESS chip */
Expand Down
34 changes: 23 additions & 11 deletions trunk/sound/isa/es1688/es1688_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,10 @@ static int snd_es1688_capture_close(struct snd_pcm_substream *substream)

static int snd_es1688_free(struct snd_es1688 *chip)
{
if (chip->res_port) {
if (chip->hardware != ES1688_HW_UNDEF)
snd_es1688_init(chip, 0);
if (chip->res_port)
release_and_free_resource(chip->res_port);
}
if (chip->irq >= 0)
free_irq(chip->irq, (void *) chip);
if (chip->dma8 >= 0) {
Expand Down Expand Up @@ -657,19 +657,27 @@ int snd_es1688_create(struct snd_card *card,
return -ENOMEM;
chip->irq = -1;
chip->dma8 = -1;
chip->hardware = ES1688_HW_UNDEF;

if ((chip->res_port = request_region(port + 4, 12, "ES1688")) == NULL) {
chip->res_port = request_region(port + 4, 12, "ES1688");
if (chip->res_port == NULL) {
snd_printk(KERN_ERR "es1688: can't grab port 0x%lx\n", port + 4);
return -EBUSY;
err = -EBUSY;
goto exit;
}
if (request_irq(irq, snd_es1688_interrupt, 0, "ES1688", (void *) chip)) {

err = request_irq(irq, snd_es1688_interrupt, 0, "ES1688", (void *) chip);
if (err < 0) {
snd_printk(KERN_ERR "es1688: can't grab IRQ %d\n", irq);
return -EBUSY;
goto exit;
}

chip->irq = irq;
if (request_dma(dma8, "ES1688")) {
err = request_dma(dma8, "ES1688");

if (err < 0) {
snd_printk(KERN_ERR "es1688: can't grab DMA8 %d\n", dma8);
return -EBUSY;
goto exit;
}
chip->dma8 = dma8;

Expand All @@ -685,14 +693,18 @@ int snd_es1688_create(struct snd_card *card,

err = snd_es1688_probe(chip);
if (err < 0)
return err;
goto exit;

err = snd_es1688_init(chip, 1);
if (err < 0)
return err;
goto exit;

/* Register device */
return snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
exit:
if (err)
snd_es1688_free(chip);
return err;
}

static struct snd_pcm_ops snd_es1688_playback_ops = {
Expand Down

0 comments on commit c97c0f3

Please sign in to comment.