Here is a link to a series of of articles about writing a device driver for a speaker. http://www.linuxgazette.com/issue69/mathew.html