bionic: Fix "size_t undefined" error

Include stdio.h, which pulls in the definition of size_t, which is used
as an argument for certain functions.

Signed-off-by: Sean Cross <xobs@kosagi.com>
board-type: Support explicit initialization

Export the initialization function, to ensure that the value is read
on system boot.  Otherwise, we might not read the correct system type.

Signed-off-by: Sean Cross <xobs@kosagi.com>
ac: Add file to read AC power status

Rather than directly read the GPIO registers, add a function to return
the current state of the AC pin.

Signed-off-by: Sean Cross <xobs@kosagi.com>
main: Detect the board type on startup

Board-type is used in a few places, particularly to lock out commands that
don't exist on certain boards.

Signed-off-by: Sean Cross <xobs@kosagi.com>
senoko-slave: Use new ac-detect functions
senoko-events: Use new ac-detect function

Signed-off-by: Sean Cross <xobs@kosagi.com>
gg: Add function to return term voltage

We want to power off the main board when the voltage gets to the "term
voltage" to prevent the battery from draining too much.  Once we do that,
the voltage should rise and we should have a watt or two during which Senoko
will continue to run.

Signed-off-by: Sean Cross <xobs@kosagi.com>
chg: Cut power to mainboard when voltage is too low

Monitor the voltage, and compare it against the "term voltage" value of
the battery.  If the votlage drops below the "term voltage" and the
mainboard is on and unplugged, turn off the mainboard immedaitely.

This prevents damaging the battery, which would be a bad thing.

Signed-off-by: Sean Cross <xobs@kosagi.com>
power: Export powerOff/powerOn fuunctions

These functions are already defined, but they do not exist in the header
file.  Add them here.

Signed-off-by: Sean Cross <xobs@kosagi.com>