summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-wiimote-core.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-05-06 01:13:03 +0400
committerJiri Kosina <jkosina@suse.cz>2013-06-03 13:07:04 +0400
commitd76f89e13a0439649120a85297085e8d8fff77ec (patch)
tree2b4d434b7085dfba62a2dfb19cb50dc3d5f092e7 /drivers/hid/hid-wiimote-core.c
parent51103c70bf8d48395ff77eee387e6c94f0216630 (diff)
downloadlinux-d76f89e13a0439649120a85297085e8d8fff77ec.tar.xz
HID: wiimote: lock DRM mode during debugfs overwrite
If we write a DRM mode via debugfs, we shouldn't allow normal operations to overwrite this DRM mode. This is important if we want to debug 3rd-party devices and we want to see what data is sent on each mode. If we write NULL/0 as DRM, the lock is removed again so the best matching DRM is chosen by wiimote core. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-wiimote-core.c')
-rw-r--r--drivers/hid/hid-wiimote-core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c
index f6c4773fac56..13963b4c8801 100644
--- a/drivers/hid/hid-wiimote-core.c
+++ b/drivers/hid/hid-wiimote-core.c
@@ -242,7 +242,9 @@ void wiiproto_req_drm(struct wiimote_data *wdata, __u8 drm)
{
__u8 cmd[3];
- if (drm == WIIPROTO_REQ_NULL)
+ if (wdata->state.flags & WIIPROTO_FLAG_DRM_LOCKED)
+ drm = wdata->state.drm;
+ else if (drm == WIIPROTO_REQ_NULL)
drm = select_drm(wdata);
cmd[0] = WIIPROTO_REQ_DRM;