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 @@ -69,6 +69,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 @@ -64,6 +65,7 @@ static const struct ath10k_hw_params ath
136 .id = QCA988X_HW_2_0_VERSION,
137 .dev_id = QCA988X_2_0_DEVICE_ID,
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 @@ -131,6 +133,7 @@ static const struct ath10k_hw_params ath
144 .id = QCA9887_HW_1_0_VERSION,
145 .dev_id = QCA9887_1_0_DEVICE_ID,
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 @@ -300,6 +303,7 @@ static const struct ath10k_hw_params ath
152 .id = QCA99X0_HW_2_0_DEV_VERSION,
153 .dev_id = QCA99X0_2_0_DEVICE_ID,
154 .name = "qca99x0 hw2.0",
156 .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
158 .otp_exe_param = 0x00000700,
159 @@ -339,6 +343,7 @@ static const struct ath10k_hw_params ath
160 .id = QCA9984_HW_1_0_DEV_VERSION,
161 .dev_id = QCA9984_1_0_DEVICE_ID,
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 @@ -383,6 +388,7 @@ static const struct ath10k_hw_params ath
168 .id = QCA9888_HW_2_0_DEV_VERSION,
169 .dev_id = QCA9888_2_0_DEVICE_ID,
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 @@ -2456,6 +2462,10 @@ int ath10k_core_start(struct ath10k *ar,
179 + status = ath10k_leds_start(ar);
186 @@ -2710,9 +2720,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 @@ -2756,6 +2775,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 @@ -908,7 +909,6 @@ struct ath10k {
232 @@ -1099,6 +1099,13 @@ struct ath10k {
236 + struct gpio_led wifi_led;
237 + struct led_classdev cdev;
239 + u32 gpio_state_pin;
243 /* protected by data_lock */
244 u32 fw_crash_counter;
245 u32 fw_warm_reset_counter;
246 --- a/drivers/net/wireless/ath/ath10k/hw.h
247 +++ b/drivers/net/wireless/ath/ath10k/hw.h
248 @@ -504,6 +504,7 @@ struct ath10k_hw_params {
255 /* Type of hw cycle counter wraparound logic, for more info
257 +++ b/drivers/net/wireless/ath/ath10k/leds.c
260 + * Copyright (c) 2005-2011 Atheros Communications Inc.
261 + * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
262 + * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com>
263 + * Copyright (c) 2018, The Linux Foundation. All rights reserved.
265 + * Permission to use, copy, modify, and/or distribute this software for any
266 + * purpose with or without fee is hereby granted, provided that the above
267 + * copyright notice and this permission notice appear in all copies.
269 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
270 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
271 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
272 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
273 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
274 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
275 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
278 +#include <linux/leds.h>
282 +#include "wmi-ops.h"
286 +static int ath10k_leds_set_brightness_blocking(struct led_classdev *led_cdev,
287 + enum led_brightness brightness)
289 + struct ath10k *ar = container_of(led_cdev, struct ath10k,
291 + struct gpio_led *led = &ar->leds.wifi_led;
293 + mutex_lock(&ar->conf_mutex);
295 + if (ar->state != ATH10K_STATE_ON)
298 + ar->leds.gpio_state_pin = (brightness != LED_OFF) ^ led->active_low;
299 + ath10k_wmi_gpio_output(ar, led->gpio, ar->leds.gpio_state_pin);
302 + mutex_unlock(&ar->conf_mutex);
307 +int ath10k_leds_start(struct ath10k *ar)
309 + if (ar->hw_params.led_pin == 0)
310 + /* leds not supported */
313 + /* under some circumstances, the gpio pin gets reconfigured
314 + * to default state by the firmware, so we need to
315 + * reconfigure it this behaviour has only ben seen on
316 + * QCA9984 and QCA99XX devices so far
318 + ath10k_wmi_gpio_config(ar, ar->hw_params.led_pin, 0,
319 + WMI_GPIO_PULL_NONE, WMI_GPIO_INTTYPE_DISABLE);
320 + ath10k_wmi_gpio_output(ar, ar->hw_params.led_pin, 1);
325 +int ath10k_leds_register(struct ath10k *ar)
329 + if (ar->hw_params.led_pin == 0)
330 + /* leds not supported */
333 + snprintf(ar->leds.label, sizeof(ar->leds.label), "ath10k-%s",
334 + wiphy_name(ar->hw->wiphy));
335 + ar->leds.wifi_led.active_low = 1;
336 + ar->leds.wifi_led.gpio = ar->hw_params.led_pin;
337 + ar->leds.wifi_led.name = ar->leds.label;
338 + ar->leds.wifi_led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
340 + ar->leds.cdev.name = ar->leds.label;
341 + ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
343 + /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
344 + ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
346 + ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
353 +void ath10k_leds_unregister(struct ath10k *ar)
355 + if (ar->hw_params.led_pin == 0)
356 + /* leds not supported */
359 + led_classdev_unregister(&ar->leds.cdev);
363 +++ b/drivers/net/wireless/ath/ath10k/leds.h
366 + * Copyright (c) 2018, The Linux Foundation. All rights reserved.
368 + * Permission to use, copy, modify, and/or distribute this software for any
369 + * purpose with or without fee is hereby granted, provided that the above
370 + * copyright notice and this permission notice appear in all copies.
372 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
373 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
374 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
375 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
376 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
377 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
378 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
385 +#ifdef CPTCFG_ATH10K_LEDS
386 +void ath10k_leds_unregister(struct ath10k *ar);
387 +int ath10k_leds_start(struct ath10k *ar);
388 +int ath10k_leds_register(struct ath10k *ar);
390 +static inline void ath10k_leds_unregister(struct ath10k *ar)
394 +static inline int ath10k_leds_start(struct ath10k *ar)
399 +static inline int ath10k_leds_register(struct ath10k *ar)
405 +#endif /* _LEDS_H_ */
406 --- a/drivers/net/wireless/ath/ath10k/mac.c
407 +++ b/drivers/net/wireless/ath/ath10k/mac.c
416 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
417 +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
418 @@ -216,7 +216,10 @@ struct wmi_ops {
419 struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value);
420 struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar,
422 + struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num,
423 + u32 input, u32 pull_type, u32 intr_mode);
425 + struct sk_buff *(*gen_gpio_output)(struct ath10k *ar, u32 gpio_num, u32 set);
428 int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
429 @@ -1054,6 +1057,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
430 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
433 +static inline int ath10k_wmi_gpio_config(struct ath10k *ar, u32 gpio_num,
434 + u32 input, u32 pull_type, u32 intr_mode)
436 + struct sk_buff *skb;
438 + if (!ar->wmi.ops->gen_gpio_config)
439 + return -EOPNOTSUPP;
441 + skb = ar->wmi.ops->gen_gpio_config(ar, gpio_num, input, pull_type, intr_mode);
443 + return PTR_ERR(skb);
445 + return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_config_cmdid);
448 +static inline int ath10k_wmi_gpio_output(struct ath10k *ar, u32 gpio_num, u32 set)
450 + struct sk_buff *skb;
452 + if (!ar->wmi.ops->gen_gpio_config)
453 + return -EOPNOTSUPP;
455 + skb = ar->wmi.ops->gen_gpio_output(ar, gpio_num, set);
457 + return PTR_ERR(skb);
459 + return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_output_cmdid);
463 ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level)
465 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
466 +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
467 @@ -3976,6 +3976,8 @@ static const struct wmi_ops wmi_tlv_ops
468 .gen_echo = ath10k_wmi_tlv_op_gen_echo,
469 .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
470 .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
471 + /* .gen_gpio_config not implemented */
472 + /* .gen_gpio_output not implemented */
475 static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
476 --- a/drivers/net/wireless/ath/ath10k/wmi.c
477 +++ b/drivers/net/wireless/ath/ath10k/wmi.c
478 @@ -7185,6 +7185,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
482 +static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar,
483 + u32 gpio_num, u32 input,
484 + u32 pull_type, u32 intr_mode)
486 + struct wmi_gpio_config_cmd *cmd;
487 + struct sk_buff *skb;
489 + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
491 + return ERR_PTR(-ENOMEM);
493 + cmd = (struct wmi_gpio_config_cmd *)skb->data;
494 + cmd->pull_type = __cpu_to_le32(pull_type);
495 + cmd->gpio_num = __cpu_to_le32(gpio_num);
496 + cmd->input = __cpu_to_le32(input);
497 + cmd->intr_mode = __cpu_to_le32(intr_mode);
499 + 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",
500 + gpio_num, input, pull_type, intr_mode);
505 +static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar,
506 + u32 gpio_num, u32 set)
508 + struct wmi_gpio_output_cmd *cmd;
509 + struct sk_buff *skb;
511 + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
513 + return ERR_PTR(-ENOMEM);
515 + cmd = (struct wmi_gpio_output_cmd *)skb->data;
516 + cmd->gpio_num = __cpu_to_le32(gpio_num);
517 + cmd->set = __cpu_to_le32(set);
519 + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n",
525 static struct sk_buff *
526 ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
527 enum wmi_sta_ps_mode psmode)
528 @@ -8796,6 +8839,9 @@ static const struct wmi_ops wmi_ops = {
529 .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
530 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
531 .gen_echo = ath10k_wmi_op_gen_echo,
532 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
533 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
535 /* .gen_bcn_tmpl not implemented */
536 /* .gen_prb_tmpl not implemented */
537 /* .gen_p2p_go_bcn_ie not implemented */
538 @@ -8866,6 +8912,8 @@ static const struct wmi_ops wmi_10_1_ops
539 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
540 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
541 .gen_echo = ath10k_wmi_op_gen_echo,
542 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
543 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
544 /* .gen_bcn_tmpl not implemented */
545 /* .gen_prb_tmpl not implemented */
546 /* .gen_p2p_go_bcn_ie not implemented */
547 @@ -8937,6 +8985,8 @@ static const struct wmi_ops wmi_10_2_ops
548 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
549 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
550 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
551 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
552 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
553 /* .gen_pdev_enable_adaptive_cca not implemented */
556 @@ -9007,6 +9057,8 @@ static const struct wmi_ops wmi_10_2_4_o
557 .gen_pdev_enable_adaptive_cca =
558 ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
559 .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
560 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
561 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
562 /* .gen_bcn_tmpl not implemented */
563 /* .gen_prb_tmpl not implemented */
564 /* .gen_p2p_go_bcn_ie not implemented */
565 @@ -9086,6 +9138,8 @@ static const struct wmi_ops wmi_10_4_ops
566 .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
567 .gen_echo = ath10k_wmi_op_gen_echo,
568 .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
569 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
570 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
573 int ath10k_wmi_attach(struct ath10k *ar)
574 --- a/drivers/net/wireless/ath/ath10k/wmi.h
575 +++ b/drivers/net/wireless/ath/ath10k/wmi.h
576 @@ -2942,6 +2942,41 @@ enum wmi_10_4_feature_mask {
580 +/* WMI_GPIO_CONFIG_CMDID */
582 + WMI_GPIO_PULL_NONE,
584 + WMI_GPIO_PULL_DOWN,
588 + WMI_GPIO_INTTYPE_DISABLE,
589 + WMI_GPIO_INTTYPE_RISING_EDGE,
590 + WMI_GPIO_INTTYPE_FALLING_EDGE,
591 + WMI_GPIO_INTTYPE_BOTH_EDGE,
592 + WMI_GPIO_INTTYPE_LEVEL_LOW,
593 + WMI_GPIO_INTTYPE_LEVEL_HIGH
596 +/* WMI_GPIO_CONFIG_CMDID */
597 +struct wmi_gpio_config_cmd {
598 + __le32 gpio_num; /* GPIO number to be setup */
599 + __le32 input; /* 0 - Output/ 1 - Input */
600 + __le32 pull_type; /* Pull type defined above */
601 + __le32 intr_mode; /* Interrupt mode defined above (Input) */
604 +/* WMI_GPIO_OUTPUT_CMDID */
605 +struct wmi_gpio_output_cmd {
606 + __le32 gpio_num; /* GPIO number to be setup */
607 + __le32 set; /* Set the GPIO pin*/
610 +/* WMI_GPIO_INPUT_EVENTID */
611 +struct wmi_gpio_input_event {
612 + __le32 gpio_num; /* GPIO number which changed state */
615 struct wmi_ext_resource_config_10_4_cmd {
616 /* contains enum wmi_host_platform_type */
617 __le32 host_platform_config;