15 Oct, 2020

1 commit

  • Removing the struct member "dev" in mt6397 RTC driver because it's not
    initialized and the only usage is for one debugging message.

    Also fixed a typo in the error message.

    Signed-off-by: Fei Shao
    Signed-off-by: Alexandre Belloni
    Link: https://lore.kernel.org/r/20201008093414.1911699-1-fshao@chromium.org

    Fei Shao
     

21 May, 2020

1 commit

  • This add support for the MediaTek MT6358 RTC. Driver using
    compatible data to store different RTC_WRTGR address offset.
    This replace RTC_WRTGR to RTC_WRTGR_MT6323 in mt6323-poweroff
    driver which only needed by armv7 CPU without ATF.

    Signed-off-by: Ran Bi
    Signed-off-by: Hsin-Hsiung Wang
    Reviewed-by: Nicolas Boichat
    Acked-by: Alexandre Belloni
    Acked-by: Sebastian Reichel
    Reviewed-by: Yingjoe Chen
    Signed-off-by: Lee Jones

    Ran Bi
     

04 Feb, 2020

1 commit

  • Pull RTC updates from Alexandre Belloni:
    "The VL_READ and VL_CLR ioctls have been reworked to be more useful.
    This will not break userspace as there are very few users and they are
    using the integer value as a boolean.

    Apart from that, two drivers were reworked and a few fixes here and
    there for a net reduction of number of lines.

    Summary:

    Subsystem:
    - the VL_READ and VL_CLR ioctls are now documented and their behavior
    is unified across all the drivers.
    - RTC_I2C_AND_SPI Kconfig option rework to avoid selecting both
    REGMAP_I2C and REGMAP_SPI unecessarily.

    Drivers:
    - at91rm9200: remove deprecated procfs, add sam9x60, sama5d4 and
    sama5d2 compatibles.
    - cmos: solve lost interrupts issue on MS Surface 3
    - hym8563: return proper errno when time is invalid
    - rv3029: many fixes, nvram support"

    * tag 'rtc-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (63 commits)
    dt-bindings: rtc: at91rm9200: document clocks property
    rtc: i2c/spi: Avoid inclusion of REGMAP support when not needed
    rtc: Kconfig: select REGMAP_I2C when necessary
    rtc: Kconfig: properly indent sd3078 entry
    rtc: cmos: Refactor code by using the new dmi_get_bios_year() helper
    rtc: cmos: Use predefined value for RTC IRQ on legacy x86
    rtc: cmos: Stop using shared IRQ
    rtc: tps6586x: Use IRQ_NOAUTOEN flag
    rtc: at91rm9200: use FIELD_PREP/FIELD_GET
    rtc: at91rm9200: avoid time readout in at91_rtc_setalarm
    rtc: at91rm9200: move register definitions to C file
    rtc: at91rm9200: add sama5d4 and sama5d2 compatibles
    dt-bindings: rtc: at91rm9200: convert bindings to json-schema
    rtc: at91rm9200: remove procfs information
    dt-bindings: atmel, at91rm9200-rtc: add microchip, sam9x60-rtc
    rtc: pcf8563: Use BIT
    rtc: moxart: Convert to SPDX identifier
    rtc: ds1343: Remove unused struct spi_device in struct ds1343_priv
    rtc: rx8025: Remove struct i2c_client from struct rx8025_data
    rtc: hym8563: Read the valid flag directly instead of caching it
    ...

    Linus Torvalds
     

11 Dec, 2019

1 commit

  • Alarm registers high byte was reserved for other functions.
    This add mask in alarm registers operation functions.
    This also fix error condition in interrupt handler.

    Fixes: fc2979118f3f ("rtc: mediatek: Add MT6397 RTC driver")

    Signed-off-by: Ran Bi
    Signed-off-by: Hsin-Hsiung Wang
    Link: https://lore.kernel.org/r/1576057435-3561-6-git-send-email-hsin-hsiung.wang@mediatek.com
    Signed-off-by: Alexandre Belloni

    Ran Bi
     

10 Dec, 2019

1 commit

  • The devm_request_threaded_irq function allocates irq that is
    released when a driver detaches. Thus, there is no reason to
    explicitly call free_irq in probe function.

    Fixes: 851b87148aa2 ("rtc: mt6397: improvements of rtc driver")
    Reported-by: Hulk Robot
    Signed-off-by: Wei Yongjun
    Link: https://lore.kernel.org/r/20191113021720.9527-1-weiyongjun1@huawei.com
    Signed-off-by: Alexandre Belloni

    Wei Yongjun
     

24 Oct, 2019

3 commits


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
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 655 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

04 Apr, 2019

1 commit

  • The IRQ mapping was changed to not being created in the rtc-mt6397
    driver, so the irq_dispose_mapping is no longer needed.
    Also the dev_id passed to free_irq should be the same as the last
    argument passed to request_threaded_irq.
    This prevents a "Trying to free already-free IRQ 274" warning when
    unbinding the driver.

    Fixes: e695d3a0b3b3 ("mfd: mt6397: Create irq mappings in mfd core driver")
    Signed-off-by: Pi-Hsun Shih
    Signed-off-by: Alexandre Belloni

    Pi-Hsun Shih
     

11 Sep, 2018

1 commit

  • 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
    before requesting the IRQ.

    Acked-by: Eddie Huang
    Signed-off-by: Alexandre Belloni

    Alexandre Belloni
     

16 Apr, 2018

1 commit

  • The core driver should create and manage irq mappings instead of
    leaf drivers. This patch change to pass irq domain to
    devm_mfd_add_devices() and it will create mapping for irq resources
    automatically. And remove irq mapping in rtc driver since this has
    been done in core driver.

    Signed-off-by: Chen Zhong
    Acked-by: Alexandre Belloni
    Signed-off-by: Lee Jones

    Chen Zhong
     

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
     

15 Mar, 2016

1 commit

  • The driver uses the MODULE_ALIAS() macro to export a platform module alias
    to allow the module to be autoloaded if the device is registered using the
    legacy platform registration mechanism but the driver is always used by OF
    only machines so the alias is not needed and should just be removed.

    Suggested-by: Arnd Bergmann
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Alexandre Belloni

    Javier Martinez Canillas
     

06 Sep, 2015

1 commit


05 Sep, 2015

1 commit


18 Jul, 2015

1 commit


25 Jun, 2015

2 commits

  • On some !ARM 32bits platforms, the following compilation error happens
    because of the division on a 64bits value in mtk_rtc_read_time():

    drivers/built-in.o: In function `mtk_rtc_read_time':
    rtc-mt6397.c:(.text+0x265d13f): undefined reference to `__divdi3'
    rtc-mt6397.c:(.text+0x265d150): undefined reference to `__moddi3'

    Use div_s64() as done in rtc_time64_to_tm() to solve that.

    Reported-by: kbuild test robot
    Acked-by: Eddie Huang
    Signed-off-by: Alexandre Belloni

    Alexandre Belloni
     
  • Add Mediatek MT6397 RTC driver

    Signed-off-by: Tianping Fang
    Signed-off-by: Eddie Huang
    Signed-off-by: Alexandre Belloni

    Tianping Fang