From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
linux-input@vger.kernel.org
Subject: Re: [PATCH] V4L/DVB: ir: Add a link to associate /sys/class/ir/irrcv with the input device
Date: Thu, 11 Mar 2010 19:05:42 -0300 [thread overview]
Message-ID: <4B996936.8030905@redhat.com> (raw)
In-Reply-To: <20100311175214.GB7467@core.coreip.homeip.net>
Dmitry,
Dmitry Torokhov wrote:
> Hi Mauro,
>
> On Thu, Mar 11, 2010 at 12:46:19PM -0300, Mauro Carvalho Chehab wrote:
>> In order to allow userspace programs to autoload an IR table, a link is
>> needed to point to the corresponding input device.
>>
>> $ tree /sys/class/irrcv/irrcv0
>> /sys/class/irrcv/irrcv0
>> |-- current_protocol
>> |-- input -> ../../../pci0000:00/0000:00:0b.1/usb1/1-3/input/input22
>> |-- power
>> | `-- wakeup
>> |-- subsystem -> ../../../../class/irrcv
>> `-- uevent
>>
>> It is now easy to associate an irrcv device with the corresponding
>> device node, at the input interface.
>>
>
> I guess the question is why don't you make input device a child of your
> irrcvX device? Then I believe driver core will link them properly. It
> will also ensure proper power management hierarchy.
>
> That probably will require you changing from class_dev into device but
> that's the direction kernel is going to anyway.
I remember you asked me to create a separate class for IR. The current code
does it, using class_create(). Once the class is created, I'm using
device_create() to create the nodes.
The current code is:
int ir_register_class(struct input_dev *input_dev)
{
...
ir_dev->class_dev = device_create(ir_input_class, NULL,
input_dev->dev.devt, ir_dev,
"irrcv%d", devno);
...
rc = sysfs_create_group(kobj, &ir_dev->attr);
...
rc = sysfs_create_link(kobj, &input_dev->dev.kobj, "input");
...
return 0;
};
int ir_input_register(struct input_dev *input_dev,
const struct ir_scancode_table *rc_tab,
const struct ir_dev_props *props)
{
...
rc = input_register_device(input_dev);
...
rc = ir_register_class(input_dev);
...
}
static int __init ir_core_init(void)
{
ir_input_class = class_create(THIS_MODULE, "irrcv");
...
}
I couldn't find any other way to create the link without explicitly
calling sysfs_create_link().
Do you have a better idea?
--
Cheers,
Mauro
next prev parent reply other threads:[~2010-03-11 22:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-11 15:46 [PATCH] V4L/DVB: ir: Add a link to associate /sys/class/ir/irrcv with the input device Mauro Carvalho Chehab
2010-03-11 17:52 ` Dmitry Torokhov
2010-03-11 22:05 ` Mauro Carvalho Chehab [this message]
2010-03-12 4:32 ` Mauro Carvalho Chehab
2010-03-13 8:41 ` Dmitry Torokhov
2010-03-13 20:59 ` Mauro Carvalho Chehab
2010-03-14 6:37 ` Dmitry Torokhov
2010-03-14 18:22 ` 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=4B996936.8030905@redhat.com \
--to=mchehab@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-media@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox