meta-facebook: Support airflow sensor

Support airflow sensor for single/duo rotor(per fan) unit.

Tested:
Get airflow sensor reading from D-bus.

Change-Id: Icac292f79f58a9c60df754cc24ad3ad6606cfceb
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
diff --git a/meta-facebook/recipes-phosphor/sensors/phosphor-virtual-sensor/greatlakes/greatlakes_sensor_config.json b/meta-facebook/recipes-phosphor/sensors/phosphor-virtual-sensor/greatlakes/greatlakes_sensor_config.json
index e6793fa..10c739d 100644
--- a/meta-facebook/recipes-phosphor/sensors/phosphor-virtual-sensor/greatlakes/greatlakes_sensor_config.json
+++ b/meta-facebook/recipes-phosphor/sensors/phosphor-virtual-sensor/greatlakes/greatlakes_sensor_config.json
@@ -237,5 +237,78 @@
     },
 
     "Expression": "(( P6 / P1 / P2 - P3 ) * P4 + P5 ) * P7"
+  },
+  {
+    "Desc": {
+      "Name": "BB_SYSTEM_AIRFLOW_CFM",
+      "SensorType": "airflow",
+      "MinValue": 0
+    },
+
+    "Params": {
+        "ConstParam": [
+          {
+            "ParamName": "rotor_single_or_duo",
+            "Value": 1
+          },
+          {
+            "ParamName": "max_support_rotor_per_fan",
+            "Value": 2
+          },
+          {
+            "ParamName": "gradient_single",
+            "Value": 0.0203
+          },
+          {
+            "ParamName": "gradient_duo",
+            "Value": 0
+          },
+          {
+            "ParamName": "displacement_single",
+            "Value": -9.9157
+          },
+          {
+            "ParamName": "displacement_duo",
+            "Value": 0
+          }
+        ],
+
+        "DbusParam": [
+          {
+            "ParamName": "rpm1",
+            "Desc": {
+              "Name": "BB_FAN0_TACH_RPM",
+              "SensorType": "fan_tach"
+            }
+          },
+          {
+            "ParamName": "rpm2",
+            "Desc": {
+              "Name": "BB_FAN1_TACH_RPM",
+              "SensorType": "fan_tach"
+            }
+          },
+          {
+            "ParamName": "rpm3",
+            "Desc": {
+              "Name": "BB_FAN2_TACH_RPM",
+              "SensorType": "fan_tach"
+            }
+          },
+          {
+            "ParamName": "rpm4",
+            "Desc": {
+              "Name": "BB_FAN3_TACH_RPM",
+              "SensorType": "fan_tach"
+            }
+          }
+        ]
+    },
+
+    "Expression": [
+      "(max_support_rotor_per_fan - 1) * (max_support_rotor_per_fan - 2) == 0 ? ",
+      "((rotor_single_or_duo % 2) * (gradient_single * avg(rpm1, rpm2, rpm3, rpm4) + displacement_single)) + ",
+      "(((rotor_single_or_duo - 1) % 2) * (gradient_duo * avg(rpm1, rpm2, rpm3, rpm4) + displacement_duo)) : 0"
+    ]
   }
 ]