Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2009, Code Aurora Forum. 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 | */ |
| 13 | #ifndef __LINUX_MFD_MSM_MARIMBA_CODEC_H |
| 14 | #define __LINUX_MFD_MSM_MARIMBA_CODEC_H |
| 15 | |
| 16 | #include <mach/qdsp5v2/adie_marimba.h> |
| 17 | |
| 18 | struct adie_codec_register { |
| 19 | u8 reg; |
| 20 | u8 mask; |
| 21 | u8 val; |
| 22 | }; |
| 23 | |
| 24 | struct adie_codec_register_image { |
| 25 | struct adie_codec_register *regs; |
| 26 | u32 img_sz; |
| 27 | }; |
| 28 | |
| 29 | struct adie_codec_path { |
| 30 | struct adie_codec_dev_profile *profile; |
| 31 | struct adie_codec_register_image img; |
| 32 | u32 hwsetting_idx; |
| 33 | u32 stage_idx; |
| 34 | u32 curr_stage; |
| 35 | }; |
| 36 | |
| 37 | int adie_codec_open(struct adie_codec_dev_profile *profile, |
| 38 | struct adie_codec_path **path_pptr); |
| 39 | int adie_codec_setpath(struct adie_codec_path *path_ptr, |
| 40 | u32 freq_plan, u32 osr); |
| 41 | int adie_codec_proceed_stage(struct adie_codec_path *path_ptr, u32 state); |
| 42 | int adie_codec_close(struct adie_codec_path *path_ptr); |
| 43 | u32 adie_codec_freq_supported(struct adie_codec_dev_profile *profile, |
| 44 | u32 requested_freq); |
| 45 | int adie_codec_enable_sidetone(struct adie_codec_path *rx_path_ptr, u32 enable); |
| 46 | |
| 47 | int adie_codec_set_device_digital_volume(struct adie_codec_path *path_ptr, |
| 48 | u32 num_channels, u32 vol_percentage /* in percentage */); |
| 49 | |
| 50 | int adie_codec_set_device_analog_volume(struct adie_codec_path *path_ptr, |
| 51 | u32 num_channels, u32 volume /* in percentage */); |
| 52 | #endif |