[3/3] tpm_i2c_nuvoton: add nuvoton, npct601 to the compatible property

Message ID 1504166040-16531-4-git-send-email-cclaudio@linux.vnet.ibm.com
State Under Review
Headers show
Series
  • libstb: add support to ibm,secureboot-v2
Related show

Commit Message

Claudio Carvalho Aug. 31, 2017, 7:54 a.m.
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(+)

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: