History log of /linux-master/drivers/rtc/rtc-sc27xx.c
Revision Date Author Comments
# 07869941 07-Jul-2021 Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>

rtc: sc27xx: Fix format of SPDX identifier

For C files, use the C99 format (//).

Cc: Orson Zhai <orsonzhai@gmail.com>
Cc: Baolin Wang <baolin.wang7@gmail.com>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210707075804.337458-6-nobuhiro1.iwamatsu@toshiba.co.jp


# fdcfd854 09-Nov-2020 Bartosz Golaszewski <bgolaszewski@baylibre.com>

rtc: rework rtc_register_device() resource management

rtc_register_device() is a managed interface but it doesn't use devres
by itself - instead it marks an rtc_device as "registered" and the devres
callback for devm_rtc_allocate_device() takes care of resource release.

This doesn't correspond with the design behind devres where managed
structures should not be aware of being managed. The correct solution
here is to register a separate devres callback for unregistering the
device.

While at it: rename rtc_register_device() to devm_rtc_register_device()
and add it to the list of managed interfaces in devres.rst. This way we
can avoid any potential confusion of driver developers who may expect
there to exist a corresponding unregister function.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201109163409.24301-8-brgl@bgdev.pl


# 7d9d4868 17-Nov-2020 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: sc27xx: Always read normal alarm

The RTC core only reads the alarm from the hardware at boot time, to know
whether an alarm was already set before booting. It keeps track of all the
alarms after that so there is no need to ever read the auxiliary alarm.

Commit 3822d1bb0df1 ("rtc: sc27xx: Always read normal alarm when
registering RTC device") already effectively removed the capability to read
the auxiliary alarm as .read_alarm is always called with rtc->registered set
to false.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Chunyan Zhang <zhang.lyra@gmail.com>
Link: https://lore.kernel.org/r/20201117212201.1288608-1-alexandre.belloni@bootlin.com


# 825156a5 06-Nov-2020 Kaixu Xia <kaixuxia@tencent.com>

rtc: sc27xx: Remove unnecessary conversion to bool

Here we could use the '!=' expression to fix the following coccicheck
warning:

./drivers/rtc/rtc-sc27xx.c:566:50-55: WARNING: conversion to bool not needed here

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/1604647854-876-1-git-send-email-kaixuxia@tencent.com


# c202ec09 21-Oct-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: sc27xx: remove .remove

dpm_sysfs_remove() and device_pm_remove() are already called by
device_del() on device removal so there is no need to call
device_init_wakeup(dev, false) from the driver and it allows to remove the
.remove callback.

Link: https://lore.kernel.org/r/20191021155806.3625-4-alexandre.belloni@bootlin.com
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# e02e3dda 05-Sep-2019 Baolin Wang <baolin.wang@linaro.org>

rtc: sc27xx: Remove clearing SPRD_RTC_POWEROFF_ALM_FLAG flag

The SPRD_RTC_POWEROFF_ALM_FLAG flag is used to indicate if a poweroff alarm
is set, which can power on the system when system in power-off status.

And the bootloader will validate this flag to check if the booting mode is
alarm booting mode, thus we should not clear this flag in kernel, instead
bootloader will clear this flag after checking the booting mode.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Link: https://lore.kernel.org/r/1f75310242de75b14d8973538bf96efffb395daf.1567666894.git.baolin.wang@linaro.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 44c638ce 18-Aug-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: remove superfluous error message

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 <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20190818220041.17833-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# faac9102 30-Jul-2019 Stephen Boyd <swboyd@chromium.org>

rtc: Remove dev_err() usage after platform_get_irq()

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.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-40-swboyd@chromium.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 3822d1bb 18-Oct-2018 Baolin Wang <baolin.wang@linaro.org>

rtc: sc27xx: Always read normal alarm when registering RTC device

When registering one RTC device, it will check to see if there is an
alarm already set in RTC hardware by reading RTC alarm, at this time
we should always read the normal alarm put in always-on region by
checking the rtc->registered flag.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# bf2c532b 18-Oct-2018 Baolin Wang <baolin.wang@linaro.org>

rtc: sc27xx: Add check to see if need to enable the alarm interrupt

The RTC interrupt enable register is not put in always-power-on region
supplied by VDDRTC, so we should check if we need enable the alarm
interrupt when system booting.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# b2ddc485 18-Oct-2018 Baolin Wang <baolin.wang@linaro.org>

rtc: sc27xx: Remove interrupts disable and clear in probe()

When registering one rtc device, it will check to see if there is an
alarm already set in rtc hardware by issuing __rtc_read_alarm(). So
we should not disable the RTC interrupts and clear the interrupts
status in probe() function.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 7db5adfa 18-Oct-2018 Baolin Wang <baolin.wang@linaro.org>

rtc: sc27xx: Clear SPG value update interrupt status

We should clear the SPG value update interrupt status once the SPG value
is updated successfully, in case incorrect status validation for next time.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# a86d6b23 18-Oct-2018 Baolin Wang <baolin.wang@linaro.org>

rtc: sc27xx: Set wakeup capability before registering rtc device

Set wakeup capability before registering rtc device, in case the alarmtimer
can find one available rtc device.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# a0defd7c 31-May-2018 Baolin Wang <baolin.wang@linaro.org>

rtc: sprd: Add new RTC power down check method

We should use the new method to check if RTC was powered down, which
is more solid. Since we have introduced power control and power status
registers, and we just check if the power status is the default value
(0x96), if yes that means the RTC has been powered down. Meanwhile We
can set the power control register to be one valid value to change
the power status to indicate RTC device is valid now.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 149aa91c 25-Apr-2018 Baolin Wang <baolin.wang@linaro.org>

rtc: sprd: Add RTC hardware range

The SC27xx RTC can support dates from 1970-01-01 00:00:00 to 2149-06-06
23:59:59.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 369a30a5 25-Apr-2018 Baolin Wang <baolin.wang@linaro.org>

rtc: sprd: Change to use devm_rtc_allocate_device()

This is a preparation patch, changing to use devm_rtc_allocate_device()
that can allow driver to set 'range_max' and 'range_min' for the RTC
device.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 66b32fc5 19-Feb-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: sc27xx: stop validating rtc_time in .read_time

rtc_time64_to_tm never generates an invalid tm. It is not necessary to
validate it. Also, the RTC core is always calling rtc_valid_tm after the
read_time callback.

Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 495bbde5 08-Nov-2017 Baolin Wang <baolin.wang@spreadtrum.com>

rtc: sc27xx: Add Spreadtrum SC27xx PMIC RTC driver

This patch adds the Spreadtrum RTC driver, which embedded in the
Spreadtrum SC27xx series PMICs.

Signed-off-by: Baolin Wang <baolin.wang@spreadtrum.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>