mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 18:35:28 +00:00
cleanup: add square brackets to make test parser easier
This may not contain all. I filtered out possible code by the
following command:
find . -name "*.h*" -o -name "*.c*" | xargs grep -n CPRINTF | \
grep -v "\[" | grep -v define | less
BUG=none
BRANCH=none
TEST=make buildall tuntests
Change-Id: I674f84f5966b34aeb8d4321d22629b450627a120
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/197997
This commit is contained in:
committed by
chrome-internal-fetch
parent
58c50a970a
commit
4ba7a1502d
@@ -209,7 +209,7 @@ int gpio_enable_interrupt(enum gpio_signal signal)
|
||||
bit = 31 - __builtin_clz(g->mask);
|
||||
|
||||
if (exti_events[bit]) {
|
||||
CPRINTF("Overriding %s with %s on EXTI%d\n",
|
||||
CPRINTF("[%T Overriding %s with %s on EXTI%d]\n",
|
||||
exti_events[bit]->name, g->name, bit);
|
||||
}
|
||||
exti_events[bit] = g;
|
||||
|
||||
@@ -210,7 +210,7 @@ int gpio_enable_interrupt(enum gpio_signal signal)
|
||||
bit = 31 - __builtin_clz(g->mask);
|
||||
|
||||
if (exti_events[bit]) {
|
||||
CPRINTF("Overriding %s with %s on EXTI%d\n",
|
||||
CPRINTF("[%T Overriding %s with %s on EXTI%d]\n",
|
||||
exti_events[bit]->name, g->name, bit);
|
||||
}
|
||||
exti_events[bit] = g;
|
||||
|
||||
@@ -214,7 +214,7 @@ int gpio_enable_interrupt(enum gpio_signal signal)
|
||||
bit = 31 - __builtin_clz(g->mask);
|
||||
|
||||
if (exti_events[bit]) {
|
||||
CPRINTF("Overriding %s with %s on EXTI%d\n",
|
||||
CPRINTF("[%T Overriding %s with %s on EXTI%d]\n",
|
||||
exti_events[bit]->name, g->name, bit);
|
||||
}
|
||||
exti_events[bit] = g;
|
||||
|
||||
@@ -256,7 +256,9 @@ static void i2c_event_handler(int port)
|
||||
|
||||
/* Confirm that you are not in master mode */
|
||||
if (STM32_I2C_SR2(port) & (1 << 0)) {
|
||||
CPRINTF("I2C slave ISR triggered in master mode, ignoring.\n");
|
||||
CPRINTF(
|
||||
"[%T I2C slave ISR triggered in "
|
||||
"master mode, ignoring]\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -314,9 +316,9 @@ static void i2c_error_handler(int port)
|
||||
/* ACK failed (NACK); expected when AP reads final byte.
|
||||
* Software must clear AF bit. */
|
||||
} else {
|
||||
CPRINTF("%s: I2C_SR1(%d): 0x%04x\n",
|
||||
CPRINTF("[%T %s: I2C_SR1(%d): 0x%04x]\n",
|
||||
__func__, port, i2c_sr1[port]);
|
||||
CPRINTF("%s: I2C_SR2(%d): 0x%04x\n",
|
||||
CPRINTF("[%T %s: I2C_SR2(%d): 0x%04x]\n",
|
||||
__func__, port, STM32_I2C_SR2(port));
|
||||
}
|
||||
|
||||
@@ -550,7 +552,7 @@ static void handle_i2c_error(int port, int rv)
|
||||
/* EC_ERROR_TIMEOUT may have a code specifying where the timeout was */
|
||||
if ((rv & 0xff) == EC_ERROR_TIMEOUT) {
|
||||
#ifdef CONFIG_I2C_DEBUG
|
||||
CPRINTF("Wait_status() timeout type: %d\n", (rv >> 8));
|
||||
CPRINTF("[%T Wait_status() timeout type: %d]\n", (rv >> 8));
|
||||
#endif
|
||||
rv = EC_ERROR_TIMEOUT;
|
||||
}
|
||||
@@ -572,7 +574,7 @@ static void handle_i2c_error(int port, int rv)
|
||||
* (Probably a stray pulse on the line got it out of sync with
|
||||
* the actual bytes) so reset it.
|
||||
*/
|
||||
CPRINTF("Unable to send START, resetting i2c.\n");
|
||||
CPRINTF("[%T Unable to send START, resetting i2c]\n");
|
||||
i2c_init_port(port);
|
||||
goto cr_cleanup;
|
||||
} else if (rv == EC_ERROR_TIMEOUT && !(r & 2)) {
|
||||
@@ -581,7 +583,7 @@ static void handle_i2c_error(int port, int rv)
|
||||
* It seems that this can be happen very briefly while sending
|
||||
* a 1. We've not actually seen this, but just to be safe.
|
||||
*/
|
||||
CPRINTF("Bad BUSY bit detected.\n");
|
||||
CPRINTF("[%T Bad BUSY bit detected]\n");
|
||||
master_stop(port);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ static void i2c_set_freq_port(const struct i2c_port_t *p)
|
||||
STM32_I2C_TIMINGR(port) = 0xB0420F13;
|
||||
break;
|
||||
default: /* unknown speed, defaults to 100kBps */
|
||||
CPRINTF("Unsupported speed %d kBps\n", p->kbps);
|
||||
CPRINTF("[%T I2C bad speed %d kBps]\n", p->kbps);
|
||||
STM32_I2C_TIMINGR(port) = 0xB0420F13;
|
||||
}
|
||||
/* Enable port */
|
||||
|
||||
@@ -84,7 +84,7 @@ static int wait_bits(int nb)
|
||||
&& !(STM32_TIM_SR(TIM_RX) & 4))
|
||||
; /* optimized for latency, not CPU usage ... */
|
||||
if (dma_bytes_done(rx, PD_MAX_RAW_SIZE) < nb) {
|
||||
CPRINTF("TMOUT RX %d/%d\n",
|
||||
CPRINTF("[%T PD TMOUT RX %d/%d]\n",
|
||||
dma_bytes_done(rx, PD_MAX_RAW_SIZE), nb);
|
||||
return -1;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ int pd_dequeue_bits(void *ctxt, int off, int len, uint32_t *val)
|
||||
return -1;
|
||||
}
|
||||
stream_err:
|
||||
CPRINTF("Invalid %d @%d\n", cnt, off);
|
||||
CPRINTF("[%T PD Invalid %d @%d]\n", cnt, off);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ int pd_find_preamble(void *ctxt)
|
||||
!(STM32_TIM_SR(TIM_RX) & 4))
|
||||
;
|
||||
if (STM32_TIM_SR(TIM_RX) & 4) {
|
||||
CPRINTF("TMOUT RX %d/%d\n",
|
||||
CPRINTF("[%T PD TMOUT RX %d/%d]\n",
|
||||
PD_MAX_RAW_SIZE - rx->cndtr, bit);
|
||||
return -1;
|
||||
}
|
||||
@@ -524,7 +524,7 @@ void *pd_hw_init(void)
|
||||
STM32_EXTI_IMR |= EXTI_COMP_MASK;
|
||||
task_enable_irq(IRQ_COMP);
|
||||
|
||||
CPRINTF("USB PD initialized\n");
|
||||
CPRINTF("[%T USB PD initialized]\n");
|
||||
return raw_samples;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ static void button_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
CPRINTF("[%T (re)initializing buttons and interrupts.]\n");
|
||||
CPRINTF("[%T (re)initializing buttons and interrupts]\n");
|
||||
next_deferred_time = 0;
|
||||
for (i = 0; i < CONFIG_BUTTON_COUNT; i++) {
|
||||
state[i].debounced_pressed = raw_button_pressed(&buttons[i]);
|
||||
|
||||
@@ -83,7 +83,7 @@ static void record_hook_delay(uint64_t now, uint64_t last, uint64_t interval,
|
||||
|
||||
/* Warn if delayed by more than 10% */
|
||||
if (delayed * 10 > interval)
|
||||
CPRINTF("Hook at interval %d us delayed by %d us\n",
|
||||
CPRINTF("[%T Hook at interval %d us delayed by %d us]\n",
|
||||
(uint32_t)interval, (uint32_t)delayed);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -269,7 +269,7 @@ int i2c_unwedge(int port)
|
||||
* If we get here, a slave is holding the clock low and there
|
||||
* is nothing we can do.
|
||||
*/
|
||||
CPRINTF("[%T I2C unwedge failed, SCL is being held low.]\n");
|
||||
CPRINTF("[%T I2C unwedge failed, SCL is being held low]\n");
|
||||
ret = EC_ERROR_UNKNOWN;
|
||||
goto unwedge_done;
|
||||
}
|
||||
@@ -277,7 +277,7 @@ int i2c_unwedge(int port)
|
||||
if (i2c_raw_get_sda(port))
|
||||
goto unwedge_done;
|
||||
|
||||
CPRINTF("[%T I2C unwedge called with SDA held low.]\n");
|
||||
CPRINTF("[%T I2C unwedge called with SDA held low]\n");
|
||||
|
||||
/* Keep trying to unwedge the SDA line until we run out of attempts. */
|
||||
for (i = 0; i < UNWEDGE_SDA_ATTEMPTS; i++) {
|
||||
|
||||
@@ -111,7 +111,7 @@ void keyboard_clear_buffer(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
CPRINTF("clearing keyboard fifo\n");
|
||||
CPRINTF("[clearing keyboard fifo]\n");
|
||||
|
||||
kb_fifo_start = 0;
|
||||
kb_fifo_end = 0;
|
||||
|
||||
@@ -438,13 +438,14 @@ static int check_keys_changed(uint8_t *state)
|
||||
|
||||
#ifdef PRINT_SCAN_TIMES
|
||||
/* Print delta times from now back to each previous scan */
|
||||
CPRINTF("[%T kb deltaT");
|
||||
for (i = 0; i < SCAN_TIME_COUNT; i++) {
|
||||
int tnew = scan_time[
|
||||
(SCAN_TIME_COUNT + scan_time_index - i) %
|
||||
SCAN_TIME_COUNT];
|
||||
CPRINTF(" %d", tnow - tnew);
|
||||
}
|
||||
CPRINTF("\n");
|
||||
CPRINTF("]\n");
|
||||
#endif
|
||||
|
||||
/* Swallow special keys */
|
||||
|
||||
@@ -153,7 +153,7 @@ static int pmu_get_event(int *event)
|
||||
*event = irq1 | (irq2 << 8);
|
||||
|
||||
if (prev_event != *event) {
|
||||
CPRINTF("pmu event: %016b\n", *event);
|
||||
CPRINTF("[%T pmu event: %016b]\n", *event);
|
||||
prev_event = *event;
|
||||
}
|
||||
|
||||
|
||||
@@ -573,6 +573,6 @@ DECLARE_HOOK(HOOK_CHIPSET_RESUME, pmu_chipset_events, HOOK_PRIO_DEFAULT);
|
||||
void pmu_irq_handler(enum gpio_signal signal)
|
||||
{
|
||||
pmu_task_throttled_wake();
|
||||
CPRINTF("Charger IRQ received.\n");
|
||||
CPRINTF("[%T Charger IRQ received]\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -312,13 +312,14 @@ static int send_validate_message(void *ctxt, uint16_t header, uint8_t cnt,
|
||||
udelay(10);
|
||||
return bit_len;
|
||||
} else {
|
||||
/* CPRINTF("ERR ACK/%d %04x\n", id, head); */
|
||||
/* CPRINTF("[%T PD ERR ACK/%d %04x]\n",
|
||||
id, head); */
|
||||
}
|
||||
}
|
||||
}
|
||||
/* we failed all the re-transmissions */
|
||||
/* TODO: try HardReset */
|
||||
CPRINTF("TX NO ACK %04x/%d\n", header, cnt);
|
||||
CPRINTF("[%T PD TX NO ACK %04x/%d]\n", header, cnt);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -329,7 +330,7 @@ static int send_control(void *ctxt, int type)
|
||||
|
||||
bit_len = send_validate_message(ctxt, header, 0, NULL);
|
||||
|
||||
CPRINTF("CTRL[%d]>%d\n", type, bit_len);
|
||||
CPRINTF("[%T PD CTRL[%d]>%d]\n", type, bit_len);
|
||||
|
||||
return bit_len;
|
||||
}
|
||||
@@ -351,7 +352,7 @@ static int send_source_cap(void *ctxt)
|
||||
|
||||
bit_len = send_validate_message(ctxt, header, pd_src_pdo_cnt,
|
||||
pd_src_pdo);
|
||||
CPRINTF("srcCAP>%d\n", bit_len);
|
||||
CPRINTF("[%T PD srcCAP>%d]\n", bit_len);
|
||||
|
||||
return bit_len;
|
||||
}
|
||||
@@ -365,7 +366,7 @@ static void send_sink_cap(void *ctxt)
|
||||
|
||||
bit_len = send_validate_message(ctxt, header, pd_snk_pdo_cnt,
|
||||
pd_snk_pdo);
|
||||
CPRINTF("snkCAP>%d\n", bit_len);
|
||||
CPRINTF("[%T PD snkCAP>%d]\n", bit_len);
|
||||
}
|
||||
|
||||
static int send_request(void *ctxt, uint32_t rdo)
|
||||
@@ -374,7 +375,7 @@ static int send_request(void *ctxt, uint32_t rdo)
|
||||
uint16_t header = PD_HEADER(PD_DATA_REQUEST, pd_role, pd_message_id, 1);
|
||||
|
||||
bit_len = send_validate_message(ctxt, header, 1, &rdo);
|
||||
CPRINTF("REQ%d>\n", bit_len);
|
||||
CPRINTF("[%T PD REQ%d>]\n", bit_len);
|
||||
|
||||
return bit_len;
|
||||
}
|
||||
@@ -387,14 +388,14 @@ static int send_bist(void *ctxt)
|
||||
uint16_t header = PD_HEADER(PD_DATA_BIST, pd_role, pd_message_id, 1);
|
||||
|
||||
bit_len = send_validate_message(ctxt, header, 1, &bdo);
|
||||
CPRINTF("BIST>%d\n", bit_len);
|
||||
CPRINTF("[%T PD BIST>%d]\n", bit_len);
|
||||
|
||||
return bit_len;
|
||||
}
|
||||
|
||||
static void handle_vdm_request(void *ctxt, int cnt, uint32_t *payload)
|
||||
{
|
||||
CPRINTF("Unhandled VDM VID %04x CMD %04x\n", payload[0] >> 16,
|
||||
CPRINTF("[%T PD Unhandled VDM VID %04x CMD %04x]\n", payload[0] >> 16,
|
||||
payload[0] & 0xFFFF);
|
||||
}
|
||||
|
||||
@@ -438,7 +439,7 @@ static void handle_data_request(void *ctxt, uint16_t head, uint32_t *payload)
|
||||
send_control(ctxt, PD_CTRL_REJECT);
|
||||
break;
|
||||
case PD_DATA_BIST:
|
||||
CPRINTF("BIST not supported\n");
|
||||
CPRINTF("[%T PD BIST not supported]\n");
|
||||
break;
|
||||
case PD_DATA_SINK_CAP:
|
||||
break;
|
||||
@@ -446,7 +447,7 @@ static void handle_data_request(void *ctxt, uint16_t head, uint32_t *payload)
|
||||
handle_vdm_request(ctxt, cnt, payload);
|
||||
break;
|
||||
default:
|
||||
CPRINTF("Unhandled data message type %d\n", type);
|
||||
CPRINTF("[%T PD unhandled data message type %d]\n", type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -484,7 +485,7 @@ static void handle_ctrl_request(void *ctxt, uint16_t head, uint32_t *payload)
|
||||
case PD_CTRL_WAIT:
|
||||
case PD_CTRL_SOFT_RESET:
|
||||
default:
|
||||
CPRINTF("Unhandled ctrl message type %d\n", type);
|
||||
CPRINTF("[%T PD unhandled ctrl message type %d]\n", type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -497,10 +498,10 @@ static void handle_request(void *ctxt, uint16_t head, uint32_t *payload)
|
||||
send_goodcrc(ctxt, PD_HEADER_ID(head));
|
||||
|
||||
/* dump received packet content */
|
||||
CPRINTF("RECV %04x/%d ", head, cnt);
|
||||
CPRINTF("[%T PD RECV %04x/%d ", head, cnt);
|
||||
for (p = 0; p < cnt; p++)
|
||||
CPRINTF("[%d]%08x ", p, payload[p]);
|
||||
CPRINTF("\n");
|
||||
CPRINTF("]\n");
|
||||
|
||||
if (cnt)
|
||||
handle_data_request(ctxt, head, payload);
|
||||
@@ -590,7 +591,8 @@ static int analyze_rx(uint32_t *payload)
|
||||
msg = "CRC";
|
||||
if (pcrc != ccrc)
|
||||
bit = PD_ERR_CRC;
|
||||
/* DEBUG */CPRINTF("CRC %08x <> %08x\n", pcrc, crc32_result());
|
||||
/* DEBUG */
|
||||
CPRINTF("[%T PD CRC %08x <> %08x]\n", pcrc, crc32_result());
|
||||
goto packet_err;
|
||||
}
|
||||
|
||||
@@ -608,7 +610,7 @@ packet_err:
|
||||
if (debug_dump)
|
||||
pd_dump_packet(ctxt, msg);
|
||||
else
|
||||
CPRINTF("RX ERR (%d)\n", bit);
|
||||
CPRINTF("[%T PD RX ERR (%d)]\n", bit);
|
||||
return bit;
|
||||
}
|
||||
|
||||
@@ -622,7 +624,7 @@ static void execute_hard_reset(void)
|
||||
pd_task_state = PD_STATE_SRC_DISCONNECTED;
|
||||
#endif
|
||||
pd_power_supply_reset();
|
||||
CPRINTF("HARD RESET!\n");
|
||||
CPRINTF("[%T PD HARD RESET!]\n");
|
||||
}
|
||||
|
||||
void pd_task(void)
|
||||
|
||||
@@ -102,7 +102,7 @@ void tsu6721_reset(void)
|
||||
|
||||
for (i = 0; i < TSU6721_SW_RESET_RETRY; ++i) {
|
||||
if (i != 0) {
|
||||
CPRINTF("[%T TSU6721 init failed. Retrying.]\n");
|
||||
CPRINTF("[%T TSU6721 init failed. Retrying]\n");
|
||||
msleep(500);
|
||||
}
|
||||
if (tsu6721_write(TSU6721_REG_RESET, 0x1))
|
||||
@@ -127,7 +127,7 @@ int tsu6721_mux(enum tsu6721_mux sel)
|
||||
* something known on the ID pin
|
||||
*/
|
||||
if (sel != TSU6721_MUX_AUTO && (id == 0x1f) && !vbus1 && !vbus3) {
|
||||
CPRINTF("TSU6721 cannot use manual mode: no VBUS or ID\n");
|
||||
CPRINTF("[%T TSU6721 cannot use manual mode: no VBUS or ID]\n");
|
||||
return EC_ERROR_INVAL;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ int tsu6721_init(void)
|
||||
int res = 0;
|
||||
|
||||
if ((dev_id != 0x0a) && (dev_id != 0x12)) {
|
||||
CPRINTF("TSU6721 invalid device ID 0x%02x\n", dev_id);
|
||||
CPRINTF("[%T TSU6721 invalid device ID 0x%02x]\n", dev_id);
|
||||
return EC_ERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user