2 * Debug support for HID Nintendo Wiimote devices
3 * Copyright (c) 2011 David Herrmann
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
13 #include <linux/module.h>
14 #include <linux/spinlock.h>
15 #include "hid-wiimote.h"
17 struct wiimote_debug {
18 struct wiimote_data *wdata;
21 int wiidebug_init(struct wiimote_data *wdata)
23 struct wiimote_debug *dbg;
26 dbg = kzalloc(sizeof(*dbg), GFP_KERNEL);
32 spin_lock_irqsave(&wdata->state.lock, flags);
34 spin_unlock_irqrestore(&wdata->state.lock, flags);
39 void wiidebug_deinit(struct wiimote_data *wdata)
41 struct wiimote_debug *dbg = wdata->debug;
47 spin_lock_irqsave(&wdata->state.lock, flags);
49 spin_unlock_irqrestore(&wdata->state.lock, flags);