History log of /linux-master/drivers/rtc/rtc-goldfish.c
Revision Date Author Comments
# c92e7ef1 06-Apr-2022 Laurent Vivier <laurent@vivier.eu>

clocksource/drivers: Add a goldfish-timer clocksource

Add a clocksource based on the goldfish-rtc device.

Move the timer register definition to <clocksource/timer-goldfish.h>

This kernel implementation is based on the QEMU upstream implementation:

https://git.qemu.org/?p=qemu.git;a=blob_plain;f=hw/rtc/goldfish_rtc.c

goldfish-timer is a high-precision signed 64-bit nanosecond timer.
It is part of the 'goldfish' virtual hardware platform used to run
some emulated Android systems under QEMU.
This timer only supports oneshot event.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20220406201523.243733-4-laurent@vivier.eu
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>


# 3378c7f4 06-Apr-2022 Laurent Vivier <laurent@vivier.eu>

rtc: goldfish: Use gf_ioread32()/gf_iowrite32()

Replace readl()/writel() by gf_ioread32()/gf_iowrite32()
as done for goldfish-tty.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220406201523.243733-3-laurent@vivier.eu
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>


# 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


# 22f8d5a1 20-Jun-2020 Huacai Chen <chenhuacai@kernel.org>

rtc: goldfish: Enable interrupt in set_alarm() when necessary

When use goldfish rtc, the "hwclock" command fails with "select() to
/dev/rtc to wait for clock tick timed out". This is because "hwclock"
need the set_alarm() hook to enable interrupt when alrm->enabled is
true. This operation is missing in goldfish rtc (but other rtc drivers,
such as cmos rtc, enable interrupt here), so add it.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/1592654683-31314-1-git-send-email-chenhc@lemote.com


# f4c29a09 24-May-2020 Tiezhu Yang <yangtiezhu@loongson.cn>

rtc: goldfish: Use correct return value for goldfish_rtc_probe()

When call function devm_platform_ioremap_resource(), we should use IS_ERR()
to check the return value and return PTR_ERR() if failed.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/1590370788-15136-1-git-send-email-yangtiezhu@loongson.cn


# 89576beb 21-Sep-2019 Markus Elfring <elfring@users.sourceforge.net>

rtc: Use devm_platform_ioremap_resource()

Simplify probe by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Link: https://lore.kernel.org/r/4552ef52-f218-93b1-6dfa-668d137676f8@web.de
Link: https://lore.kernel.org/r/5ecfcf43-d6b2-1a38-dee8-b8806f30bc83@web.de
Link: https://lore.kernel.org/r/25448e11-c43f-9ae0-4c43-6f789accc026@web.de
Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com>
Link: https://lore.kernel.org/r/8c17a59c-82ff-aa6b-5653-a38d786d3e83@web.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 2be7f1b5 20-Mar-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: goldfish: convert to SPDX identifier

Use SPDX-License-Identifier instead of a verbose license text

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# b509306d 20-Mar-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: goldfish: switch to rtc_time64_to_tm/rtc_tm_to_time64

This RTC handles dates after 2106 (up to July 2554), call the 64bit
versions of rtc_tm time conversion.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 6a6ec8c1 20-Mar-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: goldfish: allow building on more than MIPS

Goldfish can be ARM or x86, allow building the driver for more than just
MIPS.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# bd01386e 20-Mar-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: goldfish: sort headers

Sort headers alphabetically.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 5e2954fd 20-Mar-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: goldfish: add range

This RTC has a 64bit nanosecond counter.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 409b84e3 20-Mar-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: goldfish: convert to devm_rtc_allocate_device

This allows further improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 82d632b8 16-Jan-2018 James Hogan <jhogan@kernel.org>

rtc: goldfish: Add missing MODULE_LICENSE

Fix the following warning in MIPS allmodconfig by adding a
MODULE_LICENSE() at the end of rtc-goldfish.c, based on the file header
comment which says GNU General Public License version 2:

WARNING: modpost: missing MODULE_LICENSE() in drivers/rtc/rtc-goldfish.o

Fixes: f22d9cdcb5eb ("rtc: goldfish: Add RTC driver for Android emulator")
Signed-off-by: James Hogan <jhogan@kernel.org>
Cc: Miodrag Dinic <miodrag.dinic@mips.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: linux-rtc@vger.kernel.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# f22d9cdc 18-Aug-2017 Miodrag Dinic <miodrag.dinic@mips.com>

rtc: goldfish: Add RTC driver for Android emulator

Add device driver for a virtual RTC device in Android emulator.

The compatible string used by OS for binding the driver is defined
as "google,goldfish-rtc".

Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com>
Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>