Merge remote branch 'origin/master'
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / staging / ti-st / st_ll.h
CommitLineData
1d065ab6
PS
1/*
2 * Shared Transport Low Level (ST LL)
3 *
4 * Copyright (C) 2009 Texas Instruments
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 */
20
21#ifndef ST_LL_H
22#define ST_LL_H
23
24#include <linux/skbuff.h>
25#include "st.h"
26#include "st_core.h"
27
28/* ST LL receiver states */
29#define ST_W4_PACKET_TYPE 0
30#define ST_BT_W4_EVENT_HDR 1
31#define ST_BT_W4_ACL_HDR 2
32#define ST_BT_W4_SCO_HDR 3
33#define ST_BT_W4_DATA 4
34#define ST_FM_W4_EVENT_HDR 5
35#define ST_GPS_W4_EVENT_HDR 6
36
37/* ST LL state machines */
38#define ST_LL_ASLEEP 0
39#define ST_LL_ASLEEP_TO_AWAKE 1
40#define ST_LL_AWAKE 2
41#define ST_LL_AWAKE_TO_ASLEEP 3
42#define ST_LL_INVALID 4
43
44#define LL_SLEEP_IND 0x30
45#define LL_SLEEP_ACK 0x31
46#define LL_WAKE_UP_IND 0x32
47#define LL_WAKE_UP_ACK 0x33
48
49/* initialize and de-init ST LL */
50long st_ll_init(struct st_data_s *);
51long st_ll_deinit(struct st_data_s *);
52
53/* enable/disable ST LL along with KIM start/stop
54 * called by ST Core
55 */
56void st_ll_enable(struct st_data_s *);
57void st_ll_disable(struct st_data_s *);
58
59unsigned long st_ll_getstate(struct st_data_s *);
60unsigned long st_ll_sleep_state(struct st_data_s *, unsigned char);
61void st_ll_wakeup(struct st_data_s *);
62#endif /* ST_LL_H */