Christopher Bostic | 82d7000 | 2017-06-07 16:12:27 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ######################################################### |
| 3 | # Script to run on witherspoon BMC to unbind/bind the ir35221 |
| 4 | # driver's devices |
| 5 | |
Christopher Bostic | 4cc4d2f | 2017-06-14 09:55:35 -0500 | [diff] [blame] | 6 | if [ "$1" = "unbind" ] |
| 7 | then |
| 8 | if [ -e /sys/bus/i2c/drivers/ir35221/4-0070 ] |
| 9 | then |
| 10 | echo 4-0070 > /sys/bus/i2c/drivers/ir35221/$1 |
| 11 | fi |
| 12 | |
| 13 | if [ -e /sys/bus/i2c/drivers/ir35221/4-0071 ] |
| 14 | then |
| 15 | echo 4-0071 > /sys/bus/i2c/drivers/ir35221/$1 |
| 16 | fi |
| 17 | |
| 18 | if [ -e /sys/bus/i2c/drivers/ir35221/5-0070 ] |
| 19 | then |
| 20 | echo 5-0070 > /sys/bus/i2c/drivers/ir35221/$1 |
| 21 | fi |
| 22 | |
| 23 | if [ -e /sys/bus/i2c/drivers/ir35221/5-0071 ] |
| 24 | then |
| 25 | echo 5-0071 > /sys/bus/i2c/drivers/ir35221/$1 |
| 26 | fi |
| 27 | elif [ "$1" = "bind" ] |
| 28 | then |
| 29 | if [ -e /sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@1e78a000/1e78a140.i2c-bus/i2c-4/4-0070 ] |
| 30 | then |
| 31 | echo 4-0070 > /sys/bus/i2c/drivers/ir35221/$1 |
| 32 | fi |
| 33 | |
| 34 | if [ -e /sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@1e78a000/1e78a140.i2c-bus/i2c-4/4-0071 ] |
| 35 | then |
| 36 | echo 4-0071 > /sys/bus/i2c/drivers/ir35221/$1 |
| 37 | fi |
| 38 | |
| 39 | if [ -e /sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@1e78a000/1e78a180.i2c-bus/i2c-5/5-0070 ] |
| 40 | then |
| 41 | echo 5-0070 > /sys/bus/i2c/drivers/ir35221/$1 |
| 42 | fi |
| 43 | |
| 44 | if [ -e /sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@1e78a000/1e78a180.i2c-bus/i2c-5/5-0071 ] |
| 45 | then |
| 46 | echo 5-0071 > /sys/bus/i2c/drivers/ir35221/$1 |
| 47 | fi |
| 48 | fi |