diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2011-11-17 14:12:11 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-11-22 23:10:58 +0100 |
commit | 1d3452c63d4b62329d34d7634f67a3dbec21ca87 (patch) | |
tree | 5538195cda1a066e83aa5bee1da479fed004281b /drivers/hid/hid-wiimote-core.c | |
parent | 43e5e7c60ee7039f538ccfaaa4e99829719d9bea (diff) | |
download | talos-obmc-linux-1d3452c63d4b62329d34d7634f67a3dbec21ca87.tar.gz talos-obmc-linux-1d3452c63d4b62329d34d7634f67a3dbec21ca87.zip |
HID: wiimote: Allow direct eeprom access
The wiimote provides direct access to parts of its eeprom. This implements read
support for small chunks of the eeprom. This isn't very fast but prevents the
reader from blocking the wiimote stream for too long.
Write support is not yet supported as the wiimote breaks if we overwrite its
memory. Use hidraw to reverse-engineer the eeprom before implementing write
support here.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.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.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c index 919abbaba840..2fd2f0337b8d 100644 --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c @@ -320,14 +320,8 @@ static void wiiproto_req_wmem(struct wiimote_data *wdata, bool eeprom, wiimote_queue(wdata, cmd, sizeof(cmd)); } -#define wiiproto_req_rreg(wdata, os, sz) \ - wiiproto_req_rmem((wdata), false, (os), (sz)) - -#define wiiproto_req_reeprom(wdata, os, sz) \ - wiiproto_req_rmem((wdata), true, (os), (sz)) - -static void wiiproto_req_rmem(struct wiimote_data *wdata, bool eeprom, - __u32 offset, __u16 size) +void wiiproto_req_rmem(struct wiimote_data *wdata, bool eeprom, __u32 offset, + __u16 size) { __u8 cmd[7]; |