Brandon Wyman | 34e257b | 2019-03-28 17:39:18 -0500 | [diff] [blame] | 1 | /* This is a generated file. */ |
Matt Spinler | b54357f | 2017-08-21 14:38:54 -0500 | [diff] [blame] | 2 | |
Brandon Wyman | 34e257b | 2019-03-28 17:39:18 -0500 | [diff] [blame] | 3 | #include "ucd90160.hpp" |
Matt Spinler | b54357f | 2017-08-21 14:38:54 -0500 | [diff] [blame] | 4 | |
Lei YU | ab09332 | 2019-10-09 16:43:22 +0800 | [diff] [blame] | 5 | namespace phosphor |
Matt Spinler | b54357f | 2017-08-21 14:38:54 -0500 | [diff] [blame] | 6 | { |
| 7 | namespace power |
| 8 | { |
| 9 | |
| 10 | using namespace ucd90160; |
| 11 | using namespace std::string_literals; |
| 12 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 13 | const DeviceMap UCD90160::deviceMap{ |
Brandon Wyman | f99887b | 2019-04-05 17:37:14 -0500 | [diff] [blame] | 14 | %for ucd_data in ucd90160s: |
| 15 | {${ucd_data['index']}, |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 16 | DeviceDefinition{ |
Brandon Wyman | ee21fd2 | 2019-04-11 15:46:45 -0500 | [diff] [blame] | 17 | "${ucd_data['path']}", |
Matt Spinler | e7e432b | 2017-08-21 15:01:40 -0500 | [diff] [blame] | 18 | |
Brandon Wyman | ee21fd2 | 2019-04-11 15:46:45 -0500 | [diff] [blame] | 19 | RailNames{ |
| 20 | %for rail in ucd_data['RailNames']: |
| 21 | "${rail}"s, |
| 22 | %endfor |
| 23 | }, |
Matt Spinler | d998b73 | 2017-08-21 15:35:54 -0500 | [diff] [blame] | 24 | |
Brandon Wyman | 2ca8e48 | 2019-04-11 16:33:14 -0500 | [diff] [blame] | 25 | GPIConfigs{ |
| 26 | %for gpi_config in ucd_data['GPIConfigs']: |
| 27 | <% |
| 28 | poll = str(gpi_config['poll']).lower() |
| 29 | %>\ |
| 30 | GPIConfig{${gpi_config['gpi']}, ${gpi_config['pinID']}, "${gpi_config['name']}"s, ${poll}, extraAnalysisType::${gpi_config['analysis']}}, |
| 31 | %endfor |
| 32 | }, |
Matt Spinler | 2d248ae | 2017-09-19 11:06:48 -0500 | [diff] [blame] | 33 | |
Brandon Wyman | 573f887 | 2019-04-11 17:24:04 -0500 | [diff] [blame] | 34 | GPIOAnalysis{ |
Jim Wright | 5a94c9d | 2019-10-29 13:01:13 -0500 | [diff] [blame] | 35 | %for gpio_analysis in ucd_data.get('GPIOAnalysis', []): |
Brandon Wyman | 573f887 | 2019-04-11 17:24:04 -0500 | [diff] [blame] | 36 | {extraAnalysisType::${gpio_analysis['type']}, |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 37 | GPIOGroup{ |
Brandon Wyman | 573f887 | 2019-04-11 17:24:04 -0500 | [diff] [blame] | 38 | "${gpio_analysis['path']}", |
| 39 | gpio::Value::${gpio_analysis['gpio_value']}, |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 40 | [](auto& ucd, const auto& callout) { |
Brandon Wyman | 573f887 | 2019-04-11 17:24:04 -0500 | [diff] [blame] | 41 | ucd.${gpio_analysis['error_function']}(callout); |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 42 | }, |
Brandon Wyman | 573f887 | 2019-04-11 17:24:04 -0500 | [diff] [blame] | 43 | optionFlags::${gpio_analysis['option_flags']}, |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 44 | GPIODefinitions{ |
Brandon Wyman | 573f887 | 2019-04-11 17:24:04 -0500 | [diff] [blame] | 45 | %for gpio_defs in gpio_analysis['GPIODefinitions']: |
| 46 | GPIODefinition{${gpio_defs['gpio']}, "${gpio_defs['callout']}"s}, |
| 47 | %endfor |
| 48 | } |
| 49 | } |
| 50 | }, |
| 51 | %endfor |
| 52 | } |
| 53 | } |
Brandon Wyman | f99887b | 2019-04-05 17:37:14 -0500 | [diff] [blame] | 54 | }, |
| 55 | %endfor |
| 56 | }; |
Matt Spinler | b54357f | 2017-08-21 14:38:54 -0500 | [diff] [blame] | 57 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 58 | } // namespace power |
Lei YU | ab09332 | 2019-10-09 16:43:22 +0800 | [diff] [blame] | 59 | } // namespace phosphor |