wspoon: Enable fan control to run at BMC standby

To allow thermal modes to be selected at BMC standby, the fan control
application must be running. The phosphor-fan-control@.service file is
needed to start fan control at BMC standby and the
phosphor-fan-control-init@.service is no longer required.

Tested:
    Witherspoon phosphor-fan-control@.service replaced in image
    phosphor-fan-control-init@.service removed from image
    fan watchdog configs appended to fan control service still
    phosphor-fan-control@.service started at BMC standby
    fan control thermal modes presented/changeable at BMC standby
    no function change in configured thermal modes

(From meta-ibm rev: f59761e1af85b3ae6432bf0297f5cfe5be71e557)

Change-Id: I4a946f58b6f0c22ebd402304ae9d8fd17a197571
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/fans/phosphor-fan_%.bbappend b/meta-ibm/meta-witherspoon/recipes-phosphor/fans/phosphor-fan_%.bbappend
index 085857c..243a02f 100644
--- a/meta-ibm/meta-witherspoon/recipes-phosphor/fans/phosphor-fan_%.bbappend
+++ b/meta-ibm/meta-witherspoon/recipes-phosphor/fans/phosphor-fan_%.bbappend
@@ -14,8 +14,8 @@
 
 TMPL_COOLING = "phosphor-cooling-type@.service"
 INSTFMT_COOLING = "phosphor-cooling-type@{0}.service"
-COOLING_TGT = "multi-user.target"
-FMT_COOLING = "../${TMPL_COOLING}:${COOLING_TGT}.requires/${INSTFMT_COOLING}"
+MULTI_USR_TGT = "multi-user.target"
+FMT_COOLING = "../${TMPL_COOLING}:${MULTI_USR_TGT}.requires/${INSTFMT_COOLING}"
 
 FILES_phosphor-cooling-type_append_ibm-ac-server = " ${bindir}/phosphor-cooling-type"
 SYSTEMD_SERVICE_phosphor-cooling-type_append_ibm-ac-server = " ${TMPL_COOLING}"
@@ -30,7 +30,6 @@
 SYSTEMD_ENVIRONMENT_FILE_phosphor-cooling-type_append_mihawk = " ${@compose_list(d, 'COOLING_ENV_FMT', 'OBMC_CHASSIS_INSTANCES')}"
 
 #These services are protected by the watchdog
-SYSTEMD_OVERRIDE_phosphor-fan-control_witherspoon += "fan-watchdog-monitor.conf:phosphor-fan-control-init@0.service.d/fan-watchdog-monitor.conf"
 SYSTEMD_OVERRIDE_phosphor-fan-control_witherspoon += "fan-watchdog-monitor.conf:phosphor-fan-control@0.service.d/fan-watchdog-monitor.conf"
 SYSTEMD_OVERRIDE_phosphor-fan-monitor_witherspoon += "fan-watchdog-monitor.conf:phosphor-fan-monitor-init@0.service.d/fan-watchdog-monitor.conf"
 SYSTEMD_OVERRIDE_phosphor-fan-monitor_witherspoon += "fan-watchdog-monitor.conf:phosphor-fan-monitor@0.service.d/fan-watchdog-monitor.conf"
@@ -38,3 +37,16 @@
 #These services need to be stopped when watchdog expires
 SYSTEMD_OVERRIDE_phosphor-fan-control_witherspoon += "fan-watchdog-conflicts.conf:phosphor-fan-control@0.service.d/fan-watchdog-conflicts.conf"
 SYSTEMD_OVERRIDE_phosphor-fan-monitor_witherspoon += "fan-watchdog-conflicts.conf:phosphor-fan-monitor@0.service.d/fan-watchdog-conflicts.conf"
+
+# Remove fan control init service completely
+SYSTEMD_SERVICE_${PN}-control_remove_witherspoon = "${TMPL_CONTROL_INIT}"
+SYSTEMD_LINK_${PN}-control_remove_witherspoon = "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}"
+# Remove fan control from being linked
+SYSTEMD_LINK_${PN}-control_remove_witherspoon = "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}"
+
+# Link fan control service to be started at standby
+FMT_CONTROL_STDBY_witherspoon = "../${TMPL_CONTROL}:${MULTI_USR_TGT}.wants/${INSTFMT_CONTROL}"
+SYSTEMD_LINK_${PN}-control_witherspoon += "${@compose_list(d, 'FMT_CONTROL_STDBY', 'OBMC_CHASSIS_INSTANCES')}"
+# Link fan control service to also start at poweron
+FMT_CONTROL_PWRON_witherspoon = "../${TMPL_CONTROL}:${POWERON_TGT}.requires/${INSTFMT_CONTROL}"
+SYSTEMD_LINK_${PN}-control_witherspoon += "${@compose_list(d, 'FMT_CONTROL_PWRON', 'OBMC_CHASSIS_INSTANCES')}"