summaryrefslogtreecommitdiff
path: root/board/ryu/usb_pd_config.h
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2014-10-17 00:12:10 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-21 00:44:07 +0000
commit46f033171171f93bbb6021f1e8c1b6b2adf925cf (patch)
treea9d0b9381199a893901642f671c160ad6091df7d /board/ryu/usb_pd_config.h
parent0e3497762c71e6c4cd7fe6b7f71beb15ff654f6f (diff)
downloadchrome-ec-46f033171171f93bbb6021f1e8c1b6b2adf925cf.tar.gz
pd: allow selection of Tx timer channel
So far, we always use channel 1 of the Tx timer and the configuration code is hard coded. We need to support other channels for new Ryu boards. Let's make this a configurable bit. BRANCH=samus BUG=chrome-os-partner:32660 TEST=make buildall TEST=Plug in Zinger to Ryu and see 20V come up. Change-Id: Id08d4eb0d6a5721d8a03672484d0892a0714383b Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/223836 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/ryu/usb_pd_config.h')
-rw-r--r--board/ryu/usb_pd_config.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/board/ryu/usb_pd_config.h b/board/ryu/usb_pd_config.h
index 3d7506d882..8bea5276c2 100644
--- a/board/ryu/usb_pd_config.h
+++ b/board/ryu/usb_pd_config.h
@@ -22,6 +22,7 @@
/* Timer channel */
#define TIM_RX_CCR_C0 1
+#define TIM_TX_CCR_C0 1
/* RX timer capture/compare register */
#define TIM_CCR_C0 (&STM32_TIM_CCRx(TIM_CLOCK_PD_RX_C0, TIM_RX_CCR_C0))
@@ -50,7 +51,8 @@ static inline void spi_enable_clock(int port)
#define CMP1OUTSEL STM32_COMP_CMP1OUTSEL_TIM1_IC1
#define CMP2OUTSEL STM32_COMP_CMP2OUTSEL_TIM1_IC1
-#define TIM_CCR_IDX(p) TIM_RX_CCR_C0
+#define TIM_TX_CCR_IDX(p) TIM_TX_CCR_C0
+#define TIM_RX_CCR_IDX(p) TIM_RX_CCR_C0
#define TIM_CCR_CS 1
#define EXTI_COMP_MASK(p) ((1 << 21) | (1 << 22))
#define IRQ_COMP STM32_IRQ_COMP