Subhash Chandra Bose Naripeddy | 3eedc00 | 2013-11-12 20:45:15 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. |
| 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 | |
| 33 | int offload_update_mixer_and_effects_ctl(int card, int device_id, |
| 34 | struct mixer *mixer, |
| 35 | struct mixer_ctl *ctl); |
| 36 | void offload_close_mixer(struct mixer *mixer); |
| 37 | |
| 38 | #define OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG (1 << 0) |
| 39 | #define OFFLOAD_SEND_BASSBOOST_STRENGTH \ |
| 40 | (OFFLOAD_SEND_BASSBOOST_ENABLE_FLAG << 1) |
| 41 | #define OFFLOAD_SEND_BASSBOOST_MODE \ |
| 42 | (OFFLOAD_SEND_BASSBOOST_STRENGTH << 1) |
| 43 | void offload_bassboost_set_device(struct bass_boost_params *bassboost, |
| 44 | uint32_t device); |
| 45 | void offload_bassboost_set_enable_flag(struct bass_boost_params *bassboost, |
| 46 | bool enable); |
| 47 | int offload_bassboost_get_enable_flag(struct bass_boost_params *bassboost); |
| 48 | void offload_bassboost_set_strength(struct bass_boost_params *bassboost, |
| 49 | int strength); |
| 50 | void offload_bassboost_set_mode(struct bass_boost_params *bassboost, |
| 51 | int mode); |
| 52 | int offload_bassboost_send_params(struct mixer_ctl *ctl, |
| 53 | struct bass_boost_params bassboost, |
| 54 | unsigned param_send_flags); |
| 55 | |
| 56 | #define OFFLOAD_SEND_VIRTUALIZER_ENABLE_FLAG (1 << 0) |
| 57 | #define OFFLOAD_SEND_VIRTUALIZER_STRENGTH \ |
| 58 | (OFFLOAD_SEND_VIRTUALIZER_ENABLE_FLAG << 1) |
| 59 | #define OFFLOAD_SEND_VIRTUALIZER_OUT_TYPE \ |
| 60 | (OFFLOAD_SEND_VIRTUALIZER_STRENGTH << 1) |
| 61 | #define OFFLOAD_SEND_VIRTUALIZER_GAIN_ADJUST \ |
| 62 | (OFFLOAD_SEND_VIRTUALIZER_OUT_TYPE << 1) |
| 63 | void offload_virtualizer_set_device(struct virtualizer_params *virtualizer, |
| 64 | uint32_t device); |
| 65 | void offload_virtualizer_set_enable_flag(struct virtualizer_params *virtualizer, |
| 66 | bool enable); |
| 67 | int offload_virtualizer_get_enable_flag(struct virtualizer_params *virtualizer); |
| 68 | void offload_virtualizer_set_strength(struct virtualizer_params *virtualizer, |
| 69 | int strength); |
| 70 | void offload_virtualizer_set_out_type(struct virtualizer_params *virtualizer, |
| 71 | int out_type); |
| 72 | void offload_virtualizer_set_gain_adjust(struct virtualizer_params *virtualizer, |
| 73 | int gain_adjust); |
| 74 | int offload_virtualizer_send_params(struct mixer_ctl *ctl, |
| 75 | struct virtualizer_params virtualizer, |
| 76 | unsigned param_send_flags); |
| 77 | |
| 78 | #define OFFLOAD_SEND_EQ_ENABLE_FLAG (1 << 0) |
| 79 | #define OFFLOAD_SEND_EQ_PRESET \ |
| 80 | (OFFLOAD_SEND_EQ_ENABLE_FLAG << 1) |
| 81 | #define OFFLOAD_SEND_EQ_BANDS_LEVEL \ |
| 82 | (OFFLOAD_SEND_EQ_PRESET << 1) |
| 83 | void offload_eq_set_device(struct eq_params *eq, uint32_t device); |
| 84 | void offload_eq_set_enable_flag(struct eq_params *eq, bool enable); |
| 85 | int offload_eq_get_enable_flag(struct eq_params *eq); |
| 86 | void offload_eq_set_preset(struct eq_params *eq, int preset); |
| 87 | void offload_eq_set_bands_level(struct eq_params *eq, int num_bands, |
| 88 | const uint16_t *band_freq_list, |
| 89 | int *band_gain_list); |
| 90 | int offload_eq_send_params(struct mixer_ctl *ctl, struct eq_params eq, |
| 91 | unsigned param_send_flags); |
| 92 | |
| 93 | #define OFFLOAD_SEND_REVERB_ENABLE_FLAG (1 << 0) |
| 94 | #define OFFLOAD_SEND_REVERB_MODE \ |
| 95 | (OFFLOAD_SEND_REVERB_ENABLE_FLAG << 1) |
| 96 | #define OFFLOAD_SEND_REVERB_PRESET \ |
| 97 | (OFFLOAD_SEND_REVERB_MODE << 1) |
| 98 | #define OFFLOAD_SEND_REVERB_WET_MIX \ |
| 99 | (OFFLOAD_SEND_REVERB_PRESET << 1) |
| 100 | #define OFFLOAD_SEND_REVERB_GAIN_ADJUST \ |
| 101 | (OFFLOAD_SEND_REVERB_WET_MIX << 1) |
| 102 | #define OFFLOAD_SEND_REVERB_ROOM_LEVEL \ |
| 103 | (OFFLOAD_SEND_REVERB_GAIN_ADJUST << 1) |
| 104 | #define OFFLOAD_SEND_REVERB_ROOM_HF_LEVEL \ |
| 105 | (OFFLOAD_SEND_REVERB_ROOM_LEVEL << 1) |
| 106 | #define OFFLOAD_SEND_REVERB_DECAY_TIME \ |
| 107 | (OFFLOAD_SEND_REVERB_ROOM_HF_LEVEL << 1) |
| 108 | #define OFFLOAD_SEND_REVERB_DECAY_HF_RATIO \ |
| 109 | (OFFLOAD_SEND_REVERB_DECAY_TIME << 1) |
| 110 | #define OFFLOAD_SEND_REVERB_REFLECTIONS_LEVEL \ |
| 111 | (OFFLOAD_SEND_REVERB_DECAY_HF_RATIO << 1) |
| 112 | #define OFFLOAD_SEND_REVERB_REFLECTIONS_DELAY \ |
| 113 | (OFFLOAD_SEND_REVERB_REFLECTIONS_LEVEL << 1) |
| 114 | #define OFFLOAD_SEND_REVERB_LEVEL \ |
| 115 | (OFFLOAD_SEND_REVERB_REFLECTIONS_DELAY << 1) |
| 116 | #define OFFLOAD_SEND_REVERB_DELAY \ |
| 117 | (OFFLOAD_SEND_REVERB_LEVEL << 1) |
| 118 | #define OFFLOAD_SEND_REVERB_DIFFUSION \ |
| 119 | (OFFLOAD_SEND_REVERB_DELAY << 1) |
| 120 | #define OFFLOAD_SEND_REVERB_DENSITY \ |
| 121 | (OFFLOAD_SEND_REVERB_DIFFUSION << 1) |
| 122 | void offload_reverb_set_device(struct reverb_params *reverb, uint32_t device); |
| 123 | void offload_reverb_set_enable_flag(struct reverb_params *reverb, bool enable); |
| 124 | int offload_reverb_get_enable_flag(struct reverb_params *reverb); |
| 125 | void offload_reverb_set_mode(struct reverb_params *reverb, int mode); |
| 126 | void offload_reverb_set_preset(struct reverb_params *reverb, int preset); |
| 127 | void offload_reverb_set_wet_mix(struct reverb_params *reverb, int wet_mix); |
| 128 | void offload_reverb_set_gain_adjust(struct reverb_params *reverb, |
| 129 | int gain_adjust); |
| 130 | void offload_reverb_set_room_level(struct reverb_params *reverb, |
| 131 | int room_level); |
| 132 | void offload_reverb_set_room_hf_level(struct reverb_params *reverb, |
| 133 | int room_hf_level); |
| 134 | void offload_reverb_set_decay_time(struct reverb_params *reverb, |
| 135 | int decay_time); |
| 136 | void offload_reverb_set_decay_hf_ratio(struct reverb_params *reverb, |
| 137 | int decay_hf_ratio); |
| 138 | void offload_reverb_set_reflections_level(struct reverb_params *reverb, |
| 139 | int reflections_level); |
| 140 | void offload_reverb_set_reflections_delay(struct reverb_params *reverb, |
| 141 | int reflections_delay); |
| 142 | void offload_reverb_set_reverb_level(struct reverb_params *reverb, |
| 143 | int reverb_level); |
| 144 | void offload_reverb_set_delay(struct reverb_params *reverb, int delay); |
| 145 | void offload_reverb_set_diffusion(struct reverb_params *reverb, int diffusion); |
| 146 | void offload_reverb_set_density(struct reverb_params *reverb, int density); |
| 147 | int offload_reverb_send_params(struct mixer_ctl *ctl, |
| 148 | struct reverb_params reverb, |
| 149 | unsigned param_send_flags); |
| 150 | |
| 151 | #endif /*OFFLOAD_EFFECT_API_H_*/ |