]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/media/rc/ir-sony-decoder.c
Merge branch 'master' into tk71
[mv-sheeva.git] / drivers / media / rc / ir-sony-decoder.c
similarity index 90%
rename from drivers/media/IR/ir-sony-decoder.c
rename to drivers/media/rc/ir-sony-decoder.c
index b9074f07c7a0570293e46eebb8981900da862035..a92de80c48db7b4e48b64fead5353a7a9eed6083 100644 (file)
@@ -13,7 +13,7 @@
  */
 
 #include <linux/bitrev.h>
-#include "ir-core-priv.h"
+#include "rc-core-priv.h"
 
 #define SONY_UNIT              600000 /* ns */
 #define SONY_HEADER_PULSE      (4 * SONY_UNIT)
@@ -33,23 +33,23 @@ enum sony_state {
 
 /**
  * ir_sony_decode() - Decode one Sony pulse or space
- * @input_dev: the struct input_dev descriptor of the device
+ * @dev:       the struct rc_dev descriptor of the device
  * @ev:         the struct ir_raw_event descriptor of the pulse/space
  *
  * This function returns -EINVAL if the pulse violates the state machine
  */
-static int ir_sony_decode(struct input_dev *input_dev, struct ir_raw_event ev)
+static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
 {
-       struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
-       struct sony_dec *data = &ir_dev->raw->sony;
+       struct sony_dec *data = &dev->raw->sony;
        u32 scancode;
        u8 device, subdevice, function;
 
-       if (!(ir_dev->raw->enabled_protocols & IR_TYPE_SONY))
+       if (!(dev->raw->enabled_protocols & RC_TYPE_SONY))
                return 0;
 
-       if (IS_RESET(ev)) {
-               data->state = STATE_INACTIVE;
+       if (!is_timing_event(ev)) {
+               if (ev.reset)
+                       data->state = STATE_INACTIVE;
                return 0;
        }
 
@@ -143,7 +143,7 @@ static int ir_sony_decode(struct input_dev *input_dev, struct ir_raw_event ev)
 
                scancode = device << 16 | subdevice << 8 | function;
                IR_dprintk(1, "Sony(%u) scancode 0x%05x\n", data->count, scancode);
-               ir_keydown(input_dev, scancode, 0);
+               rc_keydown(dev, scancode, 0);
                data->state = STATE_INACTIVE;
                return 0;
        }
@@ -156,7 +156,7 @@ out:
 }
 
 static struct ir_raw_handler sony_handler = {
-       .protocols      = IR_TYPE_SONY,
+       .protocols      = RC_TYPE_SONY,
        .decode         = ir_sony_decode,
 };