Create recipe files for phosphor-cooling-type

Adding service file for this application. Environment file for Witherspoon.
This is currently the only system known to really need this check for water
cooling property to be set/updated.

Resolves openbmc/openbmc#370

Change-Id: I978de38d09111c38d77e1ca4b287724243acf0a9
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan%/obmc/phosphor-fan/phosphor-cooling-type-0.conf b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan%/obmc/phosphor-fan/phosphor-cooling-type-0.conf
new file mode 100644
index 0000000..334ded0
--- /dev/null
+++ b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan%/obmc/phosphor-fan/phosphor-cooling-type-0.conf
@@ -0,0 +1,6 @@
+OBJPATH="--path=/system/chassis"
+AIR="--air"
+WATER=""
+DEVICE="--dev=/dev/input/event0"
+CODE="--event=13"
+
diff --git a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan%/phosphor-cooling-type@.service b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan%/phosphor-cooling-type@.service
new file mode 100644
index 0000000..62fd438
--- /dev/null
+++ b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan%/phosphor-cooling-type@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Phosphor Cooling Type
+Wants=mapper-wait@-xyz-openbmc_project-inventory.service
+After=mapper-wait@-xyz-openbmc_project-inventory.service
+ConditionPathExists={envfiledir}/phosphor-cooling-type-%i.conf
+
+[Service]
+EnvironmentFile={envfiledir}/phosphor-cooling-type-%i.conf
+ExecStart={sbindir}/phosphor-cooling-type ${{OBJPATH}} ${{AIR}} ${{WATER}} ${{DEVICE}} ${{CODE}}
+
+[Install]
+RequiredBy={SYSTEMD_DEFAULT_TARGET}