1 /*
2  * Renesas SCP/MCP Software
3  * Copyright (c) 2020-2021, Renesas Electronics Corporation. All rights
4  * reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #include <mod_rcar_pmic.h>
10 #include <mod_psu.h>
11 #include <config_rcar_pmic.h>
12 #include <config_psu.h>
13 
14 #include <fwk_assert.h>
15 #include <fwk_element.h>
16 #include <fwk_id.h>
17 #include <fwk_module.h>
18 #include <fwk_module_idx.h>
19 #include <fwk_status.h>
20 
21 #include <stddef.h>
22 
23 static struct fwk_element psu_dev_desc_table[] = {
24     [MOD_PSU_ELEMENT_IDX_VLITTLE] = {
25         .name = "VLITTLE",
26         .data = &(const struct mod_psu_element_cfg) {
27             .driver_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_RCAR_PMIC,
28                 MOD_RCAR_PMIC_ELEMENT_IDX_LITTLE),
29             .driver_api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_RCAR_PMIC,
30                 MOD_RCAR_PMIC_API_IDX_DEVICE),
31         },
32     },
33     [MOD_PSU_ELEMENT_IDX_VBIG] = {
34         .name = "VBIG",
35         .data = &(const struct mod_psu_element_cfg) {
36             .driver_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_RCAR_PMIC,
37                 MOD_RCAR_PMIC_ELEMENT_IDX_BIG),
38             .driver_api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_RCAR_PMIC,
39                 MOD_RCAR_PMIC_API_IDX_DEVICE),
40         },
41     },
42     [MOD_PSU_ELEMENT_IDX_VGPU] = {
43         .name = "VGPU",
44         .data = &(const struct mod_psu_element_cfg) {
45             .driver_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_RCAR_PMIC,
46                 MOD_RCAR_PMIC_ELEMENT_IDX_GPU),
47             .driver_api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_RCAR_PMIC,
48                 MOD_RCAR_PMIC_API_IDX_DEVICE),
49         },
50     },
51     [MOD_PSU_ELEMENT_IDX_COUNT] = { 0 },
52 };
53 
psu_get_dev_desc_table(fwk_id_t module_id)54 static const struct fwk_element *psu_get_dev_desc_table(fwk_id_t module_id)
55 {
56     return psu_dev_desc_table;
57 }
58 
59 struct fwk_module_config config_psu = {
60     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(psu_get_dev_desc_table),
61 };
62