Add macro for checking NULL parameters in a driver

The core of libqiprog consists of action(device *dev), where we dereference
the driver in dev, and call its drv->action. dev and dev-drv cannot be
NULL. To not boilerplate this check in every core function, use a macro to
do the checking.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
libqiprog: Move core functionality to a separate file

We need the ultra-light QiProg core to be separate from the library
initialization and device detection. This allows us to reuse the core in
QiProg devices as well.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
libqiprog: Remove unused 'init' member in drivers

A driver should not need to initialize itself in order to perform its
duties. A device's initialization should be handled in .dev_open, if needed
We can bring .init back later if it makes sense, but for now, take it out.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
doc: "Pretty-ize" protocol description in markdown format

The old plaintext form was slightly readable in a text editor, and
completely harsh on the eyes in a browser. I find the new markdown form
easier to read in both a browser and text editor.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
libqirpog Add members for all functions in driver struct

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
libqiprog: Implement qiprog_set_bus

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>