#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/wait.h>
#include "tpm.h"
#define TPM_I2C_INFINEON_BUFSIZE …
#define MAX_COUNT …
#define SLEEP_DURATION_LOW …
#define SLEEP_DURATION_HI …
#define MAX_COUNT_LONG …
#define SLEEP_DURATION_LONG_LOW …
#define SLEEP_DURATION_LONG_HI …
#define SLEEP_DURATION_RESET_LOW …
#define SLEEP_DURATION_RESET_HI …
#define TPM_TIMEOUT_US_LOW …
#define TPM_TIMEOUT_US_HI …
#define TPM_TIS_I2C_DID_VID_9635 …
#define TPM_TIS_I2C_DID_VID_9645 …
enum i2c_chip_type { … };
struct tpm_inf_dev { … };
static struct tpm_inf_dev tpm_dev;
static int iic_tpm_read(u8 addr, u8 *buffer, size_t len)
{ … }
static int iic_tpm_write_generic(u8 addr, u8 *buffer, size_t len,
unsigned int sleep_low,
unsigned int sleep_hi, u8 max_count)
{ … }
static int iic_tpm_write(u8 addr, u8 *buffer, size_t len)
{ … }
static int iic_tpm_write_long(u8 addr, u8 *buffer, size_t len)
{ … }
enum tis_access { … };
enum tis_status { … };
enum tis_defaults { … };
#define TPM_ACCESS(l) …
#define TPM_STS(l) …
#define TPM_DATA_FIFO(l) …
#define TPM_DID_VID(l) …
static bool check_locality(struct tpm_chip *chip, int loc)
{ … }
static void release_locality(struct tpm_chip *chip, int loc, int force)
{ … }
static int request_locality(struct tpm_chip *chip, int loc)
{ … }
static u8 tpm_tis_i2c_status(struct tpm_chip *chip)
{ … }
static void tpm_tis_i2c_ready(struct tpm_chip *chip)
{ … }
static ssize_t get_burstcount(struct tpm_chip *chip)
{ … }
static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
int *status)
{ … }
static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
{ … }
static int tpm_tis_i2c_recv(struct tpm_chip *chip, u8 *buf, size_t count)
{ … }
static int tpm_tis_i2c_send(struct tpm_chip *chip, u8 *buf, size_t len)
{ … }
static bool tpm_tis_i2c_req_canceled(struct tpm_chip *chip, u8 status)
{ … }
static const struct tpm_class_ops tpm_tis_i2c = …;
static int tpm_tis_i2c_init(struct device *dev)
{ … }
static const struct i2c_device_id tpm_tis_i2c_table[] = …;
MODULE_DEVICE_TABLE(i2c, tpm_tis_i2c_table);
#ifdef CONFIG_OF
static const struct of_device_id tpm_tis_i2c_of_match[] = …;
MODULE_DEVICE_TABLE(of, tpm_tis_i2c_of_match);
#endif
static SIMPLE_DEV_PM_OPS(tpm_tis_i2c_ops, tpm_pm_suspend, tpm_pm_resume);
static int tpm_tis_i2c_probe(struct i2c_client *client)
{ … }
static void tpm_tis_i2c_remove(struct i2c_client *client)
{ … }
static struct i2c_driver tpm_tis_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_VERSION(…) …;
MODULE_LICENSE(…) …;