tpm_write_index(TPM_LOCK_REG, TPM_UNLOCK_VALUE); tpm_write_index(TPM_INTERUPT_REG, TPM_DISABLE_INTERUPT_VALUE); tpm_write_index(TPM_BASE_ADDR_LO, base); tpm_write_index(TPM_BASE_ADDR_HI, (base & 0xFF00) >> 8); tpm_write_index(TPM_LOCK_REG, TPM_LOCK_VALUE);  
int tpm_lpc_bus_init(struct pci_dev *pci_dev, u16 base){	u32 lpcenable, tmp;	int is_lpcm = 0;	switch (pci_dev->vendor) {	case PCI_VENDOR_ID_INTEL:		switch (pci_dev->device) {		case PCI_DEVICE_ID_INTEL_82801CA_12:		case PCI_DEVICE_ID_INTEL_82801DB_12:			is_lpcm = 1;			break;		}		/* init ICH (enable LPC) */		pci_read_config_dword(pci_dev, PCI_GEN1_DEC, &lpcenable);		lpcenable |= 0x20000000;		pci_write_config_dword(pci_dev, PCI_GEN1_DEC, lpcenable);		if (is_lpcm) {			pci_read_config_dword(pci_dev, PCI_GEN1_DEC,					      &lpcenable);			if ((lpcenable & 0x20000000) == 0) {				dev_err(&pci_dev->dev,					"cannot enable LPC\n");				return -ENODEV;			}		}		/* initialize TPM registers */		pci_read_config_dword(pci_dev, PCI_GEN2_DEC, &tmp);		if (!is_lpcm)			tmp = (tmp & 0xFFFF0000) | (base & 0xFFF0);		else			tmp =			    (tmp & 0xFFFF0000) | (base & 0xFFF0) |			    0x00000001;		pci_write_config_dword(pci_dev, PCI_GEN2_DEC, tmp);		if (is_lpcm) {			pci_read_config_dword(pci_dev, PCI_GEN_PMCON_1,					      &tmp);			tmp |= 0x00000004;	/* enable CLKRUN */			pci_write_config_dword(pci_dev, PCI_GEN_PMCON_1,					       tmp);		}		tpm_write_index(0x0D, 0x55);	/* unlock 4F */		tpm_write_index(0x0A, 0x00);	/* int disable */		tpm_write_index(0x08, base);	/* base addr lo */		tpm_write_index(0x09, (base & 0xFF00) >> 8);	/* base addr hi */		tpm_write_index(0x0D, 0xAA);	/* lock 4F */		break;	case PCI_VENDOR_ID_AMD:		/* nothing yet */		break;	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/3122a88a242454efe72930e56a3e4d56ee534f3c/tpm.c/buggy/drivers/char/tpm/tpm.c