When you install the source code for the Linux kernel, it comes a fair amount of documentation. In the top level directory there is a README file that goes over it.
In the Documentation directory there are a number of files related to handling drivers.
Now whether or not you actually need to do that is a different subject. There are a number of how-to documents you can google for that go over compiling drivers outside the kernel source tree. You do need the kernel headers, but these are usually available from the distribution.