From: Lee Jones <lee.jones@linaro.org>
To: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
rtc-linux@googlegroups.com, sameo@linux.intel.com,
a.zummo@towertech.it, alexandre.belloni@free-electrons.com,
Chao Xie <chao.xie@marvell.com>
Subject: [rtc-linux] Re: [PATCH 4/4] mfd: 88pm800: allocate pdata->rtc if not allocated earlier
Date: Mon, 1 Jun 2015 09:22:00 +0100 [thread overview]
Message-ID: <20150601082200.GC3329@x1> (raw)
In-Reply-To: <1432937962-4537-5-git-send-email-vaibhav.hiremath@linaro.org>
On Sat, 30 May 2015, Vaibhav Hiremath wrote:
> 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.
>=20
> So we need rtc platform data to be existed in PMIC driver to pass this
> information.
>=20
> Signed-off-by: Chao Xie <chao.xie@marvell.com>
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---
> drivers/mfd/88pm800.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>=20
> 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;
> }
> =20
> + /*
> + * 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 =3D 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;
> + }
> + }
> +
Where is this memory first used?
> ret =3D pm80x_init(client);
> if (ret) {
> dev_err(&client->dev, "pm800_init fail\n");
--=20
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org =E2=94=82 Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--=20
--=20
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---=20
You received this message because you are subscribed to the Google Groups "=
rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
next prev parent reply other threads:[~2015-06-01 8:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 22:19 [rtc-linux] [PATCH 0/4] Add Device tree support for 88PM800 mfd and rtc driver Vaibhav Hiremath
2015-05-29 22:19 ` [rtc-linux] [PATCH 1/4] mfd: 88pm800: add device tree support Vaibhav Hiremath
2015-06-01 8:38 ` [rtc-linux] " Lee Jones
2015-06-16 7:52 ` Vaibhav Hiremath
2015-06-16 13:02 ` Rob Herring
2015-06-16 14:36 ` Vaibhav Hiremath
2015-05-29 22:19 ` [rtc-linux] [PATCH 2/4] mfd: 88pm800: use irq_mode to configure interrupt status reg clear method Vaibhav Hiremath
2015-06-01 8:31 ` [rtc-linux] " Lee Jones
2015-06-02 8:51 ` Vaibhav Hiremath
2015-05-29 22:19 ` [rtc-linux] [PATCH 3/4] rtc: 88pm80x: add device tree support Vaibhav Hiremath
2015-05-29 22:19 ` [rtc-linux] [PATCH 4/4] mfd: 88pm800: allocate pdata->rtc if not allocated earlier Vaibhav Hiremath
2015-06-01 8:22 ` Lee Jones [this message]
2015-06-02 5:07 ` [rtc-linux] " Vaibhav Hiremath
2015-06-02 7:40 ` Lee Jones
2015-06-02 9:05 ` Vaibhav Hiremath
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
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=20150601082200.GC3329@x1 \
--to=lee.jones@linaro.org \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=chao.xie@marvell.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=rtc-linux@googlegroups.com \
--cc=sameo@linux.intel.com \
--cc=vaibhav.hiremath@linaro.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