[media] rc: img-ir: pass toggle bit to the rc driver
authorSifan Naeem <sifan.naeem@imgtec.com>
Thu, 11 Dec 2014 20:06:23 +0000 (17:06 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 23 Dec 2014 17:12:57 +0000 (15:12 -0200)
Add toggle bit to struct img_ir_scancode_req so that protocols can
provide it to img_ir_handle_data(), and pass that toggle bit up to
rc_keydown instead of 0.

This is needed for the upcoming rc-5 and rc-6 patches.

Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/rc/img-ir/img-ir-hw.c
drivers/media/rc/img-ir/img-ir-hw.h

index 88fada5dd23892ed2619b2a661b6e1642de9646a..9cecda73f98064ce24738c08731569ee9c95ea1b 100644 (file)
@@ -809,6 +809,7 @@ static void img_ir_handle_data(struct img_ir_priv *priv, u32 len, u64 raw)
        struct img_ir_scancode_req request;
 
        request.protocol = RC_TYPE_UNKNOWN;
+       request.toggle   = 0;
 
        if (dec->scancode)
                ret = dec->scancode(len, raw, hw->enabled_protocols, &request);
@@ -819,9 +820,10 @@ static void img_ir_handle_data(struct img_ir_priv *priv, u32 len, u64 raw)
        dev_dbg(priv->dev, "data (%u bits) = %#llx\n",
                len, (unsigned long long)raw);
        if (ret == IMG_IR_SCANCODE) {
-               dev_dbg(priv->dev, "decoded scan code %#x\n",
-                       request.scancode);
-               rc_keydown(hw->rdev, request.protocol, request.scancode, 0);
+               dev_dbg(priv->dev, "decoded scan code %#x, toggle %u\n",
+                       request.scancode, request.toggle);
+               rc_keydown(hw->rdev, request.protocol, request.scancode,
+                          request.toggle);
                img_ir_end_repeat(priv);
        } else if (ret == IMG_IR_REPEATCODE) {
                if (hw->mode == IMG_IR_M_REPEATING) {
index aeef3d1dd30d585a2ba1cb2c571e5fbbe5416d01..beac3a6c4660e53cde54b0b173828ca07210d7bf 100644 (file)
@@ -138,10 +138,12 @@ struct img_ir_timing_regvals {
  *             RC_TYPE_UNKNOWN).
  * @scancode:  Scan code of received message (must be written by
  *             handler if IMG_IR_SCANCODE is returned).
+ * @toggle:    Toggle bit (defaults to 0).
  */
 struct img_ir_scancode_req {
        enum rc_type protocol;
        u32 scancode;
+       u8 toggle;
 };
 
 /**
This page took 0.025785 seconds and 5 git commands to generate.