diff mbox series

[v2,09/20] tpm_i2c_nuvoton: add nuvoton, npct601 to the compatible property

Message ID 1512795154-15659-10-git-send-email-cclaudio@linux.vnet.ibm.com
State Accepted
Headers show
Series [v2,01/20] libstb: move drivers/sha512.* to mbedtls directory | expand

Commit Message

Claudio Carvalho Dec. 9, 2017, 4:52 a.m. UTC
The linux kernel doesn't have a driver compatible with
"nuvoton,npct650", but it does have for "nuvoton,npct601", which should
also be compatible with npct650.

This adds "nuvoton,npct601" to the compatible devtree property.

Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
---
 libstb/drivers/tpm_i2c_nuvoton.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/libstb/drivers/tpm_i2c_nuvoton.c b/libstb/drivers/tpm_i2c_nuvoton.c
index 90e27a9..d18add9 100644
--- a/libstb/drivers/tpm_i2c_nuvoton.c
+++ b/libstb/drivers/tpm_i2c_nuvoton.c
@@ -581,6 +581,16 @@  void tpm_i2c_nuvoton_probe(void)
 		assert(bus->check_quirk == NULL);
 		bus->check_quirk = nuvoton_tpm_quirk;
 		bus->check_quirk_data = tpm_device;
+
+		/*
+		 * Tweak for linux. It doesn't have a driver compatible
+		 * with "nuvoton,npct650"
+		 */
+		if (!dt_node_is_compatible(node, "nuvoton,npct601")) {
+			dt_check_del_prop(node, "compatible");
+			dt_add_property_strings(node, "compatible",
+						"nuvoton,npct650", "nuvoton,npct601");
+		}
 	}
 	return;
 disable: