1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include "config_mock_clock.h"
9 
10 #include <mod_mock_clock.h>
11 
12 #include <fwk_macros.h>
13 #include <fwk_module.h>
14 
15 static const struct mod_mock_clock_rate i2s_rate_table[] = {
16     { .rate = 1536000 }, { .rate = 2116800 }, { .rate = 2304000 },
17     { .rate = 4233600 }, { .rate = 4608000 }, { .rate = 8467200 },
18     { .rate = 9216000 },
19 };
20 
21 static const struct fwk_element element_table[] = {
22     [MOD_MOCK_CLOCK_ELEMENT_IDX_I2S] =
23         {
24             .name = "MOCK_I2SCLK",
25             .data = &(const struct mod_mock_clock_element_cfg){
26                     .rate_table = i2s_rate_table,
27                     .rate_count = FWK_ARRAY_SIZE(i2s_rate_table),
28                     .default_rate = 1536000,
29                 },
30         },
31     [MOD_MOCK_CLOCK_ELEMENT_IDX_COUNT] = { 0 }, /* Termination description. */
32 };
33 
get_element_table(fwk_id_t module_id)34 static const struct fwk_element *get_element_table(fwk_id_t module_id)
35 {
36     return element_table;
37 }
38 
39 struct fwk_module_config config_mock_clock = {
40     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(get_element_table),
41 };
42