Moved over code from davinci-pcm.c, now to start carving it up