linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Young <sean@mess.org>
To: Sean Wang <sean.wang@mediatek.com>
Cc: mchehab@osg.samsung.com, hdegoede@redhat.com,
	hkallweit1@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com,
	matthias.bgg@gmail.com, andi.shyti@samsung.com,
	hverkuil@xs4all.nl, ivo.g.dimitrov.75@gmail.com,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, keyhaede@gmail.com
Subject: Re: [PATCH 2/2] media: rc: add driver for IR remote receiver on MT7623 SoC
Date: Sun, 8 Jan 2017 21:16:24 +0000	[thread overview]
Message-ID: <20170108211624.GB7866@gofer.mess.org> (raw)
In-Reply-To: <1483687885.16976.19.camel@mtkswgap22>

Hi Sean,

On Fri, Jan 06, 2017 at 03:31:25PM +0800, Sean Wang wrote:
> On Thu, 2017-01-05 at 17:12 +0000, Sean Young wrote:
> > On Fri, Jan 06, 2017 at 12:06:24AM +0800, sean.wang@mediatek.com wrote:
> > > +	/* Handle pulse and space until end of message */
> > > +	for (i = 0 ; i < MTK_CHKDATA_SZ ; i++) {
> > > +		val = mtk_r32(ir, MTK_CHKDATA_REG(i));
> > > +		dev_dbg(ir->dev, "@reg%d=0x%08x\n", i, val);
> > > +
> > > +		for (j = 0 ; j < 4 ; j++) {
> > > +			wid = (val & (0xff << j * 8)) >> j * 8;
> > > +			rawir.pulse = !rawir.pulse;
> > > +			rawir.duration = wid * (MTK_IR_SAMPLE + 1);
> > > +			ir_raw_event_store_with_filter(ir->rc, &rawir);
> > > +
> > > +			if (MTK_IR_END(wid))
> > > +				goto end_msg;
> > > +		}
> > > +	}
> > 
> > If I read this correctly, there is a maximum of 17 * 4 = 68 edges per
> > IR message. The rc6 mce key 0 (scancode 0x800f0400) is 69 edges, so that
> > won't work.
> > 
> Uh, this is related to hardware limitation. Maximum number hardware
> holds indeed is only 68 edges as you said :( 
> 
> For the case, I will try change the logic into that the whole message 
> is dropped if no end of message is seen within 68 counts to avoid
> wasting CPU for decoding. 

I'm not sure it is worthwhile dropping the IR in that case. The processing
is minimal and it might be possible that we have just enough IR to decode
a scancode even if the trailing end of message is missing. Note that
the call to ir_raw_event_set_idle() will generate an timeout IR event, so
there will always be an end of message marker.

All I wanted to do was point out a limitation in case there is a
workaround; if there is not then we might as well make do with the IR
we do have.

Thanks
Sean

  reply	other threads:[~2017-01-08 21:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05 16:06 [PATCH 0/2] media: rc: add support for IR receiver on MT7623 SoC sean.wang
2017-01-05 16:06 ` [PATCH 1/2] Documentation: devicetree: Add document bindings for mtk-cir sean.wang
2017-01-09 18:32   ` Rob Herring
2017-01-10  2:35     ` Sean Wang
2017-01-11 21:27       ` Rob Herring
2017-01-05 16:06 ` [PATCH 2/2] media: rc: add driver for IR remote receiver on MT7623 SoC sean.wang
2017-01-05 17:12   ` Sean Young
2017-01-06  7:31     ` Sean Wang
2017-01-08 21:16       ` Sean Young [this message]
2017-01-09  3:13         ` Sean Wang
2017-01-09 12:39           ` Sean Young
2017-01-06  3:43   ` Andi Shyti
2017-01-06  7:41     ` Sean Wang

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=20170108211624.GB7866@gofer.mess.org \
    --to=sean@mess.org \
    --cc=andi.shyti@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=hkallweit1@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=keyhaede@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@osg.samsung.com \
    --cc=robh+dt@kernel.org \
    --cc=sean.wang@mediatek.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;
as well as URLs for NNTP newsgroup(s).