23 Mar, 2020
1 commit
-
Use devm_add_action_or_reset() for calls to clk_disable_unprepare(),
which can simplify the error handling, and .remove callback can be dropped.Signed-off-by: Anson Huang
Link: https://lore.kernel.org/r/1584349785-27042-1-git-send-email-Anson.Huang@nxp.com
Signed-off-by: Alexandre Belloni
13 Aug, 2019
1 commit
-
As spin_unlock_irq will enable interrupts.
mxc_rtc_irq_enable is called from interrupt handler mxc_rtc_interrupt.
Interrupts are enabled in interrupt handler.
Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq
in IRQ context to avoid this.Signed-off-by: Fuqian Huang
Link: https://lore.kernel.org/r/20190807082310.10135-1-huangfq.daxian@gmail.com
Signed-off-by: Alexandre Belloni
29 Apr, 2019
3 commits
-
Use .set_time instead of the deprecated .set_mmss64.
Signed-off-by: Alexandre Belloni
-
Let the core handle the range, and in particular the imx1 offsetting. This
has the benefit of extending the range of the RTC further than 365 days and
making .read_time useful again on imx1.Signed-off-by: Alexandre Belloni
-
The IRQ is requested before the struct rtc is allocated and registered, but
this struct is used in the IRQ handler. This may lead to a NULL pointer
dereference.Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc
struct before requesting the IRQ.Signed-off-by: Alexandre Belloni
12 Apr, 2019
1 commit
-
With calling dev_pm_set_wake_irq() to set MXC RTC as wakeup source
for suspend, generic wake irq mechanism will automatically enable
it as wakeup source when suspend, then the suspend/resume callback
which are ONLY for enabling/disabling irq wake can be removed, it
simplifies the code.Signed-off-by: Anson Huang
Signed-off-by: Alexandre Belloni
04 Apr, 2019
1 commit
-
Use the new helper devm_platform_ioremap_resource() which wraps the
platform_get_resource() and devm_ioremap_resource() together, to
simplify the code.Signed-off-by: Anson Huang
Signed-off-by: Alexandre Belloni
22 May, 2018
1 commit
-
Adopt the SPDX license identifier headers to ease license compliance
management.Signed-off-by: Fabio Estevam
Signed-off-by: Alexandre Belloni
04 May, 2018
1 commit
-
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.Signed-off-by: Wolfram Sang
Acked-by: Michal Simek (for zynqmp)
Signed-off-by: Alexandre Belloni
24 Aug, 2017
1 commit
-
Currently, the IRQs are disabled when the rtc character device is closed.
This means that the device needs to stay open to get alarms while the usual
use case will open the device, set the alarm and close the device as is
done in rtcwake.Keep the alarm functional on character device release so the platform can
actually wakeup.Reviewed-by: Fabio Estevam
Signed-off-by: Alexandre Belloni
24 Jun, 2017
1 commit
-
This variable was never used. With GCC 6.2, we get the following warning:
drivers/rtc/rtc-mxc.c:44:18: warning: ‘PIE_BIT_DEF’ defined but not used [-Wunused-const-variable=]
static const u32 PIE_BIT_DEF[MAX_PIE_NUM][2] = {Signed-off-by: Diaz de Grenu, Jose
Signed-off-by: Alexandre Belloni
12 Jan, 2017
1 commit
-
Declare rtc_class_ops structures as const as they are only passed
as an argument to the function devm_rtc_device_register. This argument
is of type const struct rtc_class_ops *, so rtc_class_ops structures
having this property can be declared const.
Done using Coccinelle:@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct rtc_class_ops i@p = {...};@ok1@
identifier r1.i;
position p;
@@
devm_rtc_device_register(...,&i@p,...)@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct rtc_class_ops i;Signed-off-by: Bhumika Goyal
Signed-off-by: Alexandre Belloni
20 May, 2016
1 commit
-
The RTC core handles it since 6610e08 (RTC: Rework RTC code to use
timerqueue for events).Signed-off-by: Wolfram Sang
Signed-off-by: Alexandre Belloni
05 Aug, 2015
2 commits
-
Add device tree support for the mxc rtc driver.
Acked-by: Alexandre Belloni
Signed-off-by: Philippe Reynes
Signed-off-by: Shawn Guo -
The mxc RTC needs two clocks, one for the input
reference, and one for the IP. But this driver
was only using one clock (for the reference).
This patch add the second clock (for the IP).Acked-by: Alexandre Belloni
Signed-off-by: Philippe Reynes
Signed-off-by: Shawn Guo
20 Jun, 2015
1 commit
-
The platform_device_id is not modified by the driver and core uses it as
const.Signed-off-by: Krzysztof Kozlowski
Signed-off-by: Alexandre Belloni
03 Apr, 2015
3 commits
-
This driver has a number of y2038/y2106 issues.
This patch resolves them by:
- Replacing rtc_time_to_tm() with rtc_time64_to_tm()
- Replacing rtc_tm_to_time() with rtc_tm_to_time64()
- Changing mxc_rtc_set_mmss() to use rtc_class_ops's set_mmss64()After this patch, the driver should not have any remaining
y2038/y2106 issues.Signed-off-by: Xunlei Pang
Signed-off-by: John Stultz
Acked-by: Alessandro Zummo
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Link: http://lkml.kernel.org/r/1427945681-29972-14-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar -
We want to convert mxc_rtc_set_mmss() to use rtc_class_ops's
set_mmss64(), but it uses get_alarm_or_time()/set_alarm_or_time()
internal interfaces which are y2038 unsafe.So here as a separate patch, it converts these two internal
interfaces of "mxc" to use safe time64_t to make some
preparations.Signed-off-by: Xunlei Pang
Signed-off-by: John Stultz
Acked-by: Alessandro Zummo
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Link: http://lkml.kernel.org/r/1427945681-29972-13-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar -
rtc_class_ops's set_alarm() shouldn't deal with the alarm date,
as this is handled in the rtc core.See rtc_dev_ioctl()'s RTC_ALM_SET and RTC_WKALM_SET cases.
Signed-off-by: Xunlei Pang
Signed-off-by: John Stultz
Acked-by: Alessandro Zummo
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Link: http://lkml.kernel.org/r/1427945681-29972-12-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar
20 Oct, 2014
1 commit
-
A platform_driver does not need to set an owner, it will be populated by the
driver core.Signed-off-by: Wolfram Sang
24 Jan, 2014
2 commits
-
clk_prepare_enable() may fail, so let's check its return value and
propagate it in the case of error.Signed-off-by: Fabio Estevam
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
There is no need to jump to the 'exit_free_pdata' label when
devm_clk_get() fails, as we can directly return the error and simplify the
code a bit.Signed-off-by: Fabio Estevam
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Sep, 2013
1 commit
-
Convert the composition of devm_request_mem_region and devm_ioremap to a
single call to devm_ioremap_resource. The associated call to
platform_get_resource is also simplified and moved next to the new call
to devm_ioremap_resource.This was done using a combination of the semantic patches
devm_ioremap_resource.cocci and devm_request_and_ioremap.cocci, found in
the scripts/coccinelle/api directory.In rtc-lpc32xx.c and rtc-mv.c, the local variable size is no longer needed.
In rtc-ds1511.c the size field of the local structure is not useful any
more, and is deleted.Signed-off-by: Julia Lawall
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Jul, 2013
2 commits
-
The driver core clears the driver data to NULL after device_release or
on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata
= NULL when no driver is bound"). Thus, it is not needed to manually
clear the device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Fixes the following error:
ERROR: spaces required around that '>=' (ctx:WxV)
Signed-off-by: Sachin Kamat
Cc: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
30 Apr, 2013
2 commits
-
Switch to using the SIMPLE_DEV_PM_OPS macro to declare the driver's
pm_ops. It reduces code size.Signed-off-by: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
devm_rtc_device_register() is device managed and makes cleanup
paths simpler.Signed-off-by: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Jan, 2013
1 commit
-
CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.Cc: Bill Pemberton
Cc: Alessandro Zummo
Cc: Srinidhi Kasagar
Cc: Linus Walleij
Cc: Mike Frysinger
Cc: Wan ZongShun
Cc: Guan Xuetao
Cc: Mark Brown
Signed-off-by: Greg Kroah-Hartman
15 Oct, 2012
1 commit
-
It changes the driver to use platform_device_id rather than cpu_is_xxx
to determine the controller type, and updates the platform code
accordingly.As the result, mach/hardware.h inclusion gets removed from the driver.
Signed-off-by: Shawn Guo
Acked-by: Sascha Hauer
Acked-by: Arnd Bergmann
Cc: Andrew Morton
Cc: rtc-linux@googlegroups.com
06 Oct, 2012
2 commits
-
Converting to module_platform_driver can make the code smaller and cleaner.
Signed-off-by: Fabio Estevam
Cc: Sascha Hauer
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
i.mx drivers should use clk_prepare_enable/clk_disable_unprepare() in
order to avoid clk warnings.While at it, convert to devm_clk_get() since other devm_ functions are
used in this driver and it can also save some clk_put() calls.Signed-off-by: Fabio Estevam
Acked-by: Sascha Hauer
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Jul, 2012
1 commit
-
Fixes
WARNING: at irq/handle.c:146 handle_irq_event_percpu+0x19c/0x1b8()
irq 25 handler mxc_rtc_interrupt+0x0/0xac enabled interrupts
Modules linked in:
(unwind_backtrace+0x0/0xf0) from (warn_slowpath_common+0x4c/0x64)
(warn_slowpath_common+0x4c/0x64) from (warn_slowpath_fmt+0x30/0x40)
(warn_slowpath_fmt+0x30/0x40) from (handle_irq_event_percpu+0x19c/0x1b8)
(handle_irq_event_percpu+0x19c/0x1b8) from (handle_irq_event+0x28/0x38)
(handle_irq_event+0x28/0x38) from (handle_level_irq+0x80/0xc4)
(handle_level_irq+0x80/0xc4) from (generic_handle_irq+0x24/0x38)
(generic_handle_irq+0x24/0x38) from (handle_IRQ+0x30/0x84)
(handle_IRQ+0x30/0x84) from (avic_handle_irq+0x2c/0x4c)
(avic_handle_irq+0x2c/0x4c) from (__irq_svc+0x40/0x60)
Exception stack(0xc050bf60 to 0xc050bfa8)
bf60: 00000001 00000000 003c4208 c0018e20 c050a000 c050a000 c054a4c8 c050a000
bf80: c05157a8 4117b363 80503bb4 00000000 01000000 c050bfa8 c0018e2c c000e808
bfa0: 60000013 ffffffff
(__irq_svc+0x40/0x60) from (default_idle+0x1c/0x30)
(default_idle+0x1c/0x30) from (cpu_idle+0x68/0xa8)
(cpu_idle+0x68/0xa8) from (start_kernel+0x22c/0x26c)Signed-off-by: Benoît Thébaudeau
Cc: Alessandro Zummo
Cc: Sascha Hauer
Acked-by: Uwe Kleine-König
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Jan, 2012
2 commits
-
Fix alarm IRQ handling, make the alarm one-shot. Cleanup black magick
with a validation of already validated time data.Add ability to wake the system with alarm.
[akpm@linux-foundation.org: fix CONFIG_PM=n build]
Signed-off-by: Yauhen Kharuzhy
Cc: Daniel Mack
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
There is no way to track year in the i.MX1 RTC: Days Counter register is
9-bit wide only. Attempt to save date after 1970-01-01 plus 512 days
causes endless loop in mxc_rtc_set_mmss(). Fix this by resetting year to
1970.[akpm@linux-foundation.org: use conventional comment layout]
Signed-off-by: Yauhen Kharuzhy
Cc: Daniel Mack
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
27 May, 2011
1 commit
-
[akpm@linux-foundation.org: retain the code comments]
Signed-off-by: Wolfram Sang
Cc: Vladimir Zapolskiy
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
07 May, 2011
1 commit
-
Commit f44f7f96a20 ("RTC: Initialize kernel state from RTC") uncovered
an issue in a number of RTC drivers, where the drivers call
rtc_device_register before initializing the device or platform drvdata.This frequently results in null pointer dereferences when the
rtc_device_register immediately makes use of the rtc device, calling
rtc_read_alarm.The solution is to ensure the drvdata is initialized prior to registering
the rtc device.CC: Alessandro Zummo
CC: Thomas Gleixner
CC: rtc-linux@googlegroups.com
Signed-off-by: Wolfram Sang
[fixed up commit log -jstultz]
Signed-off-by: John Stultz
10 Mar, 2011
1 commit
-
Now that the generic code handles UIE mode irqs via periodic
alarm interrupts, no one calls the
rtc_class_ops->update_irq_enable() method anymore.This patch removes the driver hooks and implementations of
update_irq_enable if no one else is calling it.CC: Thomas Gleixner
CC: Alessandro Zummo
CC: Marcelo Roberto Jimenez
CC: rtc-linux@googlegroups.com
Signed-off-by: John Stultz
11 Aug, 2010
1 commit
-
Remove six unused fields from `struct rtc_plat_data'.
Signed-off-by: Wan ZongShun
Cc: Alessandro Zummo
Cc: Paul Gortmaker
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
25 May, 2010
1 commit
-
On imx SoCs rtc clock parent is CKIL, but clock rate shall be determined
using rtc clock itself, that eliminates CKIL clock usage in the driver.Signed-off-by: Vladimir Zapolskiy
Cc: Alessandro Zummo
Cc: Daniel Mack
Cc: Andrew Morton
Cc: Paul Gortmaker
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
07 Apr, 2010
1 commit
-
On exit paths in mxc_rtc_probe() method some resources are not freed
correctly.This patch fixes:
* unrequested memory region containing imx RTC registers
* iounmap() isn't called on exit_free_pdata branch
* clock get rate is called for freed clock source
* clock isn't disabled on exit_put_clk branchTo simplify the fix managed device resources are used.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Vladimir Zapolskiy
Cc: Alessandro Zummo
Cc: Daniel Mack
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds