diff --git a/board/it8380dev/board.c b/board/it8380dev/board.c index 9808a91f97..bf0edee14d 100644 --- a/board/it8380dev/board.c +++ b/board/it8380dev/board.c @@ -27,16 +27,6 @@ #include "timer.h" #include "util.h" -/* Test GPIO interrupt function that toggles one LED. */ -void test_interrupt(enum gpio_signal signal) -{ - static int busy_state; - - /* toggle LED */ - busy_state = !busy_state; - gpio_set_level(GPIO_BUSY_LED, busy_state); -} - #include "gpio_list.h" /* @@ -212,44 +202,3 @@ const struct spi_device_t spi_devices[] = { { CONFIG_SPI_FLASH_PORT, 0, -1}, }; const unsigned int spi_devices_used = ARRAY_SIZE(spi_devices); - -/*****************************************************************************/ -/* Console commands */ - -void display_7seg(uint8_t val) -{ - int i; - static const uint8_t digits[16] = { - 0xc0, 0xf9, 0xa8, 0xb0, - 0x99, 0x92, 0x82, 0xf8, - 0x80, 0x98, 0x88, 0x83, - 0xc6, 0xa1, 0x86, 0x8e, - }; - - for (i = 0; i < 7; i++) - gpio_set_level(GPIO_H_LED0 + i, digits[val >> 4] & (1 << i)); - for (i = 0; i < 7; i++) - gpio_set_level(GPIO_L_LED0 + i, digits[val & 0xf] & (1 << i)); -} - -static int command_7seg(int argc, char **argv) -{ - uint8_t val; - char *e; - - if (argc != 2) - return EC_ERROR_PARAM_COUNT; - - val = strtoi(argv[1], &e, 16); - if (*e) - return EC_ERROR_PARAM1; - - ccprintf("display 0x%02x\n", val); - display_7seg(val); - - return EC_SUCCESS; -} -DECLARE_CONSOLE_COMMAND(seg7, command_7seg, - "", - "Print 8-bit value on 7-segment display", - NULL); diff --git a/board/it8380dev/gpio.inc b/board/it8380dev/gpio.inc index 4f4f227b7d..319ef54206 100644 --- a/board/it8380dev/gpio.inc +++ b/board/it8380dev/gpio.inc @@ -10,23 +10,8 @@ GPIO_INT(PCH_PLTRST_L, PIN(E, 3), GPIO_INT_BOTH | GPIO_PULL_UP, lpcrst_inter GPIO_INT(LID_OPEN, PIN(E, 2), GPIO_INT_BOTH | GPIO_PULL_DOWN, lid_interrupt) GPIO_INT(WP_L, PIN(E, 1), GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ -GPIO(H_LED0, PIN(A, 0), GPIO_ODR_HIGH) -GPIO(H_LED1, PIN(A, 1), GPIO_ODR_HIGH) -GPIO(H_LED2, PIN(A, 2), GPIO_ODR_HIGH) -GPIO(H_LED3, PIN(A, 3), GPIO_ODR_HIGH) -GPIO(H_LED4, PIN(A, 4), GPIO_ODR_HIGH) -GPIO(H_LED5, PIN(A, 5), GPIO_ODR_HIGH) -GPIO(H_LED6, PIN(A, 6), GPIO_ODR_HIGH) -GPIO(L_LED0, PIN(I, 0), GPIO_ODR_HIGH) -GPIO(L_LED1, PIN(I, 1), GPIO_ODR_HIGH) -GPIO(L_LED2, PIN(I, 2), GPIO_ODR_HIGH) -GPIO(L_LED3, PIN(I, 3), GPIO_ODR_HIGH) -GPIO(L_LED4, PIN(I, 4), GPIO_ODR_HIGH) -GPIO(L_LED5, PIN(I, 5), GPIO_ODR_HIGH) -GPIO(L_LED6, PIN(I, 6), GPIO_ODR_HIGH) -GPIO(BUSY_LED, PIN(J, 0), GPIO_OUT_LOW) -GPIO(GOOD_LED, PIN(J, 1), GPIO_OUT_HIGH) -GPIO(FAIL_LED, PIN(J, 2), GPIO_OUT_LOW) +GPIO(CAPS_LED, PIN(H, 1), GPIO_OUT_LOW) +GPIO(SCRO_LED, PIN(H, 2), GPIO_OUT_LOW) GPIO(PCH_SMI_L, PIN(D, 3), GPIO_OUT_HIGH) GPIO(PCH_SCI_L, PIN(D, 4), GPIO_OUT_HIGH) GPIO(GATE_A20_H, PIN(B, 5), GPIO_OUT_HIGH) diff --git a/chip/it83xx/pwm.c b/chip/it83xx/pwm.c index d027a366cc..89f71f9a1d 100644 --- a/chip/it83xx/pwm.c +++ b/chip/it83xx/pwm.c @@ -77,7 +77,9 @@ void pwm_enable(enum pwm_channel ch, int enabled) if (enabled) *pwm_ctrl_regs[ch].pwm_pin = 0x00; else - *pwm_ctrl_regs[ch].pwm_pin = 0x80; + *pwm_ctrl_regs[ch].pwm_pin = 0x80 | + ((pwm_channels[ch].flags & PWM_CONFIG_ACTIVE_LOW) ? + 4 : 2); } int pwm_get_enabled(enum pwm_channel ch)