Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2012,2015-2016 The Linux Foundation. All rights reserved. |
| 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 | #ifndef _MSM_PCM_AFE_H |
| 13 | #define _MSM_PCM_AFE_H |
Laxminath Kasam | 605b42f | 2017-08-01 22:02:15 +0530 | [diff] [blame] | 14 | #include <dsp/apr_audio-v2.h> |
| 15 | #include <dsp/q6afe-v2.h> |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 16 | |
| 17 | |
| 18 | struct pcm_afe_info { |
| 19 | unsigned long dma_addr; |
| 20 | struct snd_pcm_substream *substream; |
| 21 | unsigned int pcm_irq_pos; /* IRQ position */ |
| 22 | struct mutex lock; |
| 23 | spinlock_t dsp_lock; |
| 24 | uint32_t samp_rate; |
| 25 | uint32_t channel_mode; |
| 26 | uint8_t start; |
| 27 | uint32_t dsp_cnt; |
| 28 | uint32_t buf_phys; |
| 29 | int32_t mmap_flag; |
| 30 | int prepared; |
| 31 | struct hrtimer hrt; |
| 32 | int poll_time; |
| 33 | struct afe_audio_client *audio_client; |
| 34 | wait_queue_head_t read_wait; |
| 35 | atomic_t rec_bytes_avail; |
| 36 | bool reset_event; |
| 37 | }; |
| 38 | |
| 39 | |
| 40 | #define MSM_EXT(xname, fp_info, fp_get, fp_put, addr) \ |
| 41 | {.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
| 42 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \ |
| 43 | .name = xname, \ |
| 44 | .info = fp_info,\ |
| 45 | .get = fp_get, .put = fp_put, \ |
| 46 | .private_value = addr, \ |
| 47 | } |
| 48 | |
| 49 | #endif /*_MSM_PCM_AFE_H*/ |