ibm: Drop hwmon support for water cooled wspoon

There is an upcoming systemd change that doesn't handle what was being
done, which was to delay starting phosphor-hwmon from udev until the
chassis cooling type was on D-Bus.

This commit removes this method and goes down to a single hwmon config
file that only supports the air cooled system, which has 2 more fan
rotors than the water cooled one does.

This change also applies to the similar systems witherspoon-tacoma and
swift.

Resolves openbmc/phosphor-hwmon/#19.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ic4ed46a5bf310fb1fef8704dcafc0376c441f8c4
diff --git a/meta-ibm/recipes-phosphor/fans/phosphor-fan/witherspoon/phosphor-fan-control@.service b/meta-ibm/recipes-phosphor/fans/phosphor-fan/witherspoon/phosphor-fan-control@.service
index 2679077..5e555a2 100644
--- a/meta-ibm/recipes-phosphor/fans/phosphor-fan/witherspoon/phosphor-fan-control@.service
+++ b/meta-ibm/recipes-phosphor/fans/phosphor-fan/witherspoon/phosphor-fan-control@.service
@@ -1,7 +1,7 @@
 [Unit]
 Description=Phosphor Fan Control Daemon
-Requires=max31785-hwmon-helper@ahb-apb-bus\x401e78a000-i2c\x2dbus\x40{ADDR}-max31785\x4052.service
-After=max31785-hwmon-helper@ahb-apb-bus\x401e78a000-i2c\x2dbus\x40{ADDR}-max31785\x4052.service
+Requires=xyz.openbmc_project.Hwmon@-ahb-apb-bus\x401e78a000-i2c\x2dbus\x40{ADDR}-max31785\x4052.service
+After=xyz.openbmc_project.Hwmon@-ahb-apb-bus\x401e78a000-i2c\x2dbus\x40{ADDR}-max31785\x4052.service
 
 [Service]
 Restart=on-failure
diff --git a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/70-max31785-hwmon.rules b/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/70-max31785-hwmon.rules
deleted file mode 100644
index fd63e05..0000000
--- a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/70-max31785-hwmon.rules
+++ /dev/null
@@ -1 +0,0 @@
-SUBSYSTEM=="hwmon", ACTION=="add", ENV{OF_NAME}=="max31785", PROGRAM="/bin/systemd-escape -p '%E{OF_FULLNAME}'", RUN="/bin/systemctl start max31785-hwmon-helper@%c.service"
diff --git a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/max31785-hwmon-helper@.service b/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/max31785-hwmon-helper@.service
deleted file mode 100644
index c7ed6f1..0000000
--- a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/max31785-hwmon-helper@.service
+++ /dev/null
@@ -1,9 +0,0 @@
-[Unit]
-Description=MAX31785 hwmon helper
-Wants=phosphor-cooling-type@0.service
-After=phosphor-cooling-type@0.service
-
-[Service]
-Type=oneshot
-ExecStart=/usr/bin/env start_max31785_hwmon.sh %i
-SyslogIdentifier=max31785-hwmon-helper
diff --git a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/start_max31785_hwmon.sh b/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/start_max31785_hwmon.sh
deleted file mode 100755
index 5eff174..0000000
--- a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/start_max31785_hwmon.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-# Copy in the correct MAX31785 phosphor-hwmon config file to use based on the
-# WaterCooled property, and then start the hwmon service.
-
-# $1: The escaped OF_FULLNAME udev attribute for the MAX31785
-
-base="/etc/default/obmc/hwmon/"$(systemd-escape -u "$1")
-target=$base".conf"
-
-service=$(mapper get-service /xyz/openbmc_project/inventory/system/chassis)
-
-if [ $(busctl get-property $service \
-     /xyz/openbmc_project/inventory/system/chassis \
-     xyz.openbmc_project.Inventory.Decorator.CoolingType \
-     WaterCooled | grep true | wc -l) != 0 ];
-then
-    source=$base'_water.conf'
-else
-    source=$base'_air.conf'
-fi
-
-cp $source $target
-
-instance='-'$1
-systemctl start xyz.openbmc_project.Hwmon@$instance.service
diff --git a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/swift/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52_air.conf b/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/swift/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52.conf
similarity index 100%
rename from meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/swift/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52_air.conf
rename to meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/swift/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52.conf
diff --git a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/swift/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52_water.conf b/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/swift/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52_water.conf
deleted file mode 100644
index 0b97ed5..0000000
--- a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/swift/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52_water.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-LABEL_fan1 = "fan0_0"
-
-LABEL_fan2 = "fan1_0"
-
-LABEL_fan3 = "fan2_0"
-
-LABEL_fan4 = "fan3_0"
-
-TARGET_MODE = "RPM"
diff --git a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon-tacoma/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@200/max31785@52_air.conf b/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon-tacoma/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@200/max31785@52.conf
similarity index 100%
rename from meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon-tacoma/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@200/max31785@52_air.conf
rename to meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon-tacoma/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@200/max31785@52.conf
diff --git a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon-tacoma/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@200/max31785@52_water.conf b/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon-tacoma/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@200/max31785@52_water.conf
deleted file mode 100644
index c96bfa7..0000000
--- a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon-tacoma/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@200/max31785@52_water.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-LABEL_fan1 = "fan0_0"
-
-LABEL_fan3 = "fan2_0"
-
-LABEL_fan4 = "fan3_0"
-
-LABEL_fan5 = "fan0_1"
-
-LABEL_fan7 = "fan2_1"
-
-LABEL_fan8 = "fan3_1"
-
-TARGET_MODE = "RPM"
diff --git a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52_air.conf b/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52.conf
similarity index 100%
rename from meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52_air.conf
rename to meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52.conf
diff --git a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52_water.conf b/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52_water.conf
deleted file mode 100644
index c96bfa7..0000000
--- a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon/witherspoon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@100/max31785@52_water.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-LABEL_fan1 = "fan0_0"
-
-LABEL_fan3 = "fan2_0"
-
-LABEL_fan4 = "fan3_0"
-
-LABEL_fan5 = "fan0_1"
-
-LABEL_fan7 = "fan2_1"
-
-LABEL_fan8 = "fan3_1"
-
-TARGET_MODE = "RPM"
diff --git a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend b/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
index 7932eb3..e4b8e27 100644
--- a/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
+++ b/meta-ibm/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
@@ -4,13 +4,10 @@
 
 SRC_URI:append:ibm-ac-server = " \
            file://70-hwmon.rules \
-           file://70-max31785-hwmon.rules \
-           file://start_max31785_hwmon.sh \
            "
 
 CHIPS:witherspoon = " \
-               bus@1e78a000/i2c-bus@100/max31785@52_air \
-               bus@1e78a000/i2c-bus@100/max31785@52_water \
+               bus@1e78a000/i2c-bus@100/max31785@52 \
                bus@1e78a000/i2c-bus@100/power-supply@68 \
                bus@1e78a000/i2c-bus@100/power-supply@69 \
                bus@1e78a000/i2c-bus@100/bmp280@77 \
@@ -22,8 +19,7 @@
                bus@1e78a000/i2c-bus@380/tmp275@4a \
                "
 CHIPS:swift = " \
-               bus@1e78a000/i2c-bus@100/max31785@52_air \
-               bus@1e78a000/i2c-bus@100/max31785@52_water \
+               bus@1e78a000/i2c-bus@100/max31785@52 \
                bus@1e78a000/i2c-bus@100/power-supply@68 \
                bus@1e78a000/i2c-bus@100/power-supply@69 \
                bus@1e78a000/i2c-bus@440/tmp275@4a \
@@ -61,8 +57,7 @@
                "
 
 CHIPS:witherspoon-tacoma = " \
-               bus@1e78a000/i2c-bus@200/max31785@52_air \
-               bus@1e78a000/i2c-bus@200/max31785@52_water \
+               bus@1e78a000/i2c-bus@200/max31785@52 \
                bus@1e78a000/i2c-bus@200/power-supply@68 \
                bus@1e78a000/i2c-bus@200/power-supply@69 \
                bus@1e78a000/i2c-bus@200/bmp280@77 \
@@ -117,12 +112,3 @@
 SYSTEMD_ENVIRONMENT_FILE:max31785-msl:append:ibm-ac-server = " obmc/hwmon-max31785/max31785.conf"
 SYSTEMD_LINK:max31785-msl:append:ibm-ac-server = " ../phosphor-max31785-msl@.service:multi-user.target.wants/phosphor-max31785-msl@${MACHINE}.service"
 
-SYSTEMD_SERVICE:${PN}:append:ibm-ac-server = " max31785-hwmon-helper@.service"
-
-do_install:append:ibm-ac-server() {
-    install -d ${D}/${nonarch_base_libdir}/udev/rules.d/
-    install -m 0644 ${WORKDIR}/70-max31785-hwmon.rules ${D}/${nonarch_base_libdir}/udev/rules.d/
-
-    install -d ${D}${bindir}
-    install -m 0755 ${WORKDIR}/start_max31785_hwmon.sh ${D}${bindir}
-}