summaryrefslogtreecommitdiffstats
path: root/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir38163_workaround.sh
blob: 60120cf0de9dd579beb88bd8bb0e5cae7740e818 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh -e
# For one of the IR38163 device on i2c bus 5, address 0x42
# Because the device only work when DC-ON, so when BMC during the DC-OFF state
# the device will probe fail, need the workaround for this HW design..

if [ "$1" == "add" ]; then
    echo Add the 0x42 device on i2c bus 5....
    sleep 2
    echo 5-0042 > /sys/bus/i2c/drivers/ir38163/bind
    sleep 1
elif [ "$1" == "rm" ]; then
    echo Remove the 0x42 deivce
    sleep 2
    echo 5-0042 > /sys/bus/i2c/drivers/ir38163/unbind
    sleep 1
else
    echo "$0 <add|rm>" to set state
fi

OpenPOWER on IntegriCloud