Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion include/sound/soc.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -1480,10 +1480,20 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
unsigned int *rx_mask,
unsigned int *slots,
unsigned int *slot_width);
void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
void snd_soc_of_parse_node_prefix(struct device_node *np,
struct snd_soc_codec_conf *codec_conf,
struct device_node *of_node,
const char *propname);
static inline
void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
struct snd_soc_codec_conf *codec_conf,
struct device_node *of_node,
const char *propname)
{
snd_soc_of_parse_node_prefix(card->dev->of_node,
codec_conf, of_node, propname);
}

int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
const char *propname);
unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
Expand Down
21 changes: 12 additions & 9 deletions sound/soc/codecs/rt5663.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -3525,10 +3525,11 @@ static int rt5663_i2c_probe(struct i2c_client *i2c,
for (i = 0; i < ARRAY_SIZE(rt5663->supplies); i++) {
ret = regulator_set_load(rt5663->supplies[i].consumer,
RT5663_SUPPLY_CURRENT_UA);
if (ret) {
if (ret < 0) {
dev_err(&i2c->dev,
"Failed to set regulator %s, ret: %d\n",
"Failed to set regulator load on %s, ret: %d\n",
rt5663->supplies[i].supply, ret);
return ret;
}
}

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

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

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

if (ret)
goto err_irq;
goto err_enable;

return 0;

err_irq:

/*
* Error after enabling regulators should goto err_enable
* to disable regulators.
*/
err_enable:
if (i2c->irq)
free_irq(i2c->irq, rt5663);

err_enable:
dev_err(&i2c->dev,
"%s: Disable regulator after probe error\n", __func__);
regulator_bulk_disable(ARRAY_SIZE(rt5663->supplies), rt5663->supplies);
return ret;
}
Expand Down
28 changes: 25 additions & 3 deletions sound/soc/intel/Kconfig
Original file line numberDiff line numberDiff line change
Expand Up@@ -101,30 +101,52 @@ config SND_SST_ATOM_HIFI2_PLATFORM_ACPI
codec, then enable this option by saying Y or m. This is a
recommended option

config SND_SOC_INTEL_SKYLAKE_SSP_CLK
tristate

config SND_SOC_INTEL_SKYLAKE
tristate "SKL/BXT/KBL/GLK/CNL... Platforms"
depends on PCI && ACPI
select SND_SOC_INTEL_SKYLAKE_COMMON
help
If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/
GeminiLake or CannonLake platform with the DSP enabled in the BIOS
then enable this option by saying Y or m.

if SND_SOC_INTEL_SKYLAKE

config SND_SOC_INTEL_SKYLAKE_SSP_CLK
tristate

config SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC
bool "HDAudio codec support"
help
If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/
GeminiLake or CannonLake platform with an HDaudio codec
then enable this option by saying Y

config SND_SOC_INTEL_SKYLAKE_COMMON
tristate
select SND_HDA_EXT_CORE
select SND_HDA_DSP_LOADER
select SND_SOC_TOPOLOGY
select SND_SOC_INTEL_SST
select SND_SOC_HDAC_HDA if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC
select SND_SOC_ACPI_INTEL_MATCH
help
If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/
GeminiLake or CannonLake platform with the DSP enabled in the BIOS
then enable this option by saying Y or m.

endif ## SND_SOC_INTEL_SKYLAKE

endif ## SND_SOC_INTEL_SST_TOPLEVEL

if SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL

config SND_SOC_ACPI_INTEL_MATCH
tristate
select SND_SOC_ACPI if ACPI
# this option controls the compilation of ACPI matching tables and
# helpers and is not meant to be selected by the user.

endif ## SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL


Expand Down
30 changes: 15 additions & 15 deletions sound/soc/intel/boards/Kconfig
Original file line numberDiff line numberDiff line change
Expand Up@@ -251,7 +251,7 @@ config SND_SOC_INTEL_BXT_RT298_MACH
Say Y or m if you have such a device. This is a recommended option.
If unsure select "N".

endif
endif ## SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_APOLLOLAKE

if SND_SOC_SOF_APOLLOLAKE

Expand DownExpand Up@@ -335,20 +335,6 @@ config SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH

endif ## SND_SOC_INTEL_SKYLAKE

if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_HDA_AUDIO_CODEC

config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH
tristate "SKL/KBL/BXT/APL with HDA Codecs"
select SND_SOC_HDAC_HDMI
select SND_SOC_HDAC_HDA
help
This adds support for ASoC machine driver for Intel platforms
SKL/KBL/BXT/APL with iDisp, HDA audio codecs.
Say Y or m if you have such a device. This is a recommended option.
If unsure select "N".

endif ## SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_HDA

if SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_GEMINILAKE && SND_SOC_SOF_HDA_LINK

config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH
Expand All@@ -367,4 +353,18 @@ config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH

endif ## SND_SOC_INTEL_SKYLAKE || SND_SOC_SOF_GEMINILAKE

if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC || SND_SOC_SOF_HDA_AUDIO_CODEC

config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH
tristate "SKL/KBL/BXT/APL with HDA Codecs"
select SND_SOC_HDAC_HDMI
# SND_SOC_HDAC_HDA is already selected
help
This adds support for ASoC machine driver for Intel platforms
SKL/KBL/BXT/APL with iDisp, HDA audio codecs.
Say Y or m if you have such a device. This is a recommended option.
If unsure select "N".

endif ## SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC || SND_SOC_SOF_HDA_AUDIO_CODEC

endif ## SND_SOC_INTEL_MACH
20 changes: 18 additions & 2 deletions sound/soc/intel/skylake/skl.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,7 +37,9 @@
#include "skl.h"
#include "skl-sst-dsp.h"
#include "skl-sst-ipc.h"
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
#include "../../../soc/codecs/hdac_hda.h"
#endif

/*
* initialize the PCI registers
Expand DownExpand Up@@ -661,6 +663,8 @@ static void skl_clock_device_unregister(struct skl *skl)
platform_device_unregister(skl->clk_dev);
}

#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)

#define IDISP_INTEL_VENDOR_ID 0x80860000

/*
Expand All@@ -679,6 +683,8 @@ static void load_codec_module(struct hda_codec *codec)
#endif
}

#endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */

/*
* Probe the given codec address
*/
Expand All@@ -688,9 +694,11 @@ static int probe_codec(struct hdac_bus *bus, int addr)
(AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID;
unsigned int res = -1;
struct skl *skl = bus_to_skl(bus);
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
struct hdac_hda_priv *hda_codec;
struct hdac_device *hdev;
int err;
#endif
struct hdac_device *hdev;

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

#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
hda_codec = devm_kzalloc(&skl->pci->dev, sizeof(*hda_codec),
GFP_KERNEL);
if (!hda_codec)
Expand All@@ -718,6 +727,13 @@ static int probe_codec(struct hdac_bus *bus, int addr)
load_codec_module(&hda_codec->codec);
}
return 0;
#else
hdev = devm_kzalloc(&skl->pci->dev, sizeof(*hdev), GFP_KERNEL);
if (!hdev)
return -ENOMEM;

return snd_hdac_ext_bus_device_init(bus, addr, hdev);
#endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */
}

/* Codec initialization */
Expand DownExpand Up@@ -873,7 +889,7 @@ static int skl_create(struct pci_dev *pci,
hbus = skl_to_hbus(skl);
bus = skl_to_bus(skl);

#if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDA)
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
ext_ops = snd_soc_hdac_hda_get_ops();
#endif
snd_hdac_ext_bus_init(bus, &pci->dev, &bus_core_ops, io_ops, ext_ops);
Expand Down
11 changes: 5 additions & 6 deletions sound/soc/soc-core.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -3498,12 +3498,11 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
}
EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot);

void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
struct snd_soc_codec_conf *codec_conf,
struct device_node *of_node,
const char *propname)
void snd_soc_of_parse_node_prefix(struct device_node *np,
struct snd_soc_codec_conf *codec_conf,
struct device_node *of_node,
const char *propname)
{
struct device_node *np = card->dev->of_node;
const char *str;
int ret;

Expand All@@ -3516,7 +3515,7 @@ void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
codec_conf->of_node = of_node;
codec_conf->name_prefix = str;
}
EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix);
EXPORT_SYMBOL_GPL(snd_soc_of_parse_node_prefix);

int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
const char *propname)
Expand Down