All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <m.chehab@samsung.com>
To: zhangfei <zhangfei.gao@linaro.org>
Cc: "David Härdeman" <david@hardeman.nu>,
	arnd@arndb.de, haifeng.yan@linaro.org, jchxue@gmail.com,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v2 3/3] [media] rc: remove change_protocol in rc-ir-raw.c
Date: Wed, 27 Aug 2014 08:34:47 -0300	[thread overview]
Message-ID: <20140827083447.6af0157f.m.chehab@samsung.com> (raw)
In-Reply-To: <53FD99FA.4030207@linaro.org>

Em Wed, 27 Aug 2014 16:42:34 +0800
zhangfei <zhangfei.gao@linaro.org> escreveu:

> 
> 
> On 08/21/2014 07:50 PM, Mauro Carvalho Chehab wrote:
> > Em Thu, 21 Aug 2014 17:24:45 +0800
> > Zhangfei Gao <zhangfei.gao@linaro.org> escreveu:
> >
> >> With commit 4924a311a62f ("[media] rc-core: rename ir-raw.c"),
> >> empty change_protocol was introduced.
> >
> > No. This was introduced on this changeset:
> >
> > commit da6e162d6a4607362f8478c715c797d84d449f8b
> > Author: David Härdeman <david@hardeman.nu>
> > Date:   Thu Apr 3 20:32:16 2014 -0300
> >
> >      [media] rc-core: simplify sysfs code
> >
> >> As a result, rc_register_device will set dev->enabled_protocols
> >> addording to rc_map->rc_type, which prevent using all protocols.
> >
> > I strongly suspect that this patch will break some things, as
> > the new code seems to expect that this is always be set.
> >
> > See the code at store_protocols(): if this callback is not set,
> > then it won't allow to disable a protocol.
> >
> > Also, this doesn't prevent using all protocols. You can still use
> > "ir-keytable -p all" to enable all protocols (the "all" protocol
> > type were introduced recently at the userspace tool).
> >
> >  From the way I see, setting the protocol when a table is loaded
> > is not a bad thing, as:
> > - if RC tables are loaded, the needed protocol to decode it is
> >    already known;
> > - by running just one IR decoder, the IR handling routine will
> >    be faster and will consume less power;
> > - on a real case scenario, it is a way more likely that just one
> >    decoder will ever be needed by the end user.
> >
> > So, I think that this is just annoying for developers when are checking
> > if all decoders are working, by sending keycodes from different IR types
> > at the same time.
> >
> 
> Thanks Mauro for the kind explanation.
> 
> ir-keytable seems also enalbe specific protocol
> -p, --protocol=PROTOCOL
> 
> Currently we use lirc user space decoder/keymap and only need 
> pulse-length information from kernel.

Well, you can use ir-keytable to disable everything but lirc, not
compile the other hardware decoders or directly write "lirc" to 
/sys/class/rc/rc0/protocols (see Documentation/ABI/testing/sysfs-class-rc).

Anyway, I suggest you to use the hardware decoder instead of lirc,
as the in-kernel decoders should be lighter than lirc and works pretty
well, but this is, of course, your decision. 

Btw, it would make sense, IMHO, to have a way to setup LIRC daemon to
enable LIRC output on a given remote controller, and, optionally,
disabling the hardware decoders that are needlessly enabled.

Regards,
Mauro

WARNING: multiple messages have this Message-ID (diff)
From: m.chehab@samsung.com (Mauro Carvalho Chehab)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/3] [media] rc: remove change_protocol in rc-ir-raw.c
Date: Wed, 27 Aug 2014 08:34:47 -0300	[thread overview]
Message-ID: <20140827083447.6af0157f.m.chehab@samsung.com> (raw)
In-Reply-To: <53FD99FA.4030207@linaro.org>

Em Wed, 27 Aug 2014 16:42:34 +0800
zhangfei <zhangfei.gao@linaro.org> escreveu:

> 
> 
> On 08/21/2014 07:50 PM, Mauro Carvalho Chehab wrote:
> > Em Thu, 21 Aug 2014 17:24:45 +0800
> > Zhangfei Gao <zhangfei.gao@linaro.org> escreveu:
> >
> >> With commit 4924a311a62f ("[media] rc-core: rename ir-raw.c"),
> >> empty change_protocol was introduced.
> >
> > No. This was introduced on this changeset:
> >
> > commit da6e162d6a4607362f8478c715c797d84d449f8b
> > Author: David H?rdeman <david@hardeman.nu>
> > Date:   Thu Apr 3 20:32:16 2014 -0300
> >
> >      [media] rc-core: simplify sysfs code
> >
> >> As a result, rc_register_device will set dev->enabled_protocols
> >> addording to rc_map->rc_type, which prevent using all protocols.
> >
> > I strongly suspect that this patch will break some things, as
> > the new code seems to expect that this is always be set.
> >
> > See the code at store_protocols(): if this callback is not set,
> > then it won't allow to disable a protocol.
> >
> > Also, this doesn't prevent using all protocols. You can still use
> > "ir-keytable -p all" to enable all protocols (the "all" protocol
> > type were introduced recently at the userspace tool).
> >
> >  From the way I see, setting the protocol when a table is loaded
> > is not a bad thing, as:
> > - if RC tables are loaded, the needed protocol to decode it is
> >    already known;
> > - by running just one IR decoder, the IR handling routine will
> >    be faster and will consume less power;
> > - on a real case scenario, it is a way more likely that just one
> >    decoder will ever be needed by the end user.
> >
> > So, I think that this is just annoying for developers when are checking
> > if all decoders are working, by sending keycodes from different IR types
> > at the same time.
> >
> 
> Thanks Mauro for the kind explanation.
> 
> ir-keytable seems also enalbe specific protocol
> -p, --protocol=PROTOCOL
> 
> Currently we use lirc user space decoder/keymap and only need 
> pulse-length information from kernel.

Well, you can use ir-keytable to disable everything but lirc, not
compile the other hardware decoders or directly write "lirc" to 
/sys/class/rc/rc0/protocols (see Documentation/ABI/testing/sysfs-class-rc).

Anyway, I suggest you to use the hardware decoder instead of lirc,
as the in-kernel decoders should be lighter than lirc and works pretty
well, but this is, of course, your decision. 

Btw, it would make sense, IMHO, to have a way to setup LIRC daemon to
enable LIRC output on a given remote controller, and, optionally,
disabling the hardware decoders that are needlessly enabled.

Regards,
Mauro

  reply	other threads:[~2014-08-27 11:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21  9:24 [PATCH v2 0/3] Introduce hix5hd2 IR transmitter driver Zhangfei Gao
2014-08-21  9:24 ` Zhangfei Gao
2014-08-21  9:24 ` [PATCH v2 1/3] rc: Add DT bindings for hix5hd2 Zhangfei Gao
2014-08-21  9:24   ` Zhangfei Gao
2014-08-21  9:24 ` [PATCH v2 2/3] rc: Introduce hix5hd2 IR transmitter driver Zhangfei Gao
2014-08-21  9:24   ` Zhangfei Gao
2014-08-21 10:07   ` Sean Young
2014-08-21 10:07     ` Sean Young
2014-08-21 10:07     ` Sean Young
2014-08-27  8:49     ` zhangfei
2014-08-27  8:49       ` zhangfei
2014-08-27  9:51       ` Sean Young
2014-08-27  9:51         ` Sean Young
2014-08-27 10:10         ` zhangfei
2014-08-27 10:10           ` zhangfei
2014-08-27 13:15           ` Sean Young
2014-08-27 13:15             ` Sean Young
     [not found] ` <1408613086-12538-1-git-send-email-zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-08-21  9:24   ` [PATCH v2 3/3] [media] rc: remove change_protocol in rc-ir-raw.c Zhangfei Gao
2014-08-21  9:24     ` Zhangfei Gao
2014-08-21  9:24     ` Zhangfei Gao
2014-08-21 11:50     ` Mauro Carvalho Chehab
2014-08-21 11:50       ` Mauro Carvalho Chehab
2014-08-21 11:50       ` Mauro Carvalho Chehab
2014-08-27  8:42       ` zhangfei
2014-08-27  8:42         ` zhangfei
2014-08-27 11:34         ` Mauro Carvalho Chehab [this message]
2014-08-27 11:34           ` Mauro Carvalho Chehab
2014-08-28  9:18           ` zhangfei
2014-08-28  9:18             ` zhangfei

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=20140827083447.6af0157f.m.chehab@samsung.com \
    --to=m.chehab@samsung.com \
    --cc=arnd@arndb.de \
    --cc=david@hardeman.nu \
    --cc=devicetree@vger.kernel.org \
    --cc=haifeng.yan@linaro.org \
    --cc=jchxue@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=zhangfei.gao@linaro.org \
    /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.