summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Senichev <artemsen@gmail.com>2019-02-04 12:20:10 +0300
committerAlistair Popple <alistair@popple.id.au>2019-02-05 13:10:46 +1100
commitdeb577949a3505064f471e7b7c692e37c38ec8a4 (patch)
treee6b669c4113d6e4353c5c6c0ff3bb2489aed6740
parent302f249d95f03fbd039b5bb80ee6ba42593fccbe (diff)
downloadpdbg-deb577949a3505064f471e7b7c692e37c38ec8a4.tar.gz
pdbg-deb577949a3505064f471e7b7c692e37c38ec8a4.zip
main: Set I2C backend device specified in arguments
Restores the functionality that allows to set I2C backend device through command line arguments, it was broken by commit dacc9b57e4615f125eb1f56d842a64c40abb1408 Signed-off-by: Artem Senichev <artemsen@gmail.com> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
-rw-r--r--src/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 22e74a5..d5f9385 100644
--- a/src/main.c
+++ b/src/main.c
@@ -532,6 +532,14 @@ static bool target_selection(void)
#ifdef TARGET_ARM
case I2C:
pdbg_targets_init(&_binary_p8_i2c_dtb_o_start);
+ /* Set device for I2C backend */
+ if (device_node) {
+ struct pdbg_target *pib;
+ const size_t len = strlen(device_node) + 1 /* include last null */;
+ pdbg_for_each_class_target("pib", pib) {
+ pdbg_target_set_property(pib, "bus", device_node, len);
+ }
+ }
break;
case FSI:
OpenPOWER on IntegriCloud