FreeBSD Bugzilla – Attachment 10016 Details for
Bug 20255
[PATCH] resume from suspend breaks pcm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.54 KB, created by
mike ryan
on 2000-07-28 16:20:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
mike ryan
Created:
2000-07-28 16:20:01 UTC
Size:
3.54 KB
patch
obsolete
>Index: sys/dev/sound/pci/ds1.c >=================================================================== >RCS file: /home/ncvs/src/sys/dev/sound/pci/ds1.c,v >retrieving revision 1.8.2.1 >diff -c -r1.8.2.1 ds1.c >*** sys/dev/sound/pci/ds1.c 2000/07/19 21:18:45 1.8.2.1 >--- sys/dev/sound/pci/ds1.c 2000/07/28 15:05:44 >*************** >*** 114,119 **** >--- 114,124 ---- > int regid, irqid; > void *ih; > >+ u_int32_t workbase; >+ u_int32_t playctrlbase; >+ u_int32_t recctrlbase; >+ u_int32_t effctrlbase; >+ > u_int32_t *pbase, pbankbase, pbanksize; > volatile struct pbank *pbank[2 * 64]; > volatile struct rbank *rbank; >*************** >*** 819,834 **** > > cb = 0; > t = buf; >! ds_wr(sc, YDSXGR_WORKBASE, sc->ctrlbase + cb, 4); > cb += ws; > sc->pbase = (u_int32_t *)(t + cb); > /* printf("pbase = %p -> 0x%x\n", sc->pbase, sc->ctrlbase + cb); */ >! ds_wr(sc, YDSXGR_PLAYCTRLBASE, sc->ctrlbase + cb, 4); > cb += (64 + 1) * 4; > sc->rbank = (struct rbank *)(t + cb); >! ds_wr(sc, YDSXGR_RECCTRLBASE, sc->ctrlbase + cb, 4); > cb += 2 * 2 * rcs; >! ds_wr(sc, YDSXGR_EFFCTRLBASE, sc->ctrlbase + cb, 4); > cb += 5 * 2 * ecs; > > sc->pbankbase = sc->ctrlbase + cb; >--- 824,843 ---- > > cb = 0; > t = buf; >! sc->workbase = sc->ctrlbase + cb; >! ds_wr(sc, YDSXGR_WORKBASE, sc->workbase, 4); > cb += ws; > sc->pbase = (u_int32_t *)(t + cb); > /* printf("pbase = %p -> 0x%x\n", sc->pbase, sc->ctrlbase + cb); */ >! sc->playctrlbase = sc->ctrlbase + cb; >! ds_wr(sc, YDSXGR_PLAYCTRLBASE, sc->playctrlbase, 4); > cb += (64 + 1) * 4; > sc->rbank = (struct rbank *)(t + cb); >! sc->recctrlbase = sc->ctrlbase + cb; >! ds_wr(sc, YDSXGR_RECCTRLBASE, sc->recctrlbase, 4); > cb += 2 * 2 * rcs; >! sc->effctrlbase = sc->ctrlbase + cb; >! ds_wr(sc, YDSXGR_EFFCTRLBASE, sc->effctrlbase, 4); > cb += 5 * 2 * ecs; > > sc->pbankbase = sc->ctrlbase + cb; >*************** >*** 970,979 **** >--- 979,1039 ---- > return ENXIO; > } > >+ static int >+ ds_pci_suspend(device_t dev) >+ { >+ snddev_info *d = device_get_softc(dev); >+ struct sc_info *sc = (struct sc_info *)d->devinfo; >+ >+ ds_wr(sc, YDSXGR_NATIVEDACOUTVOL, 0x00000000, 4); >+ ds_enadsp(sc, 0); >+ >+ return 0; >+ } >+ >+ static int >+ ds_pci_resume(device_t dev) >+ { >+ int i; >+ u_int32_t r; >+ snddev_info *d = device_get_softc(dev); >+ struct sc_info *sc = (struct sc_info *)d->devinfo; >+ >+ ds_wr(sc, YDSXGR_NATIVEDACOUTVOL, 0x00000000, 4); >+ ds_enadsp(sc, 0); >+ ds_wr(sc, YDSXGR_MODE, 0x00010000, 4); >+ ds_wr(sc, YDSXGR_MODE, 0x00000000, 4); >+ ds_wr(sc, YDSXGR_MAPOFREC, 0x00000000, 4); >+ ds_wr(sc, YDSXGR_MAPOFEFFECT, 0x00000000, 4); >+ ds_wr(sc, YDSXGR_WORKBASE, 0x00000000, 4); >+ ds_wr(sc, YDSXGR_WORKBASE, sc->workbase, 4); >+ ds_wr(sc, YDSXGR_PLAYCTRLBASE, 0x00000000, 4); >+ ds_wr(sc, YDSXGR_PLAYCTRLBASE, sc->playctrlbase, 4); >+ ds_wr(sc, YDSXGR_RECCTRLBASE, 0x00000000, 4); >+ ds_wr(sc, YDSXGR_RECCTRLBASE, sc->recctrlbase, 4); >+ ds_wr(sc, YDSXGR_EFFCTRLBASE, 0x00000000, 4); >+ ds_wr(sc, YDSXGR_EFFCTRLBASE, sc->effctrlbase, 4); >+ r = ds_rd(sc, YDSXGR_GLOBALCTRL, 2); >+ ds_wr(sc, YDSXGR_GLOBALCTRL, r & ~0x0007, 2); >+ >+ for (i=0; i < sc->pchn; i++) >+ chn_resetbuf(sc->pch[i].channel); >+ for (i=0; i < sc->rchn; i++) >+ chn_resetbuf(sc->rch[i].channel); >+ >+ ds_enadsp(sc, 1); >+ mixer_reinit(d); >+ ds_wr(sc, YDSXGR_NATIVEDACOUTVOL, 0x3fff3fff, 4); >+ >+ return 0; >+ } >+ > static device_method_t ds1_methods[] = { > /* Device interface */ > DEVMETHOD(device_probe, ds_pci_probe), > DEVMETHOD(device_attach, ds_pci_attach), >+ DEVMETHOD(device_suspend, ds_pci_suspend), >+ 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 20255
: 10016