I read up on timers, and fixed that problem too. This is an updated
patch, and I'm happy to say that the tumbler now works perfectly :)
jack.
Index: keywest.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/cards/ppc/keywest.c,v
retrieving revision 1.3
diff -u -r1.3 keywest.c
--- keywest.c 2001/09/03 10:39:06 1.3
+++ keywest.c 2001/12/07 01:13:30
@@ -79,7 +79,7 @@
/* Clear all past interrupts */
interrupt_state = keywest_readb(i2c, KW_ADDR_ISR) & 0x0f;
if (interrupt_state > 0)
- keywest_writeb(i2c, KW_ADDR_ISR, interrupt_state);
+ keywest_writeb_wait(i2c, KW_ADDR_ISR, interrupt_state);
}
static int keywest_start(pmac_keywest_t *i2c, unsigned char cmd, int is_read)
Index: pmac.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/cards/ppc/pmac.c,v
retrieving revision 1.5
diff -u -r1.5 pmac.c
--- pmac.c 2001/10/11 10:27:54 1.5
+++ pmac.c 2001/12/07 01:13:32
@@ -790,7 +790,10 @@
if (beep->running) {
if (ticks <= 0)
ticks = 1;
+ del_timer(&beep->timer);
beep->timer.expires = jiffies + ticks;
+ beep->timer.function = snd_pmac_beep_stop_callback;
+ beep->timer.data = (unsigned long)chip;
add_timer(&beep->timer);
snd_pmac_dma_stop(rec);
st_le16(&chip->extra_dma.cmds->req_count, nsamples * 4);
@@ -875,10 +878,12 @@
return -ENOMEM;
}
beep->addr = virt_to_bus(beep->buf);
+ init_timer(&beep->timer);
beep->timer.function = snd_pmac_beep_stop_callback;
beep->timer.data = (unsigned long) chip;
beep->orig_mksound = kd_mksound;
beep->volume = BEEP_VOLUME;
+ beep->running = 0;
beep->control = snd_ctl_new1(&snd_pmac_beep_mixer, chip);
if (beep->control == NULL) {
kfree(beep);
Index: tumbler.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/cards/ppc/tumbler.c,v
retrieving revision 1.4
diff -u -r1.4 tumbler.c
--- tumbler.c 2001/09/07 13:41:11 1.4
+++ tumbler.c 2001/12/07 01:13:33
@@ -326,7 +326,7 @@
struct device_node *node;
void *base;
- node = find_audio_device("audio-hw-reset");
+ node = find_audio_device(device);
if (! node) {
snd_printd("cannot find device %s\n", device);
return 0;
@@ -349,12 +349,13 @@
if (! (base = tumbler_find_device("audio-hw-reset")))
return -ENODEV;
+
map = ioremap(base, 1);
- writeb(5, base);
+ writeb(5, map);
mdelay(100);
- writeb(4, base);
+ writeb(4, map);
mdelay(1);
- writeb(5, base);
+ writeb(5, map);
mdelay(1);
iounmap(map);
return 0;
@@ -447,6 +448,8 @@
chip->mixer_data = mix;
chip->mixer_free = tumbler_cleanup;
+ tumbler_init(chip);
+
if ((err = snd_pmac_keywest_find(chip, &mix->i2c, TAS_I2C_ADDR,
tumbler_init_client)) < 0)
return err;
@@ -460,7 +463,6 @@
return err;
}
- tumbler_init(chip);
#ifdef CONFIG_PMAC_PBOOK
chip->resume = tumbler_resume;
#endif