blob: 50fbe63daec6755d80ec236409aae5c7136a30f2 [file] [log] [blame]
James Feist053a6642018-10-15 13:17:09 -07001/*
2// Copyright (c) 2018 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
Brad Bishop1fb9f3f2020-08-28 08:15:13 -040016/// \file devices.hpp
James Feist053a6642018-10-15 13:17:09 -070017
18#pragma once
19#include <boost/container/flat_map.hpp>
20
21namespace devices
22{
23
24struct CmpStr
25{
James Feista465ccc2019-02-08 12:51:01 -080026 bool operator()(const char* a, const char* b) const
James Feist053a6642018-10-15 13:17:09 -070027 {
28 return std::strcmp(a, b) < 0;
29 }
30};
31
32struct ExportTemplate
33{
James Feist98132792019-07-09 13:29:09 -070034 ExportTemplate(const char* params, const char* dev) :
35 parameters(params), device(dev){};
James Feista465ccc2019-02-08 12:51:01 -080036 const char* parameters;
37 const char* device;
James Feist053a6642018-10-15 13:17:09 -070038};
39
James Feista465ccc2019-02-08 12:51:01 -080040const boost::container::flat_map<const char*, ExportTemplate, CmpStr>
Devjit Gopalpur4acdc542019-10-10 22:47:46 -070041 exportTemplates{
Hao Jiangf64d4392021-02-23 14:22:03 -080042 {{"EEPROM_24C02",
43 ExportTemplate("24c02 $Address",
44 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
45 {"EEPROM_24C64",
46 ExportTemplate("24c64 $Address",
47 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Nan Zhou296667f2021-02-23 09:53:14 -080048 {"ADM1266",
49 ExportTemplate("adm1266 $Address",
50 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Josh Lehan079c47f2020-06-18 16:34:31 -070051 {"ADM1272",
52 ExportTemplate("adm1272 $Address",
53 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Alex Qiu0cbe6bf2020-01-03 09:20:02 -080054 {"EEPROM", ExportTemplate("eeprom $Address",
55 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Gilbert Chenc61ae352020-11-03 22:32:30 +080056 {"EMC1412",
57 ExportTemplate("emc1412 $Address",
58 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Alex Qiu0cbe6bf2020-01-03 09:20:02 -080059 {"EMC1413",
60 ExportTemplate("emc1413 $Address",
61 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Gilbert Chenc61ae352020-11-03 22:32:30 +080062 {"EMC1414",
63 ExportTemplate("emc1414 $Address",
64 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Devjit Gopalpur4acdc542019-10-10 22:47:46 -070065 {"Gpio", ExportTemplate("$Index", "/sys/class/gpio/export")},
Alex Qiu0cbe6bf2020-01-03 09:20:02 -080066 {"INA230", ExportTemplate("ina230 $Address",
67 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
68 {"ISL68137",
69 ExportTemplate("isl68137 $Address",
70 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Gaurav Gandhibdad9572020-12-29 03:14:48 +000071 {"ISL68223",
72 ExportTemplate("isl68223 $Address",
73 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
74 {"ISL69243",
75 ExportTemplate("isl69243 $Address",
76 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Alex Qiuba5424a2020-01-29 13:33:16 -080077 {"MAX16601",
78 ExportTemplate("max16601 $Address",
79 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Gaurav Gandhibdad9572020-12-29 03:14:48 +000080 {"MAX20710",
81 ExportTemplate("max20710 $Address",
82 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Alex Qiu9354bf72020-01-22 17:52:32 -080083 {"MAX20730",
84 ExportTemplate("max20730 $Address",
85 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
86 {"MAX20734",
87 ExportTemplate("max20734 $Address",
88 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
89 {"MAX20796",
90 ExportTemplate("max20796 $Address",
91 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Alex Qiu0cbe6bf2020-01-03 09:20:02 -080092 {"MAX31725",
93 ExportTemplate("max31725 $Address",
94 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
95 {"MAX31730",
96 ExportTemplate("max31730 $Address",
97 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Nan Zhou296667f2021-02-23 09:53:14 -080098 {"MAX34440",
99 ExportTemplate("max34440 $Address",
100 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Alex Qiu0cbe6bf2020-01-03 09:20:02 -0800101 {"MAX34451",
102 ExportTemplate("max34451 $Address",
103 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Josh Lehanfdef8372020-05-13 17:02:43 -0700104 {"MAX6654",
105 ExportTemplate("max6654 $Address",
106 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Devjit Gopalpur4acdc542019-10-10 22:47:46 -0700107 {"PCA9543Mux",
108 ExportTemplate("pca9543 $Address",
109 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
110 {"PCA9544Mux",
111 ExportTemplate("pca9544 $Address",
112 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
113 {"PCA9545Mux",
114 ExportTemplate("pca9545 $Address",
115 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
116 {"PCA9546Mux",
117 ExportTemplate("pca9546 $Address",
118 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
119 {"PCA9547Mux",
120 ExportTemplate("pca9547 $Address",
121 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Josh Lehanac09fe42020-06-26 19:42:10 -0700122 {"SBTSI", ExportTemplate("sbtsi $Address",
123 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Devjit Gopalpur4acdc542019-10-10 22:47:46 -0700124 {"pmbus", ExportTemplate("pmbus $Address",
125 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Alex Qiu0cbe6bf2020-01-03 09:20:02 -0800126 {"TMP112", ExportTemplate("tmp112 $Address",
127 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Devjit Gopalpur4acdc542019-10-10 22:47:46 -0700128 {"TMP175", ExportTemplate("tmp175 $Address",
129 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
130 {"TMP421", ExportTemplate("tmp421 $Address",
131 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
132 {"TMP441", ExportTemplate("tmp441 $Address",
133 "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
Alex Qiu0cbe6bf2020-01-03 09:20:02 -0800134 {"TMP75",
135 ExportTemplate("tmp75 $Address",
Devjit Gopalpur4acdc542019-10-10 22:47:46 -0700136 "/sys/bus/i2c/devices/i2c-$Bus/new_device")}}};
Jae Hyun Yoo9cdeabb2018-10-16 11:47:09 -0700137} // namespace devices