summaryrefslogtreecommitdiffstats
path: root/woferclock
diff options
context:
space:
mode:
authorRaptor Engineering Development Team <support@raptorengineering.com>2018-06-06 12:44:58 -0500
committerRaptor Engineering Development Team <support@raptorengineering.com>2018-06-06 12:44:58 -0500
commit33722aa0b7ed14f3606f3db5682053c1ea36f89e (patch)
tree5510617eca54fcf6eb53d11e570e4777ad5bfe7b /woferclock
parente2230d74d15f57ceb57a2799a1e9a48d4e9fbfcb (diff)
downloadvpdtools-33722aa0b7ed14f3606f3db5682053c1ea36f89e.tar.gz
vpdtools-33722aa0b7ed14f3606f3db5682053c1ea36f89e.zip
Load I2C driver before bus scan
Diffstat (limited to 'woferclock')
-rwxr-xr-xwoferclock/list_i2c_busses12
1 files changed, 6 insertions, 6 deletions
diff --git a/woferclock/list_i2c_busses b/woferclock/list_i2c_busses
index 7406b90..fa1dbff 100755
--- a/woferclock/list_i2c_busses
+++ b/woferclock/list_i2c_busses
@@ -10,6 +10,12 @@ import glob
i2cdir = "/sys/class/i2c-dev/"
eeprom_address = 0x50
+mod_ret = os.system("modprobe i2c_dev")
+exit_code = os.WEXITSTATUS(mod_ret)
+if exit_code != 0:
+ print "[ERROR] I2C driver load failed!"
+ sys.exit(1)
+
i2cbusses = glob.glob(i2cdir + "i2c-*")
busnumlist = []
for b in i2cbusses:
@@ -18,12 +24,6 @@ for b in i2cbusses:
busnumlist.sort()
-mod_ret = os.system("modprobe i2c_dev")
-exit_code = os.WEXITSTATUS(mod_ret)
-if exit_code != 0:
- print "[ERROR] I2C driver load failed!"
- sys.exit(1)
-
mod_ret = os.system("modprobe at24")
exit_code = os.WEXITSTATUS(mod_ret)
if exit_code != 0:
OpenPOWER on IntegriCloud