Devicetree
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Gregory Fong <gregory.0xf0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Florian Fainelli
	<f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	bcm-kernel-feedback-list
	<bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH 5/7] soc: brcmstb: add wake-timer driver
Date: Fri, 19 Jun 2015 10:36:08 -0700	[thread overview]
Message-ID: <20150619173608.GJ4917@ld-irv-0074> (raw)
In-Reply-To: <CADtm3G7qui2Yi6j-pFSGO9sGdHde1hy-c9wAWfQ38Dg8rKq2Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, Jun 18, 2015 at 07:20:26PM -0700, Gregory Fong wrote:
> On Thu, Jun 18, 2015 at 5:11 PM, Brian Norris
> <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > Useful for waking the system from suspend after a specified period of
> > time.
> >
> > This IP could potentially be supported as an RTC driver (for use with
> > the 'rtcwake' utility), but it is not battery backed, so that's not a
> > great fit. Implement a custom sysfs interface instead.
> >
> > Signed-off-by: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > ---
> >  .../ABI/testing/sysfs-driver-wktmr-brcmstb         |  12 +
> >  drivers/soc/brcmstb/Kconfig                        |   3 +
> >  drivers/soc/brcmstb/Makefile                       |   1 +
> >  drivers/soc/brcmstb/wktmr.c                        | 242 +++++++++++++++++++++
> >  4 files changed, 258 insertions(+)
> >  create mode 100644 Documentation/ABI/testing/sysfs-driver-wktmr-brcmstb
> >  create mode 100644 drivers/soc/brcmstb/wktmr.c
> >
> > diff --git a/Documentation/ABI/testing/sysfs-driver-wktmr-brcmstb b/Documentation/ABI/testing/sysfs-driver-wktmr-brcmstb
> > new file mode 100644
> > index 000000000000..e563f8b8d969
> > --- /dev/null
> > +++ b/Documentation/ABI/testing/sysfs-driver-wktmr-brcmstb
> > @@ -0,0 +1,12 @@
> > +What:          /sys/bus/platform/drivers/brcm-waketimer/<MMIO-address>.waketimer/timeout
> > +Date:          November 21, 2014
> > +KernelVersion: 3.14
> > +Contact:       Brian Norris <norris-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> 
> Shouldn't this be "Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>"?

Indeed, thanks. Wouldn't want things bouncing...

> > +Description:   The control file for the wakeup timer. This integer value
> > +               represents the number of seconds between a suspend operation
> > +               (e.g., S3 suspend-to-RAM) and the time at which the wakeup
> > +               timer should fire.
> > [...]
> > diff --git a/drivers/soc/brcmstb/wktmr.c b/drivers/soc/brcmstb/wktmr.c
> > new file mode 100644
> > index 000000000000..89f989724d3c
> > --- /dev/null
> > +++ b/drivers/soc/brcmstb/wktmr.c
> > @@ -0,0 +1,242 @@
> > [...]
> > +
> > +static void brcmstb_waketmr_set_alarm(struct brcmstb_waketmr *timer,
> > +               unsigned int secs)
> > +{
> > +       unsigned int t;
> 
> Use u32.

Sure.

> > +
> > +       brcmstb_waketmr_clear_alarm(timer);
> > +
> > +       t = readl_relaxed(timer->base + BRCMSTB_WKTMR_COUNTER);
> > +       writel_relaxed(t + secs + 1, timer->base + BRCMSTB_WKTMR_ALARM);
> > +}
> > +
> > [...]
> > +static int brcmstb_waketmr_probe(struct platform_device *pdev)
> > +{
> > [...]
> > +       /*
> > +        * Set wakeup capability before requesting wakeup interrupt, so we can
> > +        * process boot-time "wakeups" (e.g., from S5 soft-off)
> > +        */
> > +       device_set_wakeup_capable(dev, true);
> > +       device_wakeup_enable(dev);
> > +
> > +       timer->irq = platform_get_irq(pdev, 0);
> > +       if ((int)timer->irq < 0)
> 
> Probably better to just have timer->irq be a signed int so you don't
> need this cast.

That's the only place where it needs to be signed. All other APIs are
unsigned, I think. But sure, I can change that.

> > [snip]
> 
> Acked-by: Gregory Fong <gregory.0xf0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Thanks for the review!

Brian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in

  parent reply	other threads:[~2015-06-19 17:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19  0:11 [PATCH 0/7] soc: brcmstb: add system suspend support for STB SoCs Brian Norris
2015-06-19  0:11 ` [PATCH 1/7] Documentation: dt: brcmstb: add system PM bindings Brian Norris
     [not found]   ` <1434672696-13632-2-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-12 19:58     ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 2/7] Documentation: dt: brcmstb: add waketimer documentation Brian Norris
     [not found]   ` <1434672696-13632-3-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-06-19  2:09     ` Gregory Fong
2015-09-12 19:58   ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 3/7] soc: add stubs for brcmstb SoC's Brian Norris
     [not found]   ` <1434672696-13632-4-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-12 20:16     ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 4/7] soc: brcmstb: add PM suspend/resume support (S2/S3/S5) Brian Norris
     [not found]   ` <1434672696-13632-5-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-12 20:23     ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 5/7] soc: brcmstb: add wake-timer driver Brian Norris
     [not found]   ` <1434672696-13632-6-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-06-19  2:20     ` Gregory Fong
     [not found]       ` <CADtm3G7qui2Yi6j-pFSGO9sGdHde1hy-c9wAWfQ38Dg8rKq2Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-19 17:36         ` Brian Norris [this message]
2015-09-12 20:00     ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 6/7] ARM: brcmstb: mask GIC IRQs on suspend Brian Norris
2015-06-19  1:48   ` Gregory Fong
     [not found]   ` <1434672696-13632-7-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-12 19:53     ` Florian Fainelli
     [not found]       ` <55F482BC.4050202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-14 17:29         ` Brian Norris
2015-09-14 17:42         ` Brian Norris
     [not found]           ` <20150914174209.GQ11487-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-09-14 17:43             ` Florian Fainelli
2015-06-19  0:11 ` [PATCH 7/7] ARM: dts: brcmstb: add BCM7445 system PM DT nodes Brian Norris
     [not found]   ` <1434672696-13632-8-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-12 19:58     ` Florian Fainelli
     [not found] ` <1434672696-13632-1-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-06-19  3:20   ` [PATCH 0/7] soc: brcmstb: add system suspend support for STB SoCs Gregory Fong
     [not found]     ` <CADtm3G7GQNuaZDoNe84YAh7pRV9s_2VhUuW8YpaCoNuozoyVZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-19 22:41       ` Brian Norris
2015-06-19 22:55         ` Brian Norris
2015-06-22 19:47 ` Brian Norris
2015-06-24  4:47   ` Florian Fainelli

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=20150619173608.GJ4917@ld-irv-0074 \
    --to=computersforpeace-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=gregory.0xf0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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