1 From: Sebastian Gottschall <s.gottschall@newmedia-net.de>
3 Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based
4 chipsets with on chipset connected led's using WMI Firmware API. The LED
5 device will get available named as "ath10k-phyX" at sysfs and can be controlled
6 with various triggers. adds also debugfs interface for gpio control.
8 This patch is specific for OpenWRt base, as is use old backported package
9 with old wireless source. Support for QCA9984 is removed and a simbol
10 is added to local-simbol file to export the actually compile the code
11 with the ATH10K_LEDS simbol.
14 Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
15 Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
16 [kvalo: major reorg and cleanup]
17 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
18 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
23 * only compile tested!
25 * fix all checkpatch warnings
29 * sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio)
31 * unsigned -> unsigned int
33 * remove GPIOLIB code, that should be added in a separate patch
35 * rename gpio.c to leds.c
39 * rename some functions:
41 ath10k_attach_led() -> ath10k_leds_register()
42 ath10k_unregister_led() -> ath10k_leds_unregister()
43 ath10k_reset_led_pin() -> ath10k_leds_start()
45 * call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering
47 * call ath10k_leds_start() only from ath10k_core_start() and not from mac.c
49 * rename struct ath10k_gpiocontrol as anonymous function under struct
50 ath10k::leds, no need for memory allocation
52 * merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller
54 * remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it
56 * Kconfig help text improvement and move it lower in the menu, also don't enable it by default
58 * switch to set_brightness_blocking() so that the callback can sleep,
59 then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex
62 * don't touch ath10k_wmi_pdev_get_temperature()
64 * as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface
66 * remove debugfs interface, that should be added in another patch
71 drivers/net/wireless/ath/ath10k/Kconfig | 10 +++
72 drivers/net/wireless/ath/ath10k/Makefile | 1 +
73 drivers/net/wireless/ath/ath10k/core.c | 22 +++++++
74 drivers/net/wireless/ath/ath10k/core.h | 9 ++-
75 drivers/net/wireless/ath/ath10k/hw.h | 1 +
76 drivers/net/wireless/ath/ath10k/leds.c | 103 ++++++++++++++++++++++++++++++
77 drivers/net/wireless/ath/ath10k/leds.h | 45 +++++++++++++
78 drivers/net/wireless/ath/ath10k/mac.c | 1 +
79 drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++++
80 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 +
81 drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++++
82 drivers/net/wireless/ath/ath10k/wmi.h | 35 ++++++++++
83 12 files changed, 314 insertions(+), 1 deletion(-)
84 create mode 100644 drivers/net/wireless/ath/ath10k/leds.c
85 create mode 100644 drivers/net/wireless/ath/ath10k/leds.h
86 --- a/drivers/net/wireless/ath/ath10k/Kconfig
87 +++ b/drivers/net/wireless/ath/ath10k/Kconfig
88 @@ -71,6 +71,16 @@ config ATH10K_DEBUGFS
90 If unsure, say Y to make it easier to debug problems.
93 + bool "Atheros ath10k LED support"
95 + select MAC80211_LEDS
100 + This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N.
102 config ATH10K_SPECTRAL
103 bool "Atheros ath10k spectral scan support"
104 depends on ATH10K_DEBUGFS
105 --- a/drivers/net/wireless/ath/ath10k/Makefile
106 +++ b/drivers/net/wireless/ath/ath10k/Makefile
107 @@ -19,6 +19,7 @@ ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) +=
108 ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o
109 ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o
110 ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o
111 +ath10k_core-$(CPTCFG_ATH10K_LEDS) += leds.o
112 ath10k_core-$(CPTCFG_MAC80211_DEBUGFS) += debugfs_sta.o
113 ath10k_core-$(CONFIG_PM) += wow.o
114 ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
117 @@ -142,6 +142,7 @@ ATH10K_DEBUG=
123 ATH10K_DFS_CERTIFIED=
125 --- a/drivers/net/wireless/ath/ath10k/core.c
126 +++ b/drivers/net/wireless/ath/ath10k/core.c
128 #include "testmode.h"
130 #include "coredump.h"
133 unsigned int ath10k_debug_mask;
134 static unsigned int ath10k_cryptmode_param;
135 @@ -55,6 +56,7 @@ static const struct ath10k_hw_params ath
136 .dev_id = QCA988X_2_0_DEVICE_ID,
137 .bus = ATH10K_BUS_PCI,
138 .name = "qca988x hw2.0",
140 .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
142 .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
143 @@ -123,6 +125,7 @@ static const struct ath10k_hw_params ath
144 .dev_id = QCA9887_1_0_DEVICE_ID,
145 .bus = ATH10K_BUS_PCI,
146 .name = "qca9887 hw1.0",
148 .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
150 .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
151 @@ -297,6 +300,7 @@ static const struct ath10k_hw_params ath
152 .dev_id = QCA99X0_2_0_DEVICE_ID,
153 .bus = ATH10K_BUS_PCI,
154 .name = "qca99x0 hw2.0",
156 .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
158 .otp_exe_param = 0x00000700,
159 @@ -337,6 +341,7 @@ static const struct ath10k_hw_params ath
160 .dev_id = QCA9984_1_0_DEVICE_ID,
161 .bus = ATH10K_BUS_PCI,
162 .name = "qca9984/qca9994 hw1.0",
164 .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
166 .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
167 @@ -384,6 +389,7 @@ static const struct ath10k_hw_params ath
168 .dev_id = QCA9888_2_0_DEVICE_ID,
169 .bus = ATH10K_BUS_PCI,
170 .name = "qca9888 hw2.0",
172 .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
174 .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
175 @@ -2720,6 +2726,10 @@ int ath10k_core_start(struct ath10k *ar,
179 + status = ath10k_leds_start(ar);
186 @@ -2976,9 +2986,18 @@ static void ath10k_core_register_work(st
187 goto err_spectral_destroy;
190 + status = ath10k_leds_register(ar);
192 + ath10k_err(ar, "could not register leds: %d\n",
194 + goto err_thermal_unregister;
197 set_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags);
200 +err_thermal_unregister:
201 + ath10k_thermal_unregister(ar);
202 err_spectral_destroy:
203 ath10k_spectral_destroy(ar);
205 @@ -3024,6 +3043,8 @@ void ath10k_core_unregister(struct ath10
206 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
209 + ath10k_leds_unregister(ar);
211 ath10k_thermal_unregister(ar);
212 /* Stop spectral before unregistering from mac80211 to remove the
213 * relayfs debugfs file cleanly. Otherwise the parent debugfs tree
214 --- a/drivers/net/wireless/ath/ath10k/core.h
215 +++ b/drivers/net/wireless/ath/ath10k/core.h
217 #include <linux/pci.h>
218 #include <linux/uuid.h>
219 #include <linux/time.h>
220 +#include <linux/leds.h>
224 @@ -1150,6 +1151,13 @@ struct ath10k {
228 + struct gpio_led wifi_led;
229 + struct led_classdev cdev;
231 + u32 gpio_state_pin;
235 /* protected by data_lock */
236 u32 fw_crash_counter;
237 u32 fw_warm_reset_counter;
238 --- a/drivers/net/wireless/ath/ath10k/hw.h
239 +++ b/drivers/net/wireless/ath/ath10k/hw.h
240 @@ -511,6 +511,7 @@ struct ath10k_hw_params {
247 /* Type of hw cycle counter wraparound logic, for more info
249 +++ b/drivers/net/wireless/ath/ath10k/leds.c
252 + * Copyright (c) 2005-2011 Atheros Communications Inc.
253 + * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
254 + * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com>
255 + * Copyright (c) 2018, The Linux Foundation. All rights reserved.
257 + * Permission to use, copy, modify, and/or distribute this software for any
258 + * purpose with or without fee is hereby granted, provided that the above
259 + * copyright notice and this permission notice appear in all copies.
261 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
262 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
263 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
264 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
265 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
266 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
267 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
270 +#include <linux/leds.h>
274 +#include "wmi-ops.h"
278 +static int ath10k_leds_set_brightness_blocking(struct led_classdev *led_cdev,
279 + enum led_brightness brightness)
281 + struct ath10k *ar = container_of(led_cdev, struct ath10k,
283 + struct gpio_led *led = &ar->leds.wifi_led;
285 + mutex_lock(&ar->conf_mutex);
287 + if (ar->state != ATH10K_STATE_ON)
290 + ar->leds.gpio_state_pin = (brightness != LED_OFF) ^ led->active_low;
291 + ath10k_wmi_gpio_output(ar, led->gpio, ar->leds.gpio_state_pin);
294 + mutex_unlock(&ar->conf_mutex);
299 +int ath10k_leds_start(struct ath10k *ar)
301 + if (ar->hw_params.led_pin == 0)
302 + /* leds not supported */
305 + /* under some circumstances, the gpio pin gets reconfigured
306 + * to default state by the firmware, so we need to
307 + * reconfigure it this behaviour has only ben seen on
308 + * QCA9984 and QCA99XX devices so far
310 + ath10k_wmi_gpio_config(ar, ar->hw_params.led_pin, 0,
311 + WMI_GPIO_PULL_NONE, WMI_GPIO_INTTYPE_DISABLE);
312 + ath10k_wmi_gpio_output(ar, ar->hw_params.led_pin, 1);
317 +int ath10k_leds_register(struct ath10k *ar)
321 + if (ar->hw_params.led_pin == 0)
322 + /* leds not supported */
325 + snprintf(ar->leds.label, sizeof(ar->leds.label), "ath10k-%s",
326 + wiphy_name(ar->hw->wiphy));
327 + ar->leds.wifi_led.active_low = 1;
328 + ar->leds.wifi_led.gpio = ar->hw_params.led_pin;
329 + ar->leds.wifi_led.name = ar->leds.label;
330 + ar->leds.wifi_led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
332 + ar->leds.cdev.name = ar->leds.label;
333 + ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
335 + /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
336 + ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
338 + ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
345 +void ath10k_leds_unregister(struct ath10k *ar)
347 + if (ar->hw_params.led_pin == 0)
348 + /* leds not supported */
351 + led_classdev_unregister(&ar->leds.cdev);
355 +++ b/drivers/net/wireless/ath/ath10k/leds.h
358 + * Copyright (c) 2018, The Linux Foundation. All rights reserved.
360 + * Permission to use, copy, modify, and/or distribute this software for any
361 + * purpose with or without fee is hereby granted, provided that the above
362 + * copyright notice and this permission notice appear in all copies.
364 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
365 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
366 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
367 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
368 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
369 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
370 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
377 +#ifdef CPTCFG_ATH10K_LEDS
378 +void ath10k_leds_unregister(struct ath10k *ar);
379 +int ath10k_leds_start(struct ath10k *ar);
380 +int ath10k_leds_register(struct ath10k *ar);
382 +static inline void ath10k_leds_unregister(struct ath10k *ar)
386 +static inline int ath10k_leds_start(struct ath10k *ar)
391 +static inline int ath10k_leds_register(struct ath10k *ar)
397 +#endif /* _LEDS_H_ */
398 --- a/drivers/net/wireless/ath/ath10k/mac.c
399 +++ b/drivers/net/wireless/ath/ath10k/mac.c
408 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
409 +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
410 @@ -216,7 +216,10 @@ struct wmi_ops {
411 struct sk_buff *(*gen_bb_timing)
413 const struct wmi_bb_timing_cfg_arg *arg);
414 + struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num,
415 + u32 input, u32 pull_type, u32 intr_mode);
417 + struct sk_buff *(*gen_gpio_output)(struct ath10k *ar, u32 gpio_num, u32 set);
420 int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
421 @@ -1080,6 +1083,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
422 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
425 +static inline int ath10k_wmi_gpio_config(struct ath10k *ar, u32 gpio_num,
426 + u32 input, u32 pull_type, u32 intr_mode)
428 + struct sk_buff *skb;
430 + if (!ar->wmi.ops->gen_gpio_config)
431 + return -EOPNOTSUPP;
433 + skb = ar->wmi.ops->gen_gpio_config(ar, gpio_num, input, pull_type, intr_mode);
435 + return PTR_ERR(skb);
437 + return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_config_cmdid);
440 +static inline int ath10k_wmi_gpio_output(struct ath10k *ar, u32 gpio_num, u32 set)
442 + struct sk_buff *skb;
444 + if (!ar->wmi.ops->gen_gpio_config)
445 + return -EOPNOTSUPP;
447 + skb = ar->wmi.ops->gen_gpio_output(ar, gpio_num, set);
449 + return PTR_ERR(skb);
451 + return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_output_cmdid);
455 ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level)
457 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
458 +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
459 @@ -4309,6 +4309,8 @@ static const struct wmi_ops wmi_tlv_ops
460 .gen_echo = ath10k_wmi_tlv_op_gen_echo,
461 .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
462 .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
463 + /* .gen_gpio_config not implemented */
464 + /* .gen_gpio_output not implemented */
467 static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
468 --- a/drivers/net/wireless/ath/ath10k/wmi.c
469 +++ b/drivers/net/wireless/ath/ath10k/wmi.c
470 @@ -7372,6 +7372,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
474 +static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar,
475 + u32 gpio_num, u32 input,
476 + u32 pull_type, u32 intr_mode)
478 + struct wmi_gpio_config_cmd *cmd;
479 + struct sk_buff *skb;
481 + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
483 + return ERR_PTR(-ENOMEM);
485 + cmd = (struct wmi_gpio_config_cmd *)skb->data;
486 + cmd->pull_type = __cpu_to_le32(pull_type);
487 + cmd->gpio_num = __cpu_to_le32(gpio_num);
488 + cmd->input = __cpu_to_le32(input);
489 + cmd->intr_mode = __cpu_to_le32(intr_mode);
491 + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_config gpio_num 0x%08x input 0x%08x pull_type 0x%08x intr_mode 0x%08x\n",
492 + gpio_num, input, pull_type, intr_mode);
497 +static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar,
498 + u32 gpio_num, u32 set)
500 + struct wmi_gpio_output_cmd *cmd;
501 + struct sk_buff *skb;
503 + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
505 + return ERR_PTR(-ENOMEM);
507 + cmd = (struct wmi_gpio_output_cmd *)skb->data;
508 + cmd->gpio_num = __cpu_to_le32(gpio_num);
509 + cmd->set = __cpu_to_le32(set);
511 + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n",
517 static struct sk_buff *
518 ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
519 enum wmi_sta_ps_mode psmode)
520 @@ -9004,6 +9047,9 @@ static const struct wmi_ops wmi_ops = {
521 .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
522 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
523 .gen_echo = ath10k_wmi_op_gen_echo,
524 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
525 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
527 /* .gen_bcn_tmpl not implemented */
528 /* .gen_prb_tmpl not implemented */
529 /* .gen_p2p_go_bcn_ie not implemented */
530 @@ -9074,6 +9120,8 @@ static const struct wmi_ops wmi_10_1_ops
531 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
532 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
533 .gen_echo = ath10k_wmi_op_gen_echo,
534 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
535 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
536 /* .gen_bcn_tmpl not implemented */
537 /* .gen_prb_tmpl not implemented */
538 /* .gen_p2p_go_bcn_ie not implemented */
539 @@ -9146,6 +9194,8 @@ static const struct wmi_ops wmi_10_2_ops
540 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
541 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
542 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
543 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
544 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
545 /* .gen_pdev_enable_adaptive_cca not implemented */
548 @@ -9217,6 +9267,8 @@ static const struct wmi_ops wmi_10_2_4_o
549 ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
550 .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
551 .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing,
552 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
553 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
554 /* .gen_bcn_tmpl not implemented */
555 /* .gen_prb_tmpl not implemented */
556 /* .gen_p2p_go_bcn_ie not implemented */
557 @@ -9297,6 +9349,8 @@ static const struct wmi_ops wmi_10_4_ops
558 .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
559 .gen_echo = ath10k_wmi_op_gen_echo,
560 .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
561 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
562 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
565 int ath10k_wmi_attach(struct ath10k *ar)
566 --- a/drivers/net/wireless/ath/ath10k/wmi.h
567 +++ b/drivers/net/wireless/ath/ath10k/wmi.h
568 @@ -2998,6 +2998,41 @@ enum wmi_10_4_feature_mask {
572 +/* WMI_GPIO_CONFIG_CMDID */
574 + WMI_GPIO_PULL_NONE,
576 + WMI_GPIO_PULL_DOWN,
580 + WMI_GPIO_INTTYPE_DISABLE,
581 + WMI_GPIO_INTTYPE_RISING_EDGE,
582 + WMI_GPIO_INTTYPE_FALLING_EDGE,
583 + WMI_GPIO_INTTYPE_BOTH_EDGE,
584 + WMI_GPIO_INTTYPE_LEVEL_LOW,
585 + WMI_GPIO_INTTYPE_LEVEL_HIGH
588 +/* WMI_GPIO_CONFIG_CMDID */
589 +struct wmi_gpio_config_cmd {
590 + __le32 gpio_num; /* GPIO number to be setup */
591 + __le32 input; /* 0 - Output/ 1 - Input */
592 + __le32 pull_type; /* Pull type defined above */
593 + __le32 intr_mode; /* Interrupt mode defined above (Input) */
596 +/* WMI_GPIO_OUTPUT_CMDID */
597 +struct wmi_gpio_output_cmd {
598 + __le32 gpio_num; /* GPIO number to be setup */
599 + __le32 set; /* Set the GPIO pin*/
602 +/* WMI_GPIO_INPUT_EVENTID */
603 +struct wmi_gpio_input_event {
604 + __le32 gpio_num; /* GPIO number which changed state */
607 struct wmi_ext_resource_config_10_4_cmd {
608 /* contains enum wmi_host_platform_type */
609 __le32 host_platform_config;