1 /* 2 * Arm SCP/MCP Software 3 * Copyright (c) 2019-2021, Arm Limited and Contributors. All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 * 7 * Description: 8 * Juno ADC Driver 9 */ 10 11 #ifndef MOD_JUNO_ADC_H 12 #define MOD_JUNO_ADC_H 13 14 #include <mod_sensor.h> 15 16 #include <fwk_id.h> 17 #include <fwk_module_idx.h> 18 19 #include <stdint.h> 20 21 /*! 22 * \ingroup GroupJunoModule 23 * \defgroup GroupADC ADC Sensor Driver 24 * \{ 25 */ 26 27 /*! 28 * \brief ADC Type indices. 29 */ 30 enum juno_adc_sensor_type { 31 /*! Voltage type ADC */ 32 ADC_TYPE_VOLT = 0, 33 /*! Current type ADC */ 34 ADC_TYPE_CURRENT, 35 /*! Power type ADC */ 36 ADC_TYPE_POWER, 37 /*! Energy type ADC */ 38 ADC_TYPE_ENERGY, 39 /*! Max number of ADC type */ 40 ADC_TYPE_COUNT 41 }; 42 43 /*! 44 * \brief ADC Device Type indices. 45 */ 46 enum juno_adc_dev_type { 47 /*! ADC for the SYS device */ 48 ADC_DEV_SYS = 0, 49 /*! ADC for the big cpu */ 50 ADC_DEV_BIG, 51 /* ADC for the LITTLE cpu */ 52 ADC_DEV_LITTLE, 53 /*! ADC for the GPU */ 54 ADC_DEV_GPU, 55 /*! Number of ADC devices */ 56 ADC_DEV_TYPE_COUNT 57 }; 58 59 /*! 60 * \brief Element configuration. 61 */ 62 struct mod_juno_adc_dev_config { 63 /*! Type of ADC */ 64 enum juno_adc_sensor_type type; 65 66 /*! Type of device */ 67 enum juno_adc_dev_type dev_type; 68 69 /*! Auxiliary sensor information */ 70 struct mod_sensor_info *info; 71 }; 72 73 /*! 74 * \brief Juno ADC API indices. 75 */ 76 enum mod_juno_adc_api_idx { 77 MOD_JUNO_ADC_API_IDX_DRIVER, 78 MOD_JUNO_ADC_API_IDX_COUNT, 79 }; 80 81 /*! 82 * \brief Juno ADC API identifier. 83 */ 84 static const fwk_id_t mod_juno_adc_api_id_driver = 85 FWK_ID_API_INIT(FWK_MODULE_IDX_JUNO_ADC, 86 MOD_JUNO_ADC_API_IDX_DRIVER); 87 88 /*! 89 * \} 90 */ 91 92 #endif /* MOD_JUNO_ADC_H */ 93