aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2007-11-07rtc: rtc-sh: Zero out tm value for invalid rtc states.Paul Mundt1-1/+3
Follows the changes of some of the other RTC drivers. If the tm value is bogus, just zero it out. Adds some sanity for RTC_RD_TIME. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-07rtc: sh-rtc: Handle rtc_device_register() failure properly.Paul Mundt1-1/+1
Currently if rtc_device_register() fails we have an IS_ERR() on the wrong pointer, which causes this to always be skipped. Fix this up to actually check the right pointer. The return value was always correct, even though the check was wrong. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-05rtc: m48t59 fix section mismatch warningRandy Dunlap1-3/+3
Change the name of this data to use a name (suffix) that is whitelisted by MODPOST so that the section warning is fixed (not generated). WARNING: vmlinux.o(.data+0x1b140): Section mismatch: reference to .init.text:m48t59_rtc_probe (between 'm48t59_rtc_platdrv' and 'm48t59_nvram_attr') Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-04rtc: ignore msb when reading back mday from alarmMark Lord1-1/+2
I have a system here that actively relies upon RTC wake alarms, and it has been failing (again) for a few days when attempting to use the /sys/class/rtc/rtc?/wakealarm interface. The old (fixed by Linus) /proc/ interface still works, but I'd like to get it using the new one. This patch fixes rtc-cmos to ignore the two upper bits when reading the BCD mday (day of month) register from CMOS. Some systems (eg. mine) seem to have the top bit set to "1" for some reason. The older /proc/ interface ignores the upper bits, and so we should too. Signed-off-by: Mark Lord <mlord@pobox.com> Acked-by: David Brownell <david-b@pacbell.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-30s3c-rtc: remove unused variableKrzysztof Helt1-2/+0
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Acked-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-20typo fixesMatt LaPlante1-1/+1
Most of these fixes were already submitted for old kernel versions, and were approved, but for some reason they never made it into the releases. Because this is a consolidation of a couple old missed patches, it touches both Kconfigs and documentation texts. Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19remove asm/bitops.h includesJiri Slaby2-2/+2
remove asm/bitops.h includes including asm/bitops directly may cause compile errors. don't include it and include linux/bitops instead. next patch will deny including asm header directly. Cc: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-18Add missing newlines to some uses of dev_<level> messagesJoe Perches1-3/+2
Found these while looking at printk uses. Add missing newlines to dev_<level> uses Add missing KERN_<level> prefixes to multiline dev_<level>s Fixed a wierd->weird spelling typo Added a newline to a printk Signed-off-by: Joe Perches <joe@perches.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Mark M. Hoffman <mhoffman@lightlink.com> Cc: Roland Dreier <rolandd@cisco.com> Cc: Tilman Schmidt <tilman@imap.cc> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jeff Garzik <jeff@garzik.org> Cc: Stephen Hemminger <shemminger@linux-foundation.org> Cc: Greg KH <greg@kroah.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Cc: James Smart <James.Smart@Emulex.Com> Cc: Andrew Vasquez <andrew.vasquez@qlogic.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16rtc: allow validated RTC_PIE_ON for non-rootBryan Kadzban1-1/+2
drivers/char/rtc.c allowed RTC_PIE_ON ioctls for non-root users, as long as the current interval (set via RTC_IRQP_SET) is <= max_user_freq. Allow RTC_PIE_ON under the same conditions when /dev/rtc* is handled by the rtc subsystem. Signed-off-by: Bryan Kadzban <bryan@kdzbn.homelinux.net> Acked-by: Alessandro Zummo <alessandro.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16rtc: add max_user_freq to sysfsBryan Kadzban1-0/+24
drivers/char/rtc.c exposed a sysctl to change the maximum frequency at which a non-root user could ask the RTC to generate interrupts (via the RTC_IRQP_SET ioctl). This value is no longer available under the new RTC subsystem, so add it to sysfs for each RTC device. Works for me on x86_64 (both reads and writes), using rtc-cmos. Signed-off-by: Bryan Kadzban <bryan@kdzbn.homelinux.net> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16rtc-cmos probe() cleanupDavid Brownell1-25/+31
Some cleanups for the rtc-cmos probe logic: - Claim i/o ports with request_region() not request_resource(), for better coexistence betwen platform and pnp bus glues. - Claim those ports earlier, to help work around procfs bugs (it allows duplicate names, like /proc/driver/rtc). - Fix some glitches in cleanup code, notably a cut'n'paste-o where the i/o port region might not get released during cleanup after a probe fault. And some comment clarifications, including noting that this code must work with PNPBIOS not just PNPACPI.. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16rtc: fix readback from /sys/class/rtc/rtc?/wakealarmMark Lord1-1/+82
Fix readback of RTC alarms on platforms which return -1 in non-hardware-supported RTC alarm fields. To fill in the missing (-1) values, we grab an RTC timestamp along with the RTC alarm value, and use the timestamp fields to populate the missing alarm fields. To counter field-wrap races (since the timestamp and alarm are not read together atomically), we read the RTC timestamp both before and after reading the RTC alarm value, and then check for wrapped fields --> if any have wrapped, we know we have a possible inconsistency, so we loop and reread the timestamp and alarm again. Wrapped fields in the RTC timestamps are an issue because rtc-cmos.c, for example, also gets/uses an RTC timestamp internally while fetching the RTC alarm. If our timestamp here wasn't the same (minutes and higher) as what was used internally there, then we might end up populating the -1 fields with inconsistent values. This fixes readbacks from /sys/class/rtc/rtc?/wakealarm, as well as other code paths which call rtc_read_alarm(). Signed-off-by: Mark Lord <mlord@pobox.com> Cc: David Brownell <david-b@pacbell.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16rtc: RTC class driver for the ds1374Scott Wood3-0/+461
This patch adds an RTC class driver for the Maxim/Dallas 1374 RTC chip, based on drivers/i2c/chips/ds1374.c. It supports alarm functionality. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16rtc-pcf8583: Check for i2c adapter functionalityJean Delvare1-0/+3
Not all i2c adapters support I2C-level messaging. Check that the adapter does before probing for a PCF8583 chip, as the driver makes use of i2c_transfer and i2c_master_send. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16rtc: make rtc-ds1742 driver hotplug-awareAtsushi Nemoto1-1/+1
The rtc-ds1742 platform driver name doesn't match its module name, which might prevents it from properly hotplugging. There is only two in-tree user of its driver, which are fixed by this patch too. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Cc: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16rtc: make rtc-ds1553 driver hotplug-awareAtsushi Nemoto1-1/+1
The rtc-ds1553 platform driver name doesn't match its module name, which might prevent it from properly hotplugging. This driver has no in-tree users. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16rtc-dev: no need to convert file->private_data to rtc deviceMark Zhan1-4/+4
In rtc-dev.c, when a rtc device is opened, file->private_data is already attached with the rtc device pointer, so there is no need to call to_rtc_device() to convert file->private_data to a rtc device pointer. Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16rtc_irq_set_freq() requires power-of-two and associated kerneldocDavid Brownell2-5/+27
RTC periodic IRQs are only defined to work for 2^N Hz values. This patch moves that validity check into the infrastructure, so drivers don't need to check it; and adds kerneldoc for the two interface functions related to periodic IRQs. (One of which was quite mysterious until its first use was recently checked in!) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16RTC: periodic irq fixAlessandro Zummo3-25/+24
Add kernel/kernel and kernel/user locking for the periodic irq feature of the rtc class. PIE ioctls are also supported. Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-09-21rtc: rtc-sh: Support 4-digit year on SH7705/SH7710/SH7712.Paul Mundt1-18/+33
All SH-4 parts have a 4-digit year, while the SH-3 parts typically only use a 2-digit one. The SH7705, SH7710, and SH7712 SH-3 parts however opted to extend it to 4-digit and still look and act like an SH-3 RTC in all other ways. This adds a capability flag (RTC_CAP_4_DIGIT_YEAR) that these corner-case CPU subtypes can set in their platform data and cleans up some of the ifdef mess in the driver as a result. Reported-by: Markus Brunner <super.firetwister@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-19rtc: rtc-ds1553.c should use resource_size_t for base addressAtsushi Nemoto1-1/+1
Currently the rtc driver, rtc-ds1552.c uses an unsigned long to store the base mmio address of the NVRAM/RTC. This breaks on 32-bit systems with larger physical addresses. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: David Brownell <david-b@pacbell.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-09-19rtc-ds1742.c should use resource_size_t for base addressDavid Gibson1-1/+1
Currently the rtc driver, rtc-ds1742.c uses an unsigned long to store the base mmio address of the NVRAM/RTC. This breaks on systems like PowerPC 440, which is a 32-bit core with 36-bit physical addresses: IO on the system, including the RTC, is typically above the 4GB point, and cannot fit into an unsigned long. This patch fixes the problem by replacing the unsigned long with a resource_size_t. Tested on Ebony (PPC440) (with additional patches to instantiate the ds1742 platform device appropriately). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-09-11RTC v3020 fixesMike Rapoport1-2/+7
Fix off-by-one in month calculations Add delay for bus accesses to satisfy Tw > 500ns Signed-off-by: Mike Rapoport <mike@compulab.co.il> Acked-by: Raphael Assenat <raph@8d.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-08-27[PATCH] rtc: Make rtc-rs5c348 driver hotplug-awareAtsushi Nemoto1-1/+1
The rtc-rs5c348 SPI driver name doesn't match its module name, which prevents it from properly hotplugging. There is only one in-tree user of its driver, which is fixed by this patch too. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Acked-by: David Brownell <david-b@pacbell.net> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-08-22rtc-max6902 minor fixesDavid Brownell1-3/+3
Minor tweaks to rtc-max6902: make it hotplug correctly, and fix a few space-before-tab whitespace botches. This driver has no current in-tree users, so the hotplug fix changes the driver name. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-08-22correct name for rtc-m41t80David Brownell1-1/+1
The new rtc-m41t80 driver name doesn't match its module name, which prevents it from properly hotplugging. Since it's new, no platforms yet depend on that name ... so this patch fixes the driver name to match its module name, rather than going the other way around with a MODULE_ALIAS(). NOTE: This sort of bug is a new thing to watch out for with new-style I2C drivers; previously I2C couldn't hotplug. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-31rtc-m48t59 driver NO_IRQ mode fixupMark Zhan1-1/+1
Since irq in m48t59_private struct is defined as 'unsigned int', which will make the following if sentence to be never true: if (m48t59->irq < 0) m48t59->irq = NO_IRQ; And thus it will make the m48t59_rtc_probe() is failed when the driver is working in a no irq mode: Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-31Use menuconfig objects: RTCJan Engelhardt1-47/+31
Change Kconfig objects from "menu, config" into "menuconfig" so that the user can disable the whole feature without having to enter the menu first. Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Cc: David Brownell <david-b@pacbell.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-31Remove the arm26 portAdrian Bunk1-1/+1
The arm26 port has been in a state where it was far from even compiling for quite some time. Ian Molton agreed with the removal. Signed-off-by: Adrian Bunk <bunk@stusta.de> Cc: Ian Molton <spyro@f2s.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-31rtc-dev: Make RTC driver return ENOTTY instead of ENOIOCTLCMDThomas Hommel1-0/+2
Prevent the RTC driver from returning ENOIOCTLCMD to userspace. Signed-off-by: Thomas Hommel <thomas.hommel@gefanuc.com> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-31s3c2410: fixup after arch movesBen Dooks1-1/+1
Fixup the changes from moving around the arch support for s3c24xx based systems. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-30Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.23Linus Torvalds1-0/+1
* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.23: sh: Fix fs.h removal from mm.h regressions. sh: fix get_wchan() for SH kernels without framepointers sh: arch/sh/boot - fix shell usage rtc: rtc-sh: Correct sh_rtc_set_time() for some SH-3 parts. sh: remove support for sh7300 and solution engine 7300 sh: Add sh to the CC_OPTIMIZE_FOR_SIZE dependencies. sh: Kill off virt_to_bus()/bus_to_virt(). sh: sh-sci - fix SH7708 support sh: Restrict DSP support to specific CPUs. sh: Silence sq compile warning on sh4 nommu. sh: Kill the rest of the SE73180 cruft. sh: remove support for sh73180 and solution engine 73180 sh: remove old broken pint code sh: Reclaim beginning of P3 space for vmalloc area. sh: Fix Dreamcast DMA issues. sh: Add kmap_coherent()/kunmap_coherent() interface for SH-4.
2007-07-28Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6Linus Torvalds1-1/+1
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: Input Serio: Blackfin doesnt support I8042 - make sure it doesnt get selected Blackfin arch: add BF54x I2C/TWI TWI0 driver support Blackfin On-Chip RTC driver update for supporting BF54x Blackfin Ethernet MAC driver: fix bug Report returned -ENOMEM upwards (in case L1/uncached memory alloc fails) Blackfin arch: add error message when IRQ no available Blackfin arch: Initialize the exception vectors early in the boot process Blackfin arch: fix a compiling warning about dma-mapping Blackfin arch: switch to using proper defines this time THREAD_SIZE and PAGE_SIZE instead of just PAGE_SIZE everywhere Blackfin arch: fix bug which unaligns the init thread's stack and causes the current macro to fail. Blackfin arch: Load P0 before storing through it Blackfin arch: fix KGDB bug, dont forget last parameter. Blackfin arch: add selections for BF544 and BF542 Blackfin arch: use bfin_read_SWRST() now that BF561 provides it Blackfin arch: setup aliases for some core Core A MMRs
2007-07-26Reorder RTC MakefileAlessandro Zummo1-20/+22
Alphabetic reordering of the drivers in the rtc subsys makefile. (akpm: merge this asap! Makefiles are the source of many patch conflicts..) Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-26rtc-ds1307: typo fix found by coverityDavid Brownell1-1/+1
Fix a typo turned up by a Coverity check: referring to the wrong register, which could cause problems with DS1338 RTCs whose oscillators halted. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-26fix missing arguments in drivers/rtc/rtc-stk17ta8.cAl Viro1-2/+4
struct bin_attribute * is needed in bin_attribute ->read()/->write() now. Incidentally, could people please run the fscking compiler before and after applying their patch and compare the build logs? That (and many, many other) would be caught immediately. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-26rtc: rtc-sh: Correct sh_rtc_set_time() for some SH-3 parts.Markus Brunner1-0/+1
Some SH-3 parts (SH7720 and SH7705 at least) need to have the start bit explicitly cleared, as the reset is not enough. This is safe across all parts, so simply clear the start bit in the sh_rtc_set_time() path. Signed-off-by: Markus Brunner <super.firetwister@gmail.com> Signed-off by: Mark Jonas <toertel@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-25Cleanup non-arch xtime uses, use get_seconds() or current_kernel_time().john stultz1-2/+3
This avoids use of the kernel-internal "xtime" variable directly outside of the actual time-related functions. Instead, use the helper functions that we already have available to us. This doesn't actually change any behaviour, but this will allow us to fix the fact that "xtime" isn't updated very often with CONFIG_NO_HZ (because much of the realtime information is maintained as separate offsets to 'xtime'), which has caused interfaces that use xtime directly to get a time that is out of sync with the real-time clock by up to a third of a second or so. Signed-off-by: John Stultz <johnstul@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-21rtc: add support for STK17TA8 chipThomas Hommel3-0/+431
This patch adds support for the Simtek STK17TA8 timekeeping chip. The STK17TA8 is quite similar to the DS1553, but differs in register layout and in various control bits in the registers. I chose to make this a new driver to avoid confusion in the code and to not get lost in #ifdefs. Signed-off-by: Thomas Hommel <thomas.hommel@gefanuc.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-21rtc: update and use the MAX6900 century byteDale Farnsworth1-24/+72
We now read and write the century byte in the max6900 chip. We probably don't need to do so on Linux-only system, but it's necessary when the chip is shared by another OS that uses the century byte. Signed-off-by: Dale Farnsworth <dale@farnsworth.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-21rtc kconfig: point out need for static linkageDavid Brownell1-0/+3
Various people have expressed surprise that their modular RTC drivers don't seem to work for initializing the system time at boot. To help avoid such unpleasantness, make the Kconfig text point out that the driver probably needs to be statically linked. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-21rtc: do not return void valueAtsushi Nemoto2-2/+2
This patch fixes these sparse warnings: drivers/rtc/rtc-ds1742.c:265:2: warning: returning void-valued expression drivers/rtc/rtc-ds1553.c:409:2: warning: returning void-valued expression Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: David Brownell <david-b@pacbell.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-20sh: Fix up SH-3 and SH-4 driver dependencies.Paul Mundt1-1/+1
Both shwdt and rtc-sh are only supported on SH-3 and SH-4 at the moment, don't allow them to break the SH-2 and SH-5 (sh64) builds. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-19RTC: add periodic irq support to rtc-cmosAlessandro Zummo1-2/+31
Adds support for periodic irq enabling in rtc-cmos. This could be used by the ALSA driver and is already being tested with the zaptel ztdummy module. Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17OMAP: add TI TWL92330/Menelaus Power Management chip driverTony Lindgren1-0/+9
Add Texas Instruments TWL92330/Menelaus Power Management chip driver. This includes voltage regulators, Dual slot memory card tranceivers and real-time clock(RTC). The support for RTC is integrated with this driver only; it is not separate module. Passes 'rtctest' on OMAP H4 EVM, other than lack of "periodic" (1/N second) IRQs. System wakeup alarms (from suspend-to-RAM) work too. The battery keeps the RTC active over power off, so once you set clock (rdate/ntpdate/etc, then "hwclock -w") then RTC_HCTOSYS at boot time will behave as expected. Cc: "Jean Delvare" <khali@linux-fr.org> Cc: "Tony Lindgren" <tony@atomide.com> Cc: "David Brownell" <david-b@pacbell.net> Signed-off-by: Trilok Soni <soni.trilok@gmail.com> Acked-by: Alessandro Zummo <alessandro.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17rtc-ds1307 becomes new-style i2c driverDavid Brownell1-75/+53
Convert the rtc-ds1307 driver into a "new style" driver. Also improve probe() checks: be more correct about switching out of AM/PM mode, and issue a (debug) diagnostic when failing due to bogus register values. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Andrew Victor <andrew@sanpeople.com> Cc: Bill Gatliff <bgat@billgatliff.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Kumar Gala <galak@gate.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17rtc-ds1307: oscillator restart for ds13{37,38,39,40}Rodolfo Giometti1-21/+45
When we find a ds1337 or ds1339 with the oscillator powered off, turn it on. If the oscillator fault flag was set, clear it and warn that the clock needs to be set. David Brownell: Bugfixes; provide corresponding update for ds1338, and the core of the fix for ds1340. Use a common warning message ("SET TIME!") whenever the clock needs to be set after oscillator fault (or oscillator enable, if fault is not a separate status). Signed-off-by: Rodolfo Giometti <giometti@linux.it> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17RTC driver for DS1216 chipsThomas Bogendoerfer3-0/+233
RTC driver for Dallas/Maxim DS126 chips used in SNI RM200/RM400 [akpm@linux-foundation.org: cleanups] Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17rtc: add support for the ST M48T59 RTCMark Zhan3-0/+502
[akpm@linux-foundation.org: x86_64 build fix] [akpm@linux-foundation.org: The acpi guys changed the bin_attribute code] Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17rtc: watchdog support for rtc-m41t80 driverAtsushi Nemoto2-0/+295
Add a watchdog driver interface to rtc-m41t80 driver. This is derived from works by Alexander Bigga <ab@mycable.de> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Alexander Bigga <ab@mycable.de> Cc: David Brownell <david-b@pacbell.net> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>