All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Ricard <christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jarkko Sakkinen
	<jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: jean-luc.blanc-qxv4g6HH51o@public.gmane.org,
	ashley-fm2HMyfA2y6tG0bUXCXiUA@public.gmane.org,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	christophe-h.ricard-qxv4g6HH51o@public.gmane.org,
	benoit.houyere-qxv4g6HH51o@public.gmane.org
Subject: Re: [PATCH v6 7/8] tpm: Use read/write_bytes for drivers without more specialized methods
Date: Tue, 3 May 2016 22:28:56 +0200	[thread overview]
Message-ID: <57290A08.20403@gmail.com> (raw)
In-Reply-To: <20160502203236.GA5415-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Ok will do

On 02/05/2016 22:32, Jarkko Sakkinen wrote:
> On Sat, Apr 23, 2016 at 12:11:24AM +0200, Christophe Ricard wrote:
>> Some drivers might need to implement only functions for transferring an
>> arbitrary number of bytes. Provides a generic functions for handling  of
>> word or dword transfers to be dump into driver functions pointers.
>>
>> Signed-off-by: Alexander Steffen <Alexander.Steffen-d0qZbvYSIPpWk0Htik3J/w@public.gmane.org>
>> Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
> Ignore my comment for 6/8. This patch is not necessary for the series.
>
> /Jarkko
>
>> ---
>>   drivers/char/tpm/tpm_tis_core.c | 30 ++++++++++++++++++++++++++++++
>>   drivers/char/tpm/tpm_tis_core.h |  4 ++++
>>   2 files changed, 34 insertions(+)
>>
>> diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
>> index f4e05ac..fd9c6a5 100644
>> --- a/drivers/char/tpm/tpm_tis_core.c
>> +++ b/drivers/char/tpm/tpm_tis_core.c
>> @@ -854,6 +854,36 @@ int tpm_tis_resume(struct device *dev)
>>   EXPORT_SYMBOL_GPL(tpm_tis_resume);
>>   #endif
>>   
>> +int tpm_tis_common_read16(struct tpm_tis_data *data, u32 addr, u16 *result)
>> +{
>> +	int rc;
>> +
>> +	rc = data->phy_ops->read_bytes(data, addr, sizeof(u16), (u8 *)result);
>> +	if (!rc)
>> +		*result = le16_to_cpu(*result);
>> +	return rc;
>> +}
>> +EXPORT_SYMBOL_GPL(tpm_tis_common_read16);
>> +
>> +int tpm_tis_common_read32(struct tpm_tis_data *data, u32 addr, u32 *result)
>> +{
>> +	int rc;
>> +
>> +	rc = data->phy_ops->read_bytes(data, addr, sizeof(u32), (u8 *)result);
>> +	if (!rc)
>> +		*result = le32_to_cpu(*result);
>> +	return rc;
>> +}
>> +EXPORT_SYMBOL_GPL(tpm_tis_common_read32);
>> +
>> +int tpm_tis_common_write32(struct tpm_tis_data *data, u32 addr, u32 value)
>> +{
>> +	value = cpu_to_le32(value);
>> +	return data->phy_ops->write_bytes(data, addr, sizeof(u32),
>> +					   (u8 *)&value);
>> +}
>> +EXPORT_SYMBOL_GPL(tpm_tis_common_write32);
>> +
>>   MODULE_AUTHOR("Leendert van Doorn (leendert-aZOuKsOsJu3MbYB6QlFGEg@public.gmane.org)");
>>   MODULE_DESCRIPTION("TPM Driver");
>>   MODULE_VERSION("2.0");
>> diff --git a/drivers/char/tpm/tpm_tis_core.h b/drivers/char/tpm/tpm_tis_core.h
>> index 91aa305..bdc7899 100644
>> --- a/drivers/char/tpm/tpm_tis_core.h
>> +++ b/drivers/char/tpm/tpm_tis_core.h
>> @@ -141,6 +141,10 @@ static inline int tpm_write32(struct tpm_tis_data *data, u32 addr, u32 value)
>>   	return data->phy_ops->write32(data, addr, value);
>>   }
>>   
>> +int tpm_tis_common_read16(struct tpm_tis_data *data, u32 addr, u16 *result);
>> +int tpm_tis_common_read32(struct tpm_tis_data *data, u32 addr, u32 *result);
>> +int tpm_tis_common_write32(struct tpm_tis_data *data, u32 addr, u32 value);
>> +
>>   void tpm_tis_remove(struct tpm_chip *chip);
>>   int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
>>   		      const struct tpm_tis_phy_ops *phy_ops,
>> -- 
>> 2.1.4
>>


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z

  parent reply	other threads:[~2016-05-03 20:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 22:11 [PATCH v6 0/8] Rework of tpm_tis to share common logic accross phy's (lpc/spi/-i2c-) Christophe Ricard
     [not found] ` <1461363085-9908-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-04-22 22:11   ` [PATCH v6 1/8] tpm: Add include guards in tpm.h Christophe Ricard
2016-04-22 22:11   ` [PATCH v6 2/8] tpm: tpm_tis: Share common data between phys Christophe Ricard
2016-04-22 22:11   ` [PATCH v6 3/8] tpm_tis: Introduce intermediate layer for TPM access Christophe Ricard
2016-04-22 22:11   ` [PATCH v6 4/8] devicetree: Add infineon to vendor-prefix.txt Christophe Ricard
2016-04-22 22:11   ` [PATCH v6 5/8] devicetree: Add Trusted Computing Group " Christophe Ricard
2016-04-22 22:11   ` [PATCH v6 6/8] tpm/tpm_tis: Split tpm_tis driver into a core and TCG TIS compliant phy Christophe Ricard
     [not found]     ` <1461363085-9908-7-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-05-02 17:16       ` Jarkko Sakkinen
     [not found]         ` <20160502171650.GC1764-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-05-02 17:25           ` Jason Gunthorpe
     [not found]             ` <20160502172552.GA32096-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-05-02 20:30               ` Jarkko Sakkinen
2016-04-22 22:11   ` [PATCH v6 7/8] tpm: Use read/write_bytes for drivers without more specialized methods Christophe Ricard
     [not found]     ` <1461363085-9908-8-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-05-02 20:32       ` Jarkko Sakkinen
     [not found]         ` <20160502203236.GA5415-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-05-03 20:28           ` Christophe Ricard [this message]
     [not found]             ` <57290A08.20403-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-04 10:52               ` Jarkko Sakkinen
2016-04-22 22:11   ` [PATCH v6 8/8] tpm/tpm_tis_spi: Add support for spi phy Christophe Ricard
2016-04-25  9:12   ` [PATCH v6 0/8] Rework of tpm_tis to share common logic accross phy's (lpc/spi/-i2c-) Jarkko Sakkinen
2016-05-02 22:18   ` Jarkko Sakkinen

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=57290A08.20403@gmail.com \
    --to=christophe.ricard-re5jqeeqqe8avxtiumwx3w@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=jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=jean-luc.blanc-qxv4g6HH51o@public.gmane.org \
    --cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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.