summaryrefslogtreecommitdiff
path: root/common/audio_codec_dmic.c
Commit message (Collapse)AuthorAgeFilesLines
* audio_codec: fix compile errorTzung-Bi Shih2019-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fixes compile error: error: initialization of 'int (*)(struct host_cmd_handler_args *)' from incompatible pointer type 'enum ec_status (*)(struct host_cmd_handler_args *)' [-Werror=incompatible-pointer-types] Commit 83d793839 ("host_command: Change host command return value to enum ec_status") changes return code to enum ec_status for host commands. Changes the function pointers accordingly. BRANCH=none BUG=chromium:1004831 BUG=b:123268236 TEST=make BOARD=kukui_scp clean && make BOARD=kukui_scp -j Change-Id: I8d38cbd732746b3fc0098b22d1faa2f04716d275 Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1835881 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* host_command: Change host command return value to enum ec_statusTom Hughes2019-10-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the host command handler callback function returns an int, it's easy to accidentally mix up the enum ec_error_list and enum ec_status types. The host commands always expect an enum ec_status type, so we change the return value to be of that explicit type. Compilation will then fail if you accidentally try to return an enum ec_error_list value. Ran the following commands and then manually fixed up a few remaining instances that were not caught: git grep --name-only 'static int .*(struct host_cmd_handler_args \*args)' |\ xargs sed -i 's#static int \(.*\)(struct host_cmd_handler_args \*args)#\ static enum ec_status \1(struct host_cmd_handler_args \*args)##' git grep --name-only 'int .*(struct host_cmd_handler_args \*args)' |\ xargs sed -i 's#int \(.*\)(struct host_cmd_handler_args \*args)#\ enum ec_status \1(struct host_cmd_handler_args \*args)##' BRANCH=none BUG=chromium:1004831 TEST=make buildall -j Cq-Depend: chrome-internal:1872675 Change-Id: Id93df9387ac53d016a1594dba86c6642babbfd1e Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1816865 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* audio_codec: support software gainTzung-Bi Shih2019-09-171-0/+30
| | | | | | | | | | | | | | | | | | | | Chip or board can define a scaler for software gain for up to 8 channels. BRANCH=none BUG=b:122027734, b:123268236 TEST=1. define CONFIG_AUDIO_CODEC in board.h 2. define CONFIG_AUDIO_CODEC_DMIC in board.h 3. define CONFIG_AUDIO_CODEC_DMIC_SOFTWARE_GAIN in board.h 4. define CONFIG_AUDIO_CODEC_DMIC_MAX_SOFTWARE_GAIN in board.h 5. make BOARD=kukui_scp -j Change-Id: I38418ca9bda7973f35d35947a55cad8180eb4df0 Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1683027 Commit-Queue: Sean Abraham <seanabraham@chromium.org> Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* audio_codec: add DMIC abstract layerTzung-Bi Shih2019-09-171-0/+77
Common DMIC host commands: - get_max_gain - get_gain_idx - set_gain_idx BRANCH=none BUG=b:122027734, b:123268236 TEST=1. define CONFIG_AUDIO_CODEC in board.h 2. define CONFIG_AUDIO_CODEC_DMIC in board.h 3. make BOARD=kukui_scp -j Change-Id: I7b4cc11645675f9d790947b17c3ea385dae13483 Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1564502 Commit-Queue: Sean Abraham <seanabraham@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>