aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorSifan Naeem <sifan.naeem@imgtec.com>2014-12-11 15:06:23 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-12-23 12:12:57 -0500
commit33e01833268d2f006e599b863a21d4e219f96bd7 (patch)
tree28c47f3ec8522ecff1867c25007ebae8e3c6e4df /drivers/media/rc
parentab93ce06eef556cc85a016e12ff7c7a763f04c91 (diff)
[media] rc: img-ir: pass toggle bit to the rc driver
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>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/img-ir/img-ir-hw.c8
-rw-r--r--drivers/media/rc/img-ir/img-ir-hw.h2
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/rc/img-ir/img-ir-hw.c b/drivers/media/rc/img-ir/img-ir-hw.c
index 88fada5dd238..9cecda73f980 100644
--- a/drivers/media/rc/img-ir/img-ir-hw.c
+++ b/drivers/media/rc/img-ir/img-ir-hw.c
@@ -809,6 +809,7 @@ static void img_ir_handle_data(struct img_ir_priv *priv, u32 len, u64 raw)
809 struct img_ir_scancode_req request; 809 struct img_ir_scancode_req request;
810 810
811 request.protocol = RC_TYPE_UNKNOWN; 811 request.protocol = RC_TYPE_UNKNOWN;
812 request.toggle = 0;
812 813
813 if (dec->scancode) 814 if (dec->scancode)
814 ret = dec->scancode(len, raw, hw->enabled_protocols, &request); 815 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)
819 dev_dbg(priv->dev, "data (%u bits) = %#llx\n", 820 dev_dbg(priv->dev, "data (%u bits) = %#llx\n",
820 len, (unsigned long long)raw); 821 len, (unsigned long long)raw);
821 if (ret == IMG_IR_SCANCODE) { 822 if (ret == IMG_IR_SCANCODE) {
822 dev_dbg(priv->dev, "decoded scan code %#x\n", 823 dev_dbg(priv->dev, "decoded scan code %#x, toggle %u\n",
823 request.scancode); 824 request.scancode, request.toggle);
824 rc_keydown(hw->rdev, request.protocol, request.scancode, 0); 825 rc_keydown(hw->rdev, request.protocol, request.scancode,
826 request.toggle);
825 img_ir_end_repeat(priv); 827 img_ir_end_repeat(priv);
826 } else if (ret == IMG_IR_REPEATCODE) { 828 } else if (ret == IMG_IR_REPEATCODE) {
827 if (hw->mode == IMG_IR_M_REPEATING) { 829 if (hw->mode == IMG_IR_M_REPEATING) {
diff --git a/drivers/media/rc/img-ir/img-ir-hw.h b/drivers/media/rc/img-ir/img-ir-hw.h
index aeef3d1dd30d..beac3a6c4660 100644
--- a/drivers/media/rc/img-ir/img-ir-hw.h
+++ b/drivers/media/rc/img-ir/img-ir-hw.h
@@ -138,10 +138,12 @@ struct img_ir_timing_regvals {
138 * RC_TYPE_UNKNOWN). 138 * RC_TYPE_UNKNOWN).
139 * @scancode: Scan code of received message (must be written by 139 * @scancode: Scan code of received message (must be written by
140 * handler if IMG_IR_SCANCODE is returned). 140 * handler if IMG_IR_SCANCODE is returned).
141 * @toggle: Toggle bit (defaults to 0).
141 */ 142 */
142struct img_ir_scancode_req { 143struct img_ir_scancode_req {
143 enum rc_type protocol; 144 enum rc_type protocol;
144 u32 scancode; 145 u32 scancode;
146 u8 toggle;
145}; 147};
146 148
147/** 149/**