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

    YueHaibing
     

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

    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

    Stephen Boyd
     

30 Apr, 2019

7 commits


01 Mar, 2018

1 commit


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 -5

    Suggested-by: Alex Smith
    Cc: Zubair Lutfullah Kakakhel
    Signed-off-by: Mathieu Malaterre
    Signed-off-by: Alexandre Belloni

    Mathieu Malaterre
     
  • Trivial fix in error message with duplicate 'write'

    Signed-off-by: Mathieu Malaterre
    Signed-off-by: Alexandre Belloni

    Mathieu Malaterre
     

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 Belloni

    Revert "rtc: jz4740: make the driver builtin only"

    This reverts commit b9168c539c0b2de756aaffd380384dbde8adbe07.

    Alexandre Belloni
     

09 Nov, 2016

2 commits


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.txt

    Signed-off-by: Paul Cercueil
    Acked-by: Maarten ter Huurne
    Signed-off-by: Alexandre Belloni

    Paul Cercueil
     
  • 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

    Paul Cercueil
     
  • 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

    Paul Cercueil
     

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

    Julia Lawall
     

20 Oct, 2014

1 commit


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

    Jingoo Han
     

04 Jul, 2013

2 commits


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

    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

    Lars-Peter Clausen
     

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

    Axel Lin
     
  • 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

    Axel Lin
     

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

    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

    Paul Cercueil
     

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

    Lars-Peter Clausen