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