ASoC: codec: Update codec driver to component driver
Some alsa API are removed in kernel-4.19 which would cause codec driver compile failure. Update codec driver to fix it. Change-Id: Ie358ec1863082166958059c179300b453d2a03ad Signed-off-by: Meng Wang <mengw@codeaurora.org>
此提交包含在:

提交者
Gerrit - the friendly Code Review server

父節點
ee084a068e
當前提交
15c825d077
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (c) 2015, 2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015, 2017-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
@@ -152,7 +152,8 @@ static int wcdcal_hwdep_release(struct snd_hwdep *hw, struct file *file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wcd_cal_create_hwdep(void *data, int node, struct snd_soc_codec *codec)
|
||||
int wcd_cal_create_hwdep(void *data, int node,
|
||||
struct snd_soc_component *component)
|
||||
{
|
||||
char hwname[40];
|
||||
struct snd_hwdep *hwdep;
|
||||
@@ -160,23 +161,23 @@ int wcd_cal_create_hwdep(void *data, int node, struct snd_soc_codec *codec)
|
||||
struct fw_info *fw_data = data;
|
||||
int err, cal_bit;
|
||||
|
||||
if (!fw_data || !codec) {
|
||||
if (!fw_data || !component) {
|
||||
pr_err("%s: wrong arguments passed\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
fw = fw_data->fw;
|
||||
snprintf(hwname, strlen("Codec %s"), "Codec %s",
|
||||
codec->component.name);
|
||||
err = snd_hwdep_new(codec->component.card->snd_card,
|
||||
component->name);
|
||||
err = snd_hwdep_new(component->card->snd_card,
|
||||
hwname, node, &hwdep);
|
||||
if (err < 0) {
|
||||
dev_err(codec->dev, "%s: new hwdep failed %d\n",
|
||||
dev_err(component->dev, "%s: new hwdep failed %d\n",
|
||||
__func__, err);
|
||||
return err;
|
||||
}
|
||||
snprintf(hwdep->name, strlen("Codec %s"), "Codec %s",
|
||||
codec->component.name);
|
||||
component->name);
|
||||
hwdep->iface = SNDRV_HWDEP_IFACE_AUDIO_CODEC;
|
||||
hwdep->private_data = fw_data;
|
||||
hwdep->ops.ioctl_compat = wcdcal_hwdep_ioctl_compat;
|
||||
@@ -188,11 +189,8 @@ int wcd_cal_create_hwdep(void *data, int node, struct snd_soc_codec *codec)
|
||||
set_bit(WCDCAL_UNINITIALISED,
|
||||
&fw_data->wcdcal_state[cal_bit]);
|
||||
fw[cal_bit] = kzalloc(sizeof *(fw[cal_bit]), GFP_KERNEL);
|
||||
if (!fw[cal_bit]) {
|
||||
dev_err(codec->dev, "%s: no memory for %s cal\n",
|
||||
__func__, cal_name_info[cal_bit]);
|
||||
if (!fw[cal_bit])
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
for_each_set_bit(cal_bit, fw_data->cal_bit, WCD9XXX_MAX_CAL) {
|
||||
fw[cal_bit]->data = kzalloc(cal_size_info[cal_bit],
|
||||
|
新增問題並參考
封鎖使用者