Remove overlays for i2c based devices
Use sysfs instead
Change-Id: I8a6d57aabbebff8d488f8a61fc34ed5315c56807
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/devices.hpp b/include/devices.hpp
new file mode 100644
index 0000000..8eb87d1
--- /dev/null
+++ b/include/devices.hpp
@@ -0,0 +1,55 @@
+/*
+// 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 *parameters, const char *device) :
+ parameters(parameters), device(device){};
+ const char *parameters;
+ const char *device;
+};
+
+const boost::container::flat_map<const char *, ExportTemplate, CmpStr>
+ exportTemplates{
+ {{"PCA9543Mux",
+ ExportTemplate("pca9543 $Address",
+ "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
+ {"PCA9545Mux",
+ ExportTemplate("pca9545 $Address",
+ "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
+ {"TMP75", ExportTemplate("tmp75 $Address",
+ "/sys/bus/i2c/devices/i2c-$Bus/new_device")
+
+ },
+ {"TMP421", ExportTemplate("tmp421 $Address",
+ "/sys/bus/i2c/devices/i2c-$Bus/new_device")
+
+ }}};
+} // namespace devices
\ No newline at end of file