drivers/char/tpm/tpm_tis_spi.h

Source file repositories/reference/linux-study-clean/drivers/char/tpm/tpm_tis_spi.h

File Facts

System
Linux kernel
Corpus path
drivers/char/tpm/tpm_tis_spi.h
Extension
.h
Size
1191 bytes
Lines
50
Domain
Driver Families
Bucket
drivers/char
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct tpm_tis_spi_phy {
	struct tpm_tis_data priv;
	struct spi_device *spi_device;
	int (*flow_control)(struct tpm_tis_spi_phy *phy,
			     struct spi_transfer *xfer);
	struct completion ready;
	unsigned long wake_after;

	u8 *iobuf;
};

static inline struct tpm_tis_spi_phy *to_tpm_tis_spi_phy(struct tpm_tis_data *data)
{
	return container_of(data, struct tpm_tis_spi_phy, priv);
}

extern 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);

extern int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u16 len,
				u8 *in, const u8 *out);

#ifdef CONFIG_TCG_TIS_SPI_CR50
extern int cr50_spi_probe(struct spi_device *spi);
#else
static inline int cr50_spi_probe(struct spi_device *spi)
{
	return -ENODEV;
}
#endif

#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_TCG_TIS_SPI_CR50)
extern int tpm_tis_spi_resume(struct device *dev);
#else
#define tpm_tis_spi_resume	NULL
#endif

#endif

Annotation

Implementation Notes