From: Vaibhav Hiremath <vaibhav.hiremath-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
Vaibhav Hiremath
<vaibhav.hiremath-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Chao Xie <chao.xie-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH 4/4] mfd: 88pm800: allocate pdata->rtc if not allocated earlier
Date: Sat, 30 May 2015 03:49:22 +0530 [thread overview]
Message-ID: <1432937962-4537-5-git-send-email-vaibhav.hiremath@linaro.org> (raw)
In-Reply-To: <1432937962-4537-1-git-send-email-vaibhav.hiremath-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
RTC in pmic 88PM800 can run even the core is powered off, and user
can set alarm in RTC. When the alarm is timed out, the PMIC will power up
the core, and the whole system will boot up. And during PMIC driver probe,
it will read some register to find out whether this boot is caused by RTC
timeout or not, and pass on this information to the RTC driver.
So we need rtc platform data to be existed in PMIC driver to pass this
information.
Signed-off-by: Chao Xie <chao.xie-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
drivers/mfd/88pm800.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c
index 8ea4467..34546a1 100644
--- a/drivers/mfd/88pm800.c
+++ b/drivers/mfd/88pm800.c
@@ -586,6 +586,25 @@ static int pm800_probe(struct i2c_client *client,
return ret;
}
+ /*
+ * RTC in pmic can run even the core is powered off, and user can set
+ * alarm in RTC. When the alarm is time out, the PMIC will power up
+ * the core, and the whole system will boot up. When PMIC driver is
+ * probed, it will read out some register to find out whether this
+ * boot is caused by RTC timeout or not, and it need pass this
+ * information to RTC driver.
+ * So we need rtc platform data to be existed to pass this information.
+ */
+ if (!pdata->rtc) {
+ pdata->rtc = devm_kzalloc(&client->dev,
+ sizeof(*(pdata->rtc)), GFP_KERNEL);
+ if (!pdata->rtc) {
+ dev_err(&client->dev,
+ "failed to allocate memory for rtc\n");
+ return -ENOMEM;
+ }
+ }
+
ret = pm80x_init(client);
if (ret) {
dev_err(&client->dev, "pm800_init fail\n");
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-05-29 22:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 22:19 [PATCH 0/4] Add Device tree support for 88PM800 mfd and rtc driver Vaibhav Hiremath
[not found] ` <1432937962-4537-1-git-send-email-vaibhav.hiremath-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-05-29 22:19 ` [PATCH 1/4] mfd: 88pm800: add device tree support Vaibhav Hiremath
[not found] ` <1432937962-4537-2-git-send-email-vaibhav.hiremath-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-06-01 8:38 ` Lee Jones
2015-06-16 7:52 ` Vaibhav Hiremath
[not found] ` <557FD5AD.5020405-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-06-16 13:02 ` Rob Herring
[not found] ` <CAL_Jsq+6yk59Z4swi2xq4=_=m89pBUt-fNXJF8smjw7qS8xazA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-16 14:36 ` Vaibhav Hiremath
2015-05-29 22:19 ` Vaibhav Hiremath [this message]
2015-06-01 8:22 ` [PATCH 4/4] mfd: 88pm800: allocate pdata->rtc if not allocated earlier Lee Jones
2015-06-02 5:07 ` Vaibhav Hiremath
[not found] ` <556D3A14.6050505-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-06-02 7:40 ` Lee Jones
2015-06-02 9:05 ` Vaibhav Hiremath
[not found] ` <556D71F6.4030608-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-06-02 9:33 ` Lee Jones
2015-06-02 9:49 ` Vaibhav Hiremath
2015-06-02 10:07 ` Lee Jones
2015-06-02 10:18 ` Vaibhav Hiremath
2015-05-29 22:19 ` [PATCH 2/4] mfd: 88pm800: use irq_mode to configure interrupt status reg clear method Vaibhav Hiremath
2015-06-01 8:31 ` Lee Jones
2015-06-02 8:51 ` Vaibhav Hiremath
2015-05-29 22:19 ` [PATCH 3/4] rtc: 88pm80x: add device tree support Vaibhav Hiremath
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=1432937962-4537-5-git-send-email-vaibhav.hiremath@linaro.org \
--to=vaibhav.hiremath-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org \
--cc=alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=chao.xie-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
--cc=sameo-VuQAYsv1563Yd54FQh9/CA@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;
as well as URLs for NNTP newsgroup(s).