diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2011-11-17 08:12:06 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-11-22 17:09:34 -0500 |
commit | 0b6815d75d8bf214998455d94061a40f3b4a77f3 (patch) | |
tree | fd8e5bca1ed7a805546f204faad80e3b91fc72b6 /drivers/hid/hid-wiimote-core.c | |
parent | 479901ba1847902623cc348b1d09c7d8979a9683 (diff) |
HID: wiimote: Add extension handler stubs
All supported extensions report data as 6 byte block. All DRMs with extension
data provide at least 6 extension bytes. Hence a generic handler for all
extension bytes is sufficient and can be called on all DRMs.
The handler distinguishes the input and passes it to the right handler. Motion+
passes data interleaved so we can have Motion+ and a regular extension enabled
simultaneously.
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 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c index 2ca8bfd350ad..d8ed1ec58e9f 100644 --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c | |||
@@ -857,6 +857,7 @@ static void handler_drm_KA(struct wiimote_data *wdata, const __u8 *payload) | |||
857 | static void handler_drm_KE(struct wiimote_data *wdata, const __u8 *payload) | 857 | static void handler_drm_KE(struct wiimote_data *wdata, const __u8 *payload) |
858 | { | 858 | { |
859 | handler_keys(wdata, payload); | 859 | handler_keys(wdata, payload); |
860 | wiiext_handle(wdata, &payload[2]); | ||
860 | } | 861 | } |
861 | 862 | ||
862 | static void handler_drm_KAI(struct wiimote_data *wdata, const __u8 *payload) | 863 | static void handler_drm_KAI(struct wiimote_data *wdata, const __u8 *payload) |
@@ -873,6 +874,7 @@ static void handler_drm_KAI(struct wiimote_data *wdata, const __u8 *payload) | |||
873 | static void handler_drm_KEE(struct wiimote_data *wdata, const __u8 *payload) | 874 | static void handler_drm_KEE(struct wiimote_data *wdata, const __u8 *payload) |
874 | { | 875 | { |
875 | handler_keys(wdata, payload); | 876 | handler_keys(wdata, payload); |
877 | wiiext_handle(wdata, &payload[2]); | ||
876 | } | 878 | } |
877 | 879 | ||
878 | static void handler_drm_KIE(struct wiimote_data *wdata, const __u8 *payload) | 880 | static void handler_drm_KIE(struct wiimote_data *wdata, const __u8 *payload) |
@@ -883,12 +885,14 @@ static void handler_drm_KIE(struct wiimote_data *wdata, const __u8 *payload) | |||
883 | ir_to_input2(wdata, &payload[7], false); | 885 | ir_to_input2(wdata, &payload[7], false); |
884 | ir_to_input3(wdata, &payload[9], true); | 886 | ir_to_input3(wdata, &payload[9], true); |
885 | input_sync(wdata->ir); | 887 | input_sync(wdata->ir); |
888 | wiiext_handle(wdata, &payload[12]); | ||
886 | } | 889 | } |
887 | 890 | ||
888 | static void handler_drm_KAE(struct wiimote_data *wdata, const __u8 *payload) | 891 | static void handler_drm_KAE(struct wiimote_data *wdata, const __u8 *payload) |
889 | { | 892 | { |
890 | handler_keys(wdata, payload); | 893 | handler_keys(wdata, payload); |
891 | handler_accel(wdata, payload); | 894 | handler_accel(wdata, payload); |
895 | wiiext_handle(wdata, &payload[5]); | ||
892 | } | 896 | } |
893 | 897 | ||
894 | static void handler_drm_KAIE(struct wiimote_data *wdata, const __u8 *payload) | 898 | static void handler_drm_KAIE(struct wiimote_data *wdata, const __u8 *payload) |
@@ -900,10 +904,12 @@ static void handler_drm_KAIE(struct wiimote_data *wdata, const __u8 *payload) | |||
900 | ir_to_input2(wdata, &payload[10], false); | 904 | ir_to_input2(wdata, &payload[10], false); |
901 | ir_to_input3(wdata, &payload[12], true); | 905 | ir_to_input3(wdata, &payload[12], true); |
902 | input_sync(wdata->ir); | 906 | input_sync(wdata->ir); |
907 | wiiext_handle(wdata, &payload[15]); | ||
903 | } | 908 | } |
904 | 909 | ||
905 | static void handler_drm_E(struct wiimote_data *wdata, const __u8 *payload) | 910 | static void handler_drm_E(struct wiimote_data *wdata, const __u8 *payload) |
906 | { | 911 | { |
912 | wiiext_handle(wdata, payload); | ||
907 | } | 913 | } |
908 | 914 | ||
909 | static void handler_drm_SKAI1(struct wiimote_data *wdata, const __u8 *payload) | 915 | static void handler_drm_SKAI1(struct wiimote_data *wdata, const __u8 *payload) |