From 5e5bfbd43553f0867b138a78a320121119468beb Mon Sep 17 00:00:00 2001 From: Alexander Polakov Date: Mon, 18 Jul 2011 14:58:24 +0400 Subject: [PATCH] more printf -> kprintf + intrs + callouts --- sys/dev/sound/pci/newhda/hdac.c | 36 ++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/sys/dev/sound/pci/newhda/hdac.c b/sys/dev/sound/pci/newhda/hdac.c index 876920a50f..c2dcdb671e 100644 --- a/sys/dev/sound/pci/newhda/hdac.c +++ b/sys/dev/sound/pci/newhda/hdac.c @@ -1747,7 +1747,7 @@ hdac_dma_alloc(struct hdac_softc *sc, struct hdac_dma *dma, bus_size_t size) */ result = bus_dmamem_alloc(dma->dma_tag, (void **)&dma->dma_vaddr, BUS_DMA_NOWAIT | BUS_DMA_ZERO | - ((sc->flags & HDAC_F_DMA_NOCACHE) ? BUS_DMA_NOCACHE : 0), + ((sc->flags & HDAC_F_DMA_NOCACHE) ? 0 /* XXX: BUS_DMA_NOCACHE */ : 0), &dma->dma_map); if (result != 0) { device_printf(sc->dev, "%s: bus_dmamem_alloc failed (%x)\n", @@ -1884,8 +1884,8 @@ hdac_irq_alloc(struct hdac_softc *sc) __func__); goto hdac_irq_alloc_fail; } - result = bus_setup_intr(sc->dev, irq->irq_res, INTR_MPSAFE | INTR_TYPE_AV, - NULL, hdac_intr_handler, sc, &irq->irq_handle); + result = snd_setup_intr(sc->dev, irq->irq_res, INTR_MPSAFE, + hdac_intr_handler, sc, &irq->irq_handle); if (result != 0) { device_printf(sc->dev, "%s: Unable to setup interrupt handler (%x)\n", @@ -3467,7 +3467,9 @@ hdac_channel_init(kobj_t obj, void *data, struct snd_dbuf *b, } if (sndbuf_alloc(ch->b, sc->chan_dmat, +#ifdef NEWSOUND (sc->flags & HDAC_F_DMA_NOCACHE) ? BUS_DMA_NOCACHE : 0, +#endif pdevinfo->chan_size) != 0) return (NULL); @@ -4189,9 +4191,9 @@ hdac_attach(device_t dev) sc->pci_subvendor = HP_NX6325_SUBVENDOR; } - callout_init(&sc->poll_hda, CALLOUT_MPSAFE); - callout_init(&sc->poll_hdac, CALLOUT_MPSAFE); - callout_init(&sc->poll_jack, CALLOUT_MPSAFE); + callout_init(&sc->poll_hda); /* , CALLOUT_MPSAFE); */ + callout_init(&sc->poll_hdac); /* , CALLOUT_MPSAFE); */ + callout_init(&sc->poll_jack); /* , CALLOUT_MPSAFE); */ TASK_INIT(&sc->unsolq_task, 0, hdac_unsolq_task, sc); @@ -7088,22 +7090,22 @@ hdac_dump_nodes(struct hdac_devinfo *devinfo) if (w->param.widget_cap & 0x0ee1) { device_printf(sc->dev, " "); if (HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP(w->param.widget_cap)) - printf(" LRSWAP"); + kprintf(" LRSWAP"); if (HDA_PARAM_AUDIO_WIDGET_CAP_POWER_CTRL(w->param.widget_cap)) - printf(" PWR"); + kprintf(" PWR"); if (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) - printf(" DIGITAL"); + kprintf(" DIGITAL"); if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) - printf(" UNSOL"); + kprintf(" UNSOL"); if (HDA_PARAM_AUDIO_WIDGET_CAP_PROC_WIDGET(w->param.widget_cap)) - printf(" PROC"); + kprintf(" PROC"); if (HDA_PARAM_AUDIO_WIDGET_CAP_STRIPE(w->param.widget_cap)) - printf(" STRIPE"); + kprintf(" STRIPE"); j = HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap); if (j == 1) - printf(" STEREO"); + kprintf(" STEREO"); else if (j > 1) - printf(" %dCH", j + 1); + kprintf(" %dCH", j + 1); kprintf("\n"); } if (w->bindas != -1) { @@ -7114,7 +7116,7 @@ hdac_dump_nodes(struct hdac_devinfo *devinfo) device_printf(sc->dev, " OSS: %s", hdac_audio_ctl_ossmixer_mask2allname(w->ossmask, buf, sizeof(buf))); if (w->ossdev >= 0) - printf(" (%s)", ossname[w->ossdev]); + kprintf(" (%s)", ossname[w->ossdev]); kprintf("\n"); } if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_OUTPUT || @@ -8163,7 +8165,7 @@ hdac_print_child(device_t dev, device_t child) int retval; retval = bus_print_child_header(dev, child); - retval += printf(" at cad %d nid %d", + retval += kprintf(" at cad %d nid %d", pdevinfo->devinfo->codec->cad, pdevinfo->devinfo->nid); retval += bus_print_child_footer(dev, child); @@ -8274,7 +8276,9 @@ hdac_pcm_attach(device_t dev) * We don't register interrupt handler with snd_setup_intr * in pcm device. Mark pcm device as MPSAFE manually. */ +#ifndef __DragonFly__ /* but we do */ pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); +#endif HDA_BOOTHVERBOSE( device_printf(dev, "OSS mixer initialization...\n"); -- 2.41.0