If you're writing a driver for a custom type of device where it doesn't make sense to split up the functionality of device and protocol, you can write a combination module.
To do this, you simply proceed as you would when writing a "normal" driver: fill in your callbacks, talk to your device, interpret its protocol, etc.
In addition, there are two things you have to do: