Line data Source code
1 0 : /*
2 : * Copyright (c) 2024 Renesas Electronics Corporation
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 : #ifndef ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_RENESAS_RX_CGC_H_
7 : #define ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_RENESAS_RX_CGC_H_
8 :
9 : #include <zephyr/drivers/clock_control.h>
10 : #include <zephyr/dt-bindings/clock/rx_clock.h>
11 :
12 0 : #define RX_CGC_PROP_HAS_STATUS_OKAY_OR(node_id, prop, default_value) \
13 : COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), (DT_PROP(node_id, prop)), (default_value))
14 :
15 0 : #define RX_CGC_CLK_SRC(node_id) \
16 : COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), \
17 : (UTIL_CAT(RX_CLOCKS_SOURCE_, DT_NODE_FULL_NAME_UPPER_TOKEN(node_id))), \
18 : (RX_CLOCKS_CLOCK_DISABLED))
19 :
20 0 : #define RX_IF_CLK_SRC(node_id) \
21 : COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay),\
22 : (UTIL_CAT(RX_IF_CLOCKS_SOURCE_, DT_NODE_FULL_NAME_UPPER_TOKEN(node_id))),\
23 : (RX_CLOCKS_CLOCK_DISABLED))
24 :
25 0 : #define RX_LPT_CLK_SRC(node_id) \
26 : COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay),\
27 : (UTIL_CAT(RX_LPT_CLOCKS_SOURCE_, DT_NODE_FULL_NAME_UPPER_TOKEN(node_id))),\
28 : (RX_LPT_CLOCKS_NON_USE))
29 :
30 0 : struct clock_control_rx_pclk_cfg {
31 0 : const struct device *clock_src_dev;
32 0 : uint32_t clk_div;
33 : };
34 :
35 0 : struct clock_control_rx_subsys_cfg {
36 0 : uint32_t mstp;
37 0 : uint32_t stop_bit;
38 : };
39 :
40 0 : struct clock_control_rx_pll_cfg {
41 0 : const struct device *clock_dev;
42 : };
43 :
44 0 : struct clock_control_rx_pll_data {
45 0 : uint32_t pll_div;
46 0 : uint32_t pll_mul;
47 : };
48 :
49 0 : struct clock_control_rx_root_cfg {
50 0 : uint32_t rate;
51 : };
52 :
53 : #endif /* ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_RENESAS_RX_CGC_H_ */
|