drivers: clock_control: silabs: Add clock control driver

Add clock control driver for Silicon Labs Series 2 and newer.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
This commit is contained in:
Aksel Skauge Mellbye 2024-09-20 16:07:55 +02:00 committed by Fabio Baltieri
commit bda8ae8c3f
23 changed files with 711 additions and 0 deletions

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2024 Silicon Laboratories Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "device_subsys.h"
#include <zephyr/drivers/clock_control/clock_control_silabs.h>
struct silabs_clock_control_cmu_config i2c0_clock = {
.bus_clock = CLOCK_I2C0,
.branch = CLOCK_BRANCH_LSPCLK,
};
struct silabs_clock_control_cmu_config wdog0_clock = {
.bus_clock = CLOCK_WDOG0,
.branch = CLOCK_BRANCH_WDOG0CLK,
};
static const struct device_subsys_data subsys_data[] = {
{.subsys = (void *)&i2c0_clock},
{.subsys = (void *)&wdog0_clock},
};
static const struct device_data devices[] = {
{
.dev = DEVICE_DT_GET_ONE(silabs_series_clock),
.subsys_data = subsys_data,
.subsys_cnt = ARRAY_SIZE(subsys_data)
}
};

View file

@ -12,6 +12,8 @@ LOG_MODULE_REGISTER(test);
#include "nrf_device_subsys.h"
#elif DT_HAS_COMPAT_STATUS_OKAY(espressif_esp32_rtc)
#include "esp32_device_subsys.h"
#elif DT_HAS_COMPAT_STATUS_OKAY(silabs_series_clock)
#include "silabs_device_subsys.h"
#else
#error "Unsupported board"
#endif

View file

@ -10,6 +10,9 @@ tests:
- esp32c3_devkitm
- esp32s2_saola
- esp32s3_devkitm/esp32s3/procpu
- sltb010a@0
- xg24_dk2601b
- xg27_dk2602a
drivers.clock.clock_control_nrf5:
platform_allow:
- nrf51dk/nrf51822