From: Jean-Francois Moine <moinejf@free.fr>
To: "Németh Márton" <nm127@freemail.hu>
Cc: Hans de Goede <hdegoede@redhat.com>,
V4L Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 1/3] add feedback LED control
Date: Mon, 1 Mar 2010 10:18:06 +0100 [thread overview]
Message-ID: <20100301101806.7c7986be@tele> (raw)
In-Reply-To: <4B8AC618.80200@freemail.hu>
On Sun, 28 Feb 2010 20:38:00 +0100
Németh Márton <nm127@freemail.hu> wrote:
> With a bitfield on and off state can be specified. What about the
> "auto" mode? Should two bits grouped together to have auto, on and
> off state? Is there already a similar control?
>
> Is the brightness of the background light LEDs adjustable or are they
> just on/off? If yes, then maybe the feedback LEDs and the background
> light LEDs should be treated as different kind.
OK. My idea about switching the LEDs by v4l2 controls was not good. So,
forget about it.
Instead, some job of the led class may be done in the gspca main,
especially register/unregister.
I propose to add a LED description in the gspca structure (level
'struct cam'). There would be 'nleds' for the number of LEDS and
'leds', a pointer to an array of:
struct gspca_led {
struct led_classdev led_cdev;
char led_name[32];
struct led_trigger led_trigger;
char trigger_name[32];
};
(this array should be in the subdriver structure - I don't show the
#ifdef's)
Then, this would work as:
- on probe, in the 'config' function of the subdriver, this one
initializes the led and trigger fields. The 'led_cdev.name' and
'led_trigger.name' should point to a sprintf format with one
argument: the video device number (ex: "video%d::toplight").
- then, at the end of gspca_dev_probe(), the gspca main creates the real
names of the leds and triggers, and does the register job.
- all led/trigger events are treated by the subdriver, normally by a
workqueue. This one must not be the system workqueue.
- on disconnection, the gspca main unregisters the leds and triggers
without calling the subdriver. In the workqueue, the disconnection
can be simply handled testing the flag 'present' after each subsystem
call.
Cheers.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
next prev parent reply other threads:[~2010-03-01 9:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-28 7:55 [PATCH 1/3] add feedback LED control Németh Márton
2010-02-28 19:28 ` Jean-Francois Moine
2010-02-28 19:38 ` Németh Márton
2010-03-01 9:03 ` Laurent Pinchart
2010-03-01 9:18 ` Jean-Francois Moine [this message]
2010-03-02 23:42 ` [RFC, PATCH 1/3] gspca: add LEDs subsystem connection Németh Márton
2010-03-09 11:27 ` Laurent Pinchart
2010-03-09 16:02 ` Richard Purdie
2010-05-06 18:14 ` [PATCH 1/3] add feedback LED control Mauro Carvalho Chehab
2010-03-01 9:01 ` Laurent Pinchart
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=20100301101806.7c7986be@tele \
--to=moinejf@free.fr \
--cc=hdegoede@redhat.com \
--cc=linux-media@vger.kernel.org \
--cc=nm127@freemail.hu \
/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