blob: 5c100eb4f8bae6a68ae6c43489e4921c92ec81a2 [file] [log] [blame]
Christopher Bosticdc8e2b62017-06-07 16:12:27 -05001#!/bin/bash
2# #########################################################
3# Script to run on witherspoon BMC to unbind/bind the ir35221
4# driver's devices
5
Christopher Bosticaa546382017-06-14 09:55:35 -05006if [ "$1" = "unbind" ]
7then
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
27elif [ "$1" = "bind" ]
28then
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
48fi