console: Add send_break support

Add support for send_break to the generic console implementation.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Bjorn Andersson
2021-01-22 18:04:58 -06:00
parent e685d367bc
commit 776f8c30fb
3 changed files with 7 additions and 0 deletions

View File

@@ -68,3 +68,8 @@ int console_write(struct device *device, const void *buf, size_t len)
{
return write(device->console_fd, buf, len);;
}
void console_send_break(struct device *device)
{
tcsendbreak(device->console_fd, 0);
}

View File

@@ -5,5 +5,6 @@
void console_open(struct device *device);
int console_write(struct device *device, const void *buf, size_t len);
void console_send_break(struct device *device);
#endif

View File

@@ -122,6 +122,7 @@ static void parse_board(struct device_parser *dp)
} else if (!strcmp(key, "console")) {
dev->console_dev = strdup(value);
dev->write = console_write;
dev->send_break = console_send_break;
} else if (!strcmp(key, "voltage")) {
dev->voltage = strtoul(value, NULL, 10);
} else if (!strcmp(key, "fastboot")) {