+/*
+ * handling beep
+ */
+void snd_pmac_beep_dma_start(pmac_t *chip, int bytes, unsigned long addr, int speed)
+{
+ pmac_stream_t *rec = &chip->playback;
+
+ snd_pmac_dma_stop(rec);
+ st_le16(&chip->extra_dma.cmds->req_count, bytes);
+ st_le16(&chip->extra_dma.cmds->xfer_status, 0);
+ st_le32(&chip->extra_dma.cmds->cmd_dep, chip->extra_dma.addr);
+ st_le32(&chip->extra_dma.cmds->phy_addr, addr);
+ st_le16(&chip->extra_dma.cmds->command, OUTPUT_MORE + BR_ALWAYS);
+ out_le32(&chip->awacs->control,
+ (in_le32(&chip->awacs->control) & ~0x1f00)
+ | (speed << 8));
+ out_le32(&chip->awacs->byteswap, 0);
+ snd_pmac_dma_set_command(rec, &chip->extra_dma);
+ snd_pmac_dma_run(rec, RUN);
+}
+
+void snd_pmac_beep_dma_stop(pmac_t *chip)
+{
+ snd_pmac_dma_stop(&chip->playback);
+ st_le16(&chip->extra_dma.cmds->command, DBDMA_STOP);
+ snd_pmac_pcm_set_format(chip); /* reset format */
+}
+
+