it8380dev: fix PWM moduel

1. Fix fan turns on during sysjump if fan is disabled.
2. Remove unused board function.

Signed-off-by: Dino Li <dino.li@ite.com.tw>

BRANCH=none
BUG=none
TEST=1-1. Console 'sysjump RW' and fan keeps off.
     1-2. Console 'fanset 4000' or 'fanset 0' and 'sysjump',
          it dose maintain the fan RPM.

Change-Id: I531d49c2a8a9fea68af4507339c7be97367c504c
Reviewed-on: https://chromium-review.googlesource.com/299650
Commit-Ready: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Dino Li
2015-09-15 19:12:10 +08:00
committed by chrome-bot
parent f33ff43d93
commit 2f99365a57
3 changed files with 5 additions and 69 deletions

View File

@@ -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,
"<hex>",
"Print 8-bit value on 7-segment display",
NULL);

View File

@@ -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)

View File

@@ -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)