diff mbox series

[V6,5/6] usb: typec: ucsi_ccg: Remove ccgx,firmware-build property

Message ID 20230119121639.226729-6-jonathanh@nvidia.com
State Changes Requested
Headers show
Series Add device-tree support for Cypress CYPD4226 | expand

Commit Message

Jon Hunter Jan. 19, 2023, 12:16 p.m. UTC
From: Wayne Chang <waynec@nvidia.com>

Remove the property 'ccgx,firmware-build' now we have migrated devices
to using the 'firmware-name' property.

Signed-off-by: Wayne Chang <waynec@nvidia.com>
Co-developed-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
V6: fixed compilation
V5: Added this patch from V3

 drivers/usb/typec/ucsi/ucsi_ccg.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

Comments

Heikki Krogerus Jan. 20, 2023, 9:34 a.m. UTC | #1
On Thu, Jan 19, 2023 at 12:16:38PM +0000, Jon Hunter wrote:
> From: Wayne Chang <waynec@nvidia.com>
> 
> Remove the property 'ccgx,firmware-build' now we have migrated devices
> to using the 'firmware-name' property.

Ah, so just do this in the patch 3/6.

> Signed-off-by: Wayne Chang <waynec@nvidia.com>
> Co-developed-by: Jon Hunter <jonathanh@nvidia.com>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
> V6: fixed compilation
> V5: Added this patch from V3
> 
>  drivers/usb/typec/ucsi/ucsi_ccg.c | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 661a3988b39d..8f5ad2094f26 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -1358,17 +1358,13 @@ static int ucsi_ccg_probe(struct i2c_client *client)
>  	INIT_WORK(&uc->pm_work, ccg_pm_workaround_work);
>  
>  	/* Only fail FW flashing when FW build information is not provided */
> -	status = device_property_read_u16(dev, "ccgx,firmware-build",
> -					  &uc->fw_build);
> -	if (status) {
> -		status = device_property_read_string(dev, "firmware-name",
> -						     &fw_name);
> -		if (!status) {
> -			if (!strcmp(fw_name, "nvidia,jetson-agx-xavier"))
> -				uc->fw_build = CCG_FW_BUILD_NVIDIA_TEGRA;
> -			else if (!strcmp(fw_name, "nvidia,gpu"))
> -				uc->fw_build = CCG_FW_BUILD_NVIDIA;
> -		}
> +	status = device_property_read_string(dev, "firmware-name",
> +					     &fw_name);

One line.

> +	if (!status) {
> +		if (!strcmp(fw_name, "nvidia,jetson-agx-xavier"))
> +			uc->fw_build = CCG_FW_BUILD_NVIDIA_TEGRA;
> +		else if (!strcmp(fw_name, "nvidia,gpu"))
> +			uc->fw_build = CCG_FW_BUILD_NVIDIA;
>  	}
>  
>  	if (!uc->fw_build)
> -- 
> 2.25.1

thanks,
Jon Hunter Jan. 20, 2023, 1:20 p.m. UTC | #2
On 20/01/2023 09:34, Heikki Krogerus wrote:
> On Thu, Jan 19, 2023 at 12:16:38PM +0000, Jon Hunter wrote:
>> From: Wayne Chang <waynec@nvidia.com>
>>
>> Remove the property 'ccgx,firmware-build' now we have migrated devices
>> to using the 'firmware-name' property.
> 
> Ah, so just do this in the patch 3/6.

ACK. This was deliberate because I was unclear if AMD needed this and so 
if it turned out they needed this, we could just drop this patch. I see 
Sanket has confirmed now and so I will squash this as suggested.

Jon
diff mbox series

Patch

diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index 661a3988b39d..8f5ad2094f26 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -1358,17 +1358,13 @@  static int ucsi_ccg_probe(struct i2c_client *client)
 	INIT_WORK(&uc->pm_work, ccg_pm_workaround_work);
 
 	/* Only fail FW flashing when FW build information is not provided */
-	status = device_property_read_u16(dev, "ccgx,firmware-build",
-					  &uc->fw_build);
-	if (status) {
-		status = device_property_read_string(dev, "firmware-name",
-						     &fw_name);
-		if (!status) {
-			if (!strcmp(fw_name, "nvidia,jetson-agx-xavier"))
-				uc->fw_build = CCG_FW_BUILD_NVIDIA_TEGRA;
-			else if (!strcmp(fw_name, "nvidia,gpu"))
-				uc->fw_build = CCG_FW_BUILD_NVIDIA;
-		}
+	status = device_property_read_string(dev, "firmware-name",
+					     &fw_name);
+	if (!status) {
+		if (!strcmp(fw_name, "nvidia,jetson-agx-xavier"))
+			uc->fw_build = CCG_FW_BUILD_NVIDIA_TEGRA;
+		else if (!strcmp(fw_name, "nvidia,gpu"))
+			uc->fw_build = CCG_FW_BUILD_NVIDIA;
 	}
 
 	if (!uc->fw_build)