aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-sa1100.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-12-21ARM: 6455/2: Better use of the RTC framework for sa11xx.Marcelo Roberto Jimenez1-24/+74
This patch uses the RTC framework to treat some common ioctl. In particular, it fixes the behaviour of rtc_irq_set_freq(), which did not work as expected because the timer was not beeing retriggered. Signed-off-by: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-11-10ARM: 6454/1: sa1100: Fix for a nasty initialization bug in the RTSR.Marcelo Roberto Jimenez1-1/+41
This patch fixes a nasty initialization condition on the RTSR register. Sometimes, bit 1 will wake up set, sometimes not. This can be seen by checking the value of the RTSR by typing '$ cat /proc/driver/rtc', which has been provided by the previous patch. If this bit is set, the command '$ cat /dev/rtc0' will lock the system in an endless interrupt routine calling loop. This patch fixes the issue both at sa1100_rtc_probe(), where it avoids a spurious interrupt from happening, and at sa1100_rtc_interrupt(), which is the robust solution, though it does not avoid the first spurious interrupt. Signed-off-by: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-11-10ARM: 6453/1: sa1100: Print the value of RTSR on /proc/drivers/rtc.Marcelo Roberto Jimenez1-0/+1
This patch adds a line to the output of /proc/drivers/rtc to show the value of the RTSR register. It will be used to demonstrate a nasty initialization bug that will be fixed in the sequence. Signed-off-by: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-11-10ARM: 6452/1: Fix checkpatch.pl issues in drivers/rtc/rtc-sa1100.c.Marcelo Roberto Jimenez1-9/+11
This patch fixes checkpatch.pl issues in drivers/rtc/rtc-sa1100.c, which I will later modify. Signed-off-by: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-15const: constify remaining dev_pm_opsAlexey Dobriyan1-1/+1
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-22Merge branch 'master' into for-linusRussell King1-1/+1
2009-09-15Nicolas Pitre has a new email addressNicolas Pitre1-1/+1
Due to problems at cam.org, my nico@cam.org email address is no longer valid. FRom now on, nico@fluxnic.net should be used instead. Signed-off-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-10[ARM] pxa: update rtc-sa1100.c to use 'struct dev_pm_ops'Haojian Zhuang1-10/+13
Remove the following warning: Platform driver 'sa1100-rtc' needs updating - please use dev_pm_ops Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
2009-03-09[ARM] pxa: separate definitions from pxa-regs.h and remove it finallyEric Miao1-1/+2
The remaining registers are separated into: - <mach/regs-ost.h> - <mach/regs-rtc.h> - <mach/regs-intc.h> and then we can remove pxa-regs.h completely. Instead of #include this file, let's: 1. include the specific <mach/regs-*.h> with care (if that's absolutely necessary) 2. define the registers in the driver, make cleanly defined API to expose the register access to external with sufficient reason Signed-off-by: Eric Miao <eric.miao@marvell.com>
2008-12-29[ARM] rtc-sa1100: don't assume CLOCK_TICK_RATE to be a constantEric Miao1-5/+7
As Nicolas and Russell pointed out, CLOCK_TICK_RATE is no more a constant on PXA when multiple processors and platforms are selected, change TIMER_FREQ in rtc-sa1100.c into a variable. Since the code to decide the clock tick rate is re-used from timer.c, introduce a common get_clock_tick_rate() for this. Signed-off-by: Eric Miao <eric.miao@marvell.com> Acked-by: Nicolas Pitre <nico@marvell.com>
2008-08-07[ARM] Move include/asm-arm/arch-* to arch/arm/*/include/machRussell King1-2/+2
This just leaves include/asm-arm/plat-* to deal with. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07[ARM] Remove asm/hardware.h, use asm/arch/hardware.h insteadRussell King1-1/+1
Remove includes of asm/hardware.h in addition to asm/arch/hardware.h. Then, since asm/hardware.h only exists to include asm/arch/hardware.h, update everything to directly include asm/arch/hardware.h and remove asm/hardware.h. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-07-10Merge branches 'at91', 'dyntick', 'ep93xx', 'iop', 'ixp', 'misc', 'orion', 'omap-reviewed', 'rpc', 'rtc' and 's3c' into develRussell King1-3/+38
2008-06-22[ARM] 5109/1: Mark rtc sa1100 driver as wakeup source before registering itUli Luckas1-2/+2
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-05-22[RTC] rtc-sa1100: remove dependence on asm/rtc.hRussell King1-1/+36
Move the two functions rtc-sa1100 wants from the old ARM RTC library into the rtc-sa1100 driver. Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-04-11rtc: fix platform driver hotplug/coldplugKay Sievers1-0/+1
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-02-06rtc: remove more dev->power.power_state usageDavid Brownell1-12/+4
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-01-26[ARM] pxa/sa1100: replace wakeup supportRussell King1-0/+31
Replace wakeup support using the alarm via the SA1100 RTC driver on SA1100 and PXA platforms. This allows RTC alarm wakeup to be enabled via sysfs using the conventional attributes. Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-10-19remove asm/bitops.h includesJiri Slaby1-1/+1
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-05-08rtc: rtc interfaces don't use class_deviceDavid Brownell1-2/+2
This patch removes class_device from the programming interface that the RTC framework exposes to the rest of the kernel. Now an rtc_device is passed, which is more type-safe and streamlines all the relevant code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> 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-02-20[PATCH] rtc-sa1100 rtc_wklarm.enabled bugfixesDavid Brownell1-5/+7
Some rtc-sa1100 bugfixes: - The read_alarm() method reports the rtc_wkalrm.enabled field properly. This patch is already in the handhelds.org tree. - And the set_alarm() method now handles that flag correctly, rather than making mismatched {en,dis}able_irq_wake() calls, which trigger runtime warning messages. (Those calls are best made in suspend/resume methods.) Note that while this SA1100/PXA RTC is fully capable of waking those ARM processors from sleep states, that mechanism isn't properly supported on either processor family, or in this driver. Some boards have board-specific PM glue providing partial workarounds for the weak generic PM support. 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>
2006-12-13[PATCH] rtc framewok: rtc_wkalrm.enabled reporting updatesDavid Brownell1-3/+1
Fix a glitch in the procfs dumping of whether the alarm IRQ is enabled: use the traditional name (from drivers/char/rtc.c and many other places) of "alarm_IRQ", not "alrm_wakeup" (which didn't even match the efirtc code, which originated that reporting API). Also, update a few of the RTC drivers to stop providing that duplicate status, and/or to expose it properly when reporting the alarm state. We really don't want every RTC driver doing their own thing here... Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells1-4/+2
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: David Howells <dhowells@redhat.com> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-01[PATCH] constify rtc_class_ops: update driversDavid Brownell1-1/+1
Update RTC framework so that drivers can constify their method tables, moving them from ".data" to ".rodata". Then update the drivers. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-02[PATCH] irq-flags: misc drivers: Use the new IRQF_ constantsThomas Gleixner1-3/+3
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: "David S. Miller" <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-27[PATCH] spin/rwlock init cleanupsIngo Molnar1-1/+1
locking init cleanups: - convert " = SPIN_LOCK_UNLOCKED" to spin_lock_init() or DEFINE_SPINLOCK() - convert rwlocks in a similar manner this patch was generated automatically. Motivation: - cleanliness - lockdep needs control of lock initialization, which the open-coded variants do not give - it's also useful for -rt and for lock debugging in general Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-25[PATCH] rtc subsystem: add capability checksAlessandro Zummo1-4/+0
Centralize CAP_SYS_XXX checks to avoid duplicate code and missing checks in the drivers. Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-05-21[PATCH] rtc subsystem: use ENOIOCTLCMD and ENOTTY where appropriateAlessandro Zummo1-1/+1
Appropriately use -ENOIOCTLCMD and -ENOTTY when the ioctl is not implemented by a driver. (akpm: we're not allowed to return -ENOIOCTLCMD to userspace. This patch does the right thing). Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-05-06[ARM] rtc-sa1100: fix compiler warnings and error cleanupRussell King1-3/+3
Fix: drivers/rtc/rtc-sa1100.c: In function `sa1100_rtc_proc': drivers/rtc/rtc-sa1100.c:298: warning: unsigned int format, long unsigned int arg (arg 3) and arrange for sa1100_rtc_open() to pass the devid to free_irq() rather than NULL. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-04-11[PATCH] RTC subsystem: SA1100 cleanupAlessandro Zummo1-8/+5
- convert printks to dev_xxx - remove messages in excess Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-04-11[PATCH] RTC subsystem: compact error messagesAlessandro Zummo1-1/+0
Move registration error message from drivers to core. Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-27[PATCH] RTC subsystem: SA1100/PXA2XX driverRichard Purdie1-0/+388
Add an RTC subsystem driver for the ARM SA1100/PXA2XX processor RTC. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>