Lines Matching +full:device +full:- +full:version
1 // SPDX-License-Identifier: GPL-2.0-only
15 #include <linux/device.h>
32 static ssize_t pubek_show(struct device *dev, struct device_attribute *attr, in pubek_show()
65 out->algorithm, in pubek_show()
66 out->encscheme, in pubek_show()
67 out->sigscheme, in pubek_show()
68 out->parameters, in pubek_show()
69 be32_to_cpu(out->keysize)); in pubek_show()
72 str += sprintf(str, "%16ph\n", &out->modulus[i]); in pubek_show()
78 return str - buf; in pubek_show()
82 static ssize_t pcrs_show(struct device *dev, struct device_attribute *attr, in pcrs_show()
107 str += sprintf(str, "PCR-%02d: ", i); in pcrs_show()
113 return str - buf; in pcrs_show()
117 static ssize_t enabled_show(struct device *dev, struct device_attribute *attr, in enabled_show()
139 static ssize_t active_show(struct device *dev, struct device_attribute *attr, in active_show()
161 static ssize_t owned_show(struct device *dev, struct device_attribute *attr, in owned_show()
183 static ssize_t temp_deactivated_show(struct device *dev, in temp_deactivated_show()
205 static ssize_t caps_show(struct device *dev, struct device_attribute *attr, in caps_show()
209 struct tpm1_version *version; in caps_show() local
227 "attempting to determine the 1.2 version", in caps_show()
229 version = &cap.version2.version; in caps_show()
235 "attempting to determine the 1.1 version", in caps_show()
240 version = &cap.version1; in caps_show()
244 "TCG version: %d.%d\nFirmware version: %d.%d\n", in caps_show()
245 version->major, version->minor, in caps_show()
246 version->rev_major, version->rev_minor); in caps_show()
248 rc = str - buf; in caps_show()
256 static ssize_t cancel_store(struct device *dev, struct device_attribute *attr, in cancel_store()
264 chip->ops->cancel(chip); in cancel_store()
270 static ssize_t durations_show(struct device *dev, struct device_attribute *attr, in durations_show()
275 if (chip->duration[TPM_LONG] == 0) in durations_show()
279 jiffies_to_usecs(chip->duration[TPM_SHORT]), in durations_show()
280 jiffies_to_usecs(chip->duration[TPM_MEDIUM]), in durations_show()
281 jiffies_to_usecs(chip->duration[TPM_LONG]), in durations_show()
282 chip->duration_adjusted in durations_show()
287 static ssize_t timeouts_show(struct device *dev, struct device_attribute *attr, in timeouts_show()
293 jiffies_to_usecs(chip->timeout_a), in timeouts_show()
294 jiffies_to_usecs(chip->timeout_b), in timeouts_show()
295 jiffies_to_usecs(chip->timeout_c), in timeouts_show()
296 jiffies_to_usecs(chip->timeout_d), in timeouts_show()
297 chip->timeout_adjusted in timeouts_show()
302 static ssize_t tpm_version_major_show(struct device *dev, in tpm_version_major_show()
307 return sprintf(buf, "%s\n", chip->flags & TPM_CHIP_FLAG_TPM2 in tpm_version_major_show()
342 WARN_ON(chip->groups_cnt != 0); in tpm_sysfs_add_device()
343 if (chip->flags & TPM_CHIP_FLAG_TPM2) in tpm_sysfs_add_device()
344 chip->groups[chip->groups_cnt++] = &tpm2_dev_group; in tpm_sysfs_add_device()
346 chip->groups[chip->groups_cnt++] = &tpm1_dev_group; in tpm_sysfs_add_device()