xref: /wlan-dirver/qca-wifi-host-cmn/gpio/dispatcher/inc/wlan_gpio_tgt_api.h (revision 8cfe6b10058a04cafb17eed051f2ddf11bee8931)
1 /*
2  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 /**
19  * DOC: wlan_gpio_tgt_api.h
20  *
21  * This header file provide with API declarations to interface with Southbound
22  */
23 #ifndef __WLAN_GPIO_CFG_TGT_API_H__
24 #define __WLAN_GPIO_CFG_TGT_API_H__
25 
26 #ifdef WLAN_FEATURE_GPIO_CFG
27 #include <qdf_status.h>
28 #include <wmi_unified_param.h>
29 struct wlan_objmgr_psoc;
30 
31 /**
32  * tgt_set_gpio_config_req(): API to set GPIO configuration to lmac
33  * @psoc: the pointer to psoc object manager
34  * @param: the pointer to gpio cfg info
35  *
36  * Return: status of operation
37  */
38 QDF_STATUS
39 tgt_set_gpio_config_req(struct wlan_objmgr_psoc *psoc,
40 			struct gpio_config_params *param);
41 
42 /**
43  * tgt_set_gpio_output_req(): API to set GPIO output info to lmac
44  * @psoc: the pointer to psoc object manager
45  * @param: the pointer to gpio output info
46  *
47  * Return: status of operation
48  */
49 
50 QDF_STATUS
51 tgt_set_gpio_output_req(struct wlan_objmgr_psoc *psoc,
52 			struct gpio_output_params *param);
53 
54 /**
55  * tgt_gpio_config() - API to send gpio config request
56  * @psoc: pointer to psoc object
57  * @gpio_num: gpio pin number
58  * @input: enable/disable the gpio pin
59  * @pull_type: gpio pull type
60  * @intr_mode: gpio interrupt mode
61  * @mux_config_val: gpio MUX value
62  * @drive: gpio drive
63  * @init_enable: gpio init_enable
64  *
65  * Return: status of operation
66  */
67 QDF_STATUS tgt_gpio_config(struct wlan_objmgr_psoc *psoc, uint32_t gpio_num,
68 			   uint32_t input, uint32_t pull_type,
69 			   uint32_t intr_mode,  uint32_t mux_config_val,
70 			   uint32_t drive, uint32_t init_enable);
71 /**
72  * tgt_gpio_output() - API to send gpio output request
73  * @psoc: pointer to psoc object
74  * @gpio_num: gpio pin number
75  * @set: enable/disable the gpio pin
76  *
77  * Return: status of operation
78  */
79 QDF_STATUS tgt_gpio_output(struct wlan_objmgr_psoc *psoc, uint32_t gpio_num,
80 			   uint32_t set);
81 #else
82 static QDF_STATUS tgt_gpio_config(struct wlan_objmgr_psoc *psoc,
83 				  uint32_t gpio_num, uint32_t input,
84 				  uint32_t pull_type, uint32_t intr_mode,
85 				  uint32_t mux_config_val, uint32_t drive,
86 				  uint32_t init_enable)
87 {
88 	return QDF_STATUS_SUCCESS;
89 }
90 
91 static QDF_STATUS tgt_gpio_output(struct wlan_objmgr_psoc *psoc,
92 				  uint32_t gpio_num, uint32_t set)
93 {
94 	return QDF_STATUS_SUCCESS;
95 }
96 #endif /* WLAN_FEATURE_GPIO_CFG */
97 #endif /* __WLAN_GPIO_TGT_API_H__ */
98