Re: Audio driver template
On Monday 09 July 2007 10:09:21 pm John-Mark Gurney wrote:
> Christopher Davis wrote this message on Mon, Jul 09, 2007 at 11:47 -0700:
> > http://people.freebsd.org/~cg/template.c
> >
> > Thought I would take a look at the audio driver template as
> > part of my task to modernize drivers, soc2007. I would simplify
> > the read and write functions to avoid using the bus tag and
> > handle, but I'm not sure what else to do to bring it up to date.
> >
> > How else can it be improved?
>
> Use bus_alloc_resources instead of using bus_alloc_resource...
> Maybe use pci_enable_busmaster and friends instead of using
> pci_write_config... (In the future for suspend/resume, I would hope
> our pci layer would save the state, which it might not if you write
> directly to the config registers.)
It already saves the state, and it does so by reading all the regs during
suspend, so that backdoor writes are saved and restored.
--
John Baldwin
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
討論串 (同標題文章)
完整討論串 (本文為第 5 之 7 篇):