Commit Graph

13 Commits

Author SHA1 Message Date
Dmitry Baryshkov
8f668bde64 laurent: driver for KernelChip Laurent family of relays
Add support for the KernelChip Laurent-2 / Laurent-5 / Laurent-112 /
Laurent-128 network-controlled relay arrays.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2024-03-30 18:20:12 +02:00
Dmitry Baryshkov
ca5f95d6cd cdba-power: add power-on/-off tool
Add simple tool reusing CDBA code to power boards on and off.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2024-03-30 18:06:19 +02:00
Dmitry Baryshkov
2f1caa28c0 tty: split tty_open to a separate file
Split the function tty_open() to a separate file.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2024-03-30 18:06:19 +02:00
Dmitry Baryshkov
f6bd2d01d7 watch: split implementation to aseparate file
Split CDBA's watching code to a separate file.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2024-03-30 18:06:19 +02:00
Dmitry Baryshkov
b6c6807add drivers: move device / console backends to separte dir
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>
2024-03-30 18:06:17 +02:00
Bjorn Andersson
81e46878ed cdba-server: Allow external status command
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>
2023-11-27 21:19:57 -06:00
Bjorn Andersson
1cef583b11 cdba-server: Introduce helper for sending measurements
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>
2023-11-27 21:18:23 -06:00
Caleb Connolly
ba8fa6e300 only enable -Werror in CI
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>
2023-11-06 12:24:53 +00:00
Dmitry Baryshkov
7b73465375 meson: support client-only builds
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>
2023-11-02 11:32:38 +02:00
Neil Armstrong
87fbc38286 Add local gpio control
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>
2023-10-30 16:16:36 +01:00
Dmitry Baryshkov
310004badb external: control the board using external program
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>
2023-10-02 17:33:13 +03:00
Neil Armstrong
f7d7054933 Add meson build to CI
Add x86_64 only meson build for now, meson requires some
cross-compile files to be passed.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-10-02 15:18:56 +02:00
Neil Armstrong
606a242dcf Introduce meson.build
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>
2023-10-02 11:10:51 +02:00