From: Sifan Naeem <sifan.naeem@imgtec.com>
To: <james.hogan@imgtec.com>, <mchehab@osg.samsung.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-media@vger.kernel.org>,
<james.hartley@imgtec.com>, <ezequiel.garcia@imgtec.com>,
Sifan Naeem <sifan.naeem@imgtec.com>
Subject: [PATCH v2 2/5] rc: img-ir: pass toggle bit to the rc driver
Date: Thu, 11 Dec 2014 20:06:23 +0000 [thread overview]
Message-ID: <1418328386-9802-3-git-send-email-sifan.naeem@imgtec.com> (raw)
In-Reply-To: <1418328386-9802-1-git-send-email-sifan.naeem@imgtec.com>
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.
Change from v1:
* Typo Corrected in the commit message.
Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
---
drivers/media/rc/img-ir/img-ir-hw.c | 8 +++++---
drivers/media/rc/img-ir/img-ir-hw.h | 2 ++
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 88fada5..9cecda7 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)
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) {
diff --git a/drivers/media/rc/img-ir/img-ir-hw.h b/drivers/media/rc/img-ir/img-ir-hw.h
index aeef3d1..beac3a6 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 {
* 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;
};
/**
--
1.7.9.5
next prev parent reply other threads:[~2014-12-11 20:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-11 20:06 [PATCH v2 0/5] rc: img-ir: rc5 and rc6 support added Sifan Naeem
2014-12-11 20:06 ` [PATCH v2 1/5] rc: img-ir: add scancode requests to a struct Sifan Naeem
2014-12-11 20:06 ` Sifan Naeem [this message]
2014-12-11 20:06 ` [PATCH v2 3/5] rc: img-ir: biphase enabled with workaround Sifan Naeem
2014-12-12 12:07 ` James Hogan
2014-12-12 13:55 ` James Hogan
2014-12-11 20:06 ` [PATCH v2 4/5] rc: img-ir: add philips rc5 decoder module Sifan Naeem
2014-12-11 20:06 ` [PATCH v2 5/5] rc: img-ir: add philips rc6 " Sifan Naeem
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1418328386-9802-3-git-send-email-sifan.naeem@imgtec.com \
--to=sifan.naeem@imgtec.com \
--cc=ezequiel.garcia@imgtec.com \
--cc=james.hartley@imgtec.com \
--cc=james.hogan@imgtec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®