1 //------------------------------------------------------------------------------
2 // <copyright file="gpio_api.h" company="Atheros">
3 //    Copyright (c) 2004-2010 Atheros Corporation.  All rights reserved.
4 //
5 //
6 // Permission to use, copy, modify, and/or distribute this software for any
7 // purpose with or without fee is hereby granted, provided that the above
8 // copyright notice and this permission notice appear in all copies.
9 //
10 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 //
18 //
19 //------------------------------------------------------------------------------
20 //==============================================================================
21 // Host-side General Purpose I/O API.
22 //
23 // Author(s): ="Atheros"
24 //==============================================================================
25 #ifndef _GPIO_API_H_
26 #define _GPIO_API_H_
27 
28 /*
29  * Send a command to the Target in order to change output on GPIO pins.
30  */
31 int wmi_gpio_output_set(struct wmi_t *wmip,
32                              u32 set_mask,
33                              u32 clear_mask,
34                              u32 enable_mask,
35                              u32 disable_mask);
36 
37 /*
38  * Send a command to the Target requesting input state of GPIO pins.
39  */
40 int wmi_gpio_input_get(struct wmi_t *wmip);
41 
42 /*
43  * Send a command to the Target to change the value of a GPIO register.
44  */
45 int wmi_gpio_register_set(struct wmi_t *wmip,
46                                u32 gpioreg_id,
47                                u32 value);
48 
49 /*
50  * Send a command to the Target to fetch the value of a GPIO register.
51  */
52 int wmi_gpio_register_get(struct wmi_t *wmip, u32 gpioreg_id);
53 
54 /*
55  * Send a command to the Target, acknowledging some GPIO interrupts.
56  */
57 int wmi_gpio_intr_ack(struct wmi_t *wmip, u32 ack_mask);
58 
59 #endif /* _GPIO_API_H_ */
60