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>
This commit is contained in:

committed by
Jiri Kosina

parent
51103c70bf
commit
d76f89e13a
@@ -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;
|
||||
|
Reference in New Issue
Block a user