diff options
Diffstat (limited to 'zephyr')
-rw-r--r-- | zephyr/projects/skyrim/led.c | 7 | ||||
-rw-r--r-- | zephyr/projects/skyrim/power_signals.c | 7 | ||||
-rw-r--r-- | zephyr/projects/skyrim/power_signals_guybrush.c | 7 | ||||
-rw-r--r-- | zephyr/projects/skyrim/usbc_config.c | 20 | ||||
-rw-r--r-- | zephyr/projects/skyrim/usbc_config_guybrush.c | 20 |
5 files changed, 43 insertions, 18 deletions
diff --git a/zephyr/projects/skyrim/led.c b/zephyr/projects/skyrim/led.c index c3841366b5..0e5ccf7744 100644 --- a/zephyr/projects/skyrim/led.c +++ b/zephyr/projects/skyrim/led.c @@ -94,9 +94,12 @@ int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness) return EC_SUCCESS; } -static void pwm_led_duty_init(void) +static int pwm_led_duty_init(const struct device *unused) { + ARG_UNUSED(unused); pwm_set_duty(PWM_CH_LED_CHRG, 100); pwm_set_duty(PWM_CH_LED_FULL, 100); + + return 0; } -DECLARE_HOOK(HOOK_INIT, pwm_led_duty_init, HOOK_PRIO_POST_PWM); +SYS_INIT(pwm_led_duty_init, APPLICATION, HOOK_PRIO_POST_PWM); diff --git a/zephyr/projects/skyrim/power_signals.c b/zephyr/projects/skyrim/power_signals.c index 2af0efb3b8..4c97b95bd0 100644 --- a/zephyr/projects/skyrim/power_signals.c +++ b/zephyr/projects/skyrim/power_signals.c @@ -64,8 +64,9 @@ static void baseboard_suspend_change(struct ap_power_ev_callback *cb, } } -static void baseboard_init(void) +static int baseboard_init(const struct device *unused) { + ARG_UNUSED(unused); static struct ap_power_ev_callback cb; /* Setup a suspend/resume callback */ @@ -76,8 +77,10 @@ static void baseboard_init(void) gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_pg_groupc_s0)); gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_pg_lpddr_s0)); gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_pg_lpddr_s3)); + + return 0; } -DECLARE_HOOK(HOOK_INIT, baseboard_init, HOOK_PRIO_POST_I2C); +SYS_INIT(baseboard_init, APPLICATION, HOOK_PRIO_POST_I2C); /** * b/175324615: On G3->S5, wait for RSMRST_L to be deasserted before asserting diff --git a/zephyr/projects/skyrim/power_signals_guybrush.c b/zephyr/projects/skyrim/power_signals_guybrush.c index cfec17b8c9..1ae357d1e5 100644 --- a/zephyr/projects/skyrim/power_signals_guybrush.c +++ b/zephyr/projects/skyrim/power_signals_guybrush.c @@ -53,13 +53,16 @@ const struct power_signal_info power_signal_list[] = { }; BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); -static void baseboard_interrupt_init(void) +static int baseboard_interrupt_init(const struct device *unused) { + ARG_UNUSED(unused); /* Enable Power Group interrupts. */ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_pg_groupc_s0)); gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_pg_lpddr4x_s3)); + + return 0; } -DECLARE_HOOK(HOOK_INIT, baseboard_interrupt_init, HOOK_PRIO_POST_I2C); +SYS_INIT(baseboard_interrupt_init, APPLICATION, HOOK_PRIO_POST_I2C); /** * b/175324615: On G3->S5, wait for RSMRST_L to be deasserted before asserting diff --git a/zephyr/projects/skyrim/usbc_config.c b/zephyr/projects/skyrim/usbc_config.c index 7d5f758131..cc7882228f 100644 --- a/zephyr/projects/skyrim/usbc_config.c +++ b/zephyr/projects/skyrim/usbc_config.c @@ -82,8 +82,9 @@ const struct tcpc_config_t tcpc_config[] = { }; BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == CONFIG_USB_PD_PORT_MAX_COUNT); -static void usbc_interrupt_init(void) +static int usbc_interrupt_init(const struct device *unused) { + ARG_UNUSED(unused); /* Enable PPC interrupts. */ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c0_ppc)); gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c1_ppc)); @@ -97,8 +98,9 @@ static void usbc_interrupt_init(void) gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c1_bc12)); /* TODO: Enable SBU fault interrupts (io expander )*/ + return 0; } -DECLARE_HOOK(HOOK_INIT, usbc_interrupt_init, HOOK_PRIO_POST_I2C); +SYS_INIT(usbc_interrupt_init, APPLICATION, HOOK_PRIO_POST_I2C); struct ppc_config_t ppc_chips[] = { [USBC_PORT_C0] = { @@ -209,8 +211,9 @@ static int ioex_set_flip(const struct usb_mux *me, mux_state_t mux_state, return EC_SUCCESS; } -static void setup_mux(void) +static int setup_mux(const struct device *unused) { + ARG_UNUSED(unused); uint32_t val; if (cros_cbi_get_fw_config(FW_IO_DB, &val) != 0) @@ -226,8 +229,10 @@ static void setup_mux(void) } else { CPRINTSUSB("Unexpected DB_IO board: %d", val); } + + return 0; } -DECLARE_HOOK(HOOK_INIT, setup_mux, HOOK_PRIO_INIT_I2C); +SYS_INIT(setup_mux, APPLICATION, HOOK_PRIO_INIT_I2C); int board_set_active_charge_port(int port) { @@ -365,11 +370,14 @@ void board_set_charge_limit(int port, int supplier, int charge_ma, /* Round up 3250 max current to multiple of 128mA for ISL9241 AC prochot. */ #define GUYBRUSH_AC_PROCHOT_CURRENT_MA 3328 -static void set_ac_prochot(void) +static int set_ac_prochot(const struct device *unused) { + ARG_UNUSED(unused); isl9241_set_ac_prochot(CHARGER_SOLO, GUYBRUSH_AC_PROCHOT_CURRENT_MA); + + return 0; } -DECLARE_HOOK(HOOK_INIT, set_ac_prochot, HOOK_PRIO_DEFAULT); +SYS_INIT(set_ac_prochot, APPLICATION, HOOK_PRIO_DEFAULT); void tcpc_alert_event(enum gpio_signal signal) { diff --git a/zephyr/projects/skyrim/usbc_config_guybrush.c b/zephyr/projects/skyrim/usbc_config_guybrush.c index 4633fedaee..16e1bc1602 100644 --- a/zephyr/projects/skyrim/usbc_config_guybrush.c +++ b/zephyr/projects/skyrim/usbc_config_guybrush.c @@ -81,8 +81,9 @@ const struct tcpc_config_t tcpc_config[] = { }; BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == CONFIG_USB_PD_PORT_MAX_COUNT); -static void usbc_interrupt_init(void) +static int usbc_interrupt_init(const struct device *unused) { + ARG_UNUSED(unused); /* Enable PPC interrupts. */ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c0_ppc)); gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c1_ppc)); @@ -96,8 +97,9 @@ static void usbc_interrupt_init(void) gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c1_bc12)); /* TODO: Enable SBU fault interrupts (io expander )*/ + return 0; } -DECLARE_HOOK(HOOK_INIT, usbc_interrupt_init, HOOK_PRIO_POST_I2C); +SYS_INIT(usbc_interrupt_init, APPLICATION, HOOK_PRIO_POST_I2C); struct ppc_config_t ppc_chips[] = { [USBC_PORT_C0] = { @@ -214,13 +216,16 @@ static int fsusb42umx_set_mux(const struct usb_mux *me, mux_state_t mux_state, return EC_SUCCESS; } -static void setup_mux(void) +static int setup_mux(const struct device *unused) { + ARG_UNUSED(unused); /* TODO: Fill in C1 mux based on CBI */ CPRINTSUSB("C1: Setting ANX7451 mux"); usb_muxes[USBC_PORT_C1].next_mux = &usbc1_anx7451; + + return 0; } -DECLARE_HOOK(HOOK_INIT, setup_mux, HOOK_PRIO_INIT_I2C); +SYS_INIT(setup_mux, APPLICATION, HOOK_PRIO_INIT_I2C); int board_set_active_charge_port(int port) { @@ -358,11 +363,14 @@ void board_set_charge_limit(int port, int supplier, int charge_ma, /* Round up 3250 max current to multiple of 128mA for ISL9241 AC prochot. */ #define GUYBRUSH_AC_PROCHOT_CURRENT_MA 3328 -static void set_ac_prochot(void) +static int set_ac_prochot(const struct device *unused) { + ARG_UNUSED(unused); isl9241_set_ac_prochot(CHARGER_SOLO, GUYBRUSH_AC_PROCHOT_CURRENT_MA); + + return 0; } -DECLARE_HOOK(HOOK_INIT, set_ac_prochot, HOOK_PRIO_DEFAULT); +SYS_INIT(set_ac_prochot, APPLICATION, HOOK_PRIO_DEFAULT); void tcpc_alert_event(enum gpio_signal signal) { |