convert sysfs gpio usage to libgpiod

Remove gpion pin number definition is R2000
and WFT configuration files

Tested By:
LED FAN Fault can be truned on/off correctly with
the configuration file
ipmitool raw 0x30 0x57 0x0 0x0 0x0 0x0 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xaa

Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: Idd5defe30a4ce442d659aca708493d9d24c4bc08
diff --git a/configurations/R2000 Chassis.json b/configurations/R2000 Chassis.json
index 111acdd..778a0fc 100644
--- a/configurations/R2000 Chassis.json
+++ b/configurations/R2000 Chassis.json
@@ -2,10 +2,13 @@
     "Exposes": [
         {
             "BindConnector": "2U System Fan connector 1",
-            "BindPresence": "Fan 0 Present",
             "Index": 0,
             "MaxReading": 14000,
             "Name": "Fan 1",
+            "Presence": {
+                "PinName": "FM_SYS_FAN0_PRSNT_D_N",
+                "Polarity": "Low"
+            },
             "Thresholds": [
                 {
                     "Direction": "less than",
@@ -24,10 +27,13 @@
         },
         {
             "BindConnector": "2U System Fan connector 2",
-            "BindPresence": "Fan 1 Present",
             "Index": 2,
             "MaxReading": 14000,
             "Name": "Fan 2",
+            "Presence": {
+                "PinName": "FM_SYS_FAN1_PRSNT_D_N",
+                "Polarity": "Low"
+            },
             "Thresholds": [
                 {
                     "Direction": "less than",
@@ -46,10 +52,13 @@
         },
         {
             "BindConnector": "2U System Fan connector 3",
-            "BindPresence": "Fan 2 Present",
             "Index": 4,
             "MaxReading": 14000,
             "Name": "Fan 3",
+            "Presence": {
+                "PinName": "FM_SYS_FAN2_PRSNT_D_N",
+                "Polarity": "Low"
+            },
             "Thresholds": [
                 {
                     "Direction": "less than",
@@ -68,10 +77,13 @@
         },
         {
             "BindConnector": "2U System Fan connector 4",
-            "BindPresence": "Fan 3 Present",
             "Index": 6,
             "MaxReading": 14000,
             "Name": "Fan 4",
+            "Presence": {
+                "PinName": "FM_SYS_FAN3_PRSNT_D_N",
+                "Polarity": "Low"
+            },
             "Thresholds": [
                 {
                     "Direction": "less than",
@@ -90,10 +102,13 @@
         },
         {
             "BindConnector": "2U System Fan connector 5",
-            "BindPresence": "Fan 4 Present",
             "Index": 8,
             "MaxReading": 14000,
             "Name": "Fan 5",
+            "Presence": {
+                "PinName": "FM_SYS_FAN4_PRSNT_D_N",
+                "Polarity": "Low"
+            },
             "Thresholds": [
                 {
                     "Direction": "less than",
@@ -112,10 +127,13 @@
         },
         {
             "BindConnector": "2U System Fan connector 6",
-            "BindPresence": "Fan 5 Present",
             "Index": 10,
             "MaxReading": 14000,
             "Name": "Fan 6",
+            "Presence": {
+                "PinName": "FM_SYS_FAN5_PRSNT_D_N",
+                "Polarity": "Low"
+            },
             "Thresholds": [
                 {
                     "Direction": "less than",
diff --git a/configurations/WFT Baseboard.json b/configurations/WFT Baseboard.json
index 9846e44..24822f8 100644
--- a/configurations/WFT Baseboard.json
+++ b/configurations/WFT Baseboard.json
@@ -557,468 +557,12 @@
         },
         {
             "Direction": "Input",
-            "Index": 64,
-            "Name": "Fan 0 Present",
-            "Polarity": "Low",
-            "Status": "disabled",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Input",
-            "Index": 65,
-            "Name": "Fan 1 Present",
-            "Polarity": "Low",
-            "Status": "disabled",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Input",
-            "Index": 66,
-            "Name": "Fan 2 Present",
-            "Polarity": "Low",
-            "Status": "disabled",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Input",
-            "Index": 67,
-            "Name": "Fan 3 Present",
-            "Polarity": "Low",
-            "Status": "disabled",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Input",
-            "Index": 68,
-            "Name": "Fan 4 Present",
-            "Polarity": "Low",
-            "Status": "disabled",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Input",
-            "Index": 69,
-            "Name": "Fan 5 Present",
-            "Polarity": "Low",
-            "Status": "disabled",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Input",
-            "Index": 70,
-            "Name": "Fan 6 Present",
-            "Polarity": "Low",
-            "Status": "disabled",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Input",
-            "Index": 71,
-            "Name": "Fan 7 Present",
-            "Polarity": "Low",
-            "Status": "disabled",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Input",
             "Index": 218,
             "Name": "ID Button",
             "Polarity": "Low",
             "Type": "Gpio"
         },
         {
-            "Direction": "Out",
-            "Index": 240,
-            "Name": "CPU1 CH1 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 241,
-            "Name": "CPU1 CH1 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 242,
-            "Name": "CPU1 CH2 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 243,
-            "Name": "CPU1 CH2 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 244,
-            "Name": "CPU1 CH3 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 245,
-            "Name": "CPU1 CH3 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 246,
-            "Name": "CPU1 CH4 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 247,
-            "Name": "CPU1 CH4 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 248,
-            "Name": "CPU1 CH5 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 249,
-            "Name": "CPU1 CH5 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 250,
-            "Name": "CPU1 CH6 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 251,
-            "Name": "CPU1 CH6 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 252,
-            "Name": "Fan1",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 253,
-            "Name": "Fan2",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 254,
-            "Name": "Fan3",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 255,
-            "Name": "Fan4",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 256,
-            "Name": "Fan5",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 257,
-            "Name": "Fan6",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 258,
-            "Name": "Fan7",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 259,
-            "Name": "Fan8",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 260,
-            "Name": "CPU2 CH1 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 261,
-            "Name": "CPU1 CH1 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 262,
-            "Name": "CPU2 CH2 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 263,
-            "Name": "CPU2 CH2 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 264,
-            "Name": "CPU2 CH3 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 265,
-            "Name": "CPU2 CH3 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 266,
-            "Name": "CPU2 CH4 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 267,
-            "Name": "CPU2 CH4 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 268,
-            "Name": "CPU2 CH5 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 269,
-            "Name": "CPU2 CH5 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 270,
-            "Name": "CPU2 CH6 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 271,
-            "Name": "CPU2 CH6 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 272,
-            "Name": "CPU3 CH1 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 273,
-            "Name": "CPU3 CH1 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 274,
-            "Name": "CPU3 CH2 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 275,
-            "Name": "CPU3 CH2 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 276,
-            "Name": "CPU3 CH3 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 277,
-            "Name": "CPU3 CH3 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 278,
-            "Name": "CPU3 CH4 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 279,
-            "Name": "CPU3 CH4 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 280,
-            "Name": "CPU3 CH5 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 281,
-            "Name": "CPU3 CH5 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 282,
-            "Name": "CPU3 CH6 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 283,
-            "Name": "CPU3 CH6 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 284,
-            "Name": "CPU4 CH1 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 285,
-            "Name": "CPU4 CH1 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 286,
-            "Name": "CPU4 CH2 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 287,
-            "Name": "CPU4 CH2 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 288,
-            "Name": "CPU4 CH3 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 289,
-            "Name": "CPU4 CH3 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 290,
-            "Name": "CPU4 CH4 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 291,
-            "Name": "CPU4 CH4 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 292,
-            "Name": "CPU4 CH5 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 293,
-            "Name": "CPU4 CH5 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 294,
-            "Name": "CPU4 CH6 DIMM1 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
-            "Direction": "Out",
-            "Index": 295,
-            "Name": "CPU4 CH6 DIMM2 FAULT",
-            "Polarity": "Low",
-            "Type": "Gpio"
-        },
-        {
             "Name": "1U System Fan connector 1",
             "Pwm": 0,
             "Status": "disabled",
@@ -1472,102 +1016,6 @@
             "Type": "IpmbSensor"
         },
         {
-            "FaultIndex": 0,
-            "FaultType": "faultMemory",
-            "LedGpioPins": [
-                240,
-                241,
-                242,
-                243,
-                244,
-                245,
-                246,
-                247,
-                248,
-                249,
-                250,
-                251
-            ],
-            "Name": "CPU1 DIMM FAULT LEDs",
-            "Type": "LedFault"
-        },
-        {
-            "FaultIndex": 1,
-            "FaultType": "faultMemory",
-            "LedGpioPins": [
-                260,
-                261,
-                262,
-                263,
-                264,
-                265,
-                266,
-                267,
-                268,
-                269,
-                270,
-                271
-            ],
-            "Name": "CPU2 DIMM FAULT LEDs",
-            "Type": "LedFault"
-        },
-        {
-            "FaultIndex": 2,
-            "FaultType": "faultMemory",
-            "LedGpioPins": [
-                273,
-                273,
-                274,
-                275,
-                276,
-                277,
-                278,
-                279,
-                280,
-                281,
-                282,
-                283
-            ],
-            "Name": "CPU3 DIMM FAULT LEDs",
-            "Type": "LedFault"
-        },
-        {
-            "FaultIndex": 3,
-            "FaultType": "faultMemory",
-            "LedGpioPins": [
-                284,
-                285,
-                286,
-                287,
-                288,
-                289,
-                290,
-                291,
-                292,
-                293,
-                294,
-                295
-            ],
-            "Name": "CPU4 DIMM FAULT LEDs",
-            "Type": "LedFault"
-        },
-        {
-            "FaultIndex": 0,
-            "FaultType": "faultFan",
-            "LedGpioPins": [
-                252,
-                253,
-                254,
-                255,
-                256,
-                257,
-                258,
-                259
-            ],
-            "Name": "Fan FAULT LEDs",
-            "Type": "LedFault"
-        },
-        {
             "Name": "Node Manager Sensor",
             "Type": "NMSensor"
         },