Commit Graph
6 Commits
Author SHA1 Message Date
Jarkko Sakkinen 71ed848fd7 tpm: rename chip->dev to chip->pdev
Rename chip->dev to chip->pdev to make it explicit that this not the
character device but actually represents the platform device.

Signed-off-by: Jarkko Sakkinen <[email protected]>
Reviewed-by: Jasob Gunthorpe <[email protected]>
Reviewed-by: Stefan Berger <[email protected]>
Reviewed-by: Peter Huewe <[email protected]>
Tested-by: Scot Doyle <[email protected]>
Tested-by: Peter Huewe <[email protected]>
Signed-off-by: Peter Huewe <[email protected]>
2015-01-17 14:00:09 +01:00
Jarkko Sakkinen 87155b7311 tpm: merge duplicate transmit_cmd() functions
Merged transmit_cmd() functions in tpm-interface.c and tpm-sysfs.c.
Added "tpm_" prefix for consistency sake. Changed cmd parameter as
opaque. This enables to use separate command structures for TPM1
and TPM2 commands in future. Loose coupling works fine here.

Signed-off-by: Jarkko Sakkinen <[email protected]>
Reviewed-by: Jasob Gunthorpe <[email protected]>
Reviewed-by: Stefan Berger <[email protected]>
Reviewed-by: Peter Huewe <[email protected]>
Tested-by: Scot Doyle <[email protected]>
Tested-by: Peter Huewe <[email protected]>
Signed-off-by: Peter Huewe <[email protected]>
2015-01-17 14:00:09 +01:00
Fengguang Wu 5f64822d63 tpm/tpm-sysfs: active_show() can be static
so we make it static

CC: Jason Gunthorpe <[email protected]>
CC: Peter Huewe <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
Signed-off-by: Peter Huewe <[email protected]>
2014-01-06 14:37:25 +01:00
Jason Gunthorpe 5f82e9f004 tpm: Use the ops structure instead of a copy in tpm_vendor_specific
This builds on the last commit to use the ops structure in the core
and reduce the size of tpm_vendor_specific.

Signed-off-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Joel Schopp <[email protected]>
Reviewed-by: Ashley Lai <[email protected]>
Signed-off-by: Peter Huewe <[email protected]>
2014-01-06 14:37:25 +01:00
Jason Gunthorpe 1e3b73a957 tpm: Pull all driver sysfs code into tpm-sysfs.c
The tpm core now sets up and controls all sysfs attributes, instead
of having each driver have a unique take on it.

All drivers now now have a uniform set of attributes, and no sysfs
related entry points are exported from the tpm core module.

This also uses the new method used to declare sysfs attributes
with DEVICE_ATTR_RO and 'struct attribute *'

Signed-off-by: Jason Gunthorpe <[email protected]>
[phuewe: had to apply the tpm_i2c_atmel part manually due to commit
191ffc6bde3fc tpm/tpm_i2c_atmel: fix coccinelle warnings]

Signed-off-by: Peter Huewe <[email protected]>
2014-01-06 14:37:25 +01:00
Jason Gunthorpe 000a07b0aa tpm: Move sysfs functions from tpm-interface to tpm-sysfs
CLASS-sysfs.c is a common idiom for linux subsystems.

This is the first step to pulling all the sysfs support code from
the drivers into tpm-sysfs. This is a plain text copy from tpm-interface
with support changes to make it compile.

_tpm_pcr_read is made non-static and is called tpm_pcr_read_dev.

Signed-off-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Peter Huewe <[email protected]>
2014-01-06 14:37:24 +01:00