07 Oct, 2019
1 commit
-
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.Signed-off-by: YueHaibing
Link: https://lore.kernel.org/r/20191006102953.57536-2-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-3-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-4-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-5-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-6-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-7-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-8-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-9-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-10-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-11-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-12-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-13-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-14-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-15-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-16-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-17-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-18-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-19-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-20-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-21-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-22-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-23-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-24-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-25-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-26-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-27-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-28-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-29-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-30-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-31-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-32-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-33-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-34-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-35-yuehaibing@huawei.com
Signed-off-by: Alexandre Belloni
21 Aug, 2019
1 commit
-
The RTC core now has error messages in case of registration failure, there
is no need to have other messages in the drivers.Signed-off-by: Alexandre Belloni
Link: https://lore.kernel.org/r/20190818220041.17833-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni
13 Aug, 2019
1 commit
-
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.//
@@
expression ret;
struct platform_device *E;
@@ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);if ( \( ret < 0 \| ret
While we're here, remove braces on if statements that only have one
statement (manually).Cc: Alessandro Zummo
Cc: Alexandre Belloni
Cc: linux-rtc@vger.kernel.org
Cc: Greg Kroah-Hartman
Signed-off-by: Stephen Boyd
Link: https://lore.kernel.org/r/20190730181557.90391-40-swboyd@chromium.org
Signed-off-by: Alexandre Belloni
30 Apr, 2019
7 commits
-
Use SPDX-License-Identifier instead of a verbose license text.
Tested-by: Mathieu Malaterre
Signed-off-by: Alexandre Belloni -
The scratchpad register is used to detect an invalid time when power to the
RTC has been lost. Instead of deleting that precious information and set
the time to the UNIX epoch, forward it to userspace.Tested-by: Mathieu Malaterre
Signed-off-by: Alexandre Belloni -
Use dev_pm_set_wake_irq() to set the RTC as a wakeup source for suspend.
This allows to remove the whole dev_pm_ops structure.Tested-by: Mathieu Malaterre
Signed-off-by: Alexandre Belloni -
Use .set_time instead of the deprecated .set_mmss.
Tested-by: Mathieu Malaterre
Signed-off-by: Alexandre Belloni -
rtc_time64_to_tm always returns a valid tm, it is not necessary to validate
it.Tested-by: Mathieu Malaterre
Signed-off-by: Alexandre Belloni -
Call the 64bit versions of rtc_tm time conversion now that the range is
enforced by the core.Tested-by: Mathieu Malaterre
Signed-off-by: Alexandre Belloni -
RTC_SEC is a 32-bit seconds counter.
Tested-by: Mathieu Malaterre
Signed-off-by: Alexandre Belloni
01 Mar, 2018
1 commit
-
rtc_time_to_tm never generates an invalid tm. It is not necessary to
validate it.Signed-off-by: Alexandre Belloni
12 Oct, 2017
2 commits
-
The current timeout for waiting for WRDY is not always sufficient. Always
increase it to 10000 even on JZ4740. This is technically only required on
JZ4780, where the current symptoms seen after a hard reboot are:jz4740-rtc 10003000.rtc: rtc core: registered 10003000.rtc as rtc0
jz4740-rtc 10003000.rtc: Could not write to RTC registers
jz4740-rtc: probe of 10003000.rtc failed with error -5Suggested-by: Alex Smith
Cc: Zubair Lutfullah Kakakhel
Signed-off-by: Mathieu Malaterre
Signed-off-by: Alexandre Belloni -
Trivial fix in error message with duplicate 'write'
Signed-off-by: Mathieu Malaterre
Signed-off-by: Alexandre Belloni
27 Jan, 2017
1 commit
-
By using kernel_halt() instead of machine_halt(), we can make the driver
build as a module.
However, jz4740 platforms not loading this module will not be able to power
off.Suggested-by: Geert Uytterhoeven
Signed-off-by: Alexandre BelloniRevert "rtc: jz4740: make the driver builtin only"
This reverts commit b9168c539c0b2de756aaffd380384dbde8adbe07.
09 Nov, 2016
2 commits
-
Since the driver is now calling machine_halt() that is not exported, it has
to be built in the kernel. Building it as a module will fail at linking
time.Signed-off-by: Alexandre Belloni
-
jz4740_rtc_poweroff() is only called from the driver, stop exporting it.
Signed-off-by: Alexandre Belloni
05 Nov, 2016
3 commits
-
The 'system-power-controller' singleton entry can be used in the
devicetree node of the jz4740-rtc driver to specify that the driver is
granted the right to power off the system through the registers of the
RTC unit.See the documentation for more details:
Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txtSigned-off-by: Paul Cercueil
Acked-by: Maarten ter Huurne
Signed-off-by: Alexandre Belloni -
See
Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txt
for a description of the bindings.Signed-off-by: Paul Cercueil
Acked-by: Maarten ter Huurne
Signed-off-by: Alexandre Belloni -
The RTC unit present in the JZ4780 works mostly the same as the one in
the JZ4740. The major difference is that register writes need to be
explicitly enabled, by writing a magic code (0xA55A) to a "write
enable" register before each access.Signed-off-by: Paul Cercueil
Acked-by: Maarten ter Huurne
Signed-off-by: Alexandre Belloni
02 Sep, 2016
1 commit
-
Check for rtc_class_ops structures that are only passed to
devm_rtc_device_register, rtc_device_register,
platform_device_register_data, all of which declare the corresponding
parameter as const. Declare rtc_class_ops structures that have these
properties as const.The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)//
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct rtc_class_ops i@p = { ... };@ok@
identifier r.i;
expression e1,e2,e3,e4;
position p;
@@
(
devm_rtc_device_register(e1,e2,&i@p,e3)
|
rtc_device_register(e1,e2,&i@p,e3)
|
platform_device_register_data(e1,e2,e3,&i@p,e4)
)@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct rtc_class_ops i = { ... };
//Signed-off-by: Julia Lawall
Acked-by: Baruch Siach
Acked-by: Hans Ulli Kroll
Acked-by: Linus Walleij
Acked-by: Thierry Reding
Signed-off-by: Alexandre Belloni
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
04 Apr, 2014
1 commit
-
Use devm_ioremap_resource() in order to make the code simpler, and move
'struct resource *mem' from 'struct jz4740_rtc' to jz4740_rtc_probe()
because the 'mem' variable is used only in jz4740_rtc_probe(). Also the
redundant return value check of platform_get_resource() is removed,
because the value is checked by devm_ioremap_resource().Signed-off-by: Jingoo Han
Cc: Lars-Peter Clausen
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Jul, 2013
2 commits
-
Use devm_*() functions to make cleanup paths simpler.
Signed-off-by: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
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
06 Oct, 2012
1 commit
-
The irq field of the jz4740_irc struct is unsigned. Yet we assign the
result of platform_get_irq() to it. platform_get_irq() may return a
negative error code and the code checks for this condition by checking if
'irq' is less than zero. But since 'irq' is unsigned this test will
always be false. Fix it by making 'irq' signed.The issue was found using the following coccinelle semantic patch:
//
@@
type T;
unsigned T i;
@@
(
*i < 0
|
*i >= 0
)
//Signed-off-by: Lars-Peter Clausen
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Jan, 2012
2 commits
-
Signed-off-by: Axel Lin
Cc: Lars-Peter Clausen
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch converts the drivers in drivers/rtc/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.Signed-off-by: Axel Lin
Acked-by: Mark Brown
Acked-by: Mike Frysinger
Acked-by: Guan Xuetao
Acked-by: Linus Walleij
Acked-by: Haojian Zhuang
Cc: Alessandro Zummo
Cc: Srinidhi Kasagar
Cc: Lars-Peter Clausen
Cc: Ben Dooks
Cc: John Stultz
Acked-by: Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
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
28 Oct, 2010
1 commit
-
Add the "alarm" function to the jz4740 RTC. Interrupts will now be raised
when the "alarm" time is reached.[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Paul Cercueil
Cc: Wan ZongShun
Cc: Alessandro Zummo
Cc: Lars-Peter Clausen
Cc: Paul Gortmaker
Cc: Ralf Baechle
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
05 Aug, 2010
1 commit
-
Add support for the RTC unit on JZ4740 SoCs.
Signed-off-by: Lars-Peter Clausen
Cc: Alessandro Zummo
Cc: Paul Gortmaker
Cc: rtc-linux@googlegroups.com
Acked-by: Wan ZongShun
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: Alessandro Zummo ,
Patchwork: https://patchwork.linux-mips.org/patch/1424/
Signed-off-by: Ralf Baechle