1 /*
2  * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_ESP32_CLOCK_CONTROL_H_
8 #define ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_ESP32_CLOCK_CONTROL_H_
9 
10 #if defined(CONFIG_SOC_SERIES_ESP32)
11 #include <zephyr/dt-bindings/clock/esp32_clock.h>
12 #elif defined(CONFIG_SOC_SERIES_ESP32S2)
13 #include <zephyr/dt-bindings/clock/esp32s2_clock.h>
14 #elif defined(CONFIG_SOC_SERIES_ESP32S3)
15 #include <zephyr/dt-bindings/clock/esp32s3_clock.h>
16 #elif defined(CONFIG_SOC_SERIES_ESP32C2)
17 #include <zephyr/dt-bindings/clock/esp32c2_clock.h>
18 #elif defined(CONFIG_SOC_SERIES_ESP32C3)
19 #include <zephyr/dt-bindings/clock/esp32c3_clock.h>
20 #elif defined(CONFIG_SOC_SERIES_ESP32C6)
21 #include <zephyr/dt-bindings/clock/esp32c6_clock.h>
22 #endif /* CONFIG_SOC_SERIES_ESP32xx */
23 
24 #define ESP32_CLOCK_CONTROL_SUBSYS_CPU 50
25 #define ESP32_CLOCK_CONTROL_SUBSYS_RTC_FAST 51
26 #define ESP32_CLOCK_CONTROL_SUBSYS_RTC_SLOW 52
27 
28 struct esp32_cpu_clock_config {
29 	int clk_src;
30 	uint32_t cpu_freq;
31 	uint32_t xtal_freq;
32 };
33 
34 struct esp32_rtc_clock_config {
35 	uint32_t rtc_fast_clock_src;
36 	uint32_t rtc_slow_clock_src;
37 };
38 
39 struct esp32_clock_config {
40 	struct esp32_cpu_clock_config cpu;
41 	struct esp32_rtc_clock_config rtc;
42 };
43 
44 #endif /* ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_ESP32_CLOCK_CONTROL_H_ */
45