Skip to contentSkip to conversation

i2c: nvidia-gpu: Supply CCGx driver the firmware build information

RFC New Heikki Krogerus 1 participant 1 message Apr 12, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 1/2 i2c: nvidia-gpu: Supply CCGx driver the firmware build information

Adding device property "ccgx,firmware-build" for the CCGx device, so the CCGx driver knows the which firmware build it needs to be dealing with.

---
 drivers/i2c/busses/i2c-nvidia-gpu.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/i2c/busses/i2c-nvidia-gpu.c +6 -0
index 4e67d5ed480e..5604323ee0b9 100644
@@ -253,6 +253,11 @@ static const struct pci_device_id gpu_i2c_ids[] = {
 };
 MODULE_DEVICE_TABLE(pci, gpu_i2c_ids);
 
+static const struct property_entry ccgx_props[] = {
+	PROPERTY_ENTRY_U16("ccgx,firmware-build", 0x766e),
+	{ }
+};
+
 static int gpu_populate_client(struct gpu_i2c_dev *i2cd, int irq)
 {
 	struct i2c_client *ccgx_client;
@@ -267,6 +272,7 @@ static int gpu_populate_client(struct gpu_i2c_dev *i2cd, int irq)
 		sizeof(i2cd->gpu_ccgx_ucsi->type));
 	i2cd->gpu_ccgx_ucsi->addr = 0x8;
 	i2cd->gpu_ccgx_ucsi->irq = irq;
+	i2cd->gpu_ccgx_ucsi->properties = ccgx_props;
 	ccgx_client = i2c_new_device(&i2cd->adapter, i2cd->gpu_ccgx_ucsi);
 	if (!ccgx_client)
 		return -ENODEV;