TPM: Provide a tpm_tis OF driver
PATCH 1/1 TPM: Provide a tpm_tis OF driver
This provides an open firwmare driver binding for tpm_tis. OF is useful on arches where PNP is not used.
Allow the tpm_tis driver to be selected if PNP or OF are compiled in.
Tested on a PPC405 with a winbond LPC TPM.
--- drivers/char/tpm/Kconfig | 2 +- drivers/char/tpm/tpm_tis.c | 75 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 69 insertions(+), 8 deletions(-)
I had previously sent a patch to make the platform device more useful, but this one is better for PPC...
Thanks
drivers/char/tpm/Kconfig +1 -1
@@ -24,7 +24,7 @@ if TCG_TPM config TCG_TIS tristate "TPM Interface Specification 1.2 Interface" - depends on PNP + depends on PNP || OF ---help--- If you have a TPM security chip that is compliant with the TCG TIS 1.2 TPM specification say Yes and it will be accessible
drivers/char/tpm/tpm_tis.c +68 -7
138 lines not on this page · raw message
Signature · 1 line
1.5.4.2
Just a minor comment
Quoted 8 lines · Jason Gunthorpe
drivers/char/tpm/tpm_tis.c +3
-1@@ -703,7 +747,17 @@ static int __init init_tis(void)return rc; } -return pnp_register_driver (&tis_pnp_driver); +#ifdef CONFIG_OF + rc =of_register_platform_driver (&tis_of_driver); +if (rc)
drivers/char/tpm/tpm_tis.c static int __init init_tis(void) · line 762
Quoted 10 lines
drivers/char/tpm/tpm_tis.c +8
-0+return rc; +#endif +#ifdef CONFIG_PNP + rc =pnp_register_driver (&tis_pnp_driver); +if (rc) +return rc; +#endif +return 0 ; }
Why not
+#ifdef CONFIG_OF
+ return of_register_platform_driver(&tis_of_driver);
+#elif CONFIG_PNP
+ return pnp_register_driver(&tis_pnp_driver);
+#endif
?
Other than this it looks nice.
Thanks,
Rajiv
Quoted 9 lines · Rajiv Andrade
Why not
(quoted diff) +5
-0+#ifdef CONFIG_OF + return of_register_platform_driver(&tis_of_driver); +#elif CONFIG_PNP + return pnp_register_driver(&tis_pnp_driver); +#endif?
AFAIK they are not exclusive options? I can't imagine anyone building a kernel with both, but the rest of the patch is designed to allow both at once..
Quoted 1 line
Acked-by Rajiv Andrade <[email protected]>
Thanks - who can pick this up to feed it upstream?
Jason