convert sysfs gpio usage to libgpiod

Updated Fan presence sensor monitoring call back
to use pin name and gpiod APIs. Number based sysfs
framework is deprecated and replaced by descriptor
based gpiod framework. With named gpio pin,
code is more portable provided the device tree
defines GPIO pin name consistently.

This requires device tree change (225598) and
configuration file change (entity-manager/+/28119)

Tested By:
remove and insert fans and observe fan presence
status change on dbus fan sensor objects

Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: Ice17a472285373ce866132ccc0da02cd1e70ddbe
diff --git a/include/TachSensor.hpp b/include/TachSensor.hpp
index c7c1b0e..9ae04e1 100644
--- a/include/TachSensor.hpp
+++ b/include/TachSensor.hpp
@@ -1,5 +1,4 @@
 #pragma once
-
 #include "Thresholds.hpp"
 #include "sensor.hpp"
 
@@ -7,6 +6,7 @@
 
 #include <boost/container/flat_map.hpp>
 #include <boost/container/flat_set.hpp>
+#include <gpiod.hpp>
 #include <memory>
 #include <optional>
 #include <sdbusplus/asio/object_server.hpp>
@@ -17,7 +17,7 @@
 class PresenceSensor
 {
   public:
-    PresenceSensor(const size_t index, bool inverted,
+    PresenceSensor(const std::string& pinName, bool inverted,
                    boost::asio::io_service& io, const std::string& name);
     ~PresenceSensor();
 
@@ -28,8 +28,8 @@
   private:
     bool status = true;
     bool inverted;
-    boost::asio::ip::tcp::socket inputDev;
-    int fd;
+    gpiod::line gpioLine;
+    boost::asio::posix::stream_descriptor gpioFd;
     std::string name;
 };