From: Chenhui Zhao <chenhui.zhao@freescale.com>
To: Scott Wood <scottwood@freescale.com>
Cc: <linuxppc-dev@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>,
<Jason.Jin@freescale.com>
Subject: Re: [PATCH] powerpc/85xx: add sleep and deep sleep support
Date: Mon, 3 Aug 2015 19:10:32 +0800 [thread overview]
Message-ID: <1438600232.7515.0@remotesmtp.freescale.net> (raw)
In-Reply-To: <1438397837.2097.4.camel@freescale.com>
On Sat, Aug 1, 2015 at 10:57 AM, Scott Wood <scottwood@freescale.com>
wrote:
> On Fri, 2015-07-24 at 20:46 +0800, Chenhui Zhao wrote:
>> +static void mpc85xx_pmc_set_wake(struct device *dev, void *enable)
>> {
>> int ret;
>> + u32 value[2];
>> +
>> + if (!device_may_wakeup(dev))
>> + return;
>> +
>> + if (!pmc_regs) {
>> + dev_err(dev, "%s: PMC is unavailable\n", __func__);
>> + return;
>> + }
>> +
>> + ret = of_property_read_u32_array(dev->of_node, "sleep",
>> value, 2);
>
> This will crash on any device without an of_node.
Add this before this line:
if (!dev->of_node)
return;
>
>
>> + if (ret) {
>> + dev_dbg(dev, "%s: Can not find the \"sleep\"
>> property.\n",
>> + __func__);
>> + return;
>> + }
>> +
>> + if (*(int *)enable)
>> + pmc_pmcdr_mask &= ~value[1];
>> + else
>> + pmc_pmcdr_mask |= value[1];
>> +
>> + if ((value[1] & 0xe0) && (pmc_flag & PMC_LOSSLESS))
>> + pmc_powmgtcsr = POWMGTCSR_LOSSLESS;
>> +}
>
> What is 0xe0?
>
> -Scott
This is a mask value for the register PMCDR, which includes all bits
corresponding to eTSEC. Will use a macro instead.
-Chenhui
prev parent reply other threads:[~2015-08-03 11:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-24 12:46 [PATCH] powerpc/85xx: add sleep and deep sleep support Chenhui Zhao
2015-08-01 2:57 ` Scott Wood
2015-08-03 11:10 ` Chenhui Zhao [this message]
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=1438600232.7515.0@remotesmtp.freescale.net \
--to=chenhui.zhao@freescale.com \
--cc=Jason.Jin@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=scottwood@freescale.com \
/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).