We implement a helper function to get number of codecs from ACPI subsystem instead of using quirk flag in machine driver. Also refactor module interface by adding max_98390_dai_link() function. On the sof_rt5682 machine driver side, we remove the quirk flag SOF_MAX98390_TWEETER_SPEAKER_PRESENT and use the new interface of max98390 to setup dai link. Signed-off-by: Brent Lu <brent.lu@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20230731103419.2536036-2-brent.lu@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
51 lines
1.6 KiB
C
51 lines
1.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright(c) 2020 Intel Corporation.
|
|
*/
|
|
|
|
/*
|
|
* This file defines data structures used in Machine Driver for Intel
|
|
* platforms with Maxim Codecs.
|
|
*/
|
|
#ifndef __SOF_MAXIM_COMMON_H
|
|
#define __SOF_MAXIM_COMMON_H
|
|
|
|
#include <sound/soc.h>
|
|
|
|
#define MAX_98373_CODEC_DAI "max98373-aif1"
|
|
#define MAX_98373_DEV0_NAME "i2c-MX98373:00"
|
|
#define MAX_98373_DEV1_NAME "i2c-MX98373:01"
|
|
|
|
extern struct snd_soc_dai_link_component max_98373_components[2];
|
|
extern struct snd_soc_ops max_98373_ops;
|
|
extern const struct snd_soc_dapm_route max_98373_dapm_routes[];
|
|
|
|
int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd);
|
|
void max_98373_set_codec_conf(struct snd_soc_card *card);
|
|
int max_98373_trigger(struct snd_pcm_substream *substream, int cmd);
|
|
|
|
/*
|
|
* Maxim MAX98390
|
|
*/
|
|
#define MAX_98390_ACPI_HID "MX98390"
|
|
#define MAX_98390_CODEC_DAI "max98390-aif1"
|
|
#define MAX_98390_DEV0_NAME "i2c-" MAX_98390_ACPI_HID ":00"
|
|
#define MAX_98390_DEV1_NAME "i2c-" MAX_98390_ACPI_HID ":01"
|
|
#define MAX_98390_DEV2_NAME "i2c-" MAX_98390_ACPI_HID ":02"
|
|
#define MAX_98390_DEV3_NAME "i2c-" MAX_98390_ACPI_HID ":03"
|
|
|
|
void max_98390_dai_link(struct device *dev, struct snd_soc_dai_link *link);
|
|
void max_98390_set_codec_conf(struct device *dev, struct snd_soc_card *card);
|
|
|
|
/*
|
|
* Maxim MAX98357A/MAX98360A
|
|
*/
|
|
#define MAX_98357A_CODEC_DAI "HiFi"
|
|
#define MAX_98357A_DEV0_NAME "MX98357A:00"
|
|
#define MAX_98360A_DEV0_NAME "MX98360A:00"
|
|
|
|
void max_98357a_dai_link(struct snd_soc_dai_link *link);
|
|
void max_98360a_dai_link(struct snd_soc_dai_link *link);
|
|
|
|
#endif /* __SOF_MAXIM_COMMON_H */
|