1 /*
2  * Renesas SCP/MCP Software
3  * Copyright (c) 2021, Renesas Electronics Corporation. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef MOD_RCAR_EXT_CLOCK_H
9 #define MOD_RCAR_EXT_CLOCK_H
10 
11 #include <rcar_mmap.h>
12 
13 #include <mod_clock.h>
14 #include <mod_rcar_clock.h>
15 
16 #include <fwk_element.h>
17 
18 #include <stdint.h>
19 
20 /*!
21  * \addtogroup GroupRCARModule RCAR Product Modules
22  * @{
23  */
24 
25 /*!
26  * \defgroup GroupRCARExtClock External Clock
27  * @{
28  */
29 
30 /*!
31  * \brief Subsystem external clock device configuration.
32  */
33 struct mod_rcar_ext_clock_dev_config {
34     /*! If true, the driver will provide a default clock supply. */
35     uint64_t clock_rate;
36     /*! The clock state. */
37     enum mod_clock_state clock_state;
38 };
39 
40 /*!
41  * @cond
42  */
43 
44 /* Device context */
45 struct rcar_ext_clock_dev_ctx {
46     bool ext_clock_initialized;
47     uint64_t clock_rate;
48     const struct mod_rcar_ext_clock_dev_config *config;
49     struct mod_rcar_clock_drv_api *api;
50 };
51 
52 /* Module context */
53 struct rcar_ext_clock_ctx {
54     struct rcar_ext_clock_dev_ctx *dev_ctx_table;
55     unsigned int dev_count;
56 };
57 
58 /*!
59  * @endcond
60  */
61 
62 /*!
63  * @}
64  */
65 
66 /*!
67  * @}
68  */
69 
70 #endif /* MOD_RCAR_EXT_CLOCK_H */
71