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