Ben Romberger | 12dce25 | 2013-01-04 15:23:07 -0800 | [diff] [blame] | 1 | #ifndef _LINUX_MSM_AUDIO_ACDB_H |
| 2 | #define _LINUX_MSM_AUDIO_ACDB_H |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3 | |
| 4 | #include <linux/msm_audio.h> |
| 5 | |
| 6 | #define AUDIO_SET_VOCPROC_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 7 | (AUDIO_MAX_COMMON_IOCTL_NUM+0), unsigned) |
| 8 | #define AUDIO_SET_VOCPROC_STREAM_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 9 | (AUDIO_MAX_COMMON_IOCTL_NUM+1), unsigned) |
| 10 | #define AUDIO_SET_VOCPROC_VOL_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 11 | (AUDIO_MAX_COMMON_IOCTL_NUM+2), unsigned) |
| 12 | #define AUDIO_SET_AUDPROC_RX_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 13 | (AUDIO_MAX_COMMON_IOCTL_NUM+3), unsigned) |
| 14 | #define AUDIO_SET_AUDPROC_RX_STREAM_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 15 | (AUDIO_MAX_COMMON_IOCTL_NUM+4), unsigned) |
| 16 | #define AUDIO_SET_AUDPROC_RX_VOL_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 17 | (AUDIO_MAX_COMMON_IOCTL_NUM+5), unsigned) |
| 18 | #define AUDIO_SET_AUDPROC_TX_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 19 | (AUDIO_MAX_COMMON_IOCTL_NUM+6), unsigned) |
| 20 | #define AUDIO_SET_AUDPROC_TX_STREAM_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 21 | (AUDIO_MAX_COMMON_IOCTL_NUM+7), unsigned) |
| 22 | #define AUDIO_SET_AUDPROC_TX_VOL_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 23 | (AUDIO_MAX_COMMON_IOCTL_NUM+8), unsigned) |
| 24 | #define AUDIO_SET_SIDETONE_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 25 | (AUDIO_MAX_COMMON_IOCTL_NUM+9), unsigned) |
| 26 | #define AUDIO_SET_ANC_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 27 | (AUDIO_MAX_COMMON_IOCTL_NUM+10), unsigned) |
| 28 | #define AUDIO_SET_VOICE_RX_TOPOLOGY _IOW(AUDIO_IOCTL_MAGIC, \ |
| 29 | (AUDIO_MAX_COMMON_IOCTL_NUM+11), unsigned) |
| 30 | #define AUDIO_SET_VOICE_TX_TOPOLOGY _IOW(AUDIO_IOCTL_MAGIC, \ |
| 31 | (AUDIO_MAX_COMMON_IOCTL_NUM+12), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 32 | #define AUDIO_SET_ADM_RX_TOPOLOGY _IOW(AUDIO_IOCTL_MAGIC, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 33 | (AUDIO_MAX_COMMON_IOCTL_NUM+13), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 34 | #define AUDIO_SET_ADM_TX_TOPOLOGY _IOW(AUDIO_IOCTL_MAGIC, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 35 | (AUDIO_MAX_COMMON_IOCTL_NUM+14), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 36 | #define AUDIO_SET_ASM_TOPOLOGY _IOW(AUDIO_IOCTL_MAGIC, \ |
| 37 | (AUDIO_MAX_COMMON_IOCTL_NUM+15), unsigned) |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 38 | #define AUDIO_SET_AFE_TX_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 39 | (AUDIO_MAX_COMMON_IOCTL_NUM+16), unsigned) |
| 40 | #define AUDIO_SET_AFE_RX_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 41 | (AUDIO_MAX_COMMON_IOCTL_NUM+17), unsigned) |
Ben Romberger | 7bd45ac | 2012-10-09 19:35:48 -0700 | [diff] [blame] | 42 | #define AUDIO_SET_VOCPROC_COL_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 43 | (AUDIO_MAX_COMMON_IOCTL_NUM+18), unsigned) |
| 44 | #define AUDIO_SET_VOCSTRM_COL_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 45 | (AUDIO_MAX_COMMON_IOCTL_NUM+19), unsigned) |
| 46 | #define AUDIO_SET_VOCVOL_COL_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 47 | (AUDIO_MAX_COMMON_IOCTL_NUM+20), unsigned) |
| 48 | #define AUDIO_SET_VOCPROC_DEV_CFG_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 49 | (AUDIO_MAX_COMMON_IOCTL_NUM+21), unsigned) |
Ben Romberger | 12dce25 | 2013-01-04 15:23:07 -0800 | [diff] [blame] | 50 | #define AUDIO_SET_LSM_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 51 | (AUDIO_MAX_COMMON_IOCTL_NUM+22), unsigned) |
Ben Romberger | 39fae34 | 2013-02-19 12:12:44 -0800 | [diff] [blame] | 52 | #define AUDIO_SET_ADM_CUSTOM_TOPOLOGY _IOW(AUDIO_IOCTL_MAGIC, \ |
| 53 | (AUDIO_MAX_COMMON_IOCTL_NUM+23), unsigned) |
| 54 | #define AUDIO_SET_ASM_CUSTOM_TOPOLOGY _IOW(AUDIO_IOCTL_MAGIC, \ |
| 55 | (AUDIO_MAX_COMMON_IOCTL_NUM+24), unsigned) |
Gopikrishnaiah Anandan | 7858d42 | 2012-12-17 14:52:27 -0500 | [diff] [blame] | 56 | #define AUDIO_SET_SPEAKER_PROT _IOW(AUDIO_IOCTL_MAGIC, 25, \ |
Ben Romberger | 3a4a8c6 | 2013-06-01 18:19:33 -0700 | [diff] [blame] | 57 | struct msm_spk_prot_cfg) |
Gopikrishnaiah Anandan | 7858d42 | 2012-12-17 14:52:27 -0500 | [diff] [blame] | 58 | #define AUDIO_GET_SPEAKER_PROT _IOR(AUDIO_IOCTL_MAGIC, 26, \ |
Ben Romberger | 3a4a8c6 | 2013-06-01 18:19:33 -0700 | [diff] [blame] | 59 | struct msm_spk_prot_status) |
Damir Didjusto | 77ff2fc | 2013-03-09 21:14:13 -0800 | [diff] [blame] | 60 | #define AUDIO_SET_AANC_CAL _IOW(AUDIO_IOCTL_MAGIC, \ |
| 61 | (AUDIO_MAX_COMMON_IOCTL_NUM+27), unsigned) |
Ben Romberger | 3a4a8c6 | 2013-06-01 18:19:33 -0700 | [diff] [blame] | 62 | #define AUDIO_REGISTER_VOCPROC_VOL_TABLE _IOW(AUDIO_IOCTL_MAGIC, \ |
| 63 | (AUDIO_MAX_COMMON_IOCTL_NUM+28), unsigned) |
| 64 | #define AUDIO_DEREGISTER_VOCPROC_VOL_TABLE _IOW(AUDIO_IOCTL_MAGIC, \ |
| 65 | (AUDIO_MAX_COMMON_IOCTL_NUM+29), unsigned) |
| 66 | #define AUDIO_MAX_ACDB_IOCTL (AUDIO_MAX_COMMON_IOCTL_NUM+40) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 67 | |
| 68 | /* ACDB structures */ |
| 69 | struct cal_block { |
| 70 | uint32_t cal_size; /* Size of Cal Data */ |
| 71 | uint32_t cal_offset; /* offset pointer to Cal Data */ |
| 72 | }; |
| 73 | |
| 74 | struct sidetone_cal { |
| 75 | uint16_t enable; |
| 76 | uint16_t gain; |
| 77 | }; |
| 78 | |
Gopikrishnaiah Anandan | 0218c64 | 2013-04-05 20:53:47 -0400 | [diff] [blame] | 79 | enum msm_spkr_prot_states { |
| 80 | MSM_SPKR_PROT_CALIBRATED, |
| 81 | MSM_SPKR_PROT_CALIBRATION_IN_PROGRESS, |
| 82 | MSM_SPKR_PROT_DISABLED, |
| 83 | MSM_SPKR_PROT_NOT_CALIBRATED |
| 84 | }; |
| 85 | |
Gopikrishnaiah Anandan | 7858d42 | 2012-12-17 14:52:27 -0500 | [diff] [blame] | 86 | struct msm_spk_prot_cfg { |
| 87 | int r0; |
| 88 | int t0; |
| 89 | uint32_t mode; /*0 - Start spk prot |
| 90 | 1 - Start calib |
| 91 | 2 - Disable spk prot*/ |
| 92 | }; |
| 93 | |
| 94 | struct msm_spk_prot_status { |
| 95 | int r0; |
| 96 | int status; |
| 97 | }; |
| 98 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 99 | /* For Real-Time Audio Calibration */ |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 100 | #define AUDIO_GET_RTAC_ADM_INFO _IOR(AUDIO_IOCTL_MAGIC, \ |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 101 | (AUDIO_MAX_ACDB_IOCTL+1), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 102 | #define AUDIO_GET_RTAC_VOICE_INFO _IOR(AUDIO_IOCTL_MAGIC, \ |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 103 | (AUDIO_MAX_ACDB_IOCTL+2), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 104 | #define AUDIO_GET_RTAC_ADM_CAL _IOWR(AUDIO_IOCTL_MAGIC, \ |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 105 | (AUDIO_MAX_ACDB_IOCTL+3), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 106 | #define AUDIO_SET_RTAC_ADM_CAL _IOWR(AUDIO_IOCTL_MAGIC, \ |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 107 | (AUDIO_MAX_ACDB_IOCTL+4), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 108 | #define AUDIO_GET_RTAC_ASM_CAL _IOWR(AUDIO_IOCTL_MAGIC, \ |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 109 | (AUDIO_MAX_ACDB_IOCTL+5), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 110 | #define AUDIO_SET_RTAC_ASM_CAL _IOWR(AUDIO_IOCTL_MAGIC, \ |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 111 | (AUDIO_MAX_ACDB_IOCTL+6), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 112 | #define AUDIO_GET_RTAC_CVS_CAL _IOWR(AUDIO_IOCTL_MAGIC, \ |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 113 | (AUDIO_MAX_ACDB_IOCTL+7), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 114 | #define AUDIO_SET_RTAC_CVS_CAL _IOWR(AUDIO_IOCTL_MAGIC, \ |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 115 | (AUDIO_MAX_ACDB_IOCTL+8), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 116 | #define AUDIO_GET_RTAC_CVP_CAL _IOWR(AUDIO_IOCTL_MAGIC, \ |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 117 | (AUDIO_MAX_ACDB_IOCTL+9), unsigned) |
Ben Romberger | c49b85d | 2011-07-15 18:55:34 -0700 | [diff] [blame] | 118 | #define AUDIO_SET_RTAC_CVP_CAL _IOWR(AUDIO_IOCTL_MAGIC, \ |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 119 | (AUDIO_MAX_ACDB_IOCTL+10), unsigned) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 120 | |
Ben Romberger | b760323 | 2011-11-23 17:16:27 -0800 | [diff] [blame] | 121 | #define AUDIO_MAX_RTAC_IOCTL (AUDIO_MAX_ACDB_IOCTL+20) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 122 | |
Ben Romberger | 12dce25 | 2013-01-04 15:23:07 -0800 | [diff] [blame] | 123 | #endif /* _LINUX_MSM_AUDIO_ACDB_H */ |