02 Jan, 2019

1 commit

  • Pull RTC updates from Alexandre Belloni:
    "Subsystem:
    - new %ptR printk format
    - rename core files
    - allow registration of multiple nvmem devices

    New driver:
    - i.MX system controller RTC

    Driver updates:
    - abx80x: handle voltage ioctls, correct binding doc
    - m41t80: correct month in alarm reads
    - pcf85363: add pcf85263 support
    - pcf8523: properly handle battery low flag
    - s3c: limit alarm to one year in the future as ALMYEAR is broken
    - sun6i: rework clock output binding"

    * tag 'rtc-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (54 commits)
    rtc: rename core files
    rtc: nvmem: fix possible use after free
    rtc: add i.MX system controller RTC support
    dt-bindings: fsl: scu: add rtc binding
    rtc: pcf2123: Add Microcrystal rv2123
    rtc: class: reimplement devm_rtc_device_register
    rtc: enforce rtc_timer_init private_data type
    rtc: abx80x: Implement RTC_VL_READ,CLR ioctls
    rtc: pcf85363: Add support for NXP pcf85263 rtc
    dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock
    rtc: pcf8523: don't return invalid date when battery is low
    dt-bindings: rtc: use a generic node name for ds1307
    PM: Switch to use %ptR
    m68k/mac: Switch to use %ptR
    Input: hp_sdc_rtc - Switch to use %ptR
    rtc: tegra: Switch to use %ptR
    rtc: s5m: Switch to use %ptR
    rtc: s3c: Switch to use %ptR
    rtc: rx8025: Switch to use %ptR
    rtc: rx6110: Switch to use %ptR
    ...

    Linus Torvalds
     

31 Dec, 2018

2 commits

  • Rename core files so there is a clearer separation between the RTC core and
    the RTC drivers.

    Signed-off-by: Alexandre Belloni

    Alexandre Belloni
     
  • In cas of probe failure, devres may free the memory allocated for
    rtc->nvram before devm_rtc_release_device() is called. This leads to
    rtc_nvram_unregister using it after being freed which may lead to a crash.

    This has been shown to happen after commit 461e557b9727 ("rtc: nvmem: use
    devm_nvmem_register()")

    Reported-by: kernel test robot
    Signed-off-by: Alexandre Belloni

    Alexandre Belloni
     

20 Dec, 2018

1 commit

  • i.MX8QXP is an ARMv8 SoC which has a Cortex-M4 system controller
    inside, the system controller is in charge of controlling power,
    clock and secure rtc etc..

    This patch adds i.MX system controller RTC driver support,
    Linux kernel has to communicate with system controller via MU
    (message unit) IPC to set/get RTC time and other alarm functions,
    since the RTC set time needs to be done in secure EL3 mode (required
    by system controller firmware) and alarm functions needs to be done
    with general MU IRQ handle, these depend on other components which
    are NOT ready, so this patch ONLY enables the RTC time read.

    Signed-off-by: Anson Huang
    Signed-off-by: Alexandre Belloni

    Anson Huang
     

19 Dec, 2018

4 commits


11 Dec, 2018

18 commits


07 Dec, 2018

4 commits

  • The bindings have been updated to expose the RTC's internal oscillator,
    for some SoCs that have it directly feeding the PRCM block. The changes
    include the index 2 for the clock outputs, as well as the clock output
    names.

    This patch adds the internal oscillator to the list of clocks exposed
    through of_clk_add_hw_provider(), and also have the driver optionally
    fetch the name of the clock from the device tree if it's available.

    Tested-by: Corentin Labbe
    Signed-off-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Alexandre Belloni

    Chen-Yu Tsai
     
  • There are different variants to the RTC hardware first seen on sun6i
    (A31). The differences we care about in this driver are the clock rate
    for the internal oscillator, prescalers, and the presence of an external
    clock output.

    This patch adds support for all the known pre-H6 base compatibles using
    the variants data structure previously introduced.

    Acked-by: Maxime Ripard
    Tested-by: Corentin Labbe
    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Alexandre Belloni

    Chen-Yu Tsai
     
  • Amongst the Allwinner SoCs that have seen some kind of coverage by the
    linux-sunxi community, whether it be mainline Linux or U-boot support,
    or just available datasheets, most newer chips use the RTC design first
    seen in the A31 (sun6i).

    Overall there have been some minor differences. This patch covers the
    following:

    - average clock rate of the internal RC oscillator
    + presence of fixed and adjustable prescaler for this clock
    - availability of an external (to the SoC) clock output

    One major difference regarding the H6 is the 24 MHz crystal is now
    routed through the RTC, as a digitally compensated oscillator (DCXO).
    This is not covered in this patch and will be supported later.

    Other differences are either unrelated to RTC or clock functionality,
    such as boot or crypto related registers, or the driver simply doesn't
    use the feature in question. One example of the latter is the
    calibration function for the RC oscillator. We consider this clock to
    be very bad and avoid using it.

    Acked-by: Maxime Ripard
    Tested-by: Corentin Labbe
    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Alexandre Belloni

    Chen-Yu Tsai
     
  • The RTC's main clock, used internally and exported to the rest of the
    SoC, is called "LOSC" (low speed oscillator) through the hardware
    documentation.

    This patch adds a default name for this clock, in case the device tree
    does not provide one. This shouldn't happen, but lets play it safe.

    Acked-by: Maxime Ripard
    Tested-by: Corentin Labbe
    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Alexandre Belloni

    Chen-Yu Tsai
     

01 Dec, 2018

1 commit

  • Pull staging and IIO driver fixes from Greg KH:
    "Here are some small IIO and staging driver fixes for 4.20-rc5.

    Nothing major, the IIO fix ended up touching the HID drivers at the
    same time, but the HID maintainer acked it. The staging fixes are all
    minor patches for reported issues and regressions, full details are in
    the shortlog.

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'staging-4.20-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
    iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers
    staging: vchiq_arm: fix compat VCHIQ_IOC_AWAIT_COMPLETION
    staging: mt7621-pinctrl: fix uninitialized variable ngroups
    staging: rtl8723bs: Add missing return for cfg80211_rtw_get_station
    staging: most: use format specifier "%s" in snprintf
    staging: rtl8723bs: Fix incorrect sense of ether_addr_equal
    staging: mt7621-dma: fix potentially dereferencing uninitialized 'tx_desc'
    staging: comedi: clarify/unify macros for NI macro-defined terminals
    drivers: staging: cedrus: find ctx before dereferencing it ctx
    staging: rtl8723bs: Fix the return value in case of error in 'rtw_wx_read32()'
    staging: comedi: ni_mio_common: scale ao INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS
    iio:st_magn: Fix enable device after trigger

    Linus Torvalds
     

23 Nov, 2018

4 commits


16 Nov, 2018

1 commit

  • Before this commit sensor_hub_input_attr_get_raw_value() failed to take
    the signedness of 16 and 8 bit values into account, returning e.g.
    65436 instead of -100 for the z-axis reading of an accelerometer.

    This commit adds a new is_signed parameter to the function and makes all
    callers pass the appropriate value for this.

    While at it, this commit also fixes up some neighboring lines where
    statements were needlessly split over 2 lines to improve readability.

    Signed-off-by: Hans de Goede
    Acked-by: Srinivas Pandruvada
    Acked-by: Benjamin Tissoires
    Cc:
    Signed-off-by: Jonathan Cameron

    Hans de Goede
     

14 Nov, 2018

4 commits

  • In case of error, we return 0.
    This is spurious and not consistent with the other functions of the driver.
    Commit e115a2bf1426 has modified more than what is said in the commit
    message. Reverse part of it znd return an error when needed, as it was
    previously.

    Fixes: e115a2bf1426 ("rtc: max77686: stop validating rtc_time in .read_time")
    Signed-off-by: Christophe JAILLET
    Reviewed-by: Chanwoo Choi
    Signed-off-by: Alexandre Belloni

    Christophe JAILLET
     
  • (RTC,ALM)YEAR registers of Exynos built-in RTC device contains 3 BCD
    characters. s3c-rtc driver uses only 2 lower of them and supports years
    from 2000..2099 range. The third BCD value is typically set to 0, but it
    looks that handling of it is broken in the hardware. It sometimes
    defaults to a random (even non-BCD) value. This is not an issue
    for handling RTCYEAR register, because bcd2bin() properly handles only
    8bit values (2 BCD characters, the third one is skipped). The problem
    is however with ALMYEAR register and proper RTC alarm operation. When
    YEAREN bit is set for the configured alarm, RTC hardware triggers alarm
    only when ALMYEAR and RTCYEAR matches. This usually doesn't happen
    because of the random noise on the third BCD character.

    Fix this by simply skipping setting ALMYEAR register in alarm
    configuration. This workaround fixes broken alarm operation on Exynos
    built-in rtc device. My tests revealed that the issue happens on the
    following Exynos series: 3250, 4210, 4412, 5250 and 5410.

    Signed-off-by: Marek Szyprowski
    Signed-off-by: Alexandre Belloni

    Marek Szyprowski
     
  • Complement commit 85d77047c4ea ("drivers/rtc/rtc-m41t80.c: propagate
    error value from smbus functions") and correct the remaining places that
    fail to propagate the error code from SMBus calls.

    Signed-off-by: Maciej W. Rozycki
    References: 85d77047c4ea ("drivers/rtc/rtc-m41t80.c: propagate error value from smbus functions")
    Signed-off-by: Alexandre Belloni

    Maciej W. Rozycki
     
  • Add the missing adjustment of the month range on alarm reads from the
    RTC, correcting an issue coming from commit 9c6dfed92c3e ("rtc: m41t80:
    add alarm functionality"). The range is 1-12 for hardware and 0-11 for
    `struct rtc_time', and is already correctly handled on alarm writes to
    the RTC.

    It was correct up until commit 48e9766726eb ("drivers/rtc/rtc-m41t80.c:
    remove disabled alarm functionality") too, which removed the previous
    implementation of alarm support.

    Signed-off-by: Maciej W. Rozycki
    Fixes: 9c6dfed92c3e ("rtc: m41t80: add alarm functionality")
    References: 48e9766726eb ("drivers/rtc/rtc-m41t80.c: remove disabled alarm functionality")
    Cc: stable@vger.kernel.org # 4.7+
    Signed-off-by: Alexandre Belloni

    Maciej W. Rozycki