1 From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001
2 From: Sebastian Gottschall <s.gottschall@dd-wrt.com>
3 Date: Mon, 13 May 2024 17:22:25 +0300
4 Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for
7 Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984
8 based chipsets with on chipset connected led's using WMI Firmware API.
9 The LED device will get available named as "ath10k-phyX" at sysfs and
10 can be controlled with various triggers.
11 Adds also debugfs interface for gpio control.
13 Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
14 Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
15 [kvalo: major reorg and cleanup]
16 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
17 [ansuel: rebase and small cleanup]
18 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
19 Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
20 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
21 Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com
23 drivers/net/wireless/ath/ath10k/Kconfig | 6 ++
24 drivers/net/wireless/ath/ath10k/Makefile | 1 +
25 drivers/net/wireless/ath/ath10k/core.c | 32 ++++++++
26 drivers/net/wireless/ath/ath10k/core.h | 8 ++
27 drivers/net/wireless/ath/ath10k/hw.h | 1 +
28 drivers/net/wireless/ath/ath10k/leds.c | 90 +++++++++++++++++++++++
29 drivers/net/wireless/ath/ath10k/leds.h | 34 +++++++++
30 drivers/net/wireless/ath/ath10k/mac.c | 1 +
31 drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++
32 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 +
33 drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++
34 drivers/net/wireless/ath/ath10k/wmi.h | 35 +++++++++
35 12 files changed, 296 insertions(+)
36 create mode 100644 drivers/net/wireless/ath/ath10k/leds.c
37 create mode 100644 drivers/net/wireless/ath/ath10k/leds.h
39 --- a/drivers/net/wireless/ath/ath10k/Kconfig
40 +++ b/drivers/net/wireless/ath/ath10k/Kconfig
41 @@ -72,6 +72,12 @@ config ATH10K_DEBUGFS
43 If unsure, say Y to make it easier to debug problems.
48 + depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211
51 config ATH10K_SPECTRAL
52 bool "Atheros ath10k spectral scan support"
53 depends on ATH10K_DEBUGFS
54 --- a/drivers/net/wireless/ath/ath10k/Makefile
55 +++ b/drivers/net/wireless/ath/ath10k/Makefile
56 @@ -19,6 +19,7 @@ ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) +=
57 ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o
58 ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o
59 ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o
60 +ath10k_core-$(CPTCFG_ATH10K_LEDS) += leds.o
61 ath10k_core-$(CPTCFG_MAC80211_DEBUGFS) += debugfs_sta.o
62 ath10k_core-$(CONFIG_PM) += wow.o
63 ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
66 @@ -161,6 +161,7 @@ ATH10K_DEBUG=
74 --- a/drivers/net/wireless/ath/ath10k/core.c
75 +++ b/drivers/net/wireless/ath/ath10k/core.c
82 unsigned int ath10k_debug_mask;
83 EXPORT_SYMBOL(ath10k_debug_mask);
84 @@ -67,6 +68,7 @@ static const struct ath10k_hw_params ath
85 .name = "qca988x hw2.0",
86 .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
89 .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
91 .channel_counters_freq_hz = 88000,
92 @@ -107,6 +109,7 @@ static const struct ath10k_hw_params ath
93 .name = "qca988x hw2.0 ubiquiti",
94 .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
97 .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
99 .channel_counters_freq_hz = 88000,
100 @@ -148,6 +151,7 @@ static const struct ath10k_hw_params ath
101 .name = "qca9887 hw1.0",
102 .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
105 .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
107 .channel_counters_freq_hz = 88000,
108 @@ -189,6 +193,7 @@ static const struct ath10k_hw_params ath
109 .name = "qca6174 hw3.2 sdio",
110 .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
114 .channel_counters_freq_hz = 88000,
115 .max_probe_resp_desc_thres = 0,
116 @@ -225,6 +230,7 @@ static const struct ath10k_hw_params ath
117 .name = "qca6164 hw2.1",
118 .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
122 .channel_counters_freq_hz = 88000,
123 .max_probe_resp_desc_thres = 0,
124 @@ -265,6 +271,7 @@ static const struct ath10k_hw_params ath
125 .name = "qca6174 hw2.1",
126 .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
130 .channel_counters_freq_hz = 88000,
131 .max_probe_resp_desc_thres = 0,
132 @@ -305,6 +312,7 @@ static const struct ath10k_hw_params ath
133 .name = "qca6174 hw3.0",
134 .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
138 .channel_counters_freq_hz = 88000,
139 .max_probe_resp_desc_thres = 0,
140 @@ -345,6 +353,7 @@ static const struct ath10k_hw_params ath
141 .name = "qca6174 hw3.2",
142 .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
146 .channel_counters_freq_hz = 88000,
147 .max_probe_resp_desc_thres = 0,
148 @@ -389,6 +398,7 @@ static const struct ath10k_hw_params ath
149 .name = "qca99x0 hw2.0",
150 .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
153 .otp_exe_param = 0x00000700,
154 .continuous_frag_desc = true,
155 .cck_rate_map_rev2 = true,
156 @@ -435,6 +445,7 @@ static const struct ath10k_hw_params ath
157 .name = "qca9984/qca9994 hw1.0",
158 .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
161 .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
162 .otp_exe_param = 0x00000700,
163 .continuous_frag_desc = true,
164 @@ -488,6 +499,7 @@ static const struct ath10k_hw_params ath
165 .name = "qca9888 hw2.0",
166 .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
169 .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
170 .otp_exe_param = 0x00000700,
171 .continuous_frag_desc = true,
172 @@ -538,6 +550,7 @@ static const struct ath10k_hw_params ath
173 .name = "qca9377 hw1.0",
174 .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
178 .channel_counters_freq_hz = 88000,
179 .max_probe_resp_desc_thres = 0,
180 @@ -578,6 +591,7 @@ static const struct ath10k_hw_params ath
181 .name = "qca9377 hw1.1",
182 .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
186 .channel_counters_freq_hz = 88000,
187 .max_probe_resp_desc_thres = 0,
188 @@ -620,6 +634,7 @@ static const struct ath10k_hw_params ath
189 .name = "qca9377 hw1.1 sdio",
190 .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
194 .channel_counters_freq_hz = 88000,
195 .max_probe_resp_desc_thres = 0,
196 @@ -653,6 +668,7 @@ static const struct ath10k_hw_params ath
197 .name = "qca4019 hw1.0",
198 .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR,
201 .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
202 .otp_exe_param = 0x0010000,
203 .continuous_frag_desc = true,
204 @@ -698,6 +714,7 @@ static const struct ath10k_hw_params ath
206 .bus = ATH10K_BUS_SNOC,
207 .name = "wcn3990 hw1.0",
209 .continuous_frag_desc = true,
210 .tx_chain_mask = 0x7,
211 .rx_chain_mask = 0x7,
212 @@ -3222,6 +3239,10 @@ int ath10k_core_start(struct ath10k *ar,
216 + status = ath10k_leds_start(ar);
223 @@ -3480,9 +3501,18 @@ static void ath10k_core_register_work(st
224 goto err_spectral_destroy;
227 + status = ath10k_leds_register(ar);
229 + ath10k_err(ar, "could not register leds: %d\n",
231 + goto err_thermal_unregister;
234 set_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags);
237 +err_thermal_unregister:
238 + ath10k_thermal_unregister(ar);
239 err_spectral_destroy:
240 ath10k_spectral_destroy(ar);
242 @@ -3528,6 +3558,8 @@ void ath10k_core_unregister(struct ath10
243 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
246 + ath10k_leds_unregister(ar);
248 ath10k_thermal_unregister(ar);
249 /* Stop spectral before unregistering from mac80211 to remove the
250 * relayfs debugfs file cleanly. Otherwise the parent debugfs tree
251 --- a/drivers/net/wireless/ath/ath10k/core.h
252 +++ b/drivers/net/wireless/ath/ath10k/core.h
254 #include <linux/pci.h>
255 #include <linux/uuid.h>
256 #include <linux/time.h>
257 +#include <linux/leds.h>
261 @@ -1256,6 +1257,13 @@ struct ath10k {
265 + struct gpio_led wifi_led;
266 + struct led_classdev cdev;
268 + u32 gpio_state_pin;
272 /* protected by data_lock */
274 u32 fw_crash_counter;
275 --- a/drivers/net/wireless/ath/ath10k/hw.h
276 +++ b/drivers/net/wireless/ath/ath10k/hw.h
277 @@ -519,6 +519,7 @@ struct ath10k_hw_params {
284 /* Type of hw cycle counter wraparound logic, for more info
286 +++ b/drivers/net/wireless/ath/ath10k/leds.c
288 +// SPDX-License-Identifier: ISC
290 + * Copyright (c) 2005-2011 Atheros Communications Inc.
291 + * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
292 + * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com>
293 + * Copyright (c) 2018 The Linux Foundation. All rights reserved.
296 +#include <linux/leds.h>
300 +#include "wmi-ops.h"
304 +static int ath10k_leds_set_brightness_blocking(struct led_classdev *led_cdev,
305 + enum led_brightness brightness)
307 + struct ath10k *ar = container_of(led_cdev, struct ath10k,
309 + struct gpio_led *led = &ar->leds.wifi_led;
311 + mutex_lock(&ar->conf_mutex);
313 + if (ar->state != ATH10K_STATE_ON)
316 + ar->leds.gpio_state_pin = (brightness != LED_OFF) ^ led->active_low;
317 + ath10k_wmi_gpio_output(ar, led->gpio, ar->leds.gpio_state_pin);
320 + mutex_unlock(&ar->conf_mutex);
325 +int ath10k_leds_start(struct ath10k *ar)
327 + if (ar->hw_params.led_pin == 0)
328 + /* leds not supported */
331 + /* under some circumstances, the gpio pin gets reconfigured
332 + * to default state by the firmware, so we need to
333 + * reconfigure it this behaviour has only ben seen on
334 + * QCA9984 and QCA99XX devices so far
336 + ath10k_wmi_gpio_config(ar, ar->hw_params.led_pin, 0,
337 + WMI_GPIO_PULL_NONE, WMI_GPIO_INTTYPE_DISABLE);
338 + ath10k_wmi_gpio_output(ar, ar->hw_params.led_pin, 1);
343 +int ath10k_leds_register(struct ath10k *ar)
347 + if (ar->hw_params.led_pin == 0)
348 + /* leds not supported */
351 + snprintf(ar->leds.label, sizeof(ar->leds.label), "ath10k-%s",
352 + wiphy_name(ar->hw->wiphy));
353 + ar->leds.wifi_led.active_low = 1;
354 + ar->leds.wifi_led.gpio = ar->hw_params.led_pin;
355 + ar->leds.wifi_led.name = ar->leds.label;
356 + ar->leds.wifi_led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
358 + ar->leds.cdev.name = ar->leds.label;
359 + ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
360 + ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
362 + ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
369 +void ath10k_leds_unregister(struct ath10k *ar)
371 + if (ar->hw_params.led_pin == 0)
372 + /* leds not supported */
375 + led_classdev_unregister(&ar->leds.cdev);
379 +++ b/drivers/net/wireless/ath/ath10k/leds.h
381 +/* SPDX-License-Identifier: ISC */
383 + * Copyright (c) 2005-2011 Atheros Communications Inc.
384 + * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
385 + * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com>
386 + * Copyright (c) 2018 The Linux Foundation. All rights reserved.
394 +#ifdef CPTCFG_ATH10K_LEDS
395 +void ath10k_leds_unregister(struct ath10k *ar);
396 +int ath10k_leds_start(struct ath10k *ar);
397 +int ath10k_leds_register(struct ath10k *ar);
399 +static inline void ath10k_leds_unregister(struct ath10k *ar)
403 +static inline int ath10k_leds_start(struct ath10k *ar)
408 +static inline int ath10k_leds_register(struct ath10k *ar)
414 +#endif /* _LEDS_H_ */
415 --- a/drivers/net/wireless/ath/ath10k/mac.c
416 +++ b/drivers/net/wireless/ath/ath10k/mac.c
425 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
426 +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
427 @@ -226,7 +226,10 @@ struct wmi_ops {
428 const struct wmi_bb_timing_cfg_arg *arg);
429 struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar,
430 const struct wmi_per_peer_per_tid_cfg_arg *arg);
431 + struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num,
432 + u32 input, u32 pull_type, u32 intr_mode);
434 + struct sk_buff *(*gen_gpio_output)(struct ath10k *ar, u32 gpio_num, u32 set);
437 int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
438 @@ -1122,6 +1125,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
439 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
442 +static inline int ath10k_wmi_gpio_config(struct ath10k *ar, u32 gpio_num,
443 + u32 input, u32 pull_type, u32 intr_mode)
445 + struct sk_buff *skb;
447 + if (!ar->wmi.ops->gen_gpio_config)
448 + return -EOPNOTSUPP;
450 + skb = ar->wmi.ops->gen_gpio_config(ar, gpio_num, input, pull_type, intr_mode);
452 + return PTR_ERR(skb);
454 + return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_config_cmdid);
457 +static inline int ath10k_wmi_gpio_output(struct ath10k *ar, u32 gpio_num, u32 set)
459 + struct sk_buff *skb;
461 + if (!ar->wmi.ops->gen_gpio_config)
462 + return -EOPNOTSUPP;
464 + skb = ar->wmi.ops->gen_gpio_output(ar, gpio_num, set);
466 + return PTR_ERR(skb);
468 + return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_output_cmdid);
472 ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level)
474 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
475 +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
476 @@ -4601,6 +4601,8 @@ static const struct wmi_ops wmi_tlv_ops
477 .gen_echo = ath10k_wmi_tlv_op_gen_echo,
478 .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
479 .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
480 + /* .gen_gpio_config not implemented */
481 + /* .gen_gpio_output not implemented */
484 static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
485 --- a/drivers/net/wireless/ath/ath10k/wmi.c
486 +++ b/drivers/net/wireless/ath/ath10k/wmi.c
487 @@ -7472,6 +7472,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
491 +static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar,
492 + u32 gpio_num, u32 input,
493 + u32 pull_type, u32 intr_mode)
495 + struct wmi_gpio_config_cmd *cmd;
496 + struct sk_buff *skb;
498 + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
500 + return ERR_PTR(-ENOMEM);
502 + cmd = (struct wmi_gpio_config_cmd *)skb->data;
503 + cmd->pull_type = __cpu_to_le32(pull_type);
504 + cmd->gpio_num = __cpu_to_le32(gpio_num);
505 + cmd->input = __cpu_to_le32(input);
506 + cmd->intr_mode = __cpu_to_le32(intr_mode);
508 + 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",
509 + gpio_num, input, pull_type, intr_mode);
514 +static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar,
515 + u32 gpio_num, u32 set)
517 + struct wmi_gpio_output_cmd *cmd;
518 + struct sk_buff *skb;
520 + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
522 + return ERR_PTR(-ENOMEM);
524 + cmd = (struct wmi_gpio_output_cmd *)skb->data;
525 + cmd->gpio_num = __cpu_to_le32(gpio_num);
526 + cmd->set = __cpu_to_le32(set);
528 + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n",
534 static struct sk_buff *
535 ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
536 enum wmi_sta_ps_mode psmode)
537 @@ -9138,6 +9181,9 @@ static const struct wmi_ops wmi_ops = {
538 .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
539 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
540 .gen_echo = ath10k_wmi_op_gen_echo,
541 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
542 + .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 @@ -9208,6 +9254,8 @@ static const struct wmi_ops wmi_10_1_ops
548 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
549 .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
550 .gen_echo = ath10k_wmi_op_gen_echo,
551 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
552 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
553 /* .gen_bcn_tmpl not implemented */
554 /* .gen_prb_tmpl not implemented */
555 /* .gen_p2p_go_bcn_ie not implemented */
556 @@ -9280,6 +9328,8 @@ static const struct wmi_ops wmi_10_2_ops
557 .gen_delba_send = ath10k_wmi_op_gen_delba_send,
558 .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
559 .get_vdev_subtype = ath10k_wmi_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_pdev_enable_adaptive_cca not implemented */
565 @@ -9351,6 +9401,8 @@ static const struct wmi_ops wmi_10_2_4_o
566 ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
567 .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
568 .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing,
569 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
570 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
571 /* .gen_bcn_tmpl not implemented */
572 /* .gen_prb_tmpl not implemented */
573 /* .gen_p2p_go_bcn_ie not implemented */
574 @@ -9432,6 +9484,8 @@ static const struct wmi_ops wmi_10_4_ops
575 .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
576 .gen_echo = ath10k_wmi_op_gen_echo,
577 .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
578 + .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
579 + .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
582 int ath10k_wmi_attach(struct ath10k *ar)
583 --- a/drivers/net/wireless/ath/ath10k/wmi.h
584 +++ b/drivers/net/wireless/ath/ath10k/wmi.h
585 @@ -3030,6 +3030,41 @@ enum wmi_10_4_feature_mask {
589 +/* WMI_GPIO_CPTCFG_CMDID */
591 + WMI_GPIO_PULL_NONE,
593 + WMI_GPIO_PULL_DOWN,
597 + WMI_GPIO_INTTYPE_DISABLE,
598 + WMI_GPIO_INTTYPE_RISING_EDGE,
599 + WMI_GPIO_INTTYPE_FALLING_EDGE,
600 + WMI_GPIO_INTTYPE_BOTH_EDGE,
601 + WMI_GPIO_INTTYPE_LEVEL_LOW,
602 + WMI_GPIO_INTTYPE_LEVEL_HIGH
605 +/* WMI_GPIO_CPTCFG_CMDID */
606 +struct wmi_gpio_config_cmd {
607 + __le32 gpio_num; /* GPIO number to be setup */
608 + __le32 input; /* 0 - Output/ 1 - Input */
609 + __le32 pull_type; /* Pull type defined above */
610 + __le32 intr_mode; /* Interrupt mode defined above (Input) */
613 +/* WMI_GPIO_OUTPUT_CMDID */
614 +struct wmi_gpio_output_cmd {
615 + __le32 gpio_num; /* GPIO number to be setup */
616 + __le32 set; /* Set the GPIO pin*/
619 +/* WMI_GPIO_INPUT_EVENTID */
620 +struct wmi_gpio_input_event {
621 + __le32 gpio_num; /* GPIO number which changed state */
624 struct wmi_ext_resource_config_10_4_cmd {
625 /* contains enum wmi_host_platform_type */
626 __le32 host_platform_config;