diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-10-31 15:27:19 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-11-01 17:13:11 +0000 |
commit | d7004207e5d809ff6bc4b6a0c6969fd3b277b886 (patch) | |
tree | dca2395867adeb5361e4ad47e5a4a57d09ab2816 /chip/lm4/lpc.c | |
parent | 760ace07a5cc4b7dc5e8f2ec59068a84562be162 (diff) | |
download | chrome-ec-d7004207e5d809ff6bc4b6a0c6969fd3b277b886.tar.gz |
cleanup: Update more TODO comments
Add bug links, reword, or remove as applicable.
No code changes, just comments.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all boards; pass unit tests
Change-Id: Id55dd530c10091d7ab9d0f942f750168fca793b4
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175326
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'chip/lm4/lpc.c')
-rw-r--r-- | chip/lm4/lpc.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/chip/lm4/lpc.c b/chip/lm4/lpc.c index 8a99247c74..7bfcc35dd0 100644 --- a/chip/lm4/lpc.c +++ b/chip/lm4/lpc.c @@ -78,12 +78,11 @@ static struct ec_lpc_host_args * const lpc_host_args = static void wait_irq_sent(void) { /* - * TODO(yjlou): udelay() is not graceful. Since the SIRQRIS is almost - * not cleared in continuous mode and EC has problem to file more than - * 1 frame in the quiet mode, this is the best way we can do right now. - * - * 4 us is the time of 2 SERIRQ frames, which is long enough to - * guarantee the IRQ has been sent out. + * A hard-coded delay here isn't very elegant, but it's the best we can + * manage (and it's a short delay, so it's not that horrible). We need + * this because SIRQRIS isn't cleared in continuous mode, and the EC + * has trouble sending more than 1 frame in quiet mode. Waiting 4 us = + * 2 SERIRQ frames ensures the IRQ has been sent out. */ udelay(4); } @@ -284,7 +283,12 @@ int lpc_comx_get_char(void) void lpc_comx_put_char(int c) { LPC_POOL_COMX[1] = c; - /* TODO: manually trigger IRQ, like we do for keyboard? */ + + /* + * We could in theory manually trigger an IRQ, like we do for the 8042 + * keyboard interface, but neither the kernel nor BIOS seems to require + * this. + */ } #endif /* CONFIG_UART_HOST */ @@ -401,10 +405,12 @@ static void handle_acpi_write(int is_cmd) #ifdef CONFIG_PWM_KBLIGHT case EC_ACPI_MEM_KEYBOARD_BACKLIGHT: /* - * TODO: not very satisfying that LPC knows directly - * about the keyboard backlight, but for now this is - * good enough and less code than defining a new - * console command interface just for ACPI read/write. + * TODO(crosbug.com/p/23774): not very satisfying that + * LPC knows directly about the keyboard backlight, but + * for now this is good enough and less code than + * defining a new API for ACPI commands. If we start + * adding more commands, or need to support LPC on more + * than just LM4, fix this. */ result = pwm_get_duty(PWM_CH_KBLIGHT); break; @@ -751,8 +757,10 @@ static void lpc_init(void) */ LM4_LPC_ADR(LPC_CH_COMX) = LPC_COMX_ADDR; /* - * TODO: could configure IRQSELs and set IRQEN2/CX, and then the host - * can enable IRQs on its own. + * In theory we could configure IRQSELs and set IRQEN2/CX, and then the + * host could enable IRQs on its own. So far that hasn't been + * necessary, and due to the issues with IRQs (see wait_irq_sent() + * above) it might not work anyway. */ LM4_LPC_CTL(LPC_CH_COMX) = 0x0004 | (LPC_POOL_OFFS_COMX << (5 - 1)); /* Enable COMx emulation for reads and writes. */ |