mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
ASoC: intel: boards: sof_maxim_common: convert to snd_soc_dapm_xxx()
This patch converts below functions. dapm->dev -> snd_soc_dapm_to_dev() dapm->card -> snd_soc_dapm_to_card() dapm->component -> snd_soc_dapm_to_component() dapm_kcontrol_get_value() -> snd_soc_dapm_kcontrol_get_value() snd_soc_component_enable_pin() -> snd_soc_dapm_enable_pin() snd_soc_component_enable_pin_unlocked() -> snd_soc_dapm_enable_pin_unlocked() snd_soc_component_disable_pin() -> snd_soc_dapm_disable_pin() snd_soc_component_disable_pin_unlocked() -> snd_soc_dapm_disable_pin_unlocked() snd_soc_component_nc_pin() -> snd_soc_dapm_nc_pin() snd_soc_component_nc_pin_unlocked() -> snd_soc_dapm_nc_pin_unlocked() snd_soc_component_get_pin_status() -> snd_soc_dapm_get_pin_status() snd_soc_component_force_enable_pin() -> snd_soc_dapm_force_enable_pin() snd_soc_component_force_enable_pin_unlocked() -> snd_soc_dapm_force_enable_pin_unlocked() snd_soc_component_force_bias_level() -> snd_soc_dapm_force_bias_level() snd_soc_component_get_bias_level() -> snd_soc_dapm_get_bias_level() snd_soc_component_init_bias_level() -> snd_soc_dapm_init_bias_level() snd_soc_component_get_dapm() -> snd_soc_component_to_dapm() snd_soc_dapm_kcontrol_component() -> snd_soc_dapm_kcontrol_to_component() snd_soc_dapm_kcontrol_widget() -> snd_soc_dapm_kcontrol_to_widget() snd_soc_dapm_kcontrol_dapm() -> snd_soc_dapm_kcontrol_to_dapm() snd_soc_dapm_np_pin() -> snd_soc_dapm_disable_pin() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/87ikfhwgqq.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
beb865ab8e
commit
f1ead097d7
|
|
@ -201,8 +201,7 @@ static int max_98373_trigger(struct snd_pcm_substream *substream, int cmd)
|
|||
|
||||
cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
for_each_rtd_codec_dais(rtd, j, codec_dai) {
|
||||
struct snd_soc_dapm_context *dapm =
|
||||
snd_soc_component_get_dapm(cpu_dai->component);
|
||||
struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(cpu_dai->component);
|
||||
char pin_name[MAX_98373_PIN_NAME];
|
||||
|
||||
snprintf(pin_name, ARRAY_SIZE(pin_name), "%s Spk",
|
||||
|
|
@ -239,12 +238,13 @@ static const struct snd_soc_ops max_98373_ops = {
|
|||
static int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
|
||||
unsigned int num_codecs = get_num_codecs(MAX_98373_ACPI_HID);
|
||||
int ret;
|
||||
|
||||
switch (num_codecs) {
|
||||
case 2:
|
||||
ret = snd_soc_dapm_new_controls(&card->dapm, maxim_2spk_widgets,
|
||||
ret = snd_soc_dapm_new_controls(dapm, maxim_2spk_widgets,
|
||||
ARRAY_SIZE(maxim_2spk_widgets));
|
||||
if (ret) {
|
||||
dev_err(rtd->dev, "fail to add max98373 widgets, ret %d\n",
|
||||
|
|
@ -260,7 +260,7 @@ static int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = snd_soc_dapm_add_routes(&card->dapm, max_98373_dapm_routes,
|
||||
ret = snd_soc_dapm_add_routes(dapm, max_98373_dapm_routes,
|
||||
ARRAY_SIZE(max_98373_dapm_routes));
|
||||
if (ret) {
|
||||
dev_err(rtd->dev, "fail to add max98373 routes, ret %d\n",
|
||||
|
|
@ -416,13 +416,14 @@ static int max_98390_hw_params(struct snd_pcm_substream *substream,
|
|||
static int max_98390_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
|
||||
unsigned int num_codecs = get_num_codecs(MAX_98390_ACPI_HID);
|
||||
int ret;
|
||||
|
||||
switch (num_codecs) {
|
||||
case 4:
|
||||
/* add widgets/controls/dapm for tweeter speakers */
|
||||
ret = snd_soc_dapm_new_controls(&card->dapm, max_98390_tt_dapm_widgets,
|
||||
ret = snd_soc_dapm_new_controls(dapm, max_98390_tt_dapm_widgets,
|
||||
ARRAY_SIZE(max_98390_tt_dapm_widgets));
|
||||
if (ret) {
|
||||
dev_err(rtd->dev, "unable to add tweeter dapm widgets, ret %d\n",
|
||||
|
|
@ -439,7 +440,7 @@ static int max_98390_init(struct snd_soc_pcm_runtime *rtd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = snd_soc_dapm_add_routes(&card->dapm, max_98390_tt_dapm_routes,
|
||||
ret = snd_soc_dapm_add_routes(dapm, max_98390_tt_dapm_routes,
|
||||
ARRAY_SIZE(max_98390_tt_dapm_routes));
|
||||
if (ret) {
|
||||
dev_err(rtd->dev, "unable to add tweeter dapm routes, ret %d\n",
|
||||
|
|
@ -450,7 +451,7 @@ static int max_98390_init(struct snd_soc_pcm_runtime *rtd)
|
|||
fallthrough;
|
||||
case 2:
|
||||
/* add regular speakers dapm route */
|
||||
ret = snd_soc_dapm_new_controls(&card->dapm, maxim_2spk_widgets,
|
||||
ret = snd_soc_dapm_new_controls(dapm, maxim_2spk_widgets,
|
||||
ARRAY_SIZE(maxim_2spk_widgets));
|
||||
if (ret) {
|
||||
dev_err(rtd->dev, "fail to add max98390 woofer widgets, ret %d\n",
|
||||
|
|
@ -466,7 +467,7 @@ static int max_98390_init(struct snd_soc_pcm_runtime *rtd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = snd_soc_dapm_add_routes(&card->dapm, max_98390_dapm_routes,
|
||||
ret = snd_soc_dapm_add_routes(dapm, max_98390_dapm_routes,
|
||||
ARRAY_SIZE(max_98390_dapm_routes));
|
||||
if (ret) {
|
||||
dev_err(rtd->dev, "unable to add dapm routes, ret %d\n",
|
||||
|
|
@ -564,9 +565,10 @@ static struct snd_soc_dai_link_component max_98360a_components[] = {
|
|||
static int max_98357a_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
|
||||
int ret;
|
||||
|
||||
ret = snd_soc_dapm_new_controls(&card->dapm, max_98357a_dapm_widgets,
|
||||
ret = snd_soc_dapm_new_controls(dapm, max_98357a_dapm_widgets,
|
||||
ARRAY_SIZE(max_98357a_dapm_widgets));
|
||||
if (ret) {
|
||||
dev_err(rtd->dev, "unable to add dapm controls, ret %d\n", ret);
|
||||
|
|
@ -581,7 +583,7 @@ static int max_98357a_init(struct snd_soc_pcm_runtime *rtd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = snd_soc_dapm_add_routes(&card->dapm, max_98357a_dapm_routes,
|
||||
ret = snd_soc_dapm_add_routes(dapm, max_98357a_dapm_routes,
|
||||
ARRAY_SIZE(max_98357a_dapm_routes));
|
||||
|
||||
if (ret)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user