diff options
author | Anton Staaf <robotboy@chromium.org> | 2015-06-16 10:34:56 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-07-15 21:57:46 +0000 |
commit | 137959bb88ef381cba67e24943388bd17ae89357 (patch) | |
tree | d4844e76548432b726cf40d57bf0214d92d64634 /driver/mcdp28x0.c | |
parent | 88a1790bb7d82a30e052f1e10a9c7c88fb5c5c36 (diff) | |
download | chrome-ec-137959bb88ef381cba67e24943388bd17ae89357.tar.gz |
USART: Add flexibility needed to support DMA
In order to support DMA transfers in one or both directions the usart
driver needs to be configurable with producer/consumer operations and
interrupt handler functions. These are now packaged up in the usart_rx
and usart_tx structs, and versions for interrupt driven RX and TX are
provided.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Change-Id: I3fd14c675c90873e903195b8e20d2070d2eda5ac
Reviewed-on: https://chromium-review.googlesource.com/285023
Trybot-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'driver/mcdp28x0.c')
-rw-r--r-- | driver/mcdp28x0.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/driver/mcdp28x0.c b/driver/mcdp28x0.c index 216d271737..0a39e5e225 100644 --- a/driver/mcdp28x0.c +++ b/driver/mcdp28x0.c @@ -38,7 +38,7 @@ static inline void print_buffer(uint8_t *buf, int cnt) static inline void print_buffer(uint8_t *buf, int cnt) {} #endif -struct usart_config const usart_mcdp; +static struct usart_config const usart_mcdp; struct queue const usart_mcdp_rx_queue = QUEUE_DIRECT(MCDP_INBUF_MAX, uint8_t, @@ -49,11 +49,12 @@ struct queue const usart_mcdp_tx_queue = QUEUE_DIRECT(MCDP_OUTBUF_MAX, null_producer, usart_mcdp.consumer); -USART_CONFIG(usart_mcdp, - CONFIG_MCDP28X0, - 115200, - usart_mcdp_rx_queue, - usart_mcdp_tx_queue); +static struct usart_config const usart_mcdp = USART_CONFIG(CONFIG_MCDP28X0, + usart_rx_interrupt, + usart_tx_interrupt, + 115200, + usart_mcdp_rx_queue, + usart_mcdp_tx_queue); /** * Compute checksum. |