Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 1 | /* |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 2 | * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 3 | |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions are |
| 6 | * met: |
| 7 | * * Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * * Redistributions in binary form must reproduce the above |
| 10 | * copyright notice, this list of conditions and the following |
| 11 | * disclaimer in the documentation and/or other materials provided |
| 12 | * with the distribution. |
| 13 | * * Neither the name of The Linux Foundation nor the names of its |
| 14 | * contributors may be used to endorse or promote products derived |
| 15 | * from this software without specific prior written permission. |
| 16 | * |
| 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | */ |
| 29 | |
| 30 | #ifndef OFFLOAD_EFFECT_API_H_ |
| 31 | #define OFFLOAD_EFFECT_API_H_ |
| 32 | |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 33 | #if __cplusplus |
| 34 | extern "C" { |
| 35 | #endif |
| 36 | |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 37 | int offload_update_mixer_and_effects_ctl(int card, int device_id, |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 38 | struct mixer **mixer, |
| 39 | struct mixer_ctl **ctl); |
| 40 | void offload_close_mixer(struct mixer **mixer); |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 41 | |
| 42 | #define OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG (1 << 0) |
| 43 | #define OFFLOAD_SEND_BASSBOOST_STRENGTH \ |
| 44 | (OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG << 1) |
| 45 | #define OFFLOAD_SEND_BASSBOOST_MODE \ |
| 46 | (OFFLOAD_SEND_BASSBOOST_STRENGTH << 1) |
| 47 | void offload_bassboost_set_device(struct bass_boost_params *bassboost, |
| 48 | uint32_t device); |
| 49 | void offload_bassboost_set_enable_flag(struct bass_boost_params *bassboost, |
| 50 | bool enable); |
| 51 | int offload_bassboost_get_enable_flag(struct bass_boost_params *bassboost); |
| 52 | void offload_bassboost_set_strength(struct bass_boost_params *bassboost, |
| 53 | int strength); |
| 54 | void offload_bassboost_set_mode(struct bass_boost_params *bassboost, |
| 55 | int mode); |
| 56 | int offload_bassboost_send_params(struct mixer_ctl *ctl, |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 57 | struct bass_boost_params *bassboost, |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 58 | unsigned param_send_flags); |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 59 | int hw_acc_bassboost_send_params(int fd, |
| 60 | struct bass_boost_params *bassboost, |
| 61 | unsigned param_send_flags); |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 62 | |
| 63 | #define OFFLOAD_SEND_VIRTUALIZER_ENABLE_FLAG (1 << 0) |
| 64 | #define OFFLOAD_SEND_VIRTUALIZER_STRENGTH \ |
| 65 | (OFFLOAD_SEND_VIRTUALIZER_ENABLE_FLAG << 1) |
| 66 | #define OFFLOAD_SEND_VIRTUALIZER_OUT_TYPE \ |
| 67 | (OFFLOAD_SEND_VIRTUALIZER_STRENGTH << 1) |
| 68 | #define OFFLOAD_SEND_VIRTUALIZER_GAIN_ADJUST \ |
| 69 | (OFFLOAD_SEND_VIRTUALIZER_OUT_TYPE << 1) |
| 70 | void offload_virtualizer_set_device(struct virtualizer_params *virtualizer, |
| 71 | uint32_t device); |
| 72 | void offload_virtualizer_set_enable_flag(struct virtualizer_params *virtualizer, |
| 73 | bool enable); |
| 74 | int offload_virtualizer_get_enable_flag(struct virtualizer_params *virtualizer); |
| 75 | void offload_virtualizer_set_strength(struct virtualizer_params *virtualizer, |
| 76 | int strength); |
| 77 | void offload_virtualizer_set_out_type(struct virtualizer_params *virtualizer, |
| 78 | int out_type); |
| 79 | void offload_virtualizer_set_gain_adjust(struct virtualizer_params *virtualizer, |
| 80 | int gain_adjust); |
| 81 | int offload_virtualizer_send_params(struct mixer_ctl *ctl, |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 82 | struct virtualizer_params *virtualizer, |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 83 | unsigned param_send_flags); |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 84 | int hw_acc_virtualizer_send_params(int fd, |
| 85 | struct virtualizer_params *virtualizer, |
| 86 | unsigned param_send_flags); |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 87 | |
| 88 | #define OFFLOAD_SEND_EQ_ENABLE_FLAG (1 << 0) |
| 89 | #define OFFLOAD_SEND_EQ_PRESET \ |
| 90 | (OFFLOAD_SEND_EQ_ENABLE_FLAG << 1) |
| 91 | #define OFFLOAD_SEND_EQ_BANDS_LEVEL \ |
| 92 | (OFFLOAD_SEND_EQ_PRESET << 1) |
| 93 | void offload_eq_set_device(struct eq_params *eq, uint32_t device); |
| 94 | void offload_eq_set_enable_flag(struct eq_params *eq, bool enable); |
| 95 | int offload_eq_get_enable_flag(struct eq_params *eq); |
| 96 | void offload_eq_set_preset(struct eq_params *eq, int preset); |
| 97 | void offload_eq_set_bands_level(struct eq_params *eq, int num_bands, |
| 98 | const uint16_t *band_freq_list, |
| 99 | int *band_gain_list); |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 100 | int offload_eq_send_params(struct mixer_ctl *ctl, struct eq_params *eq, |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 101 | unsigned param_send_flags); |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 102 | int hw_acc_eq_send_params(int fd, struct eq_params *eq, |
| 103 | unsigned param_send_flags); |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 104 | |
| 105 | #define OFFLOAD_SEND_REVERB_ENABLE_FLAG (1 << 0) |
| 106 | #define OFFLOAD_SEND_REVERB_MODE \ |
| 107 | (OFFLOAD_SEND_REVERB_ENABLE_FLAG << 1) |
| 108 | #define OFFLOAD_SEND_REVERB_PRESET \ |
| 109 | (OFFLOAD_SEND_REVERB_MODE << 1) |
| 110 | #define OFFLOAD_SEND_REVERB_WET_MIX \ |
| 111 | (OFFLOAD_SEND_REVERB_PRESET << 1) |
| 112 | #define OFFLOAD_SEND_REVERB_GAIN_ADJUST \ |
| 113 | (OFFLOAD_SEND_REVERB_WET_MIX << 1) |
| 114 | #define OFFLOAD_SEND_REVERB_ROOM_LEVEL \ |
| 115 | (OFFLOAD_SEND_REVERB_GAIN_ADJUST << 1) |
| 116 | #define OFFLOAD_SEND_REVERB_ROOM_HF_LEVEL \ |
| 117 | (OFFLOAD_SEND_REVERB_ROOM_LEVEL << 1) |
| 118 | #define OFFLOAD_SEND_REVERB_DECAY_TIME \ |
| 119 | (OFFLOAD_SEND_REVERB_ROOM_HF_LEVEL << 1) |
| 120 | #define OFFLOAD_SEND_REVERB_DECAY_HF_RATIO \ |
| 121 | (OFFLOAD_SEND_REVERB_DECAY_TIME << 1) |
| 122 | #define OFFLOAD_SEND_REVERB_REFLECTIONS_LEVEL \ |
| 123 | (OFFLOAD_SEND_REVERB_DECAY_HF_RATIO << 1) |
| 124 | #define OFFLOAD_SEND_REVERB_REFLECTIONS_DELAY \ |
| 125 | (OFFLOAD_SEND_REVERB_REFLECTIONS_LEVEL << 1) |
| 126 | #define OFFLOAD_SEND_REVERB_LEVEL \ |
| 127 | (OFFLOAD_SEND_REVERB_REFLECTIONS_DELAY << 1) |
| 128 | #define OFFLOAD_SEND_REVERB_DELAY \ |
| 129 | (OFFLOAD_SEND_REVERB_LEVEL << 1) |
| 130 | #define OFFLOAD_SEND_REVERB_DIFFUSION \ |
| 131 | (OFFLOAD_SEND_REVERB_DELAY << 1) |
| 132 | #define OFFLOAD_SEND_REVERB_DENSITY \ |
| 133 | (OFFLOAD_SEND_REVERB_DIFFUSION << 1) |
| 134 | void offload_reverb_set_device(struct reverb_params *reverb, uint32_t device); |
| 135 | void offload_reverb_set_enable_flag(struct reverb_params *reverb, bool enable); |
| 136 | int offload_reverb_get_enable_flag(struct reverb_params *reverb); |
| 137 | void offload_reverb_set_mode(struct reverb_params *reverb, int mode); |
| 138 | void offload_reverb_set_preset(struct reverb_params *reverb, int preset); |
| 139 | void offload_reverb_set_wet_mix(struct reverb_params *reverb, int wet_mix); |
| 140 | void offload_reverb_set_gain_adjust(struct reverb_params *reverb, |
| 141 | int gain_adjust); |
| 142 | void offload_reverb_set_room_level(struct reverb_params *reverb, |
| 143 | int room_level); |
| 144 | void offload_reverb_set_room_hf_level(struct reverb_params *reverb, |
| 145 | int room_hf_level); |
| 146 | void offload_reverb_set_decay_time(struct reverb_params *reverb, |
| 147 | int decay_time); |
| 148 | void offload_reverb_set_decay_hf_ratio(struct reverb_params *reverb, |
| 149 | int decay_hf_ratio); |
| 150 | void offload_reverb_set_reflections_level(struct reverb_params *reverb, |
| 151 | int reflections_level); |
| 152 | void offload_reverb_set_reflections_delay(struct reverb_params *reverb, |
| 153 | int reflections_delay); |
| 154 | void offload_reverb_set_reverb_level(struct reverb_params *reverb, |
| 155 | int reverb_level); |
| 156 | void offload_reverb_set_delay(struct reverb_params *reverb, int delay); |
| 157 | void offload_reverb_set_diffusion(struct reverb_params *reverb, int diffusion); |
| 158 | void offload_reverb_set_density(struct reverb_params *reverb, int density); |
| 159 | int offload_reverb_send_params(struct mixer_ctl *ctl, |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 160 | struct reverb_params *reverb, |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 161 | unsigned param_send_flags); |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 162 | int hw_acc_reverb_send_params(int fd, |
| 163 | struct reverb_params *reverb, |
| 164 | unsigned param_send_flags); |
| 165 | |
| 166 | #define OFFLOAD_SEND_SOFT_VOLUME_ENABLE_FLAG (1 << 0) |
| 167 | #define OFFLOAD_SEND_SOFT_VOLUME_GAIN_2CH \ |
| 168 | (OFFLOAD_SEND_SOFT_VOLUME_ENABLE_FLAG << 1) |
| 169 | #define OFFLOAD_SEND_SOFT_VOLUME_GAIN_MASTER \ |
| 170 | (OFFLOAD_SEND_SOFT_VOLUME_GAIN_2CH << 1) |
| 171 | void offload_soft_volume_set_enable(struct soft_volume_params *vol, |
| 172 | bool enable); |
| 173 | void offload_soft_volume_set_gain_master(struct soft_volume_params *vol, |
| 174 | int gain); |
| 175 | void offload_soft_volume_set_gain_2ch(struct soft_volume_params *vol, |
| 176 | int l_gain, int r_gain); |
| 177 | int offload_soft_volume_send_params(struct mixer_ctl *ctl, |
| 178 | struct soft_volume_params vol, |
| 179 | unsigned param_send_flags); |
| 180 | |
| 181 | #define OFFLOAD_SEND_TRANSITION_SOFT_VOLUME_ENABLE_FLAG (1 << 0) |
| 182 | #define OFFLOAD_SEND_TRANSITION_SOFT_VOLUME_GAIN_2CH \ |
| 183 | (OFFLOAD_SEND_TRANSITION_SOFT_VOLUME_ENABLE_FLAG << 1) |
| 184 | #define OFFLOAD_SEND_TRANSITION_SOFT_VOLUME_GAIN_MASTER \ |
| 185 | (OFFLOAD_SEND_TRANSITION_SOFT_VOLUME_GAIN_2CH << 1) |
| 186 | void offload_transition_soft_volume_set_enable(struct soft_volume_params *vol, |
| 187 | bool enable); |
| 188 | void offload_transition_soft_volume_set_gain_master(struct soft_volume_params *vol, |
| 189 | int gain); |
| 190 | void offload_transition_soft_volume_set_gain_2ch(struct soft_volume_params *vol, |
| 191 | int l_gain, int r_gain); |
| 192 | int offload_transition_soft_volume_send_params(struct mixer_ctl *ctl, |
| 193 | struct soft_volume_params vol, |
| 194 | unsigned param_send_flags); |
Alexy Joseph | d464f3b | 2014-11-18 16:14:41 -0800 | [diff] [blame^] | 195 | |
| 196 | #define OFFLOAD_SEND_HPX_STATE_ON (1 << 0) |
| 197 | #define OFFLOAD_SEND_HPX_STATE_OFF (OFFLOAD_SEND_HPX_STATE_ON << 1) |
| 198 | int offload_hpx_send_params(struct mixer_ctl *ctl, unsigned param_send_flags); |
| 199 | int hw_acc_hpx_send_params(int fd, unsigned param_send_flags); |
| 200 | |
Subhash Chandra Bose Naripeddy | e40a7cd | 2014-06-03 19:42:41 -0700 | [diff] [blame] | 201 | #if __cplusplus |
| 202 | } //extern "C" |
| 203 | #endif |
Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 204 | |
| 205 | #endif /*OFFLOAD_EFFECT_API_H_*/ |