From 874d0f47bd2da5e60e10bdbe81353efc6637cb72 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 12 Jul 2016 12:26:45 +0100 Subject: [PATCH] gt: allow for i2c bus to move around a little Unfortunately GT has alot of i2c buses, the second lot of designware buses can turn up after the i915 i2c buses but since they all have the same name, we do a dumb check to see if they are 5/6 or 9/10. Hopefully future kernel/firmware will let us do something smarter. Signed-off-by: Brendan Le Foll --- src/x86/intel_gt_tuchuck.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/x86/intel_gt_tuchuck.c b/src/x86/intel_gt_tuchuck.c index 089b29e..e684b5c 100644 --- a/src/x86/intel_gt_tuchuck.c +++ b/src/x86/intel_gt_tuchuck.c @@ -66,12 +66,19 @@ mraa_gt_tuchuck_board() b->i2c_bus[0].bus_id = 0; b->i2c_bus[0].sda = 11; b->i2c_bus[0].scl = 13; - b->i2c_bus[1].bus_id = 5; + + if (mraa_find_i2c_bus("designware", 5) != 5) { + b->i2c_bus[1].bus_id = 9; + b->i2c_bus[2].bus_id = 10; + } else { + b->i2c_bus[1].bus_id = 5; + b->i2c_bus[2].bus_id = 6; + } b->i2c_bus[1].sda = 15; b->i2c_bus[1].scl = 17; - b->i2c_bus[2].bus_id = 6; b->i2c_bus[2].sda = 19; b->i2c_bus[2].scl = 21; + b->def_i2c_bus = b->i2c_bus[0].bus_id; #if 0