control:ibm,rainier-4u: Fan rotor nonfunctional event

Sets/holds the fans at a target of 10000rpm when 1 or more fan
rotors are deemed nonfunctional.

Change-Id: I4628686fc01ef52f9e92126d63231d893115cf57
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/config_files/p10bmc/ibm,rainier-4u/events.json b/control/config_files/p10bmc/ibm,rainier-4u/events.json
index bf267ad..091c260 100644
--- a/control/config_files/p10bmc/ibm,rainier-4u/events.json
+++ b/control/config_files/p10bmc/ibm,rainier-4u/events.json
@@ -27,5 +27,59 @@
          "target": 10000
        }
      ]
+   },
+   {
+     // Hold fans at the given target when a number of rotors are nonfunctional.
+     "name": "fan rotor(s) faulted",
+     "groups": [
+       {
+         "name": "fan0 rotor inventory",
+         "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+         "property": { "name": "Functional" }
+       },
+       {
+         "name": "fan1 rotor inventory",
+         "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+         "property": { "name": "Functional" }
+       },
+       {
+         "name": "fan2 rotor inventory",
+         "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+         "property": { "name": "Functional" }
+       },
+       {
+         "name": "fan3 rotor inventory",
+         "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+         "property": { "name": "Functional" }
+       },
+       {
+         "name": "fan4 rotor inventory",
+         "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+         "property": { "name": "Functional" }
+       },
+       {
+         "name": "fan5 rotor inventory",
+         "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+         "property": { "name": "Functional" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "count_state_before_target",
+         "count": 1,
+         "state": false,
+         "target": 10000
+       }
+     ]
    }
 ]
diff --git a/control/config_files/p10bmc/ibm,rainier-4u/groups.json b/control/config_files/p10bmc/ibm,rainier-4u/groups.json
index 02b2661..7be87ad 100644
--- a/control/config_files/p10bmc/ibm,rainier-4u/groups.json
+++ b/control/config_files/p10bmc/ibm,rainier-4u/groups.json
@@ -9,5 +9,42 @@
      "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan4",
      "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan5"
    ]
+ },
+ {
+   "name": "fan0 rotor inventory",
+   "members": [
+     "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0/fan0_0"
+   ]
+ },
+ {
+   "name": "fan1 rotor inventory",
+   "members": [
+     "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan1/fan1_0"
+   ]
+ },
+ {
+   "name": "fan2 rotor inventory",
+   "members": [
+     "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan2/fan2_0"
+   ]
+ },
+ {
+   "name": "fan3 rotor inventory",
+   "members": [
+     "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan3/fan3_0"
+   ]
+ },
+ {
+   "name": "fan4 rotor inventory",
+   "members": [
+     "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan4/fan4_0"
+   ]
+ },
+ {
+   "name": "fan5 rotor inventory",
+   "members": [
+     "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan5/fan5_0"
+   ]
  }
+
 ]