mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
Pit: Add Green LED function in tps65090 charger driver
From DV2 board of pit, we'll use 3 color-LED instead of power LED on keyboard. So, we have to add the function to control 3 color-LED in pmu driver. BUG=chrome-os-partner:24855 TEST=Tested on the pi and pit board about all power status. BRANCH=pit Change-Id: I7b1df39de8fa56eab73779abfa52cf8f72427b44 Signed-off-by: Jaehoon Kim <jh228.kim@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/181588 Tested-by: Katie Roberts-Hoffman <katierh@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Wonjoon Lee <woojoo.lee@samsung.com>
This commit is contained in:
committed by
chrome-internal-fetch
parent
c35251d662
commit
f1b622231b
@@ -70,7 +70,7 @@ const struct gpio_info gpio_list[] = {
|
||||
{"I2C1_SDA", GPIO_B, (1<<7), GPIO_ODR_HIGH, NULL},
|
||||
{"I2C2_SCL", GPIO_B, (1<<10), GPIO_ODR_HIGH, NULL},
|
||||
{"I2C2_SDA", GPIO_B, (1<<11), GPIO_ODR_HIGH, NULL},
|
||||
{"LED_POWER_L", GPIO_A, (1<<2), GPIO_OUT_HIGH, NULL},
|
||||
{"CHARGING_LED",GPIO_A, (1<<2), GPIO_OUT_LOW, NULL},
|
||||
{"PMIC_PWRON", GPIO_A, (1<<12), GPIO_OUT_LOW, NULL},
|
||||
{"PMIC_RESET", GPIO_A, (1<<15), GPIO_OUT_LOW, NULL},
|
||||
{"KB_OUT00", GPIO_B, (1<<0), GPIO_KB_OUTPUT, NULL},
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#define CONFIG_PMU_HARD_RESET
|
||||
#define CONFIG_PMU_POWERINFO
|
||||
#define CONFIG_PMU_TPS65090
|
||||
#define CONFIG_PMU_TPS65090_CHARGING_LED
|
||||
#define CONFIG_SPI
|
||||
#define CONFIG_VBOOT_HASH
|
||||
|
||||
@@ -79,7 +80,7 @@ enum gpio_signal {
|
||||
GPIO_I2C1_SDA,
|
||||
GPIO_I2C2_SCL,
|
||||
GPIO_I2C2_SDA,
|
||||
GPIO_LED_POWER_L,
|
||||
GPIO_CHARGING_LED,
|
||||
GPIO_PMIC_PWRON,
|
||||
GPIO_PMIC_RESET,
|
||||
GPIO_KB_OUT00,
|
||||
|
||||
@@ -52,6 +52,21 @@ static int has_pending_event;
|
||||
|
||||
static enum charging_state current_state = ST_IDLE0;
|
||||
|
||||
#ifdef CONFIG_PMU_TPS65090_CHARGING_LED
|
||||
static void update_battery_led(void)
|
||||
{
|
||||
int alarm;
|
||||
int led_on = 0;
|
||||
if(extpower_is_present()){
|
||||
battery_status(&alarm);
|
||||
if((alarm & ALARM_CHARGED) && !gpio_get_level(GPIO_CHARGER_EN))
|
||||
led_on = 1;
|
||||
}
|
||||
|
||||
gpio_set_level(GPIO_CHARGING_LED, led_on);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void enable_charging(int enable)
|
||||
{
|
||||
enable = enable ? 1 : 0;
|
||||
@@ -409,6 +424,9 @@ void charger_task(void)
|
||||
extpower_charge_update(0);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PMU_TPS65090_CHARGING_LED
|
||||
update_battery_led();
|
||||
#endif
|
||||
/*
|
||||
* When battery is extremely low, the internal voltage can not
|
||||
* power on its gas guage IC. Charging loop will enable the
|
||||
|
||||
Reference in New Issue
Block a user