All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Härdeman" <david@hardeman.nu>
To: Jarod Wilson <jarod@wilsonet.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 0/6] rc-core: ir-core to rc-core conversion
Date: Fri, 12 Nov 2010 13:03:08 +0100	[thread overview]
Message-ID: <20101112120308.GA14033@hardeman.nu> (raw)
In-Reply-To: <AANLkTinjBOdnYfs=+HVxjaurbwEA33U2YwE0=bdz_Zto@mail.gmail.com>

On Thu, Nov 11, 2010 at 06:40:42PM -0500, Jarod Wilson wrote:
>On Thu, Nov 11, 2010 at 3:35 PM, David Härdeman <david@hardeman.nu> wrote:
>> On Thu, Nov 11, 2010 at 02:00:38PM -0200, Mauro Carvalho Chehab wrote:
>>>I like the idea of having an inlined function (like
>>>usb_fill_control_urb), to be sure that all mandatory fields are
>>>initialized by the drivers.
>>
>> I like the idea of having a function, let's call it
>> rc_register_device(), which makes sure that all mandatory fields are
>> initialized by the drivers :)
>
>rc_register_device(rc, name, phys, id); to further prevent duplicate
>struct members? :)

As I said before, that won't work with multiple input devices per rc
dev. And it's a poorly designed API (IMHO) which expects you to set a
few properties in a struct and then add a few more via a function call.

Notes wrt. a future multi-input support:

First, realize that the name/phys/id of an input device is primarily
used to distinguish them from each other in user-space. Which means
having a shared name/phys/id triplet for all input devices belonging to
one rc device only makes them pointless.

So, I think we'll want something similar to name/phys/id, but for the rc
device (can be exported via sysfs). Input name/phys/id can then be
derived from the rc device for each input subdev (or name could perhaps
be set to some user-friendly description of the actual remote control by
whichever user-space tool loads the corresponding keymap).

Example:
rc_dev->name = "FooBar IR-Masta 2000"
rc_dev->phys = "PNP0BAR/rc0"
(would be available from /sys/class/rc/rc0/{name|phys})

/* Not set by the driver, available with lsinput */
rc_dev->input_devs[0]->name = "FooBar IR-Masta 2000 Remote 1"
rc_dev->input_devs[0]->phys = "PNP0BAR/rc0/input0"
rc_dev->input_devs[0]->id.bustype = BUS_RC;
rc_dev->input_devs[1]->name = "FooBar IR-Masta 2000 Remote 2"
rc_dev->input_devs[1]->phys = "PNP0BAR/rc0/input1"
rc_dev->input_devs[1]->id.bustype = BUS_RC;

(Just an example, don't overanalyse the details)

As you see, the rc_dev->input_name/phys/id is just a stopgap measure for
now, and I certainly don't think future development will be helped by
moving any input related fields up to the rc_register_device() level
when they should instead go further "down".

>I still really like this interface change, even if its going to cause
>short-term issues for i2c devices. I think we just extend this as
>needed to handle the i2c bits.

Agreed.

-- 
David Härdeman

  parent reply	other threads:[~2010-11-12 12:03 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02 20:17 [PATCH 0/6] rc-core: ir-core to rc-core conversion David Härdeman
2010-11-02 20:17 ` [PATCH 1/6] ir-core: convert drivers/media/video/cx88 to ir-core David Härdeman
2010-11-02 20:17 ` [PATCH 2/6] ir-core: remove remaining users of the ir-functions keyhandlers David Härdeman
2010-11-02 20:17 ` [PATCH 3/6] ir-core: more cleanups of ir-functions.c David Härdeman
2010-11-02 20:17 ` [PATCH 4/6] ir-core: merge and rename to rc-core David Härdeman
2010-11-02 20:18 ` [PATCH 5/6] ir-core: make struct rc_dev the primary interface David Härdeman
2010-11-02 20:18 ` [PATCH 6/6] rc-core: convert winbond-cir David Härdeman
2010-11-02 20:26 ` [PATCH 0/6] rc-core: ir-core to rc-core conversion Jarod Wilson
2010-11-10  1:50   ` Mauro Carvalho Chehab
2010-11-10  3:25     ` Jarod Wilson
2010-11-10  4:33       ` Mauro Carvalho Chehab
2010-11-10  9:28       ` David Härdeman
2010-11-10  9:24     ` David Härdeman
2010-11-10 12:49       ` Mauro Carvalho Chehab
2010-11-10 13:06         ` David Härdeman
2010-11-10 16:24           ` Mauro Carvalho Chehab
2010-11-10 22:01             ` David Härdeman
2010-11-11 13:54               ` Mauro Carvalho Chehab
2010-11-11 15:19                 ` David Härdeman
2010-11-11 16:00                   ` Mauro Carvalho Chehab
2010-11-11 20:35                     ` David Härdeman
2010-11-11 23:40                       ` Jarod Wilson
2010-11-12  4:00                         ` Mauro Carvalho Chehab
2010-11-12 12:12                           ` David Härdeman
2010-11-12 12:56                             ` Mauro Carvalho Chehab
2010-11-12 14:08                               ` David Härdeman
2010-11-12 14:15                                 ` Mauro Carvalho Chehab
2010-11-12 12:03                         ` David Härdeman [this message]
2010-11-11 14:06               ` Mauro Carvalho Chehab
2010-11-09 10:27 ` David Härdeman
2010-11-09 10:34   ` Mauro Carvalho Chehab

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=20101112120308.GA14033@hardeman.nu \
    --to=david@hardeman.nu \
    --cc=jarod@wilsonet.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.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.