From: mark.rutland@arm.com (Mark Rutland)
To: linus-amlogic@lists.infradead.org
Subject: [RFC PATCH 2/3] rtc: Add Amlogic Virtual Wake RTC
Date: Thu, 3 Nov 2016 15:36:48 +0000 [thread overview]
Message-ID: <20161103153647.GD25852@remoulade> (raw)
In-Reply-To: <1478183365-23708-3-git-send-email-narmstrong@baylibre.com>
On Thu, Nov 03, 2016 at 03:29:24PM +0100, Neil Armstrong wrote:
> The Amlogic Meson GX SoCs uses a special register to store the
> time in seconds to wakeup after a system suspend.
Where does this register live, exactly? What IP block is it part of?
> In order to be able to reuse the RTC wakealarm feature, this
> driver implements a fake RTC device which uses the system time
> to deduce a suspend delay.
This sounds like an always-on oneshot timer device, not an RTC.
> +static int meson_vrtc_read_time(struct device *dev, struct rtc_time *tm)
> +{
> + unsigned long local_time;
> + struct timeval time;
> +
> + do_gettimeofday(&time);
> + local_time = time.tv_sec - (sys_tz.tz_minuteswest * 60);
> + rtc_time_to_tm(local_time, tm);
> +
> + return 0;
> +}
... if this were a timer, you wouldn't need this hack.
> +static int meson_vrtc_probe(struct platform_device *pdev)
> +{
> + struct meson_vrtc_data *vrtc;
> + struct resource *res;
> +
> + vrtc = devm_kzalloc(&pdev->dev, sizeof(*vrtc), GFP_KERNEL);
> + if (!vrtc)
> + return -ENOMEM;
> +
> + vrtc->pdev = pdev;
> +
> + /* Alarm registers */
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + vrtc->io_alarm = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(vrtc->io_alarm))
> + return PTR_ERR(vrtc->io_alarm);
> +
> + device_init_wakeup(&pdev->dev, 1);
> +
> + platform_set_drvdata(pdev, vrtc);
> +
> + vrtc->rtc = devm_rtc_device_register(&pdev->dev, "meson-vrtc",
> + &meson_vrtc_ops, THIS_MODULE);
> + if (IS_ERR(vrtc->rtc))
> + return PTR_ERR(vrtc->rtc);
> +
> + return 0;
> +}
I see that no interrupt is described. How exactly does this wake the system
from suspend? Is there some interrupt managed by FW for this, for example?
> +static const struct of_device_id meson_vrtc_dt_match[] = {
> + { .compatible = "amlogic,meson-vrtc"},
There was no binding documentation in this patch series.
Thanks,
Mark.
next prev parent reply other threads:[~2016-11-03 15:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-03 14:29 [RFC PATCH 0/3] ARM64: meson-gxbb: Add support for system suspend Neil Armstrong
2016-11-03 14:29 ` [RFC PATCH 1/3] ARM64: meson: Add Amlogic Meson GX PM Suspend Neil Armstrong
2016-11-03 15:30 ` Mark Rutland
2016-11-03 21:53 ` Sudeep Holla
2016-11-04 9:13 ` Neil Armstrong
2016-11-03 14:29 ` [RFC PATCH 2/3] rtc: Add Amlogic Virtual Wake RTC Neil Armstrong
2016-11-03 15:36 ` Mark Rutland [this message]
2016-11-03 15:46 ` Neil Armstrong
2016-12-01 0:51 ` [rtc-linux] " Alexandre Belloni
2016-11-03 14:29 ` [RFC PATCH 3/3] ARM64: dts: meson-gxbb: Add support for PM and Virtual RTC Neil Armstrong
2016-11-03 15:25 ` [RFC PATCH 0/3] ARM64: meson-gxbb: Add support for system suspend Mark Rutland
2016-11-03 15:43 ` Mark Rutland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161103153647.GD25852@remoulade \
--to=mark.rutland@arm.com \
--cc=linus-amlogic@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).