[PATCH umr] Add ability to write registers by address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
---
 src/app/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/app/main.c b/src/app/main.c
index 88b4feaf0058..72c29d6a26d4 100644
--- a/src/app/main.c
+++ b/src/app/main.c
@@ -216,9 +216,14 @@ int main(int argc, char **argv)
 			}
 		} else if (!strcmp(argv[i], "--write") || !strcmp(argv[i], "-w")) {
 			if (i + 2 < argc) {
+				uint32_t reg, val;
+
 				if (!asic)
 					asic = get_asic();
-				umr_set_register(asic, argv[i+1], argv[i+2]);
+				if (sscanf(argv[i+1], "%"SCNx32, &reg) == 1 && sscanf(argv[i+2], "%"SCNx32, &val) == 1)
+					umr_write_reg(asic, reg * 4, val);
+				else
+					umr_set_register(asic, argv[i+1], argv[i+2]);
 				i += 2;
 				options.need_scan = 0;
 			} else {
-- 
2.12.0



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux