meta-facebook: harma: probe pca9546 device.

The hardware changes involve the SITV and PTTV I2C bus from 9 to 11,
so we need to probe the I2C mux in the script
to ensure compatibility with EVT and DVT.

Change-Id: I0c559589d2edbec5c184efc05aad24d7ed59a916
Signed-off-by: Peter Yin <peter.yin@quantatw.com>
diff --git a/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/device-driver-probe b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/device-driver-probe
new file mode 100644
index 0000000..6eb9643
--- /dev/null
+++ b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/device-driver-probe
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+read_mux_dev() {
+  for _ in {1..3}; do
+    if /usr/sbin/i2cget -f -y "$1" "$2" 2>/dev/null; then
+      return 0
+    fi
+  done
+  return 1
+}
+
+probe_sitv_pttv_mux() {
+  if read_mux_dev 9 0x71; then
+    echo pca9546 0x71 > /sys/bus/i2c/devices/i2c-9/new_device
+  else
+    echo pca9546 0x71 > /sys/bus/i2c/devices/i2c-11/new_device
+  fi
+}
+
+probe_sitv_pttv_mux
+
+exit 0
diff --git a/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.EntityManager.conf b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.EntityManager.conf
new file mode 100644
index 0000000..e3f79ce
--- /dev/null
+++ b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.EntityManager.conf
@@ -0,0 +1,3 @@
+[Service]
+ExecStartPre=/usr/libexec/entity-manager/device-driver-probe
+