mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-19 02:04:19 +08:00
03d0aa4d4f
The current implementation of the hdac_hda codec results in zero-valued samples on capture and noise with headset playback when SOF is used on platforms with an on-board HDaudio codec. This is root-caused to SOF using be_hw_params_fixup, and the prepare() call using invalid runtime fields to determine the format. This patch moves the format handling to the hw_params() callback, as done already for hdac_hdmi, to make sure the fixed-up information is taken into account but keeps the codec initialization in prepare() as the stream_tag is only available at that time. Moving everything in the prepare() callback is possible but the code is less elegant so this two-step solution was chosen. The solution was tested with the SST driver with no regressions, and all the issues with SOF playback and capture are solved. Signed-off-by: Rander Wang <rander.wang@linux.intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
26 lines
548 B
C
26 lines
548 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright(c) 2015-18 Intel Corporation.
|
|
*/
|
|
|
|
#ifndef __HDAC_HDA_H__
|
|
#define __HDAC_HDA_H__
|
|
|
|
struct hdac_hda_pcm {
|
|
int stream_tag[2];
|
|
unsigned int format_val[2];
|
|
};
|
|
|
|
struct hdac_hda_priv {
|
|
struct hda_codec codec;
|
|
struct hdac_hda_pcm pcm[2];
|
|
};
|
|
|
|
#define hdac_to_hda_priv(_hdac) \
|
|
container_of(_hdac, struct hdac_hda_priv, codec.core)
|
|
#define hdac_to_hda_codec(_hdac) container_of(_hdac, struct hda_codec, core)
|
|
|
|
struct hdac_ext_bus_ops *snd_soc_hdac_hda_get_ops(void);
|
|
|
|
#endif /* __HDAC_HDA_H__ */
|