Kodi Community Forum

Full Version: Adapt a patch. Who's up for a challenge?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hello all, hoping some awesome people here in the XBMC forum can help me. I have a remote wonder plus x10 rf remote that I would like to get working in xbmc linux (any flavor really, openelec preferably).

The problem is that a patch is needed and I HAVE THE PATCH but don't know how to adapt the patch for kernel 3.14.11. It was written for kernel 2.6.20

All I need is someone to help adapt this patch to 3.14.11 but please show me how you did it? I would like to learn from this.

Here is the drive patch for 2.6.20:
Code:
    /*
     *  USB ATI Remote support
     *
     *                Copyright (c) 2011, 2012 Anssi Hannula <[email protected]>
     *  Version 2.2.0 Copyright (c) 2004 Torrey Hoffman <[email protected]>
     *  Version 2.1.1 Copyright (c) 2002 Vladimir Dergachev
     *
     *  This 2.2.0 version is a rewrite / cleanup of the 2.1.1 driver, including
     *  porting to the 2.6 kernel interfaces, along with other modification
     *  to better match the style of the existing usb/input drivers.  However, the
     *  protocol and hardware handling is essentially unchanged from 2.1.1.
     *
     *  The 2.1.1 driver was derived from the usbati_remote and usbkbd drivers by
     *  Vojtech Pavlik.
     *
     *  Changes:
     *
     *  Feb 2004: Torrey Hoffman <[email protected]>
     *            Version 2.2.0
     *  Jun 2004: Torrey Hoffman <[email protected]>
     *            Version 2.2.1
     *            Added key repeat support contributed by:
     *                Vincent Vanackere <[email protected]>
     *            Added support for the "Lola" remote contributed by:
     *                Seth Cohn <[email protected]>
     *
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 2 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program; if not, write to the Free Software
     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
     *
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
     *
     * Hardware & software notes
     *
     * These remote controls are distributed by ATI as part of their
     * "All-In-Wonder" video card packages.  The receiver self-identifies as a
     * "USB Receiver" with manufacturer "X10 Wireless Technology Inc".
     *
     * The "Lola" remote is available from X10.  See:
     *    http://www.x10.com/products/lola_sg1.htm
     * The Lola is similar to the ATI remote but has no mouse support, and slightly
     * different keys.
     *
     * It is possible to use multiple receivers and remotes on multiple computers
     * simultaneously by configuring them to use specific channels.
     *
     * The RF protocol used by the remote supports 16 distinct channels, 1 to 16.
     * Actually, it may even support more, at least in some revisions of the
     * hardware.
     *
     * Each remote can be configured to transmit on one channel as follows:
     *   - Press and hold the "hand icon" button.
     *   - When the red LED starts to blink, let go of the "hand icon" button.
     *   - When it stops blinking, input the channel code as two digits, from 01
     *     to 16, and press the hand icon again.
     *
     * The timing can be a little tricky.  Try loading the module with debug=1
     * to have the kernel print out messages about the remote control number
     * and mask.  Note: debugging prints remote numbers as zero-based hexadecimal.
     *
     * The driver has a "channel_mask" parameter. This bitmask specifies which
     * channels will be ignored by the module.  To mask out channels, just add
     * all the 2^channel_number values together.
     *
     * For instance, set channel_mask = 2^4 = 16 (binary 10000) to make ati_remote
     * ignore signals coming from remote controls transmitting on channel 4, but
     * accept all other channels.
     *
     * Or, set channel_mask = 65533, (0xFFFD), and all channels except 1 will be
     * ignored.
     *
     * The default is 0 (respond to all channels). Bit 0 and bits 17-32 of this
     * parameter are unused.
     *
     */
    
    #include <linux/kernel.h>
    #include <linux/errno.h>
    #include <linux/init.h>
    #include <linux/slab.h>
    #include <linux/module.h>
    #include <linux/mutex.h>
    #include <linux/usb/input.h>
    #include <linux/wait.h>
    #include <linux/jiffies.h>
    #include <media/rc-core.h>
    
    /*
     * Module and Version Information, Module Parameters
     */
    
    #define ATI_REMOTE_VENDOR_ID            0x0bc7
    #define LOLA_REMOTE_PRODUCT_ID          0x0002
    #define LOLA2_REMOTE_PRODUCT_ID         0x0003
    #define ATI_REMOTE_PRODUCT_ID           0x0004
    #define NVIDIA_REMOTE_PRODUCT_ID        0x0005
    #define MEDION_REMOTE_PRODUCT_ID        0x0006
    #define FIREFLY_REMOTE_PRODUCT_ID       0x0008
    
    #define DRIVER_VERSION          "2.2.1"
    #define DRIVER_AUTHOR           "Torrey Hoffman <[email protected]>"
    #define DRIVER_DESC             "ATI/X10 RF USB Remote Control"
    
    #define NAME_BUFSIZE      80    /* size of product name, path buffers */
    #define DATA_BUFSIZE      63    /* size of URB data buffers */
    
    /*
     * Duplicate event filtering time.
     * Sequential, identical KIND_FILTERED inputs with less than
     * FILTER_TIME milliseconds between them are considered as repeat
     * events. The hardware generates 5 events for the first keypress
     * and we have to take this into account for an accurate repeat
     * behaviour.
     */
    #define FILTER_TIME     60 /* msec */
    #define REPEAT_DELAY    500 /* msec */
    
    static unsigned long channel_mask;
    module_param(channel_mask, ulong, 0644);
    MODULE_PARM_DESC(channel_mask, "Bitmask of remote control channels to ignore");
    
    static int debug;
    module_param(debug, int, 0644);
    MODULE_PARM_DESC(debug, "Enable extra debug messages and information");
    
    static int repeat_filter = FILTER_TIME;
    module_param(repeat_filter, int, 0644);
    MODULE_PARM_DESC(repeat_filter, "Repeat filter time, default = 60 msec");
    
    static int repeat_delay = REPEAT_DELAY;
    module_param(repeat_delay, int, 0644);
    MODULE_PARM_DESC(repeat_delay, "Delay before sending repeats, default = 500 msec");
    
    static bool mouse = true;
    module_param(mouse, bool, 0444);
    MODULE_PARM_DESC(mouse, "Enable mouse device, default = yes");
    
    #define dbginfo(dev, format, arg...) \
            do { if (debug) dev_info(dev , format , ## arg); } while (0)
    #undef err
    #define err(format, arg...) printk(KERN_ERR format , ## arg)
    
    struct ati_receiver_type {
            /* either default_keymap or get_default_keymap should be set */
            const char *default_keymap;
            const char *(*get_default_keymap)(struct usb_interface *interface);
    };
    
    static const char *get_medion_keymap(struct usb_interface *interface)
    {
            struct usb_device *udev = interface_to_usbdev(interface);
    
            /*
             * There are many different Medion remotes shipped with a receiver
             * with the same usb id, but the receivers have subtle differences
             * in the USB descriptors allowing us to detect them.
             */
    
            if (udev->manufacturer && udev->product) {
                    if (udev->actconfig->desc.bmAttributes & USB_CONFIG_ATT_WAKEUP) {
    
                            if (!strcmp(udev->manufacturer, "X10 Wireless Technology Inc")
                                && !strcmp(udev->product, "USB Receiver"))
                                    return RC_MAP_MEDION_X10_DIGITAINER;
    
                            if (!strcmp(udev->manufacturer, "X10 WTI")
                                && !strcmp(udev->product, "RF receiver"))
                                    return RC_MAP_MEDION_X10_OR2X;
                    } else {
    
                             if (!strcmp(udev->manufacturer, "X10 Wireless Technology Inc")
                                && !strcmp(udev->product, "USB Receiver"))
                                    return RC_MAP_MEDION_X10;
                    }
            }
    
            dev_info(&interface->dev,
                     "Unknown Medion X10 receiver, using default ati_remote Medion keymap\n");
    
            return RC_MAP_MEDION_X10;
    }
    
    static const struct ati_receiver_type type_ati          = {
            .default_keymap = RC_MAP_ATI_X10
    };
    static const struct ati_receiver_type type_medion       = {
            .get_default_keymap = get_medion_keymap
    };
    static const struct ati_receiver_type type_firefly      = {
            .default_keymap = RC_MAP_SNAPSTREAM_FIREFLY
    };
    
    static struct usb_device_id ati_remote_table[] = {
            {
                    USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID),
                    .driver_info = (unsigned long)&type_ati
            },
            {
                    USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA2_REMOTE_PRODUCT_ID),
                    .driver_info = (unsigned long)&type_ati
            },
            {
                    USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID),
                    .driver_info = (unsigned long)&type_ati
            },
            {
                    USB_DEVICE(ATI_REMOTE_VENDOR_ID, NVIDIA_REMOTE_PRODUCT_ID),
                    .driver_info = (unsigned long)&type_ati
            },
            {
                    USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID),
                    .driver_info = (unsigned long)&type_medion
            },
            {
                    USB_DEVICE(ATI_REMOTE_VENDOR_ID, FIREFLY_REMOTE_PRODUCT_ID),
                    .driver_info = (unsigned long)&type_firefly
            },
            {}      /* Terminating entry */
    };
    
    MODULE_DEVICE_TABLE(usb, ati_remote_table);
    
    /* Get hi and low bytes of a 16-bits int */
    #define HI(a)   ((unsigned char)((a) >> 8))
    #define LO(a)   ((unsigned char)((a) & 0xff))
    
    #define SEND_FLAG_IN_PROGRESS   1
    #define SEND_FLAG_COMPLETE      2
    
    /* Device initialization strings */
    static char init1[] = { 0x80, 0x05, 0x1b, 0x15, 0x14, 0x20, 0x24, 0x15 };
    static char init2[] = { 0x83, 0x03 };
    static char init3[] = { 0x84, 0xd7, 0x020 };
    
    
    struct ati_remote {
            struct input_dev *idev;
            struct rc_dev *rdev;
            struct usb_device *udev;
            struct usb_interface *interface;
    
            struct urb *irq_urb;
            struct urb *out_urb;
            struct usb_endpoint_descriptor *endpoint_in;
            struct usb_endpoint_descriptor *endpoint_out;
            unsigned char *inbuf;
            unsigned char *outbuf;
            dma_addr_t inbuf_dma;
            dma_addr_t outbuf_dma;
    
            unsigned char old_data;     /* Detect duplicate events */
            unsigned long old_jiffies;
            unsigned long acc_jiffies;  /* handle acceleration */
            unsigned long first_jiffies;
    
            unsigned int repeat_count;
    
            char rc_name[NAME_BUFSIZE];
            char rc_phys[NAME_BUFSIZE];
            char mouse_name[NAME_BUFSIZE];
            char mouse_phys[NAME_BUFSIZE];
    
            wait_queue_head_t wait;
            int send_flags;
    
            int users; /* 0-2, users are rc and input */
            struct mutex open_mutex;
    };
    
    /* "Kinds" of messages sent from the hardware to the driver. */
    #define KIND_END        0
    #define KIND_LITERAL    1   /* Simply pass to input system */
    #define KIND_FILTERED   2   /* Add artificial key-up events, drop keyrepeats */
    #define KIND_LU         3   /* Directional keypad diagonals - left up, */
    #define KIND_RU         4   /*   right up,  */
    #define KIND_LD         5   /*   left down, */
    #define KIND_RD         6   /*   right down */
    #define KIND_ACCEL      7   /* Directional keypad - left, right, up, down.*/
    
    /* Translation table from hardware messages to input events. */
    static const struct {
            short kind;
            unsigned char data;
            int type;
            unsigned int code;
            int value;
    }  ati_remote_tbl[] = {
            /* Directional control pad axes */
            {KIND_ACCEL,   0x70, EV_REL, REL_X, -1},   /* left */
            {KIND_ACCEL,   0x71, EV_REL, REL_X, 1},    /* right */
            {KIND_ACCEL,   0x72, EV_REL, REL_Y, -1},   /* up */
            {KIND_ACCEL,   0x73, EV_REL, REL_Y, 1},    /* down */
            /* Directional control pad diagonals */
            {KIND_LU,      0x74, EV_REL, 0, 0},        /* left up */
            {KIND_RU,      0x75, EV_REL, 0, 0},        /* right up */
            {KIND_LD,      0x77, EV_REL, 0, 0},        /* left down */
            {KIND_RD,      0x76, EV_REL, 0, 0},        /* right down */
    
            /* "Mouse button" buttons */
            {KIND_LITERAL, 0x78, EV_KEY, BTN_LEFT, 1}, /* left btn down */
            {KIND_LITERAL, 0x79, EV_KEY, BTN_LEFT, 0}, /* left btn up */
            {KIND_LITERAL, 0x7c, EV_KEY, BTN_RIGHT, 1},/* right btn down */
            {KIND_LITERAL, 0x7d, EV_KEY, BTN_RIGHT, 0},/* right btn up */
    
            /* Artificial "doubleclick" events are generated by the hardware.
             * They are mapped to the "side" and "extra" mouse buttons here. */
            {KIND_FILTERED, 0x7a, EV_KEY, BTN_SIDE, 1}, /* left dblclick */
            {KIND_FILTERED, 0x7e, EV_KEY, BTN_EXTRA, 1},/* right dblclick */
    
            /* Non-mouse events are handled by rc-core */
            {KIND_END, 0x00, EV_MAX + 1, 0, 0}
    };
    
    /*
     * ati_remote_dump_input
     */
    static void ati_remote_dump(struct device *dev, unsigned char *data,
                                unsigned int len)
    {
            if (len == 1) {
                    if (data[0] != (unsigned char)0xff && data[0] != 0x00)
                            dev_warn(dev, "Weird byte 0x%02x\n", data[0]);
            } else if (len == 4)
                    dev_warn(dev, "Weird key %*ph\n", 4, data);
            else
                    dev_warn(dev, "Weird data, len=%d %*ph ...\n", len, 6, data);
    }
    
    /*
     * ati_remote_open
     */
    static int ati_remote_open(struct ati_remote *ati_remote)
    {
            int err = 0;
    
            mutex_lock(&ati_remote->open_mutex);
    
            if (ati_remote->users++ != 0)
                    goto out; /* one was already active */
    
            /* On first open, submit the read urb which was set up previously. */
            ati_remote->irq_urb->dev = ati_remote->udev;
            if (usb_submit_urb(ati_remote->irq_urb, GFP_KERNEL)) {
                    dev_err(&ati_remote->interface->dev,
                            "%s: usb_submit_urb failed!\n", __func__);
                    err = -EIO;
            }
    
    out:    mutex_unlock(&ati_remote->open_mutex);
            return err;
    }
    
    /*
     * ati_remote_close
     */
    static void ati_remote_close(struct ati_remote *ati_remote)
    {
            mutex_lock(&ati_remote->open_mutex);
            if (--ati_remote->users == 0)
                    usb_kill_urb(ati_remote->irq_urb);
            mutex_unlock(&ati_remote->open_mutex);
    }
    
    static int ati_remote_input_open(struct input_dev *inputdev)
    {
            struct ati_remote *ati_remote = input_get_drvdata(inputdev);
            return ati_remote_open(ati_remote);
    }
    
    static void ati_remote_input_close(struct input_dev *inputdev)
    {
            struct ati_remote *ati_remote = input_get_drvdata(inputdev);
            ati_remote_close(ati_remote);
    }
    
    static int ati_remote_rc_open(struct rc_dev *rdev)
    {
            struct ati_remote *ati_remote = rdev->priv;
            return ati_remote_open(ati_remote);
    }
    
    static void ati_remote_rc_close(struct rc_dev *rdev)
    {
            struct ati_remote *ati_remote = rdev->priv;
            ati_remote_close(ati_remote);
    }
    
    /*
     * ati_remote_irq_out
     */
    static void ati_remote_irq_out(struct urb *urb)
    {
            struct ati_remote *ati_remote = urb->context;
    
            if (urb->status) {
                    dev_dbg(&ati_remote->interface->dev, "%s: status %d\n",
                            __func__, urb->status);
                    return;
            }
    
            ati_remote->send_flags |= SEND_FLAG_COMPLETE;
            wmb();
            wake_up(&ati_remote->wait);
    }
    
    /*
     * ati_remote_sendpacket
     *
     * Used to send device initialization strings
     */
    static int ati_remote_sendpacket(struct ati_remote *ati_remote, u16 cmd,
            unsigned char *data)
    {
            int retval = 0;
    
            /* Set up out_urb */
            memcpy(ati_remote->out_urb->transfer_buffer + 1, data, LO(cmd));
            ((char *) ati_remote->out_urb->transfer_buffer)[0] = HI(cmd);
    
            ati_remote->out_urb->transfer_buffer_length = LO(cmd) + 1;
            ati_remote->out_urb->dev = ati_remote->udev;
            ati_remote->send_flags = SEND_FLAG_IN_PROGRESS;
    
            retval = usb_submit_urb(ati_remote->out_urb, GFP_ATOMIC);
            if (retval) {
                    dev_dbg(&ati_remote->interface->dev,
                             "sendpacket: usb_submit_urb failed: %d\n", retval);
                    return retval;
            }
    
            wait_event_timeout(ati_remote->wait,
                    ((ati_remote->out_urb->status != -EINPROGRESS) ||
                            (ati_remote->send_flags & SEND_FLAG_COMPLETE)),
                    HZ);
            usb_kill_urb(ati_remote->out_urb);
    
            return retval;
    }
    
    /*
     * ati_remote_compute_accel
     *
     * Implements acceleration curve for directional control pad
     * If elapsed time since last event is > 1/4 second, user "stopped",
     * so reset acceleration. Otherwise, user is probably holding the control
     * pad down, so we increase acceleration, ramping up over two seconds to
     * a maximum speed.
     */
    static int ati_remote_compute_accel(struct ati_remote *ati_remote)
    {
            static const char accel[] = { 1, 2, 4, 6, 9, 13, 20 };
            unsigned long now = jiffies;
            int acc;
    
            if (time_after(now, ati_remote->old_jiffies + msecs_to_jiffies(250))) {
                    acc = 1;
                    ati_remote->acc_jiffies = now;
            }
            else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(125)))
                    acc = accel[0];
            else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(250)))
                    acc = accel[1];
            else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(500)))
                    acc = accel[2];
            else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(1000)))
                    acc = accel[3];
            else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(1500)))
                    acc = accel[4];
            else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(2000)))
                    acc = accel[5];
            else
                    acc = accel[6];
    
            return acc;
    }
    
    /*
     * ati_remote_report_input
     */
    static void ati_remote_input_report(struct urb *urb)
    {
            struct ati_remote *ati_remote = urb->context;
            unsigned char *data= ati_remote->inbuf;
            struct input_dev *dev = ati_remote->idev;
            int index = -1;
            int acc;
            int remote_num;
            unsigned char scancode;
            u32 wheel_keycode = KEY_RESERVED;
            int i;
    
            /*
             * data[0] = 0x14 or 0x15
             * data[1] = data[2] + data[3] + 0xd5 (a checksum byte)
             * data[2] = the key code (with toggle bit in MSB with some models)
             * data[3] = channel << 4 (the low 4 bits must be zero)
             */
    
            /* Deal with strange looking inputs */
            if ( (urb->actual_length != 4) || (data[0] != 0x14 && data[0] != 0x15) ||
                    ((data[3] & 0x0f) != 0x00) ) {
                    ati_remote_dump(&urb->dev->dev, data, urb->actual_length);
                    return;
            }
    
            if (data[1] != ((data[2] + data[3] + 0xd5) & 0xff)) {
                    dbginfo(&ati_remote->interface->dev,
                            "wrong checksum in input: %*ph\n", 4, data);
                    return;
            }
    
            /* Mask unwanted remote channels.  */
            /* note: remote_num is 0-based, channel 1 on remote == 0 here */
            remote_num = (data[3] >> 4) & 0x0f;
            if (channel_mask & (1 << (remote_num + 1))) {
                    dbginfo(&ati_remote->interface->dev,
                            "Masked input from channel 0x%02x: data %02x,%02x, "
                            "mask= 0x%02lx\n",
                            remote_num, data[1], data[2], channel_mask);
                    return;
            }
    
            /*
             * MSB is a toggle code, though only used by some devices
             * (e.g. SnapStream Firefly)
             */
            scancode = data[2] & 0x7f;
    
            dbginfo(&ati_remote->interface->dev,
                    "channel 0x%02x; key data %02x, scancode %02x, channel mask 0x%02lx, remote mask 0x%02x\n",
                    remote_num, data[2], scancode, channel_mask, (data[3] >> 4) & 0x0f);
    
            if (scancode >= 0x70) {
                    /*
                     * This is either a mouse or scrollwheel event, depending on
                     * the remote/keymap.
                     * Get the keycode assigned to scancode 0x78/0x70. If it is
                     * set, assume this is a scrollwheel up/down event.
                     */
                    wheel_keycode = rc_g_keycode_from_table(ati_remote->rdev,
                                                            scancode & 0x78);
    
                    if (wheel_keycode == KEY_RESERVED) {
                            /* scrollwheel was not mapped, assume mouse */
    
                            /* Look up event code index in the mouse translation
                             * table.
                             */
                            for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++) {
                                    if (scancode == ati_remote_tbl[i].data) {
                                            index = i;
                                            break;
                                    }
                            }
                    }
            }
    
            if (index >= 0 && ati_remote_tbl[index].kind == KIND_LITERAL) {
                    input_event(dev, ati_remote_tbl[index].type,
                            ati_remote_tbl[index].code,
                            ati_remote_tbl[index].value);
                    input_sync(dev);
    
                    ati_remote->old_jiffies = jiffies;
                    return;
            }
    
            if (index < 0 || ati_remote_tbl[index].kind == KIND_FILTERED) {
                    unsigned long now = jiffies;
    
                    /* Filter duplicate events which happen "too close" together. */
                    if (ati_remote->old_data == data[2] &&
                        time_before(now, ati_remote->old_jiffies +
                                         msecs_to_jiffies(repeat_filter))) {
                            ati_remote->repeat_count++;
                    } else {
                            ati_remote->repeat_count = 0;
                            ati_remote->first_jiffies = now;
                    }
    
                    ati_remote->old_data = data[2];
                    ati_remote->old_jiffies = now;
    
                    /* Ensure we skip at least the 4 first duplicate events (generated
                     * by a single keypress), and continue skipping until repeat_delay
                     * msecs have passed
                     */
                    if (ati_remote->repeat_count > 0 &&
                        (ati_remote->repeat_count < 5 ||
                         time_before(now, ati_remote->first_jiffies +
                                          msecs_to_jiffies(repeat_delay))))
                            return;
    
                    if (index < 0) {
                            /* Not a mouse event, hand it to rc-core. */
                            int count = 1;
    
                            if (wheel_keycode != KEY_RESERVED) {
                                    /*
                                     * This is a scrollwheel event, send the
                                     * scroll up (0x78) / down (0x70) scancode
                                     * repeatedly as many times as indicated by
                                     * rest of the scancode.
                                     */
                                    count = (scancode & 0x07) + 1;
                                    scancode &= 0x78;
                            }
    
                            while (count--) {
                                    /*
                                    * We don't use the rc-core repeat handling yet as
                                    * it would cause ghost repeats which would be a
                                    * regression for this driver.
                                    */
                                    rc_keydown_notimeout(ati_remote->rdev, scancode,
                                                         data[2]);
                                    rc_keyup(ati_remote->rdev);
                            }
                            return;
                    }
    
                    input_event(dev, ati_remote_tbl[index].type,
                            ati_remote_tbl[index].code, 1);
                    input_sync(dev);
                    input_event(dev, ati_remote_tbl[index].type,
                            ati_remote_tbl[index].code, 0);
                    input_sync(dev);
    
            } else {
    
                    /*
                     * Other event kinds are from the directional control pad, and
                     * have an acceleration factor applied to them.  Without this
                     * acceleration, the control pad is mostly unusable.
                     */
                    acc = ati_remote_compute_accel(ati_remote);
    
                    switch (ati_remote_tbl[index].kind) {
                    case KIND_ACCEL:
                            input_event(dev, ati_remote_tbl[index].type,
                                    ati_remote_tbl[index].code,
                                    ati_remote_tbl[index].value * acc);
                            break;
                    case KIND_LU:
                            input_report_rel(dev, REL_X, -acc);
                            input_report_rel(dev, REL_Y, -acc);
                            break;
                    case KIND_RU:
                            input_report_rel(dev, REL_X, acc);
                            input_report_rel(dev, REL_Y, -acc);
                            break;
                    case KIND_LD:
                            input_report_rel(dev, REL_X, -acc);
                            input_report_rel(dev, REL_Y, acc);
                            break;
                    case KIND_RD:
                            input_report_rel(dev, REL_X, acc);
                            input_report_rel(dev, REL_Y, acc);
                            break;
                    default:
                            dev_dbg(&ati_remote->interface->dev,
                                    "ati_remote kind=%d\n",
                                    ati_remote_tbl[index].kind);
                    }
                    input_sync(dev);
    
                    ati_remote->old_jiffies = jiffies;
                    ati_remote->old_data = data[2];
            }
    }
    
    /*
     * ati_remote_irq_in
     */
    static void ati_remote_irq_in(struct urb *urb)
    {
            struct ati_remote *ati_remote = urb->context;
            int retval;
    
            switch (urb->status) {
            case 0:                 /* success */
                    ati_remote_input_report(urb);
                    break;
            case -ECONNRESET:       /* unlink */
            case -ENOENT:
            case -ESHUTDOWN:
                    dev_dbg(&ati_remote->interface->dev,
                            "%s: urb error status, unlink?\n",
                            __func__);
                    return;
            default:                /* error */
                    dev_dbg(&ati_remote->interface->dev,
                            "%s: Nonzero urb status %d\n",
                            __func__, urb->status);
            }
    
            retval = usb_submit_urb(urb, GFP_ATOMIC);
            if (retval)
                    dev_err(&ati_remote->interface->dev,
                            "%s: usb_submit_urb()=%d\n",
                            __func__, retval);
    }
    
    /*
     * ati_remote_alloc_buffers
     */
    static int ati_remote_alloc_buffers(struct usb_device *udev,
                                        struct ati_remote *ati_remote)
    {
            ati_remote->inbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
                                                   &ati_remote->inbuf_dma);
            if (!ati_remote->inbuf)
                    return -1;
    
            ati_remote->outbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC,
                                                    &ati_remote->outbuf_dma);
            if (!ati_remote->outbuf)
                    return -1;
    
            ati_remote->irq_urb = usb_alloc_urb(0, GFP_KERNEL);
            if (!ati_remote->irq_urb)
                    return -1;
    
            ati_remote->out_urb = usb_alloc_urb(0, GFP_KERNEL);
            if (!ati_remote->out_urb)
                    return -1;
    
            return 0;
    }
    
    /*
     * ati_remote_free_buffers
     */
    static void ati_remote_free_buffers(struct ati_remote *ati_remote)
    {
            usb_free_urb(ati_remote->irq_urb);
            usb_free_urb(ati_remote->out_urb);
    
            usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
                    ati_remote->inbuf, ati_remote->inbuf_dma);
    
            usb_free_coherent(ati_remote->udev, DATA_BUFSIZE,
                    ati_remote->outbuf, ati_remote->outbuf_dma);
    }
    
    static void ati_remote_input_init(struct ati_remote *ati_remote)
    {
            struct input_dev *idev = ati_remote->idev;
            int i;
    
            idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
            idev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) |
                    BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA);
            idev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
            for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++)
                    if (ati_remote_tbl[i].type == EV_KEY)
                            set_bit(ati_remote_tbl[i].code, idev->keybit);
    
            input_set_drvdata(idev, ati_remote);
    
            idev->open = ati_remote_input_open;
            idev->close = ati_remote_input_close;
    
            idev->name = ati_remote->mouse_name;
            idev->phys = ati_remote->mouse_phys;
    
            usb_to_input_id(ati_remote->udev, &idev->id);
            idev->dev.parent = &ati_remote->interface->dev;
    }
    
    static void ati_remote_rc_init(struct ati_remote *ati_remote)
    {
            struct rc_dev *rdev = ati_remote->rdev;
    
            rdev->priv = ati_remote;
            rdev->driver_type = RC_DRIVER_SCANCODE;
            rdev->allowed_protos = RC_BIT_OTHER;
            rdev->driver_name = "ati_remote";
    
            rdev->open = ati_remote_rc_open;
            rdev->close = ati_remote_rc_close;
    
            rdev->input_name = ati_remote->rc_name;
            rdev->input_phys = ati_remote->rc_phys;
    
            usb_to_input_id(ati_remote->udev, &rdev->input_id);
            rdev->dev.parent = &ati_remote->interface->dev;
    }
    
    static int ati_remote_initialize(struct ati_remote *ati_remote)
    {
            struct usb_device *udev = ati_remote->udev;
            int pipe, maxp;
    
            init_waitqueue_head(&ati_remote->wait);
    
            /* Set up irq_urb */
            pipe = usb_rcvintpipe(udev, ati_remote->endpoint_in->bEndpointAddress);
            maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
            maxp = (maxp > DATA_BUFSIZE) ? DATA_BUFSIZE : maxp;
    
            usb_fill_int_urb(ati_remote->irq_urb, udev, pipe, ati_remote->inbuf,
                             maxp, ati_remote_irq_in, ati_remote,
                             ati_remote->endpoint_in->bInterval);
            ati_remote->irq_urb->transfer_dma = ati_remote->inbuf_dma;
            ati_remote->irq_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
    
            /* Set up out_urb */
            pipe = usb_sndintpipe(udev, ati_remote->endpoint_out->bEndpointAddress);
            maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
            maxp = (maxp > DATA_BUFSIZE) ? DATA_BUFSIZE : maxp;
    
            usb_fill_int_urb(ati_remote->out_urb, udev, pipe, ati_remote->outbuf,
                             maxp, ati_remote_irq_out, ati_remote,
                             ati_remote->endpoint_out->bInterval);
            ati_remote->out_urb->transfer_dma = ati_remote->outbuf_dma;
            ati_remote->out_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
    
            /* send initialization strings */
            if ((ati_remote_sendpacket(ati_remote, 0x8008, init1)) ||
                (ati_remote_sendpacket(ati_remote, 0x8002, init2)) ||
                (ati_remote_sendpacket(ati_remote, 0x8003, init3))) {
                    dev_err(&ati_remote->interface->dev,
                             "Initializing ati_remote hardware failed.\n");
                    return -EIO;
            }
    
            return 0;
    }
    
    /*
     * ati_remote_probe
     */
    static int ati_remote_probe(struct usb_interface *interface,
            const struct usb_device_id *id)
    {
            struct usb_device *udev = interface_to_usbdev(interface);
            struct usb_host_interface *iface_host = interface->cur_altsetting;
            struct usb_endpoint_descriptor *endpoint_in, *endpoint_out;
            struct ati_receiver_type *type = (struct ati_receiver_type *)id->driver_info;
            struct ati_remote *ati_remote;
            struct input_dev *input_dev;
            struct rc_dev *rc_dev;
            int err = -ENOMEM;
    
            if (iface_host->desc.bNumEndpoints != 2) {
                    err("%s: Unexpected desc.bNumEndpoints\n", __func__);
                    return -ENODEV;
            }
    
            endpoint_in = &iface_host->endpoint[0].desc;
            endpoint_out = &iface_host->endpoint[1].desc;
    
            if (!usb_endpoint_is_int_in(endpoint_in)) {
                    err("%s: Unexpected endpoint_in\n", __func__);
                    return -ENODEV;
            }
            if (le16_to_cpu(endpoint_in->wMaxPacketSize) == 0) {
                    err("%s: endpoint_in message size==0? \n", __func__);
                    return -ENODEV;
            }
    
            ati_remote = kzalloc(sizeof (struct ati_remote), GFP_KERNEL);
            rc_dev = rc_allocate_device();
            if (!ati_remote || !rc_dev)
                    goto fail1;
    
            /* Allocate URB buffers, URBs */
            if (ati_remote_alloc_buffers(udev, ati_remote))
                    goto fail2;
    
            ati_remote->endpoint_in = endpoint_in;
            ati_remote->endpoint_out = endpoint_out;
            ati_remote->udev = udev;
            ati_remote->rdev = rc_dev;
            ati_remote->interface = interface;
    
            usb_make_path(udev, ati_remote->rc_phys, sizeof(ati_remote->rc_phys));
            strlcpy(ati_remote->mouse_phys, ati_remote->rc_phys,
                    sizeof(ati_remote->mouse_phys));
    
            strlcat(ati_remote->rc_phys, "/input0", sizeof(ati_remote->rc_phys));
            strlcat(ati_remote->mouse_phys, "/input1", sizeof(ati_remote->mouse_phys));
    
            if (udev->manufacturer)
                    strlcpy(ati_remote->rc_name, udev->manufacturer,
                            sizeof(ati_remote->rc_name));
    
            if (udev->product)
                    snprintf(ati_remote->rc_name, sizeof(ati_remote->rc_name),
                             "%s %s", ati_remote->rc_name, udev->product);
    
            if (!strlen(ati_remote->rc_name))
                    snprintf(ati_remote->rc_name, sizeof(ati_remote->rc_name),
                            DRIVER_DESC "(%04x,%04x)",
                            le16_to_cpu(ati_remote->udev->descriptor.idVendor),
                            le16_to_cpu(ati_remote->udev->descriptor.idProduct));
    
            snprintf(ati_remote->mouse_name, sizeof(ati_remote->mouse_name),
                     "%s mouse", ati_remote->rc_name);
    
            rc_dev->map_name = RC_MAP_ATI_X10; /* default map */
    
            /* set default keymap according to receiver model */
            if (type) {
                    if (type->default_keymap)
                            rc_dev->map_name = type->default_keymap;
                    else if (type->get_default_keymap)
                            rc_dev->map_name = type->get_default_keymap(interface);
            }
    
            ati_remote_rc_init(ati_remote);
            mutex_init(&ati_remote->open_mutex);
    
            /* Device Hardware Initialization - fills in ati_remote->idev from udev. */
            err = ati_remote_initialize(ati_remote);
            if (err)
                    goto fail3;
    
            /* Set up and register rc device */
            err = rc_register_device(ati_remote->rdev);
            if (err)
                    goto fail3;
    
            /* use our delay for rc_dev */
            ati_remote->rdev->input_dev->rep[REP_DELAY] = repeat_delay;
    
            /* Set up and register mouse input device */
            if (mouse) {
                    input_dev = input_allocate_device();
                    if (!input_dev) {
                            err = -ENOMEM;
                            goto fail4;
                    }
    
                    ati_remote->idev = input_dev;
                    ati_remote_input_init(ati_remote);
                    err = input_register_device(input_dev);
    
                    if (err)
                            goto fail5;
            }
    
            usb_set_intfdata(interface, ati_remote);
            return 0;
    
     fail5: input_free_device(input_dev);
     fail4: rc_unregister_device(rc_dev);
            rc_dev = NULL;
     fail3: usb_kill_urb(ati_remote->irq_urb);
            usb_kill_urb(ati_remote->out_urb);
     fail2: ati_remote_free_buffers(ati_remote);
     fail1: rc_free_device(rc_dev);
            kfree(ati_remote);
            return err;
    }
    
    /*
     * ati_remote_disconnect
     */
    static void ati_remote_disconnect(struct usb_interface *interface)
    {
            struct ati_remote *ati_remote;
    
            ati_remote = usb_get_intfdata(interface);
            usb_set_intfdata(interface, NULL);
            if (!ati_remote) {
                    dev_warn(&interface->dev, "%s - null device?\n", __func__);
                    return;
            }
    
            usb_kill_urb(ati_remote->irq_urb);
            usb_kill_urb(ati_remote->out_urb);
            if (ati_remote->idev)
                    input_unregister_device(ati_remote->idev);
            rc_unregister_device(ati_remote->rdev);
            ati_remote_free_buffers(ati_remote);
            kfree(ati_remote);
    }
    
    /* usb specific object to register with the usb subsystem */
    static struct usb_driver ati_remote_driver = {
            .name         = "ati_remote",
            .probe        = ati_remote_probe,
            .disconnect   = ati_remote_disconnect,
            .id_table     = ati_remote_table,
    };
    
    module_usb_driver(ati_remote_driver);
    
    MODULE_AUTHOR(DRIVER_AUTHOR);
    MODULE_DESCRIPTION(DRIVER_DESC);
    MODULE_LICENSE("GPL");

Here is the jist of the problem and all the technical details.
Code:
# terminal window 1
# modprobe usbmon
# cd /sys/kernel/debug/usb/usbmon
# lsusb
...
Bus 004 Device 008: ID 0bc7:0004 X10 Wireless Technology, Inc. X10 Receiver
...
# rmmod ati_remote
# modprobe ati_remote

# terminal window 2
# grep --line-buffered '4:008' 4u
ffff88018a00d3c0 1361036384 C Ii:4:008:1 -108:8 0
ffff88018a00d240 1385420709 S Io:4:008:2 -115:8 5 = 80010020 14
ffff88018a00d240 1385424393 C Io:4:008:2 0:8 5 >
ffff88018a00d240 1385424401 S Io:4:008:2 -115:8 8 = 80010020 14202020
ffff88018a00d240 1385432392 C Io:4:008:2 0:8 8 >
ffff88018a00da80 1385432519 S Ii:4:008:1 -115:8 8 <
ffff88018a00da80 1385440394 C Ii:4:008:1 0:8 1 = ff
ffff88018a00da80 1385440399 S Ii:4:008:1 -115:8 8 <
ffff88018a00da80 1415136406 C Ii:4:008:1 0:8 4 = 14658010
ffff88018a00da80 1415136432 S Ii:4:008:1 -115:8 8 <
ffff88018a00da80 1415176406 C Ii:4:008:1 0:8 4 = 14658010
ffff88018a00da80 1415176413 S Ii:4:008:1 -115:8 8 <
ffff88018a00da80 1415216405 C Ii:4:008:1 0:8 4 = 14658010
ffff88018a00da80 1415216411 S Ii:4:008:1 -115:8 8 <
ffff88018a00da80 1415256404 C Ii:4:008:1 0:8 4 = 14658010
ffff88018a00da80 1415256410 S Ii:4:008:1 -115:8 8 <
ffff88018a00da80 1415296405 C Ii:4:008:1 0:8 4 = 14658010
ffff88018a00da80 1415296412 S Ii:4:008:1 -115:8 8 <
ffff88018a00da80 1415336404 C Ii:4:008:1 0:8 4 = 14658010
ffff88018a00da80 1415336410 S Ii:4:008:1 -115:8 8 <
============================== CUT HERE ==============================

We log USB data for the RF receiver in window 2.

In window 1 we enable USB monitoring and unload and reload the ati_remote
module.

We can see the 2 initialization strings being sent to the RF receiver via the
interrupt out (Io) lines
and then when we press the Firefly key on the FF remote we see the repeated USB
packets sent by the RF remote (14658010).

However when we press any keys on the ATI remote no data is logged by usbmon.

This indicates that the RF receiver is ignoring data sent by the ATI remote
when initialized by the ati_remote modules.

However when we load the modified version of the ati_remote module we see:

============================== CUT HERE ==============================
# rmmod ati_remote
# insmod ./ati_remote_plus.ko
# grep --line-buffered '4:008' 4u
ffff88018a00da80 2183228699 C Ii:4:008:1 -108:8 0
ffff880181305a80 2197203596 S Io:4:008:2 -115:8 9 = 8080051b 15142024 15
ffff880181305a80 2197216703 C Io:4:008:2 0:8 9 >
ffff880181305a80 2197216761 S Io:4:008:2 -115:8 3 = 808303
ffff880181305a80 2197224702 C Io:4:008:2 0:8 3 >
ffff880181305a80 2197224714 S Io:4:008:2 -115:8 4 = 8084d720
ffff880181305a80 2197232701 C Io:4:008:2 0:8 4 >
ffff8801813050c0 2197232835 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2197240704 C Ii:4:008:1 0:8 1 = 00
ffff8801813050c0 2197240711 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2219904713 C Ii:4:008:1 0:8 4 = 14658010
ffff8801813050c0 2219904740 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2219944712 C Ii:4:008:1 0:8 4 = 14658010
ffff8801813050c0 2219944720 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2219984712 C Ii:4:008:1 0:8 4 = 14658010
ffff8801813050c0 2219984718 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2220024715 C Ii:4:008:1 0:8 4 = 14658010
ffff8801813050c0 2220024722 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2220064715 C Ii:4:008:1 0:8 4 = 14658010
ffff8801813050c0 2220064721 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2221952713 C Ii:4:008:1 0:8 4 = 15222d20
ffff8801813050c0 2221952740 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2221992712 C Ii:4:008:1 0:8 4 = 15222d20
ffff8801813050c0 2221992720 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2222032713 C Ii:4:008:1 0:8 4 = 15222d20
ffff8801813050c0 2222032720 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2222072715 C Ii:4:008:1 0:8 4 = 15222d20
ffff8801813050c0 2222072721 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2222120710 C Ii:4:008:1 0:8 4 = 15222d20
ffff8801813050c0 2222120716 S Ii:4:008:1 -115:8 8 <
ffff8801813050c0 2222160714 C Ii:4:008:1 0:8 4 = 15222d20
ffff8801813050c0 2222160720 S Ii:4:008:1 -115:8 8 <
============================== CUT HERE ==============================

Here we can see the modified initialization sequence being sent to the RF
remote and when we press the Firefly key on the FF remote we see the repeated
USB packets sent by the FF remote (14658010)
and when we press the ATI key on the ATI remote we see the repeated USB packets
sent by the ATI remote (15222d20).

The conclusion is that the RF receiver initialization must be changed in the
ati_remote module in order to support the ATI remote.


So what needs to happen is the ati_remote module needs to be updated. Now I have found how to recompile the kernel 2.6 module but I would like to find a way to do this for the latest kernel.

Please see the link below. I am not a linux guru and do not know how to get this to work for a more recent kernel. So I am hoping someone here maybe able to help with this. There are quite a few people out there with the remote wonder plus who would like to use it outside of windows. I currently have a windows xbmc install just to use this remote. Help me get off windows and use my remote with linux.

Here is the link to a thread where a guy got his remote wonder plus to work in linux. I am not able to do what he did and also have a newer version of linux, However I may consider getting an older version if that's the only way to do this.

translate.google.com/translate?hl=en&sl=...w%3D1426%26bih%3D662

Here is the translation below..
[quote]
If like me you have an ATI Remote Wonder in his "plus" version, you could not make it work properly with the "ati_remote" basic module.

So I'll explain in this tutorial how settled and set!

(I realize this tutorial Ubuntu 12.04.4-3.11.0-18-generic)

Started by connecting the receiver and then ATI typing this command:

Code:

lsusb


That should be displayed

Code:

0bc7: 0004 X10 Wireless Technology, Inc. X10 Receiver


The receiver and therefore well detected by Linux!

1 Module Creation and autoloading

We'll have to compile a new module containing the bases "ati_remote" but integrating our new remote.

To begin creating a folder "atiplus" or you want:

Code:

sudo mkdir atiplus


Returned to the folder with:

Code:

cd / atiplus


Then creates a new file in which you copied the source code of the new module:

Code:

sudo gedit ati_remote_plus.c


Link the source code for the new modules: pastebin.com/eP1wiGtT

(The source code for the new module from this source: www.spinics.net/lists/linux-input/msg28006.html )

I purposely changed the new source code to disable the "mouse" on the remote control that generated "freeze" at rehearsals!

Then you need to create a final "Makefile" file:

Code:

sudo gedit Makefile


We copy in there:

Code:

obj-m: = ati_remote_plus.o
KDIR: = / lib / modules / $ (shell uname r) / build
PWD: = $ (shell pwd)

all:
$ (MAKE) $ C (KDIR) M = $ (PWD) modules

clean:
$ (MAKE) $ C (KDIR) M = $ (PWD) clean


Is saved and you type:

Code:

make


Now that the module and compiled, we will have the loaded at startup.

We start by creating a folder to receive the module:

Code:

sudo mkdir p / lib / modules / $ (uname r) / kernel / drivers / ati_remote_plus


The module is copied to the folder:

Code:

ati_remote_plus.ko cp / lib / modules / $ (uname r) / kernel / drivers / ati_remote_plus /


Then we will edit the "modules" file that launches the modules ... niark niark :

Code:

sudo gedit / etc / modules


Then you add in the wake of the modules:

Code:

ati_remote_plus


We update the list of modules:

Code:

sudo depmod


Last steps to prevent the loading of the module ati_remote "basic".

We'll have to add the module to the blacklist, so you edit this file:

Code:

sudo gedit /etc/modprobe.d/blacklist.conf


Add all at the top of the list:
Code:

# Replaced by ati_remote_plus
ati_remote blacklist


From there you can restart the computer, start the "ati_remote" module will not be loaded and the module "ati_remote_plus" we have compiled shortly before the replacement.

2-detection and configuration of the remote

We'll installed ir-keytable to test and set our remote:

Code:

sudo apt-get install ir-keytable


Once finished installing type:

Code:

ir-keytable


You should see a few details this:

Code:

Found / sys / class / rc / rc0 / (/ dev / input / event3) with:
Driver ati_remote, table rc-ati-x10
Supported protocols: other
Enabled protocols:
Extra capabilities: <access denied>


ir-keytable does detect our remote!

To test the remote control type:

Code:

keytable ir-t d / dev / input / event3

[Color = red

Warning replace your well !! input [/ color]

Press the buttons you should see entries appear this way:

Code:

1396193942.353173: event key down: KEY_3 (0x0004)
1396193942.353173: event sync
1396193942.353186: event key up: KEY_3 (0x0004)
1396193942.353186: event sync


We will now configure the buttons.

To do this we will create two configuration files:

Code:

sudo gedit / lib / udev / rc_keymaps / ati_x10


Copy / paste:

Code:

# Table ati_x10 type: OTHER
0x000A KEY_MUTE
0x0025 KEY_PLAY
0x0029 KEY_PAUSE
0x0028 KEY_STOP
0x001d KEY_LEFT
0x001F KEY_RIGHT
0x001a KEY_UP
0x0022 KEY_DOWN
0x001E KEY_KPENTER
0x0021 KEY_BACK
0x001b KEY_I


Code:

sudo gedit / etc / rc_keymaps / ati_x10


You copy into it the same as in the previous file!

These are but settings but you can safely change the assignments as you like!

Finally we will ensure that our config file is automatically loaded:

Code:

sudo gedit /etc/rc_maps.cfg


Copy it in the front line:

Code:

* Rc-ati-x10 / lib / udev / rc_keymaps / ati_x10


Just above:
Code:

* Rc-twinhan1027 / lib / udev / rc_keymaps / twinhan_vp1027_dvbs


Voila! it's over! Direction the couch to enjoy :)
Now I am not a linux guru and have never patched a kernel but could this work in XBMCbuntu or openelec?

THANK for reading..
ANYONEHuh
Bum-pity bump... ANYONE??
Bump city? Someone wanna take a look. I've provided the solution just don't know how to do it with the latest kernel...
Buy a remote and receiver that works without compiling kernel modules?
(2014-09-17, 05:31)teeedubb Wrote: [ -> ]Buy a remote and receiver that works without compiling kernel modules?

I agree. The DirecTV remotes are excellent and they almost give them away ($5)

Find a standard receiver and be up and running in minuets with my preconfigured files.

DirecTV Remote on XBMC

Image
I appreciate both of your comments and dissing my use of a great x10 remote. Even if I did get a direct TV remote I would need to get a IR receiver for that remote and then my x10 would just go in the trash heap adding to the environmental impact I am already having on this planet that I try so hard to diminish. Read the story of stuff to understand where I am coming from in regards to that.

So with that in mind..

My x10 remote will work from 60 ft away and even through walls because it is RF & not IR. I have provided the solution to making my remote work and all I need is someone who is willing to take a look at how to make it work with the current linux kernel. Compiling this code is not something I have done before and making it work on an even newer kernel is far from my skill set. However I am willing to try it if someone can just help me figure out how to do it. The other 2 ATI remote wonders work with the current kernel driver but this ones commands are ignored and its simply because of some missing code in the kernel driver.

I know someone is skilled enough to solve this issue for the 100's of users with the RW+. This is just a single post but there are many regarding the RW+. All with people who would like to see it work in linux without any luck, but the answer is here and its not impossible to fix just takes someone more technical then the 100's of newbie linux users I've talked to.
Well what errors are you getting during the process?
edit delete bump
Thanks Teeeedubb.. Well the solution was last used on kernel 2.6.20. I am trying it on 3.14.11. So I get errors when I try to use it, last I tried. Ill have to try to do it again to log the errors.

What I would like to know is if its even going to work and if changes need to be made to the code to update it for kernel 3.14.11?

Are you able to look at the code and tell me what changes need to be made or what could be causing the issues with it working with 3.14?
Isn't this a kernel issue? Perhaps you need LKML.
digging around in kernel code is not for the faint hearted. Not likely you'll find someone here that does have to same remote, wants to make it work, AND has the skills to help you. Even if the patch is adapted to apply and compile, doesn't mean it will work without issues.
This guy? http://www.x10.com/ir19a.html

Looks pretty awesome, actually.
(2014-09-25, 18:57)drivesoslow Wrote: [ -> ]You could try this patch for 3.1

http://lxr.free-electrons.com/source/dri...te.c?v=3.1

Thanks, that's the same code that I included above. @ned scott That x10 remote is pretty cool, prob be the same problem as mine wont work with XBMC.

The code I included above the stuff from Torrey Hoffman was apparently already included in the kernel driver to make the remote wonder 1 & 2 work and the patch that I'm referring to is a recompile which uses around 70% of that code to include the remote wonder plus as it communicates with different codes that are not understood by the ati_remote driver. The patch I found, was used last in linux 2.6.20 and I need it to be adapted to work with 3.11 and hopefully to work in openelec.

Here is the patch to fix. This is included above but you have to scroll through to read it. Sorry I did not make that to clear. This is what I need adapted?

Hope one of you guys can help. Thanks for READING.. You guys rule...

Code:
If like me you have an ATI Remote Wonder in his "plus" version, you could not make it work properly with the "ati_remote" basic module.

So I'll explain in this tutorial how settled and set!

(I realize this tutorial Ubuntu 12.04.4-3.11.0-18-generic)

Started by connecting the receiver and then ATI typing this command:

Code:

lsusb


That should be displayed

Code:

0bc7: 0004 X10 Wireless Technology, Inc. X10 Receiver


The receiver and therefore well detected by Linux!

1 Module Creation and autoloading

We'll have to compile a new module containing the bases "ati_remote" but integrating our new remote.

To begin creating a folder "atiplus" or you want:

Code:

sudo mkdir atiplus


Returned to the folder with:

Code:

cd / atiplus


Then creates a new file in which you copied the source code of the new module:

Code:

sudo gedit ati_remote_plus.c


Link the source code for the new modules: pastebin.com/eP1wiGtT

(The source code for the new module from this source: www.spinics.net/lists/linux-input/msg28006.html )

I purposely changed the new source code to disable the "mouse" on the remote control that generated "freeze" at rehearsals!

Then you need to create a final "Makefile" file:

Code:

sudo gedit Makefile


We copy in there:

Code:

obj-m: = ati_remote_plus.o
KDIR: = / lib / modules / $ (shell uname r) / build
PWD: = $ (shell pwd)

all:
$ (MAKE) $ C (KDIR) M = $ (PWD) modules

clean:
$ (MAKE) $ C (KDIR) M = $ (PWD) clean


Is saved and you type:

Code:

make


Now that the module and compiled, we will have the loaded at startup.

We start by creating a folder to receive the module:

Code:

sudo mkdir p / lib / modules / $ (uname r) / kernel / drivers / ati_remote_plus


The module is copied to the folder:

Code:

ati_remote_plus.ko cp / lib / modules / $ (uname r) / kernel / drivers / ati_remote_plus /


Then we will edit the "modules" file that launches the modules ... niark niark :

Code:

sudo gedit / etc / modules


Then you add in the wake of the modules:

Code:

ati_remote_plus


We update the list of modules:

Code:

sudo depmod


Last steps to prevent the loading of the module ati_remote "basic".

We'll have to add the module to the blacklist, so you edit this file:

Code:

sudo gedit /etc/modprobe.d/blacklist.conf


Add all at the top of the list:
Code:

# Replaced by ati_remote_plus
ati_remote blacklist


From there you can restart the computer, start the "ati_remote" module will not be loaded and the module "ati_remote_plus" we have compiled shortly before the replacement.

2-detection and configuration of the remote

We'll installed ir-keytable to test and set our remote:

Code:

sudo apt-get install ir-keytable


Once finished installing type:

Code:

ir-keytable


You should see a few details this:

Code:

Found / sys / class / rc / rc0 / (/ dev / input / event3) with:
Driver ati_remote, table rc-ati-x10
Supported protocols: other
Enabled protocols:
Extra capabilities: <access denied>


ir-keytable does detect our remote!

To test the remote control type:

Code:

keytable ir-t d / dev / input / event3

[Color = red

Warning replace your well !! input [/ color]

Press the buttons you should see entries appear this way:

Code:

1396193942.353173: event key down: KEY_3 (0x0004)
1396193942.353173: event sync
1396193942.353186: event key up: KEY_3 (0x0004)
1396193942.353186: event sync


We will now configure the buttons.

To do this we will create two configuration files:

Code:

sudo gedit / lib / udev / rc_keymaps / ati_x10


Copy / paste:

Code:

# Table ati_x10 type: OTHER
0x000A KEY_MUTE
0x0025 KEY_PLAY
0x0029 KEY_PAUSE
0x0028 KEY_STOP
0x001d KEY_LEFT
0x001F KEY_RIGHT
0x001a KEY_UP
0x0022 KEY_DOWN
0x001E KEY_KPENTER
0x0021 KEY_BACK
0x001b KEY_I


Code:

sudo gedit / etc / rc_keymaps / ati_x10


You copy into it the same as in the previous file!

These are but settings but you can safely change the assignments as you like!

Finally we will ensure that our config file is automatically loaded:

Code:

sudo gedit /etc/rc_maps.cfg


Copy it in the front line:

Code:

* Rc-ati-x10 / lib / udev / rc_keymaps / ati_x10


Just above:
Code:

* Rc-twinhan1027 / lib / udev / rc_keymaps / twinhan_vp1027_dvbs


Voila! it's over!
Pages: 1 2 3