From 1d3452c63d4b62329d34d7634f67a3dbec21ca87 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Thu, 17 Nov 2011 14:12:11 +0100 Subject: 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 Signed-off-by: Jiri Kosina --- drivers/hid/hid-wiimote.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/hid/hid-wiimote.h') diff --git a/drivers/hid/hid-wiimote.h b/drivers/hid/hid-wiimote.h index 89b8851dbf1f..7b6765797f81 100644 --- a/drivers/hid/hid-wiimote.h +++ b/drivers/hid/hid-wiimote.h @@ -120,6 +120,13 @@ extern int wiimote_cmd_write(struct wiimote_data *wdata, __u32 offset, extern ssize_t wiimote_cmd_read(struct wiimote_data *wdata, __u32 offset, __u8 *rmem, __u8 size); +#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)) +extern void wiiproto_req_rmem(struct wiimote_data *wdata, bool eeprom, + __u32 offset, __u16 size); + #ifdef CONFIG_HID_WIIMOTE_EXT extern int wiiext_init(struct wiimote_data *wdata); -- cgit v1.2.3-59-g8ed1b