diff options
Diffstat (limited to 'baseboard/brya')
-rw-r--r-- | baseboard/brya/baseboard.h | 11 | ||||
-rw-r--r-- | baseboard/brya/baseboard_usbc_config.h | 2 | ||||
-rw-r--r-- | baseboard/brya/battery_presence.c | 4 | ||||
-rw-r--r-- | baseboard/brya/cbi.c | 6 | ||||
-rw-r--r-- | baseboard/brya/charger_bq25720.c | 12 | ||||
-rw-r--r-- | baseboard/brya/usb_pd_policy.c | 9 |
6 files changed, 25 insertions, 19 deletions
diff --git a/baseboard/brya/baseboard.h b/baseboard/brya/baseboard.h index b4ba8f2d16..84fefa9b53 100644 --- a/baseboard/brya/baseboard.h +++ b/baseboard/brya/baseboard.h @@ -68,8 +68,7 @@ #define CONFIG_CHARGE_MANAGER #define CONFIG_CHARGER #define CONFIG_CHARGER_DISCHARGE_ON_AC -#define CONFIG_CHARGER_DEFAULT_CURRENT_LIMIT 512 -#define CONFIG_CHARGER_MIN_INPUT_CURRENT_LIMIT 512 +#define CONFIG_CHARGER_INPUT_CURRENT 512 #define CONFIG_CMD_CHARGER_DUMP @@ -241,14 +240,14 @@ #ifndef __ASSEMBLER__ -#include "baseboard_usbc_config.h" +#include <stdbool.h> +#include <stdint.h> + #include "cbi.h" #include "common.h" +#include "baseboard_usbc_config.h" #include "extpower.h" -#include <stdbool.h> -#include <stdint.h> - /* * Check battery disconnect state. * This function will return if battery is initialized or not. diff --git a/baseboard/brya/baseboard_usbc_config.h b/baseboard/brya/baseboard_usbc_config.h index 17f1fe6b06..6d0cf828a3 100644 --- a/baseboard/brya/baseboard_usbc_config.h +++ b/baseboard/brya/baseboard_usbc_config.h @@ -11,9 +11,7 @@ #include "gpio_signal.h" /* Common definition for the USB PD interrupt handlers. */ -#ifdef CONFIG_USB_CHARGER void bc12_interrupt(enum gpio_signal signal); -#endif void ppc_interrupt(enum gpio_signal signal); void retimer_interrupt(enum gpio_signal signal); void tcpc_alert_event(enum gpio_signal signal); diff --git a/baseboard/brya/battery_presence.c b/baseboard/brya/battery_presence.c index ad055c1d12..1e4ab4ed44 100644 --- a/baseboard/brya/battery_presence.c +++ b/baseboard/brya/battery_presence.c @@ -6,12 +6,12 @@ * Each board should implement board_battery_info[] to define the specific * battery packs supported. */ +#include <stdbool.h> + #include "battery.h" #include "battery_smart.h" #include "common.h" -#include <stdbool.h> - static enum battery_present batt_pres_prev = BP_NOT_SURE; __overridable bool board_battery_is_initialized(void) diff --git a/baseboard/brya/cbi.c b/baseboard/brya/cbi.c index f6e5034561..7bc8dad117 100644 --- a/baseboard/brya/cbi.c +++ b/baseboard/brya/cbi.c @@ -3,13 +3,13 @@ * found in the LICENSE file. */ -#include "common.h" +#include <stdint.h> + #include "console.h" +#include "common.h" #include "cros_board_info.h" #include "hooks.h" -#include <stdint.h> - #define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ##args) #define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ##args) diff --git a/baseboard/brya/charger_bq25720.c b/baseboard/brya/charger_bq25720.c index 4976abdea6..a4fa209246 100644 --- a/baseboard/brya/charger_bq25720.c +++ b/baseboard/brya/charger_bq25720.c @@ -3,15 +3,16 @@ * found in the LICENSE file. */ +#include "common.h" + #include "charge_manager.h" #include "charge_state_v2.h" #include "charger.h" -#include "common.h" #include "compile_time_macros.h" #include "console.h" #include "driver/charger/bq25710.h" -#include "usb_pd.h" #include "usbc_ppc.h" +#include "usb_pd.h" #include "util.h" #define CPRINTSUSB(format, args...) cprints(CC_USBCHARGE, format, ##args) @@ -80,3 +81,10 @@ int board_set_active_charge_port(int port) return EC_SUCCESS; } + +__overridable void board_set_charge_limit(int port, int supplier, int charge_ma, + int max_ma, int charge_mv) +{ + charge_set_input_current_limit( + MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT), charge_mv); +} diff --git a/baseboard/brya/usb_pd_policy.c b/baseboard/brya/usb_pd_policy.c index 377ef0462e..e902fbc4a6 100644 --- a/baseboard/brya/usb_pd_policy.c +++ b/baseboard/brya/usb_pd_policy.c @@ -5,6 +5,9 @@ /* Shared USB-C policy for Brya boards */ +#include <stddef.h> +#include <stdint.h> + #include "charge_manager.h" #include "chipset.h" #include "common.h" @@ -13,17 +16,15 @@ #include "ec_commands.h" #include "gpio.h" #include "timer.h" +#include "usbc_ppc.h" #include "usb_mux.h" #include "usb_pd.h" +#include "usb_pd.h" #include "usb_pd_tbt.h" #include "usb_pd_tcpm.h" #include "usb_pd_vdo.h" -#include "usbc_ppc.h" #include "util.h" -#include <stddef.h> -#include <stdint.h> - #define CPRINTF(format, args...) cprintf(CC_USBPD, format, ##args) #define CPRINTS(format, args...) cprints(CC_USBPD, format, ##args) |