summaryrefslogtreecommitdiff
path: root/src/dev/ps2/touchkit.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2018-04-09 22:24:31 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2018-04-17 11:19:44 +0000
commit68f99c93808ac4d8e12e39c87acec89d422fd8b4 (patch)
tree9222c9d26c87d1ec419a7398f65250abe56f343f /src/dev/ps2/touchkit.hh
parent7789e9aa75ba82a0bc52dc8b2b44fa9b16234173 (diff)
downloadgem5-68f99c93808ac4d8e12e39c87acec89d422fd8b4.tar.xz
ps2: Add proper touchscreen command handling
The touchscreen model used ad-hoc mechanisms to enable/disable the device. Use standard PS/2 commands to activate/deactivate the device. Add proper TouchKit command handling. Change-Id: I0c5a2e2b47639f36ab3ee07e3e559f11afa54b9d Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/9768 Reviewed-by: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/dev/ps2/touchkit.hh')
-rw-r--r--src/dev/ps2/touchkit.hh19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/dev/ps2/touchkit.hh b/src/dev/ps2/touchkit.hh
index fa1bc52a4..dc98a78fa 100644
--- a/src/dev/ps2/touchkit.hh
+++ b/src/dev/ps2/touchkit.hh
@@ -50,6 +50,12 @@ class PS2TouchKit : public PS2Device, public VncMouse
protected:
static const uint8_t ID[];
+ enum TKCommands {
+ TouchKitActive = 'A',
+ TouchKitFWRev = 'D',
+ TouchKitCtrlType = 'E',
+ };
+
public:
PS2TouchKit(const PS2TouchKitParams *p);
@@ -63,14 +69,21 @@ class PS2TouchKit : public PS2Device, public VncMouse
void mouseAt(uint16_t x, uint16_t y, uint8_t buttons) override;
protected:
+ bool recvTouchKit(const std::vector<uint8_t> &data);
+ void sendTouchKit(const uint8_t *data, size_t size);
+ void sendTouchKit(uint8_t data) { sendTouchKit(&data, 1); }
+
/** The vnc server we're connected to (if any) */
VncInput *const vnc;
+ /** Is the device enabled? */
+ bool enabled;
+
/**
- * Has the driver been initialized in TouchKit mode? The model
- * suppresses touch event generation until this is true.
+ * Has the driver enabled TouchKit mode? The model suppresses
+ * touch event generation until this is true.
*/
- bool driverInitialized;
+ bool touchKitEnabled;
};
#endif // __DEV_PS2_TOUCHKIT_HH__