RE: [PATCH 1/1] TPM: STMicroelectronics ST33 I2C

From: Mathias LEBLANC
Date: Tue Nov 20 2012 - 03:27:28 EST


Hello,

Does anyone can say me when the driver will be integrated on linux kernel and where can we get it from the linux source code?

Thanks,

Mathias Leblanc

-----Original Message-----
From: Kent Yoder [mailto:key@xxxxxxxxxxxxxxxxxx]
Sent: 14 November, 2012 23:07
To: Mathias LEBLANC
Cc: Rajiv Andrade; Marcel Selhorst; Sirrix AG; tpmdd-devel@xxxxxxxxxxxxxxxxxxxxx; Debora Velarde; linux-kernel@xxxxxxxxxxxxxxx; Jean-Luc BLANC
Subject: Re: [PATCH 1/1] TPM: STMicroelectronics ST33 I2C

Hi Mathias,

On Wed, Nov 14, 2012 at 03:31:42PM +0100, Mathias Leblanc wrote:
> * STMicroelectronics version 1.2.0, Copyright (C) 2010
> * STMicroelectronics comes with ABSOLUTELY NO WARRANTY.
> * This is free software, and you are welcome to redistribute it
> * under certain conditions.
>
> This is the driver for TPM chip from ST Microelectronics.
>
> If you have a TPM security chip from STMicroelectronics working with
> an I2C, in menuconfig or .config choose the tpm driver on device -->
> tpm and activate the protocol of your choice before compiling the
> kernel.
> The driver will be accessible from within Linux.
>
> Tested on linux x86/x64, beagleboard REV B & XM REV C and CHROMIUM OS

Getting some build errors here:

drivers/char/tpm/tpm_stm_st33_i2c.c: In function â__check_interruptsâ:
drivers/char/tpm/tpm_stm_st33_i2c.c:615:1: warning: return from incompatible pointer type [enabled by default]
drivers/char/tpm/tpm_stm_st33_i2c.c: In function â__check_power_mgtâ:
drivers/char/tpm/tpm_stm_st33_i2c.c:619:1: warning: return from incompatible pointer type [enabled by default]
drivers/char/tpm/tpm_stm_st33_i2c.c: In function âtpm_st33_i2c_probeâ:
drivers/char/tpm/tpm_stm_st33_i2c.c:725:3: warning: suggest parentheses around arithmetic in operand of â|â [-Wparentheses]
drivers/char/tpm/tpm_stm_st33_i2c.c: In function
âtpm_st33_i2c_pm_suspendâ:
drivers/char/tpm/tpm_stm_st33_i2c.c:826:3: error: too many arguments to function âtpm_pm_suspendâ
In file included from drivers/char/tpm/tpm_stm_st33_i2c.h:55:0,
from drivers/char/tpm/tpm_stm_st33_i2c.c:35:
drivers/char/tpm/tpm.h:326:12: note: declared here
drivers/char/tpm/tpm_stm_st33_i2c.c: In function
âtpm_st33_i2c_pm_resumeâ:
drivers/char/tpm/tpm_stm_st33_i2c.c:855:3: error:
implicit declaration of function
âtpm_continue_selftestâ
[-Werror=implicit-function-declaration]

[cut]
> +/*
> + * _wait_for_interrupt_serirq_timeout
> + * @param: tpm, the chip description
> + * @param: timeout, the timeout of the interrupt
> + * @return: the status of the interruption.
> + */
> +static int _wait_for_interrupt_serirq_timeout(struct tpm_chip *chip,
> + unsigned long timeout)
> +{
> + int status;
> + struct i2c_client *client;
> + struct st33zp24_platform_data *pin_infos;
> +
> + client = (struct i2c_client *) chip->vendor.iobase;
> + pin_infos = client->dev.platform_data;
> +
> + status = wait_for_completion_interruptible_timeout(
> + &pin_infos->irq_detection,
> + timeout);

status should be a long here.

[cut]
> +
> + if (client == NULL) {
> + pr_info("client is NULL. exiting.\n");
> + err = -ENODEV;
> + goto end;
> + }
> +
> + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
> + pr_info("client not i2c capable\n");
> + err = -ENODEV;
> + goto end;
> + }
> +
> + chip = tpm_register_hardware(&client->dev, &st_i2c_tpm);
> + if (!chip) {
> + pr_info("fail chip\n");

Please use dev_info() in place of pr_info().

Thanks,
Kent

N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i