From: "Nish Aravamudan" <nish.aravamudan@gmail.com>
To: "Atsushi Nemoto" <anemo@mba.ocn.ne.jp>
Cc: linux-kernel@vger.kernel.org,
"Richard Purdie" <rpurdie@rpsys.net>,
akpm@osdl.org
Subject: Re: [PATCH] LED: add LED heartbeat trigger
Date: Tue, 20 Jun 2006 09:54:59 -0700 [thread overview]
Message-ID: <29495f1d0606200954u3e81acb4w648d5c31e8daff3a@mail.gmail.com> (raw)
In-Reply-To: <20060621.013603.132759710.anemo@mba.ocn.ne.jp>
On 6/20/06, Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> Add an LED trigger acts like a heart beat. This can be used as a
> replacement of CONFIG_HEARTBEAT code exists in some arch's timer code.
>
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
<snip>
> new file mode 100644
> index 0000000..07ac645
> --- /dev/null
> +++ b/drivers/leds/ledtrig-heartbeat.c
> + heartbeat_data->period = heartbeat_data->period * HZ / 100;
> + delay = 7 * HZ / 100;
Can these and the other HZ/100 users make use of the existing
*secs_to_jiffies() methods? FYI, if HZ=250, you're getting rounding
here, not sure if it's desired.
<snip>
> +static void heartbeat_trig_activate(struct led_classdev *led_cdev)
> +{
> + struct heartbeat_trig_data *heartbeat_data;
> +
> + heartbeat_data = kzalloc(sizeof(*heartbeat_data), GFP_KERNEL);
> + if (!heartbeat_data)
> + return;
> +
> + led_cdev->trigger_data = heartbeat_data;
> + init_timer(&heartbeat_data->timer);
> + heartbeat_data->timer.function = led_heartbeat_function;
> + heartbeat_data->timer.data = (unsigned long) led_cdev;
setup_timer()? (which will call init_timer() before returning.
Thanks,
Nish
next prev parent reply other threads:[~2006-06-20 16:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-20 16:36 Atsushi Nemoto
2006-06-20 16:54 ` Nish Aravamudan [this message]
2006-06-21 14:41 ` Atsushi Nemoto
2006-06-21 15:01 ` Atsushi Nemoto
2006-06-21 15:17 ` Richard Purdie
[not found] <6pRqN-5QK-19@gated-at.bofh.it>
2006-06-20 17:39 ` Bodo Eggert
2006-06-21 14:54 ` Atsushi Nemoto
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=29495f1d0606200954u3e81acb4w648d5c31e8daff3a@mail.gmail.com \
--to=nish.aravamudan@gmail.com \
--cc=akpm@osdl.org \
--cc=anemo@mba.ocn.ne.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
/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
all inboxes | Powered by JetHome®