Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352861
b: refs/heads/master
c: d459335
h: refs/heads/master
i:
  352859: 909b4f6
v: v3
  • Loading branch information
Peter Huewe authored and Kent Yoder committed Feb 5, 2013
1 parent e3b60b1 commit 7821af2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2bfee22f6c60e046f6b04f2d4855fddac1f67290
refs/heads/master: d459335381eca1cb91fefb87021d3d172342e55a
28 changes: 12 additions & 16 deletions trunk/drivers/char/tpm/tpm_i2c_stm_st33.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ static __devexit int tpm_st33_i2c_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_PM_SLEEP
/*
* tpm_st33_i2c_pm_suspend suspend the TPM device
* Added: Work around when suspend and no tpm application is running, suspend
Expand All @@ -827,20 +828,18 @@ static __devexit int tpm_st33_i2c_remove(struct i2c_client *client)
* @param: mesg, the power management message.
* @return: 0 in case of success.
*/
static int tpm_st33_i2c_pm_suspend(struct i2c_client *client, pm_message_t mesg)
static int tpm_st33_i2c_pm_suspend(struct device *dev)
{
struct tpm_chip *chip =
(struct tpm_chip *)i2c_get_clientdata(client);
struct st33zp24_platform_data *pin_infos =
((struct i2c_client *)TPM_VPRIV(chip))->dev.platform_data;
struct tpm_chip *chip = dev_get_drvdata(dev);
struct st33zp24_platform_data *pin_infos = dev->platform_data;
int ret = 0;

if (power_mgt)
gpio_set_value(pin_infos->io_lpcpd, 0);
else{
if (chip->data_buffer == NULL)
chip->data_buffer = pin_infos->tpm_i2c_buffer[0];
ret = tpm_pm_suspend(&client->dev);
ret = tpm_pm_suspend(dev);
}
return ret;
} /* tpm_st33_i2c_suspend() */
Expand All @@ -850,12 +849,10 @@ static int tpm_st33_i2c_pm_suspend(struct i2c_client *client, pm_message_t mesg)
* @param: client, the i2c_client drescription (TPM I2C description).
* @return: 0 in case of success.
*/
static int tpm_st33_i2c_pm_resume(struct i2c_client *client)
static int tpm_st33_i2c_pm_resume(struct device *dev)
{
struct tpm_chip *chip =
(struct tpm_chip *)i2c_get_clientdata(client);
struct st33zp24_platform_data *pin_infos =
((struct i2c_client *)TPM_VPRIV(chip))->dev.platform_data;
struct tpm_chip *chip = dev_get_drvdata(dev);
struct st33zp24_platform_data *pin_infos = dev->platform_data;

int ret = 0;

Expand All @@ -868,29 +865,28 @@ static int tpm_st33_i2c_pm_resume(struct i2c_client *client)
} else{
if (chip->data_buffer == NULL)
chip->data_buffer = pin_infos->tpm_i2c_buffer[0];
ret = tpm_pm_resume(&client->dev);
ret = tpm_pm_resume(dev);
if (!ret)
tpm_do_selftest(chip);
}
return ret;
} /* tpm_st33_i2c_pm_resume() */
#endif

static const struct i2c_device_id tpm_st33_i2c_id[] = {
{TPM_ST33_I2C, 0},
{}
};

MODULE_DEVICE_TABLE(i2c, tpm_st33_i2c_id);

static SIMPLE_DEV_PM_OPS(tpm_st33_i2c_ops, tpm_st33_i2c_pm_suspend, tpm_st33_i2c_pm_resume);
static struct i2c_driver tpm_st33_i2c_driver = {
.driver = {
.owner = THIS_MODULE,
.name = TPM_ST33_I2C,
.pm = &tpm_st33_i2c_ops,
},
.probe = tpm_st33_i2c_probe,
.remove = tpm_st33_i2c_remove,
.resume = tpm_st33_i2c_pm_resume,
.suspend = tpm_st33_i2c_pm_suspend,
.id_table = tpm_st33_i2c_id
};

Expand Down

0 comments on commit 7821af2

Please sign in to comment.