All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi Kumar V <kumarrav@codeaurora.org>
To: Jarod Wilson <jarod@redhat.com>,
	linux-media@vger.kernel.org, mchehab@redhat.com
Subject: NECX protocol STATE_TRAILER_SPACE
Date: Tue, 12 Jun 2012 18:16:31 +0530	[thread overview]
Message-ID: <4FD73A27.5020009@codeaurora.org> (raw)

Hi Jardon,

I am writing IR receiver driver over GPIO line.
Trying to read the frame sent by Samsung remote.
I am sending interrupt events to rc frame work using 
ir_raw_event_store_edge()

I am able to see that above API is pushing previous pulse/space packet 
to rc framework when an interrupt is reported to it.
I am facing one issue with NEC decoder.

NECx protocol format has one start bit, 32 data bits and one stop bit

stop bit: pulse (562us) & space ( untill next key press event)

so i think here we should skip the STATE_TRAILER_SPACE event because the 
width of it is not fixed for some of NECx protocols like samsung remote.


         case STATE_TRAILER_PULSE:
                 if (!ev.pulse)
                         break;

                 if (!eq_margin(ev.duration, NEC_TRAILER_PULSE, NEC_UNIT
                         break;

                 data->state = STATE_TRAILER_SPACE;
                 IR_dprintk(1, "NEC (Ext) state set %d\n", data->state);
                 return 0;

         case STATE_TRAILER_SPACE:
                 if (ev.pulse)
                         break;

                 if (!geq_margin(ev.duration, NEC_TRAILER_SPACE, 
NEC_UNIT / 2))
                         break;

                 address     = bitrev8((data->bits >> 24) & 0xff);
                 not_address = bitrev8((data->bits >> 16) & 0xff);
                 command     = bitrev8((data->bits >>  8) & 0xff);
                 not_command = bitrev8((data->bits >>  0) & 0xff);

                 if ((command ^ not_command) != 0xff) {
                         IR_dprintk(1, "NEC checksum error: received 
0x%08x\n",
                                    data->bits);
                         send_32bits = true;
                 }


-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

                 reply	other threads:[~2012-06-12 12:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4FD73A27.5020009@codeaurora.org \
    --to=kumarrav@codeaurora.org \
    --cc=jarod@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.