summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2020-11-06 09:20:56 +0100
committerCommit Bot <commit-bot@chromium.org>2020-12-14 19:59:09 +0000
commitf96f176c303a73973d7cf5ddf1abf86f534a6e39 (patch)
treea793c58f008cfa94cc93ea34627fd1b6457e3a1b /chip
parenta23ef3d074335f2b6953194671f966117fd1fe60 (diff)
downloadchrome-ec-f96f176c303a73973d7cf5ddf1abf86f534a6e39.tar.gz
task_set_event: remove the wait argument
There is an option in the task_set_event function which force the calling task to wait for an event. However, the option is never used thus remove it. This also will help in the Zephyr migration process. BUG=b:172360521 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ic152fd3d6862d487bcc0024c48d136556c0b81bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521599 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/ish/heci.c2
-rw-r--r--chip/ish/i2c.c2
-rw-r--r--chip/ish/ipc_heci.c2
-rw-r--r--chip/it83xx/adc.c2
-rw-r--r--chip/it83xx/i2c.c2
-rw-r--r--chip/it83xx/intc.c7
-rw-r--r--chip/lm4/adc.c2
-rw-r--r--chip/lm4/i2c.c2
-rw-r--r--chip/mchp/i2c.c2
-rw-r--r--chip/mec1322/i2c.c2
-rw-r--r--chip/npcx/adc.c2
-rw-r--r--chip/npcx/cec.c2
-rw-r--r--chip/npcx/i2c.c13
-rw-r--r--chip/npcx/peci.c2
-rw-r--r--chip/npcx/ps2.c2
-rw-r--r--chip/stm32/dma-stm32f4.c2
-rw-r--r--chip/stm32/dma.c2
-rw-r--r--chip/stm32/i2c-stm32f4.c2
-rw-r--r--chip/stm32/ucpd-stm32gx.c19
-rw-r--r--chip/stm32/usb_pd_phy.c2
20 files changed, 34 insertions, 39 deletions
diff --git a/chip/ish/heci.c b/chip/ish/heci.c
index 309a17c0a1..4a9bc9551b 100644
--- a/chip/ish/heci.c
+++ b/chip/ish/heci.c
@@ -706,7 +706,7 @@ static int handle_flow_control_cmd(struct hbm_flow_control *flow_ctrl)
mutex_unlock(&connect->cred_lock);
if (waiting_task)
- task_set_event(waiting_task, TASK_EVENT_IPC_READY, 0);
+ task_set_event(waiting_task, TASK_EVENT_IPC_READY);
return EC_SUCCESS;
}
diff --git a/chip/ish/i2c.c b/chip/ish/i2c.c
index 962379cad3..eeb4b38d60 100644
--- a/chip/ish/i2c.c
+++ b/chip/ish/i2c.c
@@ -446,7 +446,7 @@ static void i2c_interrupt_handler(struct i2c_context *ctx)
/* disable interrupts */
i2c_intr_switch(ctx->base, DISABLE_INT);
- task_set_event(ctx->wait_task_id, TASK_EVENT_I2C_IDLE, 0);
+ task_set_event(ctx->wait_task_id, TASK_EVENT_I2C_IDLE);
}
static void i2c_isr_bus0(void)
diff --git a/chip/ish/ipc_heci.c b/chip/ish/ipc_heci.c
index 5271aa3a91..3b8f4a31d1 100644
--- a/chip/ish/ipc_heci.c
+++ b/chip/ish/ipc_heci.c
@@ -377,7 +377,7 @@ static void handle_msg_recv_interrupt(const uint32_t peer_id)
if (!invalid_msg) {
/* send event to task */
task_set_event(ctx->msg_events[protocol].task_id,
- ctx->msg_events[protocol].event, 0);
+ ctx->msg_events[protocol].event);
} else {
CPRINTS("discard msg (%d) : %d", protocol, invalid_msg);
diff --git a/chip/it83xx/adc.c b/chip/it83xx/adc.c
index b3eb6e25a0..2dc82abab4 100644
--- a/chip/it83xx/adc.c
+++ b/chip/it83xx/adc.c
@@ -208,7 +208,7 @@ void adc_interrupt(void)
task_disable_irq(IT83XX_IRQ_ADC);
/* Wake up the task which was waiting for the interrupt */
if (task_waiting != TASK_ID_INVALID)
- task_set_event(task_waiting, TASK_EVENT_ADC_DONE, 0);
+ task_set_event(task_waiting, TASK_EVENT_ADC_DONE);
}
#ifdef CONFIG_ADC_VOLTAGE_COMPARATOR
diff --git a/chip/it83xx/i2c.c b/chip/it83xx/i2c.c
index 3fac0fbec5..d6dc366f56 100644
--- a/chip/it83xx/i2c.c
+++ b/chip/it83xx/i2c.c
@@ -769,7 +769,7 @@ void i2c_interrupt(int port)
/* If done doing work, wake up the task waiting for the transfer */
if (!i2c_transaction(port)) {
task_disable_irq(i2c_ctrl_regs[port].irq);
- task_set_event(id, TASK_EVENT_I2C_IDLE, 0);
+ task_set_event(id, TASK_EVENT_I2C_IDLE);
}
}
diff --git a/chip/it83xx/intc.c b/chip/it83xx/intc.c
index 057e51293a..cc7ffc6c02 100644
--- a/chip/it83xx/intc.c
+++ b/chip/it83xx/intc.c
@@ -40,7 +40,7 @@ static void chip_pd_irq(enum usbpd_port port)
IT83XX_USBPD_ISR(port) = USBPD_REG_MASK_HARD_RESET_DETECT;
USBPD_SW_RESET(port);
task_set_event(PD_PORT_TO_TASK_ID(port),
- PD_EVENT_RX_HARD_RESET, 0);
+ PD_EVENT_RX_HARD_RESET);
}
if (USBPD_IS_RX_DONE(port)) {
@@ -59,7 +59,7 @@ static void chip_pd_irq(enum usbpd_port port)
/* clear TX done interrupt */
IT83XX_USBPD_ISR(port) = USBPD_REG_MASK_MSG_TX_DONE;
task_set_event(PD_PORT_TO_TASK_ID(port),
- TASK_EVENT_PHY_TX_DONE, 0);
+ TASK_EVENT_PHY_TX_DONE);
}
if (IS_ENABLED(IT83XX_INTC_PLUG_IN_OUT_SUPPORT)) {
@@ -84,8 +84,7 @@ static void chip_pd_irq(enum usbpd_port port)
/* clear type-c device plug in/out detect interrupt */
IT83XX_USBPD_TCDCR(port) |=
USBPD_REG_PLUG_IN_OUT_DETECT_STAT;
- task_set_event(PD_PORT_TO_TASK_ID(port),
- PD_EVENT_CC, 0);
+ task_set_event(PD_PORT_TO_TASK_ID(port), PD_EVENT_CC);
}
}
}
diff --git a/chip/lm4/adc.c b/chip/lm4/adc.c
index c06ce35df3..008288e520 100644
--- a/chip/lm4/adc.c
+++ b/chip/lm4/adc.c
@@ -189,7 +189,7 @@ static void handle_interrupt(int ss)
/* Wake up the task which was waiting on the interrupt, if any */
if (id != TASK_ID_INVALID)
- task_set_event(id, TASK_EVENT_ADC_DONE, 0);
+ task_set_event(id, TASK_EVENT_ADC_DONE);
}
void ss0_interrupt(void) { handle_interrupt(0); }
diff --git a/chip/lm4/i2c.c b/chip/lm4/i2c.c
index ac4456980d..70177df28f 100644
--- a/chip/lm4/i2c.c
+++ b/chip/lm4/i2c.c
@@ -393,7 +393,7 @@ static void handle_interrupt(int port)
/* If done doing work, wake up the task waiting for the transfer */
if (!i2c_do_work(port))
- task_set_event(id, TASK_EVENT_I2C_IDLE, 0);
+ task_set_event(id, TASK_EVENT_I2C_IDLE);
}
void i2c0_interrupt(void) { handle_interrupt(0); }
diff --git a/chip/mchp/i2c.c b/chip/mchp/i2c.c
index 8016938160..606e931a13 100644
--- a/chip/mchp/i2c.c
+++ b/chip/mchp/i2c.c
@@ -950,7 +950,7 @@ static void handle_interrupt(int controller)
/* Wake up the task which was waiting on the I2C interrupt, if any. */
if (id != TASK_ID_INVALID)
- task_set_event(id, TASK_EVENT_I2C_IDLE, 0);
+ task_set_event(id, TASK_EVENT_I2C_IDLE);
}
void i2c0_interrupt(void) { handle_interrupt(0); }
diff --git a/chip/mec1322/i2c.c b/chip/mec1322/i2c.c
index 33b6c6242c..aecc8abd9b 100644
--- a/chip/mec1322/i2c.c
+++ b/chip/mec1322/i2c.c
@@ -517,7 +517,7 @@ static void handle_interrupt(int controller)
/* Wake up the task which was waiting on the I2C interrupt, if any. */
if (id != TASK_ID_INVALID)
- task_set_event(id, TASK_EVENT_I2C_IDLE, 0);
+ task_set_event(id, TASK_EVENT_I2C_IDLE);
}
void i2c0_interrupt(void) { handle_interrupt(0); }
diff --git a/chip/npcx/adc.c b/chip/npcx/adc.c
index 365b401b87..768e7dff27 100644
--- a/chip/npcx/adc.c
+++ b/chip/npcx/adc.c
@@ -338,7 +338,7 @@ void adc_interrupt(void)
/* Wake up the task which was waiting for the interrupt */
if (task_waiting != TASK_ID_INVALID)
- task_set_event(task_waiting, TASK_EVENT_ADC_DONE, 0);
+ task_set_event(task_waiting, TASK_EVENT_ADC_DONE);
}
for (i = NPCX_THRCTS_THR1_STS; i < NPCX_ADC_THRESH_CNT; i++) {
diff --git a/chip/npcx/cec.c b/chip/npcx/cec.c
index 67eda331a6..ebaefa551a 100644
--- a/chip/npcx/cec.c
+++ b/chip/npcx/cec.c
@@ -505,7 +505,7 @@ void enter_state(enum cec_state new_state)
addr = cec_rx.transfer.buf[0] & 0x0f;
if (addr == cec_addr || addr == CEC_BROADCAST_ADDR) {
task_set_event(TASK_ID_CEC,
- TASK_EVENT_RECEIVED_DATA, 0);
+ TASK_EVENT_RECEIVED_DATA);
}
timeout = DATA_ZERO_HIGH_TICKS;
} else {
diff --git a/chip/npcx/i2c.c b/chip/npcx/i2c.c
index 90465415e7..5177aa0c31 100644
--- a/chip/npcx/i2c.c
+++ b/chip/npcx/i2c.c
@@ -493,8 +493,7 @@ void i2c_done(int controller)
task_disable_irq(i2c_irqs[controller]);
/* Notify upper layer */
- task_set_event(p_status->task_waiting,
- TASK_EVENT_I2C_IDLE, 0);
+ task_set_event(p_status->task_waiting, TASK_EVENT_I2C_IDLE);
CPUTS("-END");
}
@@ -551,8 +550,7 @@ static void i2c_handle_receive(int controller)
/* Set error code */
p_status->err_code = SMB_OK;
/* Notify upper layer of missing data */
- task_set_event(p_status->task_waiting,
- TASK_EVENT_I2C_IDLE, 0);
+ task_set_event(p_status->task_waiting, TASK_EVENT_I2C_IDLE);
CPUTS("-END");
}
}
@@ -647,8 +645,7 @@ static void i2c_fifo_handle_receive(int controller)
/* Set error code */
p_status->err_code = SMB_OK;
/* Notify upper layer of missing data */
- task_set_event(p_status->task_waiting,
- TASK_EVENT_I2C_IDLE, 0);
+ task_set_event(p_status->task_waiting, TASK_EVENT_I2C_IDLE);
CPUTS("-END");
}
@@ -767,7 +764,7 @@ void i2c_master_int_handler (int controller)
p_status->err_code = SMB_BUS_ERROR;
/* Notify upper layer */
p_status->oper_state = SMB_IDLE;
- task_set_event(p_status->task_waiting, TASK_EVENT_I2C_IDLE, 0);
+ task_set_event(p_status->task_waiting, TASK_EVENT_I2C_IDLE);
CPUTS("-BER");
/*
@@ -791,7 +788,7 @@ void i2c_master_int_handler (int controller)
p_status->err_code = SMB_MASTER_NO_ADDRESS_MATCH;
/* Notify upper layer */
p_status->oper_state = SMB_IDLE;
- task_set_event(p_status->task_waiting, TASK_EVENT_I2C_IDLE, 0);
+ task_set_event(p_status->task_waiting, TASK_EVENT_I2C_IDLE);
CPUTS("-NA");
}
diff --git a/chip/npcx/peci.c b/chip/npcx/peci.c
index f3145bd2a7..badfbd87d9 100644
--- a/chip/npcx/peci.c
+++ b/chip/npcx/peci.c
@@ -271,7 +271,7 @@ DECLARE_HOOK(HOOK_INIT, peci_init, HOOK_PRIO_DEFAULT);
/* If received a PECI DONE interrupt, post the event to PECI task */
void peci_done_interrupt(void){
if (peci_pending_task_id != NULL_PENDING_TASK_ID)
- task_set_event(peci_pending_task_id, TASK_EVENT_PECI_DONE, 0);
+ task_set_event(peci_pending_task_id, TASK_EVENT_PECI_DONE);
peci_sts = NPCX_PECI_CTL_STS & 0x18;
/* no matter what, clear status bit again */
SET_BIT(NPCX_PECI_CTL_STS, NPCX_PECI_CTL_STS_DONE);
diff --git a/chip/npcx/ps2.c b/chip/npcx/ps2.c
index c470bbe68d..7b8086cbcd 100644
--- a/chip/npcx/ps2.c
+++ b/chip/npcx/ps2.c
@@ -293,7 +293,7 @@ void ps2_int_handler(void)
/* Change the PS/2 module to receive mode */
CLEAR_BIT(NPCX_PS2_PSCON, NPCX_PS2_PSCON_XMT);
ps2_ch_data[active_ch].opr_mode = PS2_RX_MODE;
- task_set_event(task_waiting, TASK_EVENT_PS2_DONE, 0);
+ task_set_event(task_waiting, TASK_EVENT_PS2_DONE);
} else {
if (!ps2_is_rx_error(active_ch)) {
uint8_t data_read = NPCX_PS2_PSDAT;
diff --git a/chip/stm32/dma-stm32f4.c b/chip/stm32/dma-stm32f4.c
index abb33befda..860874de8c 100644
--- a/chip/stm32/dma-stm32f4.c
+++ b/chip/stm32/dma-stm32f4.c
@@ -261,7 +261,7 @@ static inline void _dma_wake_callback(void *cb_data)
task_id_t id = (task_id_t)(int)cb_data;
if (id != TASK_ID_INVALID)
- task_set_event(id, TASK_EVENT_DMA_TC, 0);
+ task_set_event(id, TASK_EVENT_DMA_TC);
}
void dma_enable_tc_interrupt(enum dma_channel stream)
diff --git a/chip/stm32/dma.c b/chip/stm32/dma.c
index a2ed6ca3cb..cd6038b2aa 100644
--- a/chip/stm32/dma.c
+++ b/chip/stm32/dma.c
@@ -276,7 +276,7 @@ static inline void _dma_wake_callback(void *cb_data)
{
task_id_t id = (task_id_t)(int)cb_data;
if (id != TASK_ID_INVALID)
- task_set_event(id, TASK_EVENT_DMA_TC, 0);
+ task_set_event(id, TASK_EVENT_DMA_TC);
}
void dma_enable_tc_interrupt(enum dma_channel channel)
diff --git a/chip/stm32/i2c-stm32f4.c b/chip/stm32/i2c-stm32f4.c
index df6e61564f..c1f19704b5 100644
--- a/chip/stm32/i2c-stm32f4.c
+++ b/chip/stm32/i2c-stm32f4.c
@@ -79,7 +79,7 @@ static inline void _i2c_dma_wake_callback(void *cb_data, int port)
task_id_t id = (task_id_t)(int)cb_data;
if (id != TASK_ID_INVALID)
- task_set_event(id, TASK_EVENT_I2C_COMPLETION(port), 0);
+ task_set_event(id, TASK_EVENT_I2C_COMPLETION(port));
}
/* Each callback is hardcoded to an I2C channel. */
diff --git a/chip/stm32/ucpd-stm32gx.c b/chip/stm32/ucpd-stm32gx.c
index 8a21087b05..f0240230c7 100644
--- a/chip/stm32/ucpd-stm32gx.c
+++ b/chip/stm32/ucpd-stm32gx.c
@@ -777,7 +777,7 @@ static void ucpd_send_good_crc(int port, uint16_t rx_header)
ucpd_tx_buffers[TX_MSG_GOOD_CRC].type = tx_type;
/* Notify ucpd task that a GoodCRC message tx request is pending */
- task_set_event(TASK_ID_UCPD, UCPD_EVT_GOOD_CRC_REQ, 0);
+ task_set_event(TASK_ID_UCPD, UCPD_EVT_GOOD_CRC_REQ);
}
int stm32gx_ucpd_transmit(int port,
@@ -800,7 +800,7 @@ int stm32gx_ucpd_transmit(int port,
len - 2);
/* Notify ucpd task that a TCPM message tx request is pending */
- task_set_event(TASK_ID_UCPD, UCPD_EVT_TCPM_MSG_REQ, 0);
+ task_set_event(TASK_ID_UCPD, UCPD_EVT_TCPM_MSG_REQ);
return EC_SUCCESS;
}
@@ -847,7 +847,7 @@ void stm32gx_ucpd1_irq(void)
/* Check for CC events, set event to wake PD task */
if (sr & (STM32_UCPD_SR_TYPECEVT1 | STM32_UCPD_SR_TYPECEVT2))
- task_set_event(PD_PORT_TO_TASK_ID(port), PD_EVENT_CC, 0);
+ task_set_event(PD_PORT_TO_TASK_ID(port), PD_EVENT_CC);
/*
* Check for Tx events. tx_mask includes all status bits related to the
@@ -858,18 +858,17 @@ void stm32gx_ucpd1_irq(void)
if (sr & tx_done_mask) {
/* Check for tx message complete */
if (sr & STM32_UCPD_SR_TXMSGSENT) {
- task_set_event(TASK_ID_UCPD, UCPD_EVT_TX_MSG_SUCCESS,
- 0);
+ task_set_event(TASK_ID_UCPD, UCPD_EVT_TX_MSG_SUCCESS);
#ifdef CONFIG_STM32G4_UCPD_DEBUG
ucpd_log_mark_tx_comp();
#endif
} else if (sr & (STM32_UCPD_SR_TXMSGABT |
STM32_UCPD_SR_TXMSGDISC |STM32_UCPD_SR_TXUND)) {
- task_set_event(TASK_ID_UCPD, UCPD_EVT_TX_MSG_FAIL, 0);
+ task_set_event(TASK_ID_UCPD, UCPD_EVT_TX_MSG_FAIL);
} else if (sr & STM32_UCPD_SR_HRSTSENT) {
- task_set_event(TASK_ID_UCPD, UCPD_EVT_HR_DONE, 0);
+ task_set_event(TASK_ID_UCPD, UCPD_EVT_HR_DONE);
} else if (sr & STM32_UCPD_SR_HRSTDISC) {
- task_set_event(TASK_ID_UCPD, UCPD_EVT_HR_FAIL, 0);
+ task_set_event(TASK_ID_UCPD, UCPD_EVT_HR_FAIL);
}
/* Disable Tx interrupts */
ucpd_tx_interrupts_enable(port, 0);
@@ -906,7 +905,7 @@ void stm32gx_ucpd1_irq(void)
ucpd_send_good_crc(port, *rx_header);
} else {
task_set_event(TASK_ID_UCPD,
- UCPD_EVT_RX_GOOD_CRC, 0);
+ UCPD_EVT_RX_GOOD_CRC);
ucpd_crc_id = PD_HEADER_ID(*rx_header);
}
}
@@ -915,7 +914,7 @@ void stm32gx_ucpd1_irq(void)
if (sr & STM32_UCPD_SR_RXHRSTDET) {
/* hard reset received */
pd_execute_hard_reset(port);
- task_set_event(PD_PORT_TO_TASK_ID(port), TASK_EVENT_WAKE, 0);
+ task_set_event(PD_PORT_TO_TASK_ID(port), TASK_EVENT_WAKE);
hook_call_deferred(&ucpd_hard_reset_rx_log_data, 0);
}
diff --git a/chip/stm32/usb_pd_phy.c b/chip/stm32/usb_pd_phy.c
index b53c5cfeeb..90506d8975 100644
--- a/chip/stm32/usb_pd_phy.c
+++ b/chip/stm32/usb_pd_phy.c
@@ -303,7 +303,7 @@ static void tx_dma_done(void *data)
pd_tx_disable(port, polarity);
#if defined(CONFIG_COMMON_RUNTIME) && defined(CONFIG_DMA_DEFAULT_HANDLERS)
- task_set_event(PD_PORT_TO_TASK_ID(port), TASK_EVENT_DMA_TC, 0);
+ task_set_event(PD_PORT_TO_TASK_ID(port), TASK_EVENT_DMA_TC);
#endif
}