meta-facebook: yosemite4: add ISL28022 support

1. Add ISL28022 to kernel config.
2. Bind correct ADC driver according to Medusa board FRU

Tested:
Verified with yosemite4 DVT medusa board.

Change-Id: Id67b077310beaad541507912dafb22671d0298f4
Signed-off-by: Yikai Tsai <yikai.tsai.wiwynn@gmail.com>
diff --git a/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed/yosemite4.cfg b/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed/yosemite4.cfg
index 6a2cab5..913ab3b 100644
--- a/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed/yosemite4.cfg
+++ b/meta-facebook/meta-yosemite4/recipes-kernel/linux/linux-aspeed/yosemite4.cfg
@@ -16,6 +16,7 @@
 CONFIG_SENSORS_TMP421=y
 CONFIG_MAX1363=y
 CONFIG_SENSORS_INA238=y
+CONFIG_SENSORS_ISL28022=y
 CONFIG_SENSORS_ADC128D818=y
 CONFIG_RICHTEK_RTQ6056=y
 CONFIG_SENSORS_MAX31790=y
diff --git a/meta-facebook/meta-yosemite4/recipes-yosemite4/plat-svc/files/yosemite4-schematic-init b/meta-facebook/meta-yosemite4/recipes-yosemite4/plat-svc/files/yosemite4-schematic-init
index ff17e07..529678d 100644
--- a/meta-facebook/meta-yosemite4/recipes-yosemite4/plat-svc/files/yosemite4-schematic-init
+++ b/meta-facebook/meta-yosemite4/recipes-yosemite4/plat-svc/files/yosemite4-schematic-init
@@ -56,4 +56,13 @@
     set_gpio HSC_OCP_SLOT_EVEN_GPIO2       0
     set_gpio HSC_OCP_SLOT_EVEN_GPIO3       0
 fi
+
+# check adc device on medusa board
+medusa_model=$(get_product_model Medusa_Board)
+if [ "$medusa_model" = "Medusa Board ADC-RNS-ISL 12VHSC-ADI 48VHSC-INF" ]; then
+    echo 11-0044 > /sys/bus/i2c/drivers/isl28022/bind
+else
+    echo 11-0044 > /sys/bus/i2c/drivers/ina238/bind
+fi
+
 exit 0
diff --git a/meta-facebook/meta-yosemite4/recipes-yosemite4/plat-tool/files/yosemite4-common-functions b/meta-facebook/meta-yosemite4/recipes-yosemite4/plat-tool/files/yosemite4-common-functions
index d8a54c4..68dcd0d 100644
--- a/meta-facebook/meta-yosemite4/recipes-yosemite4/plat-tool/files/yosemite4-common-functions
+++ b/meta-facebook/meta-yosemite4/recipes-yosemite4/plat-tool/files/yosemite4-common-functions
@@ -34,3 +34,11 @@
     PRODUCT_VERSION=$(busctl get-property xyz.openbmc_project.EntityManager /xyz/openbmc_project/inventory/system/board/Yosemite_4_"$FRU_NAME" xyz.openbmc_project.Inventory.Decorator.Revision Version| awk -F\" '{print $2}')
     echo "$PRODUCT_VERSION"
 }
+
+get_product_model()
+{
+    local FRU_NAME=$1
+    local PRODUCT_MODEL
+    PRODUCT_MODEL=$(busctl get-property xyz.openbmc_project.EntityManager /xyz/openbmc_project/inventory/system/board/Yosemite_4_"$FRU_NAME" xyz.openbmc_project.Inventory.Decorator.Asset Model| awk -F\" '{print $2}')
+    echo "$PRODUCT_MODEL"
+}