Skip to content

Commit

Permalink
Merge branch 'asoc-5.2' into asoc-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
broonie committed Jul 6, 2019
2 parents 6fbc727 + 1bcc1fd commit 0dceaf7
Show file tree
Hide file tree
Showing 16 changed files with 91 additions and 29 deletions.
6 changes: 2 additions & 4 deletions sound/soc/codecs/ad193x.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,8 @@ static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai,
}

/* For DSP_*, LRCLK's polarity must be inverted */
if (fmt & SND_SOC_DAIFMT_DSP_A) {
change_bit(ffs(AD193X_DAC_LEFT_HIGH) - 1,
(unsigned long *)&dac_fmt);
}
if (fmt & SND_SOC_DAIFMT_DSP_A)
dac_fmt ^= AD193X_DAC_LEFT_HIGH;

switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM: /* codec clk & frm master */
Expand Down
31 changes: 31 additions & 0 deletions sound/soc/codecs/hdac_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,29 @@ static struct hdac_hdmi_port *hdac_hdmi_get_port_from_cvt(
return NULL;
}

/*
* Go through all converters and ensure connection is set to
* the correct pin as set via kcontrols.
*/
static void hdac_hdmi_verify_connect_sel_all_pins(struct hdac_device *hdev)
{
struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev);
struct hdac_hdmi_port *port;
struct hdac_hdmi_cvt *cvt;
int cvt_idx = 0;

list_for_each_entry(cvt, &hdmi->cvt_list, head) {
port = hdac_hdmi_get_port_from_cvt(hdev, hdmi, cvt);
if (port && port->pin) {
snd_hdac_codec_write(hdev, port->pin->nid, 0,
AC_VERB_SET_CONNECT_SEL, cvt_idx);
dev_dbg(&hdev->dev, "%s: %s set connect %d -> %d\n",
__func__, cvt->name, port->pin->nid, cvt_idx);
}
++cvt_idx;
}
}

/*
* This tries to get a valid pin and set the HW constraints based on the
* ELD. Even if a valid pin is not found return success so that device open
Expand Down Expand Up @@ -798,6 +821,14 @@ static int hdac_hdmi_cvt_output_widget_event(struct snd_soc_dapm_widget *w,
AC_VERB_SET_CHANNEL_STREAMID, pcm->stream_tag);
snd_hdac_codec_write(hdev, cvt->nid, 0,
AC_VERB_SET_STREAM_FORMAT, pcm->format);

/*
* The connection indices are shared by all converters and
* may interfere with each other. Ensure correct
* routing for all converters at stream start.
*/
hdac_hdmi_verify_connect_sel_all_pins(hdev);

break;

case SND_SOC_DAPM_POST_PMD:
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/codecs/nau8825.c
Original file line number Diff line number Diff line change
Expand Up @@ -1880,6 +1880,10 @@ static void nau8825_init_regs(struct nau8825 *nau8825)
NAU8825_JACK_EJECT_DEBOUNCE_MASK,
nau8825->jack_eject_debounce << NAU8825_JACK_EJECT_DEBOUNCE_SFT);

/* Pull up IRQ pin */
regmap_update_bits(regmap, NAU8825_REG_INTERRUPT_MASK,
NAU8825_IRQ_PIN_PULLUP | NAU8825_IRQ_PIN_PULL_EN,
NAU8825_IRQ_PIN_PULLUP | NAU8825_IRQ_PIN_PULL_EN);
/* Mask unneeded IRQs: 1 - disable, 0 - enable */
regmap_update_bits(regmap, NAU8825_REG_INTERRUPT_MASK, 0x7ff, 0x7ff);

Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/nau8825.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@
#define NAU8825_JACK_POLARITY (1 << 1) /* 0 - active low, 1 - active high */

/* INTERRUPT_MASK (0xf) */
#define NAU8825_IRQ_PIN_PULLUP (1 << 14)
#define NAU8825_IRQ_PIN_PULL_EN (1 << 13)
#define NAU8825_IRQ_OUTPUT_EN (1 << 11)
#define NAU8825_IRQ_HEADSET_COMPLETE_EN (1 << 10)
#define NAU8825_IRQ_RMS_EN (1 << 8)
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/generic/audio-graph-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,6 @@ static int graph_for_each_link(struct asoc_simple_priv *priv,
codec_ep = of_graph_get_remote_endpoint(cpu_ep);
codec_port = of_get_parent(codec_ep);

of_node_put(codec_ep);
of_node_put(codec_port);

/* get convert-xxx property */
memset(&adata, 0, sizeof(adata));
graph_parse_convert(dev, codec_ep, &adata);
Expand All @@ -457,6 +454,9 @@ static int graph_for_each_link(struct asoc_simple_priv *priv,
else
ret = func_noml(priv, cpu_ep, codec_ep, li);

of_node_put(codec_ep);
of_node_put(codec_port);

if (ret < 0)
return ret;

Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/sof_rt5682.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ static int sof_audio_probe(struct platform_device *pdev)
int dmic_num, hdmi_num;
int ret, ssp_amp, ssp_codec;

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_ATOMIC);
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

Expand Down
21 changes: 21 additions & 0 deletions sound/soc/intel/skylake/skl.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,25 @@ void skl_update_d0i3c(struct device *dev, bool enable)
snd_hdac_chip_readb(bus, VS_D0I3C));
}

/**
* skl_dum_set - set DUM bit in EM2 register
* @bus: HD-audio core bus
*
* Addresses incorrect position reporting for capture streams.
* Used on device power up.
*/
static void skl_dum_set(struct hdac_bus *bus)
{
/* For the DUM bit to be set, CRST needs to be out of reset state */
if (!(snd_hdac_chip_readb(bus, GCTL) & AZX_GCTL_RESET)) {
skl_enable_miscbdcge(bus->dev, false);
snd_hdac_bus_exit_link_reset(bus);
skl_enable_miscbdcge(bus->dev, true);
}

snd_hdac_chip_updatel(bus, VS_EM2, AZX_VS_EM2_DUM, AZX_VS_EM2_DUM);
}

/* called from IRQ */
static void skl_stream_update(struct hdac_bus *bus, struct hdac_stream *hstr)
{
Expand Down Expand Up @@ -291,6 +310,7 @@ static int _skl_resume(struct hdac_bus *bus)
struct skl *skl = bus_to_skl(bus);

skl_init_pci(skl);
skl_dum_set(bus);
skl_init_chip(bus, true);

return skl_resume_dsp(skl);
Expand Down Expand Up @@ -948,6 +968,7 @@ static int skl_first_init(struct hdac_bus *bus)

/* initialize chip */
skl_init_pci(skl);
skl_dum_set(bus);

return skl_init_chip(bus, true);
}
Expand Down
1 change: 1 addition & 0 deletions sound/soc/intel/skylake/skl.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#define DMA_TRANSMITION_START 2
#define DMA_TRANSMITION_STOP 3

#define AZX_VS_EM2_DUM BIT(23)
#define AZX_REG_VS_EM2_L1SEN BIT(13)

struct skl_dsp_resource {
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/meson/axg-tdm.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct axg_tdm_iface {

static inline bool axg_tdm_lrclk_invert(unsigned int fmt)
{
return (fmt & SND_SOC_DAIFMT_I2S) ^
return ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S) ^
!!(fmt & (SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_NB_IF));
}

Expand Down
1 change: 0 additions & 1 deletion sound/soc/meson/axg-tdmin.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ static int axg_tdmin_prepare(struct regmap *map,
break;

case SND_SOC_DAIFMT_LEFT_J:
case SND_SOC_DAIFMT_RIGHT_J:
case SND_SOC_DAIFMT_DSP_B:
break;

Expand Down
1 change: 0 additions & 1 deletion sound/soc/meson/axg-tdmout.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ static int axg_tdmout_prepare(struct regmap *map,
break;

case SND_SOC_DAIFMT_LEFT_J:
case SND_SOC_DAIFMT_RIGHT_J:
case SND_SOC_DAIFMT_DSP_B:
skew += 1;
break;
Expand Down
1 change: 1 addition & 0 deletions sound/soc/qcom/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
goto err;
}

link->nonatomic = 1;
link->dpcm_playback = 1;
link->dpcm_capture = 1;
link->stream_name = link->name;
Expand Down
20 changes: 12 additions & 8 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,10 @@ static void soc_init_component_debugfs(struct snd_soc_component *component)
component->card->debugfs_card_root);
}

if (!component->debugfs_root) {
if (IS_ERR(component->debugfs_root)) {
dev_warn(component->dev,
"ASoC: Failed to create component debugfs directory\n");
"ASoC: Failed to create component debugfs directory: %ld\n",
PTR_ERR(component->debugfs_root));
return;
}

Expand Down Expand Up @@ -212,18 +213,21 @@ static void soc_init_card_debugfs(struct snd_soc_card *card)

card->debugfs_card_root = debugfs_create_dir(card->name,
snd_soc_debugfs_root);
if (!card->debugfs_card_root) {
if (IS_ERR(card->debugfs_card_root)) {
dev_warn(card->dev,
"ASoC: Failed to create card debugfs directory\n");
"ASoC: Failed to create card debugfs directory: %ld\n",
PTR_ERR(card->debugfs_card_root));
card->debugfs_card_root = NULL;
return;
}

card->debugfs_pop_time = debugfs_create_u32("dapm_pop_time", 0644,
card->debugfs_card_root,
&card->pop_time);
if (!card->debugfs_pop_time)
if (IS_ERR(card->debugfs_pop_time))
dev_warn(card->dev,
"ASoC: Failed to create pop time debugfs file\n");
"ASoC: Failed to create pop time debugfs file: %ld\n",
PTR_ERR(card->debugfs_pop_time));
}

static void soc_cleanup_card_debugfs(struct snd_soc_card *card)
Expand Down Expand Up @@ -2837,14 +2841,12 @@ static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister)
snd_soc_dapm_shutdown(card);
snd_soc_flush_all_delayed_work(card);

mutex_lock(&client_mutex);
/* remove all components used by DAI links on this card */
for_each_comp_order(order) {
for_each_card_rtds(card, rtd) {
soc_remove_link_components(card, rtd, order);
}
}
mutex_unlock(&client_mutex);

soc_cleanup_card_resources(card);
if (!unregister)
Expand All @@ -2863,7 +2865,9 @@ static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister)
*/
int snd_soc_unregister_card(struct snd_soc_card *card)
{
mutex_lock(&client_mutex);
snd_soc_unbind_card(card, true);
mutex_unlock(&client_mutex);
dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name);

return 0;
Expand Down
18 changes: 10 additions & 8 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2155,23 +2155,25 @@ void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
{
struct dentry *d;

if (!parent)
if (!parent || IS_ERR(parent))
return;

dapm->debugfs_dapm = debugfs_create_dir("dapm", parent);

if (!dapm->debugfs_dapm) {
if (IS_ERR(dapm->debugfs_dapm)) {
dev_warn(dapm->dev,
"ASoC: Failed to create DAPM debugfs directory\n");
"ASoC: Failed to create DAPM debugfs directory %ld\n",
PTR_ERR(dapm->debugfs_dapm));
return;
}

d = debugfs_create_file("bias_level", 0444,
dapm->debugfs_dapm, dapm,
&dapm_bias_fops);
if (!d)
if (IS_ERR(d))
dev_warn(dapm->dev,
"ASoC: Failed to create bias level debugfs file\n");
"ASoC: Failed to create bias level debugfs file: %ld\n",
PTR_ERR(d));
}

static void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w)
Expand All @@ -2185,10 +2187,10 @@ static void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w)
d = debugfs_create_file(w->name, 0444,
dapm->debugfs_dapm, w,
&dapm_widget_power_fops);
if (!d)
if (IS_ERR(d))
dev_warn(w->dapm->dev,
"ASoC: Failed to create %s debugfs file\n",
w->name);
"ASoC: Failed to create %s debugfs file: %ld\n",
w->name, PTR_ERR(d));
}

static void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/ti/davinci-mcasp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
ret = edma_pcm_platform_register(&pdev->dev);
break;
case PCM_SDMA:
ret = sdma_pcm_platform_register(&pdev->dev, NULL, NULL);
ret = sdma_pcm_platform_register(&pdev->dev, "tx", "rx");
break;
default:
dev_err(&pdev->dev, "No DMA controller found (%d)\n", ret);
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/ti/omap-mcbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ static int asoc_mcbsp_probe(struct platform_device *pdev)
if (ret)
return ret;

return sdma_pcm_platform_register(&pdev->dev, NULL, NULL);
return sdma_pcm_platform_register(&pdev->dev, "tx", "rx");
}

static int asoc_mcbsp_remove(struct platform_device *pdev)
Expand Down

0 comments on commit 0dceaf7

Please sign in to comment.