From: Jun Sun <jsun@mvista.com>
To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Linux/MIPS Development <linux-mips@oss.sgi.com>,
Linux/m68k <linux-m68k@lists.linux-m68k.org>,
Linux/PPC Development <linuxppc-dev@lists.linuxppc.org>
Subject: Re: [RFC] generic MIPS RTC driver
Date: Mon, 12 Nov 2001 11:13:51 -0800 [thread overview]
Message-ID: <3BF01F6F.D64CEA50@mvista.com> (raw)
In-Reply-To: Pine.GSO.3.96.1011112194341.24771M-100000@delta.ds2.pg.gda.pl
"Maciej W. Rozycki" wrote:
>
> On Mon, 12 Nov 2001, Jun Sun wrote:
>
> > The /dev/rtc interface is highly influenced by MC146818 chip, which not all
> > RTC devices are alike. The only fundamental thing in the driver is really the
> > read and write time.
>
> You need only to keep the interface, which is:
>
> static struct file_operations rtc_fops = {
> owner: THIS_MODULE,
> llseek: no_llseek,
> read: rtc_read,
> #if RTC_IRQ
> poll: rtc_poll,
> #endif
> ioctl: rtc_ioctl,
> open: rtc_open,
> release: rtc_release,
> fasync: rtc_fasync,
> };
>
> Of these you probably must only implement open() and ioctl() -- you may
> provide others as hardware permits -- see how these functions are
> implemented in drivers/char/rtc.c. The interface is pretty generic, IMHO.
>
> > If their abstraction is reasonable, perhaps they can all converge to a better,
> > more generic rtc interface.
>
> Just implement the ioctls given hardware permits and return -EINVAL for
> others. Again, they are pretty generic: get/set the time, alarm, epoch,
> disable/enable various interrupts, etc. -- see include/linux/rtc.h. You
> may propose additional ioctls if they would be useful for particular
> hardware.
>
Basically agree.
Maybe the only thing really missing is a formal way to determine and report
the capability of the driver, rather through checking the return value being
-EINVAL.
I guess my original question to Geert is more on the abstraction of the RTC
hardware routines, especially anything beyond rtc_read_time() and
rt_write_time().
Jun
WARNING: multiple messages have this Message-ID (diff)
From: Jun Sun <jsun@mvista.com>
To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Linux/MIPS Development <linux-mips@oss.sgi.com>,
Linux/m68k <linux-m68k@lists.linux-m68k.org>,
Linux/PPC Development <linuxppc-dev@lists.linuxppc.org>
Subject: Re: [RFC] generic MIPS RTC driver
Date: Mon, 12 Nov 2001 11:13:51 -0800 [thread overview]
Message-ID: <3BF01F6F.D64CEA50@mvista.com> (raw)
In-Reply-To: Pine.GSO.3.96.1011112194341.24771M-100000@delta.ds2.pg.gda.pl
"Maciej W. Rozycki" wrote:
>
> On Mon, 12 Nov 2001, Jun Sun wrote:
>
> > The /dev/rtc interface is highly influenced by MC146818 chip, which not all
> > RTC devices are alike. The only fundamental thing in the driver is really the
> > read and write time.
>
> You need only to keep the interface, which is:
>
> static struct file_operations rtc_fops = {
> owner: THIS_MODULE,
> llseek: no_llseek,
> read: rtc_read,
> #if RTC_IRQ
> poll: rtc_poll,
> #endif
> ioctl: rtc_ioctl,
> open: rtc_open,
> release: rtc_release,
> fasync: rtc_fasync,
> };
>
> Of these you probably must only implement open() and ioctl() -- you may
> provide others as hardware permits -- see how these functions are
> implemented in drivers/char/rtc.c. The interface is pretty generic, IMHO.
>
> > If their abstraction is reasonable, perhaps they can all converge to a better,
> > more generic rtc interface.
>
> Just implement the ioctls given hardware permits and return -EINVAL for
> others. Again, they are pretty generic: get/set the time, alarm, epoch,
> disable/enable various interrupts, etc. -- see include/linux/rtc.h. You
> may propose additional ioctls if they would be useful for particular
> hardware.
>
Basically agree.
Maybe the only thing really missing is a formal way to determine and report
the capability of the driver, rather through checking the return value being
-EINVAL.
I guess my original question to Geert is more on the abstraction of the RTC
hardware routines, especially anything beyond rtc_read_time() and
rt_write_time().
Jun
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2001-11-12 19:14 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-11 7:17 [RFC] generic MIPS RTC driver Jun Sun
2001-11-11 10:14 ` Geert Uytterhoeven
2001-11-11 10:14 ` Geert Uytterhoeven
2001-11-12 12:59 ` Maciej W. Rozycki
2001-11-12 12:59 ` Maciej W. Rozycki
2001-11-12 13:11 ` Geert Uytterhoeven
2001-11-12 13:11 ` Geert Uytterhoeven
2001-11-12 13:29 ` Maciej W. Rozycki
2001-11-12 13:29 ` Maciej W. Rozycki
2001-11-12 16:14 ` Pete Popov
2001-11-12 16:14 ` Pete Popov
2001-11-12 18:26 ` Jun Sun
2001-11-12 18:26 ` Jun Sun
2001-11-12 18:56 ` Jun Sun
2001-11-12 18:56 ` Jun Sun
2001-11-12 21:51 ` Tom Rini
2001-11-12 21:51 ` Tom Rini
2001-11-12 18:24 ` Jun Sun
2001-11-12 18:24 ` Jun Sun
2001-11-12 19:04 ` Maciej W. Rozycki
2001-11-12 19:04 ` Maciej W. Rozycki
2001-11-12 19:21 ` Jun Sun
2001-11-12 19:21 ` Jun Sun
2001-11-12 18:19 ` Jun Sun
2001-11-12 18:19 ` Jun Sun
2001-11-12 18:55 ` Maciej W. Rozycki
2001-11-12 18:55 ` Maciej W. Rozycki
2001-11-12 19:13 ` Jun Sun [this message]
2001-11-12 19:13 ` Jun Sun
2001-11-12 20:02 ` Geert Uytterhoeven
2001-11-12 20:02 ` Geert Uytterhoeven
2001-11-12 20:54 ` Roman Zippel
2001-11-12 20:54 ` Roman Zippel
2001-11-13 1:31 ` Tom Rini
2001-11-13 1:31 ` Tom Rini
2001-11-13 6:20 ` Geert Uytterhoeven
2001-11-13 6:20 ` Geert Uytterhoeven
2001-11-13 14:44 ` Tom Rini
2001-11-13 14:44 ` Tom Rini
2001-11-13 14:47 ` Geert Uytterhoeven
2001-11-13 14:47 ` Geert Uytterhoeven
2001-11-13 15:30 ` Roman Zippel
2001-11-13 15:30 ` Roman Zippel
2001-11-13 15:30 ` Roman Zippel
2001-11-13 13:42 ` Richard Zidlicky
2001-11-13 13:42 ` Richard Zidlicky
2001-11-13 15:32 ` Roman Zippel
2001-11-13 15:32 ` Roman Zippel
2001-11-14 9:46 ` Richard Zidlicky
2001-11-14 9:46 ` Richard Zidlicky
2001-11-13 17:58 ` Jun Sun
2001-11-13 17:58 ` Jun Sun
2001-11-14 10:08 ` Richard Zidlicky
2001-11-14 10:08 ` Richard Zidlicky
2001-11-15 17:41 ` Jun Sun
2001-11-15 17:41 ` Jun Sun
2001-11-12 1:45 ` Atsushi Nemoto
2001-11-12 19:26 ` Jun Sun
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=3BF01F6F.D64CEA50@mvista.com \
--to=jsun@mvista.com \
--cc=geert@linux-m68k.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mips@oss.sgi.com \
--cc=linuxppc-dev@lists.linuxppc.org \
--cc=macro@ds2.pg.gda.pl \
/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.