Skip to content

Commit 134a38a

Browse files
committed
Merge branch 'backport/v4.19-intel-audio' into merge/backport/v4.19-intel-audio
Conflicts in sound/soc/intel/boards/Kconfig and sound/soc/intel/Kconfig due to upstream work to make HDaudio optional
2 parents 7997672 + b0dc82f commit 134a38a

File tree

6 files changed

+86
-36
lines changed

6 files changed

+86
-36
lines changed

include/sound/soc.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1480,10 +1480,20 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
14801480
unsigned int *rx_mask,
14811481
unsigned int *slots,
14821482
unsigned int *slot_width);
1483-
void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
1483+
void snd_soc_of_parse_node_prefix(struct device_node *np,
14841484
struct snd_soc_codec_conf *codec_conf,
14851485
struct device_node *of_node,
14861486
const char *propname);
1487+
static inline
1488+
void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
1489+
struct snd_soc_codec_conf *codec_conf,
1490+
struct device_node *of_node,
1491+
const char *propname)
1492+
{
1493+
snd_soc_of_parse_node_prefix(card->dev->of_node,
1494+
codec_conf, of_node, propname);
1495+
}
1496+
14871497
int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
14881498
const char *propname);
14891499
unsigned int snd_soc_of_parse_daifmt(struct device_node *np,

sound/soc/codecs/rt5663.c

+12-9
Original file line numberDiff line numberDiff line change
@@ -3525,10 +3525,11 @@ static int rt5663_i2c_probe(struct i2c_client *i2c,
35253525
for (i = 0; i < ARRAY_SIZE(rt5663->supplies); i++) {
35263526
ret = regulator_set_load(rt5663->supplies[i].consumer,
35273527
RT5663_SUPPLY_CURRENT_UA);
3528-
if (ret) {
3528+
if (ret < 0) {
35293529
dev_err(&i2c->dev,
3530-
"Failed to set regulator %s, ret: %d\n",
3530+
"Failed to set regulator load on %s, ret: %d\n",
35313531
rt5663->supplies[i].supply, ret);
3532+
return ret;
35323533
}
35333534
}
35343535

@@ -3546,7 +3547,7 @@ static int rt5663_i2c_probe(struct i2c_client *i2c,
35463547
ret = PTR_ERR(regmap);
35473548
dev_err(&i2c->dev, "Failed to allocate temp register map: %d\n",
35483549
ret);
3549-
return ret;
3550+
goto err_enable;
35503551
}
35513552

35523553
ret = regmap_read(regmap, RT5663_VENDOR_ID_2, &val);
@@ -3579,7 +3580,7 @@ static int rt5663_i2c_probe(struct i2c_client *i2c,
35793580
ret = PTR_ERR(rt5663->regmap);
35803581
dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
35813582
ret);
3582-
return ret;
3583+
goto err_enable;
35833584
}
35843585

35853586
/* reset and calibrate */
@@ -3689,17 +3690,19 @@ static int rt5663_i2c_probe(struct i2c_client *i2c,
36893690
rt5663_dai, ARRAY_SIZE(rt5663_dai));
36903691

36913692
if (ret)
3692-
goto err_irq;
3693+
goto err_enable;
36933694

36943695
return 0;
36953696

3696-
err_irq:
3697+
3698+
/*
3699+
* Error after enabling regulators should goto err_enable
3700+
* to disable regulators.
3701+
*/
3702+
err_enable:
36973703
if (i2c->irq)
36983704
free_irq(i2c->irq, rt5663);
36993705

3700-
err_enable:
3701-
dev_err(&i2c->dev,
3702-
"%s: Disable regulator after probe error\n", __func__);
37033706
regulator_bulk_disable(ARRAY_SIZE(rt5663->supplies), rt5663->supplies);
37043707
return ret;
37053708
}

sound/soc/intel/Kconfig

+25-3
Original file line numberDiff line numberDiff line change
@@ -101,30 +101,52 @@ config SND_SST_ATOM_HIFI2_PLATFORM_ACPI
101101
codec, then enable this option by saying Y or m. This is a
102102
recommended option
103103

104-
config SND_SOC_INTEL_SKYLAKE_SSP_CLK
105-
tristate
106-
107104
config SND_SOC_INTEL_SKYLAKE
108105
tristate "SKL/BXT/KBL/GLK/CNL... Platforms"
109106
depends on PCI && ACPI
107+
select SND_SOC_INTEL_SKYLAKE_COMMON
108+
help
109+
If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/
110+
GeminiLake or CannonLake platform with the DSP enabled in the BIOS
111+
then enable this option by saying Y or m.
112+
113+
if SND_SOC_INTEL_SKYLAKE
114+
115+
config SND_SOC_INTEL_SKYLAKE_SSP_CLK
116+
tristate
117+
118+
config SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC
119+
bool "HDAudio codec support"
120+
help
121+
If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/
122+
GeminiLake or CannonLake platform with an HDaudio codec
123+
then enable this option by saying Y
124+
125+
config SND_SOC_INTEL_SKYLAKE_COMMON
126+
tristate
110127
select SND_HDA_EXT_CORE
111128
select SND_HDA_DSP_LOADER
112129
select SND_SOC_TOPOLOGY
113130
select SND_SOC_INTEL_SST
131+
select SND_SOC_HDAC_HDA if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC
114132
select SND_SOC_ACPI_INTEL_MATCH
115133
help
116134
If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/
117135
GeminiLake or CannonLake platform with the DSP enabled in the BIOS
118136
then enable this option by saying Y or m.
119137

138+
endif ## SND_SOC_INTEL_SKYLAKE
139+
120140
endif ## SND_SOC_INTEL_SST_TOPLEVEL
121141

122142
if SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL
143+
123144
config SND_SOC_ACPI_INTEL_MATCH
124145
tristate
125146
select SND_SOC_ACPI if ACPI
126147
# this option controls the compilation of ACPI matching tables and
127148
# helpers and is not meant to be selected by the user.
149+
128150
endif ## SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL
129151

130152

sound/soc/intel/boards/Kconfig

+15-15
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ config SND_SOC_INTEL_BXT_RT298_MACH
251251
Say Y or m if you have such a device. This is a recommended option.
252252
If unsure select "N".
253253

254-
endif
254+
endif ## SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_APOLLOLAKE
255255

256256
if SND_SOC_SOF_APOLLOLAKE
257257

@@ -335,20 +335,6 @@ config SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH
335335

336336
endif ## SND_SOC_INTEL_SKYLAKE
337337

338-
if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_HDA_AUDIO_CODEC
339-
340-
config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH
341-
tristate "SKL/KBL/BXT/APL with HDA Codecs"
342-
select SND_SOC_HDAC_HDMI
343-
select SND_SOC_HDAC_HDA
344-
help
345-
This adds support for ASoC machine driver for Intel platforms
346-
SKL/KBL/BXT/APL with iDisp, HDA audio codecs.
347-
Say Y or m if you have such a device. This is a recommended option.
348-
If unsure select "N".
349-
350-
endif ## SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_HDA
351-
352338
if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_GEMINILAKE && SND_SOC_SOF_HDA_LINK
353339

354340
config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH
@@ -367,4 +353,18 @@ config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH
367353

368354
endif ## SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_GEMINILAKE
369355

356+
if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC || SND_SOC_SOF_HDA_AUDIO_CODEC
357+
358+
config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH
359+
tristate "SKL/KBL/BXT/APL with HDA Codecs"
360+
select SND_SOC_HDAC_HDMI
361+
# SND_SOC_HDAC_HDA is already selected
362+
help
363+
This adds support for ASoC machine driver for Intel platforms
364+
SKL/KBL/BXT/APL with iDisp, HDA audio codecs.
365+
Say Y or m if you have such a device. This is a recommended option.
366+
If unsure select "N".
367+
368+
endif ## SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC || SND_SOC_SOF_HDA_AUDIO_CODEC
369+
370370
endif ## SND_SOC_INTEL_MACH

sound/soc/intel/skylake/skl.c

+18-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
#include "skl.h"
3838
#include "skl-sst-dsp.h"
3939
#include "skl-sst-ipc.h"
40+
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
4041
#include "../../../soc/codecs/hdac_hda.h"
42+
#endif
4143

4244
/*
4345
* initialize the PCI registers
@@ -661,6 +663,8 @@ static void skl_clock_device_unregister(struct skl *skl)
661663
platform_device_unregister(skl->clk_dev);
662664
}
663665

666+
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
667+
664668
#define IDISP_INTEL_VENDOR_ID 0x80860000
665669

666670
/*
@@ -679,6 +683,8 @@ static void load_codec_module(struct hda_codec *codec)
679683
#endif
680684
}
681685

686+
#endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */
687+
682688
/*
683689
* Probe the given codec address
684690
*/
@@ -688,9 +694,11 @@ static int probe_codec(struct hdac_bus *bus, int addr)
688694
(AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID;
689695
unsigned int res = -1;
690696
struct skl *skl = bus_to_skl(bus);
697+
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
691698
struct hdac_hda_priv *hda_codec;
692-
struct hdac_device *hdev;
693699
int err;
700+
#endif
701+
struct hdac_device *hdev;
694702

695703
mutex_lock(&bus->cmd_mutex);
696704
snd_hdac_bus_send_cmd(bus, cmd);
@@ -700,6 +708,7 @@ static int probe_codec(struct hdac_bus *bus, int addr)
700708
return -EIO;
701709
dev_dbg(bus->dev, "codec #%d probed OK: %x\n", addr, res);
702710

711+
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
703712
hda_codec = devm_kzalloc(&skl->pci->dev, sizeof(*hda_codec),
704713
GFP_KERNEL);
705714
if (!hda_codec)
@@ -718,6 +727,13 @@ static int probe_codec(struct hdac_bus *bus, int addr)
718727
load_codec_module(&hda_codec->codec);
719728
}
720729
return 0;
730+
#else
731+
hdev = devm_kzalloc(&skl->pci->dev, sizeof(*hdev), GFP_KERNEL);
732+
if (!hdev)
733+
return -ENOMEM;
734+
735+
return snd_hdac_ext_bus_device_init(bus, addr, hdev);
736+
#endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */
721737
}
722738

723739
/* Codec initialization */
@@ -873,7 +889,7 @@ static int skl_create(struct pci_dev *pci,
873889
hbus = skl_to_hbus(skl);
874890
bus = skl_to_bus(skl);
875891

876-
#if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDA)
892+
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
877893
ext_ops = snd_soc_hdac_hda_get_ops();
878894
#endif
879895
snd_hdac_ext_bus_init(bus, &pci->dev, &bus_core_ops, io_ops, ext_ops);

sound/soc/soc-core.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -3498,12 +3498,11 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
34983498
}
34993499
EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot);
35003500

3501-
void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
3502-
struct snd_soc_codec_conf *codec_conf,
3503-
struct device_node *of_node,
3504-
const char *propname)
3501+
void snd_soc_of_parse_node_prefix(struct device_node *np,
3502+
struct snd_soc_codec_conf *codec_conf,
3503+
struct device_node *of_node,
3504+
const char *propname)
35053505
{
3506-
struct device_node *np = card->dev->of_node;
35073506
const char *str;
35083507
int ret;
35093508

@@ -3516,7 +3515,7 @@ void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
35163515
codec_conf->of_node = of_node;
35173516
codec_conf->name_prefix = str;
35183517
}
3519-
EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix);
3518+
EXPORT_SYMBOL_GPL(snd_soc_of_parse_node_prefix);
35203519

35213520
int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
35223521
const char *propname)

0 commit comments

Comments
 (0)