All of lore.kernel.org
 help / color / mirror / Atom feed
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] rtc: snvs: add Freescale rtc-snvs driver
Date: Thu, 05 Jul 2012 09:56:22 -0700	[thread overview]
Message-ID: <4FF5C736.8080001@codeaurora.org> (raw)
In-Reply-To: <1341416294-3194-1-git-send-email-shawn.guo@linaro.org>

On 07/04/12 08:38, Shawn Guo wrote:
> Add an RTC driver for Freescale Secure Non-Volatile Storage (SNVS)
> Low Power (LP) RTC.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Alessandro Zummo <a.zummo@towertech.it>

Besides the minor comment below, please add

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

> +#ifdef CONFIG_PM
> +static int snvs_rtc_suspend(struct device *dev)
> +{
> +	struct snvs_rtc_data *data = dev_get_drvdata(dev);
> +
> +	if (device_may_wakeup(dev))
> +		enable_irq_wake(data->irq);
> +
> +	return 0;
> +}
> +
> +static int snvs_rtc_resume(struct device *dev)
> +{
> +	struct snvs_rtc_data *data = dev_get_drvdata(dev);
> +
> +	if (device_may_wakeup(dev))
> +		disable_irq_wake(data->irq);
> +
> +	return 0;
> +}
> +
> +static const struct dev_pm_ops snvs_rtc_pm_ops = {
> +	.suspend = snvs_rtc_suspend,
> +	.resume = snvs_rtc_resume,
> +};

Can you use the SIMPLE_DEV_PM_OPS? Then we get the same callbacks for
hibernation.

> +#endif
> +
> +static const struct of_device_id __devinitconst snvs_dt_ids[] = {
> +	{ .compatible = "fsl,sec-v4.0-mon-rtc-lp", },
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, snvs_dt_ids);
> +
> +static struct platform_driver snvs_rtc_driver = {
> +	.driver = {
> +		.name	= "snvs_rtc",
> +		.owner	= THIS_MODULE,
> +#ifdef CONFIG_PM
> +		.pm	= &snvs_rtc_pm_ops,
> +#endif

Doing that avoids having an ifdef here.

> +		.of_match_table = snvs_dt_ids,
> +	},
> +	.probe		= snvs_rtc_probe,
> +	.remove		= __devexit_p(snvs_rtc_remove),
> +};
> +module_platform_driver(snvs_rtc_driver);
> +
> +MODULE_AUTHOR("Freescale Semiconductor, Inc.");
> +MODULE_DESCRIPTION("Freescale SNVS RTC Driver");
> +MODULE_LICENSE("GPL");


-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2012-07-05 16:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04 15:38 [PATCH v2] rtc: snvs: add Freescale rtc-snvs driver Shawn Guo
2012-07-05 16:56 ` Stephen Boyd [this message]
2012-07-05 23:28 ` Kim Phillips
2012-07-06  0:22   ` Shawn Guo
2012-07-06 22:56     ` Kim Phillips
2012-07-09  6:51       ` Shawn Guo
2012-07-10  0:45         ` Kim Phillips
2012-07-10  2:32           ` Shawn Guo
2012-07-11  0:02             ` Kim Phillips
2012-07-11  2:57               ` Shawn Guo
2012-07-12  1:50                 ` Kim Phillips
2012-07-12  2:50                   ` Shawn Guo

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=4FF5C736.8080001@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=linux-arm-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.