1/******************************************************************************
2 *
3 *  Copyright (C) 2009-2012 Broadcom Corporation
4 *
5 *  Licensed under the Apache License, Version 2.0 (the "License");
6 *  you may not use this file except in compliance with the License.
7 *  You may obtain a copy of the License at:
8 *
9 *  http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  See the License for the specific language governing permissions and
15 *  limitations under the License.
16 *
17 ******************************************************************************/
18
19/******************************************************************************
20 *
21 *  Filename:      upio.h
22 *
23 *  Description:   Contains definitions used for I/O controls
24 *
25 ******************************************************************************/
26
27#ifndef UPIO_H
28#define UPIO_H
29
30/******************************************************************************
31**  Constants & Macros
32******************************************************************************/
33
34#define UPIO_BT_POWER_OFF 0
35#define UPIO_BT_POWER_ON  1
36
37/* UPIO signals */
38enum {
39    UPIO_BT_WAKE = 0,
40    UPIO_HOST_WAKE,
41    UPIO_LPM_MODE,
42    UPIO_MAX_COUNT
43};
44
45/* UPIO assertion/deassertion */
46enum {
47    UPIO_UNKNOWN = 0,
48    UPIO_DEASSERT,
49    UPIO_ASSERT
50};
51
52/******************************************************************************
53**  Extern variables and functions
54******************************************************************************/
55
56/******************************************************************************
57**  Functions
58******************************************************************************/
59
60/*******************************************************************************
61**
62** Function        upio_init
63**
64** Description     Initialization
65**
66** Returns         None
67**
68*******************************************************************************/
69void upio_init(void);
70
71/*******************************************************************************
72**
73** Function        upio_cleanup
74**
75** Description     Clean up
76**
77** Returns         None
78**
79*******************************************************************************/
80void upio_cleanup(void);
81
82/*******************************************************************************
83**
84** Function        upio_set_bluetooth_power
85**
86** Description     Interact with low layer driver to set Bluetooth power
87**                 on/off.
88**
89** Returns         0  : SUCCESS or Not-Applicable
90**                 <0 : ERROR
91**
92*******************************************************************************/
93int upio_set_bluetooth_power(int on);
94
95/*******************************************************************************
96**
97** Function        upio_set
98**
99** Description     Set i/o based on polarity
100**
101** Returns         None
102**
103*******************************************************************************/
104void upio_set(uint8_t pio, uint8_t action, uint8_t polarity);
105
106#endif /* UPIO_H */
107
108