Re: [PATCH v6 2/2] usb: typec: ucsi: ccg: add firmware flashing support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ajay,

On Thu, Apr 11, 2019 at 01:03:10PM -0700, Ajay Gupta wrote:
> +#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.

> +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;
> +	}
> +
> +	/* 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,

-- 
heikki



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux