Add kernel patch for proper Ouya Controller Support

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Lukas Rusak 2014-06-06 16:35:04 -07:00 committed by Stephan Raue
parent f14ba70f89
commit 23fc7988c6
9 changed files with 995 additions and 24 deletions

View File

@ -0,0 +1,315 @@
diff -Naur linux-3.15-rc6.orig/drivers/hid/hid-core.c linux-3.15-rc6/drivers/hid/hid-core.c
--- linux-3.15-rc6.orig/drivers/hid/hid-core.c 2014-06-06 13:46:49.711845049 -0700
+++ linux-3.15-rc6/drivers/hid/hid-core.c 2014-06-06 13:50:33.019965538 -0700
@@ -1848,6 +1848,7 @@
{ HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_OUYA, USB_DEVICE_ID_OUYA_CONTROLLER) },
{ HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_1) },
{ HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_2) },
diff -Naur linux-3.15-rc6.orig/drivers/hid/hid-ids.h linux-3.15-rc6/drivers/hid/hid-ids.h
--- linux-3.15-rc6.orig/drivers/hid/hid-ids.h 2014-06-06 13:46:49.711845049 -0700
+++ linux-3.15-rc6/drivers/hid/hid-ids.h 2014-06-06 13:51:36.146564828 -0700
@@ -700,6 +700,9 @@
#define USB_DEVICE_ID_ORTEK_PKB1700 0x1700
#define USB_DEVICE_ID_ORTEK_WKB2000 0x2000
+#define USB_VENDOR_ID_OUYA 0x2836
+#define USB_DEVICE_ID_OUYA_CONTROLLER 0x0001
+
#define USB_VENDOR_ID_PANASONIC 0x04da
#define USB_DEVICE_ID_PANABOARD_UBT780 0x1044
#define USB_DEVICE_ID_PANABOARD_UBT880 0x104d
diff -Naur linux-3.15-rc6.orig/drivers/hid/hid-ouya.c linux-3.15-rc6/drivers/hid/hid-ouya.c
--- linux-3.15-rc6.orig/drivers/hid/hid-ouya.c 1969-12-31 16:00:00.000000000 -0800
+++ linux-3.15-rc6/drivers/hid/hid-ouya.c 2014-06-06 13:52:22.785007560 -0700
@@ -0,0 +1,260 @@
+/*
+ * HID driver for OUYA Game Controller(s)
+ *
+ * Copyright (c) 2013 OUYA
+ */
+
+#include <linux/device.h>
+#include <linux/input.h>
+#include <linux/hid.h>
+#include <linux/module.h>
+
+#include "hid-ids.h"
+
+#define OUYA_TOUCHPAD_FIXUP (1 << 0)
+
+struct ouya_sc {
+ unsigned long quirks;
+};
+
+/* Fixed report descriptor */
+static __u8 ouya_rdesc_fixed[] = {
+
+ 0x05, 0x01, /* Usage Page (Desktop), */
+ 0x09, 0x05, /* Usage (Game Pad), */
+
+ 0xA1, 0x01, /* Collection (Application), */
+ 0x85, 0x07, /* Report ID (7), */
+
+ 0xA1, 0x00, /* Collection (Physical), */
+ 0x09, 0x30, /* Usage (X), */
+ 0x09, 0x31, /* Usage (Y), */
+ 0x15, 0x00, /* Logical Minimum (0), */
+ 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
+ 0x35, 0x00, /* Physical Minimum (0), */
+ 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
+ 0x95, 0x02, /* Report Count (2), */
+ 0x75, 0x08, /* Report Size (8), */
+ 0x81, 0x02, /* Input (Variable), */
+ 0xC0, /* End Collection, */
+
+ 0xA1, 0x00, /* Collection (Physical), */
+ 0x09, 0x33, /* Usage (Rx), */
+ 0x09, 0x34, /* Usage (Ry), */
+ 0x15, 0x00, /* Logical Minimum (0), */
+ 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
+ 0x35, 0x00, /* Physical Minimum (0), */
+ 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
+ 0x95, 0x02, /* Report Count (2), */
+ 0x75, 0x08, /* Report Size (8), */
+ 0x81, 0x02, /* Input (Variable), */
+ 0xC0, /* End Collection, */
+
+ 0xA1, 0x00, /* Collection (Physical), */
+ 0x09, 0x32, /* Usage (Z), */
+ 0x15, 0x00, /* Logical Minimum (0), */
+ 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
+ 0x35, 0x00, /* Physical Minimum (0), */
+ 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
+ 0x95, 0x01, /* Report Count (1), */
+ 0x75, 0x08, /* Report Size (8), */
+ 0x81, 0x02, /* Input (Variable), */
+ 0xC0, /* End Collection, */
+
+ 0xA1, 0x00, /* Collection (Physical), */
+ 0x09, 0x35, /* Usage (Rz), */
+ 0x15, 0x00, /* Logical Minimum (0), */
+ 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
+ 0x35, 0x00, /* Physical Minimum (0), */
+ 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
+ 0x95, 0x01, /* Report Count (1), */
+ 0x75, 0x08, /* Report Size (8), */
+ 0x81, 0x02, /* Input (Variable), */
+ 0xC0, /* End Collection, */
+
+ 0x05, 0x09, /* Usage Page (Button), */
+ 0x19, 0x01, /* Usage Minimum (01h), */
+ 0x29, 0x10, /* Usage Maximum (10h), */
+ 0x95, 0x10, /* Report Count (16), */
+ 0x75, 0x01, /* Report Size (1), */
+ 0x81, 0x02, /* Input (Variable), */
+
+ /* ORIGINAL REPORT DESCRIPTOR FOR TOUCHPAD INPUT */
+ /* 06 00 ff a1 02 09 02 15 00 26 ff 00 35 00 46 ff 00 95 03 75 08 81 02 c0 */
+
+ 0x06, 0x00, 0xFF, /* Usage Page (Custom), */
+ 0x09, 0x02, /* Usage (Mouse), */
+ 0x09, 0x01, /* Usage (Pointer), */
+ 0xA1, 0x00, /* Collection (Physical), */
+ 0x05, 0x09, /* Usage Page (Button), */
+ 0x19, 0x01, /* Usage Minimum (01h), */
+ 0x29, 0x03, /* Usage Maximum (03h), */
+ 0x15, 0x00, /* Logical Minimum (0), */
+ 0x25, 0x01, /* Logical Maximum (1), */
+ 0x95, 0x03, /* Report Count (3), */
+ 0x75, 0x01, /* Report Size (1), */
+ 0x81, 0x02, /* Input (Variable), */
+ 0x95, 0x01, /* Report Count (1), */
+ 0x75, 0x05, /* Report Size (5), */
+ 0x81, 0x01, /* Input (Constant), */
+ 0x05, 0x01, /* Usage Page (Desktop), */
+ 0x09, 0x30, /* Usage (X), */
+ 0x09, 0x31, /* Usage (Y), */
+ 0x15, 0x81, /* Logical Minimum (-127), */
+ 0x25, 0x7f, /* Logical Maximum (127), */
+ 0x95, 0x02, /* Report Count (2), */
+ 0x75, 0x08, /* Report Size (8), */
+ 0x81, 0x06, /* Input (Relative), */
+ 0xC0, /* End Collection, */
+
+ 0x06, 0x00, 0xFF, /* Usage Page (Custom), */
+ 0xA1, 0x02, /* Collection (Logical), */
+ 0x75, 0x08, /* Report Size (8), */
+ 0x95, 0x07, /* Report Count (7), */
+ 0x46, 0xFF, 0x00, /* Physical Maximum (255), */
+ 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
+ 0x09, 0x01, /* Usage (Pointer), */
+ 0x91, 0x02, /* Output (Variable), */
+ 0xC0, /* End Collection, */
+
+ 0xC0, /* End Collection */
+
+
+ 0x06, 0x00, 0xFF, /* Usage Page (Custom), */
+ 0x05, 0x0C, /* Usage Page (Consumer), */
+ 0x09, 0x01, /* Usage (Consumer Control), */
+
+ 0xA1, 0x01, /* Collection (Application), */
+ 0x85, 0x03, /* Report ID (3), */
+ 0x05, 0x01, /* Usage Page (Desktop), */
+ 0x09, 0x06, /* Usage (Keyboard), */
+ 0xA1, 0x02, /* Collection (Logical), */
+ 0x05, 0x06, /* Usage Page (Generic), */
+ 0x09, 0x20, /* Usage (Battery Strgth), */
+ 0x15, 0x00, /* Logical Minimum (0), */
+ 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
+ 0x75, 0x08, /* Report Size (8), */
+ 0x95, 0x01, /* Report Count (1), */
+ 0x81, 0x02, /* Input (Variable), */
+ 0x06, 0xBC, 0xFF, /* Usage Page (Custom), */
+
+ 0x0A, 0xAD, 0xBD, /* UNKNOWN */
+
+ 0x75, 0x08, /* Report Size (8), */
+ 0x95, 0x06, /* Report Count (6), */
+ 0x81, 0x02, /* Input (Variable), */
+ 0xC0, /* End Collection, */
+
+ 0xC0, /* End Collection */
+
+ 0x00
+};
+
+static __u8 *ouya_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+ unsigned int *rsize)
+{
+ struct ouya_sc *sc = hid_get_drvdata(hdev);
+
+ if (sc->quirks & OUYA_TOUCHPAD_FIXUP) {
+ rdesc = ouya_rdesc_fixed;
+ *rsize = sizeof(ouya_rdesc_fixed);
+ }
+ return rdesc;
+}
+
+static int ouya_input_mapping(struct hid_device *hdev, struct hid_input *hi,
+ struct hid_field *field, struct hid_usage *usage,
+ unsigned long **bit, int *max)
+{
+ struct ouya_sc *sc = hid_get_drvdata(hdev);
+
+ if (!(sc->quirks & OUYA_TOUCHPAD_FIXUP)) {
+ return 0;
+ }
+
+ if ((usage->hid & 0x90000) == 0x90000 &&
+ (field->physical & 0xff000000) == 0xff000000 &&
+ usage->collection_index == 5 &&
+ field->report_count == 3) {
+
+ hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_MOUSE + (usage->hid - 0x90001));
+
+ return 1;
+ }
+
+ return 0;
+}
+
+static int ouya_probe(struct hid_device *hdev, const struct hid_device_id *id)
+{
+ int ret;
+ struct ouya_sc *sc;
+
+ sc = kzalloc(sizeof(*sc), GFP_KERNEL);
+ if (sc == NULL) {
+ hid_err(hdev, "can't alloc ouya descriptor\n");
+ return -ENOMEM;
+ }
+
+ if(((hdev->version & 0xff00) == 0x0100 && (hdev->version & 0xff) >= 0x04) ||
+ ((hdev->version & 0xff00) == 0xe100 && (hdev->version & 0xff) >= 0x3a)) {
+ hid_info(hdev, "ouya controller - new version\n");
+ sc->quirks = OUYA_TOUCHPAD_FIXUP;
+ } else {
+ sc->quirks = 0;
+ }
+ hid_set_drvdata(hdev, sc);
+
+ ret = hid_parse(hdev);
+ if (ret) {
+ hid_err(hdev, "parse failed\n");
+ goto err_free;
+ }
+
+ ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT |
+ HID_CONNECT_HIDDEV_FORCE);
+ if (ret) {
+ hid_err(hdev, "hw start failed\n");
+ goto err_free;
+ }
+
+ return 0;
+
+err_free:
+ kfree(sc);
+ return ret;
+}
+
+static void ouya_remove(struct hid_device *hdev)
+{
+ hid_hw_stop(hdev);
+ kfree(hid_get_drvdata(hdev));
+}
+
+static const struct hid_device_id ouya_devices[] = {
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_OUYA, USB_DEVICE_ID_OUYA_CONTROLLER) },
+ { }
+};
+MODULE_DEVICE_TABLE(hid, ouya_devices);
+
+static struct hid_driver ouya_driver = {
+ .name = "ouya",
+ .id_table = ouya_devices,
+ .probe = ouya_probe,
+ .remove = ouya_remove,
+ .input_mapping = ouya_input_mapping,
+ .report_fixup = ouya_report_fixup
+};
+
+static int __init ouya_init(void)
+{
+ return hid_register_driver(&ouya_driver);
+}
+
+static void __exit ouya_exit(void)
+{
+ hid_unregister_driver(&ouya_driver);
+}
+
+module_init(ouya_init);
+module_exit(ouya_exit);
diff -Naur linux-3.15-rc6.orig/drivers/hid/Kconfig linux-3.15-rc6/drivers/hid/Kconfig
--- linux-3.15-rc6.orig/drivers/hid/Kconfig 2014-06-06 13:46:49.710845040 -0700
+++ linux-3.15-rc6/drivers/hid/Kconfig 2014-06-06 13:48:41.674908325 -0700
@@ -499,6 +499,12 @@
- Ortek WKB-2000
- Skycable wireless presenter
+config HID_OUYA
+ tristate "OUYA Game Controller"
+ depends on USB_HID
+ ---help---
+ Support for OUYA Game Controller.
+
config HID_PANTHERLORD
tristate "Pantherlord/GreenAsia game controller"
depends on HID
diff -Naur linux-3.15-rc6.orig/drivers/hid/Makefile linux-3.15-rc6/drivers/hid/Makefile
--- linux-3.15-rc6.orig/drivers/hid/Makefile 2014-06-06 13:46:49.710845040 -0700
+++ linux-3.15-rc6/drivers/hid/Makefile 2014-06-06 13:49:23.951309760 -0700
@@ -68,6 +68,7 @@
obj-$(CONFIG_HID_MULTITOUCH) += hid-multitouch.o
obj-$(CONFIG_HID_NTRIG) += hid-ntrig.o
obj-$(CONFIG_HID_ORTEK) += hid-ortek.o
+obj-$(CONFIG_HID_OUYA) += hid-ouya.o
obj-$(CONFIG_HID_PRODIKEYS) += hid-prodikeys.o
obj-$(CONFIG_HID_PANTHERLORD) += hid-pl.o
obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o

View File

@ -0,0 +1,338 @@
diff -Naur xbmc-master-14-5ec51aa.orig/system/keymaps/joystick.Ouya.Controller.xml xbmc-master-14-5ec51aa/system/keymaps/joystick.Ouya.Controller.xml
--- xbmc-master-14-5ec51aa.orig/system/keymaps/joystick.Ouya.Controller.xml 1969-12-31 16:00:00.000000000 -0800
+++ xbmc-master-14-5ec51aa/system/keymaps/joystick.Ouya.Controller.xml 2014-06-06 16:31:54.812044875 -0700
@@ -0,0 +1,334 @@
+<!-- Joystick Name: OUYA Game Controller -->
+<!-- created by: N3MIS15 on the xbmc forum -->
+<!-- http://forum.xbmc.org/showthread.php?tid=173516 -->
+
+<!-- Button Mappings in OpenELEC: -->
+<!-- -->
+<!-- ID Button -->
+<!-- -->
+<!-- 1 O -->
+<!-- 2 U -->
+<!-- 3 Y -->
+<!-- 4 A -->
+<!-- 5 Left Sholder -->
+<!-- 6 Right Sholder -->
+<!-- 7 Left Stick Button -->
+<!-- 8 Right Stick Button -->
+<!-- 9 D-Pad Up -->
+<!-- 10 D-Pad Down -->
+<!-- 11 D-Pad Left -->
+<!-- 12 D-Pad Right -->
+
+<!-- Axis Mappings: -->
+<!-- -->
+<!-- ID Button -->
+<!-- -->
+<!-- 1 Left Stick L/R -->
+<!-- 2 Left Stick U/D -->
+<!-- 3 limit +1 Left Trigger Pressed -->
+<!-- 3 limit -1 Left Trigger Depressed -->
+<!-- 4 Right Stick L/R -->
+<!-- 5 Right Stick U/D -->
+<!-- 6 limit +1 Right Trigger Pressed -->
+<!-- 6 limit -1 Right Trigger Depressed -->
+
+<keymap>
+
+ <global>
+ <joystick name="OUYA Game Controller">
+ <button id="1">Select</button>
+ <button id="2">ContextMenu</button>
+ <button id="3">FullScreen</button>
+ <button id="4">Back</button>
+ <button id="5">Queue</button>
+ <button id="6">Playlist</button>
+ <button id="7">PreviousMenu</button>
+ <button id="8">XBMC.ActivateWindow(Home)</button>
+ <button id="9">Up</button>
+ <button id="10">Down</button>
+ <button id="11">Left</button>
+ <button id="12">Right</button>
+ <axis id="4" limit="-1">AnalogSeekBack</axis>
+ <axis id="4" limit="+1">AnalogSeekForward</axis>
+ <axis id="2" limit="-1">ScrollUp</axis>
+ <axis id="2" limit="+1">ScrollDown</axis>
+ </joystick>
+ </global>
+
+ <Home>
+ </Home>
+
+ <MyFiles>
+ </MyFiles>
+
+ <MyMusicPlaylist>
+ <joystick name="OUYA Game Controller">
+ <button id="5">Delete</button>
+ </joystick>
+ </MyMusicPlaylist>
+
+ <MyMusicFiles>
+ </MyMusicFiles>
+
+ <MyMusicLibrary>
+ </MyMusicLibrary>
+
+ <FullscreenVideo>
+ <joystick name="OUYA Game Controller">
+ <button id="1">Pause</button>
+ <button id="2">OSD</button>
+ <button id="4">Stop</button>
+ <button id="5">AspectRatio</button>
+ <button id="6">ShowSubtitles</button>
+ <button id="7">SmallStepBack</button>
+ <button id="8">Info</button>
+ <button id="9">BigStepForward</button>
+ <button id="10">BigStepBack</button>
+ <button id="11">StepBack</button>
+ <button id="12">StepForward</button>
+ </joystick>
+ </FullscreenVideo>
+
+ <FullscreenLiveTV>
+ <joystick name="OUYA Game Controller">
+ <button id="9">ChannelUp</button>
+ <button id="10">ChannelDown</button>
+ <button id="11">PreviousChannelGroup</button>
+ <button id="12">NextChannelGroup</button>
+ </joystick>
+ </FullscreenLiveTV>
+
+ <FullscreenInfo>
+ <joystick name="OUYA Game Controller">
+ <button id="2">OSD</button>
+ <button id="4">Close</button>
+ <button id="8">Close</button>
+ <axis id="3" limit="+1">AnalogRewind</axis>
+ <axis id="3" limit="-1">AnalogFastForward</axis>
+ </joystick>
+ </FullscreenInfo>
+
+ <PlayerControls>
+ <joystick name="OUYA Game Controller">
+ <button id="2">Close</button>
+ <button id="7">Close</button>
+ <button id="8">Close</button>
+ </joystick>
+ </PlayerControls>
+
+ <Visualisation>
+ <joystick name="OUYA Game Controller">
+ <button id="1">Pause</button>
+ <button id="4">Stop</button>
+ <button id="2">XBMC.ActivateWindow(MusicOSD)</button>
+ <button id="5">XBMC.ActivateWindow(VisualisationPresetList)</button>
+ <button id="6">Info</button>
+ <button id="8">XBMC.ActivateWindow(MusicOSD)</button>
+ <button id="9">SkipNext</button>
+ <button id="10">SkipPrevious</button>
+ <button id="11">PreviousPreset</button>
+ <button id="12">NextPreset</button>
+ <axis id="3" limit="+1">AnalogRewind</axis>
+ <axis id="6" limit="+1">AnalogFastForward</axis>
+ </joystick>
+ </Visualisation>
+
+ <MusicOSD>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ <button id="6">Info</button>
+ </joystick>
+ </MusicOSD>
+
+ <VisualisationSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </VisualisationSettings>
+
+ <VisualisationPresetList>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </VisualisationPresetList>
+
+ <SlideShow>
+ <joystick name="OUYA Game Controller">
+ <button id="1">Pause</button>
+ <button id="4">Stop</button>
+ <button id="3">ZoomNormal</button>
+ <button id="5">Rotate</button>
+ <button id="6">CodecInfo</button>
+ <button id="11">PreviousPicture</button>
+ <button id="12">NextPicture</button>
+ <axis id="1">AnalogMove</axis>
+ <axis id="2">AnalogMove</axis>
+ <axis id="3" limit="+1">ZoomOut</axis>
+ <axis id="6" limit="+1">ZoomIn</axis>
+ </joystick>
+ </SlideShow>
+
+ <ScreenCalibration>
+ <joystick name="OUYA Game Controller">
+ <button id="2">ResetCalibration</button>
+ <button id="5">NextResolution</button>
+ <button id="6">NextCalibration</button>
+ </joystick>
+ </ScreenCalibration>
+
+ <GUICalibration>
+ <joystick name="OUYA Game Controller">
+ <button id="2">ResetCalibration</button>
+ <button id="5">NextResolution</button>
+ <button id="6">NextCalibration</button>
+ </joystick>
+ </GUICalibration>
+
+ <VideoOSD>
+ <joystick name="OUYA Game Controller">
+ <button id="2">Close</button>
+ </joystick>
+ </VideoOSD>
+
+ <VideoMenu>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Stop</button>
+ <button id="2">OSD</button>
+ <button id="5">AspectRatio</button>
+ <button id="8">Info</button>
+ </joystick>
+ </VideoMenu>
+
+ <OSDVideoSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="5">AspectRatio</button>
+ <button id="2">Close</button>
+ </joystick>
+ </OSDVideoSettings>
+
+ <OSDAudioSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="5">AspectRatio</button>
+ <button id="2">Close</button>
+ </joystick>
+ </OSDAudioSettings>
+
+ <VideoBookmarks>
+ <joystick name="OUYA Game Controller">
+ <button id="5">Delete</button>
+ </joystick>
+ </VideoBookmarks>
+
+ <MyVideoLibrary>
+ </MyVideoLibrary>
+
+ <MyVideoFiles>
+ </MyVideoFiles>
+
+ <MyVideoPlaylist>
+ <joystick name="OUYA Game Controller">
+ <button id="5">Delete</button>
+ </joystick>
+ </MyVideoPlaylist>
+
+ <VirtualKeyboard>
+ <joystick name="OUYA Game Controller">
+ <button id="4">BackSpace</button>
+ <button id="3">Symbols</button>
+ <button id="5">Shift</button>
+ <button id="7">Enter</button>
+ <axis id="3" limit="+1">CursorLeft</axis>
+ <axis id="6" limit="+1">CursorRight</axis>
+ </joystick>
+ </VirtualKeyboard>
+
+ <ContextMenu>
+ <joystick name="OUYA Game Controller">
+ <button id="2">Close</button>
+ <button id="4">Close</button>
+ </joystick>
+ </ContextMenu>
+
+ <Scripts>
+ <joystick name="OUYA Game Controller">
+ <button id="2">Info</button>
+ </joystick>
+ </Scripts>
+
+ <Settings>
+ <joystick name="OUYA Game Controller">
+ <button id="4">PreviousMenu</button>
+ </joystick>
+ </Settings>
+
+ <AddonInformation>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </AddonInformation>
+
+ <AddonSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </AddonSettings>
+
+ <TextViewer>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </TextViewer>
+
+ <shutdownmenu>
+ <joystick name="OUYA Game Controller">
+ <button id="4">PreviousMenu</button>
+ <button id="7">PreviousMenu</button>
+ </joystick>
+ </shutdownmenu>
+
+ <submenu>
+ <joystick name="OUYA Game Controller">
+ <button id="4">PreviousMenu</button>
+ </joystick>
+ </submenu>
+
+ <MusicInformation>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </MusicInformation>
+
+ <MovieInformation>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </MovieInformation>
+
+ <NumericInput>
+ <joystick name="OUYA Game Controller">
+ <button id="4">BackSpace</button>
+ <button id="7">Enter</button>
+ </joystick>
+ </NumericInput>
+
+ <GamepadInput>
+ <joystick name="OUYA Game Controller">
+ <button id="7">Stop</button>
+ </joystick>
+ </GamepadInput>
+
+ <LockSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="4">PreviousMenu</button>
+ <button id="7">Close</button>
+ </joystick>
+ </LockSettings>
+
+ <ProfileSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="4">PreviousMenu</button>
+ <button id="7">Close</button>
+ </joystick>
+ </ProfileSettings>
+
+</keymap>

View File

@ -0,0 +1,338 @@
diff -Naur xbmc-master-14-5ec51aa.orig/system/keymaps/joystick.Ouya.Controller.xml xbmc-master-14-5ec51aa/system/keymaps/joystick.Ouya.Controller.xml
--- xbmc-master-14-5ec51aa.orig/system/keymaps/joystick.Ouya.Controller.xml 1969-12-31 16:00:00.000000000 -0800
+++ xbmc-master-14-5ec51aa/system/keymaps/joystick.Ouya.Controller.xml 2014-06-06 16:31:54.812044875 -0700
@@ -0,0 +1,334 @@
+<!-- Joystick Name: OUYA Game Controller -->
+<!-- created by: N3MIS15 on the xbmc forum -->
+<!-- http://forum.xbmc.org/showthread.php?tid=173516 -->
+
+<!-- Button Mappings in OpenELEC: -->
+<!-- -->
+<!-- ID Button -->
+<!-- -->
+<!-- 1 O -->
+<!-- 2 U -->
+<!-- 3 Y -->
+<!-- 4 A -->
+<!-- 5 Left Sholder -->
+<!-- 6 Right Sholder -->
+<!-- 7 Left Stick Button -->
+<!-- 8 Right Stick Button -->
+<!-- 9 D-Pad Up -->
+<!-- 10 D-Pad Down -->
+<!-- 11 D-Pad Left -->
+<!-- 12 D-Pad Right -->
+
+<!-- Axis Mappings: -->
+<!-- -->
+<!-- ID Button -->
+<!-- -->
+<!-- 1 Left Stick L/R -->
+<!-- 2 Left Stick U/D -->
+<!-- 3 limit +1 Left Trigger Pressed -->
+<!-- 3 limit -1 Left Trigger Depressed -->
+<!-- 4 Right Stick L/R -->
+<!-- 5 Right Stick U/D -->
+<!-- 6 limit +1 Right Trigger Pressed -->
+<!-- 6 limit -1 Right Trigger Depressed -->
+
+<keymap>
+
+ <global>
+ <joystick name="OUYA Game Controller">
+ <button id="1">Select</button>
+ <button id="2">ContextMenu</button>
+ <button id="3">FullScreen</button>
+ <button id="4">Back</button>
+ <button id="5">Queue</button>
+ <button id="6">Playlist</button>
+ <button id="7">PreviousMenu</button>
+ <button id="8">XBMC.ActivateWindow(Home)</button>
+ <button id="9">Up</button>
+ <button id="10">Down</button>
+ <button id="11">Left</button>
+ <button id="12">Right</button>
+ <axis id="4" limit="-1">AnalogSeekBack</axis>
+ <axis id="4" limit="+1">AnalogSeekForward</axis>
+ <axis id="2" limit="-1">ScrollUp</axis>
+ <axis id="2" limit="+1">ScrollDown</axis>
+ </joystick>
+ </global>
+
+ <Home>
+ </Home>
+
+ <MyFiles>
+ </MyFiles>
+
+ <MyMusicPlaylist>
+ <joystick name="OUYA Game Controller">
+ <button id="5">Delete</button>
+ </joystick>
+ </MyMusicPlaylist>
+
+ <MyMusicFiles>
+ </MyMusicFiles>
+
+ <MyMusicLibrary>
+ </MyMusicLibrary>
+
+ <FullscreenVideo>
+ <joystick name="OUYA Game Controller">
+ <button id="1">Pause</button>
+ <button id="2">OSD</button>
+ <button id="4">Stop</button>
+ <button id="5">AspectRatio</button>
+ <button id="6">ShowSubtitles</button>
+ <button id="7">SmallStepBack</button>
+ <button id="8">Info</button>
+ <button id="9">BigStepForward</button>
+ <button id="10">BigStepBack</button>
+ <button id="11">StepBack</button>
+ <button id="12">StepForward</button>
+ </joystick>
+ </FullscreenVideo>
+
+ <FullscreenLiveTV>
+ <joystick name="OUYA Game Controller">
+ <button id="9">ChannelUp</button>
+ <button id="10">ChannelDown</button>
+ <button id="11">PreviousChannelGroup</button>
+ <button id="12">NextChannelGroup</button>
+ </joystick>
+ </FullscreenLiveTV>
+
+ <FullscreenInfo>
+ <joystick name="OUYA Game Controller">
+ <button id="2">OSD</button>
+ <button id="4">Close</button>
+ <button id="8">Close</button>
+ <axis id="3" limit="+1">AnalogRewind</axis>
+ <axis id="3" limit="-1">AnalogFastForward</axis>
+ </joystick>
+ </FullscreenInfo>
+
+ <PlayerControls>
+ <joystick name="OUYA Game Controller">
+ <button id="2">Close</button>
+ <button id="7">Close</button>
+ <button id="8">Close</button>
+ </joystick>
+ </PlayerControls>
+
+ <Visualisation>
+ <joystick name="OUYA Game Controller">
+ <button id="1">Pause</button>
+ <button id="4">Stop</button>
+ <button id="2">XBMC.ActivateWindow(MusicOSD)</button>
+ <button id="5">XBMC.ActivateWindow(VisualisationPresetList)</button>
+ <button id="6">Info</button>
+ <button id="8">XBMC.ActivateWindow(MusicOSD)</button>
+ <button id="9">SkipNext</button>
+ <button id="10">SkipPrevious</button>
+ <button id="11">PreviousPreset</button>
+ <button id="12">NextPreset</button>
+ <axis id="3" limit="+1">AnalogRewind</axis>
+ <axis id="6" limit="+1">AnalogFastForward</axis>
+ </joystick>
+ </Visualisation>
+
+ <MusicOSD>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ <button id="6">Info</button>
+ </joystick>
+ </MusicOSD>
+
+ <VisualisationSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </VisualisationSettings>
+
+ <VisualisationPresetList>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </VisualisationPresetList>
+
+ <SlideShow>
+ <joystick name="OUYA Game Controller">
+ <button id="1">Pause</button>
+ <button id="4">Stop</button>
+ <button id="3">ZoomNormal</button>
+ <button id="5">Rotate</button>
+ <button id="6">CodecInfo</button>
+ <button id="11">PreviousPicture</button>
+ <button id="12">NextPicture</button>
+ <axis id="1">AnalogMove</axis>
+ <axis id="2">AnalogMove</axis>
+ <axis id="3" limit="+1">ZoomOut</axis>
+ <axis id="6" limit="+1">ZoomIn</axis>
+ </joystick>
+ </SlideShow>
+
+ <ScreenCalibration>
+ <joystick name="OUYA Game Controller">
+ <button id="2">ResetCalibration</button>
+ <button id="5">NextResolution</button>
+ <button id="6">NextCalibration</button>
+ </joystick>
+ </ScreenCalibration>
+
+ <GUICalibration>
+ <joystick name="OUYA Game Controller">
+ <button id="2">ResetCalibration</button>
+ <button id="5">NextResolution</button>
+ <button id="6">NextCalibration</button>
+ </joystick>
+ </GUICalibration>
+
+ <VideoOSD>
+ <joystick name="OUYA Game Controller">
+ <button id="2">Close</button>
+ </joystick>
+ </VideoOSD>
+
+ <VideoMenu>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Stop</button>
+ <button id="2">OSD</button>
+ <button id="5">AspectRatio</button>
+ <button id="8">Info</button>
+ </joystick>
+ </VideoMenu>
+
+ <OSDVideoSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="5">AspectRatio</button>
+ <button id="2">Close</button>
+ </joystick>
+ </OSDVideoSettings>
+
+ <OSDAudioSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="5">AspectRatio</button>
+ <button id="2">Close</button>
+ </joystick>
+ </OSDAudioSettings>
+
+ <VideoBookmarks>
+ <joystick name="OUYA Game Controller">
+ <button id="5">Delete</button>
+ </joystick>
+ </VideoBookmarks>
+
+ <MyVideoLibrary>
+ </MyVideoLibrary>
+
+ <MyVideoFiles>
+ </MyVideoFiles>
+
+ <MyVideoPlaylist>
+ <joystick name="OUYA Game Controller">
+ <button id="5">Delete</button>
+ </joystick>
+ </MyVideoPlaylist>
+
+ <VirtualKeyboard>
+ <joystick name="OUYA Game Controller">
+ <button id="4">BackSpace</button>
+ <button id="3">Symbols</button>
+ <button id="5">Shift</button>
+ <button id="7">Enter</button>
+ <axis id="3" limit="+1">CursorLeft</axis>
+ <axis id="6" limit="+1">CursorRight</axis>
+ </joystick>
+ </VirtualKeyboard>
+
+ <ContextMenu>
+ <joystick name="OUYA Game Controller">
+ <button id="2">Close</button>
+ <button id="4">Close</button>
+ </joystick>
+ </ContextMenu>
+
+ <Scripts>
+ <joystick name="OUYA Game Controller">
+ <button id="2">Info</button>
+ </joystick>
+ </Scripts>
+
+ <Settings>
+ <joystick name="OUYA Game Controller">
+ <button id="4">PreviousMenu</button>
+ </joystick>
+ </Settings>
+
+ <AddonInformation>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </AddonInformation>
+
+ <AddonSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </AddonSettings>
+
+ <TextViewer>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </TextViewer>
+
+ <shutdownmenu>
+ <joystick name="OUYA Game Controller">
+ <button id="4">PreviousMenu</button>
+ <button id="7">PreviousMenu</button>
+ </joystick>
+ </shutdownmenu>
+
+ <submenu>
+ <joystick name="OUYA Game Controller">
+ <button id="4">PreviousMenu</button>
+ </joystick>
+ </submenu>
+
+ <MusicInformation>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </MusicInformation>
+
+ <MovieInformation>
+ <joystick name="OUYA Game Controller">
+ <button id="4">Close</button>
+ </joystick>
+ </MovieInformation>
+
+ <NumericInput>
+ <joystick name="OUYA Game Controller">
+ <button id="4">BackSpace</button>
+ <button id="7">Enter</button>
+ </joystick>
+ </NumericInput>
+
+ <GamepadInput>
+ <joystick name="OUYA Game Controller">
+ <button id="7">Stop</button>
+ </joystick>
+ </GamepadInput>
+
+ <LockSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="4">PreviousMenu</button>
+ <button id="7">Close</button>
+ </joystick>
+ </LockSettings>
+
+ <ProfileSettings>
+ <joystick name="OUYA Game Controller">
+ <button id="4">PreviousMenu</button>
+ <button id="7">Close</button>
+ </joystick>
+ </ProfileSettings>
+
+</keymap>

View File

@ -1,20 +0,0 @@
# Ouya Bluetooth Controller
BTN_THUMBR = KEY_INFO # Display
BTN_B = KEY_EPG # Pop UP/MENU
BTN_C = KEY_EXIT # Return
BTN_TL = KEY_OPTION # Options
BTN_A = KEY_OK # Start
BTN_TL2 = KEY_UP # Direction Up
BTN_TR2 = KEY_DOWN # Direction Down
BTN_SELECT = KEY_LEFT # Direction Left
BTN_START = KEY_RIGHT # Direction Right
BTN_A = KEY_PLAY # Play
BTN_X = KEY_STOP # Stop
BTN_A = KEY_PAUSE # Pause
BTN_MODE = KEY_REWIND # Reverse
BTN_THUMBL = KEY_FASTFORWARD # Forward
BTN_Y = KEY_PREVIOUS # Pre-track
BTN_Z = KEY_NEXT # Next track

View File

@ -204,10 +204,6 @@ ATTRS{name}=="BD Remote Control", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="ps3remote.evmap"
ATTRS{name}=="OUYA Game Controller", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="ouya.evmap"
LABEL="end-bluetooth"
LABEL="end"

View File

@ -2592,6 +2592,7 @@ CONFIG_HID_PETALYNX=y
CONFIG_HID_SAMSUNG=y
CONFIG_HID_SONY=y
CONFIG_SONY_FF=y
CONFIG_HID_OUYA=m
# CONFIG_HID_SPEEDLINK is not set
# CONFIG_HID_STEELSERIES is not set
CONFIG_HID_SPINELPLUS=y

View File

@ -3059,6 +3059,7 @@ CONFIG_HID_PETALYNX=y
CONFIG_HID_SAMSUNG=y
CONFIG_HID_SONY=y
CONFIG_SONY_FF=y
CONFIG_HID_OUYA=m
# CONFIG_HID_SPEEDLINK is not set
# CONFIG_HID_STEELSERIES is not set
CONFIG_HID_SPINELPLUS=y

View File

@ -3029,6 +3029,7 @@ CONFIG_HID_PETALYNX=y
CONFIG_HID_SAMSUNG=y
CONFIG_HID_SONY=y
CONFIG_SONY_FF=y
CONFIG_HID_OUYA=m
# CONFIG_HID_SPEEDLINK is not set
# CONFIG_HID_STEELSERIES is not set
CONFIG_HID_SPINELPLUS=y

View File

@ -2271,6 +2271,7 @@ CONFIG_HID_PETALYNX=y
CONFIG_HID_SAMSUNG=y
CONFIG_HID_SONY=y
CONFIG_SONY_FF=y
CONFIG_HID_OUYA=m
# CONFIG_HID_SPEEDLINK is not set
# CONFIG_HID_STEELSERIES is not set
CONFIG_HID_SPINELPLUS=y