aboutsummaryrefslogtreecommitdiff
path: root/rmidevice/hiddevice.h
diff options
context:
space:
mode:
authorAndrew Duggan <aduggan@synaptics.com>2015-05-06 17:45:48 -0700
committerAndrew Duggan <aduggan@synaptics.com>2015-05-06 17:50:14 -0700
commitbef9c2dd3bfbe71b75f59c0dba08402414e008a2 (patch)
tree1211eb6e9d01ca93abd7af06a4ae72af2b7f148e /rmidevice/hiddevice.h
parentbc1e37b101aa71b785e0c78abb1c2ee546506b60 (diff)
downloadrmi4utils-bef9c2dd3bfbe71b75f59c0dba08402414e008a2.tar.gz
Allow rebinding of the transport device to force a reload of the HID descriptors
In some cases during firmware update the size of the input reports can change this commit allows for the unbinding and rebinding of the transport HID device to force a reload of the HID descriptors so that the new size if read by the HID transport drivers.
Diffstat (limited to 'rmidevice/hiddevice.h')
-rw-r--r--rmidevice/hiddevice.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/rmidevice/hiddevice.h b/rmidevice/hiddevice.h
index ba2d942..ac7439d 100644
--- a/rmidevice/hiddevice.h
+++ b/rmidevice/hiddevice.h
@@ -19,6 +19,7 @@
#define _HIDDEVICE_H_
#include <linux/hidraw.h>
+#include <string>
#include "rmidevice.h"
class HIDDevice : public RMIDevice
@@ -38,6 +39,7 @@ public:
virtual int GetAttentionReport(struct timeval * timeout, unsigned int source_mask,
unsigned char *buf, unsigned int *len);
virtual void Close();
+ virtual void RebindDriver();
~HIDDevice() { Close(); }
private:
@@ -68,6 +70,12 @@ private:
int GetReport(int *reportId, struct timeval * timeout = NULL);
void PrintReport(const unsigned char *report);
void ParseReportSizes();
+
+ // static HID utility functions
+ static bool LookupHidDeviceName(int bus, int vendorId, int productId, std::string &deviceName);
+ static bool FindTransportDriver(int bus, std::string & hidDeviceName,
+ std::string & transportDeviceName, std::string & driverPath);
+ static bool FindHidRawFile(std::string & hidDeviceName, std::string & hidrawFile);
};
#endif /* _HIDDEVICE_H_ */