aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Duggan <aduggan@synaptics.com>2015-05-11 15:50:59 -0700
committerAndrew Duggan <aduggan@synaptics.com>2015-05-11 15:50:59 -0700
commita0d74e0b84f067dc88190f78e79df968e414c72d (patch)
tree1620ad4d77af09d0d4f12af34b7d334aed88886f
parente7d0c107588771cae57f1b42192877590c862996 (diff)
downloadplatform_external_rmi4utils-a0d74e0b84f067dc88190f78e79df968e414c72d.tar.gz
platform_external_rmi4utils-a0d74e0b84f067dc88190f78e79df968e414c72d.tar.bz2
platform_external_rmi4utils-a0d74e0b84f067dc88190f78e79df968e414c72d.zip
Add command line option to reset the device
-rw-r--r--rmihidtool/main.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/rmihidtool/main.cpp b/rmihidtool/main.cpp
index cf25a4b..f52167e 100644
--- a/rmihidtool/main.cpp
+++ b/rmihidtool/main.cpp
@@ -34,7 +34,7 @@
#include "hiddevice.h"
-#define RMI4UPDATE_GETOPTS "hp:ir:w:foambd"
+#define RMI4UPDATE_GETOPTS "hp:ir:w:foambde"
enum rmihidtool_cmd {
RMIHIDTOOL_CMD_INTERACTIVE,
@@ -46,6 +46,7 @@
RMIHIDTOOL_CMD_PRINT_FUNCTIONS,
RMIHIDTOOL_CMD_REBIND_DRIVER,
RMIHIDTOOL_CMD_PRINT_DEVICE_INFO,
+ RMIHIDTOOL_CMD_RESET_DEVICE,
};
static int report_attn = 0;
@@ -65,6 +66,7 @@ void print_help(const char *prog_name)
fprintf(stdout, "\t-m, --print-functions\t\t\tPrint RMI4 functions for the device.\n");
fprintf(stdout, "\t-b, --rebind-driver\t\t\tRebind the driver to force an update of device properties.\n");
fprintf(stdout, "\t-d, --device-info\t\t\tPrint protocol specific information about the device.\n");
+ fprintf(stdout, "\t-e, --reset-device\t\t\tReset the device.\n");
}
void print_cmd_usage()
@@ -213,6 +215,7 @@ int main(int argc, char ** argv)
{"print-functions", 0, NULL, 'm'},
{"rebind-driver", 0, NULL, 'b'},
{"device-info", 0, NULL, 'd'},
+ {"reset-device", 0, NULL, 'e'},
{0, 0, 0, 0},
};
enum rmihidtool_cmd cmd = RMIHIDTOOL_CMD_INTERACTIVE;
@@ -267,6 +270,9 @@ int main(int argc, char ** argv)
case 'd':
cmd = RMIHIDTOOL_CMD_PRINT_DEVICE_INFO;
break;
+ case 'e':
+ cmd = RMIHIDTOOL_CMD_RESET_DEVICE;
+ break;
default:
print_help(argv[0]);
return 0;
@@ -353,6 +359,10 @@ int main(int argc, char ** argv)
case RMIHIDTOOL_CMD_PRINT_DEVICE_INFO:
device->PrintDeviceInfo();
break;
+ case RMIHIDTOOL_CMD_RESET_DEVICE:
+ device->ScanPDT();
+ device->Reset();
+ break;
case RMIHIDTOOL_CMD_INTERACTIVE:
default:
interactive(device, report);