FreeBSD Bugzilla – Attachment 10414 Details for
Bug 20891
Suspend/Resume does not work for the YMF744. This fixes that.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.25 KB, created by
ira
on 2000-08-28 02:00:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
ira
Created:
2000-08-28 02:00:01 UTC
Size:
2.25 KB
patch
obsolete
>Index: ds1.c >=================================================================== >RCS file: /usr/cvs/src/sys/dev/sound/pci/ds1.c,v >retrieving revision 1.8.2.3 >diff -u -r1.8.2.3 ds1.c >--- ds1.c 2000/08/20 00:41:00 1.8.2.3 >+++ ds1.c 2000/08/21 12:24:30 >@@ -114,6 +114,8 @@ > int regid, irqid; > void *ih; > >+ void *buf; >+ > u_int32_t *pbase, pbankbase, pbanksize; > volatile struct pbank *pbank[2 * 64]; > volatile struct rbank *rbank; >@@ -809,13 +811,20 @@ > memsz = 64 * 2 * pcs + 2 * 2 * rcs + 5 * 2 * ecs + ws; > memsz += (64 + 1) * 4; > >- if (bus_dmamem_alloc(sc->parent_dmat, &buf, BUS_DMA_NOWAIT, &map)) >+ /* this is put in so suspend/resume works and init still works. */ >+ if(sc->buf == NULL) >+ { >+ if (bus_dmamem_alloc(sc->parent_dmat, &buf, BUS_DMA_NOWAIT, &map)) > return -1; >- if (bus_dmamap_load(sc->parent_dmat, map, buf, memsz, ds_setmap, sc, 0) >- || !sc->ctrlbase) { >+ if (bus_dmamap_load(sc->parent_dmat, map, buf, memsz, ds_setmap, sc, > 0) >+ || !sc->ctrlbase) { > device_printf(sc->dev, "pcs=%d, rcs=%d, ecs=%d, ws=%d, memsz=%d\ >n", > pcs, rcs, ecs, ws, memsz); > return -1; >+ } >+ sc->buf = buf; >+ } else { >+ buf = sc->buf; > } > > cb = 0; >@@ -971,11 +980,35 @@ > return ENXIO; > } > >+/* the idea for this code is stolen from neomagic.c */ >+ >+static int >+ds_pci_resume(device_t dev) >+{ >+ snddev_info *d; >+ struct sc_info *sc; >+ >+ d = device_get_softc(dev); >+ sc = pcm_getdevinfo(dev); >+ >+ >+ if(ds_init(sc) == -1) >+ { >+ device_printf(dev, "unable to reinitialize the card\n"); >+ return ENXIO; >+ } >+ if (mixer_reinit(d) == -1) { >+ device_printf(dev, "unable to reinitialize the mixer\n"); >+ return ENXIO; >+ } >+ return 0; >+} >+ > static device_method_t ds1_methods[] = { > /* Device interface */ > DEVMETHOD(device_probe, ds_pci_probe), > DEVMETHOD(device_attach, ds_pci_attach), >- >+ DEVMETHOD(device_resume, ds_pci_resume), > { 0, 0 } > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 20891
: 10414