public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: "Antti Seppälä" <a.seppala@gmail.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>,
	linux-media@vger.kernel.org
Subject: Re: [RFC PATCH 2/3] ir-rc5-sz: Add ir encoding support
Date: Mon, 10 Feb 2014 20:50:53 +0000	[thread overview]
Message-ID: <2457095.pZsX4lrjVF@radagast> (raw)
In-Reply-To: <CAKv9HNZj2Jr4GnHXAtvqfaVsmQFVUxBmZZT-rBePoHB0X8ShiA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2345 bytes --]

Hi Antti,

On Monday 10 February 2014 22:09:33 Antti Seppälä wrote:
> >> +static int ir_rc5_sz_encode(u64 protocols,
> >> +                         const struct rc_scancode_filter *scancode,
> >> +                         struct ir_raw_event *events, unsigned int max)
> >> +{
> >> +     int ret;
> >> +     struct ir_raw_event *e = events;
> > 
> > Probably worth checking scancode->mask == 0xfff too?
> 
> I guess so. However if I'm not mistaken this makes all wakeup_filter
> writes fail in user space if wakeup_filter_mask is not set. Is that
> intended?

Good point, although looking at your patch 3, mask==0 is already permitted 
silently by the driver, which I think would make it okay.

I guess to be safe userland would have to do:
wakeup_filter_mask = 0
wakeup_filter = $value
wakeup_filter_mask = 0xfff

which doesn't sound unreasonable in the absence of a way to update them 
atomically (sysfs files doing more than one thing is frowned upon I believe).

> >> +     /* RC5-SZ scancode is raw enough for manchester as it is */
> >> +     ret = ir_raw_gen_manchester(&e, max, &ir_rc5_sz_timings,
> >> RC5_SZ_NBITS, +                                 scancode->data);
> >> +     if (ret < 0)
> >> +             return ret;
> > 
> > I suspect it needs some more space at the end too, to be sure that no
> > more bits afterwards are accepted.
> 
> I'm sorry but I'm not sure I completely understood what you meant
> here. For RC-5-SZ the entire scancode gets encoded and nothing more.
> Do you mean that the encoder should append some ir silence to the end
> result to make sure the ir sample has ended?

Yeh something like that. Certainly the raw decoders I've looked at expect a 
certain amount of space at the end to avoid decoding part of a longer protocol 
(it's in the pulse distance helper as the trailer space timing). Similarly the 
IMG hardware decoder has register fields for the free-time to require at the 
end of the message.

In fact it becomes a bit awkward for the raw IR driver for the IMG hardware 
which uses edge interrupts, as it has to have a timeout to emit a final repeat 
event after 150ms of inactivity, in order for the raw decoders to accept it 
(unless you hold the button down in which case the repeat code edges result in 
the long space).

Cheers
James

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-02-10 20:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 19:59 [RFC 0/4] rc: ir-raw: Add encode, implement NEC encode James Hogan
2014-02-06 19:59 ` [RFC 1/4] rc: ir-raw: add scancode encoder callback James Hogan
2014-02-06 19:59 ` [RFC 2/4] rc: ir-raw: add modulation helpers James Hogan
2014-02-06 19:59 ` [RFC 3/4] rc: ir-nec-decoder: add encode capability James Hogan
2014-02-06 19:59 ` [RFC 4/4] DEBUG: rc: img-ir: raw: Add loopback on s_filter James Hogan
2014-02-08 11:30 ` [RFC 0/4] rc: ir-raw: Add encode, implement NEC encode Antti Seppälä
2014-02-08 12:07   ` [RFC PATCH 0/3] rc: add RC5-SZ encoder and utilize encoders in nuvoton-cir Antti Seppälä
2014-02-08 12:07     ` [RFC PATCH 1/3] rc-core: Add Manchester encoder (phase encoder) support to rc-core Antti Seppälä
2014-02-10 10:25       ` James Hogan
2014-02-10 19:56         ` Antti Seppälä
2014-02-08 12:07     ` [RFC PATCH 2/3] ir-rc5-sz: Add ir encoding support Antti Seppälä
2014-02-10 10:30       ` James Hogan
2014-02-10 20:09         ` Antti Seppälä
2014-02-10 20:50           ` James Hogan [this message]
2014-02-11 18:14             ` Antti Seppälä
2014-02-11 23:39               ` James Hogan
2014-02-16 17:04                 ` Antti Seppälä
2014-02-27 22:43                   ` James Hogan
2014-02-16 16:45               ` [RFCv2 PATCH 0/3] rc: add RC5-SZ encoder and utilize encoders in nuvoton-cir Antti Seppälä
2014-02-16 16:45                 ` [RFCv2 PATCH 1/3] rc-core: Add Manchester encoder (phase encoder) support to rc-core Antti Seppälä
2014-02-16 16:45                 ` [RFCv2 PATCH 2/3] ir-rc5-sz: Add ir encoding support Antti Seppälä
2014-02-16 16:45                 ` [RFCv2 PATCH 3/3] nuvoton-cir: Add support for writing wakeup samples via sysfs filter callback Antti Seppälä
2014-02-08 12:07     ` [RFC " Antti Seppälä
2014-02-10  9:58   ` [RFC 0/4] rc: ir-raw: Add encode, implement NEC encode James Hogan
2014-02-10 19:45     ` Antti Seppälä

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=2457095.pZsX4lrjVF@radagast \
    --to=james.hogan@imgtec.com \
    --cc=a.seppala@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@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