From: "christophe.ricard" <christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Peter Hüwe" <PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
Cc: ashley-fm2HMyfA2y6tG0bUXCXiUA@public.gmane.org,
tpmdd-yWjUBOtONefk1uMJSBkQmQ@public.gmane.org,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
christophe-h.ricard-qxv4g6HH51o@public.gmane.org,
jean-luc.blanc-qxv4g6HH51o@public.gmane.org,
benoit.houyere-qxv4g6HH51o@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org,
jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
Subject: Re: [PATCH v4 1/4] tpm/tpm_i2c_stm_st33: Replace access to io_lpcpd from struct st33zp24_platform_data to tpm_stm_dev
Date: Mon, 26 Jan 2015 23:18:23 +0100 [thread overview]
Message-ID: <54C6BD2F.90605@gmail.com> (raw)
In-Reply-To: <201501262315.07543.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
Hi Peter,
The lpcpd pin allow the tpm to go in low power mode keeping the current
context in RAM.
As mention in the dts documentation:
"If set, power must be present when the platform is going into
sleep/hibernate mode."
The gpio state is enough to save and restore the context.
This allows for example saving some memory wear or quicker state changes...
Best Regards
Christophe
On 26/01/2015 23:15, Peter Hüwe wrote:
> Hi Christophe,
> Am Sonntag, 25. Januar 2015, 22:11:30 schrieb Christophe Ricard:
>> io_lpcpd is accessible from struct tpm_stm_dev.
>> struct st33zp24_platform_data is only valid when using static platform
>> configuration data, not when using dts.
>>
>> Reviewed-by: Jason Gunthorpe <jason.gunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
>> Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
>> ---
>> drivers/char/tpm/tpm_i2c_stm_st33.c | 18 +++++++++++-------
>> 1 file changed, 11 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c
>> b/drivers/char/tpm/tpm_i2c_stm_st33.c index 612845b..882c60a 100644
>> --- a/drivers/char/tpm/tpm_i2c_stm_st33.c
>> +++ b/drivers/char/tpm/tpm_i2c_stm_st33.c
>> @@ -837,11 +837,14 @@ static int tpm_stm_i2c_remove(struct i2c_client
>> *client) */
>> static int tpm_stm_i2c_pm_suspend(struct device *dev)
>> {
>> - struct st33zp24_platform_data *pin_infos = dev->platform_data;
>> + struct tpm_chip *chip = dev_get_drvdata(dev);
>> + struct tpm_stm_dev *tpm_dev;
>> int ret = 0;
>>
>> - if (gpio_is_valid(pin_infos->io_lpcpd))
>> - gpio_set_value(pin_infos->io_lpcpd, 0);
>> + tpm_dev = (struct tpm_stm_dev *)TPM_VPRIV(chip);
>> +
>> + if (gpio_is_valid(tpm_dev->io_lpcpd))
>> + gpio_set_value(tpm_dev->io_lpcpd, 0);
>> else
>> ret = tpm_pm_suspend(dev);
> I know this is not changed by this patch, but
> don't you need to send a tpm savestate? or is this implicit by pulling
> io_lpcpd ?
>
>
>
>> @@ -856,12 +859,13 @@ static int tpm_stm_i2c_pm_suspend(struct device *dev)
>> static int tpm_stm_i2c_pm_resume(struct device *dev)
>> {
>> struct tpm_chip *chip = dev_get_drvdata(dev);
>> - struct st33zp24_platform_data *pin_infos = dev->platform_data;
>> -
>> + struct tpm_stm_dev *tpm_dev;
>> int ret = 0;
>>
>> - if (gpio_is_valid(pin_infos->io_lpcpd)) {
>> - gpio_set_value(pin_infos->io_lpcpd, 1);
>> + tpm_dev = (struct tpm_stm_dev *)TPM_VPRIV(chip);
>> +
>> + if (gpio_is_valid(tpm_dev->io_lpcpd)) {
>> + gpio_set_value(tpm_dev->io_lpcpd, 1);
>> ret = wait_for_stat(chip,
>> TPM_STS_VALID, chip->vendor.timeout_b,
>> &chip->vendor.read_queue, false);
>
> Same applies to startup(STATE) on resume?
>
> Peter
--
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-01-26 22:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-25 21:11 [PATCH v4 0/4] st33zp24 new architecture proposal and st33zp24 spi driver Christophe Ricard
[not found] ` <1422220293-21005-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-25 21:11 ` [PATCH v4 1/4] tpm/tpm_i2c_stm_st33: Replace access to io_lpcpd from struct st33zp24_platform_data to tpm_stm_dev Christophe Ricard
[not found] ` <1422220293-21005-2-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-26 22:15 ` Peter Hüwe
[not found] ` <201501262315.07543.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
2015-01-26 22:18 ` christophe.ricard [this message]
2015-01-25 21:11 ` [PATCH v4 2/4] tpm/tpm_i2c_stm_st33: Split tpm_i2c_tpm_st33 in 2 layers (core + phy) Christophe Ricard
[not found] ` <1422220293-21005-3-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-26 23:07 ` Peter Hüwe
2015-01-25 21:11 ` [PATCH v4 3/4] tpm/st33zp24/spi: Add st33zp24 spi phy Christophe Ricard
[not found] ` <1422220293-21005-4-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-01-26 23:28 ` Peter Hüwe
2015-01-25 21:11 ` [PATCH v4 4/4] tpm/st33zp24/dts/st33zp24-spi: Add dts documentation for " Christophe Ricard
2015-01-26 21:39 ` [PATCH v4 0/4] st33zp24 new architecture proposal and st33zp24 spi driver Peter Hüwe
[not found] ` <201501262239.25303.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
2015-01-26 22:11 ` christophe.ricard
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=54C6BD2F.90605@gmail.com \
--to=christophe.ricard-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=PeterHuewe-Mmb7MZpHnFY@public.gmane.org \
--cc=ashley-fm2HMyfA2y6tG0bUXCXiUA@public.gmane.org \
--cc=benoit.houyere-qxv4g6HH51o@public.gmane.org \
--cc=christophe-h.ricard-qxv4g6HH51o@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=jean-luc.blanc-qxv4g6HH51o@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=tpmdd-yWjUBOtONefk1uMJSBkQmQ@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 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.