usb: typec: ucsi: ccg: add firmware flashing support
PATCH v6 2/2 usb: typec: ucsi: ccg: add firmware flashing support
Hi Ajay,
Quoted 1 line · Ajay Gupta
+#define
CCG_FW_VERSION_NVIDIA(b)(le16_to_cpu(b)!= (('n' << 8) | 'v'))
Does that remove the sparce warning?
Now that I see that this version is specific to NVIDIA, I think we are going to want to get this detail from a device property. I'll prepare an example for you right now so you can see how it can be done.
Quoted 13 lines
(quoted diff) +13
-0+static bool ccg_check_vendor_version(struct ucsi_ccg *uc, + struct version_format *app, + struct fw_config_table *fw_cfg) +{ + struct device *dev = uc->dev; + + /* Check if the fw build is for supported vendors. + * Add all supported vendors here. + */ + if (CCG_FW_VERSION_NVIDIA(app->build)) { + dev_info(dev, "current fw is not from supported vendor\n"); + return false; + }
Review
Quoted 10 lines
(quoted diff) +10
-0+ + /* Check if the new fw build is for supported vendors + * Add all supported vendors here. + */ + if (CCG_FW_VERSION_NVIDIA(fw_cfg->app.build)) { + dev_info(dev, "new fw is not from supported vendor\n"); + return false; + } + return true; +}
Br,