Lines Matching +full:gpio +full:- +full:config
9 * http://www.apache.org/licenses/LICENSE-2.0
23 #include <phosphor-logging/lg2.hpp>
29 namespace gpio namespace
37 /**< Enable pull-up. */
39 /**< Enable pull-down. */
48 CLI::App app{"Monitor gpio presence status"}; in main()
53 app.add_option("-c,--config", gpioFileName, "Name of config json file") in main()
54 ->required() in main()
55 ->check(CLI::ExistingFile); in main()
67 /* Get list of gpio config details from json file */ in main()
71 lg2::error("Failed to open config file: {FILE}", "FILE", gpioFileName); in main()
72 return -1; in main()
79 std::vector<phosphor::gpio::GpioPresence> gpios; in main()
83 /* GPIO Line message */ in main()
84 std::string lineMsg = "GPIO Line "; in main()
86 /* GPIO line */ in main()
89 /* GPIO line configuration, default to monitor both edge */ in main()
90 struct gpiod_line_request_config config{ in main() struct
104 /* If there is no line Name defined then gpio num nd chip in main()
106 * GPIO key configured by the kernel in main()
111 lg2::error("Failed to find line name or gpio number: {FILE}", in main()
113 return -1; in main()
121 /* Get the GPIO line */ in main()
126 /* Find the GPIO line */ in main()
134 lg2::error("Failed to find the {GPIO}", "GPIO", lineMsg); in main()
141 lg2::error("{GPIO}: Inventory path not specified", "GPIO", lineMsg); in main()
142 return -1; in main()
151 lg2::error("{GPIO}: Name path not specified", "GPIO", lineMsg); in main()
152 return -1; in main()
163 auto findBias = phosphor::gpio::biasMap.find(biasName); in main()
164 if (findBias == phosphor::gpio::biasMap.end()) in main()
166 lg2::error("{GPIO}: Bias unknown: {BIAS}", "GPIO", lineMsg, in main()
168 return -1; in main()
171 config.flags = findBias->second; in main()
177 config.flags |= GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW; in main()
187 gpios.push_back(phosphor::gpio::GpioPresence( in main()
188 line, config, io, inventory, extraInterfaces, name, lineMsg)); in main()