summaryrefslogtreecommitdiff
path: root/drivers/misc/ti-st/st_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/ti-st/st_core.c')
-rw-r--r--drivers/misc/ti-st/st_core.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index f7bb96f3a424..dd2c879faff6 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -52,6 +52,24 @@ static void remove_channel_from_table(struct st_data_s *st_gdata,
st_gdata->list[proto->chnl_id] = NULL;
}
+/*
+ * called from KIM during firmware download.
+ *
+ * This is a wrapper function to tty->ops->write_room.
+ * It returns number of free space available in
+ * uart tx buffer.
+ */
+int st_get_uart_wr_room(struct st_data_s *st_gdata)
+{
+ struct tty_struct *tty;
+ if (unlikely(st_gdata == NULL || st_gdata->tty == NULL)) {
+ pr_err("tty unavailable to perform write");
+ return -1;
+ }
+ tty = st_gdata->tty;
+ return tty->ops->write_room(tty);
+}
+
/* can be called in from
* -- KIM (during fw download)
* -- ST Core (during st_write)