Ken Chen | fd74c19 | 2018-01-30 09:51:50 +0800 | [diff] [blame^] | 1 | #!/bin/sh -e |
| 2 | # For one of the IR38163 device on i2c bus 5, address 0x42 |
| 3 | # Because the device only work when DC-ON, so when BMC during the DC-OFF state |
| 4 | # the device will probe fail, need the workaround for this HW design.. |
| 5 | |
| 6 | if [ "$1" == "add" ]; then |
| 7 | echo Add the 0x42 device on i2c bus 5.... |
| 8 | sleep 2 |
| 9 | echo 5-0042 > /sys/bus/i2c/drivers/ir38163/bind |
| 10 | sleep 1 |
| 11 | elif [ "$1" == "rm" ]; then |
| 12 | echo Remove the 0x42 deivce |
| 13 | sleep 2 |
| 14 | echo 5-0042 > /sys/bus/i2c/drivers/ir38163/unbind |
| 15 | sleep 1 |
| 16 | else |
| 17 | echo "$0 <add|rm>" to set state |
| 18 | fi |
| 19 | |