From: Randy Dunlap <randy.dunlap@oracle.com>
To: Rodolfo Giometti <giometti@linux.it>
Cc: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
David Woodhouse <dwmw2@infradead.org>,
Dave Jones <davej@redhat.com>, Sam Ravnborg <sam@ravnborg.org>,
Greg KH <greg@kroah.com>, Kay Sievers <kay.sievers@vrfy.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
Michael Kerrisk <mtk.manpages@gmail.com>,
Christoph Hellwig <hch@infradead.org>,
Alexander Gordeev <lasaine@lvk.cs.msu.su>
Subject: Re: [PATCH 1/6] pps: LinuxPPS clients support.
Date: Tue, 23 Feb 2010 08:21:40 -0800 [thread overview]
Message-ID: <4B840094.10003@oracle.com> (raw)
In-Reply-To: <1266928835-5435-2-git-send-email-giometti@linux.it>
On 02/23/10 04:40, Rodolfo Giometti wrote:
> Each PPS source can be registered/deregistered into the system by
> using special modules called "clients". They simply define the PPS
> sources' attributes and implement the time signal registartion
> mechanism.
>
> This patch adds a special directory for such clients and adds a dummy
> client that can be useful to test system integrity on real systems.
>
> Signed-off-by: Rodolfo Giometti <giometti@linux.it>
> ---
> drivers/pps/Kconfig | 2 +
> drivers/pps/Makefile | 1 +
> drivers/pps/clients/Kconfig | 18 ++++++
> drivers/pps/clients/Makefile | 9 +++
> drivers/pps/clients/ktimer.c | 123 ++++++++++++++++++++++++++++++++++++++++++
> 5 files changed, 153 insertions(+), 0 deletions(-)
> create mode 100644 drivers/pps/clients/Kconfig
> create mode 100644 drivers/pps/clients/Makefile
> create mode 100644 drivers/pps/clients/ktimer.c
> diff --git a/drivers/pps/clients/Kconfig b/drivers/pps/clients/Kconfig
> new file mode 100644
> index 0000000..60b83be
> --- /dev/null
> +++ b/drivers/pps/clients/Kconfig
> @@ -0,0 +1,18 @@
> +#
> +# PPS clients configuration
> +#
> +
> +if PPS
> +
> +comment "PPS clients support"
> +
> +config PPS_CLIENT_KTIMER
> + tristate "Kernel timer client (Testing client, use for debug)"
> + help
> + If you say yes here you get support for a PPS debugging client
> + which uses a kernel timer to generate the PPS signal.
> +
> + This driver can also be built as a module. If so, the module
> + will be called ktimer.ko.
will be called ktimer.
Only a handful of other drivers/kconfigs have that incorrect.
> +
> +endif
> diff --git a/drivers/pps/clients/ktimer.c b/drivers/pps/clients/ktimer.c
> new file mode 100644
> index 0000000..6de5dfc
> --- /dev/null
> +++ b/drivers/pps/clients/ktimer.c
> @@ -0,0 +1,123 @@
> +/*
> + * ktimer.c -- kernel timer test client
> +/*
> + * Global variables
> + */
> +
> +static int source;
> +static struct timer_list ktimer;
> +
> +/*
> + * The kernel timer
> + */
> +
> +static void pps_ktimer_event(unsigned long ptr)
> +{
> + struct timespec __ts;
> + struct pps_ktime ts;
> +
> + /* First of all we get the time stamp... */
> + getnstimeofday(&__ts);
> +
> + pr_info("PPS event at %lu\n", jiffies);
> +
> + /* ... and translate it to PPS time data struct */
> + ts.sec = __ts.tv_sec;
> + ts.nsec = __ts.tv_nsec;
> +
> + pps_event(source, &ts, PPS_CAPTUREASSERT, NULL);
> +
> + mod_timer(&ktimer, jiffies + HZ);
> +}
> +
> +/*
> + * The echo function
> + */
> +
> +static void pps_ktimer_echo(int source, int event, void *data)
> +{
> + pr_info("echo %s %s for source %d\n",
> + event & PPS_CAPTUREASSERT ? "assert" : "",
> + event & PPS_CAPTURECLEAR ? "clear" : "",
> + source);
> +}
> +
> +/*
> + * The PPS info struct
> + */
> +
> +static struct pps_source_info pps_ktimer_info = {
> + .name = "ktimer",
> + .path = "",
> + .mode = PPS_CAPTUREASSERT | PPS_OFFSETASSERT | \
> + PPS_ECHOASSERT | \
> + PPS_CANWAIT | PPS_TSFMT_TSPEC,
We don't usually use \ continuation characters when they are not needed.
> + .echo = pps_ktimer_echo,
> + .owner = THIS_MODULE,
> +};
--
~Randy
next prev parent reply other threads:[~2010-02-23 16:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-23 12:40 (version 2) LinuxPPS new functionalities Rodolfo Giometti
2010-02-23 12:40 ` [PATCH 1/6] pps: LinuxPPS clients support Rodolfo Giometti
2010-02-23 12:40 ` [PATCH 2/6] ldisc: new dcd_change() method for line disciplines Rodolfo Giometti
2010-02-23 12:40 ` [PATCH 3/6] ldisc n_tty: add new method n_tty_inherit_ops() Rodolfo Giometti
2010-02-23 12:40 ` [PATCH 4/6] pps: serial clients support Rodolfo Giometti
2010-02-23 12:40 ` [PATCH 5/6] serial 8250: enable PPS support Rodolfo Giometti
2010-02-23 12:40 ` [PATCH 6/6] serial amba-pl010: " Rodolfo Giometti
2010-02-23 16:21 ` Randy Dunlap [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-02-25 12:41 (version 3) LinuxPPS new functionalities Rodolfo Giometti
2010-02-25 12:41 ` [PATCH 1/6] pps: LinuxPPS clients support Rodolfo Giometti
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=4B840094.10003@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davej@redhat.com \
--cc=dwmw2@infradead.org \
--cc=giometti@linux.it \
--cc=greg@kroah.com \
--cc=hch@infradead.org \
--cc=hpa@zytor.com \
--cc=kay.sievers@vrfy.org \
--cc=lasaine@lvk.cs.msu.su \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mtk.manpages@gmail.com \
--cc=sam@ravnborg.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.