#include <linux/acpi.h>
#include <linux/completion.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/spi/spi.h>
#include <linux/tpm.h>
#include "tpm.h"
#include "tpm_tis_core.h"
#include "tpm_tis_spi.h"
#define MAX_SPI_FRAMESIZE …
#define SPI_HDRSIZE …
static int tpm_tis_spi_flow_control(struct tpm_tis_spi_phy *phy,
struct spi_transfer *spi_xfer)
{ … }
static int tpm_tis_spi_transfer_half(struct tpm_tis_data *data, u32 addr,
u16 len, u8 *in, const u8 *out)
{ … }
static int tpm_tis_spi_transfer_full(struct tpm_tis_data *data, u32 addr,
u16 len, u8 *in, const u8 *out)
{ … }
int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u16 len,
u8 *in, const u8 *out)
{ … }
static int tpm_tis_spi_read_bytes(struct tpm_tis_data *data, u32 addr,
u16 len, u8 *result, enum tpm_tis_io_mode io_mode)
{ … }
static int tpm_tis_spi_write_bytes(struct tpm_tis_data *data, u32 addr,
u16 len, const u8 *value, enum tpm_tis_io_mode io_mode)
{ … }
int tpm_tis_spi_init(struct spi_device *spi, struct tpm_tis_spi_phy *phy,
int irq, const struct tpm_tis_phy_ops *phy_ops)
{ … }
static const struct tpm_tis_phy_ops tpm_spi_phy_ops = …;
static int tpm_tis_spi_probe(struct spi_device *dev)
{ … }
tpm_tis_spi_probe_func;
static int tpm_tis_spi_driver_probe(struct spi_device *spi)
{ … }
static SIMPLE_DEV_PM_OPS(tpm_tis_pm, tpm_pm_suspend, tpm_tis_spi_resume);
static void tpm_tis_spi_remove(struct spi_device *dev)
{ … }
static const struct spi_device_id tpm_tis_spi_id[] = …;
MODULE_DEVICE_TABLE(spi, tpm_tis_spi_id);
static const struct of_device_id of_tis_spi_match[] __maybe_unused = …;
MODULE_DEVICE_TABLE(of, of_tis_spi_match);
static const struct acpi_device_id acpi_tis_spi_match[] __maybe_unused = …;
MODULE_DEVICE_TABLE(acpi, acpi_tis_spi_match);
static struct spi_driver tpm_tis_spi_driver = …;
module_spi_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;