diff options
Diffstat (limited to 'meta-openbmc-machines/meta-openpower')
-rw-r--r-- | meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vrm-control/ir35221-unbind-bind.sh | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vrm-control/ir35221-unbind-bind.sh b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vrm-control/ir35221-unbind-bind.sh index eea5070f7..5c100eb4f 100644 --- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vrm-control/ir35221-unbind-bind.sh +++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vrm-control/ir35221-unbind-bind.sh @@ -3,7 +3,46 @@ # Script to run on witherspoon BMC to unbind/bind the ir35221 # driver's devices -echo 4-0070 > /sys/bus/i2c/drivers/ir35221/$1 -echo 4-0071 > /sys/bus/i2c/drivers/ir35221/$1 -echo 5-0070 > /sys/bus/i2c/drivers/ir35221/$1 -echo 5-0071 > /sys/bus/i2c/drivers/ir35221/$1 +if [ "$1" = "unbind" ] +then + if [ -e /sys/bus/i2c/drivers/ir35221/4-0070 ] + then + echo 4-0070 > /sys/bus/i2c/drivers/ir35221/$1 + fi + + if [ -e /sys/bus/i2c/drivers/ir35221/4-0071 ] + then + echo 4-0071 > /sys/bus/i2c/drivers/ir35221/$1 + fi + + if [ -e /sys/bus/i2c/drivers/ir35221/5-0070 ] + then + echo 5-0070 > /sys/bus/i2c/drivers/ir35221/$1 + fi + + if [ -e /sys/bus/i2c/drivers/ir35221/5-0071 ] + then + echo 5-0071 > /sys/bus/i2c/drivers/ir35221/$1 + fi +elif [ "$1" = "bind" ] +then + if [ -e /sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@1e78a000/1e78a140.i2c-bus/i2c-4/4-0070 ] + then + echo 4-0070 > /sys/bus/i2c/drivers/ir35221/$1 + fi + + if [ -e /sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@1e78a000/1e78a140.i2c-bus/i2c-4/4-0071 ] + then + echo 4-0071 > /sys/bus/i2c/drivers/ir35221/$1 + fi + + if [ -e /sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@1e78a000/1e78a180.i2c-bus/i2c-5/5-0070 ] + then + echo 5-0070 > /sys/bus/i2c/drivers/ir35221/$1 + fi + + if [ -e /sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@1e78a000/1e78a180.i2c-bus/i2c-5/5-0071 ] + then + echo 5-0071 > /sys/bus/i2c/drivers/ir35221/$1 + fi +fi |