From 120703f9eb32033f0e39bdc552c0273c8ab45f33 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Thu, 3 Apr 2014 20:31:30 -0300 Subject: [media] rc-core: document the protocol type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Right now the protocol information is not preserved, rc-core gets handed a scancode but has no idea which protocol it corresponds to. This patch (which required reading through the source/keymap for all drivers, not fun) makes the protocol information explicit which is important documentation and makes it easier to e.g. support multiple protocols with one decoder (think rc5 and rc-streamzap). The information isn't used yet so there should be no functional changes. [m.chehab@samsung.com: rebased, added cxusb and removed bad whitespacing] Signed-off-by: David Härdeman Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/img-ir/img-ir-hw.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/media/rc/img-ir/img-ir-hw.c') diff --git a/drivers/media/rc/img-ir/img-ir-hw.c b/drivers/media/rc/img-ir/img-ir-hw.c index 153c0840bf4c..b0ec55f52228 100644 --- a/drivers/media/rc/img-ir/img-ir-hw.c +++ b/drivers/media/rc/img-ir/img-ir-hw.c @@ -512,7 +512,7 @@ unlock: static int img_ir_set_normal_filter(struct rc_dev *dev, struct rc_scancode_filter *sc_filter) { - return img_ir_set_filter(dev, RC_FILTER_NORMAL, sc_filter); + return img_ir_set_filter(dev, RC_FILTER_NORMAL, sc_filter); } static int img_ir_set_wakeup_filter(struct rc_dev *dev, @@ -795,9 +795,11 @@ static void img_ir_handle_data(struct img_ir_priv *priv, u32 len, u64 raw) struct img_ir_priv_hw *hw = &priv->hw; const struct img_ir_decoder *dec = hw->decoder; int ret = IMG_IR_SCANCODE; - int scancode; + u32 scancode; + enum rc_type protocol = RC_TYPE_UNKNOWN; + if (dec->scancode) - ret = dec->scancode(len, raw, &scancode, hw->enabled_protocols); + ret = dec->scancode(len, raw, &protocol, &scancode, hw->enabled_protocols); else if (len >= 32) scancode = (u32)raw; else if (len < 32) @@ -806,7 +808,7 @@ static void img_ir_handle_data(struct img_ir_priv *priv, u32 len, u64 raw) len, (unsigned long long)raw); if (ret == IMG_IR_SCANCODE) { dev_dbg(priv->dev, "decoded scan code %#x\n", scancode); - rc_keydown(hw->rdev, scancode, 0); + rc_keydown(hw->rdev, protocol, scancode, 0); img_ir_end_repeat(priv); } else if (ret == IMG_IR_REPEATCODE) { if (hw->mode == IMG_IR_M_REPEATING) { -- cgit v1.2.3