summaryrefslogtreecommitdiffstats
path: root/drivers/misc/ti-st/st_core.c
diff options
context:
space:
mode:
authorPavan Savoy <pavan_savoy@ti.com>2011-02-04 02:23:13 -0600
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-04 12:41:21 -0800
commitef04d121f030329aae0c2d3ec22beea0c5cbcfd3 (patch)
tree891fe4bd9a903b553d058ad08d787fbb07d64565 /drivers/misc/ti-st/st_core.c
parent6710fcff66ef0330cdc458557271ee86026745d0 (diff)
downloadop-kernel-dev-ef04d121f030329aae0c2d3ec22beea0c5cbcfd3.zip
op-kernel-dev-ef04d121f030329aae0c2d3ec22beea0c5cbcfd3.tar.gz
drivers:misc: ti-st: firmware download optimization
To fasten the process of firmware download, the chip allows disabling of the command complete event generation from host. In these cases, only few very essential commands would have the command complete events and hence the wait associated with them. So now the driver would wait for a command complete event, only when it comes across a wait event during firmware parsing. This would also mean we need to skip not just the change baud rate command but also the wait for it. Signed-off-by: Pavan Savoy <pavan_savoy@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 f7bb96f..dd2c879 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)
OpenPOWER on IntegriCloud