gadget: fix gadget teardown order

Currently we are tearing down the functionfs backend before
we disable the gadget device itself. Fix this by disabling
the gadget, then tearing down the backing I/O.

Signed-off-by: Matt Porter <mporter@linaro.org>
gadget: clean up status message

Message was a bit redundant, fix that.

Signed-off-by: Matt Porter <mporter@linaro.org>
cport: refactor cport handling and add initial i2c support

Refactor the stubbed out cport handling to allows for multiple
protocol handlers. For now, the i2c_handler is called because we
don't yet track which cport is registered to handle a protocol.
Implement the i2c handler such that writes are consumed with
a success response and displayed and reads return an incrementing
byte stream to assist in verification.

Signed-off-by: Matt Porter <mporter@linaro.org>
Merge branch 'master' of ssh://github.com/ohporter/gbsim

Conflicts:
	functionfs.c

Signed-off-by: Matt Porter <mporter@linaro.org>