summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChe-Liang Chiou <clchiou@chromium.org>2011-04-14 11:43:25 +0800
committerSimon Glass <sjg@chromium.org>2011-08-24 10:01:08 -0700
commit85d4b16be18ee79b46fd0a90b1d6651ef034a863 (patch)
treede82d0b397d523261822644a5d2cc96dbb7a741a /drivers
parent1ff7c821e5098eeef61e9c51cbad7dec5b6f633c (diff)
Set i2c bus for TPM and wake up TPM chip
With this patch you will be able to see TPM driver successfully probes TPM chip on i2c bus. The TPM driver will output the following message: "I2C addr(x20) : v05 engineering/production". R=rongchang@chromium.org BUG=none TEST=verify that above message shows up Review URL: http://codereview.chromium.org/6839014 Change-Id: Id0c4c9d24183f436c225c8ed10ed3ef464cfd501
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tpm/slb9635_i2c/ifx_v05.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/tpm/slb9635_i2c/ifx_v05.c b/drivers/tpm/slb9635_i2c/ifx_v05.c
index c39d8e765b3..6050425f9b0 100644
--- a/drivers/tpm/slb9635_i2c/ifx_v05.c
+++ b/drivers/tpm/slb9635_i2c/ifx_v05.c
@@ -18,7 +18,28 @@
int tpm_init_v05(void)
{
- return i2c_probe(TPM_V05_ADDR );
+ int rc;
+
+#ifdef CONFIG_INFINEON_TPM_I2C_BUS
+ if ((rc = i2c_set_bus_num(CONFIG_INFINEON_TPM_I2C_BUS))) {
+ debug("%s: fail: i2c_set_bus_num(0x%x) return %d\n", __func__,
+ CONFIG_INFINEON_TPM_I2C_BUS, rc);
+ return rc;
+ }
+#else
+#warning "No i2c bus number is configured."
+#endif
+ /* request for waking up device */
+ if ((rc = i2c_probe(TPM_V05_ADDR)) == 0)
+ return 0;
+
+ /* do the probing job */
+ if ((rc = i2c_probe(TPM_V05_ADDR)) == 0)
+ return 0;
+
+ debug("%s: fail: i2c_probe(0x%x) return %d\n", __func__,
+ TPM_V05_ADDR, rc);
+ return rc;
}
int tpm_open_v05(void)