diff options
Diffstat (limited to 'board/careena')
-rw-r--r-- | board/careena/battery.c | 2 | ||||
-rw-r--r-- | board/careena/board.c | 76 | ||||
-rw-r--r-- | board/careena/board.h | 9 | ||||
-rw-r--r-- | board/careena/build.mk | 2 | ||||
-rw-r--r-- | board/careena/ec.tasklist | 2 | ||||
-rw-r--r-- | board/careena/gpio.inc | 2 | ||||
-rw-r--r-- | board/careena/led.c | 28 |
7 files changed, 53 insertions, 68 deletions
diff --git a/board/careena/battery.c b/board/careena/battery.c index 7180109168..ae8b2f905a 100644 --- a/board/careena/battery.c +++ b/board/careena/battery.c @@ -1,4 +1,4 @@ -/* Copyright 2018 The Chromium OS Authors. All rights reserved. +/* Copyright 2018 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * diff --git a/board/careena/board.c b/board/careena/board.c index e8171b1be0..cfe7199a91 100644 --- a/board/careena/board.c +++ b/board/careena/board.c @@ -1,4 +1,4 @@ -/* Copyright 2018 The Chromium OS Authors. All rights reserved. +/* Copyright 2018 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -26,45 +26,35 @@ const enum gpio_signal hibernate_wake_pins[] = { GPIO_POWER_BUTTON_L, GPIO_EC_RST_ODL, }; -const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); /* I2C port map. */ const struct i2c_port_t i2c_ports[] = { - { - .name = "power", - .port = I2C_PORT_POWER, - .kbps = 100, - .scl = GPIO_I2C0_SCL, - .sda = GPIO_I2C0_SDA - }, - { - .name = "tcpc0", - .port = I2C_PORT_TCPC0, - .kbps = 400, - .scl = GPIO_I2C1_SCL, - .sda = GPIO_I2C1_SDA - }, - { - .name = "tcpc1", - .port = I2C_PORT_TCPC1, - .kbps = 400, - .scl = GPIO_I2C2_SCL, - .sda = GPIO_I2C2_SDA - }, - { - .name = "thermal", - .port = I2C_PORT_THERMAL_AP, - .kbps = 400, - .scl = GPIO_I2C3_SCL, - .sda = GPIO_I2C3_SDA - }, - { - .name = "sensor", - .port = I2C_PORT_SENSOR, - .kbps = 400, - .scl = GPIO_I2C7_SCL, - .sda = GPIO_I2C7_SDA - }, + { .name = "power", + .port = I2C_PORT_POWER, + .kbps = 100, + .scl = GPIO_I2C0_SCL, + .sda = GPIO_I2C0_SDA }, + { .name = "tcpc0", + .port = I2C_PORT_TCPC0, + .kbps = 400, + .scl = GPIO_I2C1_SCL, + .sda = GPIO_I2C1_SDA }, + { .name = "tcpc1", + .port = I2C_PORT_TCPC1, + .kbps = 400, + .scl = GPIO_I2C2_SCL, + .sda = GPIO_I2C2_SDA }, + { .name = "thermal", + .port = I2C_PORT_THERMAL_AP, + .kbps = 400, + .scl = GPIO_I2C3_SCL, + .sda = GPIO_I2C3_SDA }, + { .name = "sensor", + .port = I2C_PORT_SENSOR, + .kbps = 400, + .scl = GPIO_I2C7_SCL, + .sda = GPIO_I2C7_SDA }, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); @@ -114,15 +104,15 @@ DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); * that we don't have pin 0. */ const int keyboard_factory_scan_pins[][2] = { - {-1, -1}, {0, 5}, {1, 1}, {1, 0}, {0, 6}, - {0, 7}, {1, 4}, {1, 3}, {1, 6}, {-1, -1}, - {3, 1}, {2, 0}, {1, 5}, {2, 6}, {-1, -1}, - {2, 1}, {2, 4}, {2, 5}, {1, 2}, {2, 3}, - {2, 2}, {3, 0}, {-1, -1}, {-1, -1}, {-1, -1}, + { -1, -1 }, { 0, 5 }, { 1, 1 }, { 1, 0 }, { 0, 6 }, + { 0, 7 }, { 1, 4 }, { 1, 3 }, { 1, 6 }, { -1, -1 }, + { 3, 1 }, { 2, 0 }, { 1, 5 }, { 2, 6 }, { -1, -1 }, + { 2, 1 }, { 2, 4 }, { 2, 5 }, { 1, 2 }, { 2, 3 }, + { 2, 2 }, { 3, 0 }, { -1, -1 }, { -1, -1 }, { -1, -1 }, }; const int keyboard_factory_scan_pins_used = - ARRAY_SIZE(keyboard_factory_scan_pins); + ARRAY_SIZE(keyboard_factory_scan_pins); static int board_is_support_ps8755_tcpc(void) { diff --git a/board/careena/board.h b/board/careena/board.h index 75545cfcaa..86b88b64f0 100644 --- a/board/careena/board.h +++ b/board/careena/board.h @@ -1,4 +1,4 @@ -/* Copyright 2018 The Chromium OS Authors. All rights reserved. +/* Copyright 2018 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -17,7 +17,7 @@ * By default, enable all console messages excepted HC, ACPI and event: * The sensor stack is generating a lot of activity. */ -#define CC_DEFAULT (CC_ALL & ~(CC_MASK(CC_EVENTS) | CC_MASK(CC_LPC))) +#define CC_DEFAULT (CC_ALL & ~(CC_MASK(CC_EVENTS) | CC_MASK(CC_LPC))) #undef CONFIG_HOSTCMD_DEBUG_MODE #define CONFIG_HOSTCMD_DEBUG_MODE HCDEBUG_OFF @@ -41,10 +41,7 @@ #ifndef __ASSEMBLER__ -enum pwm_channel { - PWM_CH_KBLIGHT = 0, - PWM_CH_COUNT -}; +enum pwm_channel { PWM_CH_KBLIGHT = 0, PWM_CH_COUNT }; enum battery_type { BATTERY_DYNAPACK_COS, diff --git a/board/careena/build.mk b/board/careena/build.mk index c808e65aed..d24127ddae 100644 --- a/board/careena/build.mk +++ b/board/careena/build.mk @@ -1,5 +1,5 @@ # -*- makefile -*- -# Copyright 2015 The Chromium OS Authors. All rights reserved. +# Copyright 2015 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # diff --git a/board/careena/ec.tasklist b/board/careena/ec.tasklist index b562761311..24300fe7da 100644 --- a/board/careena/ec.tasklist +++ b/board/careena/ec.tasklist @@ -1,4 +1,4 @@ -/* Copyright 2017 The Chromium OS Authors. All rights reserved. +/* Copyright 2017 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ diff --git a/board/careena/gpio.inc b/board/careena/gpio.inc index c84c81a68e..477b17234e 100644 --- a/board/careena/gpio.inc +++ b/board/careena/gpio.inc @@ -1,6 +1,6 @@ /* -*- mode:c -*- * - * Copyright 2017 The Chromium OS Authors. All rights reserved. + * Copyright 2017 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ diff --git a/board/careena/led.c b/board/careena/led.c index 4188290b4f..48a065fdb9 100644 --- a/board/careena/led.c +++ b/board/careena/led.c @@ -1,4 +1,4 @@ -/* Copyright 2018 The Chromium OS Authors. All rights reserved. +/* Copyright 2018 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * @@ -20,7 +20,7 @@ #define BAT_LED_ON 0 #define BAT_LED_OFF 1 -const enum ec_led_id supported_led_ids[] = {EC_LED_ID_BATTERY_LED}; +const enum ec_led_id supported_led_ids[] = { EC_LED_ID_BATTERY_LED }; const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids); @@ -28,7 +28,7 @@ enum led_color { LED_OFF = 0, LED_AMBER, LED_WHITE, - LED_COLOR_COUNT /* Number of colors, not a color itself */ + LED_COLOR_COUNT /* Number of colors, not a color itself */ }; static int led_set_color_battery(enum led_color color) @@ -88,16 +88,14 @@ static void led_set_battery(void) { static int battery_ticks; static int power_ticks; - uint32_t chflags = charge_get_flags(); battery_ticks++; /* override battery led for system suspend */ - if (chipset_in_state(CHIPSET_STATE_SUSPEND | - CHIPSET_STATE_STANDBY) && + if (chipset_in_state(CHIPSET_STATE_SUSPEND | CHIPSET_STATE_STANDBY) && charge_get_state() != PWR_STATE_CHARGE) { - led_set_color_battery(power_ticks++ & 0x4 ? - LED_WHITE : LED_OFF); + led_set_color_battery(power_ticks++ & 0x4 ? LED_WHITE : + LED_OFF); return; } @@ -125,18 +123,18 @@ static void led_set_battery(void) led_set_color_battery(LED_OFF); break; case PWR_STATE_ERROR: - led_set_color_battery( - (battery_ticks & 0x2) ? LED_WHITE : LED_OFF); + led_set_color_battery((battery_ticks & 0x2) ? LED_WHITE : + LED_OFF); break; case PWR_STATE_CHARGE_NEAR_FULL: led_set_color_battery(LED_WHITE); break; case PWR_STATE_IDLE: /* External power connected in IDLE */ - if (chflags & CHARGE_FLAG_FORCE_IDLE) - led_set_color_battery( - (battery_ticks & 0x4) ? LED_AMBER : LED_OFF); - else - led_set_color_battery(LED_WHITE); + led_set_color_battery(LED_WHITE); + break; + case PWR_STATE_FORCED_IDLE: + led_set_color_battery((battery_ticks & 0x4) ? LED_AMBER : + LED_OFF); break; default: /* Other states don't alter LED behavior */ |