Beispiel #1
0
int tpm_open(uint32_t dev_addr)
{
	int rc;
	if (g_chip.is_open)
		return -EBUSY;
	rc = tpm_vendor_init(dev_addr);
	if (rc < 0)
		g_chip.is_open = 0;
	return rc;
}
Beispiel #2
0
int tis_open(void)
{
	struct tpm_chip *chip = car_get_var_ptr(&g_chip);
	int rc;

	if (chip->is_open) {
		printk(BIOS_DEBUG, "tis_open() called twice.\n");
		return -1;
	}

	rc = tpm_vendor_init(chip, CONFIG_DRIVER_TPM_I2C_BUS,
			     CONFIG_DRIVER_TPM_I2C_ADDR);
	if (rc < 0)
		chip->is_open = 0;

	if (rc)
		return -1;

	return 0;
}
Beispiel #3
0
int tis_open(void)
{
	int rc;

	if (g_chip.is_open) {
		printk(BIOS_DEBUG, "tis_open() called twice.\n");
		return -1;
	}

	rc = tpm_vendor_init(CONFIG_DRIVER_TPM_I2C_BUS,
				CONFIG_DRIVER_TPM_I2C_ADDR);

	if (rc < 0)
		g_chip.is_open = 0;

	if (rc) {
		return -1;
	}

	return 0;
}