Lines Matching +full:gpio +full:- +full:line
8 * http://www.apache.org/licenses/LICENSE-2.0
22 #include <phosphor-logging/lg2.hpp>
28 namespace gpio namespace
46 CLI::App app{"Monitor GPIO line for requested state change"}; in main()
51 app.add_option("-c,--config", gpioFileName, "Name of config json file") in main()
52 ->required() in main()
53 ->check(CLI::ExistingFile); in main()
65 /* Get list of gpio config details from json file */ in main()
69 lg2::error("GPIO monitor config file not found: {FILE}", "FILE", in main()
71 return -1; in main()
78 std::vector<std::unique_ptr<phosphor::gpio::GpioMonitor>> gpios; in main()
82 /* GPIO Line message */ in main()
83 std::string lineMsg = "GPIO Line "; in main()
85 /* GPIO line */ in main()
86 gpiod_line* line = nullptr; in main() local
88 /* GPIO line configuration, default to monitor both edge */ in main()
103 /* If there is no line Name defined then gpio num nd chip in main()
105 * GPIO key configured by the kernel in main()
110 lg2::error("Failed to find line name or gpio number: {FILE}", in main()
112 return -1; in main()
120 /* Get the GPIO line */ in main()
121 line = gpiod_line_get(chipIdStr.c_str(), gpioNum); in main()
125 /* Find the GPIO line */ in main()
128 line = gpiod_line_find(lineName.c_str()); in main()
131 if (line == nullptr) in main()
133 lg2::error("Failed to find the {GPIO}", "GPIO", lineMsg); in main()
143 auto findEvent = phosphor::gpio::polarityMap.find(eventStr); in main()
144 if (findEvent == phosphor::gpio::polarityMap.end()) in main()
146 lg2::error("{GPIO}: event missing: {EVENT}", "GPIO", lineMsg, in main()
148 return -1; in main()
151 config.request_type = findEvent->second; in main()
169 /* Parse out the targets argument if multi-targets are needed.*/ in main()
176 gpios.push_back(std::make_unique<phosphor::gpio::GpioMonitor>( in main()
177 line, config, io, target, targets, lineMsg, flag)); in main()