Forráskód Böngészése

qcacmn: Fix gpio direction conversion wrong issue

Since in wmi_gpio_config_cmd_fixed_param, the input
0 mean output, and 1 mean input, which is different
from host side enum gpio_direction. So add this fix
to do the right conversion.

Change-Id: Id60a9327e853440fd58a45c7c839109cf1f22c22
CRs-Fixed: 2856833
Chaoli Zhou 4 éve
szülő
commit
c87b5d218f
2 módosított fájl, 14 hozzáadás és 4 törlés
  1. 10 0
      wmi/inc/wmi_unified_param.h
  2. 4 4
      wmi/src/wmi_unified_gpio_tlv.c

+ 10 - 0
wmi/inc/wmi_unified_param.h

@@ -3342,6 +3342,16 @@ enum gpio_direction {
 	WMI_HOST_GPIO_DIR_MAX,
 };
 
+/**
+ * enum fw_gpio_direction - GPIO Direction
+ * @WMI_FW_GPIO_OUTPUT: set gpio as output mode
+ * @WMI_FW_GPIO_INPUT: set gpio as input mode
+ */
+enum fw_gpio_direction {
+	WMI_FW_GPIO_OUTPUT = 0,
+	WMI_FW_GPIO_INPUT = 1,
+};
+
 /**
  * enum qca_gpio_value - GPIO Value
  * @WLAN_GPIO_LEVEL_LOW: set gpio output level low

+ 4 - 4
wmi/src/wmi_unified_gpio_tlv.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -34,11 +34,11 @@ convert_gpio_direction(enum gpio_direction dir)
 {
 	switch (dir) {
 	case WMI_HOST_GPIO_INPUT:
-		return 0;
+		return WMI_FW_GPIO_INPUT;
 	case WMI_HOST_GPIO_OUTPUT:
-		return 1;
+		return WMI_FW_GPIO_OUTPUT;
 	default:
-		return 0;
+		return WMI_FW_GPIO_OUTPUT;
 	}
 }