Joel Nider | 435ad8e | 2011-12-14 16:53:30 +0200 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Joel Nider | 5556a85 | 2011-10-16 10:52:13 +0200 | [diff] [blame] | 2 | * |
| 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 Nider | 435ad8e | 2011-12-14 16:53:30 +0200 | [diff] [blame] | 16 | #include <linux/tspp.h> /* tspp_source */ |
| 17 | |
Joel Nider | 5556a85 | 2011-10-16 10:52:13 +0200 | [diff] [blame] | 18 | struct 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 Nider | 435ad8e | 2011-12-14 16:53:30 +0200 | [diff] [blame] | 25 | struct 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 | |
| 33 | typedef void (tspp_notifier)(int channel, void *user); |
| 34 | typedef void* (tspp_allocator)(int channel, int size, |
| 35 | u32 *phys_base, void *user); |
| 36 | |
| 37 | /* Kernel API functions */ |
Hamad Kadmany | 92705b3 | 2012-10-23 14:15:41 +0200 | [diff] [blame^] | 38 | int tspp_open_stream(u32 dev, u32 channel_id, |
| 39 | struct tspp_select_source *source); |
Joel Nider | 435ad8e | 2011-12-14 16:53:30 +0200 | [diff] [blame] | 40 | int tspp_close_stream(u32 dev, u32 channel_id); |
| 41 | int tspp_open_channel(u32 dev, u32 channel_id); |
| 42 | int tspp_close_channel(u32 dev, u32 channel_id); |
| 43 | int tspp_add_filter(u32 dev, u32 channel_id, struct tspp_filter *filter); |
| 44 | int tspp_remove_filter(u32 dev, u32 channel_id, struct tspp_filter *filter); |
| 45 | int tspp_set_key(u32 dev, u32 channel_id, struct tspp_key *key); |
| 46 | int tspp_register_notification(u32 dev, u32 channel, tspp_notifier *notify, |
| 47 | void *data, u32 timer_ms); |
| 48 | int tspp_unregister_notification(u32 dev, u32 channel); |
| 49 | const struct tspp_data_descriptor *tspp_get_buffer(u32 dev, u32 channel); |
| 50 | int tspp_release_buffer(u32 dev, u32 channel, u32 descriptor_id); |
| 51 | int tspp_allocate_buffers(u32 dev, u32 channel_id, u32 count, |
| 52 | u32 size, u32 int_freq, tspp_allocator *alloc, void *user); |
| 53 | |
Joel Nider | 5556a85 | 2011-10-16 10:52:13 +0200 | [diff] [blame] | 54 | #endif /* _MSM_TSPP_H_ */ |
| 55 | |