James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | |
| 17 | #include <string> |
| 18 | #include <iostream> |
| 19 | #include <regex> |
James Feist | 286babc | 2019-02-07 16:48:28 -0800 | [diff] [blame^] | 20 | #include <iomanip> |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 21 | #include <boost/process/child.hpp> |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 22 | #include <boost/algorithm/string/predicate.hpp> |
Ed Tanous | 072e25d | 2018-12-16 21:45:20 -0800 | [diff] [blame] | 23 | #include "filesystem.hpp" |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 24 | #include <boost/container/flat_map.hpp> |
| 25 | #include <boost/container/flat_set.hpp> |
| 26 | #include <nlohmann/json.hpp> |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 27 | #include <devices.hpp> |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 28 | #include <Overlay.hpp> |
| 29 | #include <Utils.hpp> |
| 30 | |
| 31 | constexpr const char *DT_OVERLAY = "/usr/bin/dtoverlay"; |
| 32 | constexpr const char *DTC = "/usr/bin/dtc"; |
| 33 | constexpr const char *OUTPUT_DIR = "/tmp/overlays"; |
James Feist | ce4367c | 2018-10-16 09:19:57 -0700 | [diff] [blame] | 34 | constexpr const char *TEMPLATE_DIR = PACKAGE_DIR "overlay_templates"; |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 35 | constexpr const char *TEMPLATE_CHAR = "$"; |
Jae Hyun Yoo | 6d1d014 | 2018-07-25 10:07:43 -0700 | [diff] [blame] | 36 | constexpr const char *HEX_FORMAT_STR = "0x"; |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 37 | constexpr const char *PLATFORM = "aspeed,ast2500"; |
James Feist | 286babc | 2019-02-07 16:48:28 -0800 | [diff] [blame^] | 38 | constexpr const char *I2C_DEVS_DIR = "/sys/bus/i2c/devices"; |
| 39 | constexpr const char *MUX_SYMLINK_DIR = "/dev/i2c-mux"; |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 40 | |
| 41 | // some drivers need to be unbind / bind to load device tree changes |
| 42 | static const boost::container::flat_map<std::string, std::string> FORCE_PROBES = |
| 43 | {{"IntelFanConnector", "/sys/bus/platform/drivers/aspeed_pwm_tacho"}}; |
| 44 | |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 45 | std::regex ILLEGAL_NAME_REGEX("[^A-Za-z0-9_]"); |
| 46 | |
| 47 | void createOverlay(const std::string &templatePath, |
| 48 | const nlohmann::json &configuration); |
| 49 | |
| 50 | void unloadAllOverlays(void) |
| 51 | { |
| 52 | boost::process::child c(DT_OVERLAY, "-d", OUTPUT_DIR, "-R"); |
| 53 | c.wait(); |
| 54 | } |
| 55 | |
| 56 | // this is hopefully temporary, but some drivers can't detect changes |
| 57 | // without an unbind and bind so this function must exist for now |
| 58 | void forceProbe(const std::string &driver) |
| 59 | { |
| 60 | std::ofstream driverUnbind(driver + "/unbind"); |
| 61 | std::ofstream driverBind(driver + "/bind"); |
| 62 | if (!driverUnbind.is_open()) |
| 63 | { |
| 64 | std::cerr << "force probe error opening " << driver << "\n"; |
| 65 | return; |
| 66 | } |
| 67 | if (!driverBind.is_open()) |
| 68 | { |
| 69 | driverUnbind.close(); |
| 70 | std::cerr << "force probe error opening " << driver << "\n"; |
| 71 | return; |
| 72 | } |
| 73 | |
Ed Tanous | 072e25d | 2018-12-16 21:45:20 -0800 | [diff] [blame] | 74 | std::filesystem::path pathObj(driver); |
| 75 | for (auto &p : std::filesystem::directory_iterator(pathObj)) |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 76 | { |
| 77 | // symlinks are object names |
| 78 | if (is_symlink(p)) |
| 79 | { |
| 80 | std::string driverName = p.path().filename(); |
| 81 | driverUnbind << driverName; |
| 82 | driverBind << driverName; |
| 83 | break; |
| 84 | } |
| 85 | } |
| 86 | driverUnbind.close(); |
| 87 | driverBind.close(); |
| 88 | } |
| 89 | |
| 90 | // helper function to make json types into string |
| 91 | std::string jsonToString(const nlohmann::json &in) |
| 92 | { |
| 93 | if (in.type() == nlohmann::json::value_t::string) |
| 94 | { |
| 95 | return in.get<std::string>(); |
| 96 | } |
| 97 | else if (in.type() == nlohmann::json::value_t::array) |
| 98 | { |
| 99 | // remove brackets and comma from array |
| 100 | std::string array = in.dump(); |
| 101 | array = array.substr(1, array.size() - 2); |
| 102 | boost::replace_all(array, ",", " "); |
| 103 | return array; |
| 104 | } |
| 105 | return in.dump(); |
| 106 | } |
| 107 | |
James Feist | 286babc | 2019-02-07 16:48:28 -0800 | [diff] [blame^] | 108 | void linkMux(const std::string &muxName, size_t bus, size_t address, |
| 109 | const nlohmann::json::array_t &channelNames) |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 110 | { |
James Feist | 286babc | 2019-02-07 16:48:28 -0800 | [diff] [blame^] | 111 | // create directory first time |
| 112 | static bool createDir = false; |
| 113 | std::error_code ec; |
| 114 | if (!createDir) |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 115 | { |
James Feist | 286babc | 2019-02-07 16:48:28 -0800 | [diff] [blame^] | 116 | std::filesystem::create_directory(MUX_SYMLINK_DIR, ec); |
| 117 | createDir = true; |
| 118 | } |
| 119 | std::ostringstream hex; |
| 120 | hex << std::hex << std::setfill('0') << std::setw(4) << address; |
| 121 | const std::string &addressHex = hex.str(); |
| 122 | |
| 123 | std::filesystem::path devDir(I2C_DEVS_DIR); |
| 124 | devDir /= std::to_string(bus) + "-" + addressHex; |
| 125 | |
| 126 | size_t channel = 0; |
| 127 | std::string channelName; |
| 128 | std::filesystem::path channelPath = devDir / "channel-0"; |
| 129 | while (is_symlink(channelPath)) |
| 130 | { |
| 131 | if (channel > channelNames.size()) |
| 132 | { |
| 133 | channelName = std::to_string(channel); |
| 134 | } |
| 135 | else |
| 136 | { |
| 137 | const std::string *ptr = |
| 138 | channelNames[channel].get_ptr<const std::string *>(); |
| 139 | if (ptr == nullptr) |
| 140 | { |
| 141 | channelName = channelNames[channel].dump(); |
| 142 | } |
| 143 | else |
| 144 | { |
| 145 | channelName = *ptr; |
| 146 | } |
| 147 | } |
| 148 | // if configuration has name empty, don't put it in dev |
| 149 | if (channelName.empty()) |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 150 | { |
| 151 | continue; |
| 152 | } |
James Feist | 286babc | 2019-02-07 16:48:28 -0800 | [diff] [blame^] | 153 | |
| 154 | std::filesystem::path bus = std::filesystem::read_symlink(channelPath); |
| 155 | const std::string &busName = bus.filename(); |
| 156 | |
| 157 | std::string linkDir = MUX_SYMLINK_DIR + std::string("/") + muxName; |
| 158 | if (channel == 0) |
| 159 | { |
| 160 | std::filesystem::create_directory(linkDir, ec); |
| 161 | } |
| 162 | std::filesystem::create_symlink( |
| 163 | "/dev/" + busName, linkDir + std::string("/") + channelName, ec); |
| 164 | |
| 165 | if (ec) |
| 166 | { |
| 167 | std::cerr << "Failure creating symlink for " << busName << "\n"; |
| 168 | return; |
| 169 | } |
| 170 | |
| 171 | channel++; |
| 172 | channelPath = devDir / ("channel-" + std::to_string(channel)); |
| 173 | } |
| 174 | if (channel == 0) |
| 175 | { |
| 176 | std::cerr << "Mux missing channels " << devDir << "\n"; |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 177 | } |
| 178 | } |
| 179 | |
James Feist | 286babc | 2019-02-07 16:48:28 -0800 | [diff] [blame^] | 180 | void exportDevice(const std::string &type, |
| 181 | const devices::ExportTemplate &exportTemplate, |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 182 | const nlohmann::json &configuration) |
| 183 | { |
| 184 | |
| 185 | std::string parameters = exportTemplate.parameters; |
| 186 | std::string device = exportTemplate.device; |
| 187 | std::string name = "unknown"; |
| 188 | const uint64_t *bus = nullptr; |
| 189 | const uint64_t *address = nullptr; |
James Feist | 286babc | 2019-02-07 16:48:28 -0800 | [diff] [blame^] | 190 | const nlohmann::json::array_t *channels = nullptr; |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 191 | |
| 192 | for (auto keyPair = configuration.begin(); keyPair != configuration.end(); |
| 193 | keyPair++) |
| 194 | { |
| 195 | std::string subsituteString; |
| 196 | |
| 197 | if (keyPair.key() == "Name" && |
| 198 | keyPair.value().type() == nlohmann::json::value_t::string) |
| 199 | { |
| 200 | subsituteString = std::regex_replace( |
| 201 | keyPair.value().get<std::string>(), ILLEGAL_NAME_REGEX, "_"); |
| 202 | name = subsituteString; |
| 203 | } |
| 204 | else |
| 205 | { |
| 206 | subsituteString = jsonToString(keyPair.value()); |
| 207 | } |
| 208 | |
| 209 | if (keyPair.key() == "Bus") |
| 210 | { |
| 211 | bus = keyPair.value().get_ptr<const uint64_t *>(); |
| 212 | } |
| 213 | else if (keyPair.key() == "Address") |
| 214 | { |
| 215 | address = keyPair.value().get_ptr<const uint64_t *>(); |
| 216 | } |
James Feist | 286babc | 2019-02-07 16:48:28 -0800 | [diff] [blame^] | 217 | else if (keyPair.key() == "ChannelNames") |
| 218 | { |
| 219 | channels = |
| 220 | keyPair.value().get_ptr<const nlohmann::json::array_t *>(); |
| 221 | } |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 222 | boost::replace_all(parameters, TEMPLATE_CHAR + keyPair.key(), |
| 223 | subsituteString); |
| 224 | boost::replace_all(device, TEMPLATE_CHAR + keyPair.key(), |
| 225 | subsituteString); |
| 226 | } |
| 227 | |
| 228 | // if we found bus and address we can attempt to prevent errors |
| 229 | if (bus != nullptr && address != nullptr) |
| 230 | { |
| 231 | std::ostringstream hex; |
| 232 | hex << std::hex << *address; |
| 233 | const std::string &addressHex = hex.str(); |
| 234 | std::string busStr = std::to_string(*bus); |
| 235 | |
Ed Tanous | 072e25d | 2018-12-16 21:45:20 -0800 | [diff] [blame] | 236 | std::filesystem::path devicePath(device); |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 237 | const std::string &dir = devicePath.parent_path().string(); |
Ed Tanous | 072e25d | 2018-12-16 21:45:20 -0800 | [diff] [blame] | 238 | for (const auto &path : std::filesystem::directory_iterator(dir)) |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 239 | { |
Ed Tanous | 072e25d | 2018-12-16 21:45:20 -0800 | [diff] [blame] | 240 | if (!std::filesystem::is_directory(path)) |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 241 | { |
| 242 | continue; |
| 243 | } |
| 244 | |
| 245 | const std::string &directoryName = path.path().filename(); |
| 246 | if (boost::starts_with(directoryName, busStr) && |
| 247 | boost::ends_with(directoryName, addressHex)) |
| 248 | { |
| 249 | return; // already exported |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | std::ofstream deviceFile(device); |
| 255 | if (!deviceFile.good()) |
| 256 | { |
| 257 | std::cerr << "Error writing " << device << "\n"; |
| 258 | return; |
| 259 | } |
| 260 | deviceFile << parameters; |
| 261 | deviceFile.close(); |
James Feist | 286babc | 2019-02-07 16:48:28 -0800 | [diff] [blame^] | 262 | if (boost::ends_with(type, "Mux") && bus && address && channels) |
| 263 | { |
| 264 | linkMux(name, *bus, *address, *channels); |
| 265 | } |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 266 | } |
| 267 | |
| 268 | // this is now deprecated |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 269 | void createOverlay(const std::string &templatePath, |
| 270 | const nlohmann::json &configuration) |
| 271 | { |
| 272 | std::ifstream templateFile(templatePath); |
| 273 | |
| 274 | if (!templateFile.is_open()) |
| 275 | { |
| 276 | std::cerr << "createOverlay error opening " << templatePath << "\n"; |
| 277 | return; |
| 278 | } |
| 279 | std::stringstream buff; |
| 280 | buff << templateFile.rdbuf(); |
| 281 | std::string templateStr = buff.str(); |
| 282 | std::string name = "unknown"; |
James Feist | d63d18a | 2018-07-19 15:23:45 -0700 | [diff] [blame] | 283 | std::string type = configuration["Type"]; |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 284 | for (auto keyPair = configuration.begin(); keyPair != configuration.end(); |
| 285 | keyPair++) |
| 286 | { |
| 287 | std::string subsituteString; |
| 288 | |
| 289 | // device tree symbols are in decimal |
James Feist | 1e3e698 | 2018-08-03 16:09:28 -0700 | [diff] [blame] | 290 | if (keyPair.key() == "Bus" && |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 291 | keyPair.value().type() == nlohmann::json::value_t::string) |
| 292 | { |
| 293 | unsigned int dec = |
| 294 | std::stoul(keyPair.value().get<std::string>(), nullptr, 16); |
| 295 | subsituteString = std::to_string(dec); |
| 296 | } |
James Feist | d63d18a | 2018-07-19 15:23:45 -0700 | [diff] [blame] | 297 | else if (keyPair.key() == "Name" && |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 298 | keyPair.value().type() == nlohmann::json::value_t::string) |
| 299 | { |
| 300 | subsituteString = std::regex_replace( |
| 301 | keyPair.value().get<std::string>(), ILLEGAL_NAME_REGEX, "_"); |
| 302 | name = subsituteString; |
| 303 | } |
James Feist | 1e3e698 | 2018-08-03 16:09:28 -0700 | [diff] [blame] | 304 | else if (keyPair.key() == "Address") |
Jae Hyun Yoo | 6d1d014 | 2018-07-25 10:07:43 -0700 | [diff] [blame] | 305 | { |
| 306 | if (keyPair.value().type() == nlohmann::json::value_t::string) |
| 307 | { |
| 308 | subsituteString = keyPair.value().get<std::string>(); |
| 309 | subsituteString.erase( |
| 310 | 0, subsituteString.find_first_not_of(HEX_FORMAT_STR)); |
| 311 | } |
| 312 | else |
| 313 | { |
| 314 | std::ostringstream hex; |
| 315 | hex << std::hex << keyPair.value().get<unsigned int>(); |
| 316 | subsituteString = hex.str(); |
| 317 | } |
| 318 | } |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 319 | else |
| 320 | { |
| 321 | subsituteString = jsonToString(keyPair.value()); |
| 322 | } |
| 323 | boost::replace_all(templateStr, TEMPLATE_CHAR + keyPair.key(), |
| 324 | subsituteString); |
| 325 | } |
| 326 | // todo: this is a lame way to fill in platform, but we only |
| 327 | // care about ast2500 right now |
James Feist | 1e3e698 | 2018-08-03 16:09:28 -0700 | [diff] [blame] | 328 | boost::replace_all(templateStr, TEMPLATE_CHAR + std::string("Platform"), |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 329 | PLATFORM); |
| 330 | std::string dtsFilename = |
| 331 | std::string(OUTPUT_DIR) + "/" + name + "_" + type + ".dts"; |
| 332 | std::string dtboFilename = |
| 333 | std::string(OUTPUT_DIR) + "/" + name + "_" + type + ".dtbo"; |
| 334 | |
| 335 | std::ofstream out(dtsFilename); |
| 336 | if (!out.is_open()) |
| 337 | { |
| 338 | std::cerr << "createOverlay error opening " << dtsFilename << "\n"; |
| 339 | return; |
| 340 | } |
| 341 | out << templateStr; |
| 342 | out.close(); |
| 343 | |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 344 | // compile dtbo and load overlay |
| 345 | boost::process::child c1(DTC, "-@", "-q", "-I", "dts", "-O", "dtb", "-o", |
| 346 | dtboFilename, dtsFilename); |
| 347 | c1.wait(); |
| 348 | if (c1.exit_code()) |
| 349 | { |
| 350 | std::cerr << "DTC error with file " << dtsFilename << "\n"; |
| 351 | return; |
| 352 | } |
| 353 | boost::process::child c2(DT_OVERLAY, "-d", OUTPUT_DIR, name + "_" + type); |
| 354 | c2.wait(); |
| 355 | if (c2.exit_code()) |
| 356 | { |
| 357 | std::cerr << "DTOverlay error with file " << dtboFilename << "\n"; |
| 358 | return; |
| 359 | } |
| 360 | auto findForceProbe = FORCE_PROBES.find(type); |
| 361 | if (findForceProbe != FORCE_PROBES.end()) |
| 362 | { |
| 363 | forceProbe(findForceProbe->second); |
| 364 | } |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 365 | } |
| 366 | |
| 367 | bool loadOverlays(const nlohmann::json &systemConfiguration) |
| 368 | { |
| 369 | |
Ed Tanous | 072e25d | 2018-12-16 21:45:20 -0800 | [diff] [blame] | 370 | std::vector<std::filesystem::path> paths; |
| 371 | if (!findFiles(std::filesystem::path(TEMPLATE_DIR), |
James Feist | a3c180a | 2018-08-09 16:06:04 -0700 | [diff] [blame] | 372 | R"(.*\.template)", paths)) |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 373 | { |
| 374 | std::cerr << "Unable to find any tempate files in " << TEMPLATE_DIR |
| 375 | << "\n"; |
| 376 | return false; |
| 377 | } |
| 378 | |
Ed Tanous | 072e25d | 2018-12-16 21:45:20 -0800 | [diff] [blame] | 379 | std::filesystem::create_directory(OUTPUT_DIR); |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 380 | for (auto entity = systemConfiguration.begin(); |
| 381 | entity != systemConfiguration.end(); entity++) |
| 382 | { |
James Feist | 1e3e698 | 2018-08-03 16:09:28 -0700 | [diff] [blame] | 383 | auto findExposes = entity.value().find("Exposes"); |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 384 | if (findExposes == entity.value().end() || |
| 385 | findExposes->type() != nlohmann::json::value_t::array) |
| 386 | { |
| 387 | continue; |
| 388 | } |
| 389 | |
| 390 | for (auto &configuration : *findExposes) |
| 391 | { |
James Feist | 1e3e698 | 2018-08-03 16:09:28 -0700 | [diff] [blame] | 392 | auto findStatus = configuration.find("Status"); |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 393 | // status missing is assumed to be 'okay' |
| 394 | if (findStatus != configuration.end() && *findStatus == "disabled") |
| 395 | { |
| 396 | continue; |
| 397 | } |
James Feist | d63d18a | 2018-07-19 15:23:45 -0700 | [diff] [blame] | 398 | auto findType = configuration.find("Type"); |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 399 | if (findType == configuration.end() || |
| 400 | findType->type() != nlohmann::json::value_t::string) |
| 401 | { |
| 402 | continue; |
| 403 | } |
| 404 | std::string type = findType.value().get<std::string>(); |
James Feist | ce4367c | 2018-10-16 09:19:57 -0700 | [diff] [blame] | 405 | #if OVERLAYS |
| 406 | |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 407 | std::string typeFile = type + std::string(".template"); |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 408 | for (const auto &path : paths) |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 409 | { |
| 410 | if (path.filename() != typeFile) |
| 411 | { |
| 412 | continue; |
| 413 | } |
| 414 | createOverlay(path.string(), configuration); |
| 415 | break; |
| 416 | } |
James Feist | ce4367c | 2018-10-16 09:19:57 -0700 | [diff] [blame] | 417 | #endif |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 418 | auto device = devices::exportTemplates.find(type.c_str()); |
| 419 | if (device != devices::exportTemplates.end()) |
| 420 | { |
James Feist | 286babc | 2019-02-07 16:48:28 -0800 | [diff] [blame^] | 421 | exportDevice(type, device->second, configuration); |
James Feist | 053a664 | 2018-10-15 13:17:09 -0700 | [diff] [blame] | 422 | } |
James Feist | c95cb14 | 2018-02-26 10:41:42 -0800 | [diff] [blame] | 423 | } |
| 424 | } |
| 425 | |
| 426 | return true; |
Jae Hyun Yoo | 6d1d014 | 2018-07-25 10:07:43 -0700 | [diff] [blame] | 427 | } |