blob: 5395b88ccf1fc26846903bcd37e7e39e21f49cae [file] [log] [blame]
Joel Nider435ad8e2011-12-14 16:53:30 +02001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Joel Nider5556a852011-10-16 10:52:13 +02002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef _MSM_TSPP_H_
14#define _MSM_TSPP_H_
15
Joel Nider435ad8e2011-12-14 16:53:30 +020016#include <linux/tspp.h> /* tspp_source */
17
Joel Nider5556a852011-10-16 10:52:13 +020018struct msm_tspp_platform_data {
19 int num_gpios;
20 const struct msm_gpio *gpios;
21 const char *tsif_pclk;
22 const char *tsif_ref_clk;
23};
24
Joel Nider435ad8e2011-12-14 16:53:30 +020025struct tspp_data_descriptor {
26 void *virt_base; /* logical address of the actual data */
27 u32 phys_base; /* physical address of the actual data */
28 int size; /* size of buffer in bytes */
29 int id; /* unique identifier */
30 void *user; /* user-defined data */
31};
32
33typedef void (tspp_notifier)(int channel, void *user);
34typedef void* (tspp_allocator)(int channel, int size,
35 u32 *phys_base, void *user);
36
37/* Kernel API functions */
Hamad Kadmany92705b32012-10-23 14:15:41 +020038int tspp_open_stream(u32 dev, u32 channel_id,
39 struct tspp_select_source *source);
Joel Nider435ad8e2011-12-14 16:53:30 +020040int tspp_close_stream(u32 dev, u32 channel_id);
41int tspp_open_channel(u32 dev, u32 channel_id);
42int tspp_close_channel(u32 dev, u32 channel_id);
43int tspp_add_filter(u32 dev, u32 channel_id, struct tspp_filter *filter);
44int tspp_remove_filter(u32 dev, u32 channel_id, struct tspp_filter *filter);
45int tspp_set_key(u32 dev, u32 channel_id, struct tspp_key *key);
46int tspp_register_notification(u32 dev, u32 channel, tspp_notifier *notify,
47 void *data, u32 timer_ms);
48int tspp_unregister_notification(u32 dev, u32 channel);
49const struct tspp_data_descriptor *tspp_get_buffer(u32 dev, u32 channel);
50int tspp_release_buffer(u32 dev, u32 channel, u32 descriptor_id);
51int tspp_allocate_buffers(u32 dev, u32 channel_id, u32 count,
52 u32 size, u32 int_freq, tspp_allocator *alloc, void *user);
53
Joel Nider5556a852011-10-16 10:52:13 +020054#endif /* _MSM_TSPP_H_ */
55