summaryrefslogtreecommitdiff
path: root/drivers/rtc
AgeCommit message (Collapse)Author
2008-07-04rtc-x1205: Fix alarm setMichael Hamel
I have discovered that the current version of rtc-x1205.c does not work correctly when asked to set the alarm time by the RTC_WKALM_SET ioctl() call. This happens because the alarm registers do not behave like the current-time registers. They are non-volatile. Two things go wrong: - the X1205 requires a 10 msec delay after any attempt to write to the non-volatile registers. The x1205_set_datetime() routine does the write as 8 single-byte writes without any delay. Only the first write succeeds. The second is NAKed because the chip is busy. - the X1205 resets the RWEL bit after any write to the non-volatile registers. This would lock out any further writes after the first even with a 10msec delay. I fix this by doing a single 8-byte write and then waiting 10msec for the chip to be ready. A side effect of this change is that it will speed up x1205_rtc_set_time() which uses the same code. I have also implemented the 'enable' bit in the rtc_wkalm structure, which the existing driver does not attempt to do. I have modified both x1205_rtc_set_alarm() to set the AL0E bit, and x1205_rtc_read_alarm() to return it. I have tested this patch on a LinkSys NSLU2 under OpenWRT, but on no other hardware. On the NSLU2 the X1205 correctly asserts its IRQ pin when the alarm time matches the current time. [akpm@linux-foundation.org: clean up over-parenthesisation] Signed-off-by: Michael Hamel <mhamel@adi.co.nz> 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>
2008-07-04rtc: rtc_read_alarm() handles wraparoundDavid Brownell
While 0e36a9a4a788e4e92407774df76c545910810d35 ("rtc: fix readback from /sys/class/rtc/rtc?/wakealarm") made sure that active alarms were never returned with invalid "wildcard" fields (negative), it can still report (wrongly) that the alarm triggers in the past. Example, if it's now 10am, an alarm firing at 5am will be triggered TOMORROW not today. (Which may also be next month or next year...) This updates that alarm handling in three ways: * Handle alarm rollover in the common cases of RTCs that don't support matching on all date fields. * Skip the invalid-field logic when it's not needed. * Minor bugfix ... tm_isdst should be ignored, it's one of the fields Linux doesn't maintain. A warning is emitted for some of the unhandled rollover cases, but the possible combinations are a bit too numerous to handle every bit of potential hardware and firmware braindamage. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Mark Lord <lkml@rtr.ca> 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>
2008-06-22[ARM] 5109/1: Mark rtc sa1100 driver as wakeup source before registering itUli Luckas
Mark rtc sa1100 driver as wakeup source before registering it. rtc_device_register evaluates device_can_wakeup(rtc->dev.parent) and supresses the creation of /sys/class/rtc/rtcX/wakealarm if device_can_wakeup is not (yet) true. Signed-off-by: Uli Luckas <u.luckas@road.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-06-12rtc: Ramtron FM3130 RTC supportSergey Lapin
Ramtron FM3130 is a chip with two separate devices inside, RTC clock and FRAM. This driver provides only RTC functionality. This chip is met in lots of custom boards with AT91SAMXXXX CPU I work with, is cheap and in no way better or worse than any other RTC on market. While it is mostly met on much smaller devices, I think it is great to have it supported in Linux. Signed-off-by: Sergey Lapin <slapin@ossfans.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>
2008-06-12provide rtc_cmos platform deviceStas Sergeev
Recently (around 2.6.25) I've noticed that RTC no longer works for me. It turned out this is because I use pnpacpi=off kernel option to work around the parport_pc bugs. I always did so, but RTC used to work fine in the past, and now it have regressed. The patch fixes the problem by creating the platform device for the RTC when PNP is disabled. This may also help running the PNP-enabled kernel on an older PCs. Signed-off-by: Stas Sergeev <stsp@aknet.ru> Cc: David Brownell <david-b@pacbell.net> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-06-12rtc-at32ap700x: fix bug in at32_rtc_readalarm()Haavard Skinnemoen
alarm->pending indicates whether there's an alarm that has actually been triggered, not whether we're waiting for it. alarm->enabled indicates that. Also add missing locking around reading the RTC registers. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> 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>
2008-06-06rtc: class driver for ppc_md RTC functionsDavid Woodhouse
This hooks up the platform-specific [gs]et_rtc_time functions so that kernels using CONFIG_RTC_CLASS have RTC support on most PowerPC platforms. A new driver, and one which we've been shipping in Fedora for a while already, since otherwise RTC support breaks. [akpm@linux-foundation.org: fix Kconfig indenting] Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Paul Mackerras <paulus@samba.org> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Acked-by: David Brownell <david-b@pacbell.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-06-06rtc-ds1374: rename device to just "ds1374"Jean Delvare
Change the name of the device from "rtc-ds1374" to just "ds1374", to match what all other RTC drivers do. I seem to remember that this name was chosen to avoid possible confusion with an older ds1374 driver, but that driver was removed 3 months ago. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Acked-by: Kumar Gala <galak@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> 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>
2008-05-13rtc: m41t80: include <linux/kernel.h> for printk()Maciej W. Rozycki
The driver uses printk(), but does not include <linux/kernel.h> -- add it. Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexander Bigga <ab@mycable.de> Cc: Wim Van Sebroeck <wim@iguana.be> 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>
2008-05-13RTC/watchdog: M41T80: fix a potential use of unitialized dataMaciej W. Rozycki
Watchdog handlers within the driver make use of "save_client" -- make sure it has been initalized before the handlers are registered. Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexander Bigga <ab@mycable.de> Cc: Wim Van Sebroeck <wim@iguana.be> 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>
2008-05-13rtc: rtc_time_to_tm: use unsigned arithmeticMaciej W. Rozycki
The input argument to rtc_time_to_tm() is unsigned as well as are members of the output structure. However signed arithmetic is used within for calculations leading to incorrect results for input values outside the signed positive range. If this happens the time of day returned is out of range. Found the problem when fiddling with the RTC and the driver where year was set to an unexpectedly large value like 2070, e.g.: rtc0: setting system clock to 2070-01-01 1193046:71582832:26 UTC (3155760954) while it should be: rtc0: setting system clock to 2070-01-01 00:15:54 UTC (3155760954) Changing types to unsigned fixes the problem. [akpm@linux-foundation.org: remove old-fashioned `register' keyword] Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Cc: Dmitri Vorobiev <dmitri.vorobiev@gmail.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-05-11i2c: Match dummy devices by typeJean Delvare
As the old driver_name/type matching scheme is going away soon, change the dummy device mechanism to use the new matching scheme. This has the downside that dummy i2c clients can no longer choose their name, they'll all appear as "dummy" in sysfs and in log messages. I don't think it is a problem in practice though, as there is little reason to use these i2c clients to log messages. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-05-09Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (37 commits) SH: catch negative denormal_subf1() retval in denormal_add() sh: Fix DMAC base address for SH7709S sh: update smc91x platform data for se7206. sh: Stub in cpu_to_node() and friends for NUMA build. sh: intc register modify fix sh: no high level trigger on some sh3 cpus sh: clean up sh7710 and sh7720 intc tables sh: add interrupt ack code to sh3 sh: unify external irq pin code for sh3 sh-sci: avoid writing to nonexistent registers sh-sci: sh7722 lacks scsptr registers sh-sci: improve sh7722 support sh: reset hardware from early printk sh: drain and wait for early printk sh: use sci_out() for early printk sh: add memory resources to /proc/iomem sh: add kernel bss resource sh: fix sh7705 interrupt vector typo sh: update smc91x platform data for se7722 sh: update smc91x platform data for MigoR ...
2008-05-08fix irq flags in rtc-ds1511Steven Rostedt
The file in drivers/rtc/rtc-ds1551.c uses "int" for flags. This can cause hard to find bugs on some architectures. This patch converts the flags to use "long" instead. This bug was discovered by doing an allyesconfig make on the -rt kernel where checks are done to ensure all flags are of size sizeof(long). Signed-off-by: Steven Rostedt <srostedt@redhat.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>
2008-05-08rtc: rtc-sh: Fixup for 64-bit resources.Paul Mundt
ioremap() and friends get the size information right, so force everything to go through there. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-04-30Merge branch 'release' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (179 commits) ACPI: Fix acpi_processor_idle and idle= boot parameters interaction acpi: fix section mismatch warning in pnpacpi intel_menlo: fix build warning ACPI: Cleanup: Remove unneeded, multiple local dummy variables ACPI: video - fix permissions on some proc entries ACPI: video - properly handle errors when registering proc elements ACPI: video - do not store invalid entries in attached_array list ACPI: re-name acpi_pm_ops to acpi_suspend_ops ACER_WMI/ASUS_LAPTOP: fix build bug thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed ACPI: check a return value correctly in acpi_power_get_context() #if 0 acpi/bay.c:eject_removable_drive() eeepc-laptop: add hwmon fan control eeepc-laptop: add backlight eeepc-laptop: add base driver ACPI: thinkpad-acpi: bump up version to 0.20 ACPI: thinkpad-acpi: fix selects in Kconfig ACPI: thinkpad-acpi: use a private workqueue ACPI: thinkpad-acpi: fluff really minor fix ACPI: thinkpad-acpi: use uppercase for "LED" on user documentation ... Fixed conflicts in drivers/acpi/video.c and drivers/misc/intel_menlow.c manually.
2008-04-29i2c: Convert most new-style drivers to use module aliasingJean Delvare
Based on earlier work by Jon Smirl and Jochen Friedrich. Update most new-style i2c drivers to use standard module aliasing instead of the old driver_name/type driver matching scheme. I've left the video drivers apart (except for SoC camera drivers) as they're a bit more diffcult to deal with, they'll have their own patch later. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Jon Smirl <jonsmirl@gmail.com> Cc: Jochen Friedrich <jochen@scram.de>
2008-04-29i2c: Add support for device alias namesJean Delvare
Based on earlier work by Jon Smirl and Jochen Friedrich. This patch allows new-style i2c chip drivers to have alias names using the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this point, the old i2c driver binding scheme (driver_name/type) is still supported. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Jochen Friedrich <jochen@scram.de> Cc: Jon Smirl <jonsmirl@gmail.com> Cc: Kay Sievers <kay.sievers@vrfy.org>
2008-04-29Remove duplicated unlikely() in IS_ERR()Hirofumi Nakagawa
Some drivers have duplicated unlikely() macros. IS_ERR() already has unlikely() in itself. This patch cleans up such pointless code. Signed-off-by: Hirofumi Nakagawa <hnakagawa@miraclelinux.com> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Jeff Garzik <jeff@garzik.org> Cc: Paul Clements <paul.clements@steeleye.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Michael Halcrow <mhalcrow@us.ibm.com> Cc: Anton Altaparmakov <aia21@cantab.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Carsten Otte <cotte@de.ibm.com> Cc: Patrick McHardy <kaber@trash.net> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29drivers: use non-racy method for proc entries creation (2)Denis V. Lunev
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data be setup before gluing PDE to main tree. Signed-off-by: Denis V. Lunev <den@openvz.org> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Peter Osterlund <petero2@telia.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Neil Brown <neilb@suse.de> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Bjorn Helgaas <bjorn.helgaas@hp.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>
2008-04-29rtc: dont reference pnp_resource_table directlyBjorn Helgaas
pnp_resource_table is going away soon, so use the more generic public interfaces instead. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-By: Rene Herman <rene.herman@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-28rtc: replace remaining __FUNCTION__ occurrencesHarvey Harrison
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.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>
2008-04-28rtc: add the support for alarm time relative to current time in sysfsZhao Yakui
In current kernel if we want to set the alarm time, the absolute time the seconds relative to 1970-01-01 00:00:00) should be written into /sys/class/rtc/rtc0/wakealarm. It is not convenient. It is more reasonable to add the support for the alarm time relative to current RTC time.(the unit is second) For example: If the RTC is required to generate alarm after 2 minutes, the following will be OK. echo +120 > /sys/class/rtc/rtc0/wakealarm or echo +0x78 > /sys/class/rtc/rtc0/wakealarm Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> 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>
2008-04-28rtc: rtc-rs5c372: fix up NULL name in transfer error pathPaul Mundt
rs5c_get_regs() currently uses rs5c->rtc->name for its debug printk when i2c_transfer() fails, though it is used several times before the rtc dev has been registered. The earliest we can get at the symbolic name is via the i2c client's struct device, which can be handled by moving the first rs5c_get_regs() until after the client pointer is assigned. Signed-off-by: Paul Mundt <lethal@linux-sh.org> 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>
2008-04-28make ds1511_rtc_{read,set}_time() staticAdrian Bunk
Make the needlessly global ds1511_rtc_{read,set}_time() static. Signed-off-by: Adrian Bunk <bunk@kernel.org> 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>
2008-04-28rtc: silence section mismatch warning in rtc-testSam Ravnborg
Fix following warning: WARNING: vmlinux.o(.data+0x253e28): Section mismatch in reference from the variable test_drv to the function .devexit.text:test_remove() Fix by renaming the platfrom_driver variable from *_drv to *_driver so modpost ignore the reference to an __devexit section. Signed-off-by: Sam Ravnborg <sam@ravnborg.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>
2008-04-28rtc-x1205: new style conversionAlessandro Zummo
[akpm@linux-foundation.org: coding-style fixes] 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>
2008-04-28rtc-pcf8563: new style conversionAlessandro Zummo
[akpm@linux-foundation.org: coding-style fixes] 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>
2008-04-28rtc-isl1208: new style conversion and minor bug fixesAlessandro Zummo
[akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: Herbert Valerio Riedel <hvr@gnu.org> 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>
2008-04-28rtc: avoid legacy drivers with generic frameworkDavid Brownell
Kconfig tweaks to help reduce RTC configuration bugs, by avoiding legacy RTC drivers when the generic RTC framework is enabled: - If rtc-cmos is selected, disable the legacy rtc driver; - When using generic RTC on x86, enable rtc-cmos by default; - In the old "chardev RTC" section of Kconfig, add a comment warning people off these (seven) legacy RTC drivers when the generic framework is in use. People can still use the legacy drivers if they want (or need) to. This doesn't fix the broken dependencies for the legacy "CMOS" RTC driver. Ideally it would be a full list of platforms where it works, not a partial list of ones where it won't. Or better yet, it would depend on a "HAVE_CMOS_RTC" flag defined by various platforms ... surely there's a Kconfig style guideline lurking there. 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>
2008-04-28rtc-pcf8583 build fixDavid Brownell
Fix bogus #include in rtc-pcf8583, so it compiles on platforms that don't support PC clone RTCs. (Original issue noted by Adrian Bunk.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Adrian Bunk <bunk@kernel.org> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-18rtc: rtc-sh: Add support for periodic IRQs.Angelo Castello
This adds support for periodic IRQs to the rtc-sh driver. RTC_IRQP_READ/RTC_IRQP_SET are added, with a number of other fixes and reordering across the rest of the code. Signed-off-by: Angelo Castello <angelo.castello@st.com> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-04-15rtc: fix the error in the function of cmos_set_alarmZhao Yakui
There is a bug in the function of cmos_set_alarm. RTC alarm time for October can't be set correctly. For October: 0x0A will be written into the RTC region (MONTH_ALARM) in current kernel. But in fact 0x10 should be written. Wildcards are also not handled correctly. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> 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>
2008-04-11rtc: fix platform driver hotplug/coldplugKay Sievers
Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable RTC platform drivers, to re-enable module auto loading. [dbrownell@users.sourceforge.net: more drivers, minor fix] Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Greg KH <greg@kroah.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>
2008-04-11rtc: rtc-s35390a.c needs the bitreverse libraryRandy Dunlap
rtc-s35390a uses BITREVERSE functions so it needs to select that config symbol to ensure that the functions are built. drivers/built-in.o: In function `s35390a_set_datetime': linux-2.6.25-rc8-git7/drivers/rtc/rtc-s35390a.c:144: undefined reference to `byte_rev_table' drivers/built-in.o: In function `s35390a_get_datetime': linux-2.6.25-rc8-git7/drivers/rtc/rtc-s35390a.c:163: undefined reference to `byte_rev_table' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.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>
2008-03-19rtc-at91sam9 fixesDavid Brownell
Updates to the at91sam9 rtt-as-rtc driver: - Bugfix: IRQ enable bits need shifting before masking with status - Platform code to initialize wakeup bits didn't get merged; cope Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Justin Waters <justin.waters@timesys.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>
2008-03-19rtc: fix kconfig helpAlessandro Zummo
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>
2008-03-04rtc: add support for the S-35390A RTC chipByron Bradley
This adds basic get/set time support for the Seiko Instruments S-35390A. This chip communicates using I2C and is used on the QNAP TS-109/TS-209 NAS devices. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Byron Bradley <byron.bbradley@gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Acked-by: David Brownell <david-b@pacbell.net> Tested-by: Tim Ellis <tim@ngndg.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>
2008-02-23rtc-cmos: display HPET emulation modeDavid Brownell
For the "cmos" RTC, have /proc/driver/rtc say whether HPET based IRQ emulation is in effect. Given the problems we've had with this particular hardware maldesign (and the fact that most BIOS code seems not to provide the IRQ routing needed to use the saner HPET modes), this should help troubleshooting. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-09rtc-r9701.c: silence compiler warningS.Çağlar Onur
Commit 75b6102257874a4ea796af686de2f72cfa0452f9 ("rtc: add support for Epson RTC-9701JE V4") introduced the warning drivers/rtc/rtc-r9701.c: In function `r9701_get_datetime': drivers/rtc/rtc-r9701.c:74: warning: unused variable `time' Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06rtc: at91sam9 RTC support (RTT and/or RTC)David Brownell
AT91sam9 RTC support, primarily in the form of an RTT-as-RTC driver that was extracted from 2.6.23-at91 patch and updated: - Relies on now-merged platform updates, which associate the RTT hardware address with each RTT and use the "at91_rtt" name. - RTC framework related fixes and cleanups, notably: * removed now-needless suspend/resume clock offset logic * alarm read/write now respects the "enabled" flag * suspend always disables update irqs * shutdown (and startup) disables all irqs - Misc cleanup: * use dev_*() messaging * add comments * remove globals, * ... etc - Don't force use of RTT0 and GPBR0. Either resource may need to be used for other purposes (like NO_HZ support). - Update "AT91RM9200 RTC" Kconfig to allow it on SAM9RL chips (it has both RTT and RTC). Driver binding uses bus_find_device() to avoid needing any kind of "timer library" code when there's more than one RTT module. (This timer can be used as an RTC, to support NO_HZ operation, or potentially for other stuff. The choice is a per-system policy.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Michel Benoit <murpme@gmail.com> Cc: Nicolas Ferre <nicolas.ferre@rfo.atmel.com> Cc: Andrew Victor <linux@maxim.org.za> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06rtc: remove more dev->power.power_state usageDavid Brownell
Remove some more references to dev->power.power_state. That field is overdue for removal, but we can't do that while it's still referenced in the kernel. The only reason to update it was to make the /sys/devices/.../power/state files (now removed) work better. 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>
2008-02-06rtc ds1307: ds_1340 change initfrederic Rodo
For DS140, clear the oscillator fault flag as needed. Signed-off-by: Frederic RODO <f.rodo@til-technologies.fr> [ And remove some "sparse" warnings. ] 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>
2008-02-06rtc: add support for Epson RTC-9701JE V4Magnus Damm
Add support for the Epson RTC-9701JE SPI RTC device. Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Acked-by: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06rtc: add support for Epson RTC-9701JE V2Magnus Damm
Add support for the Epson RTC-9701JE SPI RTC device. Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Acked-by: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06rtc: add HPET RTC emulation to RTC_DRV_CMOSBernhard Walle
That patch adds the RTC emulation of the HPET timer to the new RTC_DRV_CMOS. The old drivers/char/rtc.ko driver had that functionality and it's important on new systems. [akpm@linux-foundation.org: unbreak alpha build] Signed-off-by: Bernhard Walle <bwalle@suse.de> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Andi Kleen <ak@suse.de> Cc: john stultz <johnstul@us.ibm.com> Cc: Robert Picco <Robert.Picco@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06Blackfin RTC driver: convert sync wait to use the irq write complete noticeMike Frysinger
- thus clearing out the need for spin locks - add a small optimization for reading of the rtc field Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.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>
2008-02-06Blackfin RTC driver: shave off another memcpy() by using assignment.Mike Frysinger
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.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>
2008-02-06Blackfin RTC driver: read_alarm() checks the enabled field, not the pending ↵Mike Frysinger
field. also, dont bother using memcpy since we can just do an assignment of the same structure. Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.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>
2008-02-06Blackfin RTC driver: use dev_dbg() rather than pr_stamp()Mike Frysinger
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.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>