In order to stop clobbering the root directory, move all device and
console backends to drivers/ subdir.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
While the CDB Assist and QcomLT Debugboard is measuring voltage and
current on the DC jack directly in the backend, other backends and
further measurements can be performed using custom tooling.
Introduce support for invoking an external "status-cmd" to produce such
status updates.
The status command should on its stdout produce json-formatted status
updates following the same format as the cdba-server:
{"ts":%d.%03d, "name": {["mv"|"ma"]: %u}(, "name2": {["mv"|"ma"]: %u})*}
with the ts aquired using clock_gettime(CLOCK_MONOTONIC) and provided in
seconds and milliseconds since the first measurement.
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
The current format of the cdb_assist backend status messages was never
intended to be parsed by a non-human, and the format doesn't extend well
to other backends.
Extend the format to be formatted as a json string, with a timestamp,
implemented in a separate status module.
The button status is skipped from the new status message, as it reflect
the output-values as set by cdba itself, rather than any measured state.
The timestamp is offset to the first measurement, to avoid disclosing
the uptime of the machine cdba-server is running on.
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Enabling -Werror by default sucks for everyone who isn't maintaining
CDBA. By all means we should enable it in CI, but not for users and
not for folks packaging it in distros.
Remove it from the flags in meson.build, and use mesons built in option
to enable it only in CI.
See:
https://embeddedartistry.com/blog/2017/05/22/werror-is-not-your-friend/
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
It is expected that the majority of CDBA users do not need the server
binary. Allow users to disable the cdba-server binary and build just the
client.
Fixes: #48
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This driver permits controlling local (on the system) gpios
by using the libgpiod library.
Support for gpiod v1 and v2 is added, and parses the options
via the yaml parser.
This can be tested with the gpio-sim module:
https://docs.kernel.org/admin-guide/gpio/gpio-sim.html
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Control the board using external program. It will be called with 3
arguments: <board> <command> <on/off>, where command is one of "power",
"usb", "key-fastboot", "key-power".
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Introduce meson.build to be used with the Meson build system,
which handles the dependency and advanced compiler options
for when used on various linux distributions.
The libftdi .so for example has different names on different
distribution, using meson makes sure we can handle those easily,
and easily integrate with other package build systems like
Yocto or Buildroot.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>