blob: 5c8ba150bc8cf010b5a99be6a40143cba6bbe51b [file] [log] [blame]
/*
// Copyright (c) 2018 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
*/
#pragma once
#include <boost/container/flat_map.hpp>
namespace devices
{
struct CmpStr
{
bool operator()(const char* a, const char* b) const
{
return std::strcmp(a, b) < 0;
}
};
struct ExportTemplate
{
ExportTemplate(const char* params, const char* dev) :
parameters(params), device(dev){};
const char* parameters;
const char* device;
};
const boost::container::flat_map<const char*, ExportTemplate, CmpStr>
exportTemplates{
{{"24C02", ExportTemplate("24c02 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"24C64", ExportTemplate("24c64 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"EEPROM", ExportTemplate("eeprom $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"EMC1413",
ExportTemplate("emc1413 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"Gpio", ExportTemplate("$Index", "/sys/class/gpio/export")},
{"INA230", ExportTemplate("ina230 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"ISL68137",
ExportTemplate("isl68137 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"MAX16601",
ExportTemplate("max16601 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"MAX20730",
ExportTemplate("max20730 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"MAX20734",
ExportTemplate("max20734 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"MAX20796",
ExportTemplate("max20796 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"MAX31725",
ExportTemplate("max31725 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"MAX31730",
ExportTemplate("max31730 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"MAX34451",
ExportTemplate("max34451 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"PCA9543Mux",
ExportTemplate("pca9543 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"PCA9544Mux",
ExportTemplate("pca9544 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"PCA9545Mux",
ExportTemplate("pca9545 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"PCA9546Mux",
ExportTemplate("pca9546 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"PCA9547Mux",
ExportTemplate("pca9547 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"pmbus", ExportTemplate("pmbus $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"TMP112", ExportTemplate("tmp112 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"TMP175", ExportTemplate("tmp175 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"TMP421", ExportTemplate("tmp421 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"TMP441", ExportTemplate("tmp441 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")},
{"TMP75",
ExportTemplate("tmp75 $Address",
"/sys/bus/i2c/devices/i2c-$Bus/new_device")}}};
} // namespace devices