Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 and |
| 6 | * only version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | #ifndef __WCD9XXX_HWDEP_H__ |
| 14 | #define __WCD9XXX_HWDEP_H__ |
| 15 | #include <sound/msmcal-hwdep.h> |
| 16 | |
| 17 | enum wcd_cal_states { |
| 18 | WCDCAL_UNINITIALISED, |
| 19 | WCDCAL_INITIALISED, |
| 20 | WCDCAL_RECIEVED |
| 21 | }; |
| 22 | |
| 23 | struct fw_info { |
| 24 | struct firmware_cal *fw[WCD9XXX_MAX_CAL]; |
| 25 | DECLARE_BITMAP(cal_bit, WCD9XXX_MAX_CAL); |
| 26 | /* for calibration tracking */ |
| 27 | unsigned long wcdcal_state[WCD9XXX_MAX_CAL]; |
| 28 | struct mutex lock; |
| 29 | }; |
| 30 | |
| 31 | struct firmware_cal { |
| 32 | u8 *data; |
| 33 | size_t size; |
| 34 | }; |
| 35 | |
| 36 | struct snd_soc_codec; |
| 37 | int wcd_cal_create_hwdep(void *fw, int node, struct snd_soc_codec *codec); |
| 38 | struct firmware_cal *wcdcal_get_fw_cal(struct fw_info *fw_data, |
| 39 | enum wcd_cal_type type); |
| 40 | #endif /* __WCD9XXX_HWDEP_H__ */ |