fans:monitor:witherspoon: Install config.json file

In prep for switching the witherspoon machine over to using a runtime
fan monitoring JSON configuration, install the configuration file into
the image now.

Tested:
    Verified both `monitor.yaml` and `config.json` in phosphor-fan
    Built/installed witherspoon image and config.json file present
    Verified YAML config still used instead of present JSON config

Change-Id: Icf439c238b4a8cfe16de70ba68819071f6c1ed99
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/recipes-phosphor/fans/phosphor-fan-monitor-config.bbappend b/recipes-phosphor/fans/phosphor-fan-monitor-config.bbappend
index 8f2097c..9307f17 100644
--- a/recipes-phosphor/fans/phosphor-fan-monitor-config.bbappend
+++ b/recipes-phosphor/fans/phosphor-fan-monitor-config.bbappend
@@ -1 +1,14 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
+
+SRC_URI_witherspoon += "file://monitor.yaml"
+SRC_URI_witherspoon += "file://config.json"
+
+do_install_append_witherspoon() {
+        DEST=${D}${monitor_datadir}
+        install -D monitor.yaml ${D}${monitor_datadir}/monitor.yaml
+        install -d ${D}/${datadir}/phosphor-fan-presence/monitor/
+        install -m 0644 ${WORKDIR}/config.json ${D}/${datadir}/phosphor-fan-presence/monitor/
+}
+
+FILES_${PN}_witherspoon += "${datadir}/phosphor-fan-presence/monitor/config.json"
+FILES_${PN}_witherspoon += "${monitor_datadir}/monitor.yaml"
diff --git a/recipes-phosphor/fans/phosphor-fan-monitor-config/witherspoon/config.json b/recipes-phosphor/fans/phosphor-fan-monitor-config/witherspoon/config.json
new file mode 100644
index 0000000..5923ccc
--- /dev/null
+++ b/recipes-phosphor/fans/phosphor-fan-monitor-config/witherspoon/config.json
@@ -0,0 +1,121 @@
+{
+   "fans": [
+      {
+         "inventory": "/system/chassis/motherboard/fan0",
+         "functional_delay": 5,
+         "allowed_out_of_range_time": 30,
+         "deviation": 15,
+         "num_sensors_nonfunc_for_fan_nonfunc": 1,
+         "sensors": [
+            {
+               "name": "fan0_0",
+               "has_target": true
+            },
+            {
+               "name": "fan0_1",
+               "has_target": false
+            }
+         ]
+      },
+      {
+         "inventory": "/system/chassis/motherboard/fan1",
+         "functional_delay": 5,
+         "allowed_out_of_range_time": 30,
+         "deviation": 15,
+         "num_sensors_nonfunc_for_fan_nonfunc": 1,
+         "sensors": [
+            {
+               "name": "fan1_0",
+               "has_target": true
+            },
+            {
+               "name": "fan1_1",
+               "has_target": false
+            }
+         ],
+         "condition": {
+            "name": "propertiesMatch",
+            "properties": [
+               {
+                  "object": "/xyz/openbmc_project/inventory/system/chassis",
+                  "interface": "xyz.openbmc_project.Inventory.Decorator.CoolingType",
+                  "property": {
+                     "name": "WaterCooled",
+                     "type": "bool",
+                     "value": false
+                  }
+               }
+            ]
+         }
+      },
+      {
+         "inventory": "/system/chassis/motherboard/fan2",
+         "functional_delay": 5,
+         "allowed_out_of_range_time": 30,
+         "deviation": 15,
+         "num_sensors_nonfunc_for_fan_nonfunc": 1,
+         "sensors": [
+            {
+               "name": "fan2_0",
+               "has_target": true
+            },
+            {
+               "name": "fan2_1",
+               "has_target": false
+            }
+         ]
+      },
+      {
+         "inventory": "/system/chassis/motherboard/fan3",
+         "functional_delay": 5,
+         "allowed_out_of_range_time": 30,
+         "deviation": 15,
+         "num_sensors_nonfunc_for_fan_nonfunc": 1,
+         "sensors": [
+            {
+               "name": "fan3_0",
+               "has_target": true
+            },
+            {
+               "name": "fan3_1",
+               "has_target": false
+            }
+         ]
+      }
+   ],
+   "sensor_trust_groups": [
+      {
+         "class": "NonzeroSpeed",
+         "group": [
+            {
+               "name": "fan0_1"
+            },
+            {
+               "name": "fan1_1"
+            },
+            {
+               "name": "fan2_1"
+            },
+            {
+               "name": "fan3_1"
+            },
+            {
+               "name": "fan0_0",
+               "in_trust": false
+            },
+            {
+               "name": "fan1_0",
+               "in_trust": false
+            },
+            {
+               "name": "fan2_0",
+               "in_trust": false
+            },
+            {
+               "name": "fan3_0",
+               "in_trust": false
+            }
+         ]
+      }
+   ]
+}
diff --git a/recipes-phosphor/fans/phosphor-fan_%.bbappend b/recipes-phosphor/fans/phosphor-fan_%.bbappend
index 10f3f22..cb89a3a 100644
--- a/recipes-phosphor/fans/phosphor-fan_%.bbappend
+++ b/recipes-phosphor/fans/phosphor-fan_%.bbappend
@@ -58,6 +58,7 @@
 # Enable the use of JSON on the fan applications that support it
 EXTRA_OECONF_append_witherspoon = " --enable-json"
 RDEPENDS_${PN}-presence-tach_append_witherspoon = " phosphor-fan-presence-config"
+RDEPENDS_${PN}-monitor_append_witherspoon = " phosphor-fan-monitor-config"
 
 # Set the appropriate i2c address used within the overridden phosphor-fan-control@.service
 # file that's used for witherspoon type(including witherspoon-tacoma) machines