mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
ryu: Remove printf in interrupt handlers
We should avoid printing log in interrupt handlers: - Move VBUS logging to a deferred function. - Remove unused interrupt handler. BRANCH=Ryu BUG=None TEST=Run on Ryu P3 and see VBUS logging when VBUS changes. Change-Id: I06ffe62a656d63fdd63b5d1c5e2f6481eeddc445 Signed-off-by: Vic Yang <victoryang@google.com> Reviewed-on: https://chromium-review.googlesource.com/242180 Tested-by: Vic Yang <victoryang@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vic Yang <victoryang@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
edf0648a0a
commit
10c8a41571
@@ -33,17 +33,18 @@
|
||||
|
||||
#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
|
||||
|
||||
static void vbus_log(void)
|
||||
{
|
||||
CPRINTS("VBUS %d", gpio_get_level(GPIO_CHGR_ACOK));
|
||||
}
|
||||
DECLARE_DEFERRED(vbus_log);
|
||||
|
||||
void vbus_evt(enum gpio_signal signal)
|
||||
{
|
||||
ccprintf("VBUS %d, %d!\n", signal, gpio_get_level(signal));
|
||||
hook_call_deferred(vbus_log, 0);
|
||||
task_wake(TASK_ID_PD);
|
||||
}
|
||||
|
||||
void unhandled_evt(enum gpio_signal signal)
|
||||
{
|
||||
ccprintf("Unhandled INT %d,%d!\n", signal, gpio_get_level(signal));
|
||||
}
|
||||
|
||||
/* Wait 200ms after a charger is detected to debounce pin contact order */
|
||||
#define USB_CHG_DEBOUNCE_DELAY_MS 200
|
||||
/*
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
|
||||
/* Maximum number of deferrable functions */
|
||||
#undef DEFERRABLE_MAX_COUNT
|
||||
#define DEFERRABLE_MAX_COUNT 9
|
||||
#define DEFERRABLE_MAX_COUNT 10
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
|
||||
/* Interrupts */
|
||||
GPIO(CHGR_ACOK, D, 4, GPIO_INT_BOTH | GPIO_PULL_UP, vbus_evt)
|
||||
GPIO(BC_TEMP_ALERT_L, C, 5, GPIO_INT_FALLING, unhandled_evt)
|
||||
GPIO(BC_TEMP_ALERT_L, C, 5, GPIO_INT_FALLING, NULL)
|
||||
GPIO(POWER_BUTTON_L, C, 13, GPIO_INT_BOTH, power_button_interrupt) /* active high, the name is for compatibility with existing code */
|
||||
GPIO(USBC_BC12_INT_L, D, 11, GPIO_INT_FALLING | GPIO_PULL_UP, usb_evt)
|
||||
GPIO(LID_OPEN, E, 1, GPIO_INT_BOTH | GPIO_PULL_UP, lid_interrupt)
|
||||
GPIO(CHARGE_DONE, E, 6, GPIO_INT_BOTH, inductive_charging_interrupt)
|
||||
GPIO(LB_INT_L, E, 7, GPIO_INT_FALLING | GPIO_PULL_UP, unhandled_evt)
|
||||
GPIO(LIGHTBAR_EN_L, E, 8, GPIO_INT_FALLING | GPIO_PULL_UP, unhandled_evt)
|
||||
GPIO(LB_INT_L, E, 7, GPIO_INT_FALLING | GPIO_PULL_UP, NULL)
|
||||
GPIO(LIGHTBAR_EN_L, E, 8, GPIO_INT_FALLING | GPIO_PULL_UP, NULL)
|
||||
GPIO(AP_IN_SUSPEND, F, 9, GPIO_INT_BOTH, power_signal_interrupt)
|
||||
GPIO(BASE_PRES_L, E, 10, GPIO_INT_BOTH | GPIO_PULL_UP, unhandled_evt)
|
||||
GPIO(AP_HOLD, E, 3, GPIO_INT_BOTH, power_signal_interrupt)
|
||||
GPIO(BASE_PRES_L, E, 10, GPIO_INT_BOTH | GPIO_PULL_UP, NULL)
|
||||
GPIO(AP_HOLD, E, 3, GPIO_INT_BOTH, power_signal_interrupt)
|
||||
|
||||
/* Buttons */
|
||||
GPIO(BTN_VOLD_L, C, 0, GPIO_INPUT | GPIO_PULL_UP, NULL)
|
||||
|
||||
Reference in New Issue
Block a user